dotfiles/vscode/.vscode/extensions/ms-toolsai.jupyter-renderers-1.0.18/out/client_renderer/161.bundle.js
Errol Sancaktar 5f8db31398 alacritty
2024-07-15 17:06:13 -06:00

3 lines
3.5 MiB
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*! For license information please see 161.bundle.js.LICENSE.txt */
(self.webpackChunkjupyter_renderers=self.webpackChunkjupyter_renderers||[]).push([[161],{58148:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Beaker=e.CloudDownload=e.FileDirectory=e.Book=e.FileText=e.TelescopeOcticon=e.DatabaseOcticon=e.PulseOcticon=e.GraphOcticon=e.LinkExternalOcticon=e.ChevronDownOcticon=e.TriangleRightOcticon=e.TrashOcticon=e.PinOcticon=e.DownArrowOcticon=e.CodeOcticon=e.MarkdownOcticon=e.SVGWrapper=void 0;var n,a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},i="src/index.js",o=(n=r(67294))&&n.__esModule?n:{default:n},s=e.SVGWrapper=function(t){return o.default.createElement("span",{__source:{fileName:i,lineNumber:16}},o.default.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",width:t.width,height:t.height,viewBox:t.viewBox},t.outerProps,{style:Object.assign({fill:"currentColor",display:"inline-block",verticalAlign:"text-bottom"},t.outerProps.style),__source:{fileName:i,lineNumber:17}}),t.children))};e.MarkdownOcticon=function(t){return o.default.createElement(s,{width:16,height:16,viewBox:"0 0 16 16",outerProps:t,__source:{fileName:i,lineNumber:39}},o.default.createElement("title",{__source:{fileName:i,lineNumber:40}},"Create Text Cell"),o.default.createElement("path",{fillRule:"evenodd",d:"M14.85 3H1.15C.52 3 0 3.52 0 4.15v7.69C0 12.48.52 13 1.15 13h13.69c.64 0 1.15-.52 1.15-1.15v-7.7C16 3.52 15.48 3 14.85 3zM9 11H7V8L5.5 9.92 4 8v3H2V5h2l1.5 2L7 5h2v6zm2.99.5L9.5 8H11V5h2v3h1.5l-2.51 3.5z",__source:{fileName:i,lineNumber:41}}))},e.CodeOcticon=function(t){return o.default.createElement(s,{width:14,height:16,viewBox:"0 0 14 16",outerProps:t,__source:{fileName:i,lineNumber:49}},o.default.createElement("title",{__source:{fileName:i,lineNumber:50}},"Create Code Cell"),o.default.createElement("path",{fillRule:"evenodd",d:"M9.5 3L8 4.5 11.5 8 8 11.5 9.5 13 14 8 9.5 3zm-5 0L0 8l4.5 5L6 11.5 2.5 8 6 4.5 4.5 3z",__source:{fileName:i,lineNumber:51}}))},e.DownArrowOcticon=function(t){return o.default.createElement(s,{width:10,height:16,viewBox:"0 0 10 16",outerProps:t,__source:{fileName:i,lineNumber:59}},o.default.createElement("title",{__source:{fileName:i,lineNumber:60}},"Merge Cells"),o.default.createElement("path",{fillRule:"evenodd",d:"M5 3L0 9h3v4h4V9h3z",__source:{fileName:i,lineNumber:61}}))},e.PinOcticon=function(t){return o.default.createElement(s,{width:16,height:16,viewBox:"0 0 16 16",outerProps:t,__source:{fileName:i,lineNumber:66}},o.default.createElement("title",{__source:{fileName:i,lineNumber:67}},"Pin Cell to Top"),o.default.createElement("path",{fillRule:"evenodd",d:"M10 1.2V2l.5 1L6 6H2.2c-.44 0-.67.53-.34.86L5 10l-4 5 5-4 3.14 3.14a.5.5 0 0 0 .86-.34V10l3-4.5 1 .5h.8c.44 0 .67-.53.34-.86L10.86.86a.5.5 0 0 0-.86.34z",__source:{fileName:i,lineNumber:68}}))},e.TrashOcticon=function(t){return o.default.createElement(s,{width:12,height:16,viewBox:"0 0 12 16",outerProps:t,__source:{fileName:i,lineNumber:76}},o.default.createElement("title",{__source:{fileName:i,lineNumber:77}},"Delete Cell"),o.default.createElement("path",{fillRule:"evenodd",d:"M11 2H9c0-.55-.45-1-1-1H5c-.55 0-1 .45-1 1H2c-.55 0-1 .45-1 1v1c0 .55.45 1 1 1v9c0 .55.45 1 1 1h7c.55 0 1-.45 1-1V5c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm-1 12H3V5h1v8h1V5h1v8h1V5h1v8h1V5h1v9zm1-10H2V3h9v1z",__source:{fileName:i,lineNumber:78}}))},e.TriangleRightOcticon=function(t){return o.default.createElement(s,{width:6,height:16,viewBox:"0 0 6 16",outerProps:t,__source:{fileName:i,lineNumber:86}},o.default.createElement("title",{__source:{fileName:i,lineNumber:87}},"Run Cell"),o.default.createElement("path",{fillRule:"evenodd",d:"M0 14l6-6-6-6z",__source:{fileName:i,lineNumber:88}}))},e.ChevronDownOcticon=function(t){return o.default.createElement(s,{width:10,height:16,viewBox:"0 0 10 16",outerProps:t,__source:{fileName:i,lineNumber:93}},o.default.createElement("title",{__source:{fileName:i,lineNumber:94}},"Show Additional Actions"),o.default.createElement("path",{fillRule:"evenodd",d:"M5 11L0 6l1.5-1.5L5 8.25 8.5 4.5 10 6z",__source:{fileName:i,lineNumber:95}}))},e.LinkExternalOcticon=function(t){return o.default.createElement(s,{width:12,height:16,viewBox:"0 0 12 16",outerProps:t,__source:{fileName:i,lineNumber:100}},o.default.createElement("title",{__source:{fileName:i,lineNumber:101}},"Cell Placeholder for Pinned Cell"),o.default.createElement("path",{fillRule:"evenodd",d:"M11 10h1v3c0 .55-.45 1-1 1H1c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1h3v1H1v10h10v-3zM6 2l2.25 2.25L5 7.5 6.5 9l3.25-3.25L12 8V2H6z",__source:{fileName:i,lineNumber:102}}))},e.GraphOcticon=function(t){return o.default.createElement(s,{width:16,height:16,viewBox:"0 0 16 16",outerProps:t,__source:{fileName:i,lineNumber:110}},o.default.createElement("title",{__source:{fileName:i,lineNumber:111}},"Display Bar Graph"),o.default.createElement("path",{fillRule:"evenodd",d:"M16 14v1H0V0h1v14h15zM5 13H3V8h2v5zm4 0H7V3h2v10zm4 0h-2V6h2v7z",__source:{fileName:i,lineNumber:112}}))},e.PulseOcticon=function(t){return o.default.createElement(s,{width:14,height:16,viewBox:"0 0 14 16",outerProps:t,__source:{fileName:i,lineNumber:120}},o.default.createElement("title",{__source:{fileName:i,lineNumber:121}},"Display Line Graph"),o.default.createElement("path",{fillRule:"evenodd",d:"M11.5 8L8.8 5.4 6.6 8.5 5.5 1.6 2.38 8H0v2h3.6l.9-1.8.9 5.4L9 8.5l1.6 1.5H14V8z",__source:{fileName:i,lineNumber:122}}),"/>")},e.DatabaseOcticon=function(t){return o.default.createElement(s,{width:12,height:16,viewBox:"0 0 12 16",outerProps:t,__source:{fileName:i,lineNumber:131}},o.default.createElement("title",{__source:{fileName:i,lineNumber:132}},"Display Data Table"),o.default.createElement("path",{fillRule:"evenodd",d:"M6 15c-3.31 0-6-.9-6-2v-2c0-.17.09-.34.21-.5.67.86 3 1.5 5.79 1.5s5.12-.64 5.79-1.5c.13.16.21.33.21.5v2c0 1.1-2.69 2-6 2zm0-4c-3.31 0-6-.9-6-2V7c0-.11.04-.21.09-.31.03-.06.07-.13.12-.19C.88 7.36 3.21 8 6 8s5.12-.64 5.79-1.5c.05.06.09.13.12.19.05.1.09.21.09.31v2c0 1.1-2.69 2-6 2zm0-4c-3.31 0-6-.9-6-2V3c0-1.1 2.69-2 6-2s6 .9 6 2v2c0 1.1-2.69 2-6 2zm0-5c-2.21 0-4 .45-4 1s1.79 1 4 1 4-.45 4-1-1.79-1-4-1z",__source:{fileName:i,lineNumber:133}}))},e.TelescopeOcticon=function(t){return o.default.createElement(s,{width:14,height:16,viewBox:"0 0 14 16",outerProps:t,__source:{fileName:i,lineNumber:141}},o.default.createElement("title",{__source:{fileName:i,lineNumber:142}},"Display Scatter Plot"),o.default.createElement("path",{fillRule:"evenodd",d:"M8 9l3 6h-1l-2-4v5H7v-6l-2 5H4l2-5 2-1zM7 0H6v1h1V0zM5 3H4v1h1V3zM2 1H1v1h1V1zM.63 9a.52.52 0 0 0-.16.67l.55.92c.13.23.41.31.64.2l1.39-.66-1.16-2-1.27.86.01.01zm7.89-5.39l-5.8 3.95L3.95 9.7l6.33-3.03-1.77-3.06h.01zm4.22 1.28l-1.47-2.52a.51.51 0 0 0-.72-.17l-1.2.83 1.84 3.2 1.33-.64c.27-.13.36-.44.22-.7z",__source:{fileName:i,lineNumber:143}}))},e.FileText=function(t){return o.default.createElement(s,{width:12,height:16,viewBox:"0 0 12 16",outerProps:t,__source:{fileName:i,lineNumber:151}},o.default.createElement("title",{__source:{fileName:i,lineNumber:152}},"File"),o.default.createElement("path",{d:"M6 5H2V4h4v1zM2 8h7V7H2v1zm0 2h7V9H2v1zm0 2h7v-1H2v1zm10-7.5V14c0 .55-.45 1-1 1H1c-.55 0-1-.45-1-1V2c0-.55.45-1 1-1h7.5L12 4.5zM11 5L8 2H1v12h10V5z",__source:{fileName:i,lineNumber:153}}))},e.Book=function(t){return o.default.createElement(s,{width:16,height:16,viewBox:"0 0 16 16",outerProps:t,__source:{fileName:i,lineNumber:158}},o.default.createElement("title",{__source:{fileName:i,lineNumber:159}},"Notebook"),o.default.createElement("path",{fillRule:"evenodd",d:"M3 5h4v1H3V5zm0 3h4V7H3v1zm0 2h4V9H3v1zm11-5h-4v1h4V5zm0 2h-4v1h4V7zm0 2h-4v1h4V9zm2-6v9c0 .55-.45 1-1 1H9.5l-1 1-1-1H2c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1h5.5l1 1 1-1H15c.55 0 1 .45 1 1zm-8 .5L7.5 3H2v9h6V3.5zm7-.5H9.5l-.5.5V12h6V3z",__source:{fileName:i,lineNumber:160}}))},e.FileDirectory=function(t){return o.default.createElement(s,{width:14,height:16,viewBox:"0 0 14 16",outerProps:t,__source:{fileName:i,lineNumber:168}},o.default.createElement("title",{__source:{fileName:i,lineNumber:169}},"Directory"),o.default.createElement("path",{fillRule:"evenodd",d:"M13 4H7V3c0-.66-.31-1-1-1H1c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1V5c0-.55-.45-1-1-1zM6 4H1V3h5v1z",__source:{fileName:i,lineNumber:170}}))},e.CloudDownload=function(t){return o.default.createElement(s,{width:16,height:16,viewBox:"0 0 16 16",outerProps:t,__source:{fileName:i,lineNumber:178}},o.default.createElement("title",{__source:{fileName:i,lineNumber:179}},"Cloud Download"),o.default.createElement("path",{fillRule:"evenodd",d:"M9 12h2l-3 3-3-3h2V7h2v5zm3-8c0-.44-.91-3-4.5-3C5.08 1 3 2.92 3 5 1.02 5 0 6.52 0 8c0 1.53 1 3 3 3h3V9.7H3C1.38 9.7 1.3 8.28 1.3 8c0-.17.05-1.7 1.7-1.7h1.3V5c0-1.39 1.56-2.7 3.2-2.7 2.55 0 3.13 1.55 3.2 1.8v1.2H12c.81 0 2.7.22 2.7 2.2 0 2.09-2.25 2.2-2.7 2.2h-2V11h2c2.08 0 4-1.16 4-3.5C16 5.06 14.08 4 12 4z",__source:{fileName:i,lineNumber:180}}))},e.Beaker=function(t){return o.default.createElement(s,{width:16,height:16,viewBox:"0 0 16 16",outerProps:t,__source:{fileName:i,lineNumber:188}},o.default.createElement("title",{__source:{fileName:i,lineNumber:189}},"Experimental Data Explorer"),o.default.createElement("path",{fillRule:"evenodd",d:"M14.38 14.59L11 7V3h1V2H3v1h1v4L.63 14.59A1 1 0 0 0 1.54 16h11.94c.72 0 1.2-.75.91-1.41h-.01zM3.75 10L5 7V3h5v4l1.25 3h-7.5zM8 8h1v1H8V8zM7 7H6V6h1v1zm0-3h1v1H7V4zm0-3H6V0h1v1z",__source:{fileName:i,lineNumber:190}}))}},26867:(t,e,r)=>{t.exports=function t(e,r,n){function a(o,s){if(!r[o]){if(!e[o]){if(i)return i(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var u=r[o]={exports:{}};e[o][0].call(u.exports,(function(t){return a(e[o][1][t]||t)}),u,u.exports,t,e,r,n)}return r[o].exports}for(var i=void 0,o=0;o<n.length;o++)a(n[o]);return a}({1:[function(t,e,r){var n=t("../src/lib"),a={"X,X div":"direction:ltr;font-family:'Open Sans', verdana, arial, sans-serif;margin:0;padding:0;","X input,X button":"font-family:'Open Sans', verdana, arial, sans-serif;","X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg":"overflow:hidden;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color 0.3s ease 0s;-moz-transition:background-color 0.3s ease 0s;-ms-transition:background-color 0.3s ease 0s;-o-transition:background-color 0.3s ease 0s;transition:background-color 0.3s ease 0s;","X .modebar--hover>:not(.watermark)":"opacity:0;-webkit-transition:opacity 0.3s ease 0s;-moz-transition:opacity 0.3s ease 0s;-ms-transition:opacity 0.3s ease 0s;-o-transition:opacity 0.3s ease 0s;transition:opacity 0.3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":"content:'';position:absolute;background:transparent;border:6px solid transparent;z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;","X [data-title]:after":"content:attr(data-title);background:#69738a;color:white;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid transparent;border-left-color:#69738a;margin-top:8px;margin-right:-30px;","X .select-outline":"fill:none;stroke-width:1;shape-rendering:crispEdges;","X .select-outline-1":"stroke:white;","X .select-outline-2":"stroke:black;stroke-dasharray:2px 2px;",Y:"font-family:'Open Sans';position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;","Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,0.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:0.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(var i in a){var o=i.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");n.addStyleRule(o,a[i])}},{"../src/lib":719}],2:[function(t,e,r){e.exports=t("../src/transforms/aggregate")},{"../src/transforms/aggregate":1265}],3:[function(t,e,r){e.exports=t("../src/traces/bar")},{"../src/traces/bar":864}],4:[function(t,e,r){e.exports=t("../src/traces/barpolar")},{"../src/traces/barpolar":876}],5:[function(t,e,r){e.exports=t("../src/traces/box")},{"../src/traces/box":886}],6:[function(t,e,r){e.exports=t("../src/components/calendars")},{"../src/components/calendars":591}],7:[function(t,e,r){e.exports=t("../src/traces/candlestick")},{"../src/traces/candlestick":895}],8:[function(t,e,r){e.exports=t("../src/traces/carpet")},{"../src/traces/carpet":914}],9:[function(t,e,r){e.exports=t("../src/traces/choropleth")},{"../src/traces/choropleth":928}],10:[function(t,e,r){e.exports=t("../src/traces/choroplethmapbox")},{"../src/traces/choroplethmapbox":935}],11:[function(t,e,r){e.exports=t("../src/traces/cone")},{"../src/traces/cone":941}],12:[function(t,e,r){e.exports=t("../src/traces/contour")},{"../src/traces/contour":956}],13:[function(t,e,r){e.exports=t("../src/traces/contourcarpet")},{"../src/traces/contourcarpet":967}],14:[function(t,e,r){e.exports=t("../src/core")},{"../src/core":697}],15:[function(t,e,r){e.exports=t("../src/traces/densitymapbox")},{"../src/traces/densitymapbox":977}],16:[function(t,e,r){e.exports=t("../src/transforms/filter")},{"../src/transforms/filter":1266}],17:[function(t,e,r){e.exports=t("../src/traces/funnel")},{"../src/traces/funnel":987}],18:[function(t,e,r){e.exports=t("../src/traces/funnelarea")},{"../src/traces/funnelarea":996}],19:[function(t,e,r){e.exports=t("../src/transforms/groupby")},{"../src/transforms/groupby":1267}],20:[function(t,e,r){e.exports=t("../src/traces/heatmap")},{"../src/traces/heatmap":1009}],21:[function(t,e,r){e.exports=t("../src/traces/heatmapgl")},{"../src/traces/heatmapgl":1018}],22:[function(t,e,r){e.exports=t("../src/traces/histogram")},{"../src/traces/histogram":1030}],23:[function(t,e,r){e.exports=t("../src/traces/histogram2d")},{"../src/traces/histogram2d":1036}],24:[function(t,e,r){e.exports=t("../src/traces/histogram2dcontour")},{"../src/traces/histogram2dcontour":1040}],25:[function(t,e,r){var n=t("./core");n.register([t("./bar"),t("./box"),t("./heatmap"),t("./histogram"),t("./histogram2d"),t("./histogram2dcontour"),t("./contour"),t("./scatterternary"),t("./violin"),t("./funnel"),t("./waterfall"),t("./pie"),t("./sunburst"),t("./funnelarea"),t("./scatter3d"),t("./surface"),t("./isosurface"),t("./volume"),t("./mesh3d"),t("./cone"),t("./streamtube"),t("./scattergeo"),t("./choropleth"),t("./scattergl"),t("./splom"),t("./pointcloud"),t("./heatmapgl"),t("./parcoords"),t("./parcats"),t("./scattermapbox"),t("./choroplethmapbox"),t("./densitymapbox"),t("./sankey"),t("./indicator"),t("./table"),t("./carpet"),t("./scattercarpet"),t("./contourcarpet"),t("./ohlc"),t("./candlestick"),t("./scatterpolar"),t("./scatterpolargl"),t("./barpolar")]),n.register([t("./aggregate"),t("./filter"),t("./groupby"),t("./sort")]),n.register([t("./calendars")]),e.exports=n},{"./aggregate":2,"./bar":3,"./barpolar":4,"./box":5,"./calendars":6,"./candlestick":7,"./carpet":8,"./choropleth":9,"./choroplethmapbox":10,"./cone":11,"./contour":12,"./contourcarpet":13,"./core":14,"./densitymapbox":15,"./filter":16,"./funnel":17,"./funnelarea":18,"./groupby":19,"./heatmap":20,"./heatmapgl":21,"./histogram":22,"./histogram2d":23,"./histogram2dcontour":24,"./indicator":26,"./isosurface":27,"./mesh3d":28,"./ohlc":29,"./parcats":30,"./parcoords":31,"./pie":32,"./pointcloud":33,"./sankey":34,"./scatter3d":35,"./scattercarpet":36,"./scattergeo":37,"./scattergl":38,"./scattermapbox":39,"./scatterpolar":40,"./scatterpolargl":41,"./scatterternary":42,"./sort":43,"./splom":44,"./streamtube":45,"./sunburst":46,"./surface":47,"./table":48,"./violin":49,"./volume":50,"./waterfall":51}],26:[function(t,e,r){e.exports=t("../src/traces/indicator")},{"../src/traces/indicator":1046}],27:[function(t,e,r){e.exports=t("../src/traces/isosurface")},{"../src/traces/isosurface":1052}],28:[function(t,e,r){e.exports=t("../src/traces/mesh3d")},{"../src/traces/mesh3d":1057}],29:[function(t,e,r){e.exports=t("../src/traces/ohlc")},{"../src/traces/ohlc":1062}],30:[function(t,e,r){e.exports=t("../src/traces/parcats")},{"../src/traces/parcats":1071}],31:[function(t,e,r){e.exports=t("../src/traces/parcoords")},{"../src/traces/parcoords":1081}],32:[function(t,e,r){e.exports=t("../src/traces/pie")},{"../src/traces/pie":1092}],33:[function(t,e,r){e.exports=t("../src/traces/pointcloud")},{"../src/traces/pointcloud":1101}],34:[function(t,e,r){e.exports=t("../src/traces/sankey")},{"../src/traces/sankey":1107}],35:[function(t,e,r){e.exports=t("../src/traces/scatter3d")},{"../src/traces/scatter3d":1143}],36:[function(t,e,r){e.exports=t("../src/traces/scattercarpet")},{"../src/traces/scattercarpet":1149}],37:[function(t,e,r){e.exports=t("../src/traces/scattergeo")},{"../src/traces/scattergeo":1156}],38:[function(t,e,r){e.exports=t("../src/traces/scattergl")},{"../src/traces/scattergl":1167}],39:[function(t,e,r){e.exports=t("../src/traces/scattermapbox")},{"../src/traces/scattermapbox":1176}],40:[function(t,e,r){e.exports=t("../src/traces/scatterpolar")},{"../src/traces/scatterpolar":1183}],41:[function(t,e,r){e.exports=t("../src/traces/scatterpolargl")},{"../src/traces/scatterpolargl":1189}],42:[function(t,e,r){e.exports=t("../src/traces/scatterternary")},{"../src/traces/scatterternary":1196}],43:[function(t,e,r){e.exports=t("../src/transforms/sort")},{"../src/transforms/sort":1269}],44:[function(t,e,r){e.exports=t("../src/traces/splom")},{"../src/traces/splom":1205}],45:[function(t,e,r){e.exports=t("../src/traces/streamtube")},{"../src/traces/streamtube":1213}],46:[function(t,e,r){e.exports=t("../src/traces/sunburst")},{"../src/traces/sunburst":1219}],47:[function(t,e,r){e.exports=t("../src/traces/surface")},{"../src/traces/surface":1228}],48:[function(t,e,r){e.exports=t("../src/traces/table")},{"../src/traces/table":1236}],49:[function(t,e,r){e.exports=t("../src/traces/violin")},{"../src/traces/violin":1244}],50:[function(t,e,r){e.exports=t("../src/traces/volume")},{"../src/traces/volume":1252}],51:[function(t,e,r){e.exports=t("../src/traces/waterfall")},{"../src/traces/waterfall":1260}],52:[function(t,e,r){e.exports=function(t){var e=(t=t||{}).eye||[0,0,1],r=t.center||[0,0,0],s=t.up||[0,1,0],l=t.distanceLimits||[0,1/0],u=t.mode||"turntable",c=n(),h=a(),d=i();return c.setDistanceLimits(l[0],l[1]),c.lookAt(0,e,r,s),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,e,r,s),d.setDistanceLimits(l[0],l[1]),d.lookAt(0,e,r,s),new o({turntable:c,orbit:h,matrix:d},u)};var n=t("turntable-camera-controller"),a=t("orbit-camera-controller"),i=t("matrix-camera-controller");function o(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}var s=o.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 a="var cc=this._controllerList;for(var i=0;i<cc.length;++i){cc[i]."+t[0]+"("+r.join()+")}";s[e]=Function.apply(null,r.concat(a))})),s.recalcMatrix=function(t){this._active.recalcMatrix(t)},s.getDistance=function(t){return this._active.getDistance(t)},s.getDistanceLimits=function(t){return this._active.getDistanceLimits(t)},s.lastT=function(){return this._active.lastT()},s.setMode=function(t){if(t!==this._mode){var e=this._controllerNames.indexOf(t);if(!(e<0)){var r=this._active,n=this._controllerList[e],a=Math.max(r.lastT(),n.lastT());r.recalcMatrix(a),n.setMatrix(a,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}}},s.getMode=function(){return this._mode}},{"matrix-camera-controller":433,"orbit-camera-controller":456,"turntable-camera-controller":542}],53:[function(t,e,r){var n,a;n=this,a=function(t,e,r,n,a){function i(t){return t.target.depth}function o(t,e){return t.sourceLinks.length?t.depth:e-1}function s(t){return function(){return t}}a=a&&a.hasOwnProperty("default")?a.default:a;var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function u(t,e){return h(t.source,e.source)||t.index-e.index}function c(t,e){return h(t.target,e.target)||t.index-e.index}function h(t,e){return t.partOfCycle===e.partOfCycle?t.y0-e.y0:"top"===t.circularLinkType||"bottom"===e.circularLinkType?-1:1}function d(t){return t.value}function f(t){return(t.y0+t.y1)/2}function p(t){return f(t.source)}function m(t){return f(t.target)}function g(t){return t.index}function y(t){return t.nodes}function v(t){return t.links}function _(t,e){var r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function x(t,e){return e(t)}var b=25,w=10;function M(t,e){var r=0,n=0;t.links.forEach((function(a){a.circular&&(a.source.circularLinkType||a.target.circularLinkType?a.circularLinkType=a.source.circularLinkType?a.source.circularLinkType:a.target.circularLinkType:a.circularLinkType=r<n?"top":"bottom","top"==a.circularLinkType?r+=1:n+=1,t.nodes.forEach((function(t){x(t,e)!=x(a.source,e)&&x(t,e)!=x(a.target,e)||(t.circularLinkType=a.circularLinkType)})))})),t.links.forEach((function(t){t.circular&&(t.source.circularLinkType==t.target.circularLinkType&&(t.circularLinkType=t.source.circularLinkType),W(t,e)&&(t.circularLinkType=t.source.circularLinkType))}))}function k(t){var e=Math.abs(t.y1-t.y0),r=Math.abs(t.target.x0-t.source.x1);return Math.atan(r/e)}function T(t,e){var r=0;t.sourceLinks.forEach((function(t){r=t.circular&&!W(t,e)?r+1:r}));var n=0;return t.targetLinks.forEach((function(t){n=t.circular&&!W(t,e)?n+1:n})),r+n}function L(t){var e=t.source.sourceLinks,r=0;e.forEach((function(t){r=t.circular?r+1:r}));var n=t.target.targetLinks,a=0;return n.forEach((function(t){a=t.circular?a+1:a})),!(r>1||a>1)}function A(t,e,r){return t.sort(E),t.forEach((function(n,a){var i,o,s=0;if(W(n,r)&&L(n))n.circularPathData.verticalBuffer=s+n.width/2;else{for(var l=0;l<a;l++)if(i=t[a],o=t[l],!(i.source.column<o.target.column||i.target.column>o.source.column)){var u=t[l].circularPathData.verticalBuffer+t[l].width/2+e;s=u>s?u:s}n.circularPathData.verticalBuffer=s+n.width/2}})),t}function S(t,r,a,i){var o=e.min(t.links,(function(t){return t.source.y0}));t.links.forEach((function(t){t.circular&&(t.circularPathData={})})),A(t.links.filter((function(t){return"top"==t.circularLinkType})),r,i),A(t.links.filter((function(t){return"bottom"==t.circularLinkType})),r,i),t.links.forEach((function(e){if(e.circular){if(e.circularPathData.arcRadius=e.width+w,e.circularPathData.leftNodeBuffer=5,e.circularPathData.rightNodeBuffer=5,e.circularPathData.sourceWidth=e.source.x1-e.source.x0,e.circularPathData.sourceX=e.source.x0+e.circularPathData.sourceWidth,e.circularPathData.targetX=e.target.x0,e.circularPathData.sourceY=e.y0,e.circularPathData.targetY=e.y1,W(e,i)&&L(e))e.circularPathData.leftSmallArcRadius=w+e.width/2,e.circularPathData.leftLargeArcRadius=w+e.width/2,e.circularPathData.rightSmallArcRadius=w+e.width/2,e.circularPathData.rightLargeArcRadius=w+e.width/2,"bottom"==e.circularLinkType?(e.circularPathData.verticalFullExtent=e.source.y1+b+e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.rightLargeArcRadius):(e.circularPathData.verticalFullExtent=e.source.y0-b-e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.rightLargeArcRadius);else{var s=e.source.column,l=e.circularLinkType,u=t.links.filter((function(t){return t.source.column==s&&t.circularLinkType==l}));"bottom"==e.circularLinkType?u.sort(D):u.sort(C);var c=0;u.forEach((function(t,n){t.circularLinkID==e.circularLinkID&&(e.circularPathData.leftSmallArcRadius=w+e.width/2+c,e.circularPathData.leftLargeArcRadius=w+e.width/2+n*r+c),c+=t.width})),s=e.target.column,u=t.links.filter((function(t){return t.target.column==s&&t.circularLinkType==l})),"bottom"==e.circularLinkType?u.sort(O):u.sort(P),c=0,u.forEach((function(t,n){t.circularLinkID==e.circularLinkID&&(e.circularPathData.rightSmallArcRadius=w+e.width/2+c,e.circularPathData.rightLargeArcRadius=w+e.width/2+n*r+c),c+=t.width})),"bottom"==e.circularLinkType?(e.circularPathData.verticalFullExtent=Math.max(a,e.source.y1,e.target.y1)+b+e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.rightLargeArcRadius):(e.circularPathData.verticalFullExtent=o-b-e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.rightLargeArcRadius)}e.circularPathData.leftInnerExtent=e.circularPathData.sourceX+e.circularPathData.leftNodeBuffer,e.circularPathData.rightInnerExtent=e.circularPathData.targetX-e.circularPathData.rightNodeBuffer,e.circularPathData.leftFullExtent=e.circularPathData.sourceX+e.circularPathData.leftLargeArcRadius+e.circularPathData.leftNodeBuffer,e.circularPathData.rightFullExtent=e.circularPathData.targetX-e.circularPathData.rightLargeArcRadius-e.circularPathData.rightNodeBuffer}if(e.circular)e.path=function(t){return"top"==t.circularLinkType?"M"+t.circularPathData.sourceX+" "+t.circularPathData.sourceY+" L"+t.circularPathData.leftInnerExtent+" "+t.circularPathData.sourceY+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftSmallArcRadius+" 0 0 0 "+t.circularPathData.leftFullExtent+" "+(t.circularPathData.sourceY-t.circularPathData.leftSmallArcRadius)+" L"+t.circularPathData.leftFullExtent+" "+t.circularPathData.verticalLeftInnerExtent+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftLargeArcRadius+" 0 0 0 "+t.circularPathData.leftInnerExtent+" "+t.circularPathData.verticalFullExtent+" L"+t.circularPathData.rightInnerExtent+" "+t.circularPathData.verticalFullExtent+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightLargeArcRadius+" 0 0 0 "+t.circularPathData.rightFullExtent+" "+t.circularPathData.verticalRightInnerExtent+" L"+t.circularPathData.rightFullExtent+" "+(t.circularPathData.targetY-t.circularPathData.rightSmallArcRadius)+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightSmallArcRadius+" 0 0 0 "+t.circularPathData.rightInnerExtent+" "+t.circularPathData.targetY+" L"+t.circularPathData.targetX+" "+t.circularPathData.targetY:"M"+t.circularPathData.sourceX+" "+t.circularPathData.sourceY+" L"+t.circularPathData.leftInnerExtent+" "+t.circularPathData.sourceY+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftSmallArcRadius+" 0 0 1 "+t.circularPathData.leftFullExtent+" "+(t.circularPathData.sourceY+t.circularPathData.leftSmallArcRadius)+" L"+t.circularPathData.leftFullExtent+" "+t.circularPathData.verticalLeftInnerExtent+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftLargeArcRadius+" 0 0 1 "+t.circularPathData.leftInnerExtent+" "+t.circularPathData.verticalFullExtent+" L"+t.circularPathData.rightInnerExtent+" "+t.circularPathData.verticalFullExtent+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightLargeArcRadius+" 0 0 1 "+t.circularPathData.rightFullExtent+" "+t.circularPathData.verticalRightInnerExtent+" L"+t.circularPathData.rightFullExtent+" "+(t.circularPathData.targetY+t.circularPathData.rightSmallArcRadius)+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightSmallArcRadius+" 0 0 1 "+t.circularPathData.rightInnerExtent+" "+t.circularPathData.targetY+" L"+t.circularPathData.targetX+" "+t.circularPathData.targetY}(e);else{var h=n.linkHorizontal().source((function(t){return[t.source.x0+(t.source.x1-t.source.x0),t.y0]})).target((function(t){return[t.target.x0,t.y1]}));e.path=h(e)}}))}function E(t,e){return z(t)==z(e)?"bottom"==t.circularLinkType?D(t,e):C(t,e):z(e)-z(t)}function C(t,e){return t.y0-e.y0}function D(t,e){return e.y0-t.y0}function P(t,e){return t.y1-e.y1}function O(t,e){return e.y1-t.y1}function z(t){return t.target.column-t.source.column}function I(t){return t.target.x0-t.source.x1}function R(t,e){var r=k(t),n=I(e)/Math.tan(r);return"up"==V(t)?t.y1+n:t.y1-n}function F(t,e){var r=k(t),n=I(e)/Math.tan(r);return"up"==V(t)?t.y1-n:t.y1+n}function N(t,e,r,n){t.links.forEach((function(a){if(!a.circular&&a.target.column-a.source.column>1){var i=a.source.column+1,o=a.target.column-1,s=1,l=o-i+1;for(s=1;i<=o;i++,s++)t.nodes.forEach((function(o){if(o.column==i){var u,c=s/(l+1),h=Math.pow(1-c,3),d=3*c*Math.pow(1-c,2),f=3*Math.pow(c,2)*(1-c),p=Math.pow(c,3),m=h*a.y0+d*a.y0+f*a.y1+p*a.y1,g=m-a.width/2,y=m+a.width/2;g>o.y0&&g<o.y1?(u=o.y1-g+10,u="bottom"==o.circularLinkType?u:-u,o=j(o,u,e,r),t.nodes.forEach((function(t){x(t,n)!=x(o,n)&&t.column==o.column&&Y(o,t)&&j(t,u,e,r)}))):(y>o.y0&&y<o.y1||g<o.y0&&y>o.y1)&&(u=y-o.y0+10,o=j(o,u,e,r),t.nodes.forEach((function(t){x(t,n)!=x(o,n)&&t.column==o.column&&t.y0<o.y1&&t.y1>o.y1&&j(t,u,e,r)})))}}))}}))}function Y(t,e){return t.y0>e.y0&&t.y0<e.y1||t.y1>e.y0&&t.y1<e.y1||t.y0<e.y0&&t.y1>e.y1}function j(t,e,r,n){return t.y0+e>=r&&t.y1+e<=n&&(t.y0=t.y0+e,t.y1=t.y1+e,t.targetLinks.forEach((function(t){t.y1=t.y1+e})),t.sourceLinks.forEach((function(t){t.y0=t.y0+e}))),t}function B(t,e,r,n){t.nodes.forEach((function(a){n&&a.y+(a.y1-a.y0)>e&&(a.y=a.y-(a.y+(a.y1-a.y0)-e));var i=t.links.filter((function(t){return x(t.source,r)==x(a,r)})),o=i.length;o>1&&i.sort((function(t,e){if(!t.circular&&!e.circular){if(t.target.column==e.target.column)return t.y1-e.y1;if(!U(t,e))return t.y1-e.y1;if(t.target.column>e.target.column){var r=F(e,t);return t.y1-r}if(e.target.column>t.target.column)return F(t,e)-e.y1}return t.circular&&!e.circular?"top"==t.circularLinkType?-1:1:e.circular&&!t.circular?"top"==e.circularLinkType?1:-1:t.circular&&e.circular?t.circularLinkType===e.circularLinkType&&"top"==t.circularLinkType?t.target.column===e.target.column?t.target.y1-e.target.y1:e.target.column-t.target.column:t.circularLinkType===e.circularLinkType&&"bottom"==t.circularLinkType?t.target.column===e.target.column?e.target.y1-t.target.y1:t.target.column-e.target.column:"top"==t.circularLinkType?-1:1:void 0}));var s=a.y0;i.forEach((function(t){t.y0=s+t.width/2,s+=t.width})),i.forEach((function(t,e){if("bottom"==t.circularLinkType){for(var r=e+1,n=0;r<o;r++)n+=i[r].width;t.y0=a.y1-n-t.width/2}}))}))}function H(t,e,r){t.nodes.forEach((function(e){var n=t.links.filter((function(t){return x(t.target,r)==x(e,r)})),a=n.length;a>1&&n.sort((function(t,e){if(!t.circular&&!e.circular){if(t.source.column==e.source.column)return t.y0-e.y0;if(!U(t,e))return t.y0-e.y0;if(e.source.column<t.source.column){var r=R(e,t);return t.y0-r}if(t.source.column<e.source.column)return R(t,e)-e.y0}return t.circular&&!e.circular?"top"==t.circularLinkType?-1:1:e.circular&&!t.circular?"top"==e.circularLinkType?1:-1:t.circular&&e.circular?t.circularLinkType===e.circularLinkType&&"top"==t.circularLinkType?t.source.column===e.source.column?t.source.y1-e.source.y1:t.source.column-e.source.column:t.circularLinkType===e.circularLinkType&&"bottom"==t.circularLinkType?t.source.column===e.source.column?t.source.y1-e.source.y1:e.source.column-t.source.column:"top"==t.circularLinkType?-1:1:void 0}));var i=e.y0;n.forEach((function(t){t.y1=i+t.width/2,i+=t.width})),n.forEach((function(t,r){if("bottom"==t.circularLinkType){for(var i=r+1,o=0;i<a;i++)o+=n[i].width;t.y1=e.y1-o-t.width/2}}))}))}function U(t,e){return V(t)==V(e)}function V(t){return t.y0-t.y1>0?"up":"down"}function W(t,e){return x(t.source,e)==x(t.target,e)}t.sankeyCircular=function(){var t,n,i=0,x=0,k=1,L=1,A=24,E=g,C=o,D=y,P=v,O=32,z=2,I=null;function R(){var o={nodes:D.apply(null,arguments),links:P.apply(null,arguments)};!function(t){t.nodes.forEach((function(t,e){t.index=e,t.sourceLinks=[],t.targetLinks=[]}));var e=r.map(t.nodes,E);t.links.forEach((function(t,r){t.index=r;var n=t.source,a=t.target;"object"!==(void 0===n?"undefined":l(n))&&(n=t.source=_(e,n)),"object"!==(void 0===a?"undefined":l(a))&&(a=t.target=_(e,a)),n.sourceLinks.push(t),a.targetLinks.push(t)}))}(o),function(t,e,r){var n=0;if(null===r){for(var i=[],o=0;o<t.links.length;o++){var s=t.links[o],l=s.source.index,u=s.target.index;i[l]||(i[l]=[]),i[u]||(i[u]=[]),-1===i[l].indexOf(u)&&i[l].push(u)}var c=a(i);c.sort((function(t,e){return t.length-e.length}));var h={};for(o=0;o<c.length;o++){var d=c[o].slice(-2);h[d[0]]||(h[d[0]]={}),h[d[0]][d[1]]=!0}t.links.forEach((function(t){var e=t.target.index,r=t.source.index;e===r||h[r]&&h[r][e]?(t.circular=!0,t.circularLinkID=n,n+=1):t.circular=!1}))}else t.links.forEach((function(t){t.source[r]<t.target[r]?t.circular=!1:(t.circular=!0,t.circularLinkID=n,n+=1)}))}(o,0,I),function(t){t.nodes.forEach((function(t){t.partOfCycle=!1,t.value=Math.max(e.sum(t.sourceLinks,d),e.sum(t.targetLinks,d)),t.sourceLinks.forEach((function(e){e.circular&&(t.partOfCycle=!0,t.circularLinkType=e.circularLinkType)})),t.targetLinks.forEach((function(e){e.circular&&(t.partOfCycle=!0,t.circularLinkType=e.circularLinkType)}))}))}(o),function(t){var e,r,n;for(e=t.nodes,r=[],n=0;e.length;++n,e=r,r=[])e.forEach((function(t){t.depth=n,t.sourceLinks.forEach((function(t){r.indexOf(t.target)<0&&!t.circular&&r.push(t.target)}))}));for(e=t.nodes,r=[],n=0;e.length;++n,e=r,r=[])e.forEach((function(t){t.height=n,t.targetLinks.forEach((function(t){r.indexOf(t.source)<0&&!t.circular&&r.push(t.source)}))}));t.nodes.forEach((function(t){t.column=Math.floor(C.call(null,t,n))}))}(o),M(o,E),function(a,o,s){var l=r.nest().key((function(t){return t.column})).sortKeys(e.ascending).entries(a.nodes).map((function(t){return t.values}));(function(r){if(n){var o=1/0;l.forEach((function(t){var e=L*n/(t.length+1);o=e<o?e:o})),t=o}var s=e.min(l,(function(r){return(L-x-(r.length-1)*t)/e.sum(r,d)}));s*=.3,a.links.forEach((function(t){t.width=t.value*s}));var u=function(t){var r=0,n=0,a=0,i=0,o=e.max(t.nodes,(function(t){return t.column}));return t.links.forEach((function(t){t.circular&&("top"==t.circularLinkType?r+=t.width:n+=t.width,0==t.target.column&&(i+=t.width),t.source.column==o&&(a+=t.width))})),{top:r=r>0?r+b+w:r,bottom:n=n>0?n+b+w:n,left:i=i>0?i+b+w:i,right:a=a>0?a+b+w:a}}(a),c=function(t,r){var n=e.max(t.nodes,(function(t){return t.column})),a=k-i,o=L-x,s=a/(a+r.right+r.left),l=o/(o+r.top+r.bottom);return i=i*s+r.left,k=0==r.right?k:k*s,x=x*l+r.top,L*=l,t.nodes.forEach((function(t){t.x0=i+t.column*((k-i-A)/n),t.x1=t.x0+A})),l}(a,u);s*=c,a.links.forEach((function(t){t.width=t.value*s})),l.forEach((function(t){var e=t.length;t.forEach((function(t,n){t.depth==l.length-1&&1==e||0==t.depth&&1==e?(t.y0=L/2-t.value*s,t.y1=t.y0+t.value*s):t.partOfCycle?0==T(t,r)?(t.y0=L/2+n,t.y1=t.y0+t.value*s):"top"==t.circularLinkType?(t.y0=x+n,t.y1=t.y0+t.value*s):(t.y0=L-t.value*s-n,t.y1=t.y0+t.value*s):0==u.top||0==u.bottom?(t.y0=(L-x)/e*n,t.y1=t.y0+t.value*s):(t.y0=(L-x)/2-e/2+n,t.y1=t.y0+t.value*s)}))}))})(s),y();for(var u=1,c=o;c>0;--c)g(u*=.99,s),y();function g(t,r){var n=l.length;l.forEach((function(a){var i=a.length,o=a[0].depth;a.forEach((function(a){var s;if(a.sourceLinks.length||a.targetLinks.length)if(a.partOfCycle&&T(a,r)>0);else if(0==o&&1==i)s=a.y1-a.y0,a.y0=L/2-s/2,a.y1=L/2+s/2;else if(o==n-1&&1==i)s=a.y1-a.y0,a.y0=L/2-s/2,a.y1=L/2+s/2;else{var l=e.mean(a.sourceLinks,m),u=e.mean(a.targetLinks,p),c=((l&&u?(l+u)/2:l||u)-f(a))*t;a.y0+=c,a.y1+=c}}))}))}function y(){l.forEach((function(e){var r,n,a,i=x,o=e.length;for(e.sort(h),a=0;a<o;++a)(n=i-(r=e[a]).y0)>0&&(r.y0+=n,r.y1+=n),i=r.y1+t;if((n=i-t-L)>0)for(i=r.y0-=n,r.y1-=n,a=o-2;a>=0;--a)(n=(r=e[a]).y1+t-i)>0&&(r.y0-=n,r.y1-=n),i=r.y0}))}}(o,O,E),F(o);for(var s=0;s<4;s++)B(o,L,E),H(o,0,E),N(o,x,L,E),B(o,L,E),H(o,0,E);return function(t,r,n){var a=t.nodes,i=t.links,o=!1,s=!1;if(i.forEach((function(t){"top"==t.circularLinkType?o=!0:"bottom"==t.circularLinkType&&(s=!0)})),0==o||0==s){var l=e.min(a,(function(t){return t.y0})),u=e.max(a,(function(t){return t.y1})),c=(n-r)/(u-l);a.forEach((function(t){var e=(t.y1-t.y0)*c;t.y0=(t.y0-l)*c,t.y1=t.y0+e})),i.forEach((function(t){t.y0=(t.y0-l)*c,t.y1=(t.y1-l)*c,t.width=t.width*c}))}}(o,x,L),S(o,z,L,E),o}function F(t){t.nodes.forEach((function(t){t.sourceLinks.sort(c),t.targetLinks.sort(u)})),t.nodes.forEach((function(t){var e=t.y0,r=e,n=t.y1,a=n;t.sourceLinks.forEach((function(t){t.circular?(t.y0=n-t.width/2,n-=t.width):(t.y0=e+t.width/2,e+=t.width)})),t.targetLinks.forEach((function(t){t.circular?(t.y1=a-t.width/2,a-=t.width):(t.y1=r+t.width/2,r+=t.width)}))}))}return R.nodeId=function(t){return arguments.length?(E="function"==typeof t?t:s(t),R):E},R.nodeAlign=function(t){return arguments.length?(C="function"==typeof t?t:s(t),R):C},R.nodeWidth=function(t){return arguments.length?(A=+t,R):A},R.nodePadding=function(e){return arguments.length?(t=+e,R):t},R.nodes=function(t){return arguments.length?(D="function"==typeof t?t:s(t),R):D},R.links=function(t){return arguments.length?(P="function"==typeof t?t:s(t),R):P},R.size=function(t){return arguments.length?(i=x=0,k=+t[0],L=+t[1],R):[k-i,L-x]},R.extent=function(t){return arguments.length?(i=+t[0][0],k=+t[1][0],x=+t[0][1],L=+t[1][1],R):[[i,x],[k,L]]},R.iterations=function(t){return arguments.length?(O=+t,R):O},R.circularLinkGap=function(t){return arguments.length?(z=+t,R):z},R.nodePaddingRatio=function(t){return arguments.length?(n=+t,R):n},R.sortNodes=function(t){return arguments.length?(I=t,R):I},R.update=function(t){return M(t,E),F(t),t.links.forEach((function(t){t.circular&&(t.circularLinkType=t.y0+t.y1<L?"top":"bottom",t.source.circularLinkType=t.circularLinkType,t.target.circularLinkType=t.circularLinkType)})),B(t,L,E,!1),H(t,0,E),S(t,z,L,E),t},R},t.sankeyCenter=function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?e.min(t.sourceLinks,i)-1:0},t.sankeyLeft=function(t){return t.depth},t.sankeyRight=function(t,e){return e-1-t.height},t.sankeyJustify=o,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof r&&void 0!==e?a(r,t("d3-array"),t("d3-collection"),t("d3-shape"),t("elementary-circuits-directed-graph")):a(n.d3=n.d3||{},n.d3,n.d3,n.d3,null)},{"d3-array":152,"d3-collection":153,"d3-shape":161,"elementary-circuits-directed-graph":172}],54:[function(t,e,r){var n,a;n=this,a=function(t,e,r,n){function a(t){return t.target.depth}function i(t,e){return t.sourceLinks.length?t.depth:e-1}function o(t){return function(){return t}}function s(t,e){return u(t.source,e.source)||t.index-e.index}function l(t,e){return u(t.target,e.target)||t.index-e.index}function u(t,e){return t.y0-e.y0}function c(t){return t.value}function h(t){return(t.y0+t.y1)/2}function d(t){return h(t.source)*t.value}function f(t){return h(t.target)*t.value}function p(t){return t.index}function m(t){return t.nodes}function g(t){return t.links}function y(t,e){var r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function v(t){return[t.source.x1,t.y0]}function _(t){return[t.target.x0,t.y1]}t.sankey=function(){var t=0,n=0,a=1,v=1,_=24,x=8,b=p,w=i,M=m,k=g,T=32,L=2/3;function A(){var i={nodes:M.apply(null,arguments),links:k.apply(null,arguments)};return function(t){t.nodes.forEach((function(t,e){t.index=e,t.sourceLinks=[],t.targetLinks=[]}));var e=r.map(t.nodes,b);t.links.forEach((function(t,r){t.index=r;var n=t.source,a=t.target;"object"!=typeof n&&(n=t.source=y(e,n)),"object"!=typeof a&&(a=t.target=y(e,a)),n.sourceLinks.push(t),a.targetLinks.push(t)}))}(i),function(t){t.nodes.forEach((function(t){t.value=Math.max(e.sum(t.sourceLinks,c),e.sum(t.targetLinks,c))}))}(i),function(e){var r,n,i;for(r=e.nodes,n=[],i=0;r.length;++i,r=n,n=[])r.forEach((function(t){t.depth=i,t.sourceLinks.forEach((function(t){n.indexOf(t.target)<0&&n.push(t.target)}))}));for(r=e.nodes,n=[],i=0;r.length;++i,r=n,n=[])r.forEach((function(t){t.height=i,t.targetLinks.forEach((function(t){n.indexOf(t.source)<0&&n.push(t.source)}))}));var o=(a-t-_)/(i-1);e.nodes.forEach((function(e){e.x1=(e.x0=t+Math.max(0,Math.min(i-1,Math.floor(w.call(null,e,i))))*o)+_}))}(i),function(t){var a=r.nest().key((function(t){return t.x0})).sortKeys(e.ascending).entries(t.nodes).map((function(t){return t.values}));(function(){var r=e.max(a,(function(t){return t.length})),i=L*(v-n)/(r-1);x>i&&(x=i);var o=e.min(a,(function(t){return(v-n-(t.length-1)*x)/e.sum(t,c)}));a.forEach((function(t){t.forEach((function(t,e){t.y1=(t.y0=e)+t.value*o}))})),t.links.forEach((function(t){t.width=t.value*o}))})(),p();for(var i=1,o=T;o>0;--o)l(i*=.99),p(),s(i),p();function s(t){a.forEach((function(r){r.forEach((function(r){if(r.targetLinks.length){var n=(e.sum(r.targetLinks,d)/e.sum(r.targetLinks,c)-h(r))*t;r.y0+=n,r.y1+=n}}))}))}function l(t){a.slice().reverse().forEach((function(r){r.forEach((function(r){if(r.sourceLinks.length){var n=(e.sum(r.sourceLinks,f)/e.sum(r.sourceLinks,c)-h(r))*t;r.y0+=n,r.y1+=n}}))}))}function p(){a.forEach((function(t){var e,r,a,i=n,o=t.length;for(t.sort(u),a=0;a<o;++a)(r=i-(e=t[a]).y0)>0&&(e.y0+=r,e.y1+=r),i=e.y1+x;if((r=i-x-v)>0)for(i=e.y0-=r,e.y1-=r,a=o-2;a>=0;--a)(r=(e=t[a]).y1+x-i)>0&&(e.y0-=r,e.y1-=r),i=e.y0}))}}(i),S(i),i}function S(t){t.nodes.forEach((function(t){t.sourceLinks.sort(l),t.targetLinks.sort(s)})),t.nodes.forEach((function(t){var e=t.y0,r=e;t.sourceLinks.forEach((function(t){t.y0=e+t.width/2,e+=t.width})),t.targetLinks.forEach((function(t){t.y1=r+t.width/2,r+=t.width}))}))}return A.update=function(t){return S(t),t},A.nodeId=function(t){return arguments.length?(b="function"==typeof t?t:o(t),A):b},A.nodeAlign=function(t){return arguments.length?(w="function"==typeof t?t:o(t),A):w},A.nodeWidth=function(t){return arguments.length?(_=+t,A):_},A.nodePadding=function(t){return arguments.length?(x=+t,A):x},A.nodes=function(t){return arguments.length?(M="function"==typeof t?t:o(t),A):M},A.links=function(t){return arguments.length?(k="function"==typeof t?t:o(t),A):k},A.size=function(e){return arguments.length?(t=n=0,a=+e[0],v=+e[1],A):[a-t,v-n]},A.extent=function(e){return arguments.length?(t=+e[0][0],a=+e[1][0],n=+e[0][1],v=+e[1][1],A):[[t,n],[a,v]]},A.iterations=function(t){return arguments.length?(T=+t,A):T},A},t.sankeyCenter=function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?e.min(t.sourceLinks,a)-1:0},t.sankeyLeft=function(t){return t.depth},t.sankeyRight=function(t,e){return e-1-t.height},t.sankeyJustify=i,t.sankeyLinkHorizontal=function(){return n.linkHorizontal().source(v).target(_)},Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof r&&void 0!==e?a(r,t("d3-array"),t("d3-collection"),t("d3-shape")):a(n.d3=n.d3||{},n.d3,n.d3,n.d3)},{"d3-array":152,"d3-collection":153,"d3-shape":161}],55:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0});var n=t("@turf/meta"),a=6378137;function i(t){var e=0;if(t&&t.length>0){e+=Math.abs(o(t[0]));for(var r=1;r<t.length;r++)e-=Math.abs(o(t[r]))}return e}function o(t){var e,r,n,i,o,l,u=0,c=t.length;if(c>2){for(l=0;l<c;l++)l===c-2?(n=c-2,i=c-1,o=0):l===c-1?(n=c-1,i=0,o=1):(n=l,i=l+1,o=l+2),e=t[n],r=t[i],u+=(s(t[o][0])-s(e[0]))*Math.sin(s(r[1]));u=u*a*a/2}return u}function s(t){return t*Math.PI/180}r.default=function(t){return n.geomReduce(t,(function(t,e){return t+function(t){var e,r=0;switch(t.type){case"Polygon":return i(t.coordinates);case"MultiPolygon":for(e=0;e<t.coordinates.length;e++)r+=i(t.coordinates[e]);return r;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}(e)}),0)}},{"@turf/meta":58}],56:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0});var n=t("@turf/meta"),a=t("@turf/helpers");r.default=function(t,e){void 0===e&&(e={});var r=0,i=0,o=0;return n.coordEach(t,(function(t){r+=t[0],i+=t[1],o++})),a.point([r/o,i/o],e.properties)}},{"@turf/helpers":57,"@turf/meta":58}],57:[function(t,e,r){function n(t,e,r){void 0===r&&(r={});var n={type:"Feature"};return(0===r.id||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=e||{},n.geometry=t,n}function a(t,e,r){return void 0===r&&(r={}),n({type:"Point",coordinates:t},e,r)}function i(t,e,r){void 0===r&&(r={});for(var a=0,i=t;a<i.length;a++){var o=i[a];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}return n({type:"Polygon",coordinates:t},e,r)}function o(t,e,r){if(void 0===r&&(r={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");return n({type:"LineString",coordinates:t},e,r)}function s(t,e){void 0===e&&(e={});var r={type:"FeatureCollection"};return e.id&&(r.id=e.id),e.bbox&&(r.bbox=e.bbox),r.features=t,r}function l(t,e,r){return void 0===r&&(r={}),n({type:"MultiLineString",coordinates:t},e,r)}function u(t,e,r){return void 0===r&&(r={}),n({type:"MultiPoint",coordinates:t},e,r)}function c(t,e,r){return void 0===r&&(r={}),n({type:"MultiPolygon",coordinates:t},e,r)}function h(t,e){void 0===e&&(e="kilometers");var n=r.factors[e];if(!n)throw new Error(e+" units is invalid");return t*n}function d(t,e){void 0===e&&(e="kilometers");var n=r.factors[e];if(!n)throw new Error(e+" units is invalid");return t/n}function f(t){return t%(2*Math.PI)*180/Math.PI}function p(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)&&!/^\s*$/.test(t)}Object.defineProperty(r,"__esModule",{value:!0}),r.earthRadius=6371008.8,r.factors={centimeters:100*r.earthRadius,centimetres:100*r.earthRadius,degrees:r.earthRadius/111325,feet:3.28084*r.earthRadius,inches:39.37*r.earthRadius,kilometers:r.earthRadius/1e3,kilometres:r.earthRadius/1e3,meters:r.earthRadius,metres:r.earthRadius,miles:r.earthRadius/1609.344,millimeters:1e3*r.earthRadius,millimetres:1e3*r.earthRadius,nauticalmiles:r.earthRadius/1852,radians:1,yards:r.earthRadius/1.0936},r.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/r.earthRadius,yards:1/1.0936},r.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046},r.feature=n,r.geometry=function(t,e,r){switch(void 0===r&&(r={}),t){case"Point":return a(e).geometry;case"LineString":return o(e).geometry;case"Polygon":return i(e).geometry;case"MultiPoint":return u(e).geometry;case"MultiLineString":return l(e).geometry;case"MultiPolygon":return c(e).geometry;default:throw new Error(t+" is invalid")}},r.point=a,r.points=function(t,e,r){return void 0===r&&(r={}),s(t.map((function(t){return a(t,e)})),r)},r.polygon=i,r.polygons=function(t,e,r){return void 0===r&&(r={}),s(t.map((function(t){return i(t,e)})),r)},r.lineString=o,r.lineStrings=function(t,e,r){return void 0===r&&(r={}),s(t.map((function(t){return o(t,e)})),r)},r.featureCollection=s,r.multiLineString=l,r.multiPoint=u,r.multiPolygon=c,r.geometryCollection=function(t,e,r){return void 0===r&&(r={}),n({type:"GeometryCollection",geometries:t},e,r)},r.round=function(t,e){if(void 0===e&&(e=0),e&&!(e>=0))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r},r.radiansToLength=h,r.lengthToRadians=d,r.lengthToDegrees=function(t,e){return f(d(t,e))},r.bearingToAzimuth=function(t){var e=t%360;return e<0&&(e+=360),e},r.radiansToDegrees=f,r.degreesToRadians=function(t){return t%360*Math.PI/180},r.convertLength=function(t,e,r){if(void 0===e&&(e="kilometers"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("length must be a positive number");return h(d(t,e),r)},r.convertArea=function(t,e,n){if(void 0===e&&(e="meters"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("area must be a positive number");var a=r.areaFactors[e];if(!a)throw new Error("invalid original units");var i=r.areaFactors[n];if(!i)throw new Error("invalid final units");return t/a*i},r.isNumber=p,r.isObject=function(t){return!!t&&t.constructor===Object},r.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!p(t))throw new Error("bbox must only contain numbers")}))},r.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")},r.radians2degrees=function(){throw new Error("method has been renamed to `radiansToDegrees`")},r.degrees2radians=function(){throw new Error("method has been renamed to `degreesToRadians`")},r.distanceToDegrees=function(){throw new Error("method has been renamed to `lengthToDegrees`")},r.distanceToRadians=function(){throw new Error("method has been renamed to `lengthToRadians`")},r.radiansToDistance=function(){throw new Error("method has been renamed to `radiansToLength`")},r.bearingToAngle=function(){throw new Error("method has been renamed to `bearingToAzimuth`")},r.convertDistance=function(){throw new Error("method has been renamed to `convertLength`")}},{}],58:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0});var n=t("@turf/helpers");function a(t,e,r){if(null!==t)for(var n,i,o,s,l,u,c,h,d=0,f=0,p=t.type,m="FeatureCollection"===p,g="Feature"===p,y=m?t.features.length:1,v=0;v<y;v++){l=(h=!!(c=m?t.features[v].geometry:g?t.geometry:t)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var _=0;_<l;_++){var x=0,b=0;if(null!==(s=h?c.geometries[_]:c)){u=s.coordinates;var w=s.type;switch(d=!r||"Polygon"!==w&&"MultiPolygon"!==w?0:1,w){case null:break;case"Point":if(!1===e(u,f,v,x,b))return!1;f++,x++;break;case"LineString":case"MultiPoint":for(n=0;n<u.length;n++){if(!1===e(u[n],f,v,x,b))return!1;f++,"MultiPoint"===w&&x++}"LineString"===w&&x++;break;case"Polygon":case"MultiLineString":for(n=0;n<u.length;n++){for(i=0;i<u[n].length-d;i++){if(!1===e(u[n][i],f,v,x,b))return!1;f++}"MultiLineString"===w&&x++,"Polygon"===w&&b++}"Polygon"===w&&x++;break;case"MultiPolygon":for(n=0;n<u.length;n++){for(b=0,i=0;i<u[n].length;i++){for(o=0;o<u[n][i].length-d;o++){if(!1===e(u[n][i][o],f,v,x,b))return!1;f++}b++}x++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(!1===a(s.geometries[n],e,r))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function i(t,e){var r;switch(t.type){case"FeatureCollection":for(r=0;r<t.features.length&&!1!==e(t.features[r].properties,r);r++);break;case"Feature":e(t.properties,0)}}function o(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var r=0;r<t.features.length&&!1!==e(t.features[r],r);r++);}function s(t,e){var r,n,a,i,o,s,l,u,c,h,d=0,f="FeatureCollection"===t.type,p="Feature"===t.type,m=f?t.features.length:1;for(r=0;r<m;r++){for(s=f?t.features[r].geometry:p?t.geometry:t,u=f?t.features[r].properties:p?t.properties:{},c=f?t.features[r].bbox:p?t.bbox:void 0,h=f?t.features[r].id:p?t.id:void 0,o=(l=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,a=0;a<o;a++)if(null!==(i=l?s.geometries[a]:s))switch(i.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(i,d,u,c,h))return!1;break;case"GeometryCollection":for(n=0;n<i.geometries.length;n++)if(!1===e(i.geometries[n],d,u,c,h))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,d,u,c,h))return!1;d++}}function l(t,e){s(t,(function(t,r,a,i,o){var s,l=null===t?null:t.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return!1!==e(n.feature(t,a,{bbox:i,id:o}),r,0)&&void 0}switch(l){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}for(var u=0;u<t.coordinates.length;u++){var c={type:s,coordinates:t.coordinates[u]};if(!1===e(n.feature(c,a),r,u))return!1}}))}function u(t,e){l(t,(function(t,r,i){var o=0;if(t.geometry){var s=t.geometry.type;if("Point"!==s&&"MultiPoint"!==s){var l,u=0,c=0,h=0;return!1!==a(t,(function(a,s,d,f,p){if(void 0===l||r>u||f>c||p>h)return l=a,u=r,c=f,h=p,void(o=0);var m=n.lineString([l,a],t.properties);if(!1===e(m,r,i,p,o))return!1;o++,l=a}))&&void 0}}}))}function c(t,e){if(!t)throw new Error("geojson is required");l(t,(function(t,r,a){if(null!==t.geometry){var i=t.geometry.type,o=t.geometry.coordinates;switch(i){case"LineString":if(!1===e(t,r,a,0,0))return!1;break;case"Polygon":for(var s=0;s<o.length;s++)if(!1===e(n.lineString(o[s],t.properties),r,a,s))return!1}}}))}r.coordEach=a,r.coordReduce=function(t,e,r,n){var i=r;return a(t,(function(t,n,a,o,s){i=0===n&&void 0===r?t:e(i,t,n,a,o,s)}),n),i},r.propEach=i,r.propReduce=function(t,e,r){var n=r;return i(t,(function(t,a){n=0===a&&void 0===r?t:e(n,t,a)})),n},r.featureEach=o,r.featureReduce=function(t,e,r){var n=r;return o(t,(function(t,a){n=0===a&&void 0===r?t:e(n,t,a)})),n},r.coordAll=function(t){var e=[];return a(t,(function(t){e.push(t)})),e},r.geomEach=s,r.geomReduce=function(t,e,r){var n=r;return s(t,(function(t,a,i,o,s){n=0===a&&void 0===r?t:e(n,t,a,i,o,s)})),n},r.flattenEach=l,r.flattenReduce=function(t,e,r){var n=r;return l(t,(function(t,a,i){n=0===a&&0===i&&void 0===r?t:e(n,t,a,i)})),n},r.segmentEach=u,r.segmentReduce=function(t,e,r){var n=r,a=!1;return u(t,(function(t,i,o,s,l){n=!1===a&&void 0===r?t:e(n,t,i,o,s,l),a=!0})),n},r.lineEach=c,r.lineReduce=function(t,e,r){var n=r;return c(t,(function(t,a,i,o){n=0===a&&void 0===r?t:e(n,t,a,i,o)})),n},r.findSegment=function(t,e){if(e=e||{},!n.isObject(e))throw new Error("options is invalid");var r,a=e.featureIndex||0,i=e.multiFeatureIndex||0,o=e.geometryIndex||0,s=e.segmentIndex||0,l=e.properties;switch(t.type){case"FeatureCollection":a<0&&(a=t.features.length+a),l=l||t.features[a].properties,r=t.features[a].geometry;break;case"Feature":l=l||t.properties,r=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":r=t;break;default:throw new Error("geojson is invalid")}if(null===r)return null;var u=r.coordinates;switch(r.type){case"Point":case"MultiPoint":return null;case"LineString":return s<0&&(s=u.length+s-1),n.lineString([u[s],u[s+1]],l,e);case"Polygon":return o<0&&(o=u.length+o),s<0&&(s=u[o].length+s-1),n.lineString([u[o][s],u[o][s+1]],l,e);case"MultiLineString":return i<0&&(i=u.length+i),s<0&&(s=u[i].length+s-1),n.lineString([u[i][s],u[i][s+1]],l,e);case"MultiPolygon":return i<0&&(i=u.length+i),o<0&&(o=u[i].length+o),s<0&&(s=u[i][o].length-s-1),n.lineString([u[i][o][s],u[i][o][s+1]],l,e)}throw new Error("geojson is invalid")},r.findPoint=function(t,e){if(e=e||{},!n.isObject(e))throw new Error("options is invalid");var r,a=e.featureIndex||0,i=e.multiFeatureIndex||0,o=e.geometryIndex||0,s=e.coordIndex||0,l=e.properties;switch(t.type){case"FeatureCollection":a<0&&(a=t.features.length+a),l=l||t.features[a].properties,r=t.features[a].geometry;break;case"Feature":l=l||t.properties,r=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":r=t;break;default:throw new Error("geojson is invalid")}if(null===r)return null;var u=r.coordinates;switch(r.type){case"Point":return n.point(u,l,e);case"MultiPoint":return i<0&&(i=u.length+i),n.point(u[i],l,e);case"LineString":return s<0&&(s=u.length+s),n.point(u[s],l,e);case"Polygon":return o<0&&(o=u.length+o),s<0&&(s=u[o].length+s),n.point(u[o][s],l,e);case"MultiLineString":return i<0&&(i=u.length+i),s<0&&(s=u[i].length+s),n.point(u[i][s],l,e);case"MultiPolygon":return i<0&&(i=u.length+i),o<0&&(o=u[i].length+o),s<0&&(s=u[i][o].length-s),n.point(u[i][o][s],l,e)}throw new Error("geojson is invalid")}},{"@turf/helpers":57}],59:[function(t,e,r){var n="undefined"==typeof WeakMap?t("weak-map"):WeakMap,a=t("gl-buffer"),i=t("gl-vao"),o=new n;e.exports=function(t){var e=o.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=i(t,[{buffer:n,type:t.FLOAT,size:2}]))._triangleBuffer=n,o.set(t,e)}e.bind(),t.drawArrays(t.TRIANGLES,0,3),e.unbind()}},{"gl-buffer":241,"gl-vao":327,"weak-map":552}],60:[function(t,e,r){e.exports=function(t){var e=0,r=0,n=0,a=0;return t.map((function(t){var i=(t=t.slice())[0],o=i.toUpperCase();if(i!=o)switch(t[0]=o,i){case"a":t[6]+=n,t[7]+=a;break;case"v":t[1]+=a;break;case"h":t[1]+=n;break;default:for(var s=1;s<t.length;)t[s++]+=n,t[s++]+=a}switch(o){case"Z":n=e,a=r;break;case"H":n=t[1];break;case"V":a=t[1];break;case"M":n=e=t[1],a=r=t[2];break;default:n=t[t.length-2],a=t[t.length-1]}return t}))}},{}],61:[function(t,e,r){var n=t("pad-left");e.exports=function(t,e,r){e="number"==typeof e?e:1,r=r||": ";var a=t.split(/\r?\n/),i=String(a.length+e-1).length;return a.map((function(t,a){var o=a+e,s=String(o).length;return n(o,i-s)+r+t})).join("\n")}},{"pad-left":457}],62:[function(t,e,r){e.exports=function(t){var e=t.length;if(0===e)return[];if(1===e)return[0];for(var r=t[0].length,n=[t[0]],i=[0],o=1;o<e;++o)if(n.push(t[o]),a(n,r)){if(i.push(o),i.length===r+1)return i}else n.pop();return i};var n=t("robust-orientation");function a(t,e){for(var r=new Array(e+1),a=0;a<t.length;++a)r[a]=t[a];for(a=0;a<=t.length;++a){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-a,s);r[i]=o}if(n.apply(void 0,r))return!0}return!1}},{"robust-orientation":510}],63:[function(t,e,r){e.exports=function(t,e){return n(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}))};var n=t("delaunay-triangulate"),a=t("circumradius")},{circumradius:114,"delaunay-triangulate":165}],64:[function(t,e,r){e.exports=function(t,e){return a(n(t,e))};var n=t("alpha-complex"),a=t("simplicial-complex-boundary")},{"alpha-complex":63,"simplicial-complex-boundary":517}],65:[function(t,e,r){e.exports=function(t,e){if(!t||null==t.length)throw Error("Argument should be an array");e=null==e?1:Math.floor(e);for(var r=Array(2*e),n=0;n<e;n++){for(var a=-1/0,i=1/0,o=n,s=t.length;o<s;o+=e)t[o]>a&&(a=t[o]),t[o]<i&&(i=t[o]);r[n]=i,r[e+n]=a}return r}},{}],66:[function(t,e,r){var n=t("array-bounds");e.exports=function(t,e,r){if(!t||null==t.length)throw Error("Argument should be an array");null==e&&(e=1),null==r&&(r=n(t,e));for(var a=0;a<e;a++){var i=r[e+a],o=r[a],s=a,l=t.length;if(i===1/0&&o===-1/0)for(s=a;s<l;s+=e)t[s]=t[s]===i?1:t[s]===o?0:.5;else if(i===1/0)for(s=a;s<l;s+=e)t[s]=t[s]===i?1:0;else if(o===-1/0)for(s=a;s<l;s+=e)t[s]=t[s]===o?0:1;else{var u=i-o;for(s=a;s<l;s+=e)t[s]=0===u?.5:(t[s]-o)/u}}return t}},{"array-bounds":65}],67:[function(t,e,r){e.exports=function(t,e){var r="number"==typeof t,n="number"==typeof e;r&&!n?(e=t,t=0):r||n||(t=0,e=0);var a=(e|=0)-(t|=0);if(a<0)throw new Error("array length must be positive");for(var i=new Array(a),o=0,s=t;o<a;o++,s++)i[o]=s;return i}},{}],68:[function(t,e,n){(function(r){var n=t("object-assign");function a(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,a=0,i=Math.min(r,n);a<i;++a)if(t[a]!==e[a]){r=t[a],n=e[a];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)}var o=t("util/"),s=Object.prototype.hasOwnProperty,l=Array.prototype.slice,u="foo"===function(){}.name;function c(t){return Object.prototype.toString.call(t)}function h(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)))}var d=e.exports=v,f=/\s*function\s+([^\(\s]*)\s*/;function p(t){if(o.isFunction(t)){if(u)return t.name;var e=t.toString().match(f);return e&&e[1]}}function m(t,e){return"string"==typeof t?t.length<e?t:t.slice(0,e):t}function g(t){if(u||!o.isFunction(t))return o.inspect(t);var e=p(t);return"[Function"+(e?": "+e:"")+"]"}function y(t,e,r,n,a){throw new d.AssertionError({message:r,actual:t,expected:e,operator:n,stackStartFunction:a})}function v(t,e){t||y(t,!0,e,"==",d.ok)}function _(t,e,r,n){if(t===e)return!0;if(i(t)&&i(e))return 0===a(t,e);if(o.isDate(t)&&o.isDate(e))return t.getTime()===e.getTime();if(o.isRegExp(t)&&o.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(h(t)&&h(e)&&c(t)===c(e)&&!(t instanceof Float32Array||t instanceof Float64Array))return 0===a(new Uint8Array(t.buffer),new Uint8Array(e.buffer));if(i(t)!==i(e))return!1;var s=(n=n||{actual:[],expected:[]}).actual.indexOf(t);return-1!==s&&s===n.expected.indexOf(e)||(n.actual.push(t),n.expected.push(e),function(t,e,r,n){if(null==t||null==e)return!1;if(o.isPrimitive(t)||o.isPrimitive(e))return t===e;if(r&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;var a=x(t),i=x(e);if(a&&!i||!a&&i)return!1;if(a)return _(t=l.call(t),e=l.call(e),r);var s,u,c=M(t),h=M(e);if(c.length!==h.length)return!1;for(c.sort(),h.sort(),u=c.length-1;u>=0;u--)if(c[u]!==h[u])return!1;for(u=c.length-1;u>=0;u--)if(!_(t[s=c[u]],e[s],r,n))return!1;return!0}(t,e,r,n))}return r?t===e:t==e}function x(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function b(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)&&!0===e.call({},t)}function w(t,e,r,n){var a;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),a=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!a&&y(a,r,"Missing expected exception"+n);var i="string"==typeof n,s=!t&&a&&!r;if((!t&&o.isError(a)&&i&&b(a,r)||s)&&y(a,r,"Got unwanted exception"+n),t&&a&&r&&!b(a,r)||!t&&a)throw a}d.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=m(g(this.actual),128)+" "+this.operator+" "+m(g(this.expected),128),this.generatedMessage=!0);var e=t.stackStartFunction||y;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,a=p(e),i=n.indexOf("\n"+a);if(i>=0){var o=n.indexOf("\n",i+1);n=n.substring(o+1)}this.stack=n}}},o.inherits(d.AssertionError,Error),d.fail=y,d.ok=v,d.equal=function(t,e,r){t!=e&&y(t,e,r,"==",d.equal)},d.notEqual=function(t,e,r){t==e&&y(t,e,r,"!=",d.notEqual)},d.deepEqual=function(t,e,r){_(t,e,!1)||y(t,e,r,"deepEqual",d.deepEqual)},d.deepStrictEqual=function(t,e,r){_(t,e,!0)||y(t,e,r,"deepStrictEqual",d.deepStrictEqual)},d.notDeepEqual=function(t,e,r){_(t,e,!1)&&y(t,e,r,"notDeepEqual",d.notDeepEqual)},d.notDeepStrictEqual=function t(e,r,n){_(e,r,!0)&&y(e,r,n,"notDeepStrictEqual",t)},d.strictEqual=function(t,e,r){t!==e&&y(t,e,r,"===",d.strictEqual)},d.notStrictEqual=function(t,e,r){t===e&&y(t,e,r,"!==",d.notStrictEqual)},d.throws=function(t,e,r){w(!0,t,e,r)},d.doesNotThrow=function(t,e,r){w(!1,t,e,r)},d.ifError=function(t){if(t)throw t},d.strict=n((function t(e,r){e||y(e,!0,r,"==",t)}),d,{equal:d.strictEqual,deepEqual:d.deepStrictEqual,notEqual:d.notStrictEqual,notDeepEqual:d.notDeepStrictEqual}),d.strict.strict=d.strict;var M=Object.keys||function(t){var e=[];for(var r in t)s.call(t,r)&&e.push(r);return e}}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"object-assign":454,"util/":71}],69:[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}},{}],70:[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}},{}],71:[function(t,e,n){(function(e,r){var a=/%[sdj%]/g;n.format=function(t){if(!y(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(s(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,i=n.length,o=String(t).replace(a,(function(t){if("%%"===t)return"%";if(r>=i)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}})),l=n[r];r<i;l=n[++r])m(l)||!x(l)?o+=" "+l:o+=" "+s(l);return o},n.deprecate=function(t,a){if(v(r.process))return function(){return n.deprecate(t,a).apply(this,arguments)};if(!0===e.noDeprecation)return t;var i=!1;return function(){if(!i){if(e.throwDeprecation)throw new Error(a);e.traceDeprecation?console.trace(a):console.error(a),i=!0}return t.apply(this,arguments)}};var i,o={};function s(t,e){var r={seen:[],stylize:u};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),p(e)?r.showHidden=e:e&&n._extend(r,e),v(r.showHidden)&&(r.showHidden=!1),v(r.depth)&&(r.depth=2),v(r.colors)&&(r.colors=!1),v(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=l),c(r,t,r.depth)}function l(t,e){var r=s.styles[e];return r?"["+s.colors[r][0]+"m"+t+"["+s.colors[r][1]+"m":t}function u(t,e){return t}function c(t,e,r){if(t.customInspect&&e&&M(e.inspect)&&e.inspect!==n.inspect&&(!e.constructor||e.constructor.prototype!==e)){var a=e.inspect(r,t);return y(a)||(a=c(t,a,r)),a}var i=function(t,e){if(v(e))return t.stylize("undefined","undefined");if(y(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return g(e)?t.stylize(""+e,"number"):p(e)?t.stylize(""+e,"boolean"):m(e)?t.stylize("null","null"):void 0}(t,e);if(i)return i;var o=Object.keys(e),s=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),w(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return h(e);if(0===o.length){if(M(e)){var l=e.name?": "+e.name:"";return t.stylize("[Function"+l+"]","special")}if(_(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(b(e))return t.stylize(Date.prototype.toString.call(e),"date");if(w(e))return h(e)}var u,x="",k=!1,T=["{","}"];return f(e)&&(k=!0,T=["[","]"]),M(e)&&(x=" [Function"+(e.name?": "+e.name:"")+"]"),_(e)&&(x=" "+RegExp.prototype.toString.call(e)),b(e)&&(x=" "+Date.prototype.toUTCString.call(e)),w(e)&&(x=" "+h(e)),0!==o.length||k&&0!=e.length?r<0?_(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),u=k?function(t,e,r,n,a){for(var i=[],o=0,s=e.length;o<s;++o)A(e,String(o))?i.push(d(t,e,r,n,String(o),!0)):i.push("");return a.forEach((function(a){a.match(/^\d+$/)||i.push(d(t,e,r,n,a,!0))})),i}(t,e,r,s,o):o.map((function(n){return d(t,e,r,s,n,k)})),t.seen.pop(),function(t,e,r){return t.reduce((function(t,e){return e.indexOf("\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]}(u,x,T)):T[0]+x+T[1]}function h(t){return"["+Error.prototype.toString.call(t)+"]"}function d(t,e,r,n,a,i){var o,s,l;if((l=Object.getOwnPropertyDescriptor(e,a)||{value:e[a]}).get?s=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),A(n,a)||(o="["+a+"]"),s||(t.seen.indexOf(l.value)<0?(s=m(r)?c(t,l.value,null):c(t,l.value,r-1)).indexOf("\n")>-1&&(s=i?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")),v(o)){if(i&&a.match(/^\d+$/))return s;(o=JSON.stringify(""+a)).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 f(t){return Array.isArray(t)}function p(t){return"boolean"==typeof t}function m(t){return null===t}function g(t){return"number"==typeof t}function y(t){return"string"==typeof t}function v(t){return void 0===t}function _(t){return x(t)&&"[object RegExp]"===k(t)}function x(t){return"object"==typeof t&&null!==t}function b(t){return x(t)&&"[object Date]"===k(t)}function w(t){return x(t)&&("[object Error]"===k(t)||t instanceof Error)}function M(t){return"function"==typeof t}function k(t){return Object.prototype.toString.call(t)}function T(t){return t<10?"0"+t.toString(10):t.toString(10)}n.debuglog=function(t){if(v(i)&&(i=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!o[t])if(new RegExp("\\b"+t+"\\b","i").test(i)){var r=e.pid;o[t]=function(){var e=n.format.apply(n,arguments);console.error("%s %d: %s",t,r,e)}}else o[t]=function(){};return o[t]},n.inspect=s,s.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]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=f,n.isBoolean=p,n.isNull=m,n.isNullOrUndefined=function(t){return null==t},n.isNumber=g,n.isString=y,n.isSymbol=function(t){return"symbol"==typeof t},n.isUndefined=v,n.isRegExp=_,n.isObject=x,n.isDate=b,n.isError=w,n.isFunction=M,n.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},n.isBuffer=t("./support/isBuffer");var L=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function A(t,e){return Object.prototype.hasOwnProperty.call(t,e)}n.log=function(){var t,e;console.log("%s - %s",(e=[T((t=new Date).getHours()),T(t.getMinutes()),T(t.getSeconds())].join(":"),[t.getDate(),L[t.getMonth()],e].join(" ")),n.format.apply(n,arguments))},n.inherits=t("inherits"),n._extend=function(t,e){if(!e||!x(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"),void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":70,_process:482,inherits:69}],72:[function(t,e,r){e.exports=function(t){return atob(t)}},{}],73:[function(t,e,r){e.exports=function(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}for(i[r]=new Array(r+1),o=0;o<=r;++o)i[r][o]=1;var u=new Array(r+1);for(o=0;o<r;++o)u[o]=e[o];u[r]=1;var c=n(i,u),h=a(c[r+1]);0===h&&(h=1);var d=new Array(r+1);for(o=0;o<=r;++o)d[o]=a(c[o])/h;return d};var n=t("robust-linear-solve");function a(t){for(var e=0,r=0;r<t.length;++r)e+=t[r];return e}},{"robust-linear-solve":509}],74:[function(t,e,r){r.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},r.toByteArray=function(t){for(var e,r=u(t),n=r[0],o=r[1],s=new i(function(t,e,r){return 3*(e+r)/4-r}(0,n,o)),l=0,c=o>0?n-4:n,h=0;h<c;h+=4)e=a[t.charCodeAt(h)]<<18|a[t.charCodeAt(h+1)]<<12|a[t.charCodeAt(h+2)]<<6|a[t.charCodeAt(h+3)],s[l++]=e>>16&255,s[l++]=e>>8&255,s[l++]=255&e;return 2===o&&(e=a[t.charCodeAt(h)]<<2|a[t.charCodeAt(h+1)]>>4,s[l++]=255&e),1===o&&(e=a[t.charCodeAt(h)]<<10|a[t.charCodeAt(h+1)]<<4|a[t.charCodeAt(h+2)]>>2,s[l++]=e>>8&255,s[l++]=255&e),s},r.fromByteArray=function(t){for(var e,r=t.length,a=r%3,i=[],o=0,s=r-a;o<s;o+=16383)i.push(c(t,o,o+16383>s?s:o+16383));return 1===a?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===a&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),i.join("")};for(var n=[],a=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s<l;++s)n[s]=o[s],a[o.charCodeAt(s)]=s;function u(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,r){for(var a,i,o=[],s=e;s<r;s+=3)a=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),o.push(n[(i=a)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return o.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},{}],75:[function(t,e,r){var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).add(e[0].mul(t[1])),t[1].mul(e[1]))}},{"./lib/rationalize":85}],76:[function(t,e,r){e.exports=function(t,e){return t[0].mul(e[1]).cmp(e[0].mul(t[1]))}},{}],77:[function(t,e,r){var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]),t[1].mul(e[0]))}},{"./lib/rationalize":85}],78:[function(t,e,r){var n=t("./is-rat"),a=t("./lib/is-bn"),i=t("./lib/num-to-bn"),o=t("./lib/str-to-bn"),s=t("./lib/rationalize"),l=t("./div");e.exports=function t(e,r){if(n(e))return r?l(e,t(r)):[e[0].clone(),e[1].clone()];var u,c,h=0;if(a(e))u=e.clone();else if("string"==typeof e)u=o(e);else{if(0===e)return[i(0),i(1)];if(e===Math.floor(e))u=i(e);else{for(;e!==Math.floor(e);)e*=Math.pow(2,256),h-=256;u=i(e)}}if(n(r))u.mul(r[1]),c=r[0].clone();else if(a(r))c=r.clone();else if("string"==typeof r)c=o(r);else if(r)if(r===Math.floor(r))c=i(r);else{for(;r!==Math.floor(r);)r*=Math.pow(2,256),h+=256;c=i(r)}else c=i(1);return h>0?u=u.ushln(h):h<0&&(c=c.ushln(-h)),s(u,c)}},{"./div":77,"./is-rat":79,"./lib/is-bn":83,"./lib/num-to-bn":84,"./lib/rationalize":85,"./lib/str-to-bn":86}],79:[function(t,e,r){var n=t("./lib/is-bn");e.exports=function(t){return Array.isArray(t)&&2===t.length&&n(t[0])&&n(t[1])}},{"./lib/is-bn":83}],80:[function(t,e,r){var n=t("bn.js");e.exports=function(t){return t.cmp(new n(0))}},{"bn.js":94}],81:[function(t,e,r){var n=t("./bn-sign");e.exports=function(t){var e=t.length,r=t.words,a=0;if(1===e)a=r[0];else if(2===e)a=r[0]+67108864*r[1];else for(var i=0;i<e;i++)a+=r[i]*Math.pow(67108864,i);return n(t)*a}},{"./bn-sign":80}],82:[function(t,e,r){var n=t("double-bits"),a=t("bit-twiddle").countTrailingZeros;e.exports=function(t){var e=a(n.lo(t));if(e<32)return e;var r=a(n.hi(t));return r>20?52:r+32}},{"bit-twiddle":92,"double-bits":167}],83:[function(t,e,r){t("bn.js"),e.exports=function(t){return t&&"object"==typeof t&&Boolean(t.words)}},{"bn.js":94}],84:[function(t,e,r){var n=t("bn.js"),a=t("double-bits");e.exports=function(t){var e=a.exponent(t);return e<52?new n(t):new n(t*Math.pow(2,52-e)).ushln(e-52)}},{"bn.js":94,"double-bits":167}],85:[function(t,e,r){var n=t("./num-to-bn"),a=t("./bn-sign");e.exports=function(t,e){var r=a(t),i=a(e);if(0===r)return[n(0),n(1)];if(0===i)return[n(0),n(0)];i<0&&(t=t.neg(),e=e.neg());var o=t.gcd(e);return o.cmpn(1)?[t.div(o),e.div(o)]:[t,e]}},{"./bn-sign":80,"./num-to-bn":84}],86:[function(t,e,r){var n=t("bn.js");e.exports=function(t){return new n(t)}},{"bn.js":94}],87:[function(t,e,r){var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[0]),t[1].mul(e[1]))}},{"./lib/rationalize":85}],88:[function(t,e,r){var n=t("./lib/bn-sign");e.exports=function(t){return n(t[0])*n(t[1])}},{"./lib/bn-sign":80}],89:[function(t,e,r){var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}},{"./lib/rationalize":85}],90:[function(t,e,r){var n=t("./lib/bn-to-num"),a=t("./lib/ctz");e.exports=function(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var i=e.abs().divmod(r.abs()),o=i.div,s=n(o),l=i.mod,u=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return u*s;if(s){var c=a(s)+4;return u*(s+(d=n(l.ushln(c).divRound(r)))*Math.pow(2,-c))}var h=r.bitLength()-l.bitLength()+53,d=n(l.ushln(h).divRound(r));return h<1023?u*d*Math.pow(2,-h):u*(d*=Math.pow(2,-1023))*Math.pow(2,1023-h)}},{"./lib/bn-to-num":81,"./lib/ctz":82}],91:[function(t,e,r){function n(t,e,r,n,a,i){var o=["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",a?".get(m)":"[m]"];return i?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("}"),i?o.push("return -1};"):o.push("return i};"),o.join("")}function a(t,e,r,a){return new Function([n("A","x"+t+"y",e,["y"],!1,a),n("B","x"+t+"y",e,["y"],!0,a),n("P","c(x,y)"+t+"0",e,["y","c"],!1,a),n("Q","c(x,y)"+t+"0",e,["y","c"],!0,a),"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:a(">=",!1,"GE"),gt:a(">",!1,"GT"),lt:a("<",!0,"LT"),le:a("<=",!0,"LE"),eq:a("-",!0,"EQ",!0)}},{}],92:[function(t,e,r){function n(t){var e=32;return(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,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>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 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(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,1+((t|=t>>>8)|t>>>16)},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 a=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,a=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--a;t[e]=n<<a&255}}(a),r.reverse=function(t){return a[255&t]<<24|a[t>>>8&255]<<16|a[t>>>16&255]<<8|a[t>>>24&255]},r.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},r.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},r.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},r.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],93:[function(t,e,r){var n=t("clamp");e.exports=function(t,e){e||(e={});var r,o,s,l,u,c,h,d,f,p,m,g=null==e.cutoff?.25:e.cutoff,y=null==e.radius?8:e.radius,v=e.channel||0;if(ArrayBuffer.isView(t)||Array.isArray(t)){if(!e.width||!e.height)throw Error("For raw data width and height should be provided by options");r=e.width,o=e.height,l=t,c=e.stride?e.stride:Math.floor(t.length/r/o)}else window.HTMLCanvasElement&&t instanceof window.HTMLCanvasElement?(h=(d=t).getContext("2d"),r=d.width,o=d.height,l=(f=h.getImageData(0,0,r,o)).data,c=4):window.CanvasRenderingContext2D&&t instanceof window.CanvasRenderingContext2D?(h=t,r=(d=t.canvas).width,o=d.height,l=(f=h.getImageData(0,0,r,o)).data,c=4):window.ImageData&&t instanceof window.ImageData&&(f=t,r=t.width,o=t.height,l=f.data,c=4);if(s=Math.max(r,o),window.Uint8ClampedArray&&l instanceof window.Uint8ClampedArray||window.Uint8Array&&l instanceof window.Uint8Array)for(u=l,l=Array(r*o),p=0,m=u.length;p<m;p++)l[p]=u[p*c+v]/255;else if(1!==c)throw Error("Raw data can have only 1 value per pixel");var _=Array(r*o),x=Array(r*o),b=Array(s),w=Array(s),M=Array(s+1),k=Array(s);for(p=0,m=r*o;p<m;p++){var T=l[p];_[p]=1===T?0:0===T?a:Math.pow(Math.max(0,.5-T),2),x[p]=1===T?a:0===T?0:Math.pow(Math.max(0,T-.5),2)}i(_,r,o,b,w,k,M),i(x,r,o,b,w,k,M);var L=window.Float32Array?new Float32Array(r*o):new Array(r*o);for(p=0,m=r*o;p<m;p++)L[p]=n(1-((_[p]-x[p])/y+g),0,1);return L};var a=1e20;function i(t,e,r,n,a,i,s){for(var l=0;l<e;l++){for(var u=0;u<r;u++)n[u]=t[u*e+l];for(o(n,a,i,s,r),u=0;u<r;u++)t[u*e+l]=a[u]}for(u=0;u<r;u++){for(l=0;l<e;l++)n[l]=t[u*e+l];for(o(n,a,i,s,e),l=0;l<e;l++)t[u*e+l]=Math.sqrt(a[l])}}function o(t,e,r,n,i){r[0]=0,n[0]=-a,n[1]=+a;for(var o=1,s=0;o<i;o++){for(var l=(t[o]+o*o-(t[r[s]]+r[s]*r[s]))/(2*o-2*r[s]);l<=n[s];)s--,l=(t[o]+o*o-(t[r[s]]+r[s]*r[s]))/(2*o-2*r[s]);r[++s]=o,n[s]=l,n[s+1]=+a}for(o=0,s=0;o<i;o++){for(;n[s+1]<o;)s++;e[o]=(o-r[s])*(o-r[s])+t[r[s]]}}},{clamp:115}],94:[function(t,e,r){!function(e,r){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function a(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function i(t,e,r){if(i.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"))}var o;"object"==typeof e?e.exports=i:r.BN=i,i.BN=i,i.wordSize=26;try{o=t("buffer").Buffer}catch(t){}function s(t,e,r){for(var n=0,a=Math.min(t.length,r),i=e;i<a;i++){var o=t.charCodeAt(i)-48;n<<=4,n|=o>=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function l(t,e,r,n){for(var a=0,i=Math.min(t.length,r),o=e;o<i;o++){var s=t.charCodeAt(o)-48;a*=n,a+=s>=49?s-49+10:s>=17?s-17+10:s}return a}i.isBN=function(t){return t instanceof i||null!==t&&"object"==typeof t&&t.constructor.wordSize===i.wordSize&&Array.isArray(t.words)},i.max=function(t,e){return t.cmp(e)>0?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.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);var a=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&a++,16===e?this._parseHex(t,a):this._parseBase(t,e,a),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},i.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)},i.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 a=0;a<this.length;a++)this.words[a]=0;var i,o,s=0;if("be"===r)for(a=t.length-1,i=0;a>=0;a-=3)o=t[a]|t[a-1]<<8|t[a-2]<<16,this.words[i]|=o<<s&67108863,this.words[i+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===r)for(a=0,i=0;a<t.length;a+=3)o=t[a]|t[a+1]<<8|t[a+2]<<16,this.words[i]|=o<<s&67108863,this.words[i+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this.strip()},i.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,a,i=0;for(r=t.length-6,n=0;r>=e;r-=6)a=s(t,r,r+6),this.words[n]|=a<<i&67108863,this.words[n+1]|=a>>>26-i&4194303,(i+=24)>=26&&(i-=26,n++);r+6!==e&&(a=s(t,e,r+6),this.words[n]|=a<<i&67108863,this.words[n+1]|=a>>>26-i&4194303),this.strip()},i.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,a=1;a<=67108863;a*=e)n++;n--,a=a/e|0;for(var i=t.length-r,o=i%n,s=Math.min(i,i-o)+r,u=0,c=r;c<s;c+=n)u=l(t,c,c+n,e),this.imuln(a),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==o){var h=1;for(u=l(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)}},i.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},i.prototype.clone=function(){var t=new i(null);return this.copy(t),t},i.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","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"],c=[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],h=[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];function d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var a=0|t.words[0],i=0|e.words[0],o=a*i,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,d=Math.min(u,e.length-1),f=Math.max(0,u-t.length+1);f<=d;f++){var p=u-f|0;c+=(o=(a=0|t.words[p])*(i=0|e.words[f])+h)/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()}i.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var a=0,i=0,o=0;o<this.length;o++){var s=this.words[o],l=(16777215&(s<<a|i)).toString(16);r=0!=(i=s>>>24-a&16777215)||o!==this.length-1?u[6-l.length]+l+r:l+r,(a+=2)>=26&&(a-=26,o--)}for(0!==i&&(r=i.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 d=c[t],f=h[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(f).toString(t);r=(p=p.idivn(f)).isZero()?m+r:u[d-m.length]+m+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")},i.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},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(t,e){return n(void 0!==o),this.toArrayLike(o,t,e)},i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},i.prototype.toArrayLike=function(t,e,r){var a=this.byteLength(),i=r||Math.max(1,a);n(a<=i,"byte array longer than desired length"),n(i>0,"Requested array length <= 0"),this.strip();var o,s,l="le"===e,u=new t(i),c=this.clone();if(l){for(s=0;!c.isZero();s++)o=c.andln(255),c.iushrn(8),u[s]=o;for(;s<i;s++)u[s]=0}else{for(s=0;s<i-a;s++)u[s]=0;for(s=0;!c.isZero();s++)o=c.andln(255),c.iushrn(8),u[i-s-1]=o}return u},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.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},i.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},i.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.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},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},i.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.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()},i.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},i.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.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()},i.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},i.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.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()},i.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},i.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.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 a=0;a<e;a++)this.words[a]=67108863&~this.words[a];return r>0&&(this.words[a]=~this.words[a]&67108863>>26-r),this.strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,a=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<a:this.words[r]&~(1<<a),this.strip()},i.prototype.iadd=function(t){var e,r,n;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();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var a=0,i=0;i<n.length;i++)e=(0|r.words[i])+(0|n.words[i])+a,this.words[i]=67108863&e,a=e>>>26;for(;0!==a&&i<r.length;i++)e=(0|r.words[i])+a,this.words[i]=67108863&e,a=e>>>26;if(this.length=r.length,0!==a)this.words[this.length]=a,this.length++;else if(r!==this)for(;i<r.length;i++)this.words[i]=r.words[i];return this},i.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)},i.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,n,a=this.cmp(t);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)i=(e=(0|r.words[o])-(0|n.words[o])+i)>>26,this.words[o]=67108863&e;for(;0!==i&&o<r.length;o++)i=(e=(0|r.words[o])+i)>>26,this.words[o]=67108863&e;if(0===i&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(t){return this.clone().isub(t)};var f=function(t,e,r){var n,a,i,o=t.words,s=e.words,l=r.words,u=0,c=0|o[0],h=8191&c,d=c>>>13,f=0|o[1],p=8191&f,m=f>>>13,g=0|o[2],y=8191&g,v=g>>>13,_=0|o[3],x=8191&_,b=_>>>13,w=0|o[4],M=8191&w,k=w>>>13,T=0|o[5],L=8191&T,A=T>>>13,S=0|o[6],E=8191&S,C=S>>>13,D=0|o[7],P=8191&D,O=D>>>13,z=0|o[8],I=8191&z,R=z>>>13,F=0|o[9],N=8191&F,Y=F>>>13,j=0|s[0],B=8191&j,H=j>>>13,U=0|s[1],V=8191&U,W=U>>>13,G=0|s[2],q=8191&G,Z=G>>>13,X=0|s[3],J=8191&X,K=X>>>13,$=0|s[4],Q=8191&$,tt=$>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,at=0|s[6],it=8191&at,ot=at>>>13,st=0|s[7],lt=8191&st,ut=st>>>13,ct=0|s[8],ht=8191&ct,dt=ct>>>13,ft=0|s[9],pt=8191&ft,mt=ft>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(u+(n=Math.imul(h,B))|0)+((8191&(a=(a=Math.imul(h,H))+Math.imul(d,B)|0))<<13)|0;u=((i=Math.imul(d,H))+(a>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,B),a=(a=Math.imul(p,H))+Math.imul(m,B)|0,i=Math.imul(m,H);var yt=(u+(n=n+Math.imul(h,V)|0)|0)+((8191&(a=(a=a+Math.imul(h,W)|0)+Math.imul(d,V)|0))<<13)|0;u=((i=i+Math.imul(d,W)|0)+(a>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,B),a=(a=Math.imul(y,H))+Math.imul(v,B)|0,i=Math.imul(v,H),n=n+Math.imul(p,V)|0,a=(a=a+Math.imul(p,W)|0)+Math.imul(m,V)|0,i=i+Math.imul(m,W)|0;var vt=(u+(n=n+Math.imul(h,q)|0)|0)+((8191&(a=(a=a+Math.imul(h,Z)|0)+Math.imul(d,q)|0))<<13)|0;u=((i=i+Math.imul(d,Z)|0)+(a>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(x,B),a=(a=Math.imul(x,H))+Math.imul(b,B)|0,i=Math.imul(b,H),n=n+Math.imul(y,V)|0,a=(a=a+Math.imul(y,W)|0)+Math.imul(v,V)|0,i=i+Math.imul(v,W)|0,n=n+Math.imul(p,q)|0,a=(a=a+Math.imul(p,Z)|0)+Math.imul(m,q)|0,i=i+Math.imul(m,Z)|0;var _t=(u+(n=n+Math.imul(h,J)|0)|0)+((8191&(a=(a=a+Math.imul(h,K)|0)+Math.imul(d,J)|0))<<13)|0;u=((i=i+Math.imul(d,K)|0)+(a>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(M,B),a=(a=Math.imul(M,H))+Math.imul(k,B)|0,i=Math.imul(k,H),n=n+Math.imul(x,V)|0,a=(a=a+Math.imul(x,W)|0)+Math.imul(b,V)|0,i=i+Math.imul(b,W)|0,n=n+Math.imul(y,q)|0,a=(a=a+Math.imul(y,Z)|0)+Math.imul(v,q)|0,i=i+Math.imul(v,Z)|0,n=n+Math.imul(p,J)|0,a=(a=a+Math.imul(p,K)|0)+Math.imul(m,J)|0,i=i+Math.imul(m,K)|0;var xt=(u+(n=n+Math.imul(h,Q)|0)|0)+((8191&(a=(a=a+Math.imul(h,tt)|0)+Math.imul(d,Q)|0))<<13)|0;u=((i=i+Math.imul(d,tt)|0)+(a>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(L,B),a=(a=Math.imul(L,H))+Math.imul(A,B)|0,i=Math.imul(A,H),n=n+Math.imul(M,V)|0,a=(a=a+Math.imul(M,W)|0)+Math.imul(k,V)|0,i=i+Math.imul(k,W)|0,n=n+Math.imul(x,q)|0,a=(a=a+Math.imul(x,Z)|0)+Math.imul(b,q)|0,i=i+Math.imul(b,Z)|0,n=n+Math.imul(y,J)|0,a=(a=a+Math.imul(y,K)|0)+Math.imul(v,J)|0,i=i+Math.imul(v,K)|0,n=n+Math.imul(p,Q)|0,a=(a=a+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,i=i+Math.imul(m,tt)|0;var bt=(u+(n=n+Math.imul(h,rt)|0)|0)+((8191&(a=(a=a+Math.imul(h,nt)|0)+Math.imul(d,rt)|0))<<13)|0;u=((i=i+Math.imul(d,nt)|0)+(a>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(E,B),a=(a=Math.imul(E,H))+Math.imul(C,B)|0,i=Math.imul(C,H),n=n+Math.imul(L,V)|0,a=(a=a+Math.imul(L,W)|0)+Math.imul(A,V)|0,i=i+Math.imul(A,W)|0,n=n+Math.imul(M,q)|0,a=(a=a+Math.imul(M,Z)|0)+Math.imul(k,q)|0,i=i+Math.imul(k,Z)|0,n=n+Math.imul(x,J)|0,a=(a=a+Math.imul(x,K)|0)+Math.imul(b,J)|0,i=i+Math.imul(b,K)|0,n=n+Math.imul(y,Q)|0,a=(a=a+Math.imul(y,tt)|0)+Math.imul(v,Q)|0,i=i+Math.imul(v,tt)|0,n=n+Math.imul(p,rt)|0,a=(a=a+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,i=i+Math.imul(m,nt)|0;var wt=(u+(n=n+Math.imul(h,it)|0)|0)+((8191&(a=(a=a+Math.imul(h,ot)|0)+Math.imul(d,it)|0))<<13)|0;u=((i=i+Math.imul(d,ot)|0)+(a>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(P,B),a=(a=Math.imul(P,H))+Math.imul(O,B)|0,i=Math.imul(O,H),n=n+Math.imul(E,V)|0,a=(a=a+Math.imul(E,W)|0)+Math.imul(C,V)|0,i=i+Math.imul(C,W)|0,n=n+Math.imul(L,q)|0,a=(a=a+Math.imul(L,Z)|0)+Math.imul(A,q)|0,i=i+Math.imul(A,Z)|0,n=n+Math.imul(M,J)|0,a=(a=a+Math.imul(M,K)|0)+Math.imul(k,J)|0,i=i+Math.imul(k,K)|0,n=n+Math.imul(x,Q)|0,a=(a=a+Math.imul(x,tt)|0)+Math.imul(b,Q)|0,i=i+Math.imul(b,tt)|0,n=n+Math.imul(y,rt)|0,a=(a=a+Math.imul(y,nt)|0)+Math.imul(v,rt)|0,i=i+Math.imul(v,nt)|0,n=n+Math.imul(p,it)|0,a=(a=a+Math.imul(p,ot)|0)+Math.imul(m,it)|0,i=i+Math.imul(m,ot)|0;var Mt=(u+(n=n+Math.imul(h,lt)|0)|0)+((8191&(a=(a=a+Math.imul(h,ut)|0)+Math.imul(d,lt)|0))<<13)|0;u=((i=i+Math.imul(d,ut)|0)+(a>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(I,B),a=(a=Math.imul(I,H))+Math.imul(R,B)|0,i=Math.imul(R,H),n=n+Math.imul(P,V)|0,a=(a=a+Math.imul(P,W)|0)+Math.imul(O,V)|0,i=i+Math.imul(O,W)|0,n=n+Math.imul(E,q)|0,a=(a=a+Math.imul(E,Z)|0)+Math.imul(C,q)|0,i=i+Math.imul(C,Z)|0,n=n+Math.imul(L,J)|0,a=(a=a+Math.imul(L,K)|0)+Math.imul(A,J)|0,i=i+Math.imul(A,K)|0,n=n+Math.imul(M,Q)|0,a=(a=a+Math.imul(M,tt)|0)+Math.imul(k,Q)|0,i=i+Math.imul(k,tt)|0,n=n+Math.imul(x,rt)|0,a=(a=a+Math.imul(x,nt)|0)+Math.imul(b,rt)|0,i=i+Math.imul(b,nt)|0,n=n+Math.imul(y,it)|0,a=(a=a+Math.imul(y,ot)|0)+Math.imul(v,it)|0,i=i+Math.imul(v,ot)|0,n=n+Math.imul(p,lt)|0,a=(a=a+Math.imul(p,ut)|0)+Math.imul(m,lt)|0,i=i+Math.imul(m,ut)|0;var kt=(u+(n=n+Math.imul(h,ht)|0)|0)+((8191&(a=(a=a+Math.imul(h,dt)|0)+Math.imul(d,ht)|0))<<13)|0;u=((i=i+Math.imul(d,dt)|0)+(a>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(N,B),a=(a=Math.imul(N,H))+Math.imul(Y,B)|0,i=Math.imul(Y,H),n=n+Math.imul(I,V)|0,a=(a=a+Math.imul(I,W)|0)+Math.imul(R,V)|0,i=i+Math.imul(R,W)|0,n=n+Math.imul(P,q)|0,a=(a=a+Math.imul(P,Z)|0)+Math.imul(O,q)|0,i=i+Math.imul(O,Z)|0,n=n+Math.imul(E,J)|0,a=(a=a+Math.imul(E,K)|0)+Math.imul(C,J)|0,i=i+Math.imul(C,K)|0,n=n+Math.imul(L,Q)|0,a=(a=a+Math.imul(L,tt)|0)+Math.imul(A,Q)|0,i=i+Math.imul(A,tt)|0,n=n+Math.imul(M,rt)|0,a=(a=a+Math.imul(M,nt)|0)+Math.imul(k,rt)|0,i=i+Math.imul(k,nt)|0,n=n+Math.imul(x,it)|0,a=(a=a+Math.imul(x,ot)|0)+Math.imul(b,it)|0,i=i+Math.imul(b,ot)|0,n=n+Math.imul(y,lt)|0,a=(a=a+Math.imul(y,ut)|0)+Math.imul(v,lt)|0,i=i+Math.imul(v,ut)|0,n=n+Math.imul(p,ht)|0,a=(a=a+Math.imul(p,dt)|0)+Math.imul(m,ht)|0,i=i+Math.imul(m,dt)|0;var Tt=(u+(n=n+Math.imul(h,pt)|0)|0)+((8191&(a=(a=a+Math.imul(h,mt)|0)+Math.imul(d,pt)|0))<<13)|0;u=((i=i+Math.imul(d,mt)|0)+(a>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(N,V),a=(a=Math.imul(N,W))+Math.imul(Y,V)|0,i=Math.imul(Y,W),n=n+Math.imul(I,q)|0,a=(a=a+Math.imul(I,Z)|0)+Math.imul(R,q)|0,i=i+Math.imul(R,Z)|0,n=n+Math.imul(P,J)|0,a=(a=a+Math.imul(P,K)|0)+Math.imul(O,J)|0,i=i+Math.imul(O,K)|0,n=n+Math.imul(E,Q)|0,a=(a=a+Math.imul(E,tt)|0)+Math.imul(C,Q)|0,i=i+Math.imul(C,tt)|0,n=n+Math.imul(L,rt)|0,a=(a=a+Math.imul(L,nt)|0)+Math.imul(A,rt)|0,i=i+Math.imul(A,nt)|0,n=n+Math.imul(M,it)|0,a=(a=a+Math.imul(M,ot)|0)+Math.imul(k,it)|0,i=i+Math.imul(k,ot)|0,n=n+Math.imul(x,lt)|0,a=(a=a+Math.imul(x,ut)|0)+Math.imul(b,lt)|0,i=i+Math.imul(b,ut)|0,n=n+Math.imul(y,ht)|0,a=(a=a+Math.imul(y,dt)|0)+Math.imul(v,ht)|0,i=i+Math.imul(v,dt)|0;var Lt=(u+(n=n+Math.imul(p,pt)|0)|0)+((8191&(a=(a=a+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((i=i+Math.imul(m,mt)|0)+(a>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(N,q),a=(a=Math.imul(N,Z))+Math.imul(Y,q)|0,i=Math.imul(Y,Z),n=n+Math.imul(I,J)|0,a=(a=a+Math.imul(I,K)|0)+Math.imul(R,J)|0,i=i+Math.imul(R,K)|0,n=n+Math.imul(P,Q)|0,a=(a=a+Math.imul(P,tt)|0)+Math.imul(O,Q)|0,i=i+Math.imul(O,tt)|0,n=n+Math.imul(E,rt)|0,a=(a=a+Math.imul(E,nt)|0)+Math.imul(C,rt)|0,i=i+Math.imul(C,nt)|0,n=n+Math.imul(L,it)|0,a=(a=a+Math.imul(L,ot)|0)+Math.imul(A,it)|0,i=i+Math.imul(A,ot)|0,n=n+Math.imul(M,lt)|0,a=(a=a+Math.imul(M,ut)|0)+Math.imul(k,lt)|0,i=i+Math.imul(k,ut)|0,n=n+Math.imul(x,ht)|0,a=(a=a+Math.imul(x,dt)|0)+Math.imul(b,ht)|0,i=i+Math.imul(b,dt)|0;var At=(u+(n=n+Math.imul(y,pt)|0)|0)+((8191&(a=(a=a+Math.imul(y,mt)|0)+Math.imul(v,pt)|0))<<13)|0;u=((i=i+Math.imul(v,mt)|0)+(a>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(N,J),a=(a=Math.imul(N,K))+Math.imul(Y,J)|0,i=Math.imul(Y,K),n=n+Math.imul(I,Q)|0,a=(a=a+Math.imul(I,tt)|0)+Math.imul(R,Q)|0,i=i+Math.imul(R,tt)|0,n=n+Math.imul(P,rt)|0,a=(a=a+Math.imul(P,nt)|0)+Math.imul(O,rt)|0,i=i+Math.imul(O,nt)|0,n=n+Math.imul(E,it)|0,a=(a=a+Math.imul(E,ot)|0)+Math.imul(C,it)|0,i=i+Math.imul(C,ot)|0,n=n+Math.imul(L,lt)|0,a=(a=a+Math.imul(L,ut)|0)+Math.imul(A,lt)|0,i=i+Math.imul(A,ut)|0,n=n+Math.imul(M,ht)|0,a=(a=a+Math.imul(M,dt)|0)+Math.imul(k,ht)|0,i=i+Math.imul(k,dt)|0;var St=(u+(n=n+Math.imul(x,pt)|0)|0)+((8191&(a=(a=a+Math.imul(x,mt)|0)+Math.imul(b,pt)|0))<<13)|0;u=((i=i+Math.imul(b,mt)|0)+(a>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(N,Q),a=(a=Math.imul(N,tt))+Math.imul(Y,Q)|0,i=Math.imul(Y,tt),n=n+Math.imul(I,rt)|0,a=(a=a+Math.imul(I,nt)|0)+Math.imul(R,rt)|0,i=i+Math.imul(R,nt)|0,n=n+Math.imul(P,it)|0,a=(a=a+Math.imul(P,ot)|0)+Math.imul(O,it)|0,i=i+Math.imul(O,ot)|0,n=n+Math.imul(E,lt)|0,a=(a=a+Math.imul(E,ut)|0)+Math.imul(C,lt)|0,i=i+Math.imul(C,ut)|0,n=n+Math.imul(L,ht)|0,a=(a=a+Math.imul(L,dt)|0)+Math.imul(A,ht)|0,i=i+Math.imul(A,dt)|0;var Et=(u+(n=n+Math.imul(M,pt)|0)|0)+((8191&(a=(a=a+Math.imul(M,mt)|0)+Math.imul(k,pt)|0))<<13)|0;u=((i=i+Math.imul(k,mt)|0)+(a>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(N,rt),a=(a=Math.imul(N,nt))+Math.imul(Y,rt)|0,i=Math.imul(Y,nt),n=n+Math.imul(I,it)|0,a=(a=a+Math.imul(I,ot)|0)+Math.imul(R,it)|0,i=i+Math.imul(R,ot)|0,n=n+Math.imul(P,lt)|0,a=(a=a+Math.imul(P,ut)|0)+Math.imul(O,lt)|0,i=i+Math.imul(O,ut)|0,n=n+Math.imul(E,ht)|0,a=(a=a+Math.imul(E,dt)|0)+Math.imul(C,ht)|0,i=i+Math.imul(C,dt)|0;var Ct=(u+(n=n+Math.imul(L,pt)|0)|0)+((8191&(a=(a=a+Math.imul(L,mt)|0)+Math.imul(A,pt)|0))<<13)|0;u=((i=i+Math.imul(A,mt)|0)+(a>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(N,it),a=(a=Math.imul(N,ot))+Math.imul(Y,it)|0,i=Math.imul(Y,ot),n=n+Math.imul(I,lt)|0,a=(a=a+Math.imul(I,ut)|0)+Math.imul(R,lt)|0,i=i+Math.imul(R,ut)|0,n=n+Math.imul(P,ht)|0,a=(a=a+Math.imul(P,dt)|0)+Math.imul(O,ht)|0,i=i+Math.imul(O,dt)|0;var Dt=(u+(n=n+Math.imul(E,pt)|0)|0)+((8191&(a=(a=a+Math.imul(E,mt)|0)+Math.imul(C,pt)|0))<<13)|0;u=((i=i+Math.imul(C,mt)|0)+(a>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,n=Math.imul(N,lt),a=(a=Math.imul(N,ut))+Math.imul(Y,lt)|0,i=Math.imul(Y,ut),n=n+Math.imul(I,ht)|0,a=(a=a+Math.imul(I,dt)|0)+Math.imul(R,ht)|0,i=i+Math.imul(R,dt)|0;var Pt=(u+(n=n+Math.imul(P,pt)|0)|0)+((8191&(a=(a=a+Math.imul(P,mt)|0)+Math.imul(O,pt)|0))<<13)|0;u=((i=i+Math.imul(O,mt)|0)+(a>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(N,ht),a=(a=Math.imul(N,dt))+Math.imul(Y,ht)|0,i=Math.imul(Y,dt);var Ot=(u+(n=n+Math.imul(I,pt)|0)|0)+((8191&(a=(a=a+Math.imul(I,mt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((i=i+Math.imul(R,mt)|0)+(a>>>13)|0)+(Ot>>>26)|0,Ot&=67108863;var zt=(u+(n=Math.imul(N,pt))|0)+((8191&(a=(a=Math.imul(N,mt))+Math.imul(Y,pt)|0))<<13)|0;return u=((i=Math.imul(Y,mt))+(a>>>13)|0)+(zt>>>26)|0,zt&=67108863,l[0]=gt,l[1]=yt,l[2]=vt,l[3]=_t,l[4]=xt,l[5]=bt,l[6]=wt,l[7]=Mt,l[8]=kt,l[9]=Tt,l[10]=Lt,l[11]=At,l[12]=St,l[13]=Et,l[14]=Ct,l[15]=Dt,l[16]=Pt,l[17]=Ot,l[18]=zt,0!==u&&(l[19]=u,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(f=d),i.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?f(this,t,e):r<63?d(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,a=0,i=0;i<r.length-1;i++){var o=a;a=0;for(var s=67108863&n,l=Math.min(i,e.length-1),u=Math.max(0,i-t.length+1);u<=l;u++){var c=i-u,h=(0|t.words[c])*(0|e.words[u]),d=67108863&h;s=67108863&(d=d+s|0),a+=(o=(o=o+(h/67108864|0)|0)+(d>>>26)|0)>>>26,o&=67108863}r.words[i]=s,n=o,o=a}return 0!==n?r.words[i]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=i.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},m.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,a=0;a<e;a++)n|=(1&t)<<e-a-1,t>>=1;return n},m.prototype.permute=function(t,e,r,n,a,i){for(var o=0;o<i;o++)n[o]=e[t[o]],a[o]=r[t[o]]},m.prototype.transform=function(t,e,r,n,a,i){this.permute(i,t,e,r,n,a);for(var o=1;o<a;o<<=1)for(var s=o<<1,l=Math.cos(2*Math.PI/s),u=Math.sin(2*Math.PI/s),c=0;c<a;c+=s)for(var h=l,d=u,f=0;f<o;f++){var p=r[c+f],m=n[c+f],g=r[c+f+o],y=n[c+f+o],v=h*g-d*y;y=h*y+d*g,g=v,r[c+f]=p+g,n[c+f]=m+y,r[c+f+o]=p-g,n[c+f+o]=m-y,f!==s&&(v=l*h-u*d,d=l*d+u*h,h=v)}},m.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,a=0;for(r=r/2|0;r;r>>>=1)a++;return 1<<a+1+n},m.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var a=t[n];t[n]=t[r-n-1],t[r-n-1]=a,a=e[n],e[n]=-e[r-n-1],e[r-n-1]=-a}},m.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var a=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&a,r=a<67108864?0:a/67108864|0}return t},m.prototype.convert13b=function(t,e,r,a){for(var i=0,o=0;o<e;o++)i+=0|t[o],r[2*o]=8191&i,i>>>=13,r[2*o+1]=8191&i,i>>>=13;for(o=2*e;o<a;++o)r[o]=0;n(0===i),n(0==(-8192&i))},m.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},m.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),a=this.makeRBT(n),i=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),d=r.words;d.length=n,this.convert13b(t.words,t.length,o,n),this.convert13b(e.words,e.length,u,n),this.transform(o,i,s,l,n,a),this.transform(u,i,c,h,n,a);for(var f=0;f<n;f++){var p=s[f]*c[f]-l[f]*h[f];l[f]=s[f]*h[f]+l[f]*c[f],s[f]=p}return this.conjugate(s,l,n),this.transform(s,l,d,i,n,a),this.conjugate(d,i,n),this.normalize13b(d,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.mulf=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),p(this,t,e)},i.prototype.imul=function(t){return this.clone().mulTo(t,this)},i.prototype.imuln=function(t){n("number"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var a=(0|this.words[r])*t,i=(67108863&a)+(67108863&e);e>>=26,e+=a/67108864|0,e+=i>>>26,this.words[r]=67108863&i}return 0!==e&&(this.words[r]=e,this.length++),this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,a=r%26;e[r]=(t.words[n]&1<<a)>>>a}return e}(t);if(0===e.length)return new i(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var a=r.sqr();n<e.length;n++,a=a.sqr())0!==e[n]&&(r=r.mul(a));return r},i.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,a=(t-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e<this.length;e++){var s=this.words[e]&i,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!==a){for(e=this.length-1;e>=0;e--)this.words[e+a]=this.words[e];for(e=0;e<a;e++)this.words[e]=0;this.length+=a}return this.strip()},i.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},i.prototype.iushrn=function(t,e,r){var a;n("number"==typeof t&&t>=0),a=e?(e-e%26)/26:0;var i=t%26,o=Math.min((t-i)/26,this.length),s=67108863^67108863>>>i<<i,l=r;if(a-=o,a=Math.max(0,a),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>=a);u--){var h=0|this.words[u];this.words[u]=c<<26-i|h>>>i,c=h&s}return l&&0!==c&&(l.words[l.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,a=1<<e;return!(this.length<=r||!(this.words[r]&a))},i.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 a=67108863^67108863>>>e<<e;this.words[this.length-1]&=a}return this.strip()},i.prototype.maskn=function(t){return this.clone().imaskn(t)},i.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)},i.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},i.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()},i.prototype.addn=function(t){return this.clone().iaddn(t)},i.prototype.subn=function(t){return this.clone().isubn(t)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(t,e,r){var a,i,o=t.length+r;this._expand(o);var s=0;for(a=0;a<t.length;a++){i=(0|this.words[a+r])+s;var l=(0|t.words[a])*e;s=((i-=67108863&l)>>26)-(l/67108864|0),this.words[a+r]=67108863&i}for(;a<this.length-r;a++)s=(i=(0|this.words[a+r])+s)>>26,this.words[a+r]=67108863&i;if(0===s)return this.strip();for(n(-1===s),s=0,a=0;a<this.length;a++)s=(i=-(0|this.words[a])+s)>>26,this.words[a]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),a=t,o=0|a.words[a.length-1];0!=(r=26-this._countBits(o))&&(a=a.ushln(r),n.iushln(r),o=0|a.words[a.length-1]);var s,l=n.length-a.length;if("mod"!==e){(s=new i(null)).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(a,1,l);0===c.negative&&(n=c,s&&(s.words[l]=1));for(var h=l-1;h>=0;h--){var d=67108864*(0|n.words[a.length+h])+(0|n.words[a.length+h-1]);for(d=Math.min(d/o|0,67108863),n._ishlnsubmul(a,d,h);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(a,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=d)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(a=s.div.neg()),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:a,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(a=s.div.neg()),{div:a,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 i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modn(t.words[0]))}:this._wordDiv(t,e);var a,o,s},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.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),a=t.andln(1),i=r.cmp(n);return i<0||1===a&&0===i?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,a=this.length-1;a>=0;a--)r=(e*r+(0|this.words[a]))%t;return r},i.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var a=(0|this.words[r])+67108864*e;this.words[r]=a/t|0,e=a%t}return this.strip()},i.prototype.divn=function(t){return this.clone().idivn(t)},i.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 a=new i(1),o=new i(0),s=new i(0),l=new i(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 d=0,f=1;0==(e.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(a.isOdd()||o.isOdd())&&(a.iadd(c),o.isub(h)),a.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),a.isub(s),o.isub(l)):(r.isub(e),s.isub(a),l.isub(o))}return{a:s,b:l,gcd:r.iushln(u)}},i.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 a,o=new i(1),s=new i(0),l=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,c=1;0==(e.words[0]&c)&&u<26;++u,c<<=1);if(u>0)for(e.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var h=0,d=1;0==(r.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(r.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(s)):(r.isub(e),s.isub(o))}return(a=0===e.cmpn(1)?o:s).cmpn(0)<0&&a.iadd(t),a},i.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 a=e.cmp(r);if(a<0){var i=e;e=r,r=i}else if(0===a||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,a=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=a,this;for(var i=a,o=r;0!==i&&o<this.length;o++){var s=0|this.words[o];i=(s+=i)>>>26,s&=67108863,this.words[o]=s}return 0!==i&&(this.words[o]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var a=0|this.words[0];e=a===t?0:a<t?-1:1}return 0!==this.negative?0|-e:e},i.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},i.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],a=0|t.words[r];if(n!==a){n<a?e=-1:n>a&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return this.cmpn(t)>=0},i.prototype.gte=function(t){return this.cmp(t)>=0},i.prototype.ltn=function(t){return-1===this.cmpn(t)},i.prototype.lt=function(t){return-1===this.cmp(t)},i.prototype.lten=function(t){return this.cmpn(t)<=0},i.prototype.lte=function(t){return this.cmp(t)<=0},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new w(t)},i.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)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var g={k256:null,p224:null,p192:null,p25519:null};function y(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function b(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(t){if("string"==typeof t){var e=i._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 M(t){w.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}y.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).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},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},a(v,y),v.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 a=t.words[9];for(e.words[e.length++]=4194303&a,n=10;n<t.length;n++){var i=0|t.words[n];t.words[n-10]=(4194303&i)<<4|a>>>22,a=i}a>>>=22,t.words[n-10]=a,0===a&&t.length>10?t.length-=10:t.length-=9},v.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},a(_,y),a(x,y),a(b,y),b.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,a=67108863&n;n>>>=26,t.words[r]=a,e=n}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(g[t])return g[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new _;else if("p192"===t)e=new x;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new b}return g[t]=e,e},w.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},w.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")},w.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},w.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},w.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)},w.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},w.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)},w.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},w.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},w.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},w.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},w.prototype.isqr=function(t){return this.imul(t,t.clone())},w.prototype.sqr=function(t){return this.mul(t,t)},w.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 i(1)).iushrn(2);return this.pow(t,r)}for(var a=this.m.subn(1),o=0;!a.isZero()&&0===a.andln(1);)o++,a.iushrn(1);n(!a.isZero());var s=new i(1).toRed(this),l=s.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new i(2*c*c).toRed(this);0!==this.pow(c,u).cmp(l);)c.redIAdd(l);for(var h=this.pow(c,a),d=this.pow(t,a.addn(1).iushrn(1)),f=this.pow(t,a),p=o;0!==f.cmp(s);){for(var m=f,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g<p);var y=this.pow(h,new i(1).iushln(p-g-1));d=d.redMul(y),h=y.redSqr(),f=f.redMul(h),p=g}return d},w.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},w.prototype.pow=function(t,e){if(e.isZero())return new i(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new i(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var a=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;a!==r[0]&&(a=this.sqr(a)),0!==h||0!==o?(o<<=1,o|=h,(4==++s||0===n&&0===c)&&(a=this.mul(a,r[o]),s=0,o=0)):s=0}l=26}return a},w.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},w.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new M(t)},a(M,w),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.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),a=r.isub(n).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new i(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),o=a;return a.cmp(this.m)>=0?o=a.isub(this.m):a.cmpn(0)<0&&(o=a.iadd(this.m)),o._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:103}],95:[function(t,e,r){e.exports=function(t){var e,r,n,a=t.length,i=0;for(e=0;e<a;++e)i+=t[e].length;var o=new Array(i),s=0;for(e=0;e<a;++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 d=c[1];c[1]=c[0],c[0]=d}}}return o}},{}],96:[function(t,e,r){e.exports=function(t,e,r){switch(arguments.length){case 1:return n=[],u(a=t,a,c,!0),n;case 2:return"function"==typeof e?u(t,t,e,!0):function(t,e){return n=[],u(t,e,c,!1),n}(t,e);case 3:return u(t,e,r,!1);default:throw new Error("box-intersect: Invalid arguments")}var a};var n,a=t("typedarray-pool"),i=t("./lib/sweep"),o=t("./lib/intersect");function s(t,e){for(var r=0;r<t;++r)if(!(e[r]<=e[r+t]))return!0;return!1}function l(t,e,r,n){for(var a=0,i=0,o=0,l=t.length;o<l;++o){var u=t[o];if(!s(e,u)){for(var c=0;c<2*e;++c)r[a++]=u[c];n[i++]=o}}return i}function u(t,e,r,n){var s=t.length,u=e.length;if(!(s<=0||u<=0)){var c=t[0].length>>>1;if(!(c<=0)){var h,d=a.mallocDouble(2*c*s),f=a.mallocInt32(s);if((s=l(t,c,d,f))>0){if(1===c&&n)i.init(s),h=i.sweepComplete(c,r,0,s,d,f,0,s,d,f);else{var p=a.mallocDouble(2*c*u),m=a.mallocInt32(u);(u=l(e,c,p,m))>0&&(i.init(s+u),h=1===c?i.sweepBipartite(c,r,0,s,d,f,0,u,p,m):o(c,r,n,s,d,f,u,p,m),a.free(p),a.free(m))}a.free(d),a.free(f)}return h}}}function c(t,e){n.push([t,e])}},{"./lib/intersect":98,"./lib/sweep":102,"typedarray-pool":545}],97:[function(t,e,r){var n="d",a="ax",i="fp",o="es",s="rs",l="re",u="rb",c="bs",h="be",d="bb",f=[n,a,"vv",s,l,u,"ri",c,h,d,"bi"];function p(t){var e="bruteForce"+(t?"Full":"Partial"),r=[],a=f.slice();t||a.splice(3,0,i);var s=["function "+e+"("+a.join()+"){"];function l(e,a){var i=function(t,e,r){var a="bruteForce"+(t?"Red":"Blue")+(e?"Flip":"")+(r?"Full":""),i=["function ",a,"(",f.join(),"){","var ",o,"=2*",n,";"],s="for(var i=rs,rp=es*rs;i<re;++i,rp+=es){var x0=rb[ax+rp],x1=rb[ax+rp+d],xi=ri[i];",l="for(var j=bs,bp=es*bs;j<be;++j,bp+=es){var y0=bb[ax+bp],"+(r?"y1=bb[ax+bp+d],":"")+"yi=bi[j];";return t?i.push(s,"Q",":",l):i.push(l,"Q",":",s),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=ax+1;k<d;++k){var r0=rb[k+rp],r1=rb[k+d+rp],b0=bb[k+bp],b1=bb[k+d+bp];if(r1<b0||b1<r0)continue Q;}var rv=vv("),e?i.push("yi,xi"):i.push("xi,yi"),i.push(");if(rv!==void 0)return rv;}}}"),{name:a,code:i.join("")}}(e,a,t);r.push(i.code),s.push("return "+i.name+"("+f.join()+");")}s.push("if(re-rs>be-bs){"),t?(l(!0,!1),s.push("}else{"),l(!1,!1)):(s.push("if(fp){"),l(!0,!0),s.push("}else{"),l(!0,!1),s.push("}}else{if(fp){"),l(!1,!0),s.push("}else{"),l(!1,!1),s.push("}")),s.push("}}return "+e);var u=r.join("")+s.join("");return new Function(u)()}r.partial=p(!1),r.full=p(!0)},{}],98:[function(t,e,r){e.exports=function(t,e,r,i,c,A,S,E,C){!function(t,e){var r=8*a.log2(e+1)*(t+1)|0,i=a.nextPow2(x*r);w.length<i&&(n.free(w),w=n.mallocInt32(i));var o=a.nextPow2(b*r);M<o&&(n.free(M),M=n.mallocDouble(o))}(t,i+S);var D,P=0,O=2*t;for(k(P++,0,0,i,0,S,r?16:0,-1/0,1/0),r||k(P++,0,0,S,0,i,1,-1/0,1/0);P>0;){var z=(P-=1)*x,I=w[z],R=w[z+1],F=w[z+2],N=w[z+3],Y=w[z+4],j=w[z+5],B=P*b,H=M[B],U=M[B+1],V=1&j,W=!!(16&j),G=c,q=A,Z=E,X=C;if(V&&(G=E,q=C,Z=c,X=A),!(2&j&&(F=g(t,I,R,F,G,q,U),R>=F)||4&j&&(R=y(t,I,R,F,G,q,H))>=F)){var J=F-R,K=Y-N;if(W){if(t*J*(J+K)<f){if(void 0!==(D=l.scanComplete(t,I,e,R,F,G,q,N,Y,Z,X)))return D;continue}}else{if(t*Math.min(J,K)<h){if(void 0!==(D=o(t,I,e,V,R,F,G,q,N,Y,Z,X)))return D;continue}if(t*J*K<d){if(void 0!==(D=l.scanBipartite(t,I,e,V,R,F,G,q,N,Y,Z,X)))return D;continue}}var $=p(t,I,R,F,G,q,H,U);if(R<$)if(t*($-R)<h){if(void 0!==(D=s(t,I+1,e,R,$,G,q,N,Y,Z,X)))return D}else if(I===t-2){if(void 0!==(D=V?l.sweepBipartite(t,e,N,Y,Z,X,R,$,G,q):l.sweepBipartite(t,e,R,$,G,q,N,Y,Z,X)))return D}else k(P++,I+1,R,$,N,Y,V,-1/0,1/0),k(P++,I+1,N,Y,R,$,1^V,-1/0,1/0);if($<F){var Q=u(t,I,N,Y,Z,X),tt=Z[O*Q+I],et=m(t,I,Q,Y,Z,X,tt);if(et<Y&&k(P++,I,$,F,et,Y,(4|V)+(W?16:0),tt,U),N<Q&&k(P++,I,$,F,N,Q,(2|V)+(W?16:0),H,tt),Q+1===et){if(void 0!==(D=W?L(t,I,e,$,F,G,q,Q,Z,X[Q]):T(t,I,e,V,$,F,G,q,Q,Z,X[Q])))return D}else if(Q<et){var rt;if(W){if($<(rt=v(t,I,$,F,G,q,tt))){var nt=m(t,I,$,rt,G,q,tt);if(I===t-2){if($<nt&&void 0!==(D=l.sweepComplete(t,e,$,nt,G,q,Q,et,Z,X)))return D;if(nt<rt&&void 0!==(D=l.sweepBipartite(t,e,nt,rt,G,q,Q,et,Z,X)))return D}else $<nt&&k(P++,I+1,$,nt,Q,et,16,-1/0,1/0),nt<rt&&(k(P++,I+1,nt,rt,Q,et,0,-1/0,1/0),k(P++,I+1,Q,et,nt,rt,1,-1/0,1/0))}}else $<(rt=V?_(t,I,$,F,G,q,tt):v(t,I,$,F,G,q,tt))&&(I===t-2?D=V?l.sweepBipartite(t,e,Q,et,Z,X,$,rt,G,q):l.sweepBipartite(t,e,$,rt,G,q,Q,et,Z,X):(k(P++,I+1,$,rt,Q,et,V,-1/0,1/0),k(P++,I+1,Q,et,$,rt,1^V,-1/0,1/0)))}}}}};var n=t("typedarray-pool"),a=t("bit-twiddle"),i=t("./brute"),o=i.partial,s=i.full,l=t("./sweep"),u=t("./median"),c=t("./partition"),h=128,d=1<<22,f=1<<22,p=c("!(lo>=p0)&&!(p1>=hi)",["p0","p1"]),m=c("lo===p0",["p0"]),g=c("lo<p0",["p0"]),y=c("hi<=p0",["p0"]),v=c("lo<=p0&&p0<=hi",["p0"]),_=c("lo<p0&&p0<=hi",["p0"]),x=6,b=2,w=n.mallocInt32(1024),M=n.mallocDouble(1024);function k(t,e,r,n,a,i,o,s,l){var u=x*t;w[u]=e,w[u+1]=r,w[u+2]=n,w[u+3]=a,w[u+4]=i,w[u+5]=o;var c=b*t;M[c]=s,M[c+1]=l}function T(t,e,r,n,a,i,o,s,l,u,c){var h=2*t,d=l*h,f=u[d+e];t:for(var p=a,m=a*h;p<i;++p,m+=h){var g=o[m+e],y=o[m+e+t];if(!(f<g||y<f||n&&f===g)){for(var v,_=s[p],x=e+1;x<t;++x){g=o[m+x],y=o[m+x+t];var b=u[d+x],w=u[d+x+t];if(y<b||w<g)continue t}if(void 0!==(v=n?r(c,_):r(_,c)))return v}}}function L(t,e,r,n,a,i,o,s,l,u){var c=2*t,h=s*c,d=l[h+e];t:for(var f=n,p=n*c;f<a;++f,p+=c){var m=o[f];if(m!==u){var g=i[p+e],y=i[p+e+t];if(!(d<g||y<d)){for(var v=e+1;v<t;++v){g=i[p+v],y=i[p+v+t];var _=l[h+v],x=l[h+v+t];if(y<_||x<g)continue t}var b=r(m,u);if(void 0!==b)return b}}}}},{"./brute":97,"./median":99,"./partition":100,"./sweep":102,"bit-twiddle":92,"typedarray-pool":545}],99:[function(t,e,r){e.exports=function(t,e,r,o,s,l){if(o<=r+1)return r;for(var u=r,c=o,h=o+r>>>1,d=2*t,f=h,p=s[d*h+e];u<c;){if(c-u<a){i(t,e,u,c,s,l),p=s[d*h+e];break}var m=c-u,g=Math.random()*m+u|0,y=s[d*g+e],v=Math.random()*m+u|0,_=s[d*v+e],x=Math.random()*m+u|0,b=s[d*x+e];y<=_?b>=_?(f=v,p=_):y>=b?(f=g,p=y):(f=x,p=b):_>=b?(f=v,p=_):b>=y?(f=g,p=y):(f=x,p=b);for(var w=d*(c-1),M=d*f,k=0;k<d;++k,++w,++M){var T=s[w];s[w]=s[M],s[M]=T}var L=l[c-1];for(l[c-1]=l[f],l[f]=L,w=d*(c-1),M=d*(f=n(t,e,u,c-1,s,l,p)),k=0;k<d;++k,++w,++M)T=s[w],s[w]=s[M],s[M]=T;if(L=l[c-1],l[c-1]=l[f],l[f]=L,h<f){for(c=f-1;u<c&&s[d*(c-1)+e]===p;)c-=1;c+=1}else{if(!(f<h))break;for(u=f+1;u<c&&s[d*u+e]===p;)u+=1}}return n(t,e,r,h,s,l,s[d*h+e])};var n=t("./partition")("lo<p0",["p0"]),a=8;function i(t,e,r,n,a,i){for(var o=2*t,s=o*(r+1)+e,l=r+1;l<n;++l,s+=o)for(var u=a[s],c=l,h=o*(l-1);c>r&&a[h+e]>u;--c,h-=o){for(var d=h,f=h+o,p=0;p<o;++p,++d,++f){var m=a[d];a[d]=a[f],a[f]=m}var g=i[c];i[c]=i[c-1],i[c-1]=g}}},{"./partition":100}],100:[function(t,e,r){e.exports=function(t,e){var r="abcdef".split("").concat(e),a=[];return t.indexOf("lo")>=0&&a.push("lo=e[k+n]"),t.indexOf("hi")>=0&&a.push("hi=e[k+o]"),r.push(n.replace("_",a.join()).replace("$",t)),Function.apply(void 0,r)};var n="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"},{}],101:[function(t,e,r){e.exports=function(t,e){e<=4*n?a(0,e-1,t):function t(e,r,h){var d=(r-e+1)/6|0,f=e+d,p=r-d,m=e+r>>1,g=m-d,y=m+d,v=f,_=g,x=m,b=y,w=p,M=e+1,k=r-1,T=0;u(v,_,h)&&(T=v,v=_,_=T),u(b,w,h)&&(T=b,b=w,w=T),u(v,x,h)&&(T=v,v=x,x=T),u(_,x,h)&&(T=_,_=x,x=T),u(v,b,h)&&(T=v,v=b,b=T),u(x,b,h)&&(T=x,x=b,b=T),u(_,w,h)&&(T=_,_=w,w=T),u(_,x,h)&&(T=_,_=x,x=T),u(b,w,h)&&(T=b,b=w,w=T);for(var L=h[2*_],A=h[2*_+1],S=h[2*b],E=h[2*b+1],C=2*v,D=2*x,P=2*w,O=2*f,z=2*m,I=2*p,R=0;R<2;++R){var F=h[C+R],N=h[D+R],Y=h[P+R];h[O+R]=F,h[z+R]=N,h[I+R]=Y}o(g,e,h),o(y,r,h);for(var j=M;j<=k;++j)if(c(j,L,A,h))j!==M&&i(j,M,h),++M;else if(!c(j,S,E,h))for(;;){if(c(k,S,E,h)){c(k,L,A,h)?(s(j,M,k,h),++M,--k):(i(j,k,h),--k);break}if(--k<j)break}l(e,M-1,L,A,h),l(r,k+1,S,E,h),M-2-e<=n?a(e,M-2,h):t(e,M-2,h),r-(k+2)<=n?a(k+2,r,h):t(k+2,r,h),k-M<=n?a(M,k,h):t(M,k,h)}(0,e-1,t)};var n=32;function a(t,e,r){for(var n=2*(t+1),a=t+1;a<=e;++a){for(var i=r[n++],o=r[n++],s=a,l=n-2;s-- >t;){var u=r[l-2],c=r[l-1];if(u<i)break;if(u===i&&c<o)break;r[l]=u,r[l+1]=c,l-=2}r[l]=i,r[l+1]=o}}function i(t,e,r){e*=2;var n=r[t*=2],a=r[t+1];r[t]=r[e],r[t+1]=r[e+1],r[e]=n,r[e+1]=a}function o(t,e,r){e*=2,r[t*=2]=r[e],r[t+1]=r[e+1]}function s(t,e,r,n){e*=2,r*=2;var a=n[t*=2],i=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]=a,n[r+1]=i}function l(t,e,r,n,a){e*=2,a[t*=2]=a[e],a[e]=r,a[t+1]=a[e+1],a[e+1]=n}function u(t,e,r){e*=2;var n=r[t*=2],a=r[e];return!(n<a)&&(n!==a||r[t+1]>r[e+1])}function c(t,e,r,n){var a=n[t*=2];return a<e||a===e&&n[t+1]<r}},{}],102:[function(t,e,r){e.exports={init:function(t){var e=a.nextPow2(t);s.length<e&&(n.free(s),s=n.mallocInt32(e)),l.length<e&&(n.free(l),l=n.mallocInt32(e)),u.length<e&&(n.free(u),u=n.mallocInt32(e)),c.length<e&&(n.free(c),c=n.mallocInt32(e)),h.length<e&&(n.free(h),h=n.mallocInt32(e)),d.length<e&&(n.free(d),d=n.mallocInt32(e));var r=8*e;f.length<r&&(n.free(f),f=n.mallocDouble(r))},sweepBipartite:function(t,e,r,n,a,h,d,g,y,v){for(var _=0,x=2*t,b=t-1,w=x-1,M=r;M<n;++M){var k=h[M],T=x*M;f[_++]=a[T+b],f[_++]=-(k+1),f[_++]=a[T+w],f[_++]=k}for(M=d;M<g;++M){k=v[M]+o;var L=x*M;f[_++]=y[L+b],f[_++]=-k,f[_++]=y[L+w],f[_++]=k}var A=_>>>1;i(f,A);var S=0,E=0;for(M=0;M<A;++M){var C=0|f[2*M+1];if(C>=o)p(u,c,E--,C=C-o|0);else if(C>=0)p(s,l,S--,C);else if(C<=-o){C=-C-o|0;for(var D=0;D<S;++D)if(void 0!==(P=e(s[D],C)))return P;m(u,c,E++,C)}else{for(C=-C-1|0,D=0;D<E;++D){var P;if(void 0!==(P=e(C,u[D])))return P}m(s,l,S++,C)}}},sweepComplete:function(t,e,r,n,a,o,g,y,v,_){for(var x=0,b=2*t,w=t-1,M=b-1,k=r;k<n;++k){var T=o[k]+1<<1,L=b*k;f[x++]=a[L+w],f[x++]=-T,f[x++]=a[L+M],f[x++]=T}for(k=g;k<y;++k){T=_[k]+1<<1;var A=b*k;f[x++]=v[A+w],f[x++]=1|-T,f[x++]=v[A+M],f[x++]=1|T}var S=x>>>1;i(f,S);var E=0,C=0,D=0;for(k=0;k<S;++k){var P=0|f[2*k+1],O=1&P;if(k<S-1&&P>>1==f[2*k+3]>>1&&(O=2,k+=1),P<0){for(var z=-(P>>1)-1,I=0;I<D;++I)if(void 0!==(R=e(h[I],z)))return R;if(0!==O)for(I=0;I<E;++I)if(void 0!==(R=e(s[I],z)))return R;if(1!==O)for(I=0;I<C;++I){var R;if(void 0!==(R=e(u[I],z)))return R}0===O?m(s,l,E++,z):1===O?m(u,c,C++,z):2===O&&m(h,d,D++,z)}else z=(P>>1)-1,0===O?p(s,l,E--,z):1===O?p(u,c,C--,z):2===O&&p(h,d,D--,z)}},scanBipartite:function(t,e,r,n,a,u,c,h,d,g,y,v){var _=0,x=2*t,b=e,w=e+t,M=1,k=1;n?k=o:M=o;for(var T=a;T<u;++T){var L=T+M,A=x*T;f[_++]=c[A+b],f[_++]=-L,f[_++]=c[A+w],f[_++]=L}for(T=d;T<g;++T){L=T+k;var S=x*T;f[_++]=y[S+b],f[_++]=-L}var E=_>>>1;i(f,E);var C=0;for(T=0;T<E;++T){var D=0|f[2*T+1];if(D<0){var P=!1;if((L=-D)>=o?(P=!n,L-=o):(P=!!n,L-=1),P)m(s,l,C++,L);else{var O=v[L],z=x*L,I=y[z+e+1],R=y[z+e+1+t];t:for(var F=0;F<C;++F){var N=s[F],Y=x*N;if(!(R<c[Y+e+1]||c[Y+e+1+t]<I)){for(var j=e+2;j<t;++j)if(y[z+j+t]<c[Y+j]||c[Y+j+t]<y[z+j])continue t;var B,H=h[N];if(void 0!==(B=n?r(O,H):r(H,O)))return B}}}}else p(s,l,C--,D-M)}},scanComplete:function(t,e,r,n,a,l,u,c,h,d,p){for(var m=0,g=2*t,y=e,v=e+t,_=n;_<a;++_){var x=_+o,b=g*_;f[m++]=l[b+y],f[m++]=-x,f[m++]=l[b+v],f[m++]=x}for(_=c;_<h;++_){x=_+1;var w=g*_;f[m++]=d[w+y],f[m++]=-x}var M=m>>>1;i(f,M);var k=0;for(_=0;_<M;++_){var T=0|f[2*_+1];if(T<0)if((x=-T)>=o)s[k++]=x-o;else{var L=p[x-=1],A=g*x,S=d[A+e+1],E=d[A+e+1+t];t:for(var C=0;C<k;++C){var D=s[C],P=u[D];if(P===L)break;var O=g*D;if(!(E<l[O+e+1]||l[O+e+1+t]<S)){for(var z=e+2;z<t;++z)if(d[A+z+t]<l[O+z]||l[O+z+t]<d[A+z])continue t;var I=r(P,L);if(void 0!==I)return I}}}else{for(x=T-o,C=k-1;C>=0;--C)if(s[C]===x){for(z=C+1;z<k;++z)s[z-1]=s[z];break}--k}}}};var n=t("typedarray-pool"),a=t("bit-twiddle"),i=t("./sort"),o=1<<28,s=n.mallocInt32(1024),l=n.mallocInt32(1024),u=n.mallocInt32(1024),c=n.mallocInt32(1024),h=n.mallocInt32(1024),d=n.mallocInt32(1024),f=n.mallocDouble(8192);function p(t,e,r,n){var a=e[n],i=t[r-1];t[a]=i,e[i]=a}function m(t,e,r,n){t[r]=n,e[n]=r}},{"./sort":101,"bit-twiddle":92,"typedarray-pool":545}],103:[function(t,e,r){},{}],104:[function(t,e,r){var n=Object.create||function(t){var e=function(){};return e.prototype=t,new e},a=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return r},i=Function.prototype.bind||function(t){var e=this;return function(){return e.apply(t,arguments)}};function o(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=n(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}e.exports=o,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._maxListeners=void 0;var s,l=10;try{var u={};Object.defineProperty&&Object.defineProperty(u,"x",{value:0}),s=0===u.x}catch(t){s=!1}function c(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function h(t,e,r,a){var i,o,s;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');if((o=t._events)?(o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]):(o=t._events=n(null),t._eventsCount=0),s){if("function"==typeof s?s=o[e]=a?[r,s]:[s,r]:a?s.unshift(r):s.push(r),!s.warned&&(i=c(t))&&i>0&&s.length>i){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+' "'+String(e)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",l.name,l.message)}}else s=o[e]=r,++t._eventsCount;return t}function d(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var t=new Array(arguments.length),e=0;e<t.length;++e)t[e]=arguments[e];this.listener.apply(this.target,t)}}function f(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},a=i.call(d,n);return a.listener=r,n.wrapFn=a,a}function p(t,e,r){var n=t._events;if(!n)return[];var a=n[e];return a?"function"==typeof a?r?[a.listener||a]:[a]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(a):g(a,a.length):[]}function m(t){var e=this._events;if(e){var r=e[t];if("function"==typeof r)return 1;if(r)return r.length}return 0}function g(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}s?Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return l},set:function(t){if("number"!=typeof t||t<0||t!=t)throw new TypeError('"defaultMaxListeners" must be a positive number');l=t}}):o.defaultMaxListeners=l,o.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||isNaN(t))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=t,this},o.prototype.getMaxListeners=function(){return c(this)},o.prototype.emit=function(t){var e,r,n,a,i,o,s="error"===t;if(o=this._events)s=s&&null==o.error;else if(!s)return!1;if(s){if(arguments.length>1&&(e=arguments[1]),e instanceof Error)throw e;var l=new Error('Unhandled "error" event. ('+e+")");throw l.context=e,l}if(!(r=o[t]))return!1;var u="function"==typeof r;switch(n=arguments.length){case 1:!function(t,e,r){if(e)t.call(r);else for(var n=t.length,a=g(t,n),i=0;i<n;++i)a[i].call(r)}(r,u,this);break;case 2:!function(t,e,r,n){if(e)t.call(r,n);else for(var a=t.length,i=g(t,a),o=0;o<a;++o)i[o].call(r,n)}(r,u,this,arguments[1]);break;case 3:!function(t,e,r,n,a){if(e)t.call(r,n,a);else for(var i=t.length,o=g(t,i),s=0;s<i;++s)o[s].call(r,n,a)}(r,u,this,arguments[1],arguments[2]);break;case 4:!function(t,e,r,n,a,i){if(e)t.call(r,n,a,i);else for(var o=t.length,s=g(t,o),l=0;l<o;++l)s[l].call(r,n,a,i)}(r,u,this,arguments[1],arguments[2],arguments[3]);break;default:for(a=new Array(n-1),i=1;i<n;i++)a[i-1]=arguments[i];!function(t,e,r,n){if(e)t.apply(r,n);else for(var a=t.length,i=g(t,a),o=0;o<a;++o)i[o].apply(r,n)}(r,u,this,a)}return!0},o.prototype.addListener=function(t,e){return h(this,t,e,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(t,e){return h(this,t,e,!0)},o.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.on(t,f(this,t,e)),this},o.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.prependListener(t,f(this,t,e)),this},o.prototype.removeListener=function(t,e){var r,a,i,o,s;if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');if(!(a=this._events))return this;if(!(r=a[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=n(null):(delete a[t],a.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(var r=e,n=r+1,a=t.length;n<a;r+=1,n+=1)t[r]=t[n];t.pop()}(r,i),1===r.length&&(a[t]=r[0]),a.removeListener&&this.emit("removeListener",t,s||e)}return this},o.prototype.removeAllListeners=function(t){var e,r,i;if(!(r=this._events))return this;if(!r.removeListener)return 0===arguments.length?(this._events=n(null),this._eventsCount=0):r[t]&&(0==--this._eventsCount?this._events=n(null):delete r[t]),this;if(0===arguments.length){var o,s=a(r);for(i=0;i<s.length;++i)"removeListener"!==(o=s[i])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=n(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(e)for(i=e.length-1;i>=0;i--)this.removeListener(t,e[i]);return this},o.prototype.listeners=function(t){return p(this,t,!0)},o.prototype.rawListeners=function(t){return p(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},o.prototype.listenerCount=m,o.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],105:[function(t,e,r){(function(e){var n=t("base64-js"),a=t("ieee754");r.Buffer=e,r.SlowBuffer=function(t){return+t!=t&&(t=0),e.alloc(+t)},r.INSPECT_MAX_BYTES=50;var i=2147483647;function o(t){if(t>i)throw new RangeError('The value "'+t+'" is invalid for option "size"');var r=new Uint8Array(t);return r.__proto__=e.prototype,r}function e(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return u(t)}return s(t,e,r)}function s(t,r,n){if("string"==typeof t)return function(t,r){if("string"==typeof r&&""!==r||(r="utf8"),!e.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var n=0|d(t,r),a=o(n),i=a.write(t,r);return i!==n&&(a=a.slice(0,i)),a}(t,r);if(ArrayBuffer.isView(t))return c(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Y(t,ArrayBuffer)||t&&Y(t.buffer,ArrayBuffer))return function(t,r,n){if(r<0||t.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<r+(n||0))throw new RangeError('"length" is outside of buffer bounds');var a;return(a=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n)).__proto__=e.prototype,a}(t,r,n);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var a=t.valueOf&&t.valueOf();if(null!=a&&a!==t)return e.from(a,r,n);var i=function(t){if(e.isBuffer(t)){var r=0|h(t.length),n=o(r);return 0===n.length||t.copy(n,0,0,r),n}return void 0!==t.length?"number"!=typeof t.length||j(t.length)?o(0):c(t):"Buffer"===t.type&&Array.isArray(t.data)?c(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return e.from(t[Symbol.toPrimitive]("string"),r,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function u(t){return l(t),o(t<0?0:0|h(t))}function c(t){for(var e=t.length<0?0:0|h(t.length),r=o(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function h(t){if(t>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|t}function d(t,r){if(e.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Y(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var n=t.length,a=arguments.length>2&&!0===arguments[2];if(!a&&0===n)return 0;for(var i=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return R(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return F(t).length;default:if(i)return a?-1:R(t).length;r=(""+r).toLowerCase(),i=!0}}function f(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function p(t,r,n,a,i){if(0===t.length)return-1;if("string"==typeof n?(a=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),j(n=+n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof r&&(r=e.from(r,a)),e.isBuffer(r))return 0===r.length?-1:m(t,r,n,a,i);if("number"==typeof r)return r&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,r,n):Uint8Array.prototype.lastIndexOf.call(t,r,n):m(t,[r],n,a,i);throw new TypeError("val must be string, number or Buffer")}function m(t,e,r,n,a){var i,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}function u(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(a){var c=-1;for(i=r;i<s;i++)if(u(t,i)===u(e,-1===c?0:i-c)){if(-1===c&&(c=i),i-c+1===l)return c*o}else-1!==c&&(i-=i-c),c=-1}else for(r+l>s&&(r=s-l),i=r;i>=0;i--){for(var h=!0,d=0;d<l;d++)if(u(t,i+d)!==u(e,d)){h=!1;break}if(h)return i}return-1}function g(t,e,r,n){r=Number(r)||0;var a=t.length-r;n?(n=Number(n))>a&&(n=a):n=a;var i=e.length;n>i/2&&(n=i/2);for(var o=0;o<n;++o){var s=parseInt(e.substr(2*o,2),16);if(j(s))return o;t[r+o]=s}return o}function y(t,e,r,n){return N(R(e,t.length-r),t,r,n)}function v(t,e,r,n){return N(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function _(t,e,r,n){return v(t,e,r,n)}function x(t,e,r,n){return N(F(e),t,r,n)}function b(t,e,r,n){return N(function(t,e){for(var r,n,a,i=[],o=0;o<t.length&&!((e-=2)<0);++o)n=(r=t.charCodeAt(o))>>8,a=r%256,i.push(a),i.push(n);return i}(e,t.length-r),t,r,n)}function w(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function M(t,e,r){r=Math.min(t.length,r);for(var n=[],a=e;a<r;){var i,o,s,l,u=t[a],c=null,h=u>239?4:u>223?3:u>191?2:1;if(a+h<=r)switch(h){case 1:u<128&&(c=u);break;case 2:128==(192&(i=t[a+1]))&&(l=(31&u)<<6|63&i)>127&&(c=l);break;case 3:i=t[a+1],o=t[a+2],128==(192&i)&&128==(192&o)&&(l=(15&u)<<12|(63&i)<<6|63&o)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:i=t[a+1],o=t[a+2],s=t[a+3],128==(192&i)&&128==(192&o)&&128==(192&s)&&(l=(15&u)<<18|(63&i)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,h=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),a+=h}return function(t){var e=t.length;if(e<=k)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=k));return r}(n)}r.kMaxLength=i,e.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}}(),e.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."),Object.defineProperty(e.prototype,"parent",{enumerable:!0,get:function(){if(e.isBuffer(this))return this.buffer}}),Object.defineProperty(e.prototype,"offset",{enumerable:!0,get:function(){if(e.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&e[Symbol.species]===e&&Object.defineProperty(e,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),e.poolSize=8192,e.from=function(t,e,r){return s(t,e,r)},e.prototype.__proto__=Uint8Array.prototype,e.__proto__=Uint8Array,e.alloc=function(t,e,r){return function(t,e,r){return l(t),t<=0?o(t):void 0!==e?"string"==typeof r?o(t).fill(e,r):o(t).fill(e):o(t)}(t,e,r)},e.allocUnsafe=function(t){return u(t)},e.allocUnsafeSlow=function(t){return u(t)},e.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==e.prototype},e.compare=function(t,r){if(Y(t,Uint8Array)&&(t=e.from(t,t.offset,t.byteLength)),Y(r,Uint8Array)&&(r=e.from(r,r.offset,r.byteLength)),!e.isBuffer(t)||!e.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;for(var n=t.length,a=r.length,i=0,o=Math.min(n,a);i<o;++i)if(t[i]!==r[i]){n=t[i],a=r[i];break}return n<a?-1:a<n?1:0},e.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}},e.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return e.alloc(0);var n;if(void 0===r)for(r=0,n=0;n<t.length;++n)r+=t[n].length;var a=e.allocUnsafe(r),i=0;for(n=0;n<t.length;++n){var o=t[n];if(Y(o,Uint8Array)&&(o=e.from(o)),!e.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(a,i),i+=o.length}return a},e.byteLength=d,e.prototype._isBuffer=!0,e.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)f(this,e,e+1);return this},e.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)f(this,e,e+3),f(this,e+1,e+2);return this},e.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)f(this,e,e+7),f(this,e+1,e+6),f(this,e+2,e+5),f(this,e+3,e+4);return this},e.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?M(this,0,t):function(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))return"";for(t||(t="utf8");;)switch(t){case"hex":return A(this,e,r);case"utf8":case"utf-8":return M(this,e,r);case"ascii":return T(this,e,r);case"latin1":case"binary":return L(this,e,r);case"base64":return w(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},e.prototype.toLocaleString=e.prototype.toString,e.prototype.equals=function(t){if(!e.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===e.compare(this,t)},e.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},e.prototype.compare=function(t,r,n,a,i){if(Y(t,Uint8Array)&&(t=e.from(t,t.offset,t.byteLength)),!e.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===r&&(r=0),void 0===n&&(n=t?t.length:0),void 0===a&&(a=0),void 0===i&&(i=this.length),r<0||n>t.length||a<0||i>this.length)throw new RangeError("out of range index");if(a>=i&&r>=n)return 0;if(a>=i)return-1;if(r>=n)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(a>>>=0),s=(n>>>=0)-(r>>>=0),l=Math.min(o,s),u=this.slice(a,i),c=t.slice(r,n),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},e.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},e.prototype.indexOf=function(t,e,r){return p(this,t,e,r,!0)},e.prototype.lastIndexOf=function(t,e,r){return p(this,t,e,r,!1)},e.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 a=this.length-e;if((void 0===r||r>a)&&(r=a),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return g(this,t,e,r);case"utf8":case"utf-8":return y(this,t,e,r);case"ascii":return v(this,t,e,r);case"latin1":case"binary":return _(this,t,e,r);case"base64":return x(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},e.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function T(t,e,r){var n="";r=Math.min(t.length,r);for(var a=e;a<r;++a)n+=String.fromCharCode(127&t[a]);return n}function L(t,e,r){var n="";r=Math.min(t.length,r);for(var a=e;a<r;++a)n+=String.fromCharCode(t[a]);return n}function A(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var a="",i=e;i<r;++i)a+=I(t[i]);return a}function S(t,e,r){for(var n=t.slice(e,r),a="",i=0;i<n.length;i+=2)a+=String.fromCharCode(n[i]+256*n[i+1]);return a}function E(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 C(t,r,n,a,i,o){if(!e.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(n+a>t.length)throw new RangeError("Index out of range")}function D(t,e,r,n,a,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function P(t,e,r,n,i){return e=+e,r>>>=0,i||D(t,0,r,4),a.write(t,e,r,n,23,4),r+4}function O(t,e,r,n,i){return e=+e,r>>>=0,i||D(t,0,r,8),a.write(t,e,r,n,52,8),r+8}e.prototype.slice=function(t,r){var n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<t&&(r=t);var a=this.subarray(t,r);return a.__proto__=e.prototype,a},e.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||E(t,e,this.length);for(var n=this[t],a=1,i=0;++i<e&&(a*=256);)n+=this[t+i]*a;return n},e.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||E(t,e,this.length);for(var n=this[t+--e],a=1;e>0&&(a*=256);)n+=this[t+--e]*a;return n},e.prototype.readUInt8=function(t,e){return t>>>=0,e||E(t,1,this.length),this[t]},e.prototype.readUInt16LE=function(t,e){return t>>>=0,e||E(t,2,this.length),this[t]|this[t+1]<<8},e.prototype.readUInt16BE=function(t,e){return t>>>=0,e||E(t,2,this.length),this[t]<<8|this[t+1]},e.prototype.readUInt32LE=function(t,e){return t>>>=0,e||E(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},e.prototype.readUInt32BE=function(t,e){return t>>>=0,e||E(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},e.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||E(t,e,this.length);for(var n=this[t],a=1,i=0;++i<e&&(a*=256);)n+=this[t+i]*a;return n>=(a*=128)&&(n-=Math.pow(2,8*e)),n},e.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||E(t,e,this.length);for(var n=e,a=1,i=this[t+--n];n>0&&(a*=256);)i+=this[t+--n]*a;return i>=(a*=128)&&(i-=Math.pow(2,8*e)),i},e.prototype.readInt8=function(t,e){return t>>>=0,e||E(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},e.prototype.readInt16LE=function(t,e){t>>>=0,e||E(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},e.prototype.readInt16BE=function(t,e){t>>>=0,e||E(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},e.prototype.readInt32LE=function(t,e){return t>>>=0,e||E(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},e.prototype.readInt32BE=function(t,e){return t>>>=0,e||E(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},e.prototype.readFloatLE=function(t,e){return t>>>=0,e||E(t,4,this.length),a.read(this,t,!0,23,4)},e.prototype.readFloatBE=function(t,e){return t>>>=0,e||E(t,4,this.length),a.read(this,t,!1,23,4)},e.prototype.readDoubleLE=function(t,e){return t>>>=0,e||E(t,8,this.length),a.read(this,t,!0,52,8)},e.prototype.readDoubleBE=function(t,e){return t>>>=0,e||E(t,8,this.length),a.read(this,t,!1,52,8)},e.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var a=1,i=0;for(this[e]=255&t;++i<r&&(a*=256);)this[e+i]=t/a&255;return e+r},e.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var a=r-1,i=1;for(this[e+a]=255&t;--a>=0&&(i*=256);)this[e+a]=t/i&255;return e+r},e.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,1,255,0),this[e]=255&t,e+1},e.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},e.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},e.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||C(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},e.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||C(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},e.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var a=Math.pow(2,8*r-1);C(this,t,e,r,a-1,-a)}var i=0,o=1,s=0;for(this[e]=255&t;++i<r&&(o*=256);)t<0&&0===s&&0!==this[e+i-1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},e.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var a=Math.pow(2,8*r-1);C(this,t,e,r,a-1,-a)}var i=r-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},e.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},e.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},e.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},e.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||C(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},e.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||C(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},e.prototype.writeFloatLE=function(t,e,r){return P(this,t,e,!0,r)},e.prototype.writeFloatBE=function(t,e,r){return P(this,t,e,!1,r)},e.prototype.writeDoubleLE=function(t,e,r){return O(this,t,e,!0,r)},e.prototype.writeDoubleBE=function(t,e,r){return O(this,t,e,!1,r)},e.prototype.copy=function(t,r,n,a){if(!e.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),a||0===a||(a=this.length),r>=t.length&&(r=t.length),r||(r=0),a>0&&a<n&&(a=n),a===n)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),t.length-r<a-n&&(a=t.length-r+n);var i=a-n;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(r,n,a);else if(this===t&&n<r&&r<a)for(var o=i-1;o>=0;--o)t[o+r]=this[o+n];else Uint8Array.prototype.set.call(t,this.subarray(n,a),r);return i},e.prototype.fill=function(t,r,n,a){if("string"==typeof t){if("string"==typeof r?(a=r,r=0,n=this.length):"string"==typeof n&&(a=n,n=this.length),void 0!==a&&"string"!=typeof a)throw new TypeError("encoding must be a string");if("string"==typeof a&&!e.isEncoding(a))throw new TypeError("Unknown encoding: "+a);if(1===t.length){var i=t.charCodeAt(0);("utf8"===a&&i<128||"latin1"===a)&&(t=i)}}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;var o;if(r>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=r;o<n;++o)this[o]=t;else{var s=e.isBuffer(t)?t:e.from(t,a),l=s.length;if(0===l)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<n-r;++o)this[o+r]=s[o%l]}return this};var z=/[^+\/0-9A-Za-z-_]/g;function I(t){return t<16?"0"+t.toString(16):t.toString(16)}function R(t,e){var r;e=e||1/0;for(var n=t.length,a=null,i=[],o=0;o<n;++o){if((r=t.charCodeAt(o))>55295&&r<57344){if(!a){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&i.push(239,191,189);continue}a=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),a=r;continue}r=65536+(a-55296<<10|r-56320)}else a&&(e-=3)>-1&&i.push(239,191,189);if(a=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.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;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function F(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(z,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function N(t,e,r,n){for(var a=0;a<n&&!(a+r>=e.length||a>=t.length);++a)e[a+r]=t[a];return a}function Y(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function j(t){return t!=t}}).call(this,t("buffer").Buffer)},{"base64-js":74,buffer:105,ieee754:412}],106:[function(t,e,r){var n=t("./lib/monotone"),a=t("./lib/triangulation"),i=t("./lib/delaunay"),o=t("./lib/filter");function s(t){return[Math.min(t[0],t[1]),Math.max(t[0],t[1])]}function l(t,e){return t[0]-e[0]||t[1]-e[1]}function u(t,e,r){return e in t?t[e]:r}e.exports=function(t,e,r){Array.isArray(e)?(r=r||{},e=e||[]):(r=e||{},e=[]);var c=!!u(r,"delaunay",!0),h=!!u(r,"interior",!0),d=!!u(r,"exterior",!0),f=!!u(r,"infinity",!1);if(!h&&!d||0===t.length)return[];var p=n(t,e);if(c||h!==d||f){for(var m=a(t.length,function(t){return t.map(s).sort(l)}(e)),g=0;g<p.length;++g){var y=p[g];m.addTriangle(y[0],y[1],y[2])}return c&&i(t,m),d?h?f?o(m,0,f):m.cells():o(m,1,f):o(m,-1)}return p}},{"./lib/delaunay":107,"./lib/filter":108,"./lib/monotone":109,"./lib/triangulation":110}],107:[function(t,e,r){var n=t("robust-in-sphere")[4];function a(t,e,r,a,i,o){var s=e.opposite(a,i);if(!(s<0)){if(i<a){var l=a;a=i,i=l,l=o,o=s,s=l}e.isConstraint(a,i)||n(t[a],t[i],t[o],t[s])<0&&r.push(a,i)}}t("binary-search-bounds"),e.exports=function(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)if(!((f=l[u])<s||e.isConstraint(s,f))){for(var c=l[u-1],h=-1,d=1;d<l.length;d+=2)if(l[d-1]===f){h=l[d];break}h<0||n(t[s],t[f],t[c],t[h])<0&&r.push(s,f)}for(;r.length>0;){for(var f=r.pop(),p=(c=-1,h=-1,l=o[s=r.pop()],1);p<l.length;p+=2){var m=l[p-1],g=l[p];m===f?h=g:g===f&&(c=m)}c<0||h<0||n(t[s],t[f],t[c],t[h])>=0||(e.flip(s,f),a(t,e,r,c,s,h),a(t,e,r,s,h,c),a(t,e,r,h,f,c),a(t,e,r,f,c,h))}}},{"binary-search-bounds":111,"robust-in-sphere":508}],108:[function(t,e,r){var n,a=t("binary-search-bounds");function i(t,e,r,n,a,i,o){this.cells=t,this.neighbor=e,this.flags=n,this.constraint=r,this.active=a,this.next=i,this.boundary=o}function o(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}e.exports=function(t,e,r){var n=function(t,e){for(var r=t.cells(),n=r.length,a=0;a<n;++a){var s=(y=r[a])[0],l=y[1],u=y[2];l<u?l<s&&(y[0]=l,y[1]=u,y[2]=s):u<s&&(y[0]=u,y[1]=s,y[2]=l)}r.sort(o);var c=new Array(n);for(a=0;a<c.length;++a)c[a]=0;var h=[],d=[],f=new Array(3*n),p=new Array(3*n),m=null;e&&(m=[]);var g=new i(r,f,p,c,h,d,m);for(a=0;a<n;++a)for(var y=r[a],v=0;v<3;++v){s=y[v],l=y[(v+1)%3];var _=f[3*a+v]=g.locate(l,s,t.opposite(l,s)),x=p[3*a+v]=t.isConstraint(s,l);_<0&&(x?d.push(a):(h.push(a),c[a]=1),e&&m.push([l,s,-1]))}return g}(t,r);if(0===e)return r?n.cells.concat(n.boundary):n.cells;for(var a=1,s=n.active,l=n.next,u=n.flags,c=n.cells,h=n.constraint,d=n.neighbor;s.length>0||l.length>0;){for(;s.length>0;){var f=s.pop();if(u[f]!==-a){u[f]=a,c[f];for(var p=0;p<3;++p){var m=d[3*f+p];m>=0&&0===u[m]&&(h[3*f+p]?l.push(m):(s.push(m),u[m]=a))}}}var g=l;l=s,s=g,l.length=0,a=-a}var y=function(t,e,r){for(var n=0,a=0;a<t.length;++a)e[a]===r&&(t[n++]=t[a]);return t.length=n,t}(c,u,e);return r?y.concat(n.boundary):y},i.prototype.locate=(n=[0,0,0],function(t,e,r){var i=t,s=e,l=r;return e<r?e<t&&(i=e,s=r,l=t):r<t&&(i=r,s=t,l=e),i<0?-1:(n[0]=i,n[1]=s,n[2]=l,a.eq(this.cells,n,o))})},{"binary-search-bounds":111}],109:[function(t,e,r){var n=t("binary-search-bounds"),a=t("robust-orientation")[3];function i(t,e,r,n,a){this.a=t,this.b=e,this.idx=r,this.lowerIds=n,this.upperIds=a}function o(t,e,r,n){this.a=t,this.b=e,this.type=r,this.idx=n}function s(t,e){var r=t.a[0]-e.a[0]||t.a[1]-e.a[1]||t.type-e.type;return r||(0!==t.type&&(r=a(t.a,t.b,e.b))?r:t.idx-e.idx)}function l(t,e){return a(t.a,t.b,e)}function u(t,e,r,i,o){for(var s=n.lt(e,i,l),u=n.gt(e,i,l),c=s;c<u;++c){for(var h=e[c],d=h.lowerIds,f=d.length;f>1&&a(r[d[f-2]],r[d[f-1]],i)>0;)t.push([d[f-1],d[f-2],o]),f-=1;d.length=f,d.push(o);var p=h.upperIds;for(f=p.length;f>1&&a(r[p[f-2]],r[p[f-1]],i)<0;)t.push([p[f-2],p[f-1],o]),f-=1;p.length=f,p.push(o)}}function c(t,e){var r;return(r=t.a[0]<e.a[0]?a(t.a,t.b,e.a):a(e.b,e.a,t.a))?r:(r=e.b[0]<t.b[0]?a(t.a,t.b,e.b):a(e.b,e.a,t.b))||t.idx-e.idx}function h(t,e,r){var a=n.le(t,r,c),o=t[a],s=o.upperIds,l=s[s.length-1];o.upperIds=[l],t.splice(a+1,0,new i(r.a,r.b,r.idx,[l],s))}function d(t,e,r){var a=r.a;r.a=r.b,r.b=a;var i=n.eq(t,r,c),o=t[i];t[i-1].upperIds=o.upperIds,t.splice(i,1)}e.exports=function(t,e){for(var r=t.length,n=e.length,a=[],l=0;l<r;++l)a.push(new o(t[l],null,0,l));for(l=0;l<n;++l){var c=e[l],f=t[c[0]],p=t[c[1]];f[0]<p[0]?a.push(new o(f,p,2,l),new o(p,f,1,l)):f[0]>p[0]&&a.push(new o(p,f,2,l),new o(f,p,1,l))}a.sort(s);for(var m=a[0].a[0]-(1+Math.abs(a[0].a[0]))*Math.pow(2,-52),g=[new i([m,1],[m,0],-1,[],[],[],[])],y=[],v=(l=0,a.length);l<v;++l){var _=a[l],x=_.type;0===x?u(y,g,t,_.a,_.idx):2===x?h(g,0,_):d(g,0,_)}return y}},{"binary-search-bounds":111,"robust-orientation":510}],110:[function(t,e,r){var n=t("binary-search-bounds");function a(t,e){this.stars=t,this.edges=e}e.exports=function(t,e){for(var r=new Array(t),n=0;n<t;++n)r[n]=[];return new a(r,e)};var i=a.prototype;function o(t,e,r){for(var n=1,a=t.length;n<a;n+=2)if(t[n-1]===e&&t[n]===r)return t[n-1]=t[a-2],t[n]=t[a-1],void(t.length=a-2)}i.isConstraint=function(){var t=[0,0];function e(t,e){return t[0]-e[0]||t[1]-e[1]}return function(r,a){return t[0]=Math.min(r,a),t[1]=Math.max(r,a),n.eq(this.edges,t,e)>=0}}(),i.removeTriangle=function(t,e,r){var n=this.stars;o(n[t],e,r),o(n[e],r,t),o(n[r],t,e)},i.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},i.opposite=function(t,e){for(var r=this.stars[e],n=1,a=r.length;n<a;n+=2)if(r[n]===t)return r[n-1];return-1},i.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)},i.edges=function(){for(var t=this.stars,e=[],r=0,n=t.length;r<n;++r)for(var a=t[r],i=0,o=a.length;i<o;i+=2)e.push([a[i],a[i+1]]);return e},i.cells=function(){for(var t=this.stars,e=[],r=0,n=t.length;r<n;++r)for(var a=t[r],i=0,o=a.length;i<o;i+=2){var s=a[i],l=a[i+1];r<Math.min(s,l)&&e.push([r,s,l])}return e}},{"binary-search-bounds":111}],111:[function(t,e,r){function n(t,e,r,n,a){var i=["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[m]"];return a?e.indexOf("c")<0?i.push(";if(x===y){return m}else if(x<=y){"):i.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):i.push(";if(",e,"){i=m;"),r?i.push("l=m+1}else{h=m-1}"):i.push("h=m-1}else{l=m+1}"),i.push("}"),a?i.push("return -1};"):i.push("return i};"),i.join("")}function a(t,e,r,a){return new Function([n("A","x"+t+"y",e,["y"],a),n("P","c(x,y)"+t+"0",e,["y","c"],a),"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:a(">=",!1,"GE"),gt:a(">",!1,"GT"),lt:a("<",!0,"LT"),le:a("<=",!0,"LE"),eq:a("-",!0,"EQ",!0)}},{}],112:[function(t,e,r){e.exports=function(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}},{}],113:[function(t,e,r){var n=t("dup"),a=t("robust-linear-solve");function i(t,e){for(var r=0,n=t.length,a=0;a<n;++a)r+=t[a]*e[a];return r}function o(t){var e=t.length;if(0===e)return[];t[0].length;var r=n([t.length+1,t.length+1],1),o=n([t.length+1],1);r[e][e]=0;for(var s=0;s<e;++s){for(var l=0;l<=s;++l)r[l][s]=r[s][l]=2*i(t[s],t[l]);o[s]=i(t[s],t[s])}var u=a(r,o),c=0,h=u[e+1];for(s=0;s<h.length;++s)c+=h[s];var d=new Array(e);for(s=0;s<e;++s){h=u[s];var f=0;for(l=0;l<h.length;++l)f+=h[l];d[s]=f/c}return d}function s(t){if(0===t.length)return[];for(var e=t[0].length,r=n([e]),a=o(t),i=0;i<t.length;++i)for(var s=0;s<e;++s)r[s]+=t[i][s]*a[i];return r}s.barycenetric=o,e.exports=s},{dup:170,"robust-linear-solve":509}],114:[function(t,e,r){e.exports=function(t){for(var e=n(t),r=0,a=0;a<t.length;++a)for(var i=t[a],o=0;o<e.length;++o)r+=Math.pow(i[o]-e[o],2);return Math.sqrt(r/t.length)};var n=t("circumcenter")},{circumcenter:113}],115:[function(t,e,r){e.exports=function(t,e,r){return e<r?t<e?e:t>r?r:t:t<r?r:t>e?e:t}},{}],116:[function(t,e,r){e.exports=function(t,e,r){var n;if(r){n=e;for(var a=new Array(e.length),i=0;i<e.length;++i){var o=e[i];a[i]=[o[0],o[1],r[i]]}e=a}for(var s=function(t,e,r){var n=p(t,[],f(t));return y(e,n,r),!!n}(t,e,!!r);v(t,e,!!r);)s=!0;if(r&&s)for(n.length=0,r.length=0,i=0;i<e.length;++i)o=e[i],n.push([o[0],o[1]]),r.push(o[2]);return s};var n=t("union-find"),a=t("box-intersect"),i=t("robust-segment-intersect"),o=t("big-rat"),s=t("big-rat/cmp"),l=t("big-rat/to-float"),u=t("rat-vec"),c=t("nextafter"),h=t("./lib/rat-seg-intersect");function d(t){var e=l(t);return[c(e,-1/0),c(e,1/0)]}function f(t){for(var e=new Array(t.length),r=0;r<t.length;++r){var n=t[r];e[r]=[c(n[0],-1/0),c(n[1],-1/0),c(n[0],1/0),c(n[1],1/0)]}return e}function p(t,e,r){for(var i=e.length,o=new n(i),s=[],l=0;l<e.length;++l){var u=e[l],h=d(u[0]),f=d(u[1]);s.push([c(h[0],-1/0),c(f[0],-1/0),c(h[1],1/0),c(f[1],1/0)])}a(s,(function(t,e){o.link(t,e)}));var p=!0,m=new Array(i);for(l=0;l<i;++l)(y=o.find(l))!==l&&(p=!1,t[y]=[Math.min(t[l][0],t[y][0]),Math.min(t[l][1],t[y][1])]);if(p)return null;var g=0;for(l=0;l<i;++l){var y;(y=o.find(l))===l?(m[l]=g,t[g++]=t[l]):m[l]=-1}for(t.length=g,l=0;l<i;++l)m[l]<0&&(m[l]=m[o.find(l)]);return m}function m(t,e){return t[0]-e[0]||t[1]-e[1]}function g(t,e){return t[0]-e[0]||t[1]-e[1]||(t[2]<e[2]?-1:t[2]>e[2]?1:0)}function y(t,e,r){if(0!==t.length){if(e)for(var n=0;n<t.length;++n){var a=e[(o=t[n])[0]],i=e[o[1]];o[0]=Math.min(a,i),o[1]=Math.max(a,i)}else for(n=0;n<t.length;++n){var o;a=(o=t[n])[0],i=o[1],o[0]=Math.min(a,i),o[1]=Math.max(a,i)}r?t.sort(g):t.sort(m);var s=1;for(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 v(t,e,r){var n=function(t,e){for(var r=new Array(e.length),n=0;n<e.length;++n){var a=e[n],i=t[a[0]],o=t[a[1]];r[n]=[c(Math.min(i[0],o[0]),-1/0),c(Math.min(i[1],o[1]),-1/0),c(Math.max(i[0],o[0]),1/0),c(Math.max(i[1],o[1]),1/0)]}return r}(t,e),d=function(t,e,r){var n=[];return a(r,(function(r,a){var o=e[r],s=e[a];if(o[0]!==s[0]&&o[0]!==s[1]&&o[1]!==s[0]&&o[1]!==s[1]){var l=t[o[0]],u=t[o[1]],c=t[s[0]],h=t[s[1]];i(l,u,c,h)&&n.push([r,a])}})),n}(t,e,n),m=function(t,e,r,n){var o=[];return a(r,n,(function(r,n){var a=e[r];if(a[0]!==n&&a[1]!==n){var s=t[n],l=t[a[0]],u=t[a[1]];i(l,u,s,s)&&o.push([r,n])}})),o}(t,e,n,f(t)),g=p(t,function(t,e,r,n,a){var i,c,d=t.map((function(t){return[o(t[0]),o(t[1])]}));for(i=0;i<r.length;++i){var f=r[i];c=f[0];var p=f[1],m=e[c],g=e[p],y=h(u(t[m[0]]),u(t[m[1]]),u(t[g[0]]),u(t[g[1]]));if(y){var v=t.length;t.push([l(y[0]),l(y[1])]),d.push(y),n.push([c,v],[p,v])}}for(n.sort((function(t,e){if(t[0]!==e[0])return t[0]-e[0];var r=d[t[1]],n=d[e[1]];return s(r[0],n[0])||s(r[1],n[1])})),i=n.length-1;i>=0;--i){var _=e[c=(A=n[i])[0]],x=_[0],b=_[1],w=t[x],M=t[b];if((w[0]-M[0]||w[1]-M[1])<0){var k=x;x=b,b=k}_[0]=x;var T,L=_[1]=A[1];for(a&&(T=_[2]);i>0&&n[i-1][0]===c;){var A,S=(A=n[--i])[1];a?e.push([L,S,T]):e.push([L,S]),L=S}a?e.push([L,b,T]):e.push([L,b])}return d}(t,e,d,m,r));return y(e,g,r),!!g||d.length>0||m.length>0}},{"./lib/rat-seg-intersect":117,"big-rat":78,"big-rat/cmp":76,"big-rat/to-float":90,"box-intersect":96,nextafter:451,"rat-vec":486,"robust-segment-intersect":513,"union-find":546}],117:[function(t,e,r){e.exports=function(t,e,r,n){var i=s(e,t),h=s(n,r),d=c(i,h);if(0===o(d))return null;var f=c(h,s(t,r)),p=a(f,d),m=u(i,p);return l(t,m)};var n=t("big-rat/mul"),a=t("big-rat/div"),i=t("big-rat/sub"),o=t("big-rat/sign"),s=t("rat-vec/sub"),l=t("rat-vec/add"),u=t("rat-vec/muls");function c(t,e){return i(n(t[0],e[1]),n(t[1],e[0]))}},{"big-rat/div":77,"big-rat/mul":87,"big-rat/sign":88,"big-rat/sub":89,"rat-vec/add":485,"rat-vec/muls":487,"rat-vec/sub":488}],118:[function(t,e,r){var n=t("clamp");function a(t,e){null==e&&(e=!0);var r=t[0],a=t[1],i=t[2],o=t[3];return null==o&&(o=e?1:255),e&&(r*=255,a*=255,i*=255,o*=255),16777216*(r=255&n(r,0,255))+((a=255&n(a,0,255))<<16)+((i=255&n(i,0,255))<<8)+(255&n(o,0,255))}e.exports=a,e.exports.to=a,e.exports.from=function(t,e){var r=(t=+t)>>>24,n=(16711680&t)>>>16,a=(65280&t)>>>8,i=255&t;return!1===e?[r,n,a,i]:[r/255,n/255,a/255,i/255]}},{clamp:115}],119:[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]}},{}],120:[function(t,e,r){var n=t("color-rgba"),a=t("clamp"),i=t("dtype");e.exports=function(t,e){"float"!==e&&e||(e="array"),"uint"===e&&(e="uint8"),"uint_clamped"===e&&(e="uint8_clamped");var r=new(i(e))(4),o="uint8"!==e&&"uint8_clamped"!==e;return t.length&&"string"!=typeof t||((t=n(t))[0]/=255,t[1]/=255,t[2]/=255),function(t){return t instanceof Uint8Array||t instanceof Uint8ClampedArray||!!(Array.isArray(t)&&(t[0]>1||0===t[0])&&(t[1]>1||0===t[1])&&(t[2]>1||0===t[2])&&(!t[3]||t[3]>1))}(t)?(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=null!=t[3]?t[3]:255,o&&(r[0]/=255,r[1]/=255,r[2]/=255,r[3]/=255),r):(o?(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=null!=t[3]?t[3]:1):(r[0]=a(Math.floor(255*t[0]),0,255),r[1]=a(Math.floor(255*t[1]),0,255),r[2]=a(Math.floor(255*t[2]),0,255),r[3]=null==t[3]?255:a(Math.floor(255*t[3]),0,255)),r)}},{clamp:115,"color-rgba":122,dtype:169}],121:[function(t,e,n){(function(r){var n=t("color-name"),a=t("is-plain-obj"),i=t("defined");e.exports=function(t){var e,s,l=[],u=1;if("string"==typeof t)if(n[t])l=n[t].slice(),s="rgb";else if("transparent"===t)u=0,s="rgb",l=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var c=t.slice(1);u=1,(f=c.length)<=4?(l=[parseInt(c[0]+c[0],16),parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16)],4===f&&(u=parseInt(c[3]+c[3],16)/255)):(l=[parseInt(c[0]+c[1],16),parseInt(c[2]+c[3],16),parseInt(c[4]+c[5],16)],8===f&&(u=parseInt(c[6]+c[7],16)/255)),l[0]||(l[0]=0),l[1]||(l[1]=0),l[2]||(l[2]=0),s="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],d="rgb"===h;s=c=h.replace(/a$/,"");var f="cmyk"===c?4:"gray"===c?1:3;l=e[2].trim().split(/\s*,\s*/).map((function(t,e){if(/%$/.test(t))return e===f?parseFloat(t)/100:"rgb"===c?255*parseFloat(t)/100:parseFloat(t);if("h"===c[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==o[t])return o[t]}return parseFloat(t)})),h===c&&l.push(1),u=d||void 0===l[f]?1:l[f],l=l.slice(0,f)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(l=t.match(/([0-9]+)/g).map((function(t){return parseFloat(t)})),s=t.match(/([a-z])/gi).join("").toLowerCase());else if(isNaN(t))if(a(t)){var p=i(t.r,t.red,t.R,null);null!==p?(s="rgb",l=[p,i(t.g,t.green,t.G),i(t.b,t.blue,t.B)]):(s="hsl",l=[i(t.h,t.hue,t.H),i(t.s,t.saturation,t.S),i(t.l,t.lightness,t.L,t.b,t.brightness)]),u=i(t.a,t.alpha,t.opacity,1),null!=t.opacity&&(u/=100)}else(Array.isArray(t)||r.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t))&&(l=[t[0],t[1],t[2]],s="rgb",u=4===t.length?t[3]:1);else s="rgb",l=[t>>>16,(65280&t)>>>8,255&t];return{space:s,values:l,alpha:u}};var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"color-name":119,defined:164,"is-plain-obj":422}],122:[function(t,e,r){var n=t("color-parse"),a=t("color-space/hsl"),i=t("clamp");e.exports=function(t){var e,r=n(t);return r.space?((e=Array(3))[0]=i(r.values[0],0,255),e[1]=i(r.values[1],0,255),e[2]=i(r.values[2],0,255),"h"===r.space[0]&&(e=a.rgb(e)),e.push(i(r.alpha,0,1)),e):[]}},{clamp:115,"color-parse":121,"color-space/hsl":123}],123:[function(t,e,r){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,a,i,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0===s)return[i=255*l,i,i];e=2*l-(r=l<.5?l*(1+s):l+s-l*s),a=[0,0,0];for(var u=0;u<3;u++)(n=o+1/3*-(u-1))<0?n++:n>1&&n--,i=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,a[u]=255*i;return a}},n.hsl=function(t){var e,r,n=t[0]/255,a=t[1]/255,i=t[2]/255,o=Math.min(n,a,i),s=Math.max(n,a,i),l=s-o;return s===o?e=0:n===s?e=(a-i)/l:a===s?e=2+(i-n)/l:i===s&&(e=4+(n-a)/l),(e=Math.min(60*e,360))<0&&(e+=360),r=(o+s)/2,[e,100*(s===o?0:r<=.5?l/(s+o):l/(2-s-o)),100*r]}},{"./rgb":124}],124:[function(t,e,r){e.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},{}],125:[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:1,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]}]}},{}],126:[function(t,e,r){var n=t("./colorScale"),a=t("lerp");function i(t){return[t[0]/255,t[1]/255,t[2]/255,t[3]]}function o(t){for(var e,r="#",n=0;n<3;++n)r+=("00"+(e=(e=t[n]).toString(16))).substr(e.length);return r}function s(t){return"rgba("+t.join(",")+")"}e.exports=function(t){var e,r,l,u,c,h,d,f,p,m;if(t||(t={}),f=(t.nshades||72)-1,d=t.format||"hex",(h=t.colormap)||(h="jet"),"string"==typeof h){if(h=h.toLowerCase(),!n[h])throw Error(h+" not a supported colorscale");c=n[h]}else{if(!Array.isArray(h))throw Error("unsupported colormap option",h);c=h.slice()}if(c.length>f+1)throw new Error(h+" map requires nshades to be at least size "+c.length);p=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:t.alpha.slice():"number"==typeof t.alpha?[t.alpha,t.alpha]:[1,1],e=c.map((function(t){return Math.round(t.index*f)})),p[0]=Math.min(Math.max(p[0],0),1),p[1]=Math.min(Math.max(p[1],0),1);var g=c.map((function(t,e){var r=c[e].index,n=c[e].rgb.slice();return 4===n.length&&n[3]>=0&&n[3]<=1||(n[3]=p[0]+(p[1]-p[0])*r),n})),y=[];for(m=0;m<e.length-1;++m){u=e[m+1]-e[m],r=g[m],l=g[m+1];for(var v=0;v<u;v++){var _=v/u;y.push([Math.round(a(r[0],l[0],_)),Math.round(a(r[1],l[1],_)),Math.round(a(r[2],l[2],_)),a(r[3],l[3],_)])}}return y.push(c[c.length-1].rgb.concat(p[1])),"hex"===d?y=y.map(o):"rgbaString"===d?y=y.map(s):"float"===d&&(y=y.map(i)),y}},{"./colorScale":125,lerp:425}],127:[function(t,e,r){e.exports=function(t,e,r,i){var o=n(e,r,i);if(0===o){var s=a(n(t,e,r)),u=a(n(t,e,i));if(s===u){if(0===s){var c=l(t,e,r);return c===l(t,e,i)?0:c?1:-1}return 0}return 0===u?s>0||l(t,e,i)?-1:1:0===s?u>0||l(t,e,r)?1:-1:a(u-s)}var h=n(t,e,r);return h>0?o>0&&n(t,e,i)>0?1:-1:h<0?o>0||n(t,e,i)>0?1:-1:n(t,e,i)>0||l(t,e,r)?1:-1};var n=t("robust-orientation"),a=t("signum"),i=t("two-sum"),o=t("robust-product"),s=t("robust-sum");function l(t,e,r){var n=i(t[0],-e[0]),a=i(t[1],-e[1]),l=i(r[0],-e[0]),u=i(r[1],-e[1]),c=s(o(n,l),o(a,u));return c[c.length-1]>=0}},{"robust-orientation":510,"robust-product":511,"robust-sum":515,signum:516,"two-sum":544}],128:[function(t,e,r){e.exports=function(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]||n(t[0],t[1])-n(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=n(t[0],t[1]),u=n(e[0],e[1]);return n(l,t[2])-n(u,e[2])||n(l+t[2],o)-n(u+e[2],s);case 4:var c=t[0],h=t[1],d=t[2],f=t[3],p=e[0],m=e[1],g=e[2],y=e[3];return c+h+d+f-(p+m+g+y)||n(c,h,d,f)-n(p,m,g,y,p)||n(c+h,c+d,c+f,h+d,h+f,d+f)-n(p+m,p+g,p+y,m+g,m+y,g+y)||n(c+h+d,c+h+f,c+d+f,h+d+f)-n(p+m+g,p+m+y,p+g+y,m+g+y);default:for(var v=t.slice().sort(a),_=e.slice().sort(a),x=0;x<r;++x)if(i=v[x]-_[x])return i;return 0}};var n=Math.min;function a(t,e){return t-e}},{}],129:[function(t,e,r){var n=t("compare-cell"),a=t("cell-orientation");e.exports=function(t,e){return n(t,e)||a(t)-a(e)}},{"cell-orientation":112,"compare-cell":128}],130:[function(t,e,r){var n=t("./lib/ch1d"),a=t("./lib/ch2d"),i=t("./lib/chnd");e.exports=function(t){var e=t.length;if(0===e)return[];if(1===e)return[[0]];var r=t[0].length;return 0===r?[]:1===r?n(t):2===r?a(t):i(t,r)}},{"./lib/ch1d":131,"./lib/ch2d":132,"./lib/chnd":133}],131:[function(t,e,r){e.exports=function(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]]}},{}],132:[function(t,e,r){e.exports=function(t){var e=n(t),r=e.length;if(r<=2)return[];for(var a=new Array(r),i=e[r-1],o=0;o<r;++o){var s=e[o];a[o]=[i,s],i=s}return a};var n=t("monotone-convex-hull-2d")},{"monotone-convex-hull-2d":434}],133:[function(t,e,r){e.exports=function(t,e){try{return n(t,!0)}catch(o){var r=a(t);if(r.length<=e)return[];var i=function(t,e){for(var r=t.length,n=new Array(r),a=0;a<e.length;++a)n[a]=t[e[a]];var i=e.length;for(a=0;a<r;++a)e.indexOf(a)<0&&(n[i++]=t[a]);return n}(t,r);return function(t,e){for(var r=t.length,n=e.length,a=0;a<r;++a)for(var i=t[a],o=0;o<i.length;++o){var s=i[o];if(s<n)i[o]=e[s];else{s-=n;for(var l=0;l<n;++l)s>=e[l]&&(s+=1);i[o]=s}}return t}(n(i,!0),r)}};var n=t("incremental-convex-hull"),a=t("affine-hull")},{"affine-hull":62,"incremental-convex-hull":413}],134:[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|ç)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|é)union",ROU:"r(o|u|ou)mania",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",RWA:"rwanda",BLM:"barth(e|é)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|ã)o.?tom(e|é)",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"}},{}],135:[function(t,e,r){e.exports=["xx-small","x-small","small","medium","large","x-large","xx-large","larger","smaller"]},{}],136:[function(t,e,r){e.exports=["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]},{}],137:[function(t,e,r){e.exports=["normal","italic","oblique"]},{}],138:[function(t,e,r){e.exports=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]},{}],139:[function(t,e,r){e.exports={parse:t("./parse"),stringify:t("./stringify")}},{"./parse":141,"./stringify":142}],140:[function(t,e,r){var n=t("css-font-size-keywords");e.exports={isSize:function(t){return/^[\d\.]/.test(t)||-1!==t.indexOf("/")||-1!==n.indexOf(t)}}},{"css-font-size-keywords":135}],141:[function(t,e,r){var n=t("unquote"),a=t("css-global-keywords"),i=t("css-system-font-keywords"),o=t("css-font-weight-keywords"),s=t("css-font-style-keywords"),l=t("css-font-stretch-keywords"),u=t("string-split-by"),c=t("./lib/util").isSize;e.exports=d;var h=d.cache={};function d(t){if("string"!=typeof t)throw new Error("Font argument must be a string.");if(h[t])return h[t];if(""===t)throw new Error("Cannot parse an empty string.");if(-1!==i.indexOf(t))return h[t]={system:t};for(var e,r={style:"normal",variant:"normal",weight:"normal",stretch:"normal",lineHeight:"normal",size:"1rem",family:["serif"]},d=u(t,/\s+/);e=d.shift();){if(-1!==a.indexOf(e))return["style","variant","weight","stretch"].forEach((function(t){r[t]=e})),h[t]=r;if(-1===s.indexOf(e))if("normal"!==e&&"small-caps"!==e)if(-1===l.indexOf(e)){if(-1===o.indexOf(e)){if(c(e)){var p=u(e,"/");if(r.size=p[0],null!=p[1]?r.lineHeight=f(p[1]):"/"===d[0]&&(d.shift(),r.lineHeight=f(d.shift())),!d.length)throw new Error("Missing required font-family.");return r.family=u(d.join(" "),/\s*,\s*/).map(n),h[t]=r}throw new Error("Unknown or unsupported font token: "+e)}r.weight=e}else r.stretch=e;else r.variant=e;else r.style=e}throw new Error("Missing required font-size.")}function f(t){var e=parseFloat(t);return e.toString()===t?e:t}},{"./lib/util":140,"css-font-stretch-keywords":136,"css-font-style-keywords":137,"css-font-weight-keywords":138,"css-global-keywords":143,"css-system-font-keywords":144,"string-split-by":529,unquote:548}],142:[function(t,e,r){var n=t("pick-by-alias"),a=t("./lib/util").isSize,i=p(t("css-global-keywords")),o=p(t("css-system-font-keywords")),s=p(t("css-font-weight-keywords")),l=p(t("css-font-style-keywords")),u=p(t("css-font-stretch-keywords")),c={normal:1,"small-caps":1},h={serif:1,"sans-serif":1,monospace:1,cursive:1,fantasy:1,"system-ui":1},d="serif";function f(t,e){if(t&&!e[t]&&!i[t])throw Error("Unknown keyword `"+t+"`");return t}function p(t){for(var e={},r=0;r<t.length;r++)e[t[r]]=1;return e}e.exports=function(t){if((t=n(t,{style:"style fontstyle fontStyle font-style slope distinction",variant:"variant font-variant fontVariant fontvariant var capitalization",weight:"weight w font-weight fontWeight fontweight",stretch:"stretch font-stretch fontStretch fontstretch width",size:"size s font-size fontSize fontsize height em emSize",lineHeight:"lh line-height lineHeight lineheight leading",family:"font family fontFamily font-family fontfamily type typeface face",system:"system reserved default global"})).system)return t.system&&f(t.system,o),t.system;if(f(t.style,l),f(t.variant,c),f(t.weight,s),f(t.stretch,u),null==t.size&&(t.size="1rem"),"number"==typeof t.size&&(t.size+="px"),!a)throw Error("Bad size value `"+t.size+"`");t.family||(t.family=d),Array.isArray(t.family)&&(t.family.length||(t.family=[d]),t.family=t.family.map((function(t){return h[t]?t:'"'+t+'"'})).join(", "));var e=[];return e.push(t.style),t.variant!==t.style&&e.push(t.variant),t.weight!==t.variant&&t.weight!==t.style&&e.push(t.weight),t.stretch!==t.weight&&t.stretch!==t.variant&&t.stretch!==t.style&&e.push(t.stretch),e.push(t.size+(null==t.lineHeight||"normal"===t.lineHeight||t.lineHeight+""=="1"?"":"/"+t.lineHeight)),e.push(t.family),e.filter(Boolean).join(" ")}},{"./lib/util":140,"css-font-stretch-keywords":136,"css-font-style-keywords":137,"css-font-weight-keywords":138,"css-global-keywords":143,"css-system-font-keywords":144,"pick-by-alias":465}],143:[function(t,e,r){e.exports=["inherit","initial","unset"]},{}],144:[function(t,e,r){e.exports=["caption","icon","menu","message-box","small-caption","status-bar"]},{}],145:[function(t,e,r){e.exports=function(t,e,r,n,a,i){var o=a-1,s=a*a,l=o*o,u=(1+2*a)*l,c=a*l,h=s*(3-2*a),d=s*o;if(t.length){i||(i=new Array(t.length));for(var f=t.length-1;f>=0;--f)i[f]=u*t[f]+c*e[f]+h*r[f]+d*n[f];return i}return u*t+c*e+h*r+d*n},e.exports.derivative=function(t,e,r,n,a,i){var o=6*a*a-6*a,s=3*a*a-4*a+1,l=-6*a*a+6*a,u=3*a*a-2*a;if(t.length){i||(i=new Array(t.length));for(var c=t.length-1;c>=0;--c)i[c]=o*t[c]+s*e[c]+l*r[c]+u*n[c];return i}return o*t+s*e+l*r[c]+u*n}},{}],146:[function(t,e,r){var n=t("./lib/thunk.js");function a(){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}e.exports=function(t){var e=new a;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,n(e)}},{"./lib/thunk.js":148}],147:[function(t,e,r){var n=t("uniq");function a(t,e,r){var n,a,i=t.length,o=e.arrayArgs.length,s=e.indexArgs.length>0,l=[],u=[],c=0,h=0;for(n=0;n<i;++n)u.push(["i",n,"=0"].join(""));for(a=0;a<o;++a)for(n=0;n<i;++n)h=c,c=t[n],0===n?u.push(["d",a,"s",n,"=t",a,"p",c].join("")):u.push(["d",a,"s",n,"=(t",a,"p",c,"-s",h,"*t",a,"p",h,")"].join(""));for(u.length>0&&l.push("var "+u.join(",")),n=i-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<i;++n){for(h=c,c=t[n],a=0;a<o;++a)l.push(["p",a,"+=d",a,"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){for(var n=t.body,a=[],i=[],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 d="l"+o,f="a"+c;if(0===e.arrayBlockIndices[c])1===s.count?"generic"===r[c]?s.lvalue?(a.push(["var ",d,"=",f,".get(",u,")"].join("")),n=n.replace(l,d),i.push([f,".set(",u,",",d,")"].join(""))):n=n.replace(l,[f,".get(",u,")"].join("")):n=n.replace(l,[f,"[",u,"]"].join("")):"generic"===r[c]?(a.push(["var ",d,"=",f,".get(",u,")"].join("")),n=n.replace(l,d),s.lvalue&&i.push([f,".set(",u,",",d,")"].join(""))):(a.push(["var ",d,"=",f,"[",u,"]"].join("")),n=n.replace(l,d),s.lvalue&&i.push([f,"[",u,"]=",d].join("")));else{for(var p=[s.name],m=[u],g=0;g<Math.abs(e.arrayBlockIndices[c]);g++)p.push("\\s*\\[([^\\]]+)\\]"),m.push("$"+(g+1)+"*t"+c+"b"+g);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,[f,"[",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[a.join("\n"),n,i.join("\n")].join("\n").trim()}e.exports=function(t,e){for(var r=e[1].length-Math.abs(t.arrayBlockIndices[0])|0,o=new Array(t.arrayArgs.length),s=new Array(t.arrayArgs.length),l=0;l<t.arrayArgs.length;++l)s[l]=e[2*l],o[l]=e[2*l+1];var u=[],c=[],h=[],d=[],f=[];for(l=0;l<t.arrayArgs.length;++l){t.arrayBlockIndices[l]<0?(h.push(0),d.push(r),u.push(r),c.push(r+t.arrayBlockIndices[l])):(h.push(t.arrayBlockIndices[l]),d.push(t.arrayBlockIndices[l]+r),u.push(0),c.push(t.arrayBlockIndices[l]));for(var p=[],m=0;m<o[l].length;m++)h[l]<=o[l][m]&&o[l][m]<d[l]&&p.push(o[l][m]-h[l]);f.push(p)}var g=["SS"],y=["'use strict'"],v=[];for(m=0;m<r;++m)v.push(["s",m,"=SS[",m,"]"].join(""));for(l=0;l<t.arrayArgs.length;++l){for(g.push("a"+l),g.push("t"+l),g.push("p"+l),m=0;m<r;++m)v.push(["t",l,"p",m,"=t",l,"[",h[l]+m,"]"].join(""));for(m=0;m<Math.abs(t.arrayBlockIndices[l]);++m)v.push(["t",l,"b",m,"=t",l,"[",u[l]+m,"]"].join(""))}for(l=0;l<t.scalarArgs.length;++l)g.push("Y"+l);if(t.shapeArgs.length>0&&v.push("shape=SS.slice(0)"),t.indexArgs.length>0){var _=new Array(r);for(l=0;l<r;++l)_[l]="0";v.push(["index=[",_.join(","),"]"].join(""))}for(l=0;l<t.offsetArgs.length;++l){var x=t.offsetArgs[l],b=[];for(m=0;m<x.offset.length;++m)0!==x.offset[m]&&(1===x.offset[m]?b.push(["t",x.array,"p",m].join("")):b.push([x.offset[m],"*t",x.array,"p",m].join("")));0===b.length?v.push("q"+l+"=0"):v.push(["q",l,"=",b.join("+")].join(""))}var w=n([].concat(t.pre.thisVars).concat(t.body.thisVars).concat(t.post.thisVars));for((v=v.concat(w)).length>0&&y.push("var "+v.join(",")),l=0;l<t.arrayArgs.length;++l)y.push("p"+l+"|=0");t.pre.body.length>3&&y.push(i(t.pre,t,s));var M=i(t.body,t,s),k=function(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}(f);k<r?y.push(function(t,e,r,n){for(var i=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(c=t;c<i;++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(c=0;c<o;++c){for(var h=["offset"+c],d=t;d<i;++d)h.push(["j",d,"*t",c,"p",e[d]].join(""));u.push(["p",c,"=(",h.join("+"),")"].join(""))}for(u.push(a(e,r,n)),c=t;c<i;++c)u.push("}");return u.join("\n")}(k,f[0],t,M)):y.push(a(f[0],t,M)),t.post.body.length>3&&y.push(i(t.post,t,s)),t.debug&&console.log("-----Generated cwise routine for ",e,":\n"+y.join("\n")+"\n----------");var T=[t.funcName||"unnamed","_cwise_loop_",o[0].join("s"),"m",k,function(t){for(var e=new Array(t.length),r=!0,n=0;n<t.length;++n){var a=t[n],i=a.match(/\d+/);i=i?i[0]:"",0===a.charAt(0)?e[n]="u"+a.charAt(1)+i:e[n]=a.charAt(0)+i,n>0&&(r=r&&e[n]===e[n-1])}return r?e[0]:e.join("")}(s)].join("");return new Function(["function ",T,"(",g.join(","),"){",y.join("\n"),"} return ",T].join(""))()}},{uniq:547}],148:[function(t,e,r){var n=t("./compile.js");e.exports=function(t){var e=["'use strict'","var CACHED={}"],r=[],a=t.funcName+"_cwise_thunk";e.push(["return function ",a,"(",t.shimArgs.join(","),"){"].join(""));for(var i=[],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("")),i.push("t"+h),i.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])+"]"))}for(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--\x3e0;) {"),e.push("if (!("+u.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}")),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([",i.join(","),"])}","return proc(",s.join(","),")}"].join("")),t.debug&&console.log("-----Generated thunk:\n"+e.join("\n")+"\n----------"),new Function("compile",e.join("\n"))(n.bind(void 0,t))}},{"./compile.js":147}],149:[function(t,e,r){e.exports=t("cwise-compiler")},{"cwise-compiler":146}],150:[function(t,e,r){var n,a=t("es5-ext/object/copy"),i=t("es5-ext/object/normalize-options"),o=t("es5-ext/object/valid-callable"),s=t("es5-ext/object/map"),l=t("es5-ext/object/valid-callable"),u=t("es5-ext/object/valid-value"),c=Function.prototype.bind,h=Object.defineProperty,d=Object.prototype.hasOwnProperty;n=function(t,e,r){var n,i=u(e)&&l(e.value);return delete(n=a(e)).writable,delete n.value,n.get=function(){return!r.overwriteDefinition&&d.call(this,t)?i:(e.value=c.call(i,r.resolveContext?r.resolveContext(this):this),h(this,t,e),this[t])},n},e.exports=function(t){var e=i(arguments[1]);return null!=e.resolveContext&&o(e.resolveContext),s(t,(function(t,r){return n(r,t,e)}))}},{"es5-ext/object/copy":189,"es5-ext/object/map":198,"es5-ext/object/normalize-options":199,"es5-ext/object/valid-callable":203,"es5-ext/object/valid-value":205}],151:[function(t,e,r){var n=t("es5-ext/object/assign"),a=t("es5-ext/object/normalize-options"),i=t("es5-ext/object/is-callable"),o=t("es5-ext/string/#/contains");(e.exports=function(t,e){var r,i,s,l,u;return arguments.length<2||"string"!=typeof t?(l=e,e=t,t=null):l=arguments[2],null==t?(r=s=!0,i=!1):(r=o.call(t,"c"),i=o.call(t,"e"),s=o.call(t,"w")),u={value:e,configurable:r,enumerable:i,writable:s},l?n(a(l),u):u}).gs=function(t,e,r){var s,l,u,c;return"string"!=typeof t?(u=r,r=e,e=t,t=null):u=arguments[3],null==e?e=void 0:i(e)?null==r?r=void 0:i(r)||(u=r,r=void 0):(u=e,e=r=void 0),null==t?(s=!0,l=!1):(s=o.call(t,"c"),l=o.call(t,"e")),c={get:e,set:r,configurable:s,enumerable:l},u?n(a(u),c):c}},{"es5-ext/object/assign":186,"es5-ext/object/is-callable":192,"es5-ext/object/normalize-options":199,"es5-ext/string/#/contains":206}],152:[function(t,e,r){(function(t){function e(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function r(t){var r;return 1===t.length&&(r=t,t=function(t,n){return e(r(t),n)}),{left:function(e,r,n,a){for(null==n&&(n=0),null==a&&(a=e.length);n<a;){var i=n+a>>>1;t(e[i],r)<0?n=i+1:a=i}return n},right:function(e,r,n,a){for(null==n&&(n=0),null==a&&(a=e.length);n<a;){var i=n+a>>>1;t(e[i],r)>0?a=i:n=i+1}return n}}}var n=r(e),a=n.right,i=n.left;function o(t,e){return[t,e]}function s(t){return null===t?NaN:+t}function l(t,e){var r,n,a=t.length,i=0,o=-1,l=0,u=0;if(null==e)for(;++o<a;)isNaN(r=s(t[o]))||(u+=(n=r-l)*(r-(l+=n/++i)));else for(;++o<a;)isNaN(r=s(e(t[o],o,t)))||(u+=(n=r-l)*(r-(l+=n/++i)));if(i>1)return u/(i-1)}function u(t,e){var r=l(t,e);return r?Math.sqrt(r):r}function c(t,e){var r,n,a,i=t.length,o=-1;if(null==e){for(;++o<i;)if(null!=(r=t[o])&&r>=r)for(n=a=r;++o<i;)null!=(r=t[o])&&(n>r&&(n=r),a<r&&(a=r))}else for(;++o<i;)if(null!=(r=e(t[o],o,t))&&r>=r)for(n=a=r;++o<i;)null!=(r=e(t[o],o,t))&&(n>r&&(n=r),a<r&&(a=r));return[n,a]}var h=Array.prototype,d=h.slice,f=h.map;function p(t){return function(){return t}}function m(t){return t}function g(t,e,r){t=+t,e=+e,r=(a=arguments.length)<2?(e=t,t=0,1):a<3?1:+r;for(var n=-1,a=0|Math.max(0,Math.ceil((e-t)/r)),i=new Array(a);++n<a;)i[n]=t+n*r;return i}var y=Math.sqrt(50),v=Math.sqrt(10),_=Math.sqrt(2);function x(t,e,r){var n=(e-t)/Math.max(0,r),a=Math.floor(Math.log(n)/Math.LN10),i=n/Math.pow(10,a);return a>=0?(i>=y?10:i>=v?5:i>=_?2:1)*Math.pow(10,a):-Math.pow(10,-a)/(i>=y?10:i>=v?5:i>=_?2:1)}function b(t,e,r){var n=Math.abs(e-t)/Math.max(0,r),a=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),i=n/a;return i>=y?a*=10:i>=v?a*=5:i>=_&&(a*=2),e<t?-a:a}function w(t){return Math.ceil(Math.log(t.length)/Math.LN2)+1}function M(t,e,r){if(null==r&&(r=s),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,a=(n-1)*e,i=Math.floor(a),o=+r(t[i],i,t);return o+(+r(t[i+1],i+1,t)-o)*(a-i)}}function k(t,e){var r,n,a=t.length,i=-1;if(null==e){for(;++i<a;)if(null!=(r=t[i])&&r>=r)for(n=r;++i<a;)null!=(r=t[i])&&n>r&&(n=r)}else for(;++i<a;)if(null!=(r=e(t[i],i,t))&&r>=r)for(n=r;++i<a;)null!=(r=e(t[i],i,t))&&n>r&&(n=r);return n}function T(t){if(!(a=t.length))return[];for(var e=-1,r=k(t,L),n=new Array(r);++e<r;)for(var a,i=-1,o=n[e]=new Array(a);++i<a;)o[i]=t[i][e];return n}function L(t){return t.length}t.bisect=a,t.bisectRight=a,t.bisectLeft=i,t.ascending=e,t.bisector=r,t.cross=function(t,e,r){var n,a,i,s,l=t.length,u=e.length,c=new Array(l*u);for(null==r&&(r=o),n=i=0;n<l;++n)for(s=t[n],a=0;a<u;++a,++i)c[i]=r(s,e[a]);return c},t.descending=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN},t.deviation=u,t.extent=c,t.histogram=function(){var t=m,e=c,r=w;function n(n){var i,o,s=n.length,l=new Array(s);for(i=0;i<s;++i)l[i]=t(n[i],i,n);var u=e(l),c=u[0],h=u[1],d=r(l,c,h);Array.isArray(d)||(d=b(c,h,d),d=g(Math.ceil(c/d)*d,h,d));for(var f=d.length;d[0]<=c;)d.shift(),--f;for(;d[f-1]>h;)d.pop(),--f;var p,m=new Array(f+1);for(i=0;i<=f;++i)(p=m[i]=[]).x0=i>0?d[i-1]:c,p.x1=i<f?d[i]:h;for(i=0;i<s;++i)c<=(o=l[i])&&o<=h&&m[a(d,o,0,f)].push(n[i]);return m}return n.value=function(e){return arguments.length?(t="function"==typeof e?e:p(e),n):t},n.domain=function(t){return arguments.length?(e="function"==typeof t?t:p([t[0],t[1]]),n):e},n.thresholds=function(t){return arguments.length?(r="function"==typeof t?t:Array.isArray(t)?p(d.call(t)):p(t),n):r},n},t.thresholdFreedmanDiaconis=function(t,r,n){return t=f.call(t,s).sort(e),Math.ceil((n-r)/(2*(M(t,.75)-M(t,.25))*Math.pow(t.length,-1/3)))},t.thresholdScott=function(t,e,r){return Math.ceil((r-e)/(3.5*u(t)*Math.pow(t.length,-1/3)))},t.thresholdSturges=w,t.max=function(t,e){var r,n,a=t.length,i=-1;if(null==e){for(;++i<a;)if(null!=(r=t[i])&&r>=r)for(n=r;++i<a;)null!=(r=t[i])&&r>n&&(n=r)}else for(;++i<a;)if(null!=(r=e(t[i],i,t))&&r>=r)for(n=r;++i<a;)null!=(r=e(t[i],i,t))&&r>n&&(n=r);return n},t.mean=function(t,e){var r,n=t.length,a=n,i=-1,o=0;if(null==e)for(;++i<n;)isNaN(r=s(t[i]))?--a:o+=r;else for(;++i<n;)isNaN(r=s(e(t[i],i,t)))?--a:o+=r;if(a)return o/a},t.median=function(t,r){var n,a=t.length,i=-1,o=[];if(null==r)for(;++i<a;)isNaN(n=s(t[i]))||o.push(n);else for(;++i<a;)isNaN(n=s(r(t[i],i,t)))||o.push(n);return M(o.sort(e),.5)},t.merge=function(t){for(var e,r,n,a=t.length,i=-1,o=0;++i<a;)o+=t[i].length;for(r=new Array(o);--a>=0;)for(e=(n=t[a]).length;--e>=0;)r[--o]=n[e];return r},t.min=k,t.pairs=function(t,e){null==e&&(e=o);for(var r=0,n=t.length-1,a=t[0],i=new Array(n<0?0:n);r<n;)i[r]=e(a,a=t[++r]);return i},t.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},t.quantile=M,t.range=g,t.scan=function(t,r){if(n=t.length){var n,a,i=0,o=0,s=t[o];for(null==r&&(r=e);++i<n;)(r(a=t[i],s)<0||0!==r(s,s))&&(s=a,o=i);return 0===r(s,s)?o:void 0}},t.shuffle=function(t,e,r){for(var n,a,i=(null==r?t.length:r)-(e=null==e?0:+e);i;)a=Math.random()*i--|0,n=t[i+e],t[i+e]=t[a+e],t[a+e]=n;return t},t.sum=function(t,e){var r,n=t.length,a=-1,i=0;if(null==e)for(;++a<n;)(r=+t[a])&&(i+=r);else for(;++a<n;)(r=+e(t[a],a,t))&&(i+=r);return i},t.ticks=function(t,e,r){var n,a,i,o,s=-1;if(r=+r,(t=+t)==(e=+e)&&r>0)return[t];if((n=e<t)&&(a=t,t=e,e=a),0===(o=x(t,e,r))||!isFinite(o))return[];if(o>0)for(t=Math.ceil(t/o),e=Math.floor(e/o),i=new Array(a=Math.ceil(e-t+1));++s<a;)i[s]=(t+s)*o;else for(t=Math.floor(t*o),e=Math.ceil(e*o),i=new Array(a=Math.ceil(t-e+1));++s<a;)i[s]=(t-s)/o;return n&&i.reverse(),i},t.tickIncrement=x,t.tickStep=b,t.transpose=T,t.variance=l,t.zip=function(){return T(arguments)},Object.defineProperty(t,"__esModule",{value:!0})})("object"==typeof r&&void 0!==e?r:this.d3=this.d3||{})},{}],153:[function(t,e,r){(function(t){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 a,i=-1,o=t.length;if(null==r)for(;++i<o;)n.set(i,t[i]);else for(;++i<o;)n.set(r(a=t[i],i,t),a)}else if(t)for(var s in t)n.set(s,t[s]);return n}function n(){return{}}function a(t,e,r){t[e]=r}function i(){return r()}function o(t,e,r){t.set(e,r)}function s(){}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 l=r.prototype;function u(t,e){var r=new s;if(t instanceof s)t.each((function(t){r.add(t)}));else if(t){var n=-1,a=t.length;if(null==e)for(;++n<a;)r.add(t[n]);else for(;++n<a;)r.add(e(t[n],n,t))}return r}s.prototype=u.prototype={constructor:s,has:l.has,add:function(t){return this["$"+(t+="")]=t,this},remove:l.remove,clear:l.clear,values:l.keys,size:l.size,empty:l.empty,each:l.each},t.nest=function(){var t,e,s,l=[],u=[];function c(n,a,i,o){if(a>=l.length)return null!=t&&n.sort(t),null!=e?e(n):n;for(var s,u,h,d=-1,f=n.length,p=l[a++],m=r(),g=i();++d<f;)(h=m.get(s=p(u=n[d])+""))?h.push(u):m.set(s,[u]);return m.each((function(t,e){o(g,e,c(t,a,i,o))})),g}return s={object:function(t){return c(t,0,n,a)},map:function(t){return c(t,0,i,o)},entries:function(t){return function t(r,n){if(++n>l.length)return r;var a,i=u[n-1];return null!=e&&n>=l.length?a=r.entries():(a=[],r.each((function(e,r){a.push({key:r,values:t(e,n)})}))),null!=i?a.sort((function(t,e){return i(t.key,e.key)})):a}(c(t,0,i,o),0)},key:function(t){return l.push(t),s},sortKeys:function(t){return u[l.length-1]=t,s},sortValues:function(e){return t=e,s},rollup:function(t){return e=t,s}}},t.set=u,t.map=r,t.keys=function(t){var e=[];for(var r in t)e.push(r);return e},t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},Object.defineProperty(t,"__esModule",{value:!0})})("object"==typeof r&&void 0!==e?r:this.d3=this.d3||{})},{}],154:[function(t,e,r){(function(t){function e(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function r(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function n(){}var a="\\s*([+-]?\\d+)\\s*",i="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",o="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",s=/^#([0-9a-f]{3})$/,l=/^#([0-9a-f]{6})$/,u=new RegExp("^rgb\\("+[a,a,a]+"\\)$"),c=new RegExp("^rgb\\("+[o,o,o]+"\\)$"),h=new RegExp("^rgba\\("+[a,a,a,i]+"\\)$"),d=new RegExp("^rgba\\("+[o,o,o,i]+"\\)$"),f=new RegExp("^hsl\\("+[i,o,o]+"\\)$"),p=new RegExp("^hsla\\("+[i,o,o,i]+"\\)$"),m={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function g(t){var e;return t=(t+"").trim().toLowerCase(),(e=s.exec(t))?new b((e=parseInt(e[1],16))>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):(e=l.exec(t))?y(parseInt(e[1],16)):(e=u.exec(t))?new b(e[1],e[2],e[3],1):(e=c.exec(t))?new b(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=h.exec(t))?v(e[1],e[2],e[3],e[4]):(e=d.exec(t))?v(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=f.exec(t))?M(e[1],e[2]/100,e[3]/100,1):(e=p.exec(t))?M(e[1],e[2]/100,e[3]/100,e[4]):m.hasOwnProperty(t)?y(m[t]):"transparent"===t?new b(NaN,NaN,NaN,0):null}function y(t){return new b(t>>16&255,t>>8&255,255&t,1)}function v(t,e,r,n){return n<=0&&(t=e=r=NaN),new b(t,e,r,n)}function _(t){return t instanceof n||(t=g(t)),t?new b((t=t.rgb()).r,t.g,t.b,t.opacity):new b}function x(t,e,r,n){return 1===arguments.length?_(t):new b(t,e,r,null==n?1:n)}function b(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function w(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function M(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new T(t,e,r,n)}function k(t,e,r,a){return 1===arguments.length?function(t){if(t instanceof T)return new T(t.h,t.s,t.l,t.opacity);if(t instanceof n||(t=g(t)),!t)return new T;if(t instanceof T)return t;var e=(t=t.rgb()).r/255,r=t.g/255,a=t.b/255,i=Math.min(e,r,a),o=Math.max(e,r,a),s=NaN,l=o-i,u=(o+i)/2;return l?(s=e===o?(r-a)/l+6*(r<a):r===o?(a-e)/l+2:(e-r)/l+4,l/=u<.5?o+i:2-o-i,s*=60):l=u>0&&u<1?0:s,new T(s,l,u,t.opacity)}(t):new T(t,e,r,null==a?1:a)}function T(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function L(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}e(n,g,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}}),e(b,x,r(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new b(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new b(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},hex:function(){return"#"+w(this.r)+w(this.g)+w(this.b)},toString:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(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+")")}})),e(T,k,r(n,{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=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,a=2*r-n;return new b(L(t>=240?t-240:t+120,a,n),L(t,a,n),L(t<120?t+240:t-120,a,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 A=Math.PI/180,S=180/Math.PI,E=.96422,C=.82521,D=4/29,P=6/29,O=3*P*P;function z(t){if(t instanceof R)return new R(t.l,t.a,t.b,t.opacity);if(t instanceof U){if(isNaN(t.h))return new R(t.l,0,0,t.opacity);var e=t.h*A;return new R(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof b||(t=_(t));var r,n,a=j(t.r),i=j(t.g),o=j(t.b),s=F((.2225045*a+.7168786*i+.0606169*o)/1);return a===i&&i===o?r=n=s:(r=F((.4360747*a+.3850649*i+.1430804*o)/E),n=F((.0139322*a+.0971045*i+.7141733*o)/C)),new R(116*s-16,500*(r-s),200*(s-n),t.opacity)}function I(t,e,r,n){return 1===arguments.length?z(t):new R(t,e,r,null==n?1:n)}function R(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function F(t){return t>.008856451679035631?Math.pow(t,1/3):t/O+D}function N(t){return t>P?t*t*t:O*(t-D)}function Y(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function j(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function B(t){if(t instanceof U)return new U(t.h,t.c,t.l,t.opacity);if(t instanceof R||(t=z(t)),0===t.a&&0===t.b)return new U(NaN,0,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*S;return new U(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function H(t,e,r,n){return 1===arguments.length?B(t):new U(t,e,r,null==n?1:n)}function U(t,e,r,n){this.h=+t,this.c=+e,this.l=+r,this.opacity=+n}e(R,I,r(n,{brighter:function(t){return new R(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new R(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 new b(Y(3.1338561*(e=E*N(e))-1.6168667*(t=1*N(t))-.4906146*(r=C*N(r))),Y(-.9787684*e+1.9161415*t+.033454*r),Y(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}})),e(U,H,r(n,{brighter:function(t){return new U(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new U(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return z(this).rgb()}}));var V=-.14861,W=1.78277,G=-.29227,q=-.90649,Z=1.97294,X=Z*q,J=Z*W,K=W*G-q*V;function $(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof Q)return new Q(t.h,t.s,t.l,t.opacity);t instanceof b||(t=_(t));var e=t.r/255,r=t.g/255,n=t.b/255,a=(K*n+X*e-J*r)/(K+X-J),i=n-a,o=(Z*(r-a)-G*i)/q,s=Math.sqrt(o*o+i*i)/(Z*a*(1-a)),l=s?Math.atan2(o,i)*S-120:NaN;return new Q(l<0?l+360:l,s,a,t.opacity)}(t):new Q(t,e,r,null==n?1:n)}function Q(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}e(Q,$,r(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Q(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Q(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*A,e=+this.l,r=isNaN(this.s)?0:this.s*e*(1-e),n=Math.cos(t),a=Math.sin(t);return new b(255*(e+r*(V*n+W*a)),255*(e+r*(G*n+q*a)),255*(e+r*(Z*n)),this.opacity)}})),t.color=g,t.rgb=x,t.hsl=k,t.lab=I,t.hcl=H,t.lch=function(t,e,r,n){return 1===arguments.length?B(t):new U(r,e,t,null==n?1:n)},t.gray=function(t,e){return new R(t,0,0,null==e?1:e)},t.cubehelix=$,Object.defineProperty(t,"__esModule",{value:!0})})("object"==typeof r&&void 0!==e?r:this.d3=this.d3||{})},{}],155:[function(t,e,r){(function(t){var e={value:function(){}};function r(){for(var t,e=0,r=arguments.length,a={};e<r;++e){if(!(t=arguments[e]+"")||t in a)throw new Error("illegal type: "+t);a[t]=[]}return new n(a)}function n(t){this._=t}function a(t,e){for(var r,n=0,a=t.length;n<a;++n)if((r=t[n]).name===e)return r.value}function i(t,r,n){for(var a=0,i=t.length;a<i;++a)if(t[a].name===r){t[a]=e,t=t.slice(0,a).concat(t.slice(a+1));break}return null!=n&&t.push({name:r,value:n}),t}n.prototype=r.prototype={constructor:n,on:function(t,e){var r,n,o=this._,s=(n=o,(t+"").trim().split(/^|\s+/).map((function(t){var e="",r=t.indexOf(".");if(r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),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]=i(o[r],t.name,e);else if(null==e)for(r in o)o[r]=i(o[r],t.name,null);return this}for(;++l<u;)if((r=(t=s[l]).type)&&(r=a(o[r],t.name)))return r},copy:function(){var t={},e=this._;for(var r in e)t[r]=e[r].slice();return new n(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var r,n,a=new Array(r),i=0;i<r;++i)a[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=0,r=(n=this._[t]).length;i<r;++i)n[i].value.apply(e,a)},apply:function(t,e,r){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var n=this._[t],a=0,i=n.length;a<i;++a)n[a].value.apply(e,r)}},t.dispatch=r,Object.defineProperty(t,"__esModule",{value:!0})})("object"==typeof r&&void 0!==e?r:this.d3=this.d3||{})},{}],156:[function(t,e,r){var n,a;n=this,a=function(t,e,r,n,a){var i=function(t){return function(){return t}},o=function(){return 1e-6*(Math.random()-.5)};function s(t){return t.x+t.vx}function l(t){return t.y+t.vy}function u(t){return t.index}function c(t,e){var r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function h(t){return t.x}function d(t){return t.y}var f=Math.PI*(3-Math.sqrt(5));t.forceCenter=function(t,e){var r;function n(){var n,a,i=r.length,o=0,s=0;for(n=0;n<i;++n)o+=(a=r[n]).x,s+=a.y;for(o=o/i-t,s=s/i-e,n=0;n<i;++n)(a=r[n]).x-=o,a.y-=s}return null==t&&(t=0),null==e&&(e=0),n.initialize=function(t){r=t},n.x=function(e){return arguments.length?(t=+e,n):t},n.y=function(t){return arguments.length?(e=+t,n):e},n},t.forceCollide=function(t){var r,n,a=1,u=1;function c(){for(var t,i,c,d,f,p,m,g=r.length,y=0;y<u;++y)for(i=e.quadtree(r,s,l).visitAfter(h),t=0;t<g;++t)c=r[t],p=n[c.index],m=p*p,d=c.x+c.vx,f=c.y+c.vy,i.visit(v);function v(t,e,r,n,i){var s=t.data,l=t.r,u=p+l;if(!s)return e>d+u||n<d-u||r>f+u||i<f-u;if(s.index>c.index){var h=d-s.x-s.vx,g=f-s.y-s.vy,y=h*h+g*g;y<u*u&&(0===h&&(y+=(h=o())*h),0===g&&(y+=(g=o())*g),y=(u-(y=Math.sqrt(y)))/y*a,c.vx+=(h*=y)*(u=(l*=l)/(m+l)),c.vy+=(g*=y)*u,s.vx-=h*(u=1-u),s.vy-=g*u)}}}function h(t){if(t.data)return t.r=n[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 d(){if(r){var e,a,i=r.length;for(n=new Array(i),e=0;e<i;++e)a=r[e],n[a.index]=+t(a,e,r)}}return"function"!=typeof t&&(t=i(null==t?1:+t)),c.initialize=function(t){r=t,d()},c.iterations=function(t){return arguments.length?(u=+t,c):u},c.strength=function(t){return arguments.length?(a=+t,c):a},c.radius=function(e){return arguments.length?(t="function"==typeof e?e:i(+e),d(),c):t},c},t.forceLink=function(t){var e,n,a,s,l,h=u,d=function(t){return 1/Math.min(s[t.source.index],s[t.target.index])},f=i(30),p=1;function m(r){for(var a=0,i=t.length;a<p;++a)for(var s,u,c,h,d,f,m,g=0;g<i;++g)u=(s=t[g]).source,h=(c=s.target).x+c.vx-u.x-u.vx||o(),d=c.y+c.vy-u.y-u.vy||o(),h*=f=((f=Math.sqrt(h*h+d*d))-n[g])/f*r*e[g],d*=f,c.vx-=h*(m=l[g]),c.vy-=d*m,u.vx+=h*(m=1-m),u.vy+=d*m}function g(){if(a){var i,o,u=a.length,d=t.length,f=r.map(a,h);for(i=0,s=new Array(u);i<d;++i)(o=t[i]).index=i,"object"!=typeof o.source&&(o.source=c(f,o.source)),"object"!=typeof o.target&&(o.target=c(f,o.target)),s[o.source.index]=(s[o.source.index]||0)+1,s[o.target.index]=(s[o.target.index]||0)+1;for(i=0,l=new Array(d);i<d;++i)o=t[i],l[i]=s[o.source.index]/(s[o.source.index]+s[o.target.index]);e=new Array(d),y(),n=new Array(d),v()}}function y(){if(a)for(var r=0,n=t.length;r<n;++r)e[r]=+d(t[r],r,t)}function v(){if(a)for(var e=0,r=t.length;e<r;++e)n[e]=+f(t[e],e,t)}return null==t&&(t=[]),m.initialize=function(t){a=t,g()},m.links=function(e){return arguments.length?(t=e,g(),m):t},m.id=function(t){return arguments.length?(h=t,m):h},m.iterations=function(t){return arguments.length?(p=+t,m):p},m.strength=function(t){return arguments.length?(d="function"==typeof t?t:i(+t),y(),m):d},m.distance=function(t){return arguments.length?(f="function"==typeof t?t:i(+t),v(),m):f},m},t.forceManyBody=function(){var t,r,n,a,s=i(-30),l=1,u=1/0,c=.81;function f(a){var i,o=t.length,s=e.quadtree(t,h,d).visitAfter(m);for(n=a,i=0;i<o;++i)r=t[i],s.visit(g)}function p(){if(t){var e,r,n=t.length;for(a=new Array(n),e=0;e<n;++e)r=t[e],a[r.index]=+s(r,e,t)}}function m(t){var e,r,n,i,o,s=0,l=0;if(t.length){for(n=i=o=0;o<4;++o)(e=t[o])&&(r=Math.abs(e.value))&&(s+=e.value,l+=r,n+=r*e.x,i+=r*e.y);t.x=n/l,t.y=i/l}else{(e=t).x=e.data.x,e.y=e.data.y;do{s+=a[e.data.index]}while(e=e.next)}t.value=s}function g(t,e,i,s){if(!t.value)return!0;var h=t.x-r.x,d=t.y-r.y,f=s-e,p=h*h+d*d;if(f*f/c<p)return p<u&&(0===h&&(p+=(h=o())*h),0===d&&(p+=(d=o())*d),p<l&&(p=Math.sqrt(l*p)),r.vx+=h*t.value*n/p,r.vy+=d*t.value*n/p),!0;if(!(t.length||p>=u)){(t.data!==r||t.next)&&(0===h&&(p+=(h=o())*h),0===d&&(p+=(d=o())*d),p<l&&(p=Math.sqrt(l*p)));do{t.data!==r&&(f=a[t.data.index]*n/p,r.vx+=h*f,r.vy+=d*f)}while(t=t.next)}}return f.initialize=function(e){t=e,p()},f.strength=function(t){return arguments.length?(s="function"==typeof t?t:i(+t),p(),f):s},f.distanceMin=function(t){return arguments.length?(l=t*t,f):Math.sqrt(l)},f.distanceMax=function(t){return arguments.length?(u=t*t,f):Math.sqrt(u)},f.theta=function(t){return arguments.length?(c=t*t,f):Math.sqrt(c)},f},t.forceRadial=function(t,e,r){var n,a,o,s=i(.1);function l(t){for(var i=0,s=n.length;i<s;++i){var l=n[i],u=l.x-e||1e-6,c=l.y-r||1e-6,h=Math.sqrt(u*u+c*c),d=(o[i]-h)*a[i]*t/h;l.vx+=u*d,l.vy+=c*d}}function u(){if(n){var e,r=n.length;for(a=new Array(r),o=new Array(r),e=0;e<r;++e)o[e]=+t(n[e],e,n),a[e]=isNaN(o[e])?0:+s(n[e],e,n)}}return"function"!=typeof t&&(t=i(+t)),null==e&&(e=0),null==r&&(r=0),l.initialize=function(t){n=t,u()},l.strength=function(t){return arguments.length?(s="function"==typeof t?t:i(+t),u(),l):s},l.radius=function(e){return arguments.length?(t="function"==typeof e?e:i(+e),u(),l):t},l.x=function(t){return arguments.length?(e=+t,l):e},l.y=function(t){return arguments.length?(r=+t,l):r},l},t.forceSimulation=function(t){var e,i=1,o=.001,s=1-Math.pow(o,1/300),l=0,u=.6,c=r.map(),h=a.timer(p),d=n.dispatch("tick","end");function p(){m(),d.call("tick",e),i<o&&(h.stop(),d.call("end",e))}function m(){var e,r,n=t.length;for(i+=(l-i)*s,c.each((function(t){t(i)})),e=0;e<n;++e)null==(r=t[e]).fx?r.x+=r.vx*=u:(r.x=r.fx,r.vx=0),null==r.fy?r.y+=r.vy*=u:(r.y=r.fy,r.vy=0)}function g(){for(var e,r=0,n=t.length;r<n;++r){if((e=t[r]).index=r,isNaN(e.x)||isNaN(e.y)){var a=10*Math.sqrt(r),i=r*f;e.x=a*Math.cos(i),e.y=a*Math.sin(i)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function y(e){return e.initialize&&e.initialize(t),e}return null==t&&(t=[]),g(),e={tick:m,restart:function(){return h.restart(p),e},stop:function(){return h.stop(),e},nodes:function(r){return arguments.length?(t=r,g(),c.each(y),e):t},alpha:function(t){return arguments.length?(i=+t,e):i},alphaMin:function(t){return arguments.length?(o=+t,e):o},alphaDecay:function(t){return arguments.length?(s=+t,e):+s},alphaTarget:function(t){return arguments.length?(l=+t,e):l},velocityDecay:function(t){return arguments.length?(u=1-t,e):1-u},force:function(t,r){return arguments.length>1?(null==r?c.remove(t):c.set(t,y(r)),e):c.get(t)},find:function(e,r,n){var a,i,o,s,l,u=0,c=t.length;for(null==n?n=1/0:n*=n,u=0;u<c;++u)(o=(a=e-(s=t[u]).x)*a+(i=r-s.y)*i)<n&&(l=s,n=o);return l},on:function(t,r){return arguments.length>1?(d.on(t,r),e):d.on(t)}}},t.forceX=function(t){var e,r,n,a=i(.1);function o(t){for(var a,i=0,o=e.length;i<o;++i)(a=e[i]).vx+=(n[i]-a.x)*r[i]*t}function s(){if(e){var i,o=e.length;for(r=new Array(o),n=new Array(o),i=0;i<o;++i)r[i]=isNaN(n[i]=+t(e[i],i,e))?0:+a(e[i],i,e)}}return"function"!=typeof t&&(t=i(null==t?0:+t)),o.initialize=function(t){e=t,s()},o.strength=function(t){return arguments.length?(a="function"==typeof t?t:i(+t),s(),o):a},o.x=function(e){return arguments.length?(t="function"==typeof e?e:i(+e),s(),o):t},o},t.forceY=function(t){var e,r,n,a=i(.1);function o(t){for(var a,i=0,o=e.length;i<o;++i)(a=e[i]).vy+=(n[i]-a.y)*r[i]*t}function s(){if(e){var i,o=e.length;for(r=new Array(o),n=new Array(o),i=0;i<o;++i)r[i]=isNaN(n[i]=+t(e[i],i,e))?0:+a(e[i],i,e)}}return"function"!=typeof t&&(t=i(null==t?0:+t)),o.initialize=function(t){e=t,s()},o.strength=function(t){return arguments.length?(a="function"==typeof t?t:i(+t),s(),o):a},o.y=function(e){return arguments.length?(t="function"==typeof e?e:i(+e),s(),o):t},o},Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof r&&void 0!==e?a(r,t("d3-quadtree"),t("d3-collection"),t("d3-dispatch"),t("d3-timer")):a(n.d3=n.d3||{},n.d3,n.d3,n.d3,n.d3)},{"d3-collection":153,"d3-dispatch":155,"d3-quadtree":160,"d3-timer":162}],157:[function(t,e,r){(function(t){function e(t,e){return t.parent===e.parent?1:2}function r(t,e){return t+e.x}function n(t,e){return Math.max(t,e.y)}function a(t){var e=0,r=t.children,n=r&&r.length;if(n)for(;--n>=0;)e+=r[n].value;else e=1;t.value=e}function i(t,e){var r,n,a,i,s,c=new u(t),h=+t.value&&(c.value=t.value),d=[c];for(null==e&&(e=o);r=d.pop();)if(h&&(r.value=+r.data.value),(a=e(r.data))&&(s=a.length))for(r.children=new Array(s),i=s-1;i>=0;--i)d.push(n=r.children[i]=new u(a[i])),n.parent=r,n.depth=r.depth+1;return c.eachBefore(l)}function o(t){return t.children}function s(t){t.data=t.data.data}function l(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function u(t){this.data=t,this.depth=this.height=0,this.parent=null}u.prototype=i.prototype={constructor:u,count:function(){return this.eachAfter(a)},each:function(t){var e,r,n,a,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(t(i),r=i.children)for(n=0,a=r.length;n<a;++n)o.push(r[n])}while(o.length);return this},eachAfter:function(t){for(var e,r,n,a=this,i=[a],o=[];a=i.pop();)if(o.push(a),e=a.children)for(r=0,n=e.length;r<n;++r)i.push(e[r]);for(;a=o.pop();)t(a);return this},eachBefore:function(t){for(var e,r,n=this,a=[n];n=a.pop();)if(t(n),e=n.children)for(r=e.length-1;r>=0;--r)a.push(e[r]);return this},sum:function(t){return this.eachAfter((function(e){for(var r=+t(e.data)||0,n=e.children,a=n&&n.length;--a>=0;)r+=n[a].value;e.value=r}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,r=function(t,e){if(t===e)return t;var r=t.ancestors(),n=e.ancestors(),a=null;for(t=r.pop(),e=n.pop();t===e;)a=t,t=r.pop(),e=n.pop();return a}(e,t),n=[e];e!==r;)e=e.parent,n.push(e);for(var a=n.length;t!==r;)n.splice(a,0,t),t=t.parent;return n},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each((function(e){t.push(e)})),t},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(r){r!==t&&e.push({source:r.parent,target:r})})),e},copy:function(){return i(this).eachBefore(s)}};var c=Array.prototype.slice;function h(t){for(var e,r,n=0,a=(t=function(t){for(var e,r,n=t.length;n;)r=Math.random()*n--|0,e=t[n],t[n]=t[r],t[r]=e;return t}(c.call(t))).length,i=[];n<a;)e=t[n],r&&p(r,e)?++n:(r=g(i=d(i,e)),n=0);return r}function d(t,e){var r,n;if(m(e,t))return[e];for(r=0;r<t.length;++r)if(f(e,t[r])&&m(y(t[r],e),t))return[t[r],e];for(r=0;r<t.length-1;++r)for(n=r+1;n<t.length;++n)if(f(y(t[r],t[n]),e)&&f(y(t[r],e),t[n])&&f(y(t[n],e),t[r])&&m(v(t[r],t[n],e),t))return[t[r],t[n],e];throw new Error}function f(t,e){var r=t.r-e.r,n=e.x-t.x,a=e.y-t.y;return r<0||r*r<n*n+a*a}function p(t,e){var r=t.r-e.r+1e-6,n=e.x-t.x,a=e.y-t.y;return r>0&&r*r>n*n+a*a}function m(t,e){for(var r=0;r<e.length;++r)if(!p(t,e[r]))return!1;return!0}function g(t){switch(t.length){case 1:return{x:(e=t[0]).x,y:e.y,r:e.r};case 2:return y(t[0],t[1]);case 3:return v(t[0],t[1],t[2])}var e}function y(t,e){var r=t.x,n=t.y,a=t.r,i=e.x,o=e.y,s=e.r,l=i-r,u=o-n,c=s-a,h=Math.sqrt(l*l+u*u);return{x:(r+i+l/h*c)/2,y:(n+o+u/h*c)/2,r:(h+a+s)/2}}function v(t,e,r){var n=t.x,a=t.y,i=t.r,o=e.x,s=e.y,l=e.r,u=r.x,c=r.y,h=r.r,d=n-o,f=n-u,p=a-s,m=a-c,g=l-i,y=h-i,v=n*n+a*a-i*i,_=v-o*o-s*s+l*l,x=v-u*u-c*c+h*h,b=f*p-d*m,w=(p*x-m*_)/(2*b)-n,M=(m*g-p*y)/b,k=(f*_-d*x)/(2*b)-a,T=(d*y-f*g)/b,L=M*M+T*T-1,A=2*(i+w*M+k*T),S=w*w+k*k-i*i,E=-(L?(A+Math.sqrt(A*A-4*L*S))/(2*L):S/A);return{x:n+w+M*E,y:a+k+T*E,r:E}}function _(t,e,r){var n,a,i,o,s=t.x-e.x,l=t.y-e.y,u=s*s+l*l;u?(a=e.r+r.r,a*=a,o=t.r+r.r,a>(o*=o)?(n=(u+o-a)/(2*u),i=Math.sqrt(Math.max(0,o/u-n*n)),r.x=t.x-n*s-i*l,r.y=t.y-n*l+i*s):(n=(u+a-o)/(2*u),i=Math.sqrt(Math.max(0,a/u-n*n)),r.x=e.x+n*s-i*l,r.y=e.y+n*l+i*s)):(r.x=e.x+r.r,r.y=e.y)}function x(t,e){var r=t.r+e.r-1e-6,n=e.x-t.x,a=e.y-t.y;return r>0&&r*r>n*n+a*a}function b(t){var e=t._,r=t.next._,n=e.r+r.r,a=(e.x*r.r+r.x*e.r)/n,i=(e.y*r.r+r.y*e.r)/n;return a*a+i*i}function w(t){this._=t,this.next=null,this.previous=null}function M(t){if(!(a=t.length))return 0;var e,r,n,a,i,o,s,l,u,c,d;if((e=t[0]).x=0,e.y=0,!(a>1))return e.r;if(r=t[1],e.x=-r.r,r.x=e.r,r.y=0,!(a>2))return e.r+r.r;_(r,e,n=t[2]),e=new w(e),r=new w(r),n=new w(n),e.next=n.previous=r,r.next=e.previous=n,n.next=r.previous=e;t:for(s=3;s<a;++s){_(e._,r._,n=t[s]),n=new w(n),l=r.next,u=e.previous,c=r._.r,d=e._.r;do{if(c<=d){if(x(l._,n._)){r=l,e.next=r,r.previous=e,--s;continue t}c+=l._.r,l=l.next}else{if(x(u._,n._)){(e=u).next=r,r.previous=e,--s;continue t}d+=u._.r,u=u.previous}}while(l!==u.next);for(n.previous=e,n.next=r,e.next=r.previous=r=n,i=b(e);(n=n.next)!==r;)(o=b(n))<i&&(e=n,i=o);r=e.next}for(e=[r._],n=r;(n=n.next)!==r;)e.push(n._);for(n=h(e),s=0;s<a;++s)(e=t[s]).x-=n.x,e.y-=n.y;return n.r}function k(t){if("function"!=typeof t)throw new Error;return t}function T(){return 0}function L(t){return function(){return t}}function A(t){return Math.sqrt(t.value)}function S(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function E(t,e){return function(r){if(n=r.children){var n,a,i,o=n.length,s=t(r)*e||0;if(s)for(a=0;a<o;++a)n[a].r+=s;if(i=M(n),s)for(a=0;a<o;++a)n[a].r-=s;r.r=i+s}}}function C(t){return function(e){var r=e.parent;e.r*=t,r&&(e.x=r.x+t*e.x,e.y=r.y+t*e.y)}}function D(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function P(t,e,r,n,a){for(var i,o=t.children,s=-1,l=o.length,u=t.value&&(n-e)/t.value;++s<l;)(i=o[s]).y0=r,i.y1=a,i.x0=e,i.x1=e+=i.value*u}var O={depth:-1},z={};function I(t){return t.id}function R(t){return t.parentId}function F(t,e){return t.parent===e.parent?1:2}function N(t){var e=t.children;return e?e[0]:t.t}function Y(t){var e=t.children;return e?e[e.length-1]:t.t}function j(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 B(t,e,r){return t.a.parent===e.parent?t.a:r}function H(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function U(t,e,r,n,a){for(var i,o=t.children,s=-1,l=o.length,u=t.value&&(a-r)/t.value;++s<l;)(i=o[s]).x0=e,i.x1=n,i.y0=r,i.y1=r+=i.value*u}H.prototype=Object.create(u.prototype);var V=(1+Math.sqrt(5))/2;function W(t,e,r,n,a,i){for(var o,s,l,u,c,h,d,f,p,m,g,y=[],v=e.children,_=0,x=0,b=v.length,w=e.value;_<b;){l=a-r,u=i-n;do{c=v[x++].value}while(!c&&x<b);for(h=d=c,g=c*c*(m=Math.max(u/l,l/u)/(w*t)),p=Math.max(d/g,g/h);x<b;++x){if(c+=s=v[x].value,s<h&&(h=s),s>d&&(d=s),g=c*c*m,(f=Math.max(d/g,g/h))>p){c-=s;break}p=f}y.push(o={value:c,dice:l<u,children:v.slice(_,x)}),o.dice?P(o,r,n,a,w?n+=u*c/w:i):U(o,r,n,w?r+=l*c/w:a,i),w-=c,_=x}return y}var G=function t(e){function r(t,r,n,a,i){W(e,t,r,n,a,i)}return r.ratio=function(e){return t((e=+e)>1?e:1)},r}(V),q=function t(e){function r(t,r,n,a,i){if((o=t._squarify)&&o.ratio===e)for(var o,s,l,u,c,h=-1,d=o.length,f=t.value;++h<d;){for(l=(s=o[h]).children,u=s.value=0,c=l.length;u<c;++u)s.value+=l[u].value;s.dice?P(s,r,n,a,n+=(i-n)*s.value/f):U(s,r,n,r+=(a-r)*s.value/f,i),f-=s.value}else t._squarify=o=W(e,t,r,n,a,i),o.ratio=e}return r.ratio=function(e){return t((e=+e)>1?e:1)},r}(V);t.cluster=function(){var t=e,a=1,i=1,o=!1;function s(e){var s,l=0;e.eachAfter((function(e){var a=e.children;a?(e.x=function(t){return t.reduce(r,0)/t.length}(a),e.y=function(t){return 1+t.reduce(n,0)}(a)):(e.x=s?l+=t(e,s):0,e.y=0,s=e)}));var u=function(t){for(var e;e=t.children;)t=e[0];return t}(e),c=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(e),h=u.x-t(u,c)/2,d=c.x+t(c,u)/2;return e.eachAfter(o?function(t){t.x=(t.x-e.x)*a,t.y=(e.y-t.y)*i}:function(t){t.x=(t.x-h)/(d-h)*a,t.y=(1-(e.y?t.y/e.y:1))*i})}return s.separation=function(e){return arguments.length?(t=e,s):t},s.size=function(t){return arguments.length?(o=!1,a=+t[0],i=+t[1],s):o?null:[a,i]},s.nodeSize=function(t){return arguments.length?(o=!0,a=+t[0],i=+t[1],s):o?[a,i]:null},s},t.hierarchy=i,t.pack=function(){var t=null,e=1,r=1,n=T;function a(a){return a.x=e/2,a.y=r/2,t?a.eachBefore(S(t)).eachAfter(E(n,.5)).eachBefore(C(1)):a.eachBefore(S(A)).eachAfter(E(T,1)).eachAfter(E(n,a.r/Math.min(e,r))).eachBefore(C(Math.min(e,r)/(2*a.r))),a}return a.radius=function(e){return arguments.length?(t=null==(r=e)?null:k(r),a):t;var r},a.size=function(t){return arguments.length?(e=+t[0],r=+t[1],a):[e,r]},a.padding=function(t){return arguments.length?(n="function"==typeof t?t:L(+t),a):n},a},t.packSiblings=function(t){return M(t),t},t.packEnclose=h,t.partition=function(){var t=1,e=1,r=0,n=!1;function a(a){var i=a.height+1;return a.x0=a.y0=r,a.x1=t,a.y1=e/i,a.eachBefore(function(t,e){return function(n){n.children&&P(n,n.x0,t*(n.depth+1)/e,n.x1,t*(n.depth+2)/e);var a=n.x0,i=n.y0,o=n.x1-r,s=n.y1-r;o<a&&(a=o=(a+o)/2),s<i&&(i=s=(i+s)/2),n.x0=a,n.y0=i,n.x1=o,n.y1=s}}(e,i)),n&&a.eachBefore(D),a}return a.round=function(t){return arguments.length?(n=!!t,a):n},a.size=function(r){return arguments.length?(t=+r[0],e=+r[1],a):[t,e]},a.padding=function(t){return arguments.length?(r=+t,a):r},a},t.stratify=function(){var t=I,e=R;function r(r){var n,a,i,o,s,c,h,d=r.length,f=new Array(d),p={};for(a=0;a<d;++a)n=r[a],s=f[a]=new u(n),null!=(c=t(n,a,r))&&(c+="")&&(p[h="$"+(s.id=c)]=h in p?z:s);for(a=0;a<d;++a)if(s=f[a],null!=(c=e(r[a],a,r))&&(c+="")){if(!(o=p["$"+c]))throw new Error("missing: "+c);if(o===z)throw new Error("ambiguous: "+c);o.children?o.children.push(s):o.children=[s],s.parent=o}else{if(i)throw new Error("multiple roots");i=s}if(!i)throw new Error("no root");if(i.parent=O,i.eachBefore((function(t){t.depth=t.parent.depth+1,--d})).eachBefore(l),i.parent=null,d>0)throw new Error("cycle");return i}return r.id=function(e){return arguments.length?(t=k(e),r):t},r.parentId=function(t){return arguments.length?(e=k(t),r):e},r},t.tree=function(){var t=F,e=1,r=1,n=null;function a(a){var l=function(t){for(var e,r,n,a,i,o=new H(t,0),s=[o];e=s.pop();)if(n=e._.children)for(e.children=new Array(i=n.length),a=i-1;a>=0;--a)s.push(r=e.children[a]=new H(n[a],a)),r.parent=e;return(o.parent=new H(null,0)).children=[o],o}(a);if(l.eachAfter(i),l.parent.m=-l.z,l.eachBefore(o),n)a.eachBefore(s);else{var u=a,c=a,h=a;a.eachBefore((function(t){t.x<u.x&&(u=t),t.x>c.x&&(c=t),t.depth>h.depth&&(h=t)}));var d=u===c?1:t(u,c)/2,f=d-u.x,p=e/(c.x+d+f),m=r/(h.depth||1);a.eachBefore((function(t){t.x=(t.x+f)*p,t.y=t.depth*m}))}return a}function i(e){var r=e.children,n=e.parent.children,a=e.i?n[e.i-1]:null;if(r){!function(t){for(var e,r=0,n=0,a=t.children,i=a.length;--i>=0;)(e=a[i]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(e);var i=(r[0].z+r[r.length-1].z)/2;a?(e.z=a.z+t(e._,a._),e.m=e.z-i):e.z=i}else a&&(e.z=a.z+t(e._,a._));e.parent.A=function(e,r,n){if(r){for(var a,i=e,o=e,s=r,l=i.parent.children[0],u=i.m,c=o.m,h=s.m,d=l.m;s=Y(s),i=N(i),s&&i;)l=N(l),(o=Y(o)).a=e,(a=s.z+h-i.z-u+t(s._,i._))>0&&(j(B(s,e,n),e,a),u+=a,c+=a),h+=s.m,u+=i.m,d+=l.m,c+=o.m;s&&!Y(o)&&(o.t=s,o.m+=h-c),i&&!N(l)&&(l.t=i,l.m+=u-d,n=e)}return n}(e,a,e.parent.A||n[0])}function o(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*r}return a.separation=function(e){return arguments.length?(t=e,a):t},a.size=function(t){return arguments.length?(n=!1,e=+t[0],r=+t[1],a):n?null:[e,r]},a.nodeSize=function(t){return arguments.length?(n=!0,e=+t[0],r=+t[1],a):n?[e,r]:null},a},t.treemap=function(){var t=G,e=!1,r=1,n=1,a=[0],i=T,o=T,s=T,l=T,u=T;function c(t){return t.x0=t.y0=0,t.x1=r,t.y1=n,t.eachBefore(h),a=[0],e&&t.eachBefore(D),t}function h(e){var r=a[e.depth],n=e.x0+r,c=e.y0+r,h=e.x1-r,d=e.y1-r;h<n&&(n=h=(n+h)/2),d<c&&(c=d=(c+d)/2),e.x0=n,e.y0=c,e.x1=h,e.y1=d,e.children&&(r=a[e.depth+1]=i(e)/2,n+=u(e)-r,c+=o(e)-r,(h-=s(e)-r)<n&&(n=h=(n+h)/2),(d-=l(e)-r)<c&&(c=d=(c+d)/2),t(e,n,c,h,d))}return c.round=function(t){return arguments.length?(e=!!t,c):e},c.size=function(t){return arguments.length?(r=+t[0],n=+t[1],c):[r,n]},c.tile=function(e){return arguments.length?(t=k(e),c):t},c.padding=function(t){return arguments.length?c.paddingInner(t).paddingOuter(t):c.paddingInner()},c.paddingInner=function(t){return arguments.length?(i="function"==typeof t?t:L(+t),c):i},c.paddingOuter=function(t){return arguments.length?c.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):c.paddingTop()},c.paddingTop=function(t){return arguments.length?(o="function"==typeof t?t:L(+t),c):o},c.paddingRight=function(t){return arguments.length?(s="function"==typeof t?t:L(+t),c):s},c.paddingBottom=function(t){return arguments.length?(l="function"==typeof t?t:L(+t),c):l},c.paddingLeft=function(t){return arguments.length?(u="function"==typeof t?t:L(+t),c):u},c},t.treemapBinary=function(t,e,r,n,a){var i,o,s=t.children,l=s.length,u=new Array(l+1);for(u[0]=o=i=0;i<l;++i)u[i+1]=o+=s[i].value;!function t(e,r,n,a,i,o,l){if(e>=r-1){var c=s[e];return c.x0=a,c.y0=i,c.x1=o,void(c.y1=l)}for(var h=u[e],d=n/2+h,f=e+1,p=r-1;f<p;){var m=f+p>>>1;u[m]<d?f=m+1:p=m}d-u[f-1]<u[f]-d&&e+1<f&&--f;var g=u[f]-h,y=n-g;if(o-a>l-i){var v=(a*y+o*g)/n;t(e,f,g,a,i,v,l),t(f,r,y,v,i,o,l)}else{var _=(i*y+l*g)/n;t(e,f,g,a,i,o,_),t(f,r,y,a,_,o,l)}}(0,l,t.value,e,r,n,a)},t.treemapDice=P,t.treemapSlice=U,t.treemapSliceDice=function(t,e,r,n,a){(1&t.depth?U:P)(t,e,r,n,a)},t.treemapSquarify=G,t.treemapResquarify=q,Object.defineProperty(t,"__esModule",{value:!0})})("object"==typeof r&&void 0!==e?r:this.d3=this.d3||{})},{}],158:[function(t,e,r){var n,a;n=this,a=function(t,e){function r(t,e,r,n,a){var i=t*t,o=i*t;return((1-3*t+3*i-o)*e+(4-6*i+3*o)*r+(1+3*t+3*i-3*o)*n+o*a)/6}function n(t){var e=t.length-1;return function(n){var a=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[a],o=t[a+1],s=a>0?t[a-1]:2*i-o,l=a<e-1?t[a+2]:2*o-i;return r((n-a/e)*e,s,i,o,l)}}function a(t){var e=t.length;return function(n){var a=Math.floor(((n%=1)<0?++n:n)*e),i=t[(a+e-1)%e],o=t[a%e],s=t[(a+1)%e],l=t[(a+2)%e];return r((n-a/e)*e,i,o,s,l)}}function i(t){return function(){return t}}function o(t,e){return function(r){return t+r*e}}function s(t,e){var r=e-t;return r?o(t,r>180||r<-180?r-360*Math.round(r/360):r):i(isNaN(t)?e:t)}function l(t,e){var r=e-t;return r?o(t,r):i(isNaN(t)?e:t)}var u=function t(r){var n=function(t){return 1==(t=+t)?l:function(e,r){return r-e?function(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)}}(e,r,t):i(isNaN(e)?r:e)}}(r);function a(t,r){var a=n((t=e.rgb(t)).r,(r=e.rgb(r)).r),i=n(t.g,r.g),o=n(t.b,r.b),s=l(t.opacity,r.opacity);return function(e){return t.r=a(e),t.g=i(e),t.b=o(e),t.opacity=s(e),t+""}}return a.gamma=t,a}(1);function c(t){return function(r){var n,a,i=r.length,o=new Array(i),s=new Array(i),l=new Array(i);for(n=0;n<i;++n)a=e.rgb(r[n]),o[n]=a.r||0,s[n]=a.g||0,l[n]=a.b||0;return o=t(o),s=t(s),l=t(l),a.opacity=1,function(t){return a.r=o(t),a.g=s(t),a.b=l(t),a+""}}}var h=c(n),d=c(a);function f(t,e){var r,n=e?e.length:0,a=t?Math.min(n,t.length):0,i=new Array(a),o=new Array(n);for(r=0;r<a;++r)i[r]=x(t[r],e[r]);for(;r<n;++r)o[r]=e[r];return function(t){for(r=0;r<a;++r)o[r]=i[r](t);return o}}function p(t,e){var r=new Date;return e-=t=+t,function(n){return r.setTime(t+e*n),r}}function m(t,e){return e-=t=+t,function(r){return t+e*r}}function g(t,e){var r,n={},a={};for(r in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)r in t?n[r]=x(t[r],e[r]):a[r]=e[r];return function(t){for(r in n)a[r]=n[r](t);return a}}var y=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,v=new RegExp(y.source,"g");function _(t,e){var r,n,a,i=y.lastIndex=v.lastIndex=0,o=-1,s=[],l=[];for(t+="",e+="";(r=y.exec(t))&&(n=v.exec(e));)(a=n.index)>i&&(a=e.slice(i,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:m(r,n)})),i=v.lastIndex;return i<e.length&&(a=e.slice(i),s[o]?s[o]+=a:s[++o]=a),s.length<2?l[0]?function(t){return function(e){return t(e)+""}}(l[0].x):function(t){return function(){return t}}(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 x(t,r){var n,a=typeof r;return null==r||"boolean"===a?i(r):("number"===a?m:"string"===a?(n=e.color(r))?(r=n,u):_:r instanceof e.color?u:r instanceof Date?p:Array.isArray(r)?f:"function"!=typeof r.valueOf&&"function"!=typeof r.toString||isNaN(r)?g:m)(t,r)}var b,w,M,k,T=180/Math.PI,L={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function A(t,e,r,n,a,i){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:a,translateY:i,rotate:Math.atan2(e,t)*T,skewX:Math.atan(l)*T,scaleX:o,scaleY:s}}function S(t,e,r,n){function a(t){return t.length?t.pop()+" ":""}return function(i,o){var s=[],l=[];return i=t(i),o=t(o),function(t,n,a,i,o,s){if(t!==a||n!==i){var l=o.push("translate(",null,e,null,r);s.push({i:l-4,x:m(t,a)},{i:l-2,x:m(n,i)})}else(a||i)&&o.push("translate("+a+e+i+r)}(i.translateX,i.translateY,o.translateX,o.translateY,s,l),function(t,e,r,i){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),i.push({i:r.push(a(r)+"rotate(",null,n)-2,x:m(t,e)})):e&&r.push(a(r)+"rotate("+e+n)}(i.rotate,o.rotate,s,l),function(t,e,r,i){t!==e?i.push({i:r.push(a(r)+"skewX(",null,n)-2,x:m(t,e)}):e&&r.push(a(r)+"skewX("+e+n)}(i.skewX,o.skewX,s,l),function(t,e,r,n,i,o){if(t!==r||e!==n){var s=i.push(a(i)+"scale(",null,",",null,")");o.push({i:s-4,x:m(t,r)},{i:s-2,x:m(e,n)})}else 1===r&&1===n||i.push(a(i)+"scale("+r+","+n+")")}(i.scaleX,i.scaleY,o.scaleX,o.scaleY,s,l),i=o=null,function(t){for(var e,r=-1,n=l.length;++r<n;)s[(e=l[r]).i]=e.x(t);return s.join("")}}}var E=S((function(t){return"none"===t?L:(b||(b=document.createElement("DIV"),w=document.documentElement,M=document.defaultView),b.style.transform=t,t=M.getComputedStyle(w.appendChild(b),null).getPropertyValue("transform"),w.removeChild(b),A(+(t=t.slice(7,-1).split(","))[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}),"px, ","px)","deg)"),C=S((function(t){return null==t?L:(k||(k=document.createElementNS("http://www.w3.org/2000/svg","g")),k.setAttribute("transform",t),(t=k.transform.baseVal.consolidate())?A((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):L)}),", ",")",")"),D=Math.SQRT2;function P(t){return((t=Math.exp(t))+1/t)/2}function O(t){return function(r,n){var a=t((r=e.hsl(r)).h,(n=e.hsl(n)).h),i=l(r.s,n.s),o=l(r.l,n.l),s=l(r.opacity,n.opacity);return function(t){return r.h=a(t),r.s=i(t),r.l=o(t),r.opacity=s(t),r+""}}}var z=O(s),I=O(l);function R(t){return function(r,n){var a=t((r=e.hcl(r)).h,(n=e.hcl(n)).h),i=l(r.c,n.c),o=l(r.l,n.l),s=l(r.opacity,n.opacity);return function(t){return r.h=a(t),r.c=i(t),r.l=o(t),r.opacity=s(t),r+""}}}var F=R(s),N=R(l);function Y(t){return function r(n){function a(r,a){var i=t((r=e.cubehelix(r)).h,(a=e.cubehelix(a)).h),o=l(r.s,a.s),s=l(r.l,a.l),u=l(r.opacity,a.opacity);return function(t){return r.h=i(t),r.s=o(t),r.l=s(Math.pow(t,n)),r.opacity=u(t),r+""}}return n=+n,a.gamma=r,a}(1)}var j=Y(s),B=Y(l);t.interpolate=x,t.interpolateArray=f,t.interpolateBasis=n,t.interpolateBasisClosed=a,t.interpolateDate=p,t.interpolateDiscrete=function(t){var e=t.length;return function(r){return t[Math.max(0,Math.min(e-1,Math.floor(r*e)))]}},t.interpolateHue=function(t,e){var r=s(+t,+e);return function(t){var e=r(t);return e-360*Math.floor(e/360)}},t.interpolateNumber=m,t.interpolateObject=g,t.interpolateRound=function(t,e){return e-=t=+t,function(r){return Math.round(t+e*r)}},t.interpolateString=_,t.interpolateTransformCss=E,t.interpolateTransformSvg=C,t.interpolateZoom=function(t,e){var r,n,a=t[0],i=t[1],o=t[2],s=e[0],l=e[1],u=e[2],c=s-a,h=l-i,d=c*c+h*h;if(d<1e-12)n=Math.log(u/o)/D,r=function(t){return[a+t*c,i+t*h,o*Math.exp(D*t*n)]};else{var f=Math.sqrt(d),p=(u*u-o*o+4*d)/(2*o*2*f),m=(u*u-o*o-4*d)/(2*u*2*f),g=Math.log(Math.sqrt(p*p+1)-p),y=Math.log(Math.sqrt(m*m+1)-m);n=(y-g)/D,r=function(t){var e,r=t*n,s=P(g),l=o/(2*f)*(s*(e=D*r+g,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(g));return[a+l*c,i+l*h,o*s/P(D*r+g)]}}return r.duration=1e3*n,r},t.interpolateRgb=u,t.interpolateRgbBasis=h,t.interpolateRgbBasisClosed=d,t.interpolateHsl=z,t.interpolateHslLong=I,t.interpolateLab=function(t,r){var n=l((t=e.lab(t)).l,(r=e.lab(r)).l),a=l(t.a,r.a),i=l(t.b,r.b),o=l(t.opacity,r.opacity);return function(e){return t.l=n(e),t.a=a(e),t.b=i(e),t.opacity=o(e),t+""}},t.interpolateHcl=F,t.interpolateHclLong=N,t.interpolateCubehelix=j,t.interpolateCubehelixLong=B,t.piecewise=function(t,e){for(var r=0,n=e.length-1,a=e[0],i=new Array(n<0?0:n);r<n;)i[r]=t(a,a=e[++r]);return function(t){var e=Math.max(0,Math.min(n-1,Math.floor(t*=n)));return i[e](t-e)}},t.quantize=function(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t(n/(e-1));return r},Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof r&&void 0!==e?a(r,t("d3-color")):a(n.d3=n.d3||{},n.d3)},{"d3-color":154}],159:[function(t,e,r){(function(t){var e=Math.PI,r=2*e,n=r-1e-6;function a(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function i(){return new a}a.prototype=i.prototype={constructor:a,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,r,n){this._+="Q"+ +t+","+ +e+","+(this._x1=+r)+","+(this._y1=+n)},bezierCurveTo:function(t,e,r,n,a,i){this._+="C"+ +t+","+ +e+","+ +r+","+ +n+","+(this._x1=+a)+","+(this._y1=+i)},arcTo:function(t,r,n,a,i){t=+t,r=+r,n=+n,a=+a,i=+i;var o=this._x1,s=this._y1,l=n-t,u=a-r,c=o-t,h=s-r,d=c*c+h*h;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=r);else if(d>1e-6)if(Math.abs(h*l-u*c)>1e-6&&i){var f=n-o,p=a-s,m=l*l+u*u,g=f*f+p*p,y=Math.sqrt(m),v=Math.sqrt(d),_=i*Math.tan((e-Math.acos((m+d-g)/(2*y*v)))/2),x=_/v,b=_/y;Math.abs(x-1)>1e-6&&(this._+="L"+(t+x*c)+","+(r+x*h)),this._+="A"+i+","+i+",0,0,"+ +(h*f>c*p)+","+(this._x1=t+b*l)+","+(this._y1=r+b*u)}else this._+="L"+(this._x1=t)+","+(this._y1=r)},arc:function(t,a,i,o,s,l){t=+t,a=+a;var u=(i=+i)*Math.cos(o),c=i*Math.sin(o),h=t+u,d=a+c,f=1^l,p=l?o-s:s-o;if(i<0)throw new Error("negative radius: "+i);null===this._x1?this._+="M"+h+","+d:(Math.abs(this._x1-h)>1e-6||Math.abs(this._y1-d)>1e-6)&&(this._+="L"+h+","+d),i&&(p<0&&(p=p%r+r),p>n?this._+="A"+i+","+i+",0,1,"+f+","+(t-u)+","+(a-c)+"A"+i+","+i+",0,1,"+f+","+(this._x1=h)+","+(this._y1=d):p>1e-6&&(this._+="A"+i+","+i+",0,"+ +(p>=e)+","+f+","+(this._x1=t+i*Math.cos(s))+","+(this._y1=a+i*Math.sin(s))))},rect:function(t,e,r,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}},t.path=i,Object.defineProperty(t,"__esModule",{value:!0})})("object"==typeof r&&void 0!==e?r:this.d3=this.d3||{})},{}],160:[function(t,e,r){(function(t){function e(t,e,r,n){if(isNaN(e)||isNaN(r))return t;var a,i,o,s,l,u,c,h,d,f=t._root,p={data:n},m=t._x0,g=t._y0,y=t._x1,v=t._y1;if(!f)return t._root=p,t;for(;f.length;)if((u=e>=(i=(m+y)/2))?m=i:y=i,(c=r>=(o=(g+v)/2))?g=o:v=o,a=f,!(f=f[h=c<<1|u]))return a[h]=p,t;if(s=+t._x.call(null,f.data),l=+t._y.call(null,f.data),e===s&&r===l)return p.next=f,a?a[h]=p:t._root=p,t;do{a=a?a[h]=new Array(4):t._root=new Array(4),(u=e>=(i=(m+y)/2))?m=i:y=i,(c=r>=(o=(g+v)/2))?g=o:v=o}while((h=c<<1|u)==(d=(l>=o)<<1|s>=i));return a[d]=f,a[h]=p,t}var r=function(t,e,r,n,a){this.node=t,this.x0=e,this.y0=r,this.x1=n,this.y1=a};function n(t){return t[0]}function a(t){return t[1]}function i(t,e,r){var i=new o(null==e?n:e,null==r?a:r,NaN,NaN,NaN,NaN);return null==t?i:i.addAll(t)}function o(t,e,r,n,a,i){this._x=t,this._y=e,this._x0=r,this._y0=n,this._x1=a,this._y1=i,this._root=void 0}function s(t){for(var e={data:t.data},r=e;t=t.next;)r=r.next={data:t.data};return e}var l=i.prototype=o.prototype;l.copy=function(){var t,e,r=new o(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=s(n),r;for(t=[{source:n,target:r._root=new Array(4)}];n=t.pop();)for(var a=0;a<4;++a)(e=n.source[a])&&(e.length?t.push({source:e,target:n.target[a]=new Array(4)}):n.target[a]=s(e));return r},l.add=function(t){var r=+this._x.call(null,t),n=+this._y.call(null,t);return e(this.cover(r,n),r,n,t)},l.addAll=function(t){var r,n,a,i,o=t.length,s=new Array(o),l=new Array(o),u=1/0,c=1/0,h=-1/0,d=-1/0;for(n=0;n<o;++n)isNaN(a=+this._x.call(null,r=t[n]))||isNaN(i=+this._y.call(null,r))||(s[n]=a,l[n]=i,a<u&&(u=a),a>h&&(h=a),i<c&&(c=i),i>d&&(d=i));for(h<u&&(u=this._x0,h=this._x1),d<c&&(c=this._y0,d=this._y1),this.cover(u,c).cover(h,d),n=0;n<o;++n)e(this,s[n],l[n],t[n]);return this},l.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var r=this._x0,n=this._y0,a=this._x1,i=this._y1;if(isNaN(r))a=(r=Math.floor(t))+1,i=(n=Math.floor(e))+1;else{if(!(r>t||t>a||n>e||e>i))return this;var o,s,l=a-r,u=this._root;switch(s=(e<(n+i)/2)<<1|t<(r+a)/2){case 0:do{(o=new Array(4))[s]=u,u=o}while(i=n+(l*=2),t>(a=r+l)||e>i);break;case 1:do{(o=new Array(4))[s]=u,u=o}while(i=n+(l*=2),(r=a-l)>t||e>i);break;case 2:do{(o=new Array(4))[s]=u,u=o}while(n=i-(l*=2),t>(a=r+l)||n>e);break;case 3:do{(o=new Array(4))[s]=u,u=o}while(n=i-(l*=2),(r=a-l)>t||n>e)}this._root&&this._root.length&&(this._root=u)}return this._x0=r,this._y0=n,this._x1=a,this._y1=i,this},l.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},l.extent=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]]},l.find=function(t,e,n){var a,i,o,s,l,u,c,h=this._x0,d=this._y0,f=this._x1,p=this._y1,m=[],g=this._root;for(g&&m.push(new r(g,h,d,f,p)),null==n?n=1/0:(h=t-n,d=e-n,f=t+n,p=e+n,n*=n);u=m.pop();)if(!(!(g=u.node)||(i=u.x0)>f||(o=u.y0)>p||(s=u.x1)<h||(l=u.y1)<d))if(g.length){var y=(i+s)/2,v=(o+l)/2;m.push(new r(g[3],y,v,s,l),new r(g[2],i,v,y,l),new r(g[1],y,o,s,v),new r(g[0],i,o,y,v)),(c=(e>=v)<<1|t>=y)&&(u=m[m.length-1],m[m.length-1]=m[m.length-1-c],m[m.length-1-c]=u)}else{var _=t-+this._x.call(null,g.data),x=e-+this._y.call(null,g.data),b=_*_+x*x;if(b<n){var w=Math.sqrt(n=b);h=t-w,d=e-w,f=t+w,p=e+w,a=g.data}}return a},l.remove=function(t){if(isNaN(i=+this._x.call(null,t))||isNaN(o=+this._y.call(null,t)))return this;var e,r,n,a,i,o,s,l,u,c,h,d,f=this._root,p=this._x0,m=this._y0,g=this._x1,y=this._y1;if(!f)return this;if(f.length)for(;;){if((u=i>=(s=(p+g)/2))?p=s:g=s,(c=o>=(l=(m+y)/2))?m=l:y=l,e=f,!(f=f[h=c<<1|u]))return this;if(!f.length)break;(e[h+1&3]||e[h+2&3]||e[h+3&3])&&(r=e,d=h)}for(;f.data!==t;)if(n=f,!(f=f.next))return this;return(a=f.next)&&delete f.next,n?(a?n.next=a:delete n.next,this):e?(a?e[h]=a:delete e[h],(f=e[0]||e[1]||e[2]||e[3])&&f===(e[3]||e[2]||e[1]||e[0])&&!f.length&&(r?r[d]=f:this._root=f),this):(this._root=a,this)},l.removeAll=function(t){for(var e=0,r=t.length;e<r;++e)this.remove(t[e]);return this},l.root=function(){return this._root},l.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},l.visit=function(t){var e,n,a,i,o,s,l=[],u=this._root;for(u&&l.push(new r(u,this._x0,this._y0,this._x1,this._y1));e=l.pop();)if(!t(u=e.node,a=e.x0,i=e.y0,o=e.x1,s=e.y1)&&u.length){var c=(a+o)/2,h=(i+s)/2;(n=u[3])&&l.push(new r(n,c,h,o,s)),(n=u[2])&&l.push(new r(n,a,h,c,s)),(n=u[1])&&l.push(new r(n,c,i,o,h)),(n=u[0])&&l.push(new r(n,a,i,c,h))}return this},l.visitAfter=function(t){var e,n=[],a=[];for(this._root&&n.push(new r(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var o,s=e.x0,l=e.y0,u=e.x1,c=e.y1,h=(s+u)/2,d=(l+c)/2;(o=i[0])&&n.push(new r(o,s,l,h,d)),(o=i[1])&&n.push(new r(o,h,l,u,d)),(o=i[2])&&n.push(new r(o,s,d,h,c)),(o=i[3])&&n.push(new r(o,h,d,u,c))}a.push(e)}for(;e=a.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},l.x=function(t){return arguments.length?(this._x=t,this):this._x},l.y=function(t){return arguments.length?(this._y=t,this):this._y},t.quadtree=i,Object.defineProperty(t,"__esModule",{value:!0})})("object"==typeof r&&void 0!==e?r:this.d3=this.d3||{})},{}],161:[function(t,e,r){var n,a;n=this,a=function(t,e){function r(t){return function(){return t}}var n=Math.abs,a=Math.atan2,i=Math.cos,o=Math.max,s=Math.min,l=Math.sin,u=Math.sqrt,c=1e-12,h=Math.PI,d=h/2,f=2*h;function p(t){return t>=1?d:t<=-1?-d:Math.asin(t)}function m(t){return t.innerRadius}function g(t){return t.outerRadius}function y(t){return t.startAngle}function v(t){return t.endAngle}function _(t){return t&&t.padAngle}function x(t,e,r,n,a,i,s){var l=t-r,c=e-n,h=(s?i:-i)/u(l*l+c*c),d=h*c,f=-h*l,p=t+d,m=e+f,g=r+d,y=n+f,v=(p+g)/2,_=(m+y)/2,x=g-p,b=y-m,w=x*x+b*b,M=a-i,k=p*y-g*m,T=(b<0?-1:1)*u(o(0,M*M*w-k*k)),L=(k*b-x*T)/w,A=(-k*x-b*T)/w,S=(k*b+x*T)/w,E=(-k*x+b*T)/w,C=L-v,D=A-_,P=S-v,O=E-_;return C*C+D*D>P*P+O*O&&(L=S,A=E),{cx:L,cy:A,x01:-d,y01:-f,x11:L*(a/M-1),y11:A*(a/M-1)}}function b(t){this._context=t}function w(t){return new b(t)}function M(t){return t[0]}function k(t){return t[1]}function T(){var t=M,n=k,a=r(!0),i=null,o=w,s=null;function l(r){var l,u,c,h=r.length,d=!1;for(null==i&&(s=o(c=e.path())),l=0;l<=h;++l)!(l<h&&a(u=r[l],l,r))===d&&((d=!d)?s.lineStart():s.lineEnd()),d&&s.point(+t(u,l,r),+n(u,l,r));if(c)return s=null,c+""||null}return l.x=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),l):t},l.y=function(t){return arguments.length?(n="function"==typeof t?t:r(+t),l):n},l.defined=function(t){return arguments.length?(a="function"==typeof t?t:r(!!t),l):a},l.curve=function(t){return arguments.length?(o=t,null!=i&&(s=o(i)),l):o},l.context=function(t){return arguments.length?(null==t?i=s=null:s=o(i=t),l):i},l}function L(){var t=M,n=null,a=r(0),i=k,o=r(!0),s=null,l=w,u=null;function c(r){var c,h,d,f,p,m=r.length,g=!1,y=new Array(m),v=new Array(m);for(null==s&&(u=l(p=e.path())),c=0;c<=m;++c){if(!(c<m&&o(f=r[c],c,r))===g)if(g=!g)h=c,u.areaStart(),u.lineStart();else{for(u.lineEnd(),u.lineStart(),d=c-1;d>=h;--d)u.point(y[d],v[d]);u.lineEnd(),u.areaEnd()}g&&(y[c]=+t(f,c,r),v[c]=+a(f,c,r),u.point(n?+n(f,c,r):y[c],i?+i(f,c,r):v[c]))}if(p)return u=null,p+""||null}function h(){return T().defined(o).curve(l).context(s)}return c.x=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),n=null,c):t},c.x0=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),c):t},c.x1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:r(+t),c):n},c.y=function(t){return arguments.length?(a="function"==typeof t?t:r(+t),i=null,c):a},c.y0=function(t){return arguments.length?(a="function"==typeof t?t:r(+t),c):a},c.y1=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:r(+t),c):i},c.lineX0=c.lineY0=function(){return h().x(t).y(a)},c.lineY1=function(){return h().x(t).y(i)},c.lineX1=function(){return h().x(n).y(a)},c.defined=function(t){return arguments.length?(o="function"==typeof t?t:r(!!t),c):o},c.curve=function(t){return arguments.length?(l=t,null!=s&&(u=l(s)),c):l},c.context=function(t){return arguments.length?(null==t?s=u=null:u=l(s=t),c):s},c}function A(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function S(t){return t}b.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var E=D(w);function C(t){this._curve=t}function D(t){function e(e){return new C(t(e))}return e._curve=t,e}function P(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(D(t)):e()._curve},t}function O(){return P(T().curve(E))}function z(){var t=L().curve(E),e=t.curve,r=t.lineX0,n=t.lineX1,a=t.lineY0,i=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return P(r())},delete t.lineX0,t.lineEndAngle=function(){return P(n())},delete t.lineX1,t.lineInnerRadius=function(){return P(a())},delete t.lineY0,t.lineOuterRadius=function(){return P(i())},delete t.lineY1,t.curve=function(t){return arguments.length?e(D(t)):e()._curve},t}function I(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}C.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};var R=Array.prototype.slice;function F(t){return t.source}function N(t){return t.target}function Y(t){var n=F,a=N,i=M,o=k,s=null;function l(){var r,l=R.call(arguments),u=n.apply(this,l),c=a.apply(this,l);if(s||(s=r=e.path()),t(s,+i.apply(this,(l[0]=u,l)),+o.apply(this,l),+i.apply(this,(l[0]=c,l)),+o.apply(this,l)),r)return s=null,r+""||null}return l.source=function(t){return arguments.length?(n=t,l):n},l.target=function(t){return arguments.length?(a=t,l):a},l.x=function(t){return arguments.length?(i="function"==typeof t?t:r(+t),l):i},l.y=function(t){return arguments.length?(o="function"==typeof t?t:r(+t),l):o},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}function j(t,e,r,n,a){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,a,n,a)}function B(t,e,r,n,a){t.moveTo(e,r),t.bezierCurveTo(e,r=(r+a)/2,n,r,n,a)}function H(t,e,r,n,a){var i=I(e,r),o=I(e,r=(r+a)/2),s=I(n,r),l=I(n,a);t.moveTo(i[0],i[1]),t.bezierCurveTo(o[0],o[1],s[0],s[1],l[0],l[1])}var U={draw:function(t,e){var r=Math.sqrt(e/h);t.moveTo(r,0),t.arc(0,0,r,0,f)}},V={draw:function(t,e){var r=Math.sqrt(e/5)/2;t.moveTo(-3*r,-r),t.lineTo(-r,-r),t.lineTo(-r,-3*r),t.lineTo(r,-3*r),t.lineTo(r,-r),t.lineTo(3*r,-r),t.lineTo(3*r,r),t.lineTo(r,r),t.lineTo(r,3*r),t.lineTo(-r,3*r),t.lineTo(-r,r),t.lineTo(-3*r,r),t.closePath()}},W=Math.sqrt(1/3),G=2*W,q={draw:function(t,e){var r=Math.sqrt(e/G),n=r*W;t.moveTo(0,-r),t.lineTo(n,0),t.lineTo(0,r),t.lineTo(-n,0),t.closePath()}},Z=Math.sin(h/10)/Math.sin(7*h/10),X=Math.sin(f/10)*Z,J=-Math.cos(f/10)*Z,K={draw:function(t,e){var r=Math.sqrt(.8908130915292852*e),n=X*r,a=J*r;t.moveTo(0,-r),t.lineTo(n,a);for(var i=1;i<5;++i){var o=f*i/5,s=Math.cos(o),l=Math.sin(o);t.lineTo(l*r,-s*r),t.lineTo(s*n-l*a,l*n+s*a)}t.closePath()}},$={draw:function(t,e){var r=Math.sqrt(e),n=-r/2;t.rect(n,n,r,r)}},Q=Math.sqrt(3),tt={draw:function(t,e){var r=-Math.sqrt(e/(3*Q));t.moveTo(0,2*r),t.lineTo(-Q*r,-r),t.lineTo(Q*r,-r),t.closePath()}},et=-.5,rt=Math.sqrt(3)/2,nt=1/Math.sqrt(12),at=3*(nt/2+1),it={draw:function(t,e){var r=Math.sqrt(e/at),n=r/2,a=r*nt,i=n,o=r*nt+r,s=-i,l=o;t.moveTo(n,a),t.lineTo(i,o),t.lineTo(s,l),t.lineTo(et*n-rt*a,rt*n+et*a),t.lineTo(et*i-rt*o,rt*i+et*o),t.lineTo(et*s-rt*l,rt*s+et*l),t.lineTo(et*n+rt*a,et*a-rt*n),t.lineTo(et*i+rt*o,et*o-rt*i),t.lineTo(et*s+rt*l,et*l-rt*s),t.closePath()}},ot=[U,V,q,$,K,tt,it];function st(){}function lt(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function ut(t){this._context=t}function ct(t){this._context=t}function ht(t){this._context=t}function dt(t,e){this._basis=new ut(t),this._beta=e}ut.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:lt(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:lt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ct.prototype={areaStart:st,areaEnd:st,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:lt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ht.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:lt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},dt.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var n,a=t[0],i=e[0],o=t[r]-a,s=e[r]-i,l=-1;++l<=r;)n=l/r,this._basis.point(this._beta*t[l]+(1-this._beta)*(a+n*o),this._beta*e[l]+(1-this._beta)*(i+n*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var ft=function t(e){function r(t){return 1===e?new ut(t):new dt(t,e)}return r.beta=function(e){return t(+e)},r}(.85);function pt(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function mt(t,e){this._context=t,this._k=(1-e)/6}mt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:pt(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:pt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var gt=function t(e){function r(t){return new mt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function yt(t,e){this._context=t,this._k=(1-e)/6}yt.prototype={areaStart:st,areaEnd:st,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:pt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var vt=function t(e){function r(t){return new yt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function _t(t,e){this._context=t,this._k=(1-e)/6}_t.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:pt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var xt=function t(e){function r(t){return new _t(t,e)}return r.tension=function(e){return t(+e)},r}(0);function bt(t,e,r){var n=t._x1,a=t._y1,i=t._x2,o=t._y2;if(t._l01_a>c){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,a=(a*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>c){var u=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,h=3*t._l23_a*(t._l23_a+t._l12_a);i=(i*u+t._x1*t._l23_2a-e*t._l12_2a)/h,o=(o*u+t._y1*t._l23_2a-r*t._l12_2a)/h}t._context.bezierCurveTo(n,a,i,o,t._x2,t._y2)}function wt(t,e){this._context=t,this._alpha=e}wt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:bt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Mt=function t(e){function r(t){return e?new wt(t,e):new mt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function kt(t,e){this._context=t,this._alpha=e}kt.prototype={areaStart:st,areaEnd:st,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:bt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Tt=function t(e){function r(t){return e?new kt(t,e):new yt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function Lt(t,e){this._context=t,this._alpha=e}Lt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:bt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var At=function t(e){function r(t){return e?new Lt(t,e):new _t(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function St(t){this._context=t}function Et(t){return t<0?-1:1}function Ct(t,e,r){var n=t._x1-t._x0,a=e-t._x1,i=(t._y1-t._y0)/(n||a<0&&-0),o=(r-t._y1)/(a||n<0&&-0),s=(i*a+o*n)/(n+a);return(Et(i)+Et(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(s))||0}function Dt(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function Pt(t,e,r){var n=t._x0,a=t._y0,i=t._x1,o=t._y1,s=(i-n)/3;t._context.bezierCurveTo(n+s,a+s*e,i-s,o-s*r,i,o)}function Ot(t){this._context=t}function zt(t){this._context=new It(t)}function It(t){this._context=t}function Rt(t){this._context=t}function Ft(t){var e,r,n=t.length-1,a=new Array(n),i=new Array(n),o=new Array(n);for(a[0]=0,i[0]=2,o[0]=t[0]+2*t[1],e=1;e<n-1;++e)a[e]=1,i[e]=4,o[e]=4*t[e]+2*t[e+1];for(a[n-1]=2,i[n-1]=7,o[n-1]=8*t[n-1]+t[n],e=1;e<n;++e)r=a[e]/i[e-1],i[e]-=r,o[e]-=r*o[e-1];for(a[n-1]=o[n-1]/i[n-1],e=n-2;e>=0;--e)a[e]=(o[e]-a[e+1])/i[e];for(i[n-1]=(t[n]+a[n-1])/2,e=0;e<n-1;++e)i[e]=2*t[e+1]-a[e+1];return[a,i]}function Nt(t,e){this._context=t,this._t=e}function Yt(t,e){if((a=t.length)>1)for(var r,n,a,i=1,o=t[e[0]],s=o.length;i<a;++i)for(n=o,o=t[e[i]],r=0;r<s;++r)o[r][1]+=o[r][0]=isNaN(n[r][1])?n[r][0]:n[r][1]}function jt(t){for(var e=t.length,r=new Array(e);--e>=0;)r[e]=e;return r}function Bt(t,e){return t[e]}function Ht(t){var e=t.map(Ut);return jt(t).sort((function(t,r){return e[t]-e[r]}))}function Ut(t){for(var e,r=-1,n=0,a=t.length,i=-1/0;++r<a;)(e=+t[r][1])>i&&(i=e,n=r);return n}function Vt(t){var e=t.map(Wt);return jt(t).sort((function(t,r){return e[t]-e[r]}))}function Wt(t){for(var e,r=0,n=-1,a=t.length;++n<a;)(e=+t[n][1])&&(r+=e);return r}St.prototype={areaStart:st,areaEnd:st,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},Ot.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Pt(this,this._t0,Dt(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var r=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,Pt(this,Dt(this,r=Ct(this,t,e)),r);break;default:Pt(this,this._t0,r=Ct(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}},(zt.prototype=Object.create(Ot.prototype)).point=function(t,e){Ot.prototype.point.call(this,e,t)},It.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,r,n,a,i){this._context.bezierCurveTo(e,t,n,r,i,a)}},Rt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,r=t.length;if(r)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===r)this._context.lineTo(t[1],e[1]);else for(var n=Ft(t),a=Ft(e),i=0,o=1;o<r;++i,++o)this._context.bezierCurveTo(n[0][i],a[0][i],n[1][i],a[1][i],t[o],e[o]);(this._line||0!==this._line&&1===r)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}},Nt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}}this._x=t,this._y=e}},t.arc=function(){var t=m,o=g,b=r(0),w=null,M=y,k=v,T=_,L=null;function A(){var r,m,g,y=+t.apply(this,arguments),v=+o.apply(this,arguments),_=M.apply(this,arguments)-d,A=k.apply(this,arguments)-d,S=n(A-_),E=A>_;if(L||(L=r=e.path()),v<y&&(m=v,v=y,y=m),v>c)if(S>f-c)L.moveTo(v*i(_),v*l(_)),L.arc(0,0,v,_,A,!E),y>c&&(L.moveTo(y*i(A),y*l(A)),L.arc(0,0,y,A,_,E));else{var C,D,P=_,O=A,z=_,I=A,R=S,F=S,N=T.apply(this,arguments)/2,Y=N>c&&(w?+w.apply(this,arguments):u(y*y+v*v)),j=s(n(v-y)/2,+b.apply(this,arguments)),B=j,H=j;if(Y>c){var U=p(Y/y*l(N)),V=p(Y/v*l(N));(R-=2*U)>c?(z+=U*=E?1:-1,I-=U):(R=0,z=I=(_+A)/2),(F-=2*V)>c?(P+=V*=E?1:-1,O-=V):(F=0,P=O=(_+A)/2)}var W=v*i(P),G=v*l(P),q=y*i(I),Z=y*l(I);if(j>c){var X,J=v*i(O),K=v*l(O),$=y*i(z),Q=y*l(z);if(S<h&&(X=function(t,e,r,n,a,i,o,s){var l=r-t,u=n-e,h=o-a,d=s-i,f=d*l-h*u;if(!(f*f<c))return[t+(f=(h*(e-i)-d*(t-a))/f)*l,e+f*u]}(W,G,$,Q,J,K,q,Z))){var tt=W-X[0],et=G-X[1],rt=J-X[0],nt=K-X[1],at=1/l(((g=(tt*rt+et*nt)/(u(tt*tt+et*et)*u(rt*rt+nt*nt)))>1?0:g<-1?h:Math.acos(g))/2),it=u(X[0]*X[0]+X[1]*X[1]);B=s(j,(y-it)/(at-1)),H=s(j,(v-it)/(at+1))}}F>c?H>c?(C=x($,Q,W,G,v,H,E),D=x(J,K,q,Z,v,H,E),L.moveTo(C.cx+C.x01,C.cy+C.y01),H<j?L.arc(C.cx,C.cy,H,a(C.y01,C.x01),a(D.y01,D.x01),!E):(L.arc(C.cx,C.cy,H,a(C.y01,C.x01),a(C.y11,C.x11),!E),L.arc(0,0,v,a(C.cy+C.y11,C.cx+C.x11),a(D.cy+D.y11,D.cx+D.x11),!E),L.arc(D.cx,D.cy,H,a(D.y11,D.x11),a(D.y01,D.x01),!E))):(L.moveTo(W,G),L.arc(0,0,v,P,O,!E)):L.moveTo(W,G),y>c&&R>c?B>c?(C=x(q,Z,J,K,y,-B,E),D=x(W,G,$,Q,y,-B,E),L.lineTo(C.cx+C.x01,C.cy+C.y01),B<j?L.arc(C.cx,C.cy,B,a(C.y01,C.x01),a(D.y01,D.x01),!E):(L.arc(C.cx,C.cy,B,a(C.y01,C.x01),a(C.y11,C.x11),!E),L.arc(0,0,y,a(C.cy+C.y11,C.cx+C.x11),a(D.cy+D.y11,D.cx+D.x11),E),L.arc(D.cx,D.cy,B,a(D.y11,D.x11),a(D.y01,D.x01),!E))):L.arc(0,0,y,I,z,E):L.lineTo(q,Z)}else L.moveTo(0,0);if(L.closePath(),r)return L=null,r+""||null}return A.centroid=function(){var e=(+t.apply(this,arguments)+ +o.apply(this,arguments))/2,r=(+M.apply(this,arguments)+ +k.apply(this,arguments))/2-h/2;return[i(r)*e,l(r)*e]},A.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),A):t},A.outerRadius=function(t){return arguments.length?(o="function"==typeof t?t:r(+t),A):o},A.cornerRadius=function(t){return arguments.length?(b="function"==typeof t?t:r(+t),A):b},A.padRadius=function(t){return arguments.length?(w=null==t?null:"function"==typeof t?t:r(+t),A):w},A.startAngle=function(t){return arguments.length?(M="function"==typeof t?t:r(+t),A):M},A.endAngle=function(t){return arguments.length?(k="function"==typeof t?t:r(+t),A):k},A.padAngle=function(t){return arguments.length?(T="function"==typeof t?t:r(+t),A):T},A.context=function(t){return arguments.length?(L=null==t?null:t,A):L},A},t.area=L,t.line=T,t.pie=function(){var t=S,e=A,n=null,a=r(0),i=r(f),o=r(0);function s(r){var s,l,u,c,h,d=r.length,p=0,m=new Array(d),g=new Array(d),y=+a.apply(this,arguments),v=Math.min(f,Math.max(-f,i.apply(this,arguments)-y)),_=Math.min(Math.abs(v)/d,o.apply(this,arguments)),x=_*(v<0?-1:1);for(s=0;s<d;++s)(h=g[m[s]=s]=+t(r[s],s,r))>0&&(p+=h);for(null!=e?m.sort((function(t,r){return e(g[t],g[r])})):null!=n&&m.sort((function(t,e){return n(r[t],r[e])})),s=0,u=p?(v-d*x)/p:0;s<d;++s,y=c)l=m[s],c=y+((h=g[l])>0?h*u:0)+x,g[l]={data:r[l],index:s,value:h,startAngle:y,endAngle:c,padAngle:_};return g}return s.value=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),s):t},s.sortValues=function(t){return arguments.length?(e=t,n=null,s):e},s.sort=function(t){return arguments.length?(n=t,e=null,s):n},s.startAngle=function(t){return arguments.length?(a="function"==typeof t?t:r(+t),s):a},s.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:r(+t),s):i},s.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:r(+t),s):o},s},t.areaRadial=z,t.radialArea=z,t.lineRadial=O,t.radialLine=O,t.pointRadial=I,t.linkHorizontal=function(){return Y(j)},t.linkVertical=function(){return Y(B)},t.linkRadial=function(){var t=Y(H);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t},t.symbol=function(){var t=r(U),n=r(64),a=null;function i(){var r;if(a||(a=r=e.path()),t.apply(this,arguments).draw(a,+n.apply(this,arguments)),r)return a=null,r+""||null}return i.type=function(e){return arguments.length?(t="function"==typeof e?e:r(e),i):t},i.size=function(t){return arguments.length?(n="function"==typeof t?t:r(+t),i):n},i.context=function(t){return arguments.length?(a=null==t?null:t,i):a},i},t.symbols=ot,t.symbolCircle=U,t.symbolCross=V,t.symbolDiamond=q,t.symbolSquare=$,t.symbolStar=K,t.symbolTriangle=tt,t.symbolWye=it,t.curveBasisClosed=function(t){return new ct(t)},t.curveBasisOpen=function(t){return new ht(t)},t.curveBasis=function(t){return new ut(t)},t.curveBundle=ft,t.curveCardinalClosed=vt,t.curveCardinalOpen=xt,t.curveCardinal=gt,t.curveCatmullRomClosed=Tt,t.curveCatmullRomOpen=At,t.curveCatmullRom=Mt,t.curveLinearClosed=function(t){return new St(t)},t.curveLinear=w,t.curveMonotoneX=function(t){return new Ot(t)},t.curveMonotoneY=function(t){return new zt(t)},t.curveNatural=function(t){return new Rt(t)},t.curveStep=function(t){return new Nt(t,.5)},t.curveStepAfter=function(t){return new Nt(t,1)},t.curveStepBefore=function(t){return new Nt(t,0)},t.stack=function(){var t=r([]),e=jt,n=Yt,a=Bt;function i(r){var i,o,s=t.apply(this,arguments),l=r.length,u=s.length,c=new Array(u);for(i=0;i<u;++i){for(var h,d=s[i],f=c[i]=new Array(l),p=0;p<l;++p)f[p]=h=[0,+a(r[p],d,p,r)],h.data=r[p];f.key=d}for(i=0,o=e(c);i<u;++i)c[o[i]].index=i;return n(c,o),c}return i.keys=function(e){return arguments.length?(t="function"==typeof e?e:r(R.call(e)),i):t},i.value=function(t){return arguments.length?(a="function"==typeof t?t:r(+t),i):a},i.order=function(t){return arguments.length?(e=null==t?jt:"function"==typeof t?t:r(R.call(t)),i):e},i.offset=function(t){return arguments.length?(n=null==t?Yt:t,i):n},i},t.stackOffsetExpand=function(t,e){if((n=t.length)>0){for(var r,n,a,i=0,o=t[0].length;i<o;++i){for(a=r=0;r<n;++r)a+=t[r][i][1]||0;if(a)for(r=0;r<n;++r)t[r][i][1]/=a}Yt(t,e)}},t.stackOffsetDiverging=function(t,e){if((s=t.length)>1)for(var r,n,a,i,o,s,l=0,u=t[e[0]].length;l<u;++l)for(i=o=0,r=0;r<s;++r)(a=(n=t[e[r]][l])[1]-n[0])>=0?(n[0]=i,n[1]=i+=a):a<0?(n[1]=o,n[0]=o+=a):n[0]=i},t.stackOffsetNone=Yt,t.stackOffsetSilhouette=function(t,e){if((r=t.length)>0){for(var r,n=0,a=t[e[0]],i=a.length;n<i;++n){for(var o=0,s=0;o<r;++o)s+=t[o][n][1]||0;a[n][1]+=a[n][0]=-s/2}Yt(t,e)}},t.stackOffsetWiggle=function(t,e){if((a=t.length)>0&&(n=(r=t[e[0]]).length)>0){for(var r,n,a,i=0,o=1;o<n;++o){for(var s=0,l=0,u=0;s<a;++s){for(var c=t[e[s]],h=c[o][1]||0,d=(h-(c[o-1][1]||0))/2,f=0;f<s;++f){var p=t[e[f]];d+=(p[o][1]||0)-(p[o-1][1]||0)}l+=h,u+=d*h}r[o-1][1]+=r[o-1][0]=i,l&&(i-=u/l)}r[o-1][1]+=r[o-1][0]=i,Yt(t,e)}},t.stackOrderAppearance=Ht,t.stackOrderAscending=Vt,t.stackOrderDescending=function(t){return Vt(t).reverse()},t.stackOrderInsideOut=function(t){var e,r,n=t.length,a=t.map(Wt),i=Ht(t),o=0,s=0,l=[],u=[];for(e=0;e<n;++e)r=i[e],o<s?(o+=a[r],l.push(r)):(s+=a[r],u.push(r));return u.reverse().concat(l)},t.stackOrderNone=jt,t.stackOrderReverse=function(t){return jt(t).reverse()},Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof r&&void 0!==e?a(r,t("d3-path")):a(n.d3=n.d3||{},n.d3)},{"d3-path":159}],162:[function(t,e,r){(function(t){var e,r,n=0,a=0,i=0,o=0,s=0,l=0,u="object"==typeof performance&&performance.now?performance:Date,c="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function h(){return s||(c(d),s=u.now()+l)}function d(){s=0}function f(){this._call=this._time=this._next=null}function p(t,e,r){var n=new f;return n.restart(t,e,r),n}function m(){h(),++n;for(var t,r=e;r;)(t=s-r._time)>=0&&r._call.call(null,t),r=r._next;--n}function g(){s=(o=u.now())+l,n=a=0;try{m()}finally{n=0,function(){for(var t,n,a=e,i=1/0;a;)a._call?(i>a._time&&(i=a._time),t=a,a=a._next):(n=a._next,a._next=null,a=t?t._next=n:e=n);r=t,v(i)}(),s=0}}function y(){var t=u.now(),e=t-o;e>1e3&&(l-=e,o=t)}function v(t){n||(a&&(a=clearTimeout(a)),t-s>24?(t<1/0&&(a=setTimeout(g,t-u.now()-l)),i&&(i=clearInterval(i))):(i||(o=u.now(),i=setInterval(y,1e3)),n=1,c(g)))}f.prototype=p.prototype={constructor:f,restart:function(t,n,a){if("function"!=typeof t)throw new TypeError("callback is not a function");a=(null==a?h():+a)+(null==n?0:+n),this._next||r===this||(r?r._next=this:e=this,r=this),this._call=t,this._time=a,v()},stop:function(){this._call&&(this._call=null,this._time=1/0,v())}},t.now=h,t.timer=p,t.timerFlush=m,t.timeout=function(t,e,r){var n=new f;return e=null==e?0:+e,n.restart((function(r){n.stop(),t(r+e)}),e,r),n},t.interval=function(t,e,r){var n=new f,a=e;return null==e?(n.restart(t,e,r),n):(e=+e,r=null==r?h():+r,n.restart((function i(o){o+=a,n.restart(i,a+=e,r),t(o)}),e,r),n)},Object.defineProperty(t,"__esModule",{value:!0})})("object"==typeof r&&void 0!==e?r:this.d3=this.d3||{})},{}],163:[function(t,e,r){!function(){var t={version:"3.5.17"},r=[].slice,n=function(t){return r.call(t)},a=this.document;function i(t){return t&&(t.ownerDocument||t.document||t).documentElement}function o(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}if(a)try{n(a.documentElement.childNodes)[0].nodeType}catch(t){n=function(t){for(var e=t.length,r=new Array(e);e--;)r[e]=t[e];return r}}if(Date.now||(Date.now=function(){return+new Date}),a)try{a.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var s=this.Element.prototype,l=s.setAttribute,u=s.setAttributeNS,c=this.CSSStyleDeclaration.prototype,h=c.setProperty;s.setAttribute=function(t,e){l.call(this,t,e+"")},s.setAttributeNS=function(t,e,r){u.call(this,t,e,r+"")},c.setProperty=function(t,e,r){h.call(this,t,e+"",r)}}function d(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function f(t){return null===t?NaN:+t}function p(t){return!isNaN(t)}function m(t){return{left:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n<a;){var i=n+a>>>1;t(e[i],r)<0?n=i+1:a=i}return n},right:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n<a;){var i=n+a>>>1;t(e[i],r)>0?a=i:n=i+1}return n}}}t.ascending=d,t.descending=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN},t.min=function(t,e){var r,n,a=-1,i=t.length;if(1===arguments.length){for(;++a<i;)if(null!=(n=t[a])&&n>=n){r=n;break}for(;++a<i;)null!=(n=t[a])&&r>n&&(r=n)}else{for(;++a<i;)if(null!=(n=e.call(t,t[a],a))&&n>=n){r=n;break}for(;++a<i;)null!=(n=e.call(t,t[a],a))&&r>n&&(r=n)}return r},t.max=function(t,e){var r,n,a=-1,i=t.length;if(1===arguments.length){for(;++a<i;)if(null!=(n=t[a])&&n>=n){r=n;break}for(;++a<i;)null!=(n=t[a])&&n>r&&(r=n)}else{for(;++a<i;)if(null!=(n=e.call(t,t[a],a))&&n>=n){r=n;break}for(;++a<i;)null!=(n=e.call(t,t[a],a))&&n>r&&(r=n)}return r},t.extent=function(t,e){var r,n,a,i=-1,o=t.length;if(1===arguments.length){for(;++i<o;)if(null!=(n=t[i])&&n>=n){r=a=n;break}for(;++i<o;)null!=(n=t[i])&&(r>n&&(r=n),a<n&&(a=n))}else{for(;++i<o;)if(null!=(n=e.call(t,t[i],i))&&n>=n){r=a=n;break}for(;++i<o;)null!=(n=e.call(t,t[i],i))&&(r>n&&(r=n),a<n&&(a=n))}return[r,a]},t.sum=function(t,e){var r,n=0,a=t.length,i=-1;if(1===arguments.length)for(;++i<a;)p(r=+t[i])&&(n+=r);else for(;++i<a;)p(r=+e.call(t,t[i],i))&&(n+=r);return n},t.mean=function(t,e){var r,n=0,a=t.length,i=-1,o=a;if(1===arguments.length)for(;++i<a;)p(r=f(t[i]))?n+=r:--o;else for(;++i<a;)p(r=f(e.call(t,t[i],i)))?n+=r:--o;if(o)return n/o},t.quantile=function(t,e){var r=(t.length-1)*e+1,n=Math.floor(r),a=+t[n-1],i=r-n;return i?a+i*(t[n]-a):a},t.median=function(e,r){var n,a=[],i=e.length,o=-1;if(1===arguments.length)for(;++o<i;)p(n=f(e[o]))&&a.push(n);else for(;++o<i;)p(n=f(r.call(e,e[o],o)))&&a.push(n);if(a.length)return t.quantile(a.sort(d),.5)},t.variance=function(t,e){var r,n,a=t.length,i=0,o=0,s=-1,l=0;if(1===arguments.length)for(;++s<a;)p(r=f(t[s]))&&(o+=(n=r-i)*(r-(i+=n/++l)));else for(;++s<a;)p(r=f(e.call(t,t[s],s)))&&(o+=(n=r-i)*(r-(i+=n/++l)));if(l>1)return o/(l-1)},t.deviation=function(){var e=t.variance.apply(this,arguments);return e?Math.sqrt(e):e};var g=m(d);function y(t){return t.length}t.bisectLeft=g.left,t.bisect=t.bisectRight=g.right,t.bisector=function(t){return m(1===t.length?function(e,r){return d(t(e),r)}:t)},t.shuffle=function(t,e,r){(i=arguments.length)<3&&(r=t.length,i<2&&(e=0));for(var n,a,i=r-e;i;)a=Math.random()*i--|0,n=t[i+e],t[i+e]=t[a+e],t[a+e]=n;return t},t.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},t.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],a=new Array(r<0?0:r);e<r;)a[e]=[n,n=t[++e]];return a},t.transpose=function(e){if(!(i=e.length))return[];for(var r=-1,n=t.min(e,y),a=new Array(n);++r<n;)for(var i,o=-1,s=a[r]=new Array(i);++o<i;)s[o]=e[o][r];return a},t.zip=function(){return t.transpose(arguments)},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e},t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},t.merge=function(t){for(var e,r,n,a=t.length,i=-1,o=0;++i<a;)o+=t[i].length;for(r=new Array(o);--a>=0;)for(e=(n=t[a]).length;--e>=0;)r[--o]=n[e];return r};var v=Math.abs;function _(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function x(){this._=Object.create(null)}t.range=function(t,e,r){if(arguments.length<3&&(r=1,arguments.length<2&&(e=t,t=0)),(e-t)/r==1/0)throw new Error("infinite range");var n,a=[],i=function(t){for(var e=1;t*e%1;)e*=10;return e}(v(r)),o=-1;if(t*=i,e*=i,(r*=i)<0)for(;(n=t+r*++o)>e;)a.push(n/i);else for(;(n=t+r*++o)<e;)a.push(n/i);return a},t.map=function(t,e){var r=new x;if(t instanceof x)t.forEach((function(t,e){r.set(t,e)}));else if(Array.isArray(t)){var n,a=-1,i=t.length;if(1===arguments.length)for(;++a<i;)r.set(a,t[a]);else for(;++a<i;)r.set(e.call(t,n=t[a],a),n)}else for(var o in t)r.set(o,t[o]);return r};function b(t){return"__proto__"==(t+="")||"\0"===t[0]?"\0"+t:t}function w(t){return"\0"===(t+="")[0]?t.slice(1):t}function M(t){return b(t)in this._}function k(t){return(t=b(t))in this._&&delete this._[t]}function T(){var t=[];for(var e in this._)t.push(w(e));return t}function L(){var t=0;for(var e in this._)++t;return t}function A(){for(var t in this._)return!1;return!0}function S(){this._=Object.create(null)}function E(t){return t}function C(t,e,r){return function(){var n=r.apply(e,arguments);return n===e?t:n}}function D(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=P.length;r<n;++r){var a=P[r]+e;if(a in t)return a}}_(x,{has:M,get:function(t){return this._[b(t)]},set:function(t,e){return this._[b(t)]=e},remove:k,keys:T,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:w(e),value:this._[e]});return t},size:L,empty:A,forEach:function(t){for(var e in this._)t.call(this,w(e),this._[e])}}),t.nest=function(){var e,r,n={},a=[],i=[];function o(t,i,s){if(s>=a.length)return r?r.call(n,i):e?i.sort(e):i;for(var l,u,c,h,d=-1,f=i.length,p=a[s++],m=new x;++d<f;)(h=m.get(l=p(u=i[d])))?h.push(u):m.set(l,[u]);return t?(u=t(),c=function(e,r){u.set(e,o(t,r,s))}):(u={},c=function(e,r){u[e]=o(t,r,s)}),m.forEach(c),u}return n.map=function(t,e){return o(e,t,0)},n.entries=function(e){return function t(e,r){if(r>=a.length)return e;var n=[],o=i[r++];return e.forEach((function(e,a){n.push({key:e,values:t(a,r)})})),o?n.sort((function(t,e){return o(t.key,e.key)})):n}(o(t.map,e,0),0)},n.key=function(t){return a.push(t),n},n.sortKeys=function(t){return i[a.length-1]=t,n},n.sortValues=function(t){return e=t,n},n.rollup=function(t){return r=t,n},n},t.set=function(t){var e=new S;if(t)for(var r=0,n=t.length;r<n;++r)e.add(t[r]);return e},_(S,{has:M,add:function(t){return this._[b(t+="")]=!0,t},remove:k,values:T,size:L,empty:A,forEach:function(t){for(var e in this._)t.call(this,w(e))}}),t.behavior={},t.rebind=function(t,e){for(var r,n=1,a=arguments.length;++n<a;)t[r=arguments[n]]=C(t,e,e[r]);return t};var P=["webkit","ms","moz","Moz","o","O"];function O(){}function z(){}function I(t){var e=[],r=new x;function n(){for(var r,n=e,a=-1,i=n.length;++a<i;)(r=n[a].on)&&r.apply(this,arguments);return t}return n.on=function(n,a){var i,o=r.get(n);return arguments.length<2?o&&o.on:(o&&(o.on=null,e=e.slice(0,i=e.indexOf(o)).concat(e.slice(i+1)),r.remove(n)),a&&e.push(r.set(n,{on:a})),t)},n}function R(){t.event.preventDefault()}function F(){for(var e,r=t.event;e=r.sourceEvent;)r=e;return r}function N(e){for(var r=new z,n=0,a=arguments.length;++n<a;)r[arguments[n]]=I(r);return r.of=function(n,a){return function(i){try{var o=i.sourceEvent=t.event;i.target=e,t.event=i,r[i.type].apply(n,a)}finally{t.event=o}}},r}t.dispatch=function(){for(var t=new z,e=-1,r=arguments.length;++e<r;)t[arguments[e]]=I(t);return t},z.prototype.on=function(t,e){var r=t.indexOf("."),n="";if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t)return arguments.length<2?this[t].on(n):this[t].on(n,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(n,null);return this}},t.event=null,t.requote=function(t){return t.replace(Y,"\\$&")};var Y=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,j={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function B(t){return j(t,W),t}var H=function(t,e){return e.querySelector(t)},U=function(t,e){return e.querySelectorAll(t)},V=function(t,e){var r=t.matches||t[D(t,"matchesSelector")];return(V=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(H=function(t,e){return Sizzle(t,e)[0]||null},U=Sizzle,V=Sizzle.matchesSelector),t.selection=function(){return t.select(a.documentElement)};var W=t.selection.prototype=[];function G(t){return"function"==typeof t?t:function(){return H(t,this)}}function q(t){return"function"==typeof t?t:function(){return U(t,this)}}W.select=function(t){var e,r,n,a,i=[];t=G(t);for(var o=-1,s=this.length;++o<s;){i.push(e=[]),e.parentNode=(n=this[o]).parentNode;for(var l=-1,u=n.length;++l<u;)(a=n[l])?(e.push(r=t.call(a,a.__data__,l,o)),r&&"__data__"in a&&(r.__data__=a.__data__)):e.push(null)}return B(i)},W.selectAll=function(t){var e,r,a=[];t=q(t);for(var i=-1,o=this.length;++i<o;)for(var s=this[i],l=-1,u=s.length;++l<u;)(r=s[l])&&(a.push(e=n(t.call(r,r.__data__,l,i))),e.parentNode=r);return B(a)};var Z="http://www.w3.org/1999/xhtml",X={svg:"http://www.w3.org/2000/svg",xhtml:Z,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function J(e,r){return e=t.ns.qualify(e),null==r?e.local?function(){this.removeAttributeNS(e.space,e.local)}:function(){this.removeAttribute(e)}:"function"==typeof r?e.local?function(){var t=r.apply(this,arguments);null==t?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,t)}:function(){var t=r.apply(this,arguments);null==t?this.removeAttribute(e):this.setAttribute(e,t)}:e.local?function(){this.setAttributeNS(e.space,e.local,r)}:function(){this.setAttribute(e,r)}}function K(t){return t.trim().replace(/\s+/g," ")}function $(e){return new RegExp("(?:^|\\s+)"+t.requote(e)+"(?:\\s+|$)","g")}function Q(t){return(t+"").trim().split(/^|\s+/)}function tt(t,e){var r=(t=Q(t).map(et)).length;return"function"==typeof e?function(){for(var n=-1,a=e.apply(this,arguments);++n<r;)t[n](this,a)}:function(){for(var n=-1;++n<r;)t[n](this,e)}}function et(t){var e=$(t);return function(r,n){if(a=r.classList)return n?a.add(t):a.remove(t);var a=r.getAttribute("class")||"";n?(e.lastIndex=0,e.test(a)||r.setAttribute("class",K(a+" "+t))):r.setAttribute("class",K(a.replace(e," ")))}}function rt(t,e,r){return null==e?function(){this.style.removeProperty(t)}:"function"==typeof e?function(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,r)}:function(){this.style.setProperty(t,e,r)}}function nt(t,e){return null==e?function(){delete this[t]}:"function"==typeof e?function(){var r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}:function(){this[t]=e}}function at(e){return"function"==typeof e?e:(e=t.ns.qualify(e)).local?function(){return this.ownerDocument.createElementNS(e.space,e.local)}:function(){var t=this.ownerDocument,r=this.namespaceURI;return r===Z&&t.documentElement.namespaceURI===Z?t.createElement(e):t.createElementNS(r,e)}}function it(){var t=this.parentNode;t&&t.removeChild(this)}function ot(t){return{__data__:t}}function st(t){return function(){return V(this,t)}}function lt(t,e){for(var r=0,n=t.length;r<n;r++)for(var a,i=t[r],o=0,s=i.length;o<s;o++)(a=i[o])&&e(a,o,r);return t}function ut(t){return j(t,ct),t}t.ns={prefix:X,qualify:function(t){var e=t.indexOf(":"),r=t;return e>=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),X.hasOwnProperty(r)?{space:X[r],local:t}:t}},W.attr=function(e,r){if(arguments.length<2){if("string"==typeof e){var n=this.node();return(e=t.ns.qualify(e)).local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(r in e)this.each(J(r,e[r]));return this}return this.each(J(e,r))},W.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=Q(t)).length,a=-1;if(e=r.classList){for(;++a<n;)if(!e.contains(t[a]))return!1}else for(e=r.getAttribute("class");++a<n;)if(!$(t[a]).test(e))return!1;return!0}for(e in t)this.each(tt(e,t[e]));return this}return this.each(tt(t,e))},W.style=function(t,e,r){var n=arguments.length;if(n<3){if("string"!=typeof t){for(r in n<2&&(e=""),t)this.each(rt(r,t[r],e));return this}if(n<2){var a=this.node();return o(a).getComputedStyle(a,null).getPropertyValue(t)}r=""}return this.each(rt(t,e,r))},W.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(nt(e,t[e]));return this}return this.each(nt(t,e))},W.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},W.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},W.append=function(t){return t=at(t),this.select((function(){return this.appendChild(t.apply(this,arguments))}))},W.insert=function(t,e){return t=at(t),e=G(e),this.select((function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)}))},W.remove=function(){return this.each(it)},W.data=function(t,e){var r,n,a=-1,i=this.length;if(!arguments.length){for(t=new Array(i=(r=this[0]).length);++a<i;)(n=r[a])&&(t[a]=n.__data__);return t}function o(t,r){var n,a,i,o=t.length,c=r.length,h=Math.min(o,c),d=new Array(c),f=new Array(c),p=new Array(o);if(e){var m,g=new x,y=new Array(o);for(n=-1;++n<o;)(a=t[n])&&(g.has(m=e.call(a,a.__data__,n))?p[n]=a:g.set(m,a),y[n]=m);for(n=-1;++n<c;)(a=g.get(m=e.call(r,i=r[n],n)))?!0!==a&&(d[n]=a,a.__data__=i):f[n]=ot(i),g.set(m,!0);for(n=-1;++n<o;)n in y&&!0!==g.get(y[n])&&(p[n]=t[n])}else{for(n=-1;++n<h;)a=t[n],i=r[n],a?(a.__data__=i,d[n]=a):f[n]=ot(i);for(;n<c;++n)f[n]=ot(r[n]);for(;n<o;++n)p[n]=t[n]}f.update=d,f.parentNode=d.parentNode=p.parentNode=t.parentNode,s.push(f),l.push(d),u.push(p)}var s=ut([]),l=B([]),u=B([]);if("function"==typeof t)for(;++a<i;)o(r=this[a],t.call(r,r.parentNode.__data__,a));else for(;++a<i;)o(r=this[a],t);return l.enter=function(){return s},l.exit=function(){return u},l},W.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")},W.filter=function(t){var e,r,n,a=[];"function"!=typeof t&&(t=st(t));for(var i=0,o=this.length;i<o;i++){a.push(e=[]),e.parentNode=(r=this[i]).parentNode;for(var s=0,l=r.length;s<l;s++)(n=r[s])&&t.call(n,n.__data__,s,i)&&e.push(n)}return B(a)},W.order=function(){for(var t=-1,e=this.length;++t<e;)for(var r,n=this[t],a=n.length-1,i=n[a];--a>=0;)(r=n[a])&&(i&&i!==r.nextSibling&&i.parentNode.insertBefore(r,i),i=r);return this},W.sort=function(t){t=function(t){return arguments.length||(t=d),function(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}}.apply(this,arguments);for(var e=-1,r=this.length;++e<r;)this[e].sort(t);return this.order()},W.each=function(t){return lt(this,(function(e,r,n){t.call(e,e.__data__,r,n)}))},W.call=function(t){var e=n(arguments);return t.apply(e[0]=this,e),this},W.empty=function(){return!this.node()},W.node=function(){for(var t=0,e=this.length;t<e;t++)for(var r=this[t],n=0,a=r.length;n<a;n++){var i=r[n];if(i)return i}return null},W.size=function(){var t=0;return lt(this,(function(){++t})),t};var ct=[];function ht(e,r,a){var i="__on"+e,o=e.indexOf("."),s=ft;o>0&&(e=e.slice(0,o));var l=dt.get(e);function u(){var t=this[i];t&&(this.removeEventListener(e,t,t.$),delete this[i])}return l&&(e=l,s=pt),o?r?function(){var t=s(r,n(arguments));u.call(this),this.addEventListener(e,this[i]=t,t.$=a),t._=r}:u:r?O:function(){var r,n=new RegExp("^__on([^.]+)"+t.requote(e)+"$");for(var a in this)if(r=a.match(n)){var i=this[a];this.removeEventListener(r[1],i,i.$),delete this[a]}}}t.selection.enter=ut,t.selection.enter.prototype=ct,ct.append=W.append,ct.empty=W.empty,ct.node=W.node,ct.call=W.call,ct.size=W.size,ct.select=function(t){for(var e,r,n,a,i,o=[],s=-1,l=this.length;++s<l;){n=(a=this[s]).update,o.push(e=[]),e.parentNode=a.parentNode;for(var u=-1,c=a.length;++u<c;)(i=a[u])?(e.push(n[u]=r=t.call(a.parentNode,i.__data__,u,s)),r.__data__=i.__data__):e.push(null)}return B(o)},ct.insert=function(t,e){var r,n,a;return arguments.length<2&&(r=this,e=function(t,e,i){var o,s=r[i].update,l=s.length;for(i!=a&&(a=i,n=0),e>=n&&(n=e+1);!(o=s[n])&&++n<l;);return o}),W.insert.call(this,t,e)},t.select=function(t){var e;return"string"==typeof t?(e=[H(t,a)]).parentNode=a.documentElement:(e=[t]).parentNode=i(t),B([e])},t.selectAll=function(t){var e;return"string"==typeof t?(e=n(U(t,a))).parentNode=a.documentElement:(e=n(t)).parentNode=null,B([e])},W.on=function(t,e,r){var n=arguments.length;if(n<3){if("string"!=typeof t){for(r in n<2&&(e=!1),t)this.each(ht(r,t[r],e));return this}if(n<2)return(n=this.node()["__on"+t])&&n._;r=!1}return this.each(ht(t,e,r))};var dt=t.map({mouseenter:"mouseover",mouseleave:"mouseout"});function ft(e,r){return function(n){var a=t.event;t.event=n,r[0]=this.__data__;try{e.apply(this,r)}finally{t.event=a}}}function pt(t,e){var r=ft(t,e);return function(t){var e=t.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||r.call(this,t)}}a&&dt.forEach((function(t){"on"+t in a&&dt.remove(t)}));var mt,gt=0;function yt(e){var r=".dragsuppress-"+ ++gt,n="click"+r,a=t.select(o(e)).on("touchmove"+r,R).on("dragstart"+r,R).on("selectstart"+r,R);if(null==mt&&(mt=!("onselectstart"in e)&&D(e.style,"userSelect")),mt){var s=i(e).style,l=s[mt];s[mt]="none"}return function(t){if(a.on(r,null),mt&&(s[mt]=l),t){var e=function(){a.on(n,null)};a.on(n,(function(){R(),e()}),!0),setTimeout(e,0)}}}t.mouse=function(t){return _t(t,F())};var vt=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function _t(e,r){r.changedTouches&&(r=r.changedTouches[0]);var n=e.ownerSVGElement||e;if(n.createSVGPoint){var a=n.createSVGPoint();if(vt<0){var i=o(e);if(i.scrollX||i.scrollY){var s=(n=t.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important"))[0][0].getScreenCTM();vt=!(s.f||s.e),n.remove()}}return vt?(a.x=r.pageX,a.y=r.pageY):(a.x=r.clientX,a.y=r.clientY),[(a=a.matrixTransform(e.getScreenCTM().inverse())).x,a.y]}var l=e.getBoundingClientRect();return[r.clientX-l.left-e.clientLeft,r.clientY-l.top-e.clientTop]}function xt(){return t.event.changedTouches[0].identifier}t.touch=function(t,e,r){if(arguments.length<3&&(r=e,e=F().changedTouches),e)for(var n,a=0,i=e.length;a<i;++a)if((n=e[a]).identifier===r)return _t(t,n)},t.behavior.drag=function(){var e=N(i,"drag","dragstart","dragend"),r=null,n=s(O,t.mouse,o,"mousemove","mouseup"),a=s(xt,t.touch,E,"touchmove","touchend");function i(){this.on("mousedown.drag",n).on("touchstart.drag",a)}function s(n,a,i,o,s){return function(){var l,u=t.event.target.correspondingElement||t.event.target,c=this.parentNode,h=e.of(this,arguments),d=0,f=n(),p=".drag"+(null==f?"":"-"+f),m=t.select(i(u)).on(o+p,(function(){var t,e,r=a(c,f);r&&(t=r[0]-y[0],e=r[1]-y[1],d|=t|e,y=r,h({type:"drag",x:r[0]+l[0],y:r[1]+l[1],dx:t,dy:e}))})).on(s+p,(function(){a(c,f)&&(m.on(o+p,null).on(s+p,null),g(d),h({type:"dragend"}))})),g=yt(u),y=a(c,f);l=r?[(l=r.apply(this,arguments)).x-y[0],l.y-y[1]]:[0,0],h({type:"dragstart"})}}return i.origin=function(t){return arguments.length?(r=t,i):r},t.rebind(i,e,"on")},t.touches=function(t,e){return arguments.length<2&&(e=F().touches),e?n(e).map((function(e){var r=_t(t,e);return r.identifier=e.identifier,r})):[]};var bt=1e-6,wt=1e-12,Mt=Math.PI,kt=2*Mt,Tt=kt-bt,Lt=Mt/2,At=Mt/180,St=180/Mt;function Et(t){return t>0?1:t<0?-1:0}function Ct(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function Dt(t){return t>1?0:t<-1?Mt:Math.acos(t)}function Pt(t){return t>1?Lt:t<-1?-Lt:Math.asin(t)}function Ot(t){return((t=Math.exp(t))+1/t)/2}function zt(t){return(t=Math.sin(t/2))*t}var It=Math.SQRT2;t.interpolateZoom=function(t,e){var r,n,a=t[0],i=t[1],o=t[2],s=e[0],l=e[1],u=e[2],c=s-a,h=l-i,d=c*c+h*h;if(d<wt)n=Math.log(u/o)/It,r=function(t){return[a+t*c,i+t*h,o*Math.exp(It*t*n)]};else{var f=Math.sqrt(d),p=(u*u-o*o+4*d)/(2*o*2*f),m=(u*u-o*o-4*d)/(2*u*2*f),g=Math.log(Math.sqrt(p*p+1)-p),y=Math.log(Math.sqrt(m*m+1)-m);n=(y-g)/It,r=function(t){var e,r=t*n,s=Ot(g),l=o/(2*f)*(s*(e=It*r+g,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(g));return[a+l*c,i+l*h,o*s/Ot(It*r+g)]}}return r.duration=1e3*n,r},t.behavior.zoom=function(){var e,r,n,i,s,l,u,c,h,d={x:0,y:0,k:1},f=[960,500],p=Nt,m=250,g=0,y="mousedown.zoom",v="mousemove.zoom",_="mouseup.zoom",x="touchstart.zoom",b=N(w,"zoomstart","zoom","zoomend");function w(t){t.on(y,D).on(Ft+".zoom",O).on("dblclick.zoom",z).on(x,P)}function M(t){return[(t[0]-d.x)/d.k,(t[1]-d.y)/d.k]}function k(t){d.k=Math.max(p[0],Math.min(p[1],t))}function T(t,e){e=function(t){return[t[0]*d.k+d.x,t[1]*d.k+d.y]}(e),d.x+=t[0]-e[0],d.y+=t[1]-e[1]}function L(e,n,a,i){e.__chart__={x:d.x,y:d.y,k:d.k},k(Math.pow(2,i)),T(r=n,a),e=t.select(e),m>0&&(e=e.transition().duration(m)),e.call(w.event)}function A(){u&&u.domain(l.range().map((function(t){return(t-d.x)/d.k})).map(l.invert)),h&&h.domain(c.range().map((function(t){return(t-d.y)/d.k})).map(c.invert))}function S(t){g++||t({type:"zoomstart"})}function E(t){A(),t({type:"zoom",scale:d.k,translate:[d.x,d.y]})}function C(t){--g||(t({type:"zoomend"}),r=null)}function D(){var e=this,r=b.of(e,arguments),n=0,a=t.select(o(e)).on(v,(function(){n=1,T(t.mouse(e),i),E(r)})).on(_,(function(){a.on(v,null).on(_,null),s(n),C(r)})),i=M(t.mouse(e)),s=yt(e);ls.call(e),S(r)}function P(){var e,r=this,n=b.of(r,arguments),a={},i=0,o=".zoom-"+t.event.changedTouches[0].identifier,l="touchmove"+o,u="touchend"+o,c=[],h=t.select(r),f=yt(r);function p(){var n=t.touches(r);return e=d.k,n.forEach((function(t){t.identifier in a&&(a[t.identifier]=M(t))})),n}function m(){var e=t.event.target;t.select(e).on(l,g).on(u,v),c.push(e);for(var n=t.event.changedTouches,o=0,h=n.length;o<h;++o)a[n[o].identifier]=null;var f=p(),m=Date.now();if(1===f.length){if(m-s<500){var y=f[0];L(r,y,a[y.identifier],Math.floor(Math.log(d.k)/Math.LN2)+1),R()}s=m}else if(f.length>1){y=f[0];var _=f[1],x=y[0]-_[0],b=y[1]-_[1];i=x*x+b*b}}function g(){var o,l,u,c,h=t.touches(r);ls.call(r);for(var d=0,f=h.length;d<f;++d,c=null)if(u=h[d],c=a[u.identifier]){if(l)break;o=u,l=c}if(c){var p=(p=u[0]-o[0])*p+(p=u[1]-o[1])*p,m=i&&Math.sqrt(p/i);o=[(o[0]+u[0])/2,(o[1]+u[1])/2],l=[(l[0]+c[0])/2,(l[1]+c[1])/2],k(m*e)}s=null,T(o,l),E(n)}function v(){if(t.event.touches.length){for(var e=t.event.changedTouches,r=0,i=e.length;r<i;++r)delete a[e[r].identifier];for(var s in a)return void p()}t.selectAll(c).on(o,null),h.on(y,D).on(x,P),f(),C(n)}m(),S(n),h.on(y,null).on(x,m)}function O(){var a=b.of(this,arguments);i?clearTimeout(i):(ls.call(this),e=M(r=n||t.mouse(this)),S(a)),i=setTimeout((function(){i=null,C(a)}),50),R(),k(Math.pow(2,.002*Rt())*d.k),T(r,e),E(a)}function z(){var e=t.mouse(this),r=Math.log(d.k)/Math.LN2;L(this,e,M(e),t.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}return Ft||(Ft="onwheel"in a?(Rt=function(){return-t.event.deltaY*(t.event.deltaMode?120:1)},"wheel"):"onmousewheel"in a?(Rt=function(){return t.event.wheelDelta},"mousewheel"):(Rt=function(){return-t.event.detail},"MozMousePixelScroll")),w.event=function(e){e.each((function(){var e=b.of(this,arguments),n=d;hs?t.select(this).transition().each("start.zoom",(function(){d=this.__chart__||{x:0,y:0,k:1},S(e)})).tween("zoom:zoom",(function(){var a=f[0],i=f[1],o=r?r[0]:a/2,s=r?r[1]:i/2,l=t.interpolateZoom([(o-d.x)/d.k,(s-d.y)/d.k,a/d.k],[(o-n.x)/n.k,(s-n.y)/n.k,a/n.k]);return function(t){var r=l(t),n=a/r[2];this.__chart__=d={x:o-r[0]*n,y:s-r[1]*n,k:n},E(e)}})).each("interrupt.zoom",(function(){C(e)})).each("end.zoom",(function(){C(e)})):(this.__chart__=d,S(e),E(e),C(e))}))},w.translate=function(t){return arguments.length?(d={x:+t[0],y:+t[1],k:d.k},A(),w):[d.x,d.y]},w.scale=function(t){return arguments.length?(d={x:d.x,y:d.y,k:null},k(+t),A(),w):d.k},w.scaleExtent=function(t){return arguments.length?(p=null==t?Nt:[+t[0],+t[1]],w):p},w.center=function(t){return arguments.length?(n=t&&[+t[0],+t[1]],w):n},w.size=function(t){return arguments.length?(f=t&&[+t[0],+t[1]],w):f},w.duration=function(t){return arguments.length?(m=+t,w):m},w.x=function(t){return arguments.length?(u=t,l=t.copy(),d={x:0,y:0,k:1},w):u},w.y=function(t){return arguments.length?(h=t,c=t.copy(),d={x:0,y:0,k:1},w):h},t.rebind(w,b,"on")};var Rt,Ft,Nt=[0,1/0];function Yt(){}function jt(t,e,r){return this instanceof jt?(this.h=+t,this.s=+e,void(this.l=+r)):arguments.length<2?t instanceof jt?new jt(t.h,t.s,t.l):se(""+t,le,jt):new jt(t,e,r)}t.color=Yt,Yt.prototype.toString=function(){return this.rgb()+""},t.hsl=jt;var Bt=jt.prototype=new Yt;function Ht(t,e,r){var n,a;function i(t){return Math.round(255*function(t){return t>360?t-=360:t<0&&(t+=360),t<60?n+(a-n)*t/60:t<180?a:t<240?n+(a-n)*(240-t)/60:n}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)||e<0?0:e>1?1:e,n=2*(r=r<0?0:r>1?1:r)-(a=r<=.5?r*(1+e):r+e-r*e),new re(i(t+120),i(t),i(t-120))}function Ut(e,r,n){return this instanceof Ut?(this.h=+e,this.c=+r,void(this.l=+n)):arguments.length<2?e instanceof Ut?new Ut(e.h,e.c,e.l):$t(e instanceof Gt?e.l:(e=ue((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Ut(e,r,n)}Bt.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new jt(this.h,this.s,this.l/t)},Bt.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new jt(this.h,this.s,t*this.l)},Bt.rgb=function(){return Ht(this.h,this.s,this.l)},t.hcl=Ut;var Vt=Ut.prototype=new Yt;function Wt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new Gt(r,Math.cos(t*=At)*e,Math.sin(t)*e)}function Gt(t,e,r){return this instanceof Gt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof Gt?new Gt(t.l,t.a,t.b):t instanceof Ut?Wt(t.h,t.c,t.l):ue((t=re(t)).r,t.g,t.b):new Gt(t,e,r)}Vt.brighter=function(t){return new Ut(this.h,this.c,Math.min(100,this.l+qt*(arguments.length?t:1)))},Vt.darker=function(t){return new Ut(this.h,this.c,Math.max(0,this.l-qt*(arguments.length?t:1)))},Vt.rgb=function(){return Wt(this.h,this.c,this.l).rgb()},t.lab=Gt;var qt=18,Zt=.95047,Xt=1.08883,Jt=Gt.prototype=new Yt;function Kt(t,e,r){var n=(t+16)/116,a=n+e/500,i=n-r/200;return new re(ee(3.2404542*(a=Qt(a)*Zt)-1.5371385*(n=1*Qt(n))-.4985314*(i=Qt(i)*Xt)),ee(-.969266*a+1.8760108*n+.041556*i),ee(.0556434*a-.2040259*n+1.0572252*i))}function $t(t,e,r){return t>0?new Ut(Math.atan2(r,e)*St,Math.sqrt(e*e+r*r),t):new Ut(NaN,NaN,t)}function Qt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function te(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function ee(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function re(t,e,r){return this instanceof re?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof re?new re(t.r,t.g,t.b):se(""+t,re,Ht):new re(t,e,r)}function ne(t){return new re(t>>16,t>>8&255,255&t)}function ae(t){return ne(t)+""}Jt.brighter=function(t){return new Gt(Math.min(100,this.l+qt*(arguments.length?t:1)),this.a,this.b)},Jt.darker=function(t){return new Gt(Math.max(0,this.l-qt*(arguments.length?t:1)),this.a,this.b)},Jt.rgb=function(){return Kt(this.l,this.a,this.b)},t.rgb=re;var ie=re.prototype=new Yt;function oe(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function se(t,e,r){var n,a,i,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(a=n[2].split(","),n[1]){case"hsl":return r(parseFloat(a[0]),parseFloat(a[1])/100,parseFloat(a[2])/100);case"rgb":return e(he(a[0]),he(a[1]),he(a[2]))}return(i=de.get(t))?e(i.r,i.g,i.b):(null==t||"#"!==t.charAt(0)||isNaN(i=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&i)>>4,o|=o>>4,s=240&i,s|=s>>4,l=15&i,l|=l<<4):7===t.length&&(o=(16711680&i)>>16,s=(65280&i)>>8,l=255&i)),e(o,s,l))}function le(t,e,r){var n,a,i=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),s=o-i,l=(o+i)/2;return s?(a=l<.5?s/(o+i):s/(2-o-i),n=t==o?(e-r)/s+(e<r?6:0):e==o?(r-t)/s+2:(t-e)/s+4,n*=60):(n=NaN,a=l>0&&l<1?0:n),new jt(n,a,l)}function ue(t,e,r){var n=te((.4124564*(t=ce(t))+.3575761*(e=ce(e))+.1804375*(r=ce(r)))/Zt),a=te((.2126729*t+.7151522*e+.072175*r)/1);return Gt(116*a-16,500*(n-a),200*(a-te((.0193339*t+.119192*e+.9503041*r)/Xt)))}function ce(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function he(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}ie.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,a=30;return e||r||n?(e&&e<a&&(e=a),r&&r<a&&(r=a),n&&n<a&&(n=a),new re(Math.min(255,e/t),Math.min(255,r/t),Math.min(255,n/t))):new re(a,a,a)},ie.darker=function(t){return new re((t=Math.pow(.7,arguments.length?t:1))*this.r,t*this.g,t*this.b)},ie.hsl=function(){return le(this.r,this.g,this.b)},ie.toString=function(){return"#"+oe(this.r)+oe(this.g)+oe(this.b)};var de=t.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});function fe(t){return"function"==typeof t?t:function(){return t}}function pe(t){return function(e,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=null),me(e,r,t,n)}}function me(e,r,a,i){var o={},s=t.dispatch("beforesend","progress","load","error"),l={},u=new XMLHttpRequest,c=null;function h(){var t,e=u.status;if(!e&&function(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}(u)||e>=200&&e<300||304===e){try{t=a.call(o,u)}catch(t){return void s.error.call(o,t)}s.load.call(o,t)}else s.error.call(o,u)}return!this.XDomainRequest||"withCredentials"in u||!/^(http(s)?:)?\/\//.test(e)||(u=new XDomainRequest),"onload"in u?u.onload=u.onerror=h:u.onreadystatechange=function(){u.readyState>3&&h()},u.onprogress=function(e){var r=t.event;t.event=e;try{s.progress.call(o,u)}finally{t.event=r}},o.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?l[t]:(null==e?delete l[t]:l[t]=e+"",o)},o.mimeType=function(t){return arguments.length?(r=null==t?null:t+"",o):r},o.responseType=function(t){return arguments.length?(c=t,o):c},o.response=function(t){return a=t,o},["get","post"].forEach((function(t){o[t]=function(){return o.send.apply(o,[t].concat(n(arguments)))}})),o.send=function(t,n,a){if(2===arguments.length&&"function"==typeof n&&(a=n,n=null),u.open(t,e,!0),null==r||"accept"in l||(l.accept=r+",*/*"),u.setRequestHeader)for(var i in l)u.setRequestHeader(i,l[i]);return null!=r&&u.overrideMimeType&&u.overrideMimeType(r),null!=c&&(u.responseType=c),null!=a&&o.on("error",a).on("load",(function(t){a(null,t)})),s.beforesend.call(o,u),u.send(null==n?null:n),o},o.abort=function(){return u.abort(),o},t.rebind(o,s,"on"),null==i?o:o.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(i))}de.forEach((function(t,e){de.set(t,ne(e))})),t.functor=fe,t.xhr=pe(E),t.dsv=function(t,e){var r=new RegExp('["'+t+"\n]"),n=t.charCodeAt(0);function a(t,r,n){arguments.length<3&&(n=r,r=null);var a=me(t,e,null==r?i:o(r),n);return a.row=function(t){return arguments.length?a.response(null==(r=t)?i:o(t)):r},a}function i(t){return a.parse(t.responseText)}function o(t){return function(e){return a.parse(e.responseText,t)}}function s(e){return e.map(l).join(t)}function l(t){return r.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return a.parse=function(t,e){var r;return a.parseRows(t,(function(t,n){if(r)return r(t,n-1);var a=new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+"]"})).join(",")+"}");r=e?function(t,r){return e(a(t),r)}:a}))},a.parseRows=function(t,e){var r,a,i={},o={},s=[],l=t.length,u=0,c=0;function h(){if(u>=l)return o;if(a)return a=!1,i;var e=u;if(34===t.charCodeAt(e)){for(var r=e;r++<l;)if(34===t.charCodeAt(r)){if(34!==t.charCodeAt(r+1))break;++r}return u=r+2,13===(s=t.charCodeAt(r+1))?(a=!0,10===t.charCodeAt(r+2)&&++u):10===s&&(a=!0),t.slice(e+1,r).replace(/""/g,'"')}for(;u<l;){var s,c=1;if(10===(s=t.charCodeAt(u++)))a=!0;else if(13===s)a=!0,10===t.charCodeAt(u)&&(++u,++c);else if(s!==n)continue;return t.slice(e,u-c)}return t.slice(e)}for(;(r=h())!==o;){for(var d=[];r!==i&&r!==o;)d.push(r),r=h();e&&null==(d=e(d,c++))||s.push(d)}return s},a.format=function(e){if(Array.isArray(e[0]))return a.formatRows(e);var r=new S,n=[];return e.forEach((function(t){for(var e in t)r.has(e)||n.push(r.add(e))})),[n.map(l).join(t)].concat(e.map((function(e){return n.map((function(t){return l(e[t])})).join(t)}))).join("\n")},a.formatRows=function(t){return t.map(s).join("\n")},a},t.csv=t.dsv(",","text/csv"),t.tsv=t.dsv("\t","text/tab-separated-values");var ge,ye,ve,_e,xe=this[D(this,"requestAnimationFrame")]||function(t){setTimeout(t,17)};function be(t,e,r){var n=arguments.length;n<2&&(e=0),n<3&&(r=Date.now());var a={c:t,t:r+e,n:null};return ye?ye.n=a:ge=a,ye=a,ve||(_e=clearTimeout(_e),ve=1,xe(we)),a}function we(){var t=Me(),e=ke()-t;e>24?(isFinite(e)&&(clearTimeout(_e),_e=setTimeout(we,e)),ve=0):(ve=1,xe(we))}function Me(){for(var t=Date.now(),e=ge;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function ke(){for(var t,e=ge,r=1/0;e;)e.c?(e.t<r&&(r=e.t),e=(t=e).n):e=t?t.n=e.n:ge=e.n;return ye=t,r}function Te(t,e){return e-(t?Math.ceil(Math.log(t)/Math.LN10):1)}t.timer=function(){be.apply(this,arguments)},t.timer.flush=function(){Me(),ke()},t.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var Le=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map((function(t,e){var r=Math.pow(10,3*v(8-e));return{scale:e>8?function(t){return t/r}:function(t){return t*r},symbol:t}}));t.formatPrefix=function(e,r){var n=0;return(e=+e)&&(e<0&&(e*=-1),r&&(e=t.round(e,Te(e,r))),n=1+Math.floor(1e-12+Math.log(e)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),Le[8+n/3]};var Ae=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Se=t.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(e,r){return(e=t.round(e,Te(e,r))).toFixed(Math.max(0,Math.min(20,Te(e*(1+1e-15),r))))}});function Ee(t){return t+""}var Ce=t.time={},De=Date;function Pe(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}Pe.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(){Oe.setUTCDate.apply(this._,arguments)},setDay:function(){Oe.setUTCDay.apply(this._,arguments)},setFullYear:function(){Oe.setUTCFullYear.apply(this._,arguments)},setHours:function(){Oe.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Oe.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Oe.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Oe.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Oe.setUTCSeconds.apply(this._,arguments)},setTime:function(){Oe.setTime.apply(this._,arguments)}};var Oe=Date.prototype;function ze(t,e,r){function n(e){var r=t(e),n=i(r,1);return e-r<n-e?r:n}function a(r){return e(r=t(new De(r-1)),1),r}function i(t,r){return e(t=new De(+t),r),t}function o(t,n,i){var o=a(t),s=[];if(i>1)for(;o<n;)r(o)%i||s.push(new Date(+o)),e(o,1);else for(;o<n;)s.push(new Date(+o)),e(o,1);return s}t.floor=t,t.round=n,t.ceil=a,t.offset=i,t.range=o;var s=t.utc=Ie(t);return s.floor=s,s.round=Ie(n),s.ceil=Ie(a),s.offset=Ie(i),s.range=function(t,e,r){try{De=Pe;var n=new Pe;return n._=t,o(n,e,r)}finally{De=Date}},t}function Ie(t){return function(e,r){try{De=Pe;var n=new Pe;return n._=e,t(n,r)._}finally{De=Date}}}Ce.year=ze((function(t){return(t=Ce.day(t)).setMonth(0,1),t}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t){return t.getFullYear()})),Ce.years=Ce.year.range,Ce.years.utc=Ce.year.utc.range,Ce.day=ze((function(t){var e=new De(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})),Ce.days=Ce.day.range,Ce.days.utc=Ce.day.utc.range,Ce.dayOfYear=function(t){var e=Ce.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=Ce[t]=ze((function(t){return(t=Ce.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=Ce.year(t).getDay();return Math.floor((Ce.dayOfYear(t)+(r+e)%7)/7)-(r!==e)}));Ce[t+"s"]=r.range,Ce[t+"s"].utc=r.utc.range,Ce[t+"OfYear"]=function(t){var r=Ce.year(t).getDay();return Math.floor((Ce.dayOfYear(t)+(r+e)%7)/7)}})),Ce.week=Ce.sunday,Ce.weeks=Ce.sunday.range,Ce.weeks.utc=Ce.sunday.utc.range,Ce.weekOfYear=Ce.sundayOfYear;var Re={"-":"",_:" ",0:"0"},Fe=/^\s*\d+/,Ne=/^%/;function Ye(t,e,r){var n=t<0?"-":"",a=(n?-t:t)+"",i=a.length;return n+(i<r?new Array(r-i+1).join(e)+a:a)}function je(e){return new RegExp("^(?:"+e.map(t.requote).join("|")+")","i")}function Be(t){for(var e=new x,r=-1,n=t.length;++r<n;)e.set(t[r].toLowerCase(),r);return e}function He(t,e,r){Fe.lastIndex=0;var n=Fe.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function Ue(t,e,r){Fe.lastIndex=0;var n=Fe.exec(e.slice(r));return n?(t.U=+n[0],r+n[0].length):-1}function Ve(t,e,r){Fe.lastIndex=0;var n=Fe.exec(e.slice(r));return n?(t.W=+n[0],r+n[0].length):-1}function We(t,e,r){Fe.lastIndex=0;var n=Fe.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function Ge(t,e,r){Fe.lastIndex=0;var n,a=Fe.exec(e.slice(r,r+2));return a?(t.y=(n=+a[0])+(n>68?1900:2e3),r+a[0].length):-1}function qe(t,e,r){return/^[+-]\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function Ze(t,e,r){Fe.lastIndex=0;var n=Fe.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function Xe(t,e,r){Fe.lastIndex=0;var n=Fe.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function Je(t,e,r){Fe.lastIndex=0;var n=Fe.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function Ke(t,e,r){Fe.lastIndex=0;var n=Fe.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function $e(t,e,r){Fe.lastIndex=0;var n=Fe.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function Qe(t,e,r){Fe.lastIndex=0;var n=Fe.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function tr(t,e,r){Fe.lastIndex=0;var n=Fe.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function er(t){var e=t.getTimezoneOffset(),r=e>0?"-":"+",n=v(e)/60|0,a=v(e)%60;return r+Ye(n,"0",2)+Ye(a,"0",2)}function rr(t,e,r){Ne.lastIndex=0;var n=Ne.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function nr(t){for(var e=t.length,r=-1;++r<e;)t[r][0]=this(t[r][0]);return function(e){for(var r=0,n=t[r];!n[1](e);)n=t[++r];return n[0](e)}}t.locale=function(e){return{numberFormat:function(e){var r=e.decimal,n=e.thousands,a=e.grouping,i=e.currency,o=a&&n?function(t,e){for(var r=t.length,i=[],o=0,s=a[0],l=0;r>0&&s>0&&(l+s+1>e&&(s=Math.max(1,e-l)),i.push(t.substring(r-=s,r+s)),!((l+=s+1)>e));)s=a[o=(o+1)%a.length];return i.reverse().join(n)}:E;return function(e){var n=Ae.exec(e),a=n[1]||" ",s=n[2]||">",l=n[3]||"-",u=n[4]||"",c=n[5],h=+n[6],d=n[7],f=n[8],p=n[9],m=1,g="",y="",v=!1,_=!0;switch(f&&(f=+f.substring(1)),(c||"0"===a&&"="===s)&&(c=a="0",s="="),p){case"n":d=!0,p="g";break;case"%":m=100,y="%",p="f";break;case"p":m=100,y="%",p="r";break;case"b":case"o":case"x":case"X":"#"===u&&(g="0"+p.toLowerCase());case"c":_=!1;case"d":v=!0,f=0;break;case"s":m=-1,p="r"}"$"===u&&(g=i[0],y=i[1]),"r"!=p||f||(p="g"),null!=f&&("g"==p?f=Math.max(1,Math.min(21,f)):"e"!=p&&"f"!=p||(f=Math.max(0,Math.min(20,f)))),p=Se.get(p)||Ee;var x=c&&d;return function(e){var n=y;if(v&&e%1)return"";var i=e<0||0===e&&1/e<0?(e=-e,"-"):"-"===l?"":l;if(m<0){var u=t.formatPrefix(e,f);e=u.scale(e),n=u.symbol+y}else e*=m;var b,w,M=(e=p(e,f)).lastIndexOf(".");if(M<0){var k=_?e.lastIndexOf("e"):-1;k<0?(b=e,w=""):(b=e.substring(0,k),w=e.substring(k))}else b=e.substring(0,M),w=r+e.substring(M+1);!c&&d&&(b=o(b,1/0));var T=g.length+b.length+w.length+(x?0:i.length),L=T<h?new Array(T=h-T+1).join(a):"";return x&&(b=o(L+b,L.length?h-w.length:1/0)),i+=g,e=b+w,("<"===s?i+e+L:">"===s?L+i+e:"^"===s?L.substring(0,T>>=1)+i+e+L.substring(T):i+(x?e:L+e))+n}}}(e),timeFormat:function(e){var r=e.dateTime,n=e.date,a=e.time,i=e.periods,o=e.days,s=e.shortDays,l=e.months,u=e.shortMonths;function c(t){var e=t.length;function r(r){for(var n,a,i,o=[],s=-1,l=0;++s<e;)37===t.charCodeAt(s)&&(o.push(t.slice(l,s)),null!=(a=Re[n=t.charAt(++s)])&&(n=t.charAt(++s)),(i=b[n])&&(n=i(r,null==a?"e"===n?" ":"0":a)),o.push(n),l=s+1);return o.push(t.slice(l,s)),o.join("")}return r.parse=function(e){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null};if(h(r,t,e,0)!=e.length)return null;"p"in r&&(r.H=r.H%12+12*r.p);var n=null!=r.Z&&De!==Pe,a=new(n?Pe:De);return"j"in r?a.setFullYear(r.y,0,r.j):"W"in r||"U"in r?("w"in r||(r.w="W"in r?1:0),a.setFullYear(r.y,0,1),a.setFullYear(r.y,0,"W"in r?(r.w+6)%7+7*r.W-(a.getDay()+5)%7:r.w+7*r.U-(a.getDay()+6)%7)):a.setFullYear(r.y,r.m,r.d),a.setHours(r.H+(r.Z/100|0),r.M+r.Z%100,r.S,r.L),n?a._:a},r.toString=function(){return t},r}function h(t,e,r,n){for(var a,i,o,s=0,l=e.length,u=r.length;s<l;){if(n>=u)return-1;if(37===(a=e.charCodeAt(s++))){if(o=e.charAt(s++),!(i=w[o in Re?e.charAt(s++):o])||(n=i(t,r,n))<0)return-1}else if(a!=r.charCodeAt(n++))return-1}return n}c.utc=function(t){var e=c(t);function r(t){try{var r=new(De=Pe);return r._=t,e(r)}finally{De=Date}}return r.parse=function(t){try{De=Pe;var r=e.parse(t);return r&&r._}finally{De=Date}},r.toString=e.toString,r},c.multi=c.utc.multi=nr;var d=t.map(),f=je(o),p=Be(o),m=je(s),g=Be(s),y=je(l),v=Be(l),_=je(u),x=Be(u);i.forEach((function(t,e){d.set(t.toLowerCase(),e)}));var b={a:function(t){return s[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return u[t.getMonth()]},B:function(t){return l[t.getMonth()]},c:c(r),d:function(t,e){return Ye(t.getDate(),e,2)},e:function(t,e){return Ye(t.getDate(),e,2)},H:function(t,e){return Ye(t.getHours(),e,2)},I:function(t,e){return Ye(t.getHours()%12||12,e,2)},j:function(t,e){return Ye(1+Ce.dayOfYear(t),e,3)},L:function(t,e){return Ye(t.getMilliseconds(),e,3)},m:function(t,e){return Ye(t.getMonth()+1,e,2)},M:function(t,e){return Ye(t.getMinutes(),e,2)},p:function(t){return i[+(t.getHours()>=12)]},S:function(t,e){return Ye(t.getSeconds(),e,2)},U:function(t,e){return Ye(Ce.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Ye(Ce.mondayOfYear(t),e,2)},x:c(n),X:c(a),y:function(t,e){return Ye(t.getFullYear()%100,e,2)},Y:function(t,e){return Ye(t.getFullYear()%1e4,e,4)},Z:er,"%":function(){return"%"}},w={a:function(t,e,r){m.lastIndex=0;var n=m.exec(e.slice(r));return n?(t.w=g.get(n[0].toLowerCase()),r+n[0].length):-1},A:function(t,e,r){f.lastIndex=0;var n=f.exec(e.slice(r));return n?(t.w=p.get(n[0].toLowerCase()),r+n[0].length):-1},b:function(t,e,r){_.lastIndex=0;var n=_.exec(e.slice(r));return n?(t.m=x.get(n[0].toLowerCase()),r+n[0].length):-1},B:function(t,e,r){y.lastIndex=0;var n=y.exec(e.slice(r));return n?(t.m=v.get(n[0].toLowerCase()),r+n[0].length):-1},c:function(t,e,r){return h(t,b.c.toString(),e,r)},d:Xe,e:Xe,H:Ke,I:Ke,j:Je,L:tr,m:Ze,M:$e,p:function(t,e,r){var n=d.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)},S:Qe,U:Ue,w:He,W:Ve,x:function(t,e,r){return h(t,b.x.toString(),e,r)},X:function(t,e,r){return h(t,b.X.toString(),e,r)},y:Ge,Y:We,Z:qe,"%":rr};return c}(e)}};var ar=t.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function ir(){}t.format=ar.numberFormat,t.geo={},ir.prototype={s:0,t:0,add:function(t){sr(t,this.t,or),sr(or.s,this.s,this),this.s?this.t+=or.t:this.s=or.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var or=new ir;function sr(t,e,r){var n=r.s=t+e,a=n-t,i=n-a;r.t=t-i+(e-a)}function lr(t,e){t&&cr.hasOwnProperty(t.type)&&cr[t.type](t,e)}t.geo.stream=function(t,e){t&&ur.hasOwnProperty(t.type)?ur[t.type](t,e):lr(t,e)};var ur={Feature:function(t,e){lr(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,a=r.length;++n<a;)lr(r[n].geometry,e)}},cr={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,a=r.length;++n<a;)t=r[n],e.point(t[0],t[1],t[2])},LineString:function(t,e){hr(t.coordinates,e,0)},MultiLineString:function(t,e){for(var r=t.coordinates,n=-1,a=r.length;++n<a;)hr(r[n],e,0)},Polygon:function(t,e){dr(t.coordinates,e)},MultiPolygon:function(t,e){for(var r=t.coordinates,n=-1,a=r.length;++n<a;)dr(r[n],e)},GeometryCollection:function(t,e){for(var r=t.geometries,n=-1,a=r.length;++n<a;)lr(r[n],e)}};function hr(t,e,r){var n,a=-1,i=t.length-r;for(e.lineStart();++a<i;)n=t[a],e.point(n[0],n[1],n[2]);e.lineEnd()}function dr(t,e){var r=-1,n=t.length;for(e.polygonStart();++r<n;)hr(t[r],e,1);e.polygonEnd()}t.geo.area=function(e){return fr=0,t.geo.stream(e,Lr),fr};var fr,pr,mr,gr,yr,vr,_r,xr,br,wr,Mr,kr,Tr=new ir,Lr={sphere:function(){fr+=4*Mt},point:O,lineStart:O,lineEnd:O,polygonStart:function(){Tr.reset(),Lr.lineStart=Ar},polygonEnd:function(){var t=2*Tr;fr+=t<0?4*Mt+t:t,Lr.lineStart=Lr.lineEnd=Lr.point=O}};function Ar(){var t,e,r,n,a;function i(t,e){e=e*At/2+Mt/4;var i=(t*=At)-r,o=i>=0?1:-1,s=o*i,l=Math.cos(e),u=Math.sin(e),c=a*u,h=n*l+c*Math.cos(s),d=c*o*Math.sin(s);Tr.add(Math.atan2(d,h)),r=t,n=l,a=u}Lr.point=function(o,s){Lr.point=i,r=(t=o)*At,n=Math.cos(s=(e=s)*At/2+Mt/4),a=Math.sin(s)},Lr.lineEnd=function(){i(t,e)}}function Sr(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 Er(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Cr(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 Dr(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Pr(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Or(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 zr(t){return[Math.atan2(t[1],t[0]),Pt(t[2])]}function Ir(t,e){return v(t[0]-e[0])<bt&&v(t[1]-e[1])<bt}t.geo.bounds=function(){var e,r,n,a,i,o,s,l,u,c,h,d={point:f,lineStart:m,lineEnd:g,polygonStart:function(){d.point=y,d.lineStart=_,d.lineEnd=x,u=0,Lr.polygonStart()},polygonEnd:function(){Lr.polygonEnd(),d.point=f,d.lineStart=m,d.lineEnd=g,Tr<0?(e=-(n=180),r=-(a=90)):u>bt?a=90:u<-bt&&(r=-90),h[0]=e,h[1]=n}};function f(t,i){c.push(h=[e=t,n=t]),i<r&&(r=i),i>a&&(a=i)}function p(t,o){var s=Sr([t*At,o*At]);if(l){var u=Cr(l,s),c=Cr([u[1],-u[0],0],u);Or(c),c=zr(c);var h=t-i,d=h>0?1:-1,p=c[0]*St*d,m=v(h)>180;if(m^(d*i<p&&p<d*t))(g=c[1]*St)>a&&(a=g);else if(m^(d*i<(p=(p+360)%360-180)&&p<d*t)){var g;(g=-c[1]*St)<r&&(r=g)}else o<r&&(r=o),o>a&&(a=o);m?t<i?b(e,t)>b(e,n)&&(n=t):b(t,n)>b(e,n)&&(e=t):n>=e?(t<e&&(e=t),t>n&&(n=t)):t>i?b(e,t)>b(e,n)&&(n=t):b(t,n)>b(e,n)&&(e=t)}else f(t,o);l=s,i=t}function m(){d.point=p}function g(){h[0]=e,h[1]=n,d.point=f,l=null}function y(t,e){if(l){var r=t-i;u+=v(r)>180?r+(r>0?360:-360):r}else o=t,s=e;Lr.point(t,e),p(t,e)}function _(){Lr.lineStart()}function x(){y(o,s),Lr.lineEnd(),v(u)>bt&&(e=-(n=180)),h[0]=e,h[1]=n,l=null}function b(t,e){return(e-=t)<0?e+360:e}function w(t,e){return t[0]-e[0]}function M(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}return function(i){if(a=n=-(e=r=1/0),c=[],t.geo.stream(i,d),u=c.length){c.sort(w);for(var o=1,s=[m=c[0]];o<u;++o)M((f=c[o])[0],m)||M(f[1],m)?(b(m[0],f[1])>b(m[0],m[1])&&(m[1]=f[1]),b(f[0],m[1])>b(m[0],m[1])&&(m[0]=f[0])):s.push(m=f);for(var l,u,f,p=-1/0,m=(o=0,s[u=s.length-1]);o<=u;m=f,++o)f=s[o],(l=b(m[1],f[0]))>p&&(p=l,e=f[0],n=m[1])}return c=h=null,e===1/0||r===1/0?[[NaN,NaN],[NaN,NaN]]:[[e,r],[n,a]]}}(),t.geo.centroid=function(e){pr=mr=gr=yr=vr=_r=xr=br=wr=Mr=kr=0,t.geo.stream(e,Rr);var r=wr,n=Mr,a=kr,i=r*r+n*n+a*a;return i<wt&&(r=_r,n=xr,a=br,mr<bt&&(r=gr,n=yr,a=vr),(i=r*r+n*n+a*a)<wt)?[NaN,NaN]:[Math.atan2(n,r)*St,Pt(a/Math.sqrt(i))*St]};var Rr={sphere:O,point:Fr,lineStart:Yr,lineEnd:jr,polygonStart:function(){Rr.lineStart=Br},polygonEnd:function(){Rr.lineStart=Yr}};function Fr(t,e){t*=At;var r=Math.cos(e*=At);Nr(r*Math.cos(t),r*Math.sin(t),Math.sin(e))}function Nr(t,e,r){gr+=(t-gr)/++pr,yr+=(e-yr)/pr,vr+=(r-vr)/pr}function Yr(){var t,e,r;function n(n,a){n*=At;var i=Math.cos(a*=At),o=i*Math.cos(n),s=i*Math.sin(n),l=Math.sin(a),u=Math.atan2(Math.sqrt((u=e*l-r*s)*u+(u=r*o-t*l)*u+(u=t*s-e*o)*u),t*o+e*s+r*l);mr+=u,_r+=u*(t+(t=o)),xr+=u*(e+(e=s)),br+=u*(r+(r=l)),Nr(t,e,r)}Rr.point=function(a,i){a*=At;var o=Math.cos(i*=At);t=o*Math.cos(a),e=o*Math.sin(a),r=Math.sin(i),Rr.point=n,Nr(t,e,r)}}function jr(){Rr.point=Fr}function Br(){var t,e,r,n,a;function i(t,e){t*=At;var i=Math.cos(e*=At),o=i*Math.cos(t),s=i*Math.sin(t),l=Math.sin(e),u=n*l-a*s,c=a*o-r*l,h=r*s-n*o,d=Math.sqrt(u*u+c*c+h*h),f=r*o+n*s+a*l,p=d&&-Dt(f)/d,m=Math.atan2(d,f);wr+=p*u,Mr+=p*c,kr+=p*h,mr+=m,_r+=m*(r+(r=o)),xr+=m*(n+(n=s)),br+=m*(a+(a=l)),Nr(r,n,a)}Rr.point=function(o,s){t=o,e=s,Rr.point=i,o*=At;var l=Math.cos(s*=At);r=l*Math.cos(o),n=l*Math.sin(o),a=Math.sin(s),Nr(r,n,a)},Rr.lineEnd=function(){i(t,e),Rr.lineEnd=jr,Rr.point=Fr}}function Hr(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 Ur(){return!0}function Vr(t,e,r,n,a){var i=[],o=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,r=t[0],n=t[e];if(Ir(r,n)){a.lineStart();for(var s=0;s<e;++s)a.point((r=t[s])[0],r[1]);a.lineEnd()}else{var l=new Gr(r,t,null,!0),u=new Gr(r,null,l,!1);l.o=u,i.push(l),o.push(u),l=new Gr(n,t,null,!1),u=new Gr(n,null,l,!0),l.o=u,i.push(l),o.push(u)}}})),o.sort(e),Wr(i),Wr(o),i.length){for(var s=0,l=r,u=o.length;s<u;++s)o[s].e=l=!l;for(var c,h,d=i[0];;){for(var f=d,p=!0;f.v;)if((f=f.n)===d)return;c=f.z,a.lineStart();do{if(f.v=f.o.v=!0,f.e){if(p)for(s=0,u=c.length;s<u;++s)a.point((h=c[s])[0],h[1]);else n(f.x,f.n.x,1,a);f=f.n}else{if(p)for(s=(c=f.p.z).length-1;s>=0;--s)a.point((h=c[s])[0],h[1]);else n(f.x,f.p.x,-1,a);f=f.p}c=(f=f.o).z,p=!p}while(!f.v);a.lineEnd()}}}function Wr(t){if(e=t.length){for(var e,r,n=0,a=t[0];++n<e;)a.n=r=t[n],r.p=a,a=r;a.n=r=t[0],r.p=a}}function Gr(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 qr(e,r,n,a){return function(i,o){var s,l=r(o),u=i.invert(a[0],a[1]),c={point:h,lineStart:f,lineEnd:p,polygonStart:function(){c.point=x,c.lineStart=b,c.lineEnd=w,s=[],m=[]},polygonEnd:function(){c.point=h,c.lineStart=f,c.lineEnd=p,s=t.merge(s);var e=function(t,e){var r=t[0],n=t[1],a=[Math.sin(r),-Math.cos(r),0],i=0,o=0;Tr.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],d=h[0],f=h[1]/2+Mt/4,p=Math.sin(f),m=Math.cos(f),g=1;;){g===c&&(g=0);var y=(t=u[g])[0],v=t[1]/2+Mt/4,_=Math.sin(v),x=Math.cos(v),b=y-d,w=b>=0?1:-1,M=w*b,k=M>Mt,T=p*_;if(Tr.add(Math.atan2(T*w*Math.sin(M),m*x+T*Math.cos(M))),i+=k?b+w*kt:b,k^d>=r^y>=r){var L=Cr(Sr(h),Sr(t));Or(L);var A=Cr(a,L);Or(A);var S=(k^b>=0?-1:1)*Pt(A[2]);(n>S||n===S&&(L[0]||L[1]))&&(o+=k^b>=0?1:-1)}if(!g++)break;d=y,p=_,m=x,h=t}}return(i<-bt||i<bt&&Tr<-bt)^1&o}(u,m);s.length?(_||(o.polygonStart(),_=!0),Vr(s,Jr,e,n,o)):e&&(_||(o.polygonStart(),_=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),_&&(o.polygonEnd(),_=!1),s=m=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function h(t,r){var n=i(t,r);e(t=n[0],r=n[1])&&o.point(t,r)}function d(t,e){var r=i(t,e);l.point(r[0],r[1])}function f(){c.point=d,l.lineStart()}function p(){c.point=h,l.lineEnd()}var m,g,y=Xr(),v=r(y),_=!1;function x(t,e){g.push([t,e]);var r=i(t,e);v.point(r[0],r[1])}function b(){v.lineStart(),g=[]}function w(){x(g[0][0],g[0][1]),v.lineEnd();var t,e=v.clean(),r=y.buffer(),n=r.length;if(g.pop(),m.push(g),g=null,n)if(1&e){var a,i=-1;if((n=(t=r[0]).length-1)>0){for(_||(o.polygonStart(),_=!0),o.lineStart();++i<n;)o.point((a=t[i])[0],a[1]);o.lineEnd()}}else n>1&&2&e&&r.push(r.pop().concat(r.shift())),s.push(r.filter(Zr))}return c}}function Zr(t){return t.length>1}function Xr(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:O,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function Jr(t,e){return((t=t.x)[0]<0?t[1]-Lt-bt:Lt-t[1])-((e=e.x)[0]<0?e[1]-Lt-bt:Lt-e[1])}var Kr=qr(Ur,(function(t){var e,r=NaN,n=NaN,a=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(i,o){var s=i>0?Mt:-Mt,l=v(i-r);v(l-Mt)<bt?(t.point(r,n=(n+o)/2>0?Lt:-Lt),t.point(a,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(i,n),e=0):a!==s&&l>=Mt&&(v(r-a)<bt&&(r-=a*bt),v(i-s)<bt&&(i-=s*bt),n=function(t,e,r,n){var a,i,o=Math.sin(t-r);return v(o)>bt?Math.atan((Math.sin(e)*(i=Math.cos(n))*Math.sin(r)-Math.sin(n)*(a=Math.cos(e))*Math.sin(t))/(a*i*o)):(e+n)/2}(r,n,i,o),t.point(a,n),t.lineEnd(),t.lineStart(),t.point(s,n),e=0),t.point(r=i,n=o),a=s},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}}),(function(t,e,r,n){var a;if(null==t)a=r*Lt,n.point(-Mt,a),n.point(0,a),n.point(Mt,a),n.point(Mt,0),n.point(Mt,-a),n.point(0,-a),n.point(-Mt,-a),n.point(-Mt,0),n.point(-Mt,a);else if(v(t[0]-e[0])>bt){var i=t[0]<e[0]?Mt:-Mt;a=r*i/2,n.point(-i,a),n.point(0,a),n.point(i,a)}else n.point(e[0],e[1])}),[-Mt,-Mt/2]);function $r(t,e,r,n){return function(a){var i,o=a.a,s=a.b,l=o.x,u=o.y,c=0,h=1,d=s.x-l,f=s.y-u;if(i=t-l,d||!(i>0)){if(i/=d,d<0){if(i<c)return;i<h&&(h=i)}else if(d>0){if(i>h)return;i>c&&(c=i)}if(i=r-l,d||!(i<0)){if(i/=d,d<0){if(i>h)return;i>c&&(c=i)}else if(d>0){if(i<c)return;i<h&&(h=i)}if(i=e-u,f||!(i>0)){if(i/=f,f<0){if(i<c)return;i<h&&(h=i)}else if(f>0){if(i>h)return;i>c&&(c=i)}if(i=n-u,f||!(i<0)){if(i/=f,f<0){if(i>h)return;i>c&&(c=i)}else if(f>0){if(i<c)return;i<h&&(h=i)}return c>0&&(a.a={x:l+c*d,y:u+c*f}),h<1&&(a.b={x:l+h*d,y:u+h*f}),a}}}}}}var Qr=1e9;function tn(e,r,n,a){return function(l){var u,c,h,d,f,p,m,g,y,v,_,x=l,b=Xr(),w=$r(e,r,n,a),M={point:L,lineStart:function(){M.point=A,c&&c.push(h=[]),v=!0,y=!1,m=g=NaN},lineEnd:function(){u&&(A(d,f),p&&y&&b.rejoin(),u.push(b.buffer())),M.point=L,y&&l.lineEnd()},polygonStart:function(){l=b,u=[],c=[],_=!0},polygonEnd:function(){l=x,u=t.merge(u);var r=function(t){for(var e=0,r=c.length,n=t[1],a=0;a<r;++a)for(var i,o=1,s=c[a],l=s.length,u=s[0];o<l;++o)i=s[o],u[1]<=n?i[1]>n&&Ct(u,i,t)>0&&++e:i[1]<=n&&Ct(u,i,t)<0&&--e,u=i;return 0!==e}([e,a]),n=_&&r,i=u.length;(n||i)&&(l.polygonStart(),n&&(l.lineStart(),k(null,null,1,l),l.lineEnd()),i&&Vr(u,o,r,k,l),l.polygonEnd()),u=c=h=null}};function k(t,o,l,u){var c=0,h=0;if(null==t||(c=i(t,l))!==(h=i(o,l))||s(t,o)<0^l>0)do{u.point(0===c||3===c?e:n,c>1?a:r)}while((c=(c+l+4)%4)!==h);else u.point(o[0],o[1])}function T(t,i){return e<=t&&t<=n&&r<=i&&i<=a}function L(t,e){T(t,e)&&l.point(t,e)}function A(t,e){var r=T(t=Math.max(-Qr,Math.min(Qr,t)),e=Math.max(-Qr,Math.min(Qr,e)));if(c&&h.push([t,e]),v)d=t,f=e,p=r,v=!1,r&&(l.lineStart(),l.point(t,e));else if(r&&y)l.point(t,e);else{var n={a:{x:m,y:g},b:{x:t,y:e}};w(n)?(y||(l.lineStart(),l.point(n.a.x,n.a.y)),l.point(n.b.x,n.b.y),r||l.lineEnd(),_=!1):r&&(l.lineStart(),l.point(t,e),_=!1)}m=t,g=e,y=r}return M};function i(t,a){return v(t[0]-e)<bt?a>0?0:3:v(t[0]-n)<bt?a>0?2:1:v(t[1]-r)<bt?a>0?1:0:a>0?3:2}function o(t,e){return s(t.x,e.x)}function s(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]}}function en(t){var e=0,r=Mt/3,n=Ln(t),a=n(e,r);return a.parallels=function(t){return arguments.length?n(e=t[0]*Mt/180,r=t[1]*Mt/180):[e/Mt*180,r/Mt*180]},a}function rn(t,e){var r=Math.sin(t),n=(r+Math.sin(e))/2,a=1+r*(2*n-r),i=Math.sqrt(a)/n;function o(t,e){var r=Math.sqrt(a-2*n*Math.sin(e))/n;return[r*Math.sin(t*=n),i-r*Math.cos(t)]}return o.invert=function(t,e){var r=i-e;return[Math.atan2(t,r)/n,Pt((a-(t*t+r*r)*n*n)/(2*n))]},o}t.geo.clipExtent=function(){var t,e,r,n,a,i,o={stream:function(t){return a&&(a.valid=!1),(a=i(t)).valid=!0,a},extent:function(s){return arguments.length?(i=tn(t=+s[0][0],e=+s[0][1],r=+s[1][0],n=+s[1][1]),a&&(a.valid=!1,a=null),o):[[t,e],[r,n]]}};return o.extent([[0,0],[960,500]])},(t.geo.conicEqualArea=function(){return en(rn)}).raw=rn,t.geo.albers=function(){return t.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},t.geo.albersUsa=function(){var e,r,n,a,i=t.geo.albers(),o=t.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=t.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,r){e=[t,r]}};function u(t){var i=t[0],o=t[1];return e=null,r(i,o),e||(n(i,o),e)||a(i,o),e}return u.invert=function(t){var e=i.scale(),r=i.translate(),n=(t[0]-r[0])/e,a=(t[1]-r[1])/e;return(a>=.12&&a<.234&&n>=-.425&&n<-.214?o:a>=.166&&a<.234&&n>=-.214&&n<-.115?s:i).invert(t)},u.stream=function(t){var e=i.stream(t),r=o.stream(t),n=s.stream(t);return{point:function(t,a){e.point(t,a),r.point(t,a),n.point(t,a)},sphere:function(){e.sphere(),r.sphere(),n.sphere()},lineStart:function(){e.lineStart(),r.lineStart(),n.lineStart()},lineEnd:function(){e.lineEnd(),r.lineEnd(),n.lineEnd()},polygonStart:function(){e.polygonStart(),r.polygonStart(),n.polygonStart()},polygonEnd:function(){e.polygonEnd(),r.polygonEnd(),n.polygonEnd()}}},u.precision=function(t){return arguments.length?(i.precision(t),o.precision(t),s.precision(t),u):i.precision()},u.scale=function(t){return arguments.length?(i.scale(t),o.scale(.35*t),s.scale(t),u.translate(i.translate())):i.scale()},u.translate=function(t){if(!arguments.length)return i.translate();var e=i.scale(),c=+t[0],h=+t[1];return r=i.translate(t).clipExtent([[c-.455*e,h-.238*e],[c+.455*e,h+.238*e]]).stream(l).point,n=o.translate([c-.307*e,h+.201*e]).clipExtent([[c-.425*e+bt,h+.12*e+bt],[c-.214*e-bt,h+.234*e-bt]]).stream(l).point,a=s.translate([c-.205*e,h+.212*e]).clipExtent([[c-.214*e+bt,h+.166*e+bt],[c-.115*e-bt,h+.234*e-bt]]).stream(l).point,u},u.scale(1070)};var nn,an,on,sn,ln,un,cn={point:O,lineStart:O,lineEnd:O,polygonStart:function(){an=0,cn.lineStart=hn},polygonEnd:function(){cn.lineStart=cn.lineEnd=cn.point=O,nn+=v(an/2)}};function hn(){var t,e,r,n;function a(t,e){an+=n*t-r*e,r=t,n=e}cn.point=function(i,o){cn.point=a,t=r=i,e=n=o},cn.lineEnd=function(){a(t,e)}}var dn={point:function(t,e){t<on&&(on=t),t>ln&&(ln=t),e<sn&&(sn=e),e>un&&(un=e)},lineStart:O,lineEnd:O,polygonStart:O,polygonEnd:O};function fn(){var t=pn(4.5),e=[],r={point:n,lineStart:function(){r.point=a},lineEnd:o,polygonStart:function(){r.lineEnd=s},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(e){return t=pn(e),r},result:function(){if(e.length){var t=e.join("");return e=[],t}}};function n(r,n){e.push("M",r,",",n,t)}function a(t,n){e.push("M",t,",",n),r.point=i}function i(t,r){e.push("L",t,",",r)}function o(){r.point=n}function s(){e.push("Z")}return r}function pn(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}var mn,gn={point:yn,lineStart:vn,lineEnd:_n,polygonStart:function(){gn.lineStart=xn},polygonEnd:function(){gn.point=yn,gn.lineStart=vn,gn.lineEnd=_n}};function yn(t,e){gr+=t,yr+=e,++vr}function vn(){var t,e;function r(r,n){var a=r-t,i=n-e,o=Math.sqrt(a*a+i*i);_r+=o*(t+r)/2,xr+=o*(e+n)/2,br+=o,yn(t=r,e=n)}gn.point=function(n,a){gn.point=r,yn(t=n,e=a)}}function _n(){gn.point=yn}function xn(){var t,e,r,n;function a(t,e){var a=t-r,i=e-n,o=Math.sqrt(a*a+i*i);_r+=o*(r+t)/2,xr+=o*(n+e)/2,br+=o,wr+=(o=n*t-r*e)*(r+t),Mr+=o*(n+e),kr+=3*o,yn(r=t,n=e)}gn.point=function(i,o){gn.point=a,yn(t=r=i,e=n=o)},gn.lineEnd=function(){a(t,e)}}function bn(t){var e=4.5,r={point:n,lineStart:function(){r.point=a},lineEnd:o,polygonStart:function(){r.lineEnd=s},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(t){return e=t,r},result:O};function n(r,n){t.moveTo(r+e,n),t.arc(r,n,e,0,kt)}function a(e,n){t.moveTo(e,n),r.point=i}function i(e,r){t.lineTo(e,r)}function o(){r.point=n}function s(){t.closePath()}return r}function wn(t){var e=.5,r=Math.cos(30*At),n=16;function a(e){return(n?function(e){var r,a,o,s,l,u,c,h,d,f,p,m,g={point:y,lineStart:v,lineEnd:x,polygonStart:function(){e.polygonStart(),g.lineStart=b},polygonEnd:function(){e.polygonEnd(),g.lineStart=v}};function y(r,n){r=t(r,n),e.point(r[0],r[1])}function v(){h=NaN,g.point=_,e.lineStart()}function _(r,a){var o=Sr([r,a]),s=t(r,a);i(h,d,c,f,p,m,h=s[0],d=s[1],c=r,f=o[0],p=o[1],m=o[2],n,e),e.point(h,d)}function x(){g.point=y,e.lineEnd()}function b(){v(),g.point=w,g.lineEnd=M}function w(t,e){_(r=t,e),a=h,o=d,s=f,l=p,u=m,g.point=_}function M(){i(h,d,c,f,p,m,a,o,r,s,l,u,n,e),g.lineEnd=x,x()}return g}:function(e){return kn(e,(function(r,n){r=t(r,n),e.point(r[0],r[1])}))})(e)}function i(n,a,o,s,l,u,c,h,d,f,p,m,g,y){var _=c-n,x=h-a,b=_*_+x*x;if(b>4*e&&g--){var w=s+f,M=l+p,k=u+m,T=Math.sqrt(w*w+M*M+k*k),L=Math.asin(k/=T),A=v(v(k)-1)<bt||v(o-d)<bt?(o+d)/2:Math.atan2(M,w),S=t(A,L),E=S[0],C=S[1],D=E-n,P=C-a,O=x*D-_*P;(O*O/b>e||v((_*D+x*P)/b-.5)>.3||s*f+l*p+u*m<r)&&(i(n,a,o,s,l,u,E,C,A,w/=T,M/=T,k,g,y),y.point(E,C),i(E,C,A,w,M,k,c,h,d,f,p,m,g,y))}}return a.precision=function(t){return arguments.length?(n=(e=t*t)>0&&16,a):Math.sqrt(e)},a}function Mn(t){this.stream=t}function kn(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 Tn(t){return Ln((function(){return t}))()}function Ln(e){var r,n,a,i,o,s,l=wn((function(t,e){return[(t=r(t,e))[0]*u+i,o-t[1]*u]})),u=150,c=480,h=250,d=0,f=0,p=0,m=0,g=0,y=Kr,_=E,x=null,b=null;function w(t){return[(t=a(t[0]*At,t[1]*At))[0]*u+i,o-t[1]*u]}function M(t){return(t=a.invert((t[0]-i)/u,(o-t[1])/u))&&[t[0]*St,t[1]*St]}function k(){a=Hr(n=Cn(p,m,g),r);var t=r(d,f);return i=c-t[0]*u,o=h+t[1]*u,T()}function T(){return s&&(s.valid=!1,s=null),w}return w.stream=function(t){return s&&(s.valid=!1),(s=An(y(n,l(_(t))))).valid=!0,s},w.clipAngle=function(t){return arguments.length?(y=null==t?(x=t,Kr):function(t){var e=Math.cos(t),r=e>0,n=v(e)>bt;return qr(a,(function(t){var e,s,l,u,c;return{lineStart:function(){u=l=!1,c=1},point:function(h,d){var f,p=[h,d],m=a(h,d),g=r?m?0:o(h,d):m?o(h+(h<0?Mt:-Mt),d):0;if(!e&&(u=l=m)&&t.lineStart(),m!==l&&(f=i(e,p),(Ir(e,f)||Ir(p,f))&&(p[0]+=bt,p[1]+=bt,m=a(p[0],p[1]))),m!==l)c=0,m?(t.lineStart(),f=i(p,e),t.point(f[0],f[1])):(f=i(e,p),t.point(f[0],f[1]),t.lineEnd()),e=f;else if(n&&e&&r^m){var y;g&s||!(y=i(p,e,!0))||(c=0,r?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1])))}!m||e&&Ir(e,p)||t.point(p[0],p[1]),e=p,l=m,s=g},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return c|(u&&l)<<1}}}),zn(t,6*At),r?[0,-t]:[-Mt,t-Mt]);function a(t,r){return Math.cos(t)*Math.cos(r)>e}function i(t,r,n){var a=[1,0,0],i=Cr(Sr(t),Sr(r)),o=Er(i,i),s=i[0],l=o-s*s;if(!l)return!n&&t;var u=e*o/l,c=-e*s/l,h=Cr(a,i),d=Pr(a,u);Dr(d,Pr(i,c));var f=h,p=Er(d,f),m=Er(f,f),g=p*p-m*(Er(d,d)-1);if(!(g<0)){var y=Math.sqrt(g),_=Pr(f,(-p-y)/m);if(Dr(_,d),_=zr(_),!n)return _;var x,b=t[0],w=r[0],M=t[1],k=r[1];w<b&&(x=b,b=w,w=x);var T=w-b,L=v(T-Mt)<bt;if(!L&&k<M&&(x=M,M=k,k=x),L||T<bt?L?M+k>0^_[1]<(v(_[0]-b)<bt?M:k):M<=_[1]&&_[1]<=k:T>Mt^(b<=_[0]&&_[0]<=w)){var A=Pr(f,(-p+y)/m);return Dr(A,d),[_,zr(A)]}}}function o(e,n){var a=r?t:Mt-t,i=0;return e<-a?i|=1:e>a&&(i|=2),n<-a?i|=4:n>a&&(i|=8),i}}((x=+t)*At),T()):x},w.clipExtent=function(t){return arguments.length?(b=t,_=t?tn(t[0][0],t[0][1],t[1][0],t[1][1]):E,T()):b},w.scale=function(t){return arguments.length?(u=+t,k()):u},w.translate=function(t){return arguments.length?(c=+t[0],h=+t[1],k()):[c,h]},w.center=function(t){return arguments.length?(d=t[0]%360*At,f=t[1]%360*At,k()):[d*St,f*St]},w.rotate=function(t){return arguments.length?(p=t[0]%360*At,m=t[1]%360*At,g=t.length>2?t[2]%360*At:0,k()):[p*St,m*St,g*St]},t.rebind(w,l,"precision"),function(){return r=e.apply(this,arguments),w.invert=r.invert&&M,k()}}function An(t){return kn(t,(function(e,r){t.point(e*At,r*At)}))}function Sn(t,e){return[t,e]}function En(t,e){return[t>Mt?t-kt:t<-Mt?t+kt:t,e]}function Cn(t,e,r){return t?e||r?Hr(Pn(t),On(e,r)):Pn(t):e||r?On(e,r):En}function Dn(t){return function(e,r){return[(e+=t)>Mt?e-kt:e<-Mt?e+kt:e,r]}}function Pn(t){var e=Dn(t);return e.invert=Dn(-t),e}function On(t,e){var r=Math.cos(t),n=Math.sin(t),a=Math.cos(e),i=Math.sin(e);function o(t,e){var o=Math.cos(e),s=Math.cos(t)*o,l=Math.sin(t)*o,u=Math.sin(e),c=u*r+s*n;return[Math.atan2(l*a-c*i,s*r-u*n),Pt(c*a+l*i)]}return o.invert=function(t,e){var o=Math.cos(e),s=Math.cos(t)*o,l=Math.sin(t)*o,u=Math.sin(e),c=u*a-l*i;return[Math.atan2(l*a+u*i,s*r+c*n),Pt(c*r-s*n)]},o}function zn(t,e){var r=Math.cos(t),n=Math.sin(t);return function(a,i,o,s){var l=o*e;null!=a?(a=In(r,a),i=In(r,i),(o>0?a<i:a>i)&&(a+=o*kt)):(a=t+o*kt,i=t-.5*l);for(var u,c=a;o>0?c>i:c<i;c-=l)s.point((u=zr([r,-n*Math.cos(c),-n*Math.sin(c)]))[0],u[1])}}function In(t,e){var r=Sr(e);r[0]-=t,Or(r);var n=Dt(-r[1]);return((-r[2]<0?-n:n)+2*Math.PI-bt)%(2*Math.PI)}function Rn(e,r,n){var a=t.range(e,r-bt,n).concat(r);return function(t){return a.map((function(e){return[t,e]}))}}function Fn(e,r,n){var a=t.range(e,r-bt,n).concat(r);return function(t){return a.map((function(e){return[e,t]}))}}function Nn(t){return t.source}function Yn(t){return t.target}t.geo.path=function(){var e,r,n,a,i,o=4.5;function s(e){return e&&("function"==typeof o&&a.pointRadius(+o.apply(this,arguments)),i&&i.valid||(i=n(a)),t.geo.stream(e,i)),a.result()}function l(){return i=null,s}return s.area=function(e){return nn=0,t.geo.stream(e,n(cn)),nn},s.centroid=function(e){return gr=yr=vr=_r=xr=br=wr=Mr=kr=0,t.geo.stream(e,n(gn)),kr?[wr/kr,Mr/kr]:br?[_r/br,xr/br]:vr?[gr/vr,yr/vr]:[NaN,NaN]},s.bounds=function(e){return ln=un=-(on=sn=1/0),t.geo.stream(e,n(dn)),[[on,sn],[ln,un]]},s.projection=function(t){return arguments.length?(n=(e=t)?t.stream||(r=t,a=wn((function(t,e){return r([t*St,e*St])})),function(t){return An(a(t))}):E,l()):e;var r,a},s.context=function(t){return arguments.length?(a=null==(r=t)?new fn:new bn(t),"function"!=typeof o&&a.pointRadius(o),l()):r},s.pointRadius=function(t){return arguments.length?(o="function"==typeof t?t:(a.pointRadius(+t),+t),s):o},s.projection(t.geo.albersUsa()).context(null)},t.geo.transform=function(t){return{stream:function(e){var r=new Mn(e);for(var n in t)r[n]=t[n];return r}}},Mn.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},t.geo.projection=Tn,t.geo.projectionMutator=Ln,(t.geo.equirectangular=function(){return Tn(Sn)}).raw=Sn.invert=Sn,t.geo.rotation=function(t){function e(e){return(e=t(e[0]*At,e[1]*At))[0]*=St,e[1]*=St,e}return t=Cn(t[0]%360*At,t[1]*At,t.length>2?t[2]*At:0),e.invert=function(e){return(e=t.invert(e[0]*At,e[1]*At))[0]*=St,e[1]*=St,e},e},En.invert=Sn,t.geo.circle=function(){var t,e,r=[0,0],n=6;function a(){var t="function"==typeof r?r.apply(this,arguments):r,n=Cn(-t[0]*At,-t[1]*At,0).invert,a=[];return e(null,null,1,{point:function(t,e){a.push(t=n(t,e)),t[0]*=St,t[1]*=St}}),{type:"Polygon",coordinates:[a]}}return a.origin=function(t){return arguments.length?(r=t,a):r},a.angle=function(r){return arguments.length?(e=zn((t=+r)*At,n*At),a):t},a.precision=function(r){return arguments.length?(e=zn(t*At,(n=+r)*At),a):n},a.angle(90)},t.geo.distance=function(t,e){var r,n=(e[0]-t[0])*At,a=t[1]*At,i=e[1]*At,o=Math.sin(n),s=Math.cos(n),l=Math.sin(a),u=Math.cos(a),c=Math.sin(i),h=Math.cos(i);return Math.atan2(Math.sqrt((r=h*o)*r+(r=u*c-l*h*s)*r),l*c+u*h*s)},t.geo.graticule=function(){var e,r,n,a,i,o,s,l,u,c,h,d,f=10,p=f,m=90,g=360,y=2.5;function _(){return{type:"MultiLineString",coordinates:x()}}function x(){return t.range(Math.ceil(a/m)*m,n,m).map(h).concat(t.range(Math.ceil(l/g)*g,s,g).map(d)).concat(t.range(Math.ceil(r/f)*f,e,f).filter((function(t){return v(t%m)>bt})).map(u)).concat(t.range(Math.ceil(o/p)*p,i,p).filter((function(t){return v(t%g)>bt})).map(c))}return _.lines=function(){return x().map((function(t){return{type:"LineString",coordinates:t}}))},_.outline=function(){return{type:"Polygon",coordinates:[h(a).concat(d(s).slice(1),h(n).reverse().slice(1),d(l).reverse().slice(1))]}},_.extent=function(t){return arguments.length?_.majorExtent(t).minorExtent(t):_.minorExtent()},_.majorExtent=function(t){return arguments.length?(a=+t[0][0],n=+t[1][0],l=+t[0][1],s=+t[1][1],a>n&&(t=a,a=n,n=t),l>s&&(t=l,l=s,s=t),_.precision(y)):[[a,l],[n,s]]},_.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],o=+t[0][1],i=+t[1][1],r>e&&(t=r,r=e,e=t),o>i&&(t=o,o=i,i=t),_.precision(y)):[[r,o],[e,i]]},_.step=function(t){return arguments.length?_.majorStep(t).minorStep(t):_.minorStep()},_.majorStep=function(t){return arguments.length?(m=+t[0],g=+t[1],_):[m,g]},_.minorStep=function(t){return arguments.length?(f=+t[0],p=+t[1],_):[f,p]},_.precision=function(t){return arguments.length?(y=+t,u=Rn(o,i,90),c=Fn(r,e,y),h=Rn(l,s,90),d=Fn(a,n,y),_):y},_.majorExtent([[-180,-90+bt],[180,90-bt]]).minorExtent([[-180,-80-bt],[180,80+bt]])},t.geo.greatArc=function(){var e,r,n=Nn,a=Yn;function i(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),r||a.apply(this,arguments)]}}return i.distance=function(){return t.geo.distance(e||n.apply(this,arguments),r||a.apply(this,arguments))},i.source=function(t){return arguments.length?(n=t,e="function"==typeof t?null:t,i):n},i.target=function(t){return arguments.length?(a=t,r="function"==typeof t?null:t,i):a},i.precision=function(){return arguments.length?i:0},i},t.geo.interpolate=function(t,e){return r=t[0]*At,n=t[1]*At,a=e[0]*At,i=e[1]*At,o=Math.cos(n),s=Math.sin(n),l=Math.cos(i),u=Math.sin(i),c=o*Math.cos(r),h=o*Math.sin(r),d=l*Math.cos(a),f=l*Math.sin(a),p=2*Math.asin(Math.sqrt(zt(i-n)+o*l*zt(a-r))),m=1/Math.sin(p),(g=p?function(t){var e=Math.sin(t*=p)*m,r=Math.sin(p-t)*m,n=r*c+e*d,a=r*h+e*f,i=r*s+e*u;return[Math.atan2(a,n)*St,Math.atan2(i,Math.sqrt(n*n+a*a))*St]}:function(){return[r*St,n*St]}).distance=p,g;var r,n,a,i,o,s,l,u,c,h,d,f,p,m,g},t.geo.length=function(e){return mn=0,t.geo.stream(e,jn),mn};var jn={sphere:O,point:O,lineStart:function(){var t,e,r;function n(n,a){var i=Math.sin(a*=At),o=Math.cos(a),s=v((n*=At)-t),l=Math.cos(s);mn+=Math.atan2(Math.sqrt((s=o*Math.sin(s))*s+(s=r*i-e*o*l)*s),e*i+r*o*l),t=n,e=i,r=o}jn.point=function(a,i){t=a*At,e=Math.sin(i*=At),r=Math.cos(i),jn.point=n},jn.lineEnd=function(){jn.point=jn.lineEnd=O}},lineEnd:O,polygonStart:O,polygonEnd:O};function Bn(t,e){function r(e,r){var n=Math.cos(e),a=Math.cos(r),i=t(n*a);return[i*a*Math.sin(e),i*Math.sin(r)]}return r.invert=function(t,r){var n=Math.sqrt(t*t+r*r),a=e(n),i=Math.sin(a),o=Math.cos(a);return[Math.atan2(t*i,n*o),Math.asin(n&&r*i/n)]},r}var Hn=Bn((function(t){return Math.sqrt(2/(1+t))}),(function(t){return 2*Math.asin(t/2)}));(t.geo.azimuthalEqualArea=function(){return Tn(Hn)}).raw=Hn;var Un=Bn((function(t){var e=Math.acos(t);return e&&e/Math.sin(e)}),E);function Vn(t,e){var r=Math.cos(t),n=function(t){return Math.tan(Mt/4+t/2)},a=t===e?Math.sin(t):Math.log(r/Math.cos(e))/Math.log(n(e)/n(t)),i=r*Math.pow(n(t),a)/a;if(!a)return qn;function o(t,e){i>0?e<-Lt+bt&&(e=-Lt+bt):e>Lt-bt&&(e=Lt-bt);var r=i/Math.pow(n(e),a);return[r*Math.sin(a*t),i-r*Math.cos(a*t)]}return o.invert=function(t,e){var r=i-e,n=Et(a)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/a,2*Math.atan(Math.pow(i/n,1/a))-Lt]},o}function Wn(t,e){var r=Math.cos(t),n=t===e?Math.sin(t):(r-Math.cos(e))/(e-t),a=r/n+t;if(v(n)<bt)return Sn;function i(t,e){var r=a-e;return[r*Math.sin(n*t),a-r*Math.cos(n*t)]}return i.invert=function(t,e){var r=a-e;return[Math.atan2(t,r)/n,a-Et(n)*Math.sqrt(t*t+r*r)]},i}(t.geo.azimuthalEquidistant=function(){return Tn(Un)}).raw=Un,(t.geo.conicConformal=function(){return en(Vn)}).raw=Vn,(t.geo.conicEquidistant=function(){return en(Wn)}).raw=Wn;var Gn=Bn((function(t){return 1/t}),Math.atan);function qn(t,e){return[t,Math.log(Math.tan(Mt/4+e/2))]}function Zn(t){var e,r=Tn(t),n=r.scale,a=r.translate,i=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=a.apply(r,arguments);return t===r?e?r.clipExtent(null):r:t},r.clipExtent=function(t){var o=i.apply(r,arguments);if(o===r){if(e=null==t){var s=Mt*n(),l=a();i([[l[0]-s,l[1]-s],[l[0]+s,l[1]+s]])}}else e&&(o=null);return o},r.clipExtent(null)}(t.geo.gnomonic=function(){return Tn(Gn)}).raw=Gn,qn.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Lt]},(t.geo.mercator=function(){return Zn(qn)}).raw=qn;var Xn=Bn((function(){return 1}),Math.asin);(t.geo.orthographic=function(){return Tn(Xn)}).raw=Xn;var Jn=Bn((function(t){return 1/(1+t)}),(function(t){return 2*Math.atan(t)}));function Kn(t,e){return[Math.log(Math.tan(Mt/4+e/2)),-t]}function $n(t){return t[0]}function Qn(t){return t[1]}function ta(t){for(var e=t.length,r=[0,1],n=2,a=2;a<e;a++){for(;n>1&&Ct(t[r[n-2]],t[r[n-1]],t[a])<=0;)--n;r[n++]=a}return r.slice(0,n)}function ea(t,e){return t[0]-e[0]||t[1]-e[1]}(t.geo.stereographic=function(){return Tn(Jn)}).raw=Jn,Kn.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Lt]},(t.geo.transverseMercator=function(){var t=Zn(Kn),e=t.center,r=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return t?r([t[0],t[1],t.length>2?t[2]+90:90]):[(t=r())[0],t[1],t[2]-90]},r([0,0,90])}).raw=Kn,t.geom={},t.geom.hull=function(t){var e=$n,r=Qn;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,a=fe(e),i=fe(r),o=t.length,s=[],l=[];for(n=0;n<o;n++)s.push([+a.call(this,t[n],n),+i.call(this,t[n],n),n]);for(s.sort(ea),n=0;n<o;n++)l.push([s[n][0],-s[n][1]]);var u=ta(s),c=ta(l),h=c[0]===u[0],d=c[c.length-1]===u[u.length-1],f=[];for(n=u.length-1;n>=0;--n)f.push(t[s[u[n]][2]]);for(n=+h;n<c.length-d;++n)f.push(t[s[c[n]][2]]);return f}return n.x=function(t){return arguments.length?(e=t,n):e},n.y=function(t){return arguments.length?(r=t,n):r},n},t.geom.polygon=function(t){return j(t,ra),t};var ra=t.geom.polygon.prototype=[];function na(t,e,r){return(r[0]-e[0])*(t[1]-e[1])<(r[1]-e[1])*(t[0]-e[0])}function aa(t,e,r,n){var a=t[0],i=r[0],o=e[0]-a,s=n[0]-i,l=t[1],u=r[1],c=e[1]-l,h=n[1]-u,d=(s*(l-u)-h*(a-i))/(h*o-s*c);return[a+d*o,l+d*c]}function ia(t){var e=t[0],r=t[t.length-1];return!(e[0]-r[0]||e[1]-r[1])}ra.area=function(){for(var t,e=-1,r=this.length,n=this[r-1],a=0;++e<r;)t=n,n=this[e],a+=t[1]*n[0]-t[0]*n[1];return.5*a},ra.centroid=function(t){var e,r,n=-1,a=this.length,i=0,o=0,s=this[a-1];for(arguments.length||(t=-1/(6*this.area()));++n<a;)e=s,s=this[n],r=e[0]*s[1]-s[0]*e[1],i+=(e[0]+s[0])*r,o+=(e[1]+s[1])*r;return[i*t,o*t]},ra.clip=function(t){for(var e,r,n,a,i,o,s=ia(t),l=-1,u=this.length-ia(this),c=this[u-1];++l<u;){for(e=t.slice(),t.length=0,a=this[l],i=e[(n=e.length-s)-1],r=-1;++r<n;)na(o=e[r],c,a)?(na(i,c,a)||t.push(aa(i,o,c,a)),t.push(o)):na(i,c,a)&&t.push(aa(i,o,c,a)),i=o;s&&t.push(t[0]),c=a}return t};var oa,sa,la,ua,ca,ha=[],da=[];function fa(){Da(this),this.edge=this.site=this.circle=null}function pa(t){var e=ha.pop()||new fa;return e.site=t,e}function ma(t){ka(t),la.remove(t),ha.push(t),Da(t)}function ga(t){var e=t.circle,r=e.x,n=e.cy,a={x:r,y:n},i=t.P,o=t.N,s=[t];ma(t);for(var l=i;l.circle&&v(r-l.circle.x)<bt&&v(n-l.circle.cy)<bt;)i=l.P,s.unshift(l),ma(l),l=i;s.unshift(l),ka(l);for(var u=o;u.circle&&v(r-u.circle.x)<bt&&v(n-u.circle.cy)<bt;)o=u.N,s.push(u),ma(u),u=o;s.push(u),ka(u);var c,h=s.length;for(c=1;c<h;++c)u=s[c],l=s[c-1],Sa(u.edge,l.site,u.site,a);l=s[0],(u=s[h-1]).edge=Aa(l.site,u.site,null,a),Ma(l),Ma(u)}function ya(t){for(var e,r,n,a,i=t.x,o=t.y,s=la._;s;)if((n=va(s,o)-i)>bt)s=s.L;else{if(!((a=i-_a(s,o))>bt)){n>-bt?(e=s.P,r=s):a>-bt?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=pa(t);if(la.insert(e,l),e||r){if(e===r)return ka(e),r=pa(e.site),la.insert(l,r),l.edge=r.edge=Aa(e.site,l.site),Ma(e),void Ma(r);if(r){ka(e),ka(r);var u=e.site,c=u.x,h=u.y,d=t.x-c,f=t.y-h,p=r.site,m=p.x-c,g=p.y-h,y=2*(d*g-f*m),v=d*d+f*f,_=m*m+g*g,x={x:(g*v-f*_)/y+c,y:(d*_-m*v)/y+h};Sa(r.edge,u,p,x),l.edge=Aa(u,t,null,x),r.edge=Aa(t,p,null,x),Ma(e),Ma(r)}else l.edge=Aa(e.site,l.site)}}function va(t,e){var r=t.site,n=r.x,a=r.y,i=a-e;if(!i)return n;var o=t.P;if(!o)return-1/0;var s=(r=o.site).x,l=r.y,u=l-e;if(!u)return s;var c=s-n,h=1/i-1/u,d=c/u;return h?(-d+Math.sqrt(d*d-2*h*(c*c/(-2*u)-l+u/2+a-i/2)))/h+n:(n+s)/2}function _a(t,e){var r=t.N;if(r)return va(r,e);var n=t.site;return n.y===e?n.x:1/0}function xa(t){this.site=t,this.edges=[]}function ba(t,e){return e.angle-t.angle}function wa(){Da(this),this.x=this.y=this.arc=this.site=this.cy=null}function Ma(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,a=t.site,i=r.site;if(n!==i){var o=a.x,s=a.y,l=n.x-o,u=n.y-s,c=i.x-o,h=2*(l*(g=i.y-s)-u*c);if(!(h>=-wt)){var d=l*l+u*u,f=c*c+g*g,p=(g*d-u*f)/h,m=(l*f-c*d)/h,g=m+s,y=da.pop()||new wa;y.arc=t,y.site=a,y.x=p+o,y.y=g+Math.sqrt(p*p+m*m),y.cy=g,t.circle=y;for(var v=null,_=ca._;_;)if(y.y<_.y||y.y===_.y&&y.x<=_.x){if(!_.L){v=_.P;break}_=_.L}else{if(!_.R){v=_;break}_=_.R}ca.insert(v,y),v||(ua=y)}}}}function ka(t){var e=t.circle;e&&(e.P||(ua=e.N),ca.remove(e),da.push(e),Da(e),t.circle=null)}function Ta(t,e){var r=t.b;if(r)return!0;var n,a,i=t.a,o=e[0][0],s=e[1][0],l=e[0][1],u=e[1][1],c=t.l,h=t.r,d=c.x,f=c.y,p=h.x,m=h.y,g=(d+p)/2,y=(f+m)/2;if(m===f){if(g<o||g>=s)return;if(d>p){if(i){if(i.y>=u)return}else i={x:g,y:l};r={x:g,y:u}}else{if(i){if(i.y<l)return}else i={x:g,y:u};r={x:g,y:l}}}else if(a=y-(n=(d-p)/(m-f))*g,n<-1||n>1)if(d>p){if(i){if(i.y>=u)return}else i={x:(l-a)/n,y:l};r={x:(u-a)/n,y:u}}else{if(i){if(i.y<l)return}else i={x:(u-a)/n,y:u};r={x:(l-a)/n,y:l}}else if(f<m){if(i){if(i.x>=s)return}else i={x:o,y:n*o+a};r={x:s,y:n*s+a}}else{if(i){if(i.x<o)return}else i={x:s,y:n*s+a};r={x:o,y:n*o+a}}return t.a=i,t.b=r,!0}function La(t,e){this.l=t,this.r=e,this.a=this.b=null}function Aa(t,e,r,n){var a=new La(t,e);return oa.push(a),r&&Sa(a,t,e,r),n&&Sa(a,e,t,n),sa[t.i].edges.push(new Ea(a,t,e)),sa[e.i].edges.push(new Ea(a,e,t)),a}function Sa(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 Ea(t,e,r){var n=t.a,a=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(a.x-n.x,n.y-a.y):Math.atan2(n.x-a.x,a.y-n.y)}function Ca(){this._=null}function Da(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function Pa(t,e){var r=e,n=e.R,a=r.U;a?a.L===r?a.L=n:a.R=n:t._=n,n.U=a,r.U=n,r.R=n.L,r.R&&(r.R.U=r),n.L=r}function Oa(t,e){var r=e,n=e.L,a=r.U;a?a.L===r?a.L=n:a.R=n:t._=n,n.U=a,r.U=n,r.L=n.R,r.L&&(r.L.U=r),n.R=r}function za(t){for(;t.L;)t=t.L;return t}function Ia(t,e){var r,n,a,i=t.sort(Ra).pop();for(oa=[],sa=new Array(t.length),la=new Ca,ca=new Ca;;)if(a=ua,i&&(!a||i.y<a.y||i.y===a.y&&i.x<a.x))i.x===r&&i.y===n||(sa[i.i]=new xa(i),ya(i),r=i.x,n=i.y),i=t.pop();else{if(!a)break;ga(a.arc)}e&&(function(t){for(var e,r=oa,n=$r(t[0][0],t[0][1],t[1][0],t[1][1]),a=r.length;a--;)(!Ta(e=r[a],t)||!n(e)||v(e.a.x-e.b.x)<bt&&v(e.a.y-e.b.y)<bt)&&(e.a=e.b=null,r.splice(a,1))}(e),function(t){for(var e,r,n,a,i,o,s,l,u,c,h=t[0][0],d=t[1][0],f=t[0][1],p=t[1][1],m=sa,g=m.length;g--;)if((i=m[g])&&i.prepare())for(l=(s=i.edges).length,o=0;o<l;)n=(c=s[o].end()).x,a=c.y,e=(u=s[++o%l].start()).x,r=u.y,(v(n-e)>bt||v(a-r)>bt)&&(s.splice(o,0,new Ea((y=i.site,_=c,x=v(n-h)<bt&&p-a>bt?{x:h,y:v(e-h)<bt?r:p}:v(a-p)<bt&&d-n>bt?{x:v(r-p)<bt?e:d,y:p}:v(n-d)<bt&&a-f>bt?{x:d,y:v(e-d)<bt?r:f}:v(a-f)<bt&&n-h>bt?{x:v(r-f)<bt?e:h,y:f}:null,b=void 0,(b=new La(y,null)).a=_,b.b=x,oa.push(b),b),i.site,null)),++l);var y,_,x,b}(e));var o={cells:sa,edges:oa};return la=ca=oa=sa=null,o}function Ra(t,e){return e.y-t.y||e.x-t.x}xa.prototype.prepare=function(){for(var t,e=this.edges,r=e.length;r--;)(t=e[r].edge).b&&t.a||e.splice(r,1);return e.sort(ba),e.length},Ea.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}},Ca.prototype={insert:function(t,e){var r,n,a;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=za(this._),e.P=null,e.N=t,t.P=t.L=e,r=t):(e.P=e.N=null,this._=e,r=null);for(e.L=e.R=null,e.U=r,e.C=!0,t=e;r&&r.C;)r===(n=r.U).L?(a=n.R)&&a.C?(r.C=a.C=!1,n.C=!0,t=n):(t===r.R&&(Pa(this,r),r=(t=r).U),r.C=!1,n.C=!0,Oa(this,n)):(a=n.L)&&a.C?(r.C=a.C=!1,n.C=!0,t=n):(t===r.L&&(Oa(this,r),r=(t=r).U),r.C=!1,n.C=!0,Pa(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,a=t.U,i=t.L,o=t.R;if(r=i?o?za(o):i:o,a?a.L===t?a.L=r:a.R=r:this._=r,i&&o?(n=r.C,r.C=t.C,r.L=i,i.U=r,r!==o?(a=r.U,r.U=t.U,t=r.R,a.L=t,r.R=o,o.U=r):(r.U=a,a=r,t=r.R)):(n=t.C,t=r),t&&(t.U=a),!n)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===a.L){if((e=a.R).C&&(e.C=!1,a.C=!0,Pa(this,a),e=a.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,Oa(this,e),e=a.R),e.C=a.C,a.C=e.R.C=!1,Pa(this,a),t=this._;break}}else if((e=a.L).C&&(e.C=!1,a.C=!0,Oa(this,a),e=a.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,Pa(this,e),e=a.L),e.C=a.C,a.C=e.L.C=!1,Oa(this,a),t=this._;break}e.C=!0,t=a,a=a.U}while(!t.C);t&&(t.C=!1)}}},t.geom.voronoi=function(t){var e=$n,r=Qn,n=e,a=r,i=Fa;if(t)return o(t);function o(t){var e=new Array(t.length),r=i[0][0],n=i[0][1],a=i[1][0],o=i[1][1];return Ia(s(t),i).cells.forEach((function(i,s){var l=i.edges,u=i.site;(e[s]=l.length?l.map((function(t){var e=t.start();return[e.x,e.y]})):u.x>=r&&u.x<=a&&u.y>=n&&u.y<=o?[[r,o],[a,o],[a,n],[r,n]]:[]).point=t[s]})),e}function s(t){return t.map((function(t,e){return{x:Math.round(n(t,e)/bt)*bt,y:Math.round(a(t,e)/bt)*bt,i:e}}))}return o.links=function(t){return Ia(s(t)).edges.filter((function(t){return t.l&&t.r})).map((function(e){return{source:t[e.l.i],target:t[e.r.i]}}))},o.triangles=function(t){var e=[];return Ia(s(t)).cells.forEach((function(r,n){for(var a,i,o,s,l=r.site,u=r.edges.sort(ba),c=-1,h=u.length,d=u[h-1].edge,f=d.l===l?d.r:d.l;++c<h;)a=f,f=(d=u[c].edge).l===l?d.r:d.l,n<a.i&&n<f.i&&(o=a,s=f,((i=l).x-s.x)*(o.y-i.y)-(i.x-o.x)*(s.y-i.y)<0)&&e.push([t[n],t[a.i],t[f.i]])})),e},o.x=function(t){return arguments.length?(n=fe(e=t),o):e},o.y=function(t){return arguments.length?(a=fe(r=t),o):r},o.clipExtent=function(t){return arguments.length?(i=null==t?Fa:t,o):i===Fa?null:i},o.size=function(t){return arguments.length?o.clipExtent(t&&[[0,0],t]):i===Fa?null:i&&i[1]},o};var Fa=[[-1e6,-1e6],[1e6,1e6]];function Na(t){return t.x}function Ya(t){return t.y}function ja(e,r){e=t.rgb(e),r=t.rgb(r);var n=e.r,a=e.g,i=e.b,o=r.r-n,s=r.g-a,l=r.b-i;return function(t){return"#"+oe(Math.round(n+o*t))+oe(Math.round(a+s*t))+oe(Math.round(i+l*t))}}function Ba(t,e){var r,n={},a={};for(r in t)r in e?n[r]=Ga(t[r],e[r]):a[r]=t[r];for(r in e)r in t||(a[r]=e[r]);return function(t){for(r in n)a[r]=n[r](t);return a}}function Ha(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function Ua(t,e){var r,n,a,i=Va.lastIndex=Wa.lastIndex=0,o=-1,s=[],l=[];for(t+="",e+="";(r=Va.exec(t))&&(n=Wa.exec(e));)(a=n.index)>i&&(a=e.slice(i,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:Ha(r,n)})),i=Wa.lastIndex;return i<e.length&&(a=e.slice(i),s[o]?s[o]+=a:s[++o]=a),s.length<2?l[0]?(e=l[0].x,function(t){return e(t)+""}):function(){return e}:(e=l.length,function(t){for(var r,n=0;n<e;++n)s[(r=l[n]).i]=r.x(t);return s.join("")})}t.geom.delaunay=function(e){return t.geom.voronoi().triangles(e)},t.geom.quadtree=function(t,e,r,n,a){var i,o=$n,s=Qn;if(i=arguments.length)return o=Na,s=Ya,3===i&&(a=r,n=e,r=e=0),l(t);function l(t){var l,u,c,h,d,f,p,m,g,y=fe(o),_=fe(s);if(null!=e)f=e,p=r,m=n,g=a;else if(m=g=-(f=p=1/0),u=[],c=[],d=t.length,i)for(h=0;h<d;++h)(l=t[h]).x<f&&(f=l.x),l.y<p&&(p=l.y),l.x>m&&(m=l.x),l.y>g&&(g=l.y),u.push(l.x),c.push(l.y);else for(h=0;h<d;++h){var x=+y(l=t[h],h),b=+_(l,h);x<f&&(f=x),b<p&&(p=b),x>m&&(m=x),b>g&&(g=b),u.push(x),c.push(b)}var w=m-f,M=g-p;function k(t,e,r,n,a,i,o,s){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var l=t.x,u=t.y;if(null!=l)if(v(l-r)+v(u-n)<.01)T(t,e,r,n,a,i,o,s);else{var c=t.point;t.x=t.y=t.point=null,T(t,c,l,u,a,i,o,s),T(t,e,r,n,a,i,o,s)}else t.x=r,t.y=n,t.point=e}else T(t,e,r,n,a,i,o,s)}function T(t,e,r,n,a,i,o,s){var l=.5*(a+o),u=.5*(i+s),c=r>=l,h=n>=u,d=h<<1|c;t.leaf=!1,c?a=l:o=l,h?i=u:s=u,k(t=t.nodes[d]||(t.nodes[d]={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){k(L,t,+y(t,++h),+_(t,h),f,p,m,g)}}),e,r,n,a,i,o,s)}w>M?g=p+w:m=f+M;var L={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){k(L,t,+y(t,++h),+_(t,h),f,p,m,g)},visit:function(t){!function t(e,r,n,a,i,o){if(!e(r,n,a,i,o)){var s=.5*(n+i),l=.5*(a+o),u=r.nodes;u[0]&&t(e,u[0],n,a,s,l),u[1]&&t(e,u[1],s,a,i,l),u[2]&&t(e,u[2],n,l,s,o),u[3]&&t(e,u[3],s,l,i,o)}}(t,L,f,p,m,g)},find:function(t){return function(t,e,r,n,a,i,o){var s,l=1/0;return function t(u,c,h,d,f){if(!(c>i||h>o||d<n||f<a)){if(p=u.point){var p,m=e-u.x,g=r-u.y,y=m*m+g*g;if(y<l){var v=Math.sqrt(l=y);n=e-v,a=r-v,i=e+v,o=r+v,s=p}}for(var _=u.nodes,x=.5*(c+d),b=.5*(h+f),w=(r>=b)<<1|e>=x,M=w+4;w<M;++w)if(u=_[3&w])switch(3&w){case 0:t(u,c,h,x,b);break;case 1:t(u,x,h,d,b);break;case 2:t(u,c,b,x,f);break;case 3:t(u,x,b,d,f)}}}(t,n,a,i,o),s}(L,t[0],t[1],f,p,m,g)}};if(h=-1,null==e){for(;++h<d;)k(L,t[h],u[h],c[h],f,p,m,g);--h}else t.forEach(L.add);return u=c=t=l=null,L}return l.x=function(t){return arguments.length?(o=t,l):o},l.y=function(t){return arguments.length?(s=t,l):s},l.extent=function(t){return arguments.length?(null==t?e=r=n=a=null:(e=+t[0][0],r=+t[0][1],n=+t[1][0],a=+t[1][1]),l):null==e?null:[[e,r],[n,a]]},l.size=function(t){return arguments.length?(null==t?e=r=n=a=null:(e=r=0,n=+t[0],a=+t[1]),l):null==e?null:[n-e,a-r]},l},t.interpolateRgb=ja,t.interpolateObject=Ba,t.interpolateNumber=Ha,t.interpolateString=Ua;var Va=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Wa=new RegExp(Va.source,"g");function Ga(e,r){for(var n,a=t.interpolators.length;--a>=0&&!(n=t.interpolators[a](e,r)););return n}function qa(t,e){var r,n=[],a=[],i=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r<s;++r)n.push(Ga(t[r],e[r]));for(;r<i;++r)a[r]=t[r];for(;r<o;++r)a[r]=e[r];return function(t){for(r=0;r<s;++r)a[r]=n[r](t);return a}}t.interpolate=Ga,t.interpolators=[function(t,e){var r=typeof e;return("string"===r?de.has(e.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(e)?ja:Ua:e instanceof Yt?ja:Array.isArray(e)?qa:"object"===r&&isNaN(e)?Ba:Ha)(t,e)}],t.interpolateArray=qa;var Za=function(){return E},Xa=t.map({linear:Za,poly:function(t){return function(e){return Math.pow(e,t)}},quad:function(){return Qa},cubic:function(){return ti},sin:function(){return ri},exp:function(){return ni},circle:function(){return ai},elastic:function(t,e){var r;return arguments.length<2&&(e=.45),arguments.length?r=e/kt*Math.asin(1/t):(t=1,r=e/4),function(n){return 1+t*Math.pow(2,-10*n)*Math.sin((n-r)*kt/e)}},back:function(t){return t||(t=1.70158),function(e){return e*e*((t+1)*e-t)}},bounce:function(){return ii}}),Ja=t.map({in:E,out:Ka,"in-out":$a,"out-in":function(t){return $a(Ka(t))}});function Ka(t){return function(e){return 1-t(1-e)}}function $a(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function Qa(t){return t*t}function ti(t){return t*t*t}function ei(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 ri(t){return 1-Math.cos(t*Lt)}function ni(t){return Math.pow(2,10*(t-1))}function ai(t){return 1-Math.sqrt(1-t*t)}function ii(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 oi(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function si(t){var e,r,n,a=[t.a,t.b],i=[t.c,t.d],o=ui(a),s=li(a,i),l=ui(((e=i)[0]+=(n=-s)*(r=a)[0],e[1]+=n*r[1],e))||0;a[0]*i[1]<i[0]*a[1]&&(a[0]*=-1,a[1]*=-1,o*=-1,s*=-1),this.rotate=(o?Math.atan2(a[1],a[0]):Math.atan2(-i[0],i[1]))*St,this.translate=[t.e,t.f],this.scale=[o,l],this.skew=l?Math.atan2(s,l)*St:0}function li(t,e){return t[0]*e[0]+t[1]*e[1]}function ui(t){var e=Math.sqrt(li(t,t));return e&&(t[0]/=e,t[1]/=e),e}t.ease=function(t){var e,n=t.indexOf("-"),a=n>=0?t.slice(0,n):t,i=n>=0?t.slice(n+1):"in";return a=Xa.get(a)||Za,i=Ja.get(i)||E,e=i(a.apply(null,r.call(arguments,1))),function(t){return t<=0?0:t>=1?1:e(t)}},t.interpolateHcl=function(e,r){e=t.hcl(e),r=t.hcl(r);var n=e.h,a=e.c,i=e.l,o=r.h-n,s=r.c-a,l=r.l-i;return isNaN(s)&&(s=0,a=isNaN(a)?r.c:a),isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360),function(t){return Wt(n+o*t,a+s*t,i+l*t)+""}},t.interpolateHsl=function(e,r){e=t.hsl(e),r=t.hsl(r);var n=e.h,a=e.s,i=e.l,o=r.h-n,s=r.s-a,l=r.l-i;return isNaN(s)&&(s=0,a=isNaN(a)?r.s:a),isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360),function(t){return Ht(n+o*t,a+s*t,i+l*t)+""}},t.interpolateLab=function(e,r){e=t.lab(e),r=t.lab(r);var n=e.l,a=e.a,i=e.b,o=r.l-n,s=r.a-a,l=r.b-i;return function(t){return Kt(n+o*t,a+s*t,i+l*t)+""}},t.interpolateRound=oi,t.transform=function(e){var r=a.createElementNS(t.ns.prefix.svg,"g");return(t.transform=function(t){if(null!=t){r.setAttribute("transform",t);var e=r.transform.baseVal.consolidate()}return new si(e?e.matrix:ci)})(e)},si.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var ci={a:1,b:0,c:0,d:1,e:0,f:0};function hi(t){return t.length?t.pop()+",":""}function di(e,r){var n=[],a=[];return e=t.transform(e),r=t.transform(r),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var a=r.push("translate(",null,",",null,")");n.push({i:a-4,x:Ha(t[0],e[0])},{i:a-2,x:Ha(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}(e.translate,r.translate,n,a),function(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(hi(r)+"rotate(",null,")")-2,x:Ha(t,e)})):e&&r.push(hi(r)+"rotate("+e+")")}(e.rotate,r.rotate,n,a),function(t,e,r,n){t!==e?n.push({i:r.push(hi(r)+"skewX(",null,")")-2,x:Ha(t,e)}):e&&r.push(hi(r)+"skewX("+e+")")}(e.skew,r.skew,n,a),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var a=r.push(hi(r)+"scale(",null,",",null,")");n.push({i:a-4,x:Ha(t[0],e[0])},{i:a-2,x:Ha(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(hi(r)+"scale("+e+")")}(e.scale,r.scale,n,a),e=r=null,function(t){for(var e,r=-1,i=a.length;++r<i;)n[(e=a[r]).i]=e.x(t);return n.join("")}}function fi(t,e){return e=(e-=t=+t)||1/e,function(r){return(r-t)/e}}function pi(t,e){return e=(e-=t=+t)||1/e,function(r){return Math.max(0,Math.min(1,(r-t)/e))}}function mi(t){for(var e=t.source,r=t.target,n=function(t,e){if(t===e)return t;for(var r=gi(t),n=gi(e),a=r.pop(),i=n.pop(),o=null;a===i;)o=a,a=r.pop(),i=n.pop();return o}(e,r),a=[e];e!==n;)e=e.parent,a.push(e);for(var i=a.length;r!==n;)a.splice(i,0,r),r=r.parent;return a}function gi(t){for(var e=[],r=t.parent;null!=r;)e.push(t),t=r,r=r.parent;return e.push(t),e}function yi(t){t.fixed|=2}function vi(t){t.fixed&=-7}function _i(t){t.fixed|=4,t.px=t.x,t.py=t.y}function xi(t){t.fixed&=-5}t.interpolateTransform=di,t.layout={},t.layout.bundle=function(){return function(t){for(var e=[],r=-1,n=t.length;++r<n;)e.push(mi(t[r]));return e}},t.layout.chord=function(){var e,r,n,a,i,o,s,l={},u=0;function c(){var l,c,d,f,p,m={},g=[],y=t.range(a),v=[];for(e=[],r=[],l=0,f=-1;++f<a;){for(c=0,p=-1;++p<a;)c+=n[f][p];g.push(c),v.push(t.range(a)),l+=c}for(i&&y.sort((function(t,e){return i(g[t],g[e])})),o&&v.forEach((function(t,e){t.sort((function(t,r){return o(n[e][t],n[e][r])}))})),l=(kt-u*a)/l,c=0,f=-1;++f<a;){for(d=c,p=-1;++p<a;){var _=y[f],x=v[_][p],b=n[_][x],w=c,M=c+=b*l;m[_+"-"+x]={index:_,subindex:x,startAngle:w,endAngle:M,value:b}}r[_]={index:_,startAngle:d,endAngle:c,value:g[_]},c+=u}for(f=-1;++f<a;)for(p=f-1;++p<a;){var k=m[f+"-"+p],T=m[p+"-"+f];(k.value||T.value)&&e.push(k.value<T.value?{source:T,target:k}:{source:k,target:T})}s&&h()}function h(){e.sort((function(t,e){return s((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)}))}return l.matrix=function(t){return arguments.length?(a=(n=t)&&n.length,e=r=null,l):n},l.padding=function(t){return arguments.length?(u=t,e=r=null,l):u},l.sortGroups=function(t){return arguments.length?(i=t,e=r=null,l):i},l.sortSubgroups=function(t){return arguments.length?(o=t,e=null,l):o},l.sortChords=function(t){return arguments.length?(s=t,e&&h(),l):s},l.chords=function(){return e||c(),e},l.groups=function(){return r||c(),r},l},t.layout.force=function(){var e,r,n,a,i,o,s={},l=t.dispatch("start","tick","end"),u=[1,1],c=.9,h=bi,d=wi,f=-30,p=Mi,m=.1,g=.64,y=[],v=[];function _(t){return function(e,r,n,a){if(e.point!==t){var i=e.cx-t.x,o=e.cy-t.y,s=a-r,l=i*i+o*o;if(s*s/g<l){if(l<p){var u=e.charge/l;t.px-=i*u,t.py-=o*u}return!0}e.point&&l&&l<p&&(u=e.pointCharge/l,t.px-=i*u,t.py-=o*u)}return!e.charge}}function x(e){e.px=t.event.x,e.py=t.event.y,s.resume()}return s.tick=function(){if((n*=.99)<.005)return e=null,l.end({type:"end",alpha:n=0}),!0;var r,s,h,d,p,g,x,b,w,M=y.length,k=v.length;for(s=0;s<k;++s)d=(h=v[s]).source,(g=(b=(p=h.target).x-d.x)*b+(w=p.y-d.y)*w)&&(b*=g=n*i[s]*((g=Math.sqrt(g))-a[s])/g,w*=g,p.x-=b*(x=d.weight+p.weight?d.weight/(d.weight+p.weight):.5),p.y-=w*x,d.x+=b*(x=1-x),d.y+=w*x);if((x=n*m)&&(b=u[0]/2,w=u[1]/2,s=-1,x))for(;++s<M;)(h=y[s]).x+=(b-h.x)*x,h.y+=(w-h.y)*x;if(f)for(function t(e,r,n){var a=0,i=0;if(e.charge=0,!e.leaf)for(var o,s=e.nodes,l=s.length,u=-1;++u<l;)null!=(o=s[u])&&(t(o,r,n),e.charge+=o.charge,a+=o.charge*o.cx,i+=o.charge*o.cy);if(e.point){e.leaf||(e.point.x+=Math.random()-.5,e.point.y+=Math.random()-.5);var c=r*n[e.point.index];e.charge+=e.pointCharge=c,a+=c*e.point.x,i+=c*e.point.y}e.cx=a/e.charge,e.cy=i/e.charge}(r=t.geom.quadtree(y),n,o),s=-1;++s<M;)(h=y[s]).fixed||r.visit(_(h));for(s=-1;++s<M;)(h=y[s]).fixed?(h.x=h.px,h.y=h.py):(h.x-=(h.px-(h.px=h.x))*c,h.y-=(h.py-(h.py=h.y))*c);l.tick({type:"tick",alpha:n})},s.nodes=function(t){return arguments.length?(y=t,s):y},s.links=function(t){return arguments.length?(v=t,s):v},s.size=function(t){return arguments.length?(u=t,s):u},s.linkDistance=function(t){return arguments.length?(h="function"==typeof t?t:+t,s):h},s.distance=s.linkDistance,s.linkStrength=function(t){return arguments.length?(d="function"==typeof t?t:+t,s):d},s.friction=function(t){return arguments.length?(c=+t,s):c},s.charge=function(t){return arguments.length?(f="function"==typeof t?t:+t,s):f},s.chargeDistance=function(t){return arguments.length?(p=t*t,s):Math.sqrt(p)},s.gravity=function(t){return arguments.length?(m=+t,s):m},s.theta=function(t){return arguments.length?(g=t*t,s):Math.sqrt(g)},s.alpha=function(t){return arguments.length?(t=+t,n?t>0?n=t:(e.c=null,e.t=NaN,e=null,l.end({type:"end",alpha:n=0})):t>0&&(l.start({type:"start",alpha:n=t}),e=be(s.tick)),s):n},s.start=function(){var t,e,r,n=y.length,l=v.length,c=u[0],p=u[1];for(t=0;t<n;++t)(r=y[t]).index=t,r.weight=0;for(t=0;t<l;++t)"number"==typeof(r=v[t]).source&&(r.source=y[r.source]),"number"==typeof r.target&&(r.target=y[r.target]),++r.source.weight,++r.target.weight;for(t=0;t<n;++t)r=y[t],isNaN(r.x)&&(r.x=m("x",c)),isNaN(r.y)&&(r.y=m("y",p)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(a=[],"function"==typeof h)for(t=0;t<l;++t)a[t]=+h.call(this,v[t],t);else for(t=0;t<l;++t)a[t]=h;if(i=[],"function"==typeof d)for(t=0;t<l;++t)i[t]=+d.call(this,v[t],t);else for(t=0;t<l;++t)i[t]=d;if(o=[],"function"==typeof f)for(t=0;t<n;++t)o[t]=+f.call(this,y[t],t);else for(t=0;t<n;++t)o[t]=f;function m(r,a){if(!e){for(e=new Array(n),u=0;u<n;++u)e[u]=[];for(u=0;u<l;++u){var i=v[u];e[i.source.index].push(i.target),e[i.target.index].push(i.source)}}for(var o,s=e[t],u=-1,c=s.length;++u<c;)if(!isNaN(o=s[u][r]))return o;return Math.random()*a}return s.resume()},s.resume=function(){return s.alpha(.1)},s.stop=function(){return s.alpha(0)},s.drag=function(){if(r||(r=t.behavior.drag().origin(E).on("dragstart.force",yi).on("drag.force",x).on("dragend.force",vi)),!arguments.length)return r;this.on("mouseover.force",_i).on("mouseout.force",xi).call(r)},t.rebind(s,l,"on")};var bi=20,wi=1,Mi=1/0;function ki(e,r){return t.rebind(e,r,"sort","children","value"),e.nodes=e,e.links=Ci,e}function Ti(t,e){for(var r=[t];null!=(t=r.pop());)if(e(t),(a=t.children)&&(n=a.length))for(var n,a;--n>=0;)r.push(a[n])}function Li(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(i=t.children)&&(a=i.length))for(var a,i,o=-1;++o<a;)r.push(i[o]);for(;null!=(t=n.pop());)e(t)}function Ai(t){return t.children}function Si(t){return t.value}function Ei(t,e){return e.value-t.value}function Ci(e){return t.merge(e.map((function(t){return(t.children||[]).map((function(e){return{source:t,target:e}}))})))}t.layout.hierarchy=function(){var t=Ei,e=Ai,r=Si;function n(a){var i,o=[a],s=[];for(a.depth=0;null!=(i=o.pop());)if(s.push(i),(u=e.call(n,i,i.depth))&&(l=u.length)){for(var l,u,c;--l>=0;)o.push(c=u[l]),c.parent=i,c.depth=i.depth+1;r&&(i.value=0),i.children=u}else r&&(i.value=+r.call(n,i,i.depth)||0),delete i.children;return Li(a,(function(e){var n,a;t&&(n=e.children)&&n.sort(t),r&&(a=e.parent)&&(a.value+=e.value)})),s}return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(Ti(t,(function(t){t.children&&(t.value=0)})),Li(t,(function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)}))),t},n},t.layout.partition=function(){var e=t.layout.hierarchy(),r=[1,1];function n(t,n){var a=e.call(this,t,n);return function t(e,r,n,a){var i=e.children;if(e.x=r,e.y=e.depth*a,e.dx=n,e.dy=a,i&&(o=i.length)){var o,s,l,u=-1;for(n=e.value?n/e.value:0;++u<o;)t(s=i[u],r,l=s.value*n,a),r+=l}}(a[0],0,r[0],r[1]/function t(e){var r=e.children,n=0;if(r&&(a=r.length))for(var a,i=-1;++i<a;)n=Math.max(n,t(r[i]));return 1+n}(a[0])),a}return n.size=function(t){return arguments.length?(r=t,n):r},ki(n,e)},t.layout.pie=function(){var e=Number,r=Di,n=0,a=kt,i=0;function o(s){var l,u=s.length,c=s.map((function(t,r){return+e.call(o,t,r)})),h=+("function"==typeof n?n.apply(this,arguments):n),d=("function"==typeof a?a.apply(this,arguments):a)-h,f=Math.min(Math.abs(d)/u,+("function"==typeof i?i.apply(this,arguments):i)),p=f*(d<0?-1:1),m=t.sum(c),g=m?(d-u*p)/m:0,y=t.range(u),v=[];return null!=r&&y.sort(r===Di?function(t,e){return c[e]-c[t]}:function(t,e){return r(s[t],s[e])}),y.forEach((function(t){v[t]={data:s[t],value:l=c[t],startAngle:h,endAngle:h+=l*g+p,padAngle:f}})),v}return o.value=function(t){return arguments.length?(e=t,o):e},o.sort=function(t){return arguments.length?(r=t,o):r},o.startAngle=function(t){return arguments.length?(n=t,o):n},o.endAngle=function(t){return arguments.length?(a=t,o):a},o.padAngle=function(t){return arguments.length?(i=t,o):i},o};var Di={};function Pi(t){return t.x}function Oi(t){return t.y}function zi(t,e,r){t.y0=e,t.y=r}t.layout.stack=function(){var e=E,r=Fi,n=Ni,a=zi,i=Pi,o=Oi;function s(l,u){if(!(f=l.length))return l;var c=l.map((function(t,r){return e.call(s,t,r)})),h=c.map((function(t){return t.map((function(t,e){return[i.call(s,t,e),o.call(s,t,e)]}))})),d=r.call(s,h,u);c=t.permute(c,d),h=t.permute(h,d);var f,p,m,g,y=n.call(s,h,u),v=c[0].length;for(m=0;m<v;++m)for(a.call(s,c[0][m],g=y[m],h[0][m][1]),p=1;p<f;++p)a.call(s,c[p][m],g+=h[p-1][m][1],h[p][m][1]);return l}return s.values=function(t){return arguments.length?(e=t,s):e},s.order=function(t){return arguments.length?(r="function"==typeof t?t:Ii.get(t)||Fi,s):r},s.offset=function(t){return arguments.length?(n="function"==typeof t?t:Ri.get(t)||Ni,s):n},s.x=function(t){return arguments.length?(i=t,s):i},s.y=function(t){return arguments.length?(o=t,s):o},s.out=function(t){return arguments.length?(a=t,s):a},s};var Ii=t.map({"inside-out":function(e){var r,n,a=e.length,i=e.map(Yi),o=e.map(ji),s=t.range(a).sort((function(t,e){return i[t]-i[e]})),l=0,u=0,c=[],h=[];for(r=0;r<a;++r)n=s[r],l<u?(l+=o[n],c.push(n)):(u+=o[n],h.push(n));return h.reverse().concat(c)},reverse:function(e){return t.range(e.length).reverse()},default:Fi}),Ri=t.map({silhouette:function(t){var e,r,n,a=t.length,i=t[0].length,o=[],s=0,l=[];for(r=0;r<i;++r){for(e=0,n=0;e<a;e++)n+=t[e][r][1];n>s&&(s=n),o.push(n)}for(r=0;r<i;++r)l[r]=(s-o[r])/2;return l},wiggle:function(t){var e,r,n,a,i,o,s,l,u,c=t.length,h=t[0],d=h.length,f=[];for(f[0]=l=u=0,r=1;r<d;++r){for(e=0,a=0;e<c;++e)a+=t[e][r][1];for(e=0,i=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;i+=o*t[e][r][1]}f[r]=l-=a?i/a*s:0,l<u&&(u=l)}for(r=0;r<d;++r)f[r]-=u;return f},expand:function(t){var e,r,n,a=t.length,i=t[0].length,o=1/a,s=[];for(r=0;r<i;++r){for(e=0,n=0;e<a;e++)n+=t[e][r][1];if(n)for(e=0;e<a;e++)t[e][r][1]/=n;else for(e=0;e<a;e++)t[e][r][1]=o}for(r=0;r<i;++r)s[r]=0;return s},zero:Ni});function Fi(e){return t.range(e.length)}function Ni(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,a=t[0][1],i=t.length;r<i;++r)(e=t[r][1])>a&&(n=r,a=e);return n}function ji(t){return t.reduce(Bi,0)}function Bi(t,e){return t+e[1]}function Hi(t,e){return Ui(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function Ui(t,e){for(var r=-1,n=+t[0],a=(t[1]-n)/e,i=[];++r<=e;)i[r]=a*r+n;return i}function Vi(e){return[t.min(e),t.max(e)]}function Wi(t,e){return t.value-e.value}function Gi(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function qi(t,e){t._pack_next=e,e._pack_prev=t}function Zi(t,e){var r=e.x-t.x,n=e.y-t.y,a=t.r+e.r;return.999*a*a>r*r+n*n}function Xi(t){if((e=t.children)&&(l=e.length)){var e,r,n,a,i,o,s,l,u=1/0,c=-1/0,h=1/0,d=-1/0;if(e.forEach(Ji),(r=e[0]).x=-r.r,r.y=0,_(r),l>1&&((n=e[1]).x=n.r,n.y=0,_(n),l>2))for($i(r,n,a=e[2]),_(a),Gi(r,a),r._pack_prev=a,Gi(a,n),n=r._pack_next,i=3;i<l;i++){$i(r,n,a=e[i]);var f=0,p=1,m=1;for(o=n._pack_next;o!==n;o=o._pack_next,p++)if(Zi(o,a)){f=1;break}if(1==f)for(s=r._pack_prev;s!==o._pack_prev&&!Zi(s,a);s=s._pack_prev,m++);f?(p<m||p==m&&n.r<r.r?qi(r,n=o):qi(r=s,n),i--):(Gi(r,a),n=a,_(a))}var g=(u+c)/2,y=(h+d)/2,v=0;for(i=0;i<l;i++)(a=e[i]).x-=g,a.y-=y,v=Math.max(v,a.r+Math.sqrt(a.x*a.x+a.y*a.y));t.r=v,e.forEach(Ki)}function _(t){u=Math.min(t.x-t.r,u),c=Math.max(t.x+t.r,c),h=Math.min(t.y-t.r,h),d=Math.max(t.y+t.r,d)}}function Ji(t){t._pack_next=t._pack_prev=t}function Ki(t){delete t._pack_next,delete t._pack_prev}function $i(t,e,r){var n=t.r+r.r,a=e.x-t.x,i=e.y-t.y;if(n&&(a||i)){var o=e.r+r.r,s=a*a+i*i,l=.5+((n*=n)-(o*=o))/(2*s),u=Math.sqrt(Math.max(0,2*o*(n+s)-(n-=s)*n-o*o))/(2*s);r.x=t.x+l*a+u*i,r.y=t.y+l*i-u*a}else r.x=t.x+n,r.y=t.y}function Qi(t,e){return t.parent==e.parent?1:2}function to(t){var e=t.children;return e.length?e[0]:t.t}function eo(t){var e,r=t.children;return(e=r.length)?r[e-1]:t.t}function ro(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 no(t,e,r){return t.a.parent===e.parent?t.a:r}function ao(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function io(t,e){var r=t.x+e[3],n=t.y+e[0],a=t.dx-e[1]-e[3],i=t.dy-e[0]-e[2];return a<0&&(r+=a/2,a=0),i<0&&(n+=i/2,i=0),{x:r,y:n,dx:a,dy:i}}function oo(t){var e=t[0],r=t[t.length-1];return e<r?[e,r]:[r,e]}function so(t){return t.rangeExtent?t.rangeExtent():oo(t.range())}function lo(t,e,r,n){var a=r(t[0],t[1]),i=n(e[0],e[1]);return function(t){return i(a(t))}}function uo(t,e){var r,n=0,a=t.length-1,i=t[n],o=t[a];return o<i&&(r=n,n=a,a=r,r=i,i=o,o=r),t[n]=e.floor(i),t[a]=e.ceil(o),t}function co(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:ho}t.layout.histogram=function(){var e=!0,r=Number,n=Vi,a=Hi;function i(i,o){for(var s,l,u=[],c=i.map(r,this),h=n.call(this,c,o),d=a.call(this,h,c,o),f=(o=-1,c.length),p=d.length-1,m=e?1:1/f;++o<p;)(s=u[o]=[]).dx=d[o+1]-(s.x=d[o]),s.y=0;if(p>0)for(o=-1;++o<f;)(l=c[o])>=h[0]&&l<=h[1]&&((s=u[t.bisect(d,l,1,p)-1]).y+=m,s.push(i[o]));return u}return i.value=function(t){return arguments.length?(r=t,i):r},i.range=function(t){return arguments.length?(n=fe(t),i):n},i.bins=function(t){return arguments.length?(a="number"==typeof t?function(e){return Ui(e,t)}:fe(t),i):a},i.frequency=function(t){return arguments.length?(e=!!t,i):e},i},t.layout.pack=function(){var e,r=t.layout.hierarchy().sort(Wi),n=0,a=[1,1];function i(t,i){var o=r.call(this,t,i),s=o[0],l=a[0],u=a[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,Xi),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,Xi),Li(s,(function(t){t.r-=h}))}return function t(e,r,n,a){var i=e.children;if(e.x=r+=a*e.x,e.y=n+=a*e.y,e.r*=a,i)for(var o=-1,s=i.length;++o<s;)t(i[o],r,n,a)}(s,l/2,u/2,e?1:1/Math.max(2*s.r/l,2*s.r/u)),o}return i.size=function(t){return arguments.length?(a=t,i):a},i.radius=function(t){return arguments.length?(e=null==t||"function"==typeof t?t:+t,i):e},i.padding=function(t){return arguments.length?(n=+t,i):n},ki(i,r)},t.layout.tree=function(){var e=t.layout.hierarchy().sort(null).value(null),r=Qi,n=[1,1],a=null;function i(t,i){var u=e.call(this,t,i),c=u[0],h=function(t){for(var e,r={A:null,children:[t]},n=[r];null!=(e=n.pop());)for(var a,i=e.children,o=0,s=i.length;o<s;++o)n.push((i[o]=a={_:i[o],parent:e,children:(a=i[o].children)&&a.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=a);return r.children[0]}(c);if(Li(h,o),h.parent.m=-h.z,Ti(h,s),a)Ti(c,l);else{var d=c,f=c,p=c;Ti(c,(function(t){t.x<d.x&&(d=t),t.x>f.x&&(f=t),t.depth>p.depth&&(p=t)}));var m=r(d,f)/2-d.x,g=n[0]/(f.x+r(f,d)/2+m),y=n[1]/(p.depth||1);Ti(c,(function(t){t.x=(t.x+m)*g,t.y=t.depth*y}))}return u}function o(t){var e=t.children,n=t.parent.children,a=t.i?n[t.i-1]:null;if(e.length){!function(t){for(var e,r=0,n=0,a=t.children,i=a.length;--i>=0;)(e=a[i]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(t);var i=(e[0].z+e[e.length-1].z)/2;a?(t.z=a.z+r(t._,a._),t.m=t.z-i):t.z=i}else a&&(t.z=a.z+r(t._,a._));t.parent.A=function(t,e,n){if(e){for(var a,i=t,o=t,s=e,l=i.parent.children[0],u=i.m,c=o.m,h=s.m,d=l.m;s=eo(s),i=to(i),s&&i;)l=to(l),(o=eo(o)).a=t,(a=s.z+h-i.z-u+r(s._,i._))>0&&(ro(no(s,t,n),t,a),u+=a,c+=a),h+=s.m,u+=i.m,d+=l.m,c+=o.m;s&&!eo(o)&&(o.t=s,o.m+=h-c),i&&!to(l)&&(l.t=i,l.m+=u-d,n=t)}return n}(t,a,t.parent.A||n[0])}function s(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function l(t){t.x*=n[0],t.y=t.depth*n[1]}return i.separation=function(t){return arguments.length?(r=t,i):r},i.size=function(t){return arguments.length?(a=null==(n=t)?l:null,i):a?null:n},i.nodeSize=function(t){return arguments.length?(a=null==(n=t)?null:l,i):a?n:null},ki(i,e)},t.layout.cluster=function(){var e=t.layout.hierarchy().sort(null).value(null),r=Qi,n=[1,1],a=!1;function i(i,o){var s,l=e.call(this,i,o),u=l[0],c=0;Li(u,(function(e){var n=e.children;n&&n.length?(e.x=function(t){return t.reduce((function(t,e){return t+e.x}),0)/t.length}(n),e.y=function(e){return 1+t.max(e,(function(t){return t.y}))}(n)):(e.x=s?c+=r(e,s):0,e.y=0,s=e)}));var h=function t(e){var r=e.children;return r&&r.length?t(r[0]):e}(u),d=function t(e){var r,n=e.children;return n&&(r=n.length)?t(n[r-1]):e}(u),f=h.x-r(h,d)/2,p=d.x+r(d,h)/2;return Li(u,a?function(t){t.x=(t.x-u.x)*n[0],t.y=(u.y-t.y)*n[1]}:function(t){t.x=(t.x-f)/(p-f)*n[0],t.y=(1-(u.y?t.y/u.y:1))*n[1]}),l}return i.separation=function(t){return arguments.length?(r=t,i):r},i.size=function(t){return arguments.length?(a=null==(n=t),i):a?null:n},i.nodeSize=function(t){return arguments.length?(a=null!=(n=t),i):a?n:null},ki(i,e)},t.layout.treemap=function(){var e,r=t.layout.hierarchy(),n=Math.round,a=[1,1],i=null,o=ao,s=!1,l="squarify",u=.5*(1+Math.sqrt(5));function c(t,e){for(var r,n,a=-1,i=t.length;++a<i;)n=(r=t[a]).value*(e<0?0:e),r.area=isNaN(n)||n<=0?0:n}function h(t){var e=t.children;if(e&&e.length){var r,n,a,i=o(t),s=[],u=e.slice(),d=1/0,m="slice"===l?i.dx:"dice"===l?i.dy:"slice-dice"===l?1&t.depth?i.dy:i.dx:Math.min(i.dx,i.dy);for(c(u,i.dx*i.dy/t.value),s.area=0;(a=u.length)>0;)s.push(r=u[a-1]),s.area+=r.area,"squarify"!==l||(n=f(s,m))<=d?(u.pop(),d=n):(s.area-=s.pop().area,p(s,m,i,!1),m=Math.min(i.dx,i.dy),s.length=s.area=0,d=1/0);s.length&&(p(s,m,i,!0),s.length=s.area=0),e.forEach(h)}}function d(t){var e=t.children;if(e&&e.length){var r,n=o(t),a=e.slice(),i=[];for(c(a,n.dx*n.dy/t.value),i.area=0;r=a.pop();)i.push(r),i.area+=r.area,null!=r.z&&(p(i,r.z?n.dx:n.dy,n,!a.length),i.length=i.area=0);e.forEach(d)}}function f(t,e){for(var r,n=t.area,a=0,i=1/0,o=-1,s=t.length;++o<s;)(r=t[o].area)&&(r<i&&(i=r),r>a&&(a=r));return e*=e,(n*=n)?Math.max(e*a*u/n,n/(e*i*u)):1/0}function p(t,e,r,a){var i,o=-1,s=t.length,l=r.x,u=r.y,c=e?n(t.area/e):0;if(e==r.dx){for((a||c>r.dy)&&(c=r.dy);++o<s;)(i=t[o]).x=l,i.y=u,i.dy=c,l+=i.dx=Math.min(r.x+r.dx-l,c?n(i.area/c):0);i.z=!0,i.dx+=r.x+r.dx-l,r.y+=c,r.dy-=c}else{for((a||c>r.dx)&&(c=r.dx);++o<s;)(i=t[o]).x=l,i.y=u,i.dx=c,u+=i.dy=Math.min(r.y+r.dy-u,c?n(i.area/c):0);i.z=!1,i.dy+=r.y+r.dy-u,r.x+=c,r.dx-=c}}function m(t){var n=e||r(t),i=n[0];return i.x=i.y=0,i.value?(i.dx=a[0],i.dy=a[1]):i.dx=i.dy=0,e&&r.revalue(i),c([i],i.dx*i.dy/i.value),(e?d:h)(i),s&&(e=n),n}return m.size=function(t){return arguments.length?(a=t,m):a},m.padding=function(t){if(!arguments.length)return i;function e(e){return io(e,t)}var r;return o=null==(i=t)?ao:"function"==(r=typeof t)?function(e){var r=t.call(m,e,e.depth);return null==r?ao(e):io(e,"number"==typeof r?[r,r,r,r]:r)}:"number"===r?(t=[t,t,t,t],e):e,m},m.round=function(t){return arguments.length?(n=t?Math.round:Number,m):n!=Number},m.sticky=function(t){return arguments.length?(s=t,e=null,m):s},m.ratio=function(t){return arguments.length?(u=t,m):u},m.mode=function(t){return arguments.length?(l=t+"",m):l},ki(m,r)},t.random={normal:function(t,e){var r=arguments.length;return r<2&&(e=1),r<1&&(t=0),function(){var r,n,a;do{a=(r=2*Math.random()-1)*r+(n=2*Math.random()-1)*n}while(!a||a>1);return t+e*r*Math.sqrt(-2*Math.log(a)/a)}},logNormal:function(){var e=t.random.normal.apply(t,arguments);return function(){return Math.exp(e())}},bates:function(e){var r=t.random.irwinHall(e);return function(){return r()/e}},irwinHall:function(t){return function(){for(var e=0,r=0;r<t;r++)e+=Math.random();return e}}},t.scale={};var ho={floor:E,ceil:E};function fo(e,r,n,a){var i=[],o=[],s=0,l=Math.min(e.length,r.length)-1;for(e[l]<e[0]&&(e=e.slice().reverse(),r=r.slice().reverse());++s<=l;)i.push(n(e[s-1],e[s])),o.push(a(r[s-1],r[s]));return function(r){var n=t.bisect(e,r,1,l)-1;return o[n](i[n](r))}}function po(e,r){return t.rebind(e,r,"range","rangeRound","interpolate","clamp")}function mo(t,e){return uo(t,co(go(t,e)[2])),uo(t,co(go(t,e)[2])),t}function go(t,e){null==e&&(e=10);var r=oo(t),n=r[1]-r[0],a=Math.pow(10,Math.floor(Math.log(n/e)/Math.LN10)),i=e/n*a;return i<=.15?a*=10:i<=.35?a*=5:i<=.75&&(a*=2),r[0]=Math.ceil(r[0]/a)*a,r[1]=Math.floor(r[1]/a)*a+.5*a,r[2]=a,r}function yo(e,r){return t.range.apply(t,go(e,r))}function vo(e,r,n){var a=go(e,r);if(n){var i=Ae.exec(n);if(i.shift(),"s"===i[8]){var o=t.formatPrefix(Math.max(v(a[0]),v(a[1])));return i[7]||(i[7]="."+xo(o.scale(a[2]))),i[8]="f",n=t.format(i.join("")),function(t){return n(o.scale(t))+o.symbol}}i[7]||(i[7]="."+function(t,e){var r=xo(e[2]);return t in _o?Math.abs(r-xo(Math.max(v(e[0]),v(e[1]))))+ +("e"!==t):r-2*("%"===t)}(i[8],a)),n=i.join("")}else n=",."+xo(a[2])+"f";return t.format(n)}t.scale.linear=function(){return function t(e,r,n,a){var i,o;function s(){var t=Math.min(e.length,r.length)>2?fo:lo,s=a?pi:fi;return i=t(e,r,s,n),o=t(r,e,s,Ga),l}function l(t){return i(t)}return l.invert=function(t){return o(t)},l.domain=function(t){return arguments.length?(e=t.map(Number),s()):e},l.range=function(t){return arguments.length?(r=t,s()):r},l.rangeRound=function(t){return l.range(t).interpolate(oi)},l.clamp=function(t){return arguments.length?(a=t,s()):a},l.interpolate=function(t){return arguments.length?(n=t,s()):n},l.ticks=function(t){return yo(e,t)},l.tickFormat=function(t,r){return vo(e,t,r)},l.nice=function(t){return mo(e,t),s()},l.copy=function(){return t(e,r,n,a)},s()}([0,1],[0,1],Ga,!1)};var _o={s:1,g:1,p:1,r:1,e:1};function xo(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}t.scale.log=function(){return function e(r,n,a,i){function o(t){return(a?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(n)}function s(t){return a?Math.pow(n,t):-Math.pow(n,-t)}function l(t){return r(o(t))}return l.invert=function(t){return s(r.invert(t))},l.domain=function(t){return arguments.length?(a=t[0]>=0,r.domain((i=t.map(Number)).map(o)),l):i},l.base=function(t){return arguments.length?(n=+t,r.domain(i.map(o)),l):n},l.nice=function(){var t=uo(i.map(o),a?Math:wo);return r.domain(t),i=t.map(s),l},l.ticks=function(){var t=oo(i),e=[],r=t[0],l=t[1],u=Math.floor(o(r)),c=Math.ceil(o(l)),h=n%1?2:n;if(isFinite(c-u)){if(a){for(;u<c;u++)for(var d=1;d<h;d++)e.push(s(u)*d);e.push(s(u))}else for(e.push(s(u));u++<c;)for(d=h-1;d>0;d--)e.push(s(u)*d);for(u=0;e[u]<r;u++);for(c=e.length;e[c-1]>l;c--);e=e.slice(u,c)}return e},l.tickFormat=function(e,r){if(!arguments.length)return bo;arguments.length<2?r=bo:"function"!=typeof r&&(r=t.format(r));var a=Math.max(1,n*e/l.ticks().length);return function(t){var e=t/s(Math.round(o(t)));return e*n<n-.5&&(e*=n),e<=a?r(t):""}},l.copy=function(){return e(r.copy(),n,a,i)},po(l,r)}(t.scale.linear().domain([0,1]),10,!0,[1,10])};var bo=t.format(".0e"),wo={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};function Mo(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}t.scale.pow=function(){return function t(e,r,n){var a=Mo(r),i=Mo(1/r);function o(t){return e(a(t))}return o.invert=function(t){return i(e.invert(t))},o.domain=function(t){return arguments.length?(e.domain((n=t.map(Number)).map(a)),o):n},o.ticks=function(t){return yo(n,t)},o.tickFormat=function(t,e){return vo(n,t,e)},o.nice=function(t){return o.domain(mo(n,t))},o.exponent=function(t){return arguments.length?(a=Mo(r=t),i=Mo(1/r),e.domain(n.map(a)),o):r},o.copy=function(){return t(e.copy(),r,n)},po(o,e)}(t.scale.linear(),1,[0,1])},t.scale.sqrt=function(){return t.scale.pow().exponent(.5)},t.scale.ordinal=function(){return function e(r,n){var a,i,o;function s(t){return i[((a.get(t)||("range"===n.t?a.set(t,r.push(t)):NaN))-1)%i.length]}function l(e,n){return t.range(r.length).map((function(t){return e+n*t}))}return s.domain=function(t){if(!arguments.length)return r;r=[],a=new x;for(var e,i=-1,o=t.length;++i<o;)a.has(e=t[i])||a.set(e,r.push(e));return s[n.t].apply(s,n.a)},s.range=function(t){return arguments.length?(i=t,o=0,n={t:"range",a:arguments},s):i},s.rangePoints=function(t,e){arguments.length<2&&(e=0);var a=t[0],u=t[1],c=r.length<2?(a=(a+u)/2,0):(u-a)/(r.length-1+e);return i=l(a+c*e/2,c),o=0,n={t:"rangePoints",a:arguments},s},s.rangeRoundPoints=function(t,e){arguments.length<2&&(e=0);var a=t[0],u=t[1],c=r.length<2?(a=u=Math.round((a+u)/2),0):(u-a)/(r.length-1+e)|0;return i=l(a+Math.round(c*e/2+(u-a-(r.length-1+e)*c)/2),c),o=0,n={t:"rangeRoundPoints",a:arguments},s},s.rangeBands=function(t,e,a){arguments.length<2&&(e=0),arguments.length<3&&(a=e);var u=t[1]<t[0],c=t[u-0],h=(t[1-u]-c)/(r.length-e+2*a);return i=l(c+h*a,h),u&&i.reverse(),o=h*(1-e),n={t:"rangeBands",a:arguments},s},s.rangeRoundBands=function(t,e,a){arguments.length<2&&(e=0),arguments.length<3&&(a=e);var u=t[1]<t[0],c=t[u-0],h=t[1-u],d=Math.floor((h-c)/(r.length-e+2*a));return i=l(c+Math.round((h-c-(r.length-e)*d)/2),d),u&&i.reverse(),o=Math.round(d*(1-e)),n={t:"rangeRoundBands",a:arguments},s},s.rangeBand=function(){return o},s.rangeExtent=function(){return oo(n.a[0])},s.copy=function(){return e(r,n)},s.domain(r)}([],{t:"range",a:[[]]})},t.scale.category10=function(){return t.scale.ordinal().range(ko)},t.scale.category20=function(){return t.scale.ordinal().range(To)},t.scale.category20b=function(){return t.scale.ordinal().range(Lo)},t.scale.category20c=function(){return t.scale.ordinal().range(Ao)};var ko=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(ae),To=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(ae),Lo=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(ae),Ao=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(ae);function So(){return 0}t.scale.quantile=function(){return function e(r,n){var a;function i(){var e=0,i=n.length;for(a=[];++e<i;)a[e-1]=t.quantile(r,e/i);return o}function o(e){if(!isNaN(e=+e))return n[t.bisect(a,e)]}return o.domain=function(t){return arguments.length?(r=t.map(f).filter(p).sort(d),i()):r},o.range=function(t){return arguments.length?(n=t,i()):n},o.quantiles=function(){return a},o.invertExtent=function(t){return(t=n.indexOf(t))<0?[NaN,NaN]:[t>0?a[t-1]:r[0],t<a.length?a[t]:r[r.length-1]]},o.copy=function(){return e(r,n)},i()}([],[])},t.scale.quantize=function(){return function t(e,r,n){var a,i;function o(t){return n[Math.max(0,Math.min(i,Math.floor(a*(t-e))))]}function s(){return a=n.length/(r-e),i=n.length-1,o}return o.domain=function(t){return arguments.length?(e=+t[0],r=+t[t.length-1],s()):[e,r]},o.range=function(t){return arguments.length?(n=t,s()):n},o.invertExtent=function(t){return[t=(t=n.indexOf(t))<0?NaN:t/a+e,t+1/a]},o.copy=function(){return t(e,r,n)},s()}(0,1,[0,1])},t.scale.threshold=function(){return function e(r,n){function a(e){if(e<=e)return n[t.bisect(r,e)]}return a.domain=function(t){return arguments.length?(r=t,a):r},a.range=function(t){return arguments.length?(n=t,a):n},a.invertExtent=function(t){return t=n.indexOf(t),[r[t-1],r[t]]},a.copy=function(){return e(r,n)},a}([.5],[0,1])},t.scale.identity=function(){return function t(e){function r(t){return+t}return r.invert=r,r.domain=r.range=function(t){return arguments.length?(e=t.map(r),r):e},r.ticks=function(t){return yo(e,t)},r.tickFormat=function(t,r){return vo(e,t,r)},r.copy=function(){return t(e)},r}([0,1])},t.svg={},t.svg.arc=function(){var t=Co,e=Do,r=So,n=Eo,a=Po,i=Oo,o=zo;function s(){var s=Math.max(0,+t.apply(this,arguments)),u=Math.max(0,+e.apply(this,arguments)),c=a.apply(this,arguments)-Lt,h=i.apply(this,arguments)-Lt,d=Math.abs(h-c),f=c>h?0:1;if(u<s&&(p=u,u=s,s=p),d>=Tt)return l(u,f)+(s?l(s,1-f):"")+"Z";var p,m,g,y,v,_,x,b,w,M,k,T,L=0,A=0,S=[];if((y=(+o.apply(this,arguments)||0)/2)&&(g=n===Eo?Math.sqrt(s*s+u*u):+n.apply(this,arguments),f||(A*=-1),u&&(A=Pt(g/u*Math.sin(y))),s&&(L=Pt(g/s*Math.sin(y)))),u){v=u*Math.cos(c+A),_=u*Math.sin(c+A),x=u*Math.cos(h-A),b=u*Math.sin(h-A);var E=Math.abs(h-c-2*A)<=Mt?0:1;if(A&&Io(v,_,x,b)===f^E){var C=(c+h)/2;v=u*Math.cos(C),_=u*Math.sin(C),x=b=null}}else v=_=0;if(s){w=s*Math.cos(h-L),M=s*Math.sin(h-L),k=s*Math.cos(c+L),T=s*Math.sin(c+L);var D=Math.abs(c-h+2*L)<=Mt?0:1;if(L&&Io(w,M,k,T)===1-f^D){var P=(c+h)/2;w=s*Math.cos(P),M=s*Math.sin(P),k=T=null}}else w=M=0;if(d>bt&&(p=Math.min(Math.abs(u-s)/2,+r.apply(this,arguments)))>.001){m=s<u^f?0:1;var O=p,z=p;if(d<Mt){var I=null==k?[w,M]:null==x?[v,_]:aa([v,_],[k,T],[x,b],[w,M]),R=v-I[0],F=_-I[1],N=x-I[0],Y=b-I[1],j=1/Math.sin(Math.acos((R*N+F*Y)/(Math.sqrt(R*R+F*F)*Math.sqrt(N*N+Y*Y)))/2),B=Math.sqrt(I[0]*I[0]+I[1]*I[1]);z=Math.min(p,(s-B)/(j-1)),O=Math.min(p,(u-B)/(j+1))}if(null!=x){var H=Ro(null==k?[w,M]:[k,T],[v,_],u,O,f),U=Ro([x,b],[w,M],u,O,f);p===O?S.push("M",H[0],"A",O,",",O," 0 0,",m," ",H[1],"A",u,",",u," 0 ",1-f^Io(H[1][0],H[1][1],U[1][0],U[1][1]),",",f," ",U[1],"A",O,",",O," 0 0,",m," ",U[0]):S.push("M",H[0],"A",O,",",O," 0 1,",m," ",U[0])}else S.push("M",v,",",_);if(null!=k){var V=Ro([v,_],[k,T],s,-z,f),W=Ro([w,M],null==x?[v,_]:[x,b],s,-z,f);p===z?S.push("L",W[0],"A",z,",",z," 0 0,",m," ",W[1],"A",s,",",s," 0 ",f^Io(W[1][0],W[1][1],V[1][0],V[1][1]),",",1-f," ",V[1],"A",z,",",z," 0 0,",m," ",V[0]):S.push("L",W[0],"A",z,",",z," 0 0,",m," ",V[0])}else S.push("L",w,",",M)}else S.push("M",v,",",_),null!=x&&S.push("A",u,",",u," 0 ",E,",",f," ",x,",",b),S.push("L",w,",",M),null!=k&&S.push("A",s,",",s," 0 ",D,",",1-f," ",k,",",T);return S.push("Z"),S.join("")}function l(t,e){return"M0,"+t+"A"+t+","+t+" 0 1,"+e+" 0,"+-t+"A"+t+","+t+" 0 1,"+e+" 0,"+t}return s.innerRadius=function(e){return arguments.length?(t=fe(e),s):t},s.outerRadius=function(t){return arguments.length?(e=fe(t),s):e},s.cornerRadius=function(t){return arguments.length?(r=fe(t),s):r},s.padRadius=function(t){return arguments.length?(n=t==Eo?Eo:fe(t),s):n},s.startAngle=function(t){return arguments.length?(a=fe(t),s):a},s.endAngle=function(t){return arguments.length?(i=fe(t),s):i},s.padAngle=function(t){return arguments.length?(o=fe(t),s):o},s.centroid=function(){var r=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,n=(+a.apply(this,arguments)+ +i.apply(this,arguments))/2-Lt;return[Math.cos(n)*r,Math.sin(n)*r]},s};var Eo="auto";function Co(t){return t.innerRadius}function Do(t){return t.outerRadius}function Po(t){return t.startAngle}function Oo(t){return t.endAngle}function zo(t){return t&&t.padAngle}function Io(t,e,r,n){return(t-r)*e-(e-n)*t>0?0:1}function Ro(t,e,r,n,a){var i=t[0]-e[0],o=t[1]-e[1],s=(a?n:-n)/Math.sqrt(i*i+o*o),l=s*o,u=-s*i,c=t[0]+l,h=t[1]+u,d=e[0]+l,f=e[1]+u,p=(c+d)/2,m=(h+f)/2,g=d-c,y=f-h,v=g*g+y*y,_=r-n,x=c*f-d*h,b=(y<0?-1:1)*Math.sqrt(Math.max(0,_*_*v-x*x)),w=(x*y-g*b)/v,M=(-x*g-y*b)/v,k=(x*y+g*b)/v,T=(-x*g+y*b)/v,L=w-p,A=M-m,S=k-p,E=T-m;return L*L+A*A>S*S+E*E&&(w=k,M=T),[[w-l,M-u],[w*r/_,M*r/_]]}function Fo(t){var e=$n,r=Qn,n=Ur,a=Yo,i=a.key,o=.7;function s(i){var s,l=[],u=[],c=-1,h=i.length,d=fe(e),f=fe(r);function p(){l.push("M",a(t(u),o))}for(;++c<h;)n.call(this,s=i[c],c)?u.push([+d.call(this,s,c),+f.call(this,s,c)]):u.length&&(p(),u=[]);return u.length&&p(),l.length?l.join(""):null}return s.x=function(t){return arguments.length?(e=t,s):e},s.y=function(t){return arguments.length?(r=t,s):r},s.defined=function(t){return arguments.length?(n=t,s):n},s.interpolate=function(t){return arguments.length?(i="function"==typeof t?a=t:(a=No.get(t)||Yo).key,s):i},s.tension=function(t){return arguments.length?(o=t,s):o},s}t.svg.line=function(){return Fo(E)};var No=t.map({linear:Yo,"linear-closed":jo,step:function(t){for(var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];++e<r;)a.push("H",(n[0]+(n=t[e])[0])/2,"V",n[1]);return r>1&&a.push("H",n[0]),a.join("")},"step-before":Bo,"step-after":Ho,basis:Wo,"basis-open":function(t){if(t.length<4)return Yo(t);for(var e,r=[],n=-1,a=t.length,i=[0],o=[0];++n<3;)e=t[n],i.push(e[0]),o.push(e[1]);for(r.push(Go(Xo,i)+","+Go(Xo,o)),--n;++n<a;)e=t[n],i.shift(),i.push(e[0]),o.shift(),o.push(e[1]),Jo(r,i,o);return r.join("")},"basis-closed":function(t){for(var e,r,n=-1,a=t.length,i=a+4,o=[],s=[];++n<4;)r=t[n%a],o.push(r[0]),s.push(r[1]);for(e=[Go(Xo,o),",",Go(Xo,s)],--n;++n<i;)r=t[n%a],o.shift(),o.push(r[0]),s.shift(),s.push(r[1]),Jo(e,o,s);return e.join("")},bundle:function(t,e){var r=t.length-1;if(r)for(var n,a,i=t[0][0],o=t[0][1],s=t[r][0]-i,l=t[r][1]-o,u=-1;++u<=r;)a=u/r,(n=t[u])[0]=e*n[0]+(1-e)*(i+a*s),n[1]=e*n[1]+(1-e)*(o+a*l);return Wo(t)},cardinal:function(t,e){return t.length<3?Yo(t):t[0]+Uo(t,Vo(t,e))},"cardinal-open":function(t,e){return t.length<4?Yo(t):t[1]+Uo(t.slice(1,-1),Vo(t,e))},"cardinal-closed":function(t,e){return t.length<3?jo(t):t[0]+Uo((t.push(t[0]),t),Vo([t[t.length-2]].concat(t,[t[1]]),e))},monotone:function(t){return t.length<3?Yo(t):t[0]+Uo(t,function(t){for(var e,r,n,a,i=[],o=function(t){for(var e=0,r=t.length-1,n=[],a=t[0],i=t[1],o=n[0]=Ko(a,i);++e<r;)n[e]=(o+(o=Ko(a=i,i=t[e+1])))/2;return n[e]=o,n}(t),s=-1,l=t.length-1;++s<l;)e=Ko(t[s],t[s+1]),v(e)<bt?o[s]=o[s+1]=0:(a=(r=o[s]/e)*r+(n=o[s+1]/e)*n)>9&&(a=3*e/Math.sqrt(a),o[s]=a*r,o[s+1]=a*n);for(s=-1;++s<=l;)a=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),i.push([a||0,o[s]*a||0]);return i}(t))}});function Yo(t){return t.length>1?t.join("L"):t+"Z"}function jo(t){return t.join("L")+"Z"}function Bo(t){for(var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];++e<r;)a.push("V",(n=t[e])[1],"H",n[0]);return a.join("")}function Ho(t){for(var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];++e<r;)a.push("H",(n=t[e])[0],"V",n[1]);return a.join("")}function Uo(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return Yo(t);var r=t.length!=e.length,n="",a=t[0],i=t[1],o=e[0],s=o,l=1;if(r&&(n+="Q"+(i[0]-2*o[0]/3)+","+(i[1]-2*o[1]/3)+","+i[0]+","+i[1],a=t[1],l=2),e.length>1){s=e[1],i=t[l],l++,n+="C"+(a[0]+o[0])+","+(a[1]+o[1])+","+(i[0]-s[0])+","+(i[1]-s[1])+","+i[0]+","+i[1];for(var u=2;u<e.length;u++,l++)i=t[l],s=e[u],n+="S"+(i[0]-s[0])+","+(i[1]-s[1])+","+i[0]+","+i[1]}if(r){var c=t[l];n+="Q"+(i[0]+2*s[0]/3)+","+(i[1]+2*s[1]/3)+","+c[0]+","+c[1]}return n}function Vo(t,e){for(var r,n=[],a=(1-e)/2,i=t[0],o=t[1],s=1,l=t.length;++s<l;)r=i,i=o,o=t[s],n.push([a*(o[0]-r[0]),a*(o[1]-r[1])]);return n}function Wo(t){if(t.length<3)return Yo(t);var e=1,r=t.length,n=t[0],a=n[0],i=n[1],o=[a,a,a,(n=t[1])[0]],s=[i,i,i,n[1]],l=[a,",",i,"L",Go(Xo,o),",",Go(Xo,s)];for(t.push(t[r-1]);++e<=r;)n=t[e],o.shift(),o.push(n[0]),s.shift(),s.push(n[1]),Jo(l,o,s);return t.pop(),l.push("L",n),l.join("")}function Go(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}No.forEach((function(t,e){e.key=t,e.closed=/-closed$/.test(t)}));var qo=[0,2/3,1/3,0],Zo=[0,1/3,2/3,0],Xo=[0,1/6,2/3,1/6];function Jo(t,e,r){t.push("C",Go(qo,e),",",Go(qo,r),",",Go(Zo,e),",",Go(Zo,r),",",Go(Xo,e),",",Go(Xo,r))}function Ko(t,e){return(e[1]-t[1])/(e[0]-t[0])}function $o(t){for(var e,r,n,a=-1,i=t.length;++a<i;)r=(e=t[a])[0],n=e[1]-Lt,e[0]=r*Math.cos(n),e[1]=r*Math.sin(n);return t}function Qo(t){var e=$n,r=$n,n=0,a=Qn,i=Ur,o=Yo,s=o.key,l=o,u="L",c=.7;function h(s){var h,d,f,p=[],m=[],g=[],y=-1,v=s.length,_=fe(e),x=fe(n),b=e===r?function(){return d}:fe(r),w=n===a?function(){return f}:fe(a);function M(){p.push("M",o(t(g),c),u,l(t(m.reverse()),c),"Z")}for(;++y<v;)i.call(this,h=s[y],y)?(m.push([d=+_.call(this,h,y),f=+x.call(this,h,y)]),g.push([+b.call(this,h,y),+w.call(this,h,y)])):m.length&&(M(),m=[],g=[]);return m.length&&M(),p.length?p.join(""):null}return h.x=function(t){return arguments.length?(e=r=t,h):r},h.x0=function(t){return arguments.length?(e=t,h):e},h.x1=function(t){return arguments.length?(r=t,h):r},h.y=function(t){return arguments.length?(n=a=t,h):a},h.y0=function(t){return arguments.length?(n=t,h):n},h.y1=function(t){return arguments.length?(a=t,h):a},h.defined=function(t){return arguments.length?(i=t,h):i},h.interpolate=function(t){return arguments.length?(s="function"==typeof t?o=t:(o=No.get(t)||Yo).key,l=o.reverse||o,u=o.closed?"M":"L",h):s},h.tension=function(t){return arguments.length?(c=t,h):c},h}function ts(t){return t.radius}function es(t){return[t.x,t.y]}function rs(){return 64}function ns(){return"circle"}function as(t){var e=Math.sqrt(t/Mt);return"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+-e+"A"+e+","+e+" 0 1,1 0,"+e+"Z"}t.svg.line.radial=function(){var t=Fo($o);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},Bo.reverse=Ho,Ho.reverse=Bo,t.svg.area=function(){return Qo(E)},t.svg.area.radial=function(){var t=Qo($o);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},t.svg.chord=function(){var t=Nn,e=Yn,r=ts,n=Po,a=Oo;function i(r,n){var a,i,u=o(this,t,r,n),c=o(this,e,r,n);return"M"+u.p0+s(u.r,u.p1,u.a1-u.a0)+(i=c,((a=u).a0==i.a0&&a.a1==i.a1?l(u.r,u.p1,u.r,u.p0):l(u.r,u.p1,c.r,c.p0)+s(c.r,c.p1,c.a1-c.a0)+l(c.r,c.p1,u.r,u.p0))+"Z")}function o(t,e,i,o){var s=e.call(t,i,o),l=r.call(t,s,o),u=n.call(t,s,o)-Lt,c=a.call(t,s,o)-Lt;return{r:l,a0:u,a1:c,p0:[l*Math.cos(u),l*Math.sin(u)],p1:[l*Math.cos(c),l*Math.sin(c)]}}function s(t,e,r){return"A"+t+","+t+" 0 "+ +(r>Mt)+",1 "+e}function l(t,e,r,n){return"Q 0,0 "+n}return i.radius=function(t){return arguments.length?(r=fe(t),i):r},i.source=function(e){return arguments.length?(t=fe(e),i):t},i.target=function(t){return arguments.length?(e=fe(t),i):e},i.startAngle=function(t){return arguments.length?(n=fe(t),i):n},i.endAngle=function(t){return arguments.length?(a=fe(t),i):a},i},t.svg.diagonal=function(){var t=Nn,e=Yn,r=es;function n(n,a){var i=t.call(this,n,a),o=e.call(this,n,a),s=(i.y+o.y)/2,l=[i,{x:i.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return n.source=function(e){return arguments.length?(t=fe(e),n):t},n.target=function(t){return arguments.length?(e=fe(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},t.svg.diagonal.radial=function(){var e=t.svg.diagonal(),r=es,n=e.projection;return e.projection=function(t){return arguments.length?n(function(t){return function(){var e=t.apply(this,arguments),r=e[0],n=e[1]-Lt;return[r*Math.cos(n),r*Math.sin(n)]}}(r=t)):r},e},t.svg.symbol=function(){var t=ns,e=rs;function r(r,n){return(is.get(t.call(this,r,n))||as)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=fe(e),r):t},r.size=function(t){return arguments.length?(e=fe(t),r):e},r};var is=t.map({circle:as,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*ss)),r=e*ss;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/os),r=e*os/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/os),r=e*os/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});t.svg.symbolTypes=is.keys();var os=Math.sqrt(3),ss=Math.tan(30*At);W.transition=function(t){for(var e,r,n=hs||++ps,a=ys(t),i=[],o=ds||{time:Date.now(),ease:ei,delay:0,duration:250},s=-1,l=this.length;++s<l;){i.push(e=[]);for(var u=this[s],c=-1,h=u.length;++c<h;)(r=u[c])&&vs(r,c,a,n,o),e.push(r)}return cs(i,a,n)},W.interrupt=function(t){return this.each(null==t?ls:us(ys(t)))};var ls=us(ys());function us(t){return function(){var e,r,n;(e=this[t])&&(n=e[r=e.active])&&(n.timer.c=null,n.timer.t=NaN,--e.count?delete e[r]:delete this[t],e.active+=.5,n.event&&n.event.interrupt.call(this,this.__data__,n.index))}}function cs(t,e,r){return j(t,fs),t.namespace=e,t.id=r,t}var hs,ds,fs=[],ps=0;function ms(t,e,r,n){var a=t.id,i=t.namespace;return lt(t,"function"==typeof r?function(t,o,s){t[i][a].tween.set(e,n(r.call(t,t.__data__,o,s)))}:(r=n(r),function(t){t[i][a].tween.set(e,r)}))}function gs(t){return null==t&&(t=""),function(){this.textContent=t}}function ys(t){return null==t?"__transition__":"__transition_"+t+"__"}function vs(t,e,r,n,a){var i,o,s,l,u,c=t[r]||(t[r]={active:0,count:0}),h=c[n];function d(r){var a=c.active,d=c[a];for(var p in d&&(d.timer.c=null,d.timer.t=NaN,--c.count,delete c[a],d.event&&d.event.interrupt.call(t,t.__data__,d.index)),c)if(+p<n){var m=c[p];m.timer.c=null,m.timer.t=NaN,--c.count,delete c[p]}o.c=f,be((function(){return o.c&&f(r||1)&&(o.c=null,o.t=NaN),1}),0,i),c.active=n,h.event&&h.event.start.call(t,t.__data__,e),u=[],h.tween.forEach((function(r,n){(n=n.call(t,t.__data__,e))&&u.push(n)})),l=h.ease,s=h.duration}function f(a){for(var i=a/s,o=l(i),d=u.length;d>0;)u[--d].call(t,o);if(i>=1)return h.event&&h.event.end.call(t,t.__data__,e),--c.count?delete c[n]:delete t[r],1}h||(i=a.time,o=be((function(t){var e=h.delay;if(o.t=e+i,e<=t)return d(t-e);o.c=d}),0,i),h=c[n]={tween:new x,time:i,timer:o,delay:a.delay,duration:a.duration,ease:a.ease,index:e},a=null,++c.count)}fs.call=W.call,fs.empty=W.empty,fs.node=W.node,fs.size=W.size,t.transition=function(e,r){return e&&e.transition?hs?e.transition(r):e:t.selection().transition(e)},t.transition.prototype=fs,fs.select=function(t){var e,r,n,a=this.id,i=this.namespace,o=[];t=G(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__),vs(r,c,i,a,n[i][a]),e.push(r)):e.push(null)}return cs(o,i,a)},fs.selectAll=function(t){var e,r,n,a,i,o=this.id,s=this.namespace,l=[];t=q(t);for(var u=-1,c=this.length;++u<c;)for(var h=this[u],d=-1,f=h.length;++d<f;)if(n=h[d]){i=n[s][o],r=t.call(n,n.__data__,d,u),l.push(e=[]);for(var p=-1,m=r.length;++p<m;)(a=r[p])&&vs(a,p,s,o,i),e.push(a)}return cs(l,s,o)},fs.filter=function(t){var e,r,n=[];"function"!=typeof t&&(t=st(t));for(var a=0,i=this.length;a<i;a++){n.push(e=[]);for(var o,s=0,l=(o=this[a]).length;s<l;s++)(r=o[s])&&t.call(r,r.__data__,s,a)&&e.push(r)}return cs(n,this.namespace,this.id)},fs.tween=function(t,e){var r=this.id,n=this.namespace;return arguments.length<2?this.node()[n][r].tween.get(t):lt(this,null==e?function(e){e[n][r].tween.remove(t)}:function(a){a[n][r].tween.set(t,e)})},fs.attr=function(e,r){if(arguments.length<2){for(r in e)this.attr(r,e[r]);return this}var n="transform"==e?di:Ga,a=t.ns.qualify(e);function i(){this.removeAttribute(a)}function o(){this.removeAttributeNS(a.space,a.local)}return ms(this,"attr."+e,r,a.local?function(t){return null==t?o:(t+="",function(){var e,r=this.getAttributeNS(a.space,a.local);return r!==t&&(e=n(r,t),function(t){this.setAttributeNS(a.space,a.local,e(t))})})}:function(t){return null==t?i:(t+="",function(){var e,r=this.getAttribute(a);return r!==t&&(e=n(r,t),function(t){this.setAttribute(a,e(t))})})})},fs.attrTween=function(e,r){var n=t.ns.qualify(e);return this.tween("attr."+e,n.local?function(t,e){var a=r.call(this,t,e,this.getAttributeNS(n.space,n.local));return a&&function(t){this.setAttributeNS(n.space,n.local,a(t))}}:function(t,e){var a=r.call(this,t,e,this.getAttribute(n));return a&&function(t){this.setAttribute(n,a(t))}})},fs.style=function(t,e,r){var n=arguments.length;if(n<3){if("string"!=typeof t){for(r in n<2&&(e=""),t)this.style(r,t[r],e);return this}r=""}function a(){this.style.removeProperty(t)}return ms(this,"style."+t,e,(function(e){return null==e?a:(e+="",function(){var n,a=o(this).getComputedStyle(this,null).getPropertyValue(t);return a!==e&&(n=Ga(a,e),function(e){this.style.setProperty(t,n(e),r)})})}))},fs.styleTween=function(t,e,r){return arguments.length<3&&(r=""),this.tween("style."+t,(function(n,a){var i=e.call(this,n,a,o(this).getComputedStyle(this,null).getPropertyValue(t));return i&&function(e){this.style.setProperty(t,i(e),r)}}))},fs.text=function(t){return ms(this,"text",t,gs)},fs.remove=function(){var t=this.namespace;return this.each("end.transition",(function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)}))},fs.ease=function(e){var r=this.id,n=this.namespace;return arguments.length<1?this.node()[n][r].ease:("function"!=typeof e&&(e=t.ease.apply(t,arguments)),lt(this,(function(t){t[n][r].ease=e})))},fs.delay=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].delay:lt(this,"function"==typeof t?function(n,a,i){n[r][e].delay=+t.call(n,n.__data__,a,i)}:(t=+t,function(n){n[r][e].delay=t}))},fs.duration=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].duration:lt(this,"function"==typeof t?function(n,a,i){n[r][e].duration=Math.max(1,t.call(n,n.__data__,a,i))}:(t=Math.max(1,t),function(n){n[r][e].duration=t}))},fs.each=function(e,r){var n=this.id,a=this.namespace;if(arguments.length<2){var i=ds,o=hs;try{hs=n,lt(this,(function(t,r,i){ds=t[a][n],e.call(t,t.__data__,r,i)}))}finally{ds=i,hs=o}}else lt(this,(function(i){var o=i[a][n];(o.event||(o.event=t.dispatch("start","end","interrupt"))).on(e,r)}));return this},fs.transition=function(){for(var t,e,r,n=this.id,a=++ps,i=this.namespace,o=[],s=0,l=this.length;s<l;s++){o.push(t=[]);for(var u,c=0,h=(u=this[s]).length;c<h;c++)(e=u[c])&&vs(e,c,i,a,{time:(r=e[i][n]).time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration}),t.push(e)}return cs(o,i,a)},t.svg.axis=function(){var e,r=t.scale.linear(),a=_s,i=6,o=6,s=3,l=[10],u=null;function c(n){n.each((function(){var n,c=t.select(this),h=this.__chart__||r,d=this.__chart__=r.copy(),f=null==u?d.ticks?d.ticks.apply(d,l):d.domain():u,p=null==e?d.tickFormat?d.tickFormat.apply(d,l):E:e,m=c.selectAll(".tick").data(f,d),g=m.enter().insert("g",".domain").attr("class","tick").style("opacity",bt),y=t.transition(m.exit()).style("opacity",bt).remove(),v=t.transition(m.order()).style("opacity",1),_=Math.max(i,0)+s,x=so(d),b=c.selectAll(".domain").data([0]),w=(b.enter().append("path").attr("class","domain"),t.transition(b));g.append("line"),g.append("text");var M,k,T,L,A=g.select("line"),S=v.select("line"),C=m.select("text").text(p),D=g.select("text"),P=v.select("text"),O="top"===a||"left"===a?-1:1;if("bottom"===a||"top"===a?(n=bs,M="x",T="y",k="x2",L="y2",C.attr("dy",O<0?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+x[0]+","+O*o+"V0H"+x[1]+"V"+O*o)):(n=ws,M="y",T="x",k="y2",L="x2",C.attr("dy",".32em").style("text-anchor",O<0?"end":"start"),w.attr("d","M"+O*o+","+x[0]+"H0V"+x[1]+"H"+O*o)),A.attr(L,O*i),D.attr(T,O*_),S.attr(k,0).attr(L,O*i),P.attr(M,0).attr(T,O*_),d.rangeBand){var z=d,I=z.rangeBand()/2;h=d=function(t){return z(t)+I}}else h.rangeBand?h=d:y.call(n,d,h);g.call(n,h,d),v.call(n,d,d)}))}return c.scale=function(t){return arguments.length?(r=t,c):r},c.orient=function(t){return arguments.length?(a=t in xs?t+"":_s,c):a},c.ticks=function(){return arguments.length?(l=n(arguments),c):l},c.tickValues=function(t){return arguments.length?(u=t,c):u},c.tickFormat=function(t){return arguments.length?(e=t,c):e},c.tickSize=function(t){var e=arguments.length;return e?(i=+t,o=+arguments[e-1],c):i},c.innerTickSize=function(t){return arguments.length?(i=+t,c):i},c.outerTickSize=function(t){return arguments.length?(o=+t,c):o},c.tickPadding=function(t){return arguments.length?(s=+t,c):s},c.tickSubdivide=function(){return arguments.length&&c},c};var _s="bottom",xs={top:1,right:1,bottom:1,left:1};function bs(t,e,r){t.attr("transform",(function(t){var n=e(t);return"translate("+(isFinite(n)?n:r(t))+",0)"}))}function ws(t,e,r){t.attr("transform",(function(t){var n=e(t);return"translate(0,"+(isFinite(n)?n:r(t))+")"}))}t.svg.brush=function(){var e,r,n=N(d,"brushstart","brush","brushend"),a=null,i=null,s=[0,0],l=[0,0],u=!0,c=!0,h=ks[0];function d(e){e.each((function(){var e=t.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",g).on("touchstart.brush",g),r=e.selectAll(".background").data([0]);r.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),e.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var n=e.selectAll(".resize").data(h,E);n.exit().remove(),n.enter().append("g").attr("class",(function(t){return"resize "+t})).style("cursor",(function(t){return Ms[t]})).append("rect").attr("x",(function(t){return/[ew]$/.test(t)?-3:null})).attr("y",(function(t){return/^[ns]/.test(t)?-3:null})).attr("width",6).attr("height",6).style("visibility","hidden"),n.style("display",d.empty()?"none":null);var o,s=t.transition(e),l=t.transition(r);a&&(o=so(a),l.attr("x",o[0]).attr("width",o[1]-o[0]),p(s)),i&&(o=so(i),l.attr("y",o[0]).attr("height",o[1]-o[0]),m(s)),f(s)}))}function f(t){t.selectAll(".resize").attr("transform",(function(t){return"translate("+s[+/e$/.test(t)]+","+l[+/^s/.test(t)]+")"}))}function p(t){t.select(".extent").attr("x",s[0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",s[1]-s[0])}function m(t){t.select(".extent").attr("y",l[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",l[1]-l[0])}function g(){var h,g,y=this,v=t.select(t.event.target),_=n.of(y,arguments),x=t.select(y),b=v.datum(),w=!/^(n|s)$/.test(b)&&a,M=!/^(e|w)$/.test(b)&&i,k=v.classed("extent"),T=yt(y),L=t.mouse(y),A=t.select(o(y)).on("keydown.brush",(function(){32==t.event.keyCode&&(k||(h=null,L[0]-=s[1],L[1]-=l[1],k=2),R())})).on("keyup.brush",(function(){32==t.event.keyCode&&2==k&&(L[0]+=s[1],L[1]+=l[1],k=0,R())}));if(t.event.changedTouches?A.on("touchmove.brush",C).on("touchend.brush",P):A.on("mousemove.brush",C).on("mouseup.brush",P),x.interrupt().selectAll("*").interrupt(),k)L[0]=s[0]-L[0],L[1]=l[0]-L[1];else if(b){var S=+/w$/.test(b),E=+/^n/.test(b);g=[s[1-S]-L[0],l[1-E]-L[1]],L[0]=s[S],L[1]=l[E]}else t.event.altKey&&(h=L.slice());function C(){var e=t.mouse(y),r=!1;g&&(e[0]+=g[0],e[1]+=g[1]),k||(t.event.altKey?(h||(h=[(s[0]+s[1])/2,(l[0]+l[1])/2]),L[0]=s[+(e[0]<h[0])],L[1]=l[+(e[1]<h[1])]):h=null),w&&D(e,a,0)&&(p(x),r=!0),M&&D(e,i,1)&&(m(x),r=!0),r&&(f(x),_({type:"brush",mode:k?"move":"resize"}))}function D(t,n,a){var i,o,d=so(n),f=d[0],p=d[1],m=L[a],g=a?l:s,y=g[1]-g[0];if(k&&(f-=m,p-=y+m),i=(a?c:u)?Math.max(f,Math.min(p,t[a])):t[a],k?o=(i+=m)+y:(h&&(m=Math.max(f,Math.min(p,2*h[a]-i))),m<i?(o=i,i=m):o=m),g[0]!=i||g[1]!=o)return a?r=null:e=null,g[0]=i,g[1]=o,!0}function P(){C(),x.style("pointer-events","all").selectAll(".resize").style("display",d.empty()?"none":null),t.select("body").style("cursor",null),A.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),T(),_({type:"brushend"})}x.style("pointer-events","none").selectAll(".resize").style("display",null),t.select("body").style("cursor",v.style("cursor")),_({type:"brushstart"}),C()}return d.event=function(a){a.each((function(){var a=n.of(this,arguments),i={x:s,y:l,i:e,j:r},o=this.__chart__||i;this.__chart__=i,hs?t.select(this).transition().each("start.brush",(function(){e=o.i,r=o.j,s=o.x,l=o.y,a({type:"brushstart"})})).tween("brush:brush",(function(){var t=qa(s,i.x),n=qa(l,i.y);return e=r=null,function(e){s=i.x=t(e),l=i.y=n(e),a({type:"brush",mode:"resize"})}})).each("end.brush",(function(){e=i.i,r=i.j,a({type:"brush",mode:"resize"}),a({type:"brushend"})})):(a({type:"brushstart"}),a({type:"brush",mode:"resize"}),a({type:"brushend"}))}))},d.x=function(t){return arguments.length?(h=ks[!(a=t)<<1|!i],d):a},d.y=function(t){return arguments.length?(h=ks[!a<<1|!(i=t)],d):i},d.clamp=function(t){return arguments.length?(a&&i?(u=!!t[0],c=!!t[1]):a?u=!!t:i&&(c=!!t),d):a&&i?[u,c]:a?u:i?c:null},d.extent=function(t){var n,o,u,c,h;return arguments.length?(a&&(n=t[0],o=t[1],i&&(n=n[0],o=o[0]),e=[n,o],a.invert&&(n=a(n),o=a(o)),o<n&&(h=n,n=o,o=h),n==s[0]&&o==s[1]||(s=[n,o])),i&&(u=t[0],c=t[1],a&&(u=u[1],c=c[1]),r=[u,c],i.invert&&(u=i(u),c=i(c)),c<u&&(h=u,u=c,c=h),u==l[0]&&c==l[1]||(l=[u,c])),d):(a&&(e?(n=e[0],o=e[1]):(n=s[0],o=s[1],a.invert&&(n=a.invert(n),o=a.invert(o)),o<n&&(h=n,n=o,o=h))),i&&(r?(u=r[0],c=r[1]):(u=l[0],c=l[1],i.invert&&(u=i.invert(u),c=i.invert(c)),c<u&&(h=u,u=c,c=h))),a&&i?[[n,u],[o,c]]:a?[n,o]:i&&[u,c])},d.clear=function(){return d.empty()||(s=[0,0],l=[0,0],e=r=null),d},d.empty=function(){return!!a&&s[0]==s[1]||!!i&&l[0]==l[1]},t.rebind(d,n,"on")};var Ms={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},ks=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Ts=Ce.format=ar.timeFormat,Ls=Ts.utc,As=Ls("%Y-%m-%dT%H:%M:%S.%LZ");function Ss(t){return t.toISOString()}function Es(e,r,n){function a(t){return e(t)}function i(e,n){var a=(e[1]-e[0])/n,i=t.bisect(Ds,a);return i==Ds.length?[r.year,go(e.map((function(t){return t/31536e6})),n)[2]]:i?r[a/Ds[i-1]<Ds[i]/a?i-1:i]:[zs,go(e,n)[2]]}return a.invert=function(t){return Cs(e.invert(t))},a.domain=function(t){return arguments.length?(e.domain(t),a):e.domain().map(Cs)},a.nice=function(t,e){var r=a.domain(),n=oo(r),o=null==t?i(n,10):"number"==typeof t&&i(n,t);function s(r){return!isNaN(r)&&!t.range(r,Cs(+r+1),e).length}return o&&(t=o[0],e=o[1]),a.domain(uo(r,e>1?{floor:function(e){for(;s(e=t.floor(e));)e=Cs(e-1);return e},ceil:function(e){for(;s(e=t.ceil(e));)e=Cs(+e+1);return e}}:t))},a.ticks=function(t,e){var r=oo(a.domain()),n=null==t?i(r,10):"number"==typeof t?i(r,t):!t.range&&[{range:t},e];return n&&(t=n[0],e=n[1]),t.range(r[0],Cs(+r[1]+1),e<1?1:e)},a.tickFormat=function(){return n},a.copy=function(){return Es(e.copy(),r,n)},po(a,e)}function Cs(t){return new Date(t)}Ts.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Ss:As,Ss.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},Ss.toString=As.toString,Ce.second=ze((function(t){return new De(1e3*Math.floor(t/1e3))}),(function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))}),(function(t){return t.getSeconds()})),Ce.seconds=Ce.second.range,Ce.seconds.utc=Ce.second.utc.range,Ce.minute=ze((function(t){return new De(6e4*Math.floor(t/6e4))}),(function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))}),(function(t){return t.getMinutes()})),Ce.minutes=Ce.minute.range,Ce.minutes.utc=Ce.minute.utc.range,Ce.hour=ze((function(t){var e=t.getTimezoneOffset()/60;return new De(36e5*(Math.floor(t/36e5-e)+e))}),(function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))}),(function(t){return t.getHours()})),Ce.hours=Ce.hour.range,Ce.hours.utc=Ce.hour.utc.range,Ce.month=ze((function(t){return(t=Ce.day(t)).setDate(1),t}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t){return t.getMonth()})),Ce.months=Ce.month.range,Ce.months.utc=Ce.month.utc.range;var Ds=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Ps=[[Ce.second,1],[Ce.second,5],[Ce.second,15],[Ce.second,30],[Ce.minute,1],[Ce.minute,5],[Ce.minute,15],[Ce.minute,30],[Ce.hour,1],[Ce.hour,3],[Ce.hour,6],[Ce.hour,12],[Ce.day,1],[Ce.day,2],[Ce.week,1],[Ce.month,1],[Ce.month,3],[Ce.year,1]],Os=Ts.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",Ur]]),zs={range:function(e,r,n){return t.range(Math.ceil(e/n)*n,+r,n).map(Cs)},floor:E,ceil:E};Ps.year=Ce.year,Ce.scale=function(){return Es(t.scale.linear(),Ps,Os)};var Is=Ps.map((function(t){return[t[0].utc,t[1]]})),Rs=Ls.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",Ur]]);function Fs(t){return JSON.parse(t.responseText)}function Ns(t){var e=a.createRange();return e.selectNode(a.body),e.createContextualFragment(t.responseText)}Is.year=Ce.year.utc,Ce.scale.utc=function(){return Es(t.scale.linear(),Is,Rs)},t.text=pe((function(t){return t.responseText})),t.json=function(t,e){return me(t,"application/json",Fs,e)},t.html=function(t,e){return me(t,"text/html",Ns,e)},t.xml=pe((function(t){return t.responseXML})),"object"==typeof e&&e.exports?e.exports=t:this.d3=t}()},{}],164:[function(t,e,r){e.exports=function(){for(var t=0;t<arguments.length;t++)if(void 0!==arguments[t])return arguments[t]}},{}],165:[function(t,e,r){var n=t("incremental-convex-hull"),a=t("uniq");function i(t,e){this.point=t,this.index=e}function o(t,e){for(var r=t.point,n=e.point,a=r.length,i=0;i<a;++i){var o=n[i]-r[i];if(o)return o}return 0}e.exports=function(t,e){var r=t.length;if(0===r)return[];var s=t[0].length;if(s<1)return[];if(1===s)return function(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 a=new Array(t-1),i=1;i<t;++i){var o=n[i-1],s=n[i];a[i-1]=[o[1],s[1]]}return r&&a.push([-1,a[0][1]],[a[t-1][1],-1]),a}(r,t,e);for(var l=new Array(r),u=1,c=0;c<r;++c){for(var h=t[c],d=new Array(s+1),f=0,p=0;p<s;++p){var m=h[p];d[p]=m,f+=m*m}d[s]=f,l[c]=new i(d,c),u=Math.max(f,u)}a(l,o),r=l.length;var g=new Array(r+s+1),y=new Array(r+s+1),v=(s+1)*(s+1)*u,_=new Array(s+1);for(c=0;c<=s;++c)_[c]=0;for(_[s]=v,g[0]=_.slice(),y[0]=-1,c=0;c<=s;++c)(d=_.slice())[c]=1,g[c+1]=d,y[c+1]=-1;for(c=0;c<r;++c){var x=l[c];g[c+s+1]=x.point,y[c+s+1]=x.index}var b=n(g,!1);if(b=e?b.filter((function(t){for(var e=0,r=0;r<=s;++r){var n=y[t[r]];if(n<0&&++e>=2)return!1;t[r]=n}return!0})):b.filter((function(t){for(var e=0;e<=s;++e){var r=y[t[e]];if(r<0)return!1;t[e]=r}return!0})),1&s)for(c=0;c<b.length;++c)d=(x=b[c])[0],x[0]=x[1],x[1]=d;return b}},{"incremental-convex-hull":413,uniq:547}],166:[function(t,e,r){e.exports=i;var n=(i.canvas=document.createElement("canvas")).getContext("2d"),a=o([32,126]);function i(t,e){Array.isArray(t)&&(t=t.join(", "));var r,i={},s=16,l=.05;e&&(2===e.length&&"number"==typeof e[0]?r=o(e):Array.isArray(e)?r=e:(e.o?r=o(e.o):e.pairs&&(r=e.pairs),e.fontSize&&(s=e.fontSize),null!=e.threshold&&(l=e.threshold))),r||(r=a),n.font=s+"px "+t;for(var u=0;u<r.length;u++){var c=r[u],h=n.measureText(c[0]).width+n.measureText(c[1]).width,d=n.measureText(c).width;if(Math.abs(h-d)>s*l){var f=(d-h)/s;i[c]=1e3*f}}return i}function o(t){for(var e=[],r=t[0];r<=t[1];r++)for(var n=String.fromCharCode(r),a=t[0];a<t[1];a++){var i=n+String.fromCharCode(a);e.push(i)}return e}i.createPairs=o,i.ascii=a},{}],167:[function(t,e,r){(function(t){var r=!1;if("undefined"!=typeof Float64Array){var n=new Float64Array(1),a=new Uint32Array(n.buffer);n[0]=1,r=!0,1072693248===a[1]?(e.exports=function(t){return n[0]=t,[a[0],a[1]]},e.exports.pack=function(t,e){return a[0]=t,a[1]=e,n[0]},e.exports.lo=function(t){return n[0]=t,a[0]},e.exports.hi=function(t){return n[0]=t,a[1]}):1072693248===a[0]?(e.exports=function(t){return n[0]=t,[a[1],a[0]]},e.exports.pack=function(t,e){return a[1]=t,a[0]=e,n[0]},e.exports.lo=function(t){return n[0]=t,a[1]},e.exports.hi=function(t){return n[0]=t,a[0]}):r=!1}if(!r){var i=new t(8);e.exports=function(t){return i.writeDoubleLE(t,0,!0),[i.readUInt32LE(0,!0),i.readUInt32LE(4,!0)]},e.exports.pack=function(t,e){return i.writeUInt32LE(t,0,!0),i.writeUInt32LE(e,4,!0),i.readDoubleLE(0,!0)},e.exports.lo=function(t){return i.writeDoubleLE(t,0,!0),i.readUInt32LE(0,!0)},e.exports.hi=function(t){return i.writeDoubleLE(t,0,!0),i.readUInt32LE(4,!0)}}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),a=1048575&n;return 2146435072&n&&(a+=1<<20),[r,a]},e.exports.denormalized=function(t){return!(2146435072&e.exports.hi(t))}}).call(this,t("buffer").Buffer)},{buffer:105}],168:[function(t,e,r){var n=t("abs-svg-path"),a=t("normalize-svg-path"),i={M:"moveTo",C:"bezierCurveTo"};e.exports=function(t,e){t.beginPath(),a(n(e)).forEach((function(e){var r=e[0],n=e.slice(1);t[i[r]].apply(t,n)})),t.closePath()}},{"abs-svg-path":60,"normalize-svg-path":452}],169:[function(t,e,r){e.exports=function(t){switch(t){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}},{}],170:[function(t,e,r){e.exports=function(t,e){switch(void 0===e&&(e=0),typeof t){case"number":if(t>0)return function(t,e){var r,n;for(r=new Array(t),n=0;n<t;++n)r[n]=e;return r}(0|t,e);break;case"object":if("number"==typeof t.length)return function t(e,r,n){var a=0|e[n];if(a<=0)return[];var i,o=new Array(a);if(n===e.length-1)for(i=0;i<a;++i)o[i]=r;else for(i=0;i<a;++i)o[i]=t(e,r,n+1);return o}(t,e,0)}return[]}},{}],171:[function(t,e,r){e.exports=function(t,e){var r=t.length;if("number"!=typeof e){e=0;for(var a=0;a<r;++a){var i=t[a];e=Math.max(e,i[0],i[1])}e=1+(0|e)}e|=0;var o=new Array(e);for(a=0;a<e;++a)o[a]=[];for(a=0;a<r;++a)o[(i=t[a])[0]].push(i[1]),o[i[1]].push(i[0]);for(var s=0;s<e;++s)n(o[s],(function(t,e){return t-e}));return o};var n=t("uniq")},{uniq:547}],172:[function(t,e,r){var n=t("strongly-connected-components");e.exports=function(t){var e,r=[],a=[],i=[],o={},s=[];function l(t){var r,n,c=!1;for(a.push(t),i[t]=!0,r=0;r<s[t].length;r++)(n=s[t][r])===e?(u(e,a),c=!0):i[n]||(c=l(n));if(c)!function t(e){i[e]=!1,o.hasOwnProperty(e)&&Object.keys(o[e]).forEach((function(r){delete o[e][r],i[r]&&t(r)}))}(t);else for(r=0;r<s[t].length;r++){n=s[t][r];var h=o[n];h||(h={},o[n]=h),h[n]=!0}return a.pop(),c}function u(t,e){var n=[].concat(e).concat(t);r.push(n)}function c(e){!function(e){for(var r=0;r<t.length;r++)r<e&&(t[r]=[]),t[r]=t[r].filter((function(t){return t>=e}))}(e);for(var r,a=n(t).components.filter((function(t){return t.length>1})),i=1/0,o=0;o<a.length;o++)for(var s=0;s<a[o].length;s++)a[o][s]<i&&(i=a[o][s],r=o);var l=a[r];return!!l&&{leastVertex:i,adjList:t.map((function(t,e){return-1===l.indexOf(e)?[]:t.filter((function(t){return-1!==l.indexOf(t)}))}))}}e=0;for(var h=t.length;e<h;){var d=c(e);if(e=d.leastVertex,s=d.adjList){for(var f=0;f<s.length;f++)for(var p=0;p<s[f].length;p++){var m=s[f][p];i[+m]=!1,o[m]={}}l(e),e+=1}else e=h}return r}},{"strongly-connected-components":530}],173:[function(t,e,r){var n=t("../../object/valid-value");e.exports=function(){return n(this).length=0,this}},{"../../object/valid-value":205}],174:[function(t,e,r){e.exports=t("./is-implemented")()?Array.from:t("./shim")},{"./is-implemented":175,"./shim":176}],175:[function(t,e,r){e.exports=function(){var t,e,r=Array.from;return"function"==typeof r&&(e=r(t=["raz","dwa"]),Boolean(e&&e!==t&&"dwa"===e[1]))}},{}],176:[function(t,e,r){var n=t("es6-symbol").iterator,a=t("../../function/is-arguments"),i=t("../../function/is-function"),o=t("../../number/to-pos-integer"),s=t("../../object/valid-callable"),l=t("../../object/valid-value"),u=t("../../object/is-value"),c=t("../../string/is-string"),h=Array.isArray,d=Function.prototype.call,f={configurable:!0,enumerable:!0,writable:!0,value:null},p=Object.defineProperty;e.exports=function(t){var e,r,m,g,y,v,_,x,b,w,M=arguments[1],k=arguments[2];if(t=Object(l(t)),u(M)&&s(M),this&&this!==Array&&i(this))e=this;else{if(!M){if(a(t))return 1!==(y=t.length)?Array.apply(null,t):((g=new Array(1))[0]=t[0],g);if(h(t)){for(g=new Array(y=t.length),r=0;r<y;++r)g[r]=t[r];return g}}g=[]}if(!h(t))if(void 0!==(b=t[n])){for(_=s(b).call(t),e&&(g=new e),x=_.next(),r=0;!x.done;)w=M?d.call(M,k,x.value,r):x.value,e?(f.value=w,p(g,r,f)):g[r]=w,x=_.next(),++r;y=r}else if(c(t)){for(y=t.length,e&&(g=new e),r=0,m=0;r<y;++r)w=t[r],r+1<y&&(v=w.charCodeAt(0))>=55296&&v<=56319&&(w+=t[++r]),w=M?d.call(M,k,w,m):w,e?(f.value=w,p(g,m,f)):g[m]=w,++m;y=m}if(void 0===y)for(y=o(t.length),e&&(g=new e(y)),r=0;r<y;++r)w=M?d.call(M,k,t[r],r):t[r],e?(f.value=w,p(g,r,f)):g[r]=w;return e&&(f.value=null,g.length=y),g}},{"../../function/is-arguments":177,"../../function/is-function":178,"../../number/to-pos-integer":184,"../../object/is-value":194,"../../object/valid-callable":203,"../../object/valid-value":205,"../../string/is-string":209,"es6-symbol":219}],177:[function(t,e,r){var n=Object.prototype.toString,a=n.call(function(){return arguments}());e.exports=function(t){return n.call(t)===a}},{}],178:[function(t,e,r){var n=Object.prototype.toString,a=n.call(t("./noop"));e.exports=function(t){return"function"==typeof t&&n.call(t)===a}},{"./noop":179}],179:[function(t,e,r){e.exports=function(){}},{}],180:[function(t,e,r){e.exports=t("./is-implemented")()?Math.sign:t("./shim")},{"./is-implemented":181,"./shim":182}],181:[function(t,e,r){e.exports=function(){var t=Math.sign;return"function"==typeof t&&1===t(10)&&-1===t(-20)}},{}],182:[function(t,e,r){e.exports=function(t){return t=Number(t),isNaN(t)||0===t?t:t>0?1:-1}},{}],183:[function(t,e,r){var n=t("../math/sign"),a=Math.abs,i=Math.floor;e.exports=function(t){return isNaN(t)?0:0!==(t=Number(t))&&isFinite(t)?n(t)*i(a(t)):t}},{"../math/sign":180}],184:[function(t,e,r){var n=t("./to-integer"),a=Math.max;e.exports=function(t){return a(0,n(t))}},{"./to-integer":183}],185:[function(t,e,r){var n=t("./valid-callable"),a=t("./valid-value"),i=Function.prototype.bind,o=Function.prototype.call,s=Object.keys,l=Object.prototype.propertyIsEnumerable;e.exports=function(t,e){return function(r,u){var c,h=arguments[2],d=arguments[3];return r=Object(a(r)),n(u),c=s(r),d&&c.sort("function"==typeof d?i.call(d,r):void 0),"function"!=typeof t&&(t=c[t]),o.call(t,c,(function(t,n){return l.call(r,t)?o.call(u,h,r[t],t,r,n):e}))}}},{"./valid-callable":203,"./valid-value":205}],186:[function(t,e,r){e.exports=t("./is-implemented")()?Object.assign:t("./shim")},{"./is-implemented":187,"./shim":188}],187:[function(t,e,r){e.exports=function(){var t,e=Object.assign;return"function"==typeof e&&(e(t={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},{}],188:[function(t,e,r){var n=t("../keys"),a=t("../valid-value"),i=Math.max;e.exports=function(t,e){var r,o,s,l=i(arguments.length,2);for(t=Object(a(t)),s=function(n){try{t[n]=e[n]}catch(t){r||(r=t)}},o=1;o<l;++o)n(e=arguments[o]).forEach(s);if(void 0!==r)throw r;return t}},{"../keys":195,"../valid-value":205}],189:[function(t,e,r){var n=t("../array/from"),a=t("./assign"),i=t("./valid-value");e.exports=function(t){var e=Object(i(t)),r=arguments[1],o=Object(arguments[2]);if(e!==t&&!r)return e;var s={};return r?n(r,(function(e){(o.ensure||e in t)&&(s[e]=t[e])})):a(s,t),s}},{"../array/from":174,"./assign":186,"./valid-value":205}],190:[function(t,e,r){var n,a,i,o,s=Object.create;t("./set-prototype-of/is-implemented")()||(n=t("./set-prototype-of/shim")),e.exports=n?1!==n.level?s:(a={},i={},o={configurable:!1,enumerable:!1,writable:!0,value:void 0},Object.getOwnPropertyNames(Object.prototype).forEach((function(t){i[t]="__proto__"!==t?o:{configurable:!0,enumerable:!1,writable:!0,value:void 0}})),Object.defineProperties(a,i),Object.defineProperty(n,"nullPolyfill",{configurable:!1,enumerable:!1,writable:!1,value:a}),function(t,e){return s(null===t?a:t,e)}):s},{"./set-prototype-of/is-implemented":201,"./set-prototype-of/shim":202}],191:[function(t,e,r){e.exports=t("./_iterate")("forEach")},{"./_iterate":185}],192:[function(t,e,r){e.exports=function(t){return"function"==typeof t}},{}],193:[function(t,e,r){var n=t("./is-value"),a={function:!0,object:!0};e.exports=function(t){return n(t)&&a[typeof t]||!1}},{"./is-value":194}],194:[function(t,e,r){var n=t("../function/noop")();e.exports=function(t){return t!==n&&null!==t}},{"../function/noop":179}],195:[function(t,e,r){e.exports=t("./is-implemented")()?Object.keys:t("./shim")},{"./is-implemented":196,"./shim":197}],196:[function(t,e,r){e.exports=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}},{}],197:[function(t,e,r){var n=t("../is-value"),a=Object.keys;e.exports=function(t){return a(n(t)?Object(t):t)}},{"../is-value":194}],198:[function(t,e,r){var n=t("./valid-callable"),a=t("./for-each"),i=Function.prototype.call;e.exports=function(t,e){var r={},o=arguments[2];return n(e),a(t,(function(t,n,a,s){r[n]=i.call(e,o,t,n,a,s)})),r}},{"./for-each":191,"./valid-callable":203}],199:[function(t,e,r){var n=t("./is-value"),a=Array.prototype.forEach,i=Object.create;e.exports=function(t){var e=i(null);return a.call(arguments,(function(t){n(t)&&function(t,e){var r;for(r in t)e[r]=t[r]}(Object(t),e)})),e}},{"./is-value":194}],200:[function(t,e,r){e.exports=t("./is-implemented")()?Object.setPrototypeOf:t("./shim")},{"./is-implemented":201,"./shim":202}],201:[function(t,e,r){var n=Object.create,a=Object.getPrototypeOf,i={};e.exports=function(){var t=Object.setPrototypeOf;return"function"==typeof t&&a(t((arguments[0]||n)(null),i))===i}},{}],202:[function(t,e,r){var n,a,i,o,s=t("../is-object"),l=t("../valid-value"),u=Object.prototype.isPrototypeOf,c=Object.defineProperty,h={configurable:!0,enumerable:!1,writable:!0,value:void 0};n=function(t,e){if(l(t),null===e||s(e))return t;throw new TypeError("Prototype must be null or an object")},e.exports=(a=function(){var t,e=Object.create(null),r={},n=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__");if(n){try{(t=n.set).call(e,r)}catch(t){}if(Object.getPrototypeOf(e)===r)return{set:t,level:2}}return e.__proto__=r,Object.getPrototypeOf(e)===r?{level:2}:((e={}).__proto__=r,Object.getPrototypeOf(e)===r&&{level:1})}())?(2===a.level?a.set?(o=a.set,i=function(t,e){return o.call(n(t,e),e),t}):i=function(t,e){return n(t,e).__proto__=e,t}:i=function t(e,r){var a;return n(e,r),(a=u.call(t.nullPolyfill,e))&&delete t.nullPolyfill.__proto__,null===r&&(r=t.nullPolyfill),e.__proto__=r,a&&c(t.nullPolyfill,"__proto__",h),e},Object.defineProperty(i,"level",{configurable:!1,enumerable:!1,writable:!1,value:a.level})):null,t("../create")},{"../create":190,"../is-object":193,"../valid-value":205}],203:[function(t,e,r){e.exports=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}},{}],204:[function(t,e,r){var n=t("./is-object");e.exports=function(t){if(!n(t))throw new TypeError(t+" is not an Object");return t}},{"./is-object":193}],205:[function(t,e,r){var n=t("./is-value");e.exports=function(t){if(!n(t))throw new TypeError("Cannot use null or undefined");return t}},{"./is-value":194}],206:[function(t,e,r){e.exports=t("./is-implemented")()?String.prototype.contains:t("./shim")},{"./is-implemented":207,"./shim":208}],207:[function(t,e,r){var n="razdwatrzy";e.exports=function(){return"function"==typeof n.contains&&!0===n.contains("dwa")&&!1===n.contains("foo")}},{}],208:[function(t,e,r){var n=String.prototype.indexOf;e.exports=function(t){return n.call(this,t,arguments[1])>-1}},{}],209:[function(t,e,r){var n=Object.prototype.toString,a=n.call("");e.exports=function(t){return"string"==typeof t||t&&"object"==typeof t&&(t instanceof String||n.call(t)===a)||!1}},{}],210:[function(t,e,r){var n=Object.create(null),a=Math.random;e.exports=function(){var t;do{t=a().toString(36).slice(2)}while(n[t]);return t}},{}],211:[function(t,e,r){var n,a=t("es5-ext/object/set-prototype-of"),i=t("es5-ext/string/#/contains"),o=t("d"),s=t("es6-symbol"),l=t("./"),u=Object.defineProperty;n=e.exports=function(t,e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");l.call(this,t),e=e?i.call(e,"key+value")?"key+value":i.call(e,"key")?"key":"value":"value",u(this,"__kind__",o("",e))},a&&a(n,l),delete n.prototype.constructor,n.prototype=Object.create(l.prototype,{_resolve:o((function(t){return"value"===this.__kind__?this.__list__[t]:"key+value"===this.__kind__?[t,this.__list__[t]]:t}))}),u(n.prototype,s.toStringTag,o("c","Array Iterator"))},{"./":214,d:151,"es5-ext/object/set-prototype-of":200,"es5-ext/string/#/contains":206,"es6-symbol":219}],212:[function(t,e,r){var n=t("es5-ext/function/is-arguments"),a=t("es5-ext/object/valid-callable"),i=t("es5-ext/string/is-string"),o=t("./get"),s=Array.isArray,l=Function.prototype.call,u=Array.prototype.some;e.exports=function(t,e){var r,c,h,d,f,p,m,g,y=arguments[2];if(s(t)||n(t)?r="array":i(t)?r="string":t=o(t),a(e),h=function(){d=!0},"array"!==r)if("string"!==r)for(c=t.next();!c.done;){if(l.call(e,y,c.value,h),d)return;c=t.next()}else for(p=t.length,f=0;f<p&&(m=t[f],f+1<p&&(g=m.charCodeAt(0))>=55296&&g<=56319&&(m+=t[++f]),l.call(e,y,m,h),!d);++f);else u.call(t,(function(t){return l.call(e,y,t,h),d}))}},{"./get":213,"es5-ext/function/is-arguments":177,"es5-ext/object/valid-callable":203,"es5-ext/string/is-string":209}],213:[function(t,e,r){var n=t("es5-ext/function/is-arguments"),a=t("es5-ext/string/is-string"),i=t("./array"),o=t("./string"),s=t("./valid-iterable"),l=t("es6-symbol").iterator;e.exports=function(t){return"function"==typeof s(t)[l]?t[l]():n(t)?new i(t):a(t)?new o(t):new i(t)}},{"./array":211,"./string":216,"./valid-iterable":217,"es5-ext/function/is-arguments":177,"es5-ext/string/is-string":209,"es6-symbol":219}],214:[function(t,e,r){var n,a=t("es5-ext/array/#/clear"),i=t("es5-ext/object/assign"),o=t("es5-ext/object/valid-callable"),s=t("es5-ext/object/valid-value"),l=t("d"),u=t("d/auto-bind"),c=t("es6-symbol"),h=Object.defineProperty,d=Object.defineProperties;e.exports=n=function(t,e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");d(this,{__list__:l("w",s(t)),__context__:l("w",e),__nextIndex__:l("w",0)}),e&&(o(e.on),e.on("_add",this._onAdd),e.on("_delete",this._onDelete),e.on("_clear",this._onClear))},delete n.prototype.constructor,d(n.prototype,i({_next:l((function(){var t;if(this.__list__)return this.__redo__&&void 0!==(t=this.__redo__.shift())?t:this.__nextIndex__<this.__list__.length?this.__nextIndex__++:void this._unBind()})),next:l((function(){return this._createResult(this._next())})),_createResult:l((function(t){return void 0===t?{done:!0,value:void 0}:{done:!1,value:this._resolve(t)}})),_resolve:l((function(t){return this.__list__[t]})),_unBind:l((function(){this.__list__=null,delete this.__redo__,this.__context__&&(this.__context__.off("_add",this._onAdd),this.__context__.off("_delete",this._onDelete),this.__context__.off("_clear",this._onClear),this.__context__=null)})),toString:l((function(){return"[object "+(this[c.toStringTag]||"Object")+"]"}))},u({_onAdd:l((function(t){t>=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach((function(e,r){e>=t&&(this.__redo__[r]=++e)}),this),this.__redo__.push(t)):h(this,"__redo__",l("c",[t])))})),_onDelete:l((function(t){var e;t>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(e=this.__redo__.indexOf(t))&&this.__redo__.splice(e,1),this.__redo__.forEach((function(e,r){e>t&&(this.__redo__[r]=--e)}),this)))})),_onClear:l((function(){this.__redo__&&a.call(this.__redo__),this.__nextIndex__=0}))}))),h(n.prototype,c.iterator,l((function(){return this})))},{d:151,"d/auto-bind":150,"es5-ext/array/#/clear":173,"es5-ext/object/assign":186,"es5-ext/object/valid-callable":203,"es5-ext/object/valid-value":205,"es6-symbol":219}],215:[function(t,e,r){var n=t("es5-ext/function/is-arguments"),a=t("es5-ext/object/is-value"),i=t("es5-ext/string/is-string"),o=t("es6-symbol").iterator,s=Array.isArray;e.exports=function(t){return!(!a(t)||!s(t)&&!i(t)&&!n(t)&&"function"!=typeof t[o])}},{"es5-ext/function/is-arguments":177,"es5-ext/object/is-value":194,"es5-ext/string/is-string":209,"es6-symbol":219}],216:[function(t,e,r){var n,a=t("es5-ext/object/set-prototype-of"),i=t("d"),o=t("es6-symbol"),s=t("./"),l=Object.defineProperty;n=e.exports=function(t){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");t=String(t),s.call(this,t),l(this,"__length__",i("",t.length))},a&&a(n,s),delete n.prototype.constructor,n.prototype=Object.create(s.prototype,{_next:i((function(){if(this.__list__)return this.__nextIndex__<this.__length__?this.__nextIndex__++:void this._unBind()})),_resolve:i((function(t){var e,r=this.__list__[t];return this.__nextIndex__===this.__length__?r:(e=r.charCodeAt(0))>=55296&&e<=56319?r+this.__list__[this.__nextIndex__++]:r}))}),l(n.prototype,o.toStringTag,i("c","String Iterator"))},{"./":214,d:151,"es5-ext/object/set-prototype-of":200,"es6-symbol":219}],217:[function(t,e,r){var n=t("./is-iterable");e.exports=function(t){if(!n(t))throw new TypeError(t+" is not iterable");return t}},{"./is-iterable":215}],218:[function(t,e,n){(function(r,a){!function(t,r){"object"==typeof n&&void 0!==e?e.exports=r():t.ES6Promise=r()}(this,(function(){function e(t){return"function"==typeof t}var n=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},i=0,o=void 0,s=void 0,l=function(t,e){m[i]=t,m[i+1]=e,2===(i+=2)&&(s?s(g):b())},u="undefined"!=typeof window?window:void 0,c=u||{},h=c.MutationObserver||c.WebKitMutationObserver,d="undefined"==typeof self&&void 0!==r&&"[object process]"==={}.toString.call(r),f="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function p(){var t=setTimeout;return function(){return t(g,1)}}var m=new Array(1e3);function g(){for(var t=0;t<i;t+=2)(0,m[t])(m[t+1]),m[t]=void 0,m[t+1]=void 0;i=0}var y,v,_,x,b=void 0;function w(t,e){var r=arguments,n=this,a=new this.constructor(T);void 0===a[k]&&j(a);var i,o=n._state;return o?(i=r[o-1],l((function(){return N(o,a,i,n._result)}))):z(n,a,t,e),a}function M(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(T);return C(e,t),e}d?b=function(){return r.nextTick(g)}:h?(v=0,_=new h(g),x=document.createTextNode(""),_.observe(x,{characterData:!0}),b=function(){x.data=v=++v%2}):f?((y=new MessageChannel).port1.onmessage=g,b=function(){return y.port2.postMessage(0)}):b=void 0===u&&"function"==typeof t?function(){try{var e=t("vertx");return o=e.runOnLoop||e.runOnContext,function(){o(g)}}catch(t){return p()}}():p();var k=Math.random().toString(36).substring(16);function T(){}var L=void 0,A=new R;function S(t){try{return t.then}catch(t){return A.error=t,A}}function E(t,r,n){r.constructor===t.constructor&&n===w&&r.constructor.resolve===M?function(t,e){1===e._state?P(t,e._result):2===e._state?O(t,e._result):z(e,void 0,(function(e){return C(t,e)}),(function(e){return O(t,e)}))}(t,r):n===A?O(t,A.error):void 0===n?P(t,r):e(n)?function(t,e,r){l((function(t){var n=!1,a=function(t,e,r,n){try{t.call(e,r,n)}catch(t){return t}}(r,e,(function(r){n||(n=!0,e!==r?C(t,r):P(t,r))}),(function(e){n||(n=!0,O(t,e))}),t._label);!n&&a&&(n=!0,O(t,a))}),t)}(t,r,n):P(t,r)}function C(t,e){var r;t===e?O(t,new TypeError("You cannot resolve a promise with itself")):"function"==typeof(r=e)||"object"==typeof r&&null!==r?E(t,e,S(e)):P(t,e)}function D(t){t._onerror&&t._onerror(t._result),I(t)}function P(t,e){t._state===L&&(t._result=e,t._state=1,0!==t._subscribers.length&&l(I,t))}function O(t,e){t._state===L&&(t._state=2,t._result=e,l(D,t))}function z(t,e,r,n){var a=t._subscribers,i=a.length;t._onerror=null,a[i]=e,a[i+1]=r,a[i+2]=n,0===i&&t._state&&l(I,t)}function I(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n=void 0,a=void 0,i=t._result,o=0;o<e.length;o+=3)n=e[o],a=e[o+r],n?N(r,n,a,i):a(i);t._subscribers.length=0}}function R(){this.error=null}var F=new R;function N(t,r,n,a){var i=e(n),o=void 0,s=void 0,l=void 0,u=void 0;if(i){if((o=function(t,e){try{return t(e)}catch(t){return F.error=t,F}}(n,a))===F?(u=!0,s=o.error,o=null):l=!0,r===o)return void O(r,new TypeError("A promises callback cannot return that same promise."))}else o=a,l=!0;r._state!==L||(i&&l?C(r,o):u?O(r,s):1===t?P(r,o):2===t&&O(r,o))}var Y=0;function j(t){t[k]=Y++,t._state=void 0,t._result=void 0,t._subscribers=[]}function B(t,e){this._instanceConstructor=t,this.promise=new t(T),this.promise[k]||j(this.promise),n(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?P(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&P(this.promise,this._result))):O(this.promise,new Error("Array Methods must be provided an Array"))}function H(t){this[k]=Y++,this._result=this._state=void 0,this._subscribers=[],T!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof H?function(t,e){try{e((function(e){C(t,e)}),(function(e){O(t,e)}))}catch(e){O(t,e)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}function U(){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=H}return B.prototype._enumerate=function(){for(var t=this.length,e=this._input,r=0;this._state===L&&r<t;r++)this._eachEntry(e[r],r)},B.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===M){var a=S(t);if(a===w&&t._state!==L)this._settledAt(t._state,e,t._result);else if("function"!=typeof a)this._remaining--,this._result[e]=t;else if(r===H){var i=new r(T);E(i,t,a),this._willSettleAt(i,e)}else this._willSettleAt(new r((function(e){return e(t)})),e)}else this._willSettleAt(n(t),e)},B.prototype._settledAt=function(t,e,r){var n=this.promise;n._state===L&&(this._remaining--,2===t?O(n,r):this._result[e]=r),0===this._remaining&&P(n,this._result)},B.prototype._willSettleAt=function(t,e){var r=this;z(t,void 0,(function(t){return r._settledAt(1,e,t)}),(function(t){return r._settledAt(2,e,t)}))},H.all=function(t){return new B(this,t).promise},H.race=function(t){var e=this;return n(t)?new e((function(r,n){for(var a=t.length,i=0;i<a;i++)e.resolve(t[i]).then(r,n)})):new e((function(t,e){return e(new TypeError("You must pass an array to race."))}))},H.resolve=M,H.reject=function(t){var e=new this(T);return O(e,t),e},H._setScheduler=function(t){s=t},H._setAsap=function(t){l=t},H._asap=l,H.prototype={constructor:H,then:w,catch:function(t){return this.then(null,t)}},U(),H.polyfill=U,H.Promise=H,H}))}).call(this,t("_process"),void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:482}],219:[function(t,e,r){e.exports=t("./is-implemented")()?Symbol:t("./polyfill")},{"./is-implemented":220,"./polyfill":222}],220:[function(t,e,r){var n={object:!0,symbol:!0};e.exports=function(){var t;if("function"!=typeof Symbol)return!1;t=Symbol("test symbol");try{String(t)}catch(t){return!1}return!!n[typeof Symbol.iterator]&&!!n[typeof Symbol.toPrimitive]&&!!n[typeof Symbol.toStringTag]}},{}],221:[function(t,e,r){e.exports=function(t){return!!t&&("symbol"==typeof t||!!t.constructor&&"Symbol"===t.constructor.name&&"Symbol"===t[t.constructor.toStringTag])}},{}],222:[function(t,e,r){var n,a,i,o,s=t("d"),l=t("./validate-symbol"),u=Object.create,c=Object.defineProperties,h=Object.defineProperty,d=Object.prototype,f=u(null);if("function"==typeof Symbol){n=Symbol;try{String(n()),o=!0}catch(t){}}var p,m=(p=u(null),function(t){for(var e,r,n=0;p[t+(n||"")];)++n;return p[t+=n||""]=!0,h(d,e="@@"+t,s.gs(null,(function(t){r||(r=!0,h(this,e,s(t)),r=!1)}))),e});i=function(t){if(this instanceof i)throw new TypeError("Symbol is not a constructor");return a(t)},e.exports=a=function t(e){var r;if(this instanceof t)throw new TypeError("Symbol is not a constructor");return o?n(e):(r=u(i.prototype),e=void 0===e?"":String(e),c(r,{__description__:s("",e),__name__:s("",m(e))}))},c(a,{for:s((function(t){return f[t]?f[t]:f[t]=a(String(t))})),keyFor:s((function(t){var e;for(e in l(t),f)if(f[e]===t)return e})),hasInstance:s("",n&&n.hasInstance||a("hasInstance")),isConcatSpreadable:s("",n&&n.isConcatSpreadable||a("isConcatSpreadable")),iterator:s("",n&&n.iterator||a("iterator")),match:s("",n&&n.match||a("match")),replace:s("",n&&n.replace||a("replace")),search:s("",n&&n.search||a("search")),species:s("",n&&n.species||a("species")),split:s("",n&&n.split||a("split")),toPrimitive:s("",n&&n.toPrimitive||a("toPrimitive")),toStringTag:s("",n&&n.toStringTag||a("toStringTag")),unscopables:s("",n&&n.unscopables||a("unscopables"))}),c(i.prototype,{constructor:s(a),toString:s("",(function(){return this.__name__}))}),c(a.prototype,{toString:s((function(){return"Symbol ("+l(this).__description__+")"})),valueOf:s((function(){return l(this)}))}),h(a.prototype,a.toPrimitive,s("",(function(){var t=l(this);return"symbol"==typeof t?t:t.toString()}))),h(a.prototype,a.toStringTag,s("c","Symbol")),h(i.prototype,a.toStringTag,s("c",a.prototype[a.toStringTag])),h(i.prototype,a.toPrimitive,s("c",a.prototype[a.toPrimitive]))},{"./validate-symbol":223,d:151}],223:[function(t,e,r){var n=t("./is-symbol");e.exports=function(t){if(!n(t))throw new TypeError(t+" is not a symbol");return t}},{"./is-symbol":221}],224:[function(t,e,r){e.exports=function(t,e,r){var n=e||0,a=r||1;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]],[a*t[12]-t[8],a*t[13]-t[9],a*t[14]-t[10],a*t[15]-t[11]]]}},{}],225:[function(t,e,r){var n=t("is-string-blank");e.exports=function(t){var e=typeof t;if("string"===e){var r=t;if(0==(t=+t)&&n(r))return!1}else if("number"!==e)return!1;return t-t<1}},{"is-string-blank":423}],226:[function(t,e,r){e.exports=function(t,e,r){switch(arguments.length){case 0:return new o([0],[0],0);case 1:return"number"==typeof t?new o(n=l(t),n,0):new o(t,l(t.length),0);case 2:var n;if("number"==typeof e)return new o(t,n=l(t.length),+e);r=0;case 3:if(t.length!==e.length)throw new Error("state and velocity lengths must match");return new o(t,e,r)}};var n=t("cubic-hermite"),a=t("binary-search-bounds");function i(t,e,r){return Math.min(e,Math.max(t,r))}function o(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()]}var s=o.prototype;function l(t){for(var e=new Array(t),r=0;r<t;++r)e[r]=0;return e}s.flush=function(t){var e=a.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))},s.curve=function(t){var e=this._time,r=e.length,o=a.le(e,t),s=this._scratch[0],l=this._state,u=this._velocity,c=this.dimension,h=this.bounds;if(o<0)for(var d=c-1,f=0;f<c;++f,--d)s[f]=l[d];else if(o>=r-1){d=l.length-1;var p=t-e[r-1];for(f=0;f<c;++f,--d)s[f]=l[d]+p*u[d]}else{d=c*(o+1)-1;var m=e[o],g=e[o+1]-m||1,y=this._scratch[1],v=this._scratch[2],_=this._scratch[3],x=this._scratch[4],b=!0;for(f=0;f<c;++f,--d)y[f]=l[d],_[f]=u[d]*g,v[f]=l[d+c],x[f]=u[d+c]*g,b=b&&y[f]===v[f]&&_[f]===x[f]&&0===_[f];if(b)for(f=0;f<c;++f)s[f]=y[f];else n(y,_,v,x,(t-m)/g,s)}var w=h[0],M=h[1];for(f=0;f<c;++f)s[f]=i(w[f],M[f],s[f]);return s},s.dcurve=function(t){var e=this._time,r=e.length,i=a.le(e,t),o=this._scratch[0],s=this._state,l=this._velocity,u=this.dimension;if(i>=r-1)for(var c=s.length-1,h=(e[r-1],0);h<u;++h,--c)o[h]=l[c];else{c=u*(i+1)-1;var d=e[i],f=e[i+1]-d||1,p=this._scratch[1],m=this._scratch[2],g=this._scratch[3],y=this._scratch[4],v=!0;for(h=0;h<u;++h,--c)p[h]=s[c],g[h]=l[c]*f,m[h]=s[c+u],y[h]=l[c+u]*f,v=v&&p[h]===m[h]&&g[h]===y[h]&&0===g[h];if(v)for(h=0;h<u;++h)o[h]=0;else for(n.derivative(p,g,m,y,(t-d)/f,o),h=0;h<u;++h)o[h]/=f}return o},s.lastT=function(){var t=this._time;return t[t.length-1]},s.stable=function(){for(var t=this._velocity,e=t.length,r=this.dimension-1;r>=0;--r)if(t[--e])return!1;return!0},s.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(t<e||arguments.length!==r+1)){var n=this._state,a=this._velocity,o=n.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)n.push(n[o++]),a.push(0);for(this._time.push(t),h=r;h>0;--h)n.push(i(l[h-1],u[h-1],arguments[h])),a.push(0)}},s.push=function(t){var e=this.lastT(),r=this.dimension;if(!(t<e||arguments.length!==r+1)){var n=this._state,a=this._velocity,o=n.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 d=r;d>0;--d){var f=i(u[d-1],c[d-1],arguments[d]);n.push(f),a.push((f-n[o++])*h)}}},s.set=function(t){var e=this.dimension;if(!(t<this.lastT()||arguments.length!==e+1)){var r=this._state,n=this._velocity,a=this.bounds,o=a[0],s=a[1];this._time.push(t);for(var l=e;l>0;--l)r.push(i(o[l-1],s[l-1],arguments[l])),n.push(0)}},s.move=function(t){var e=this.lastT(),r=this.dimension;if(!(t<=e||arguments.length!==r+1)){var n=this._state,a=this._velocity,o=n.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 d=r;d>0;--d){var f=arguments[d];n.push(i(l[d-1],u[d-1],n[o++]+f)),a.push(f*h)}}},s.idle=function(t){var e=this.lastT();if(!(t<e)){var r=this.dimension,n=this._state,a=this._velocity,o=n.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)n.push(i(l[h],u[h],n[o]+c*a[o])),a.push(0),o+=1}}},{"binary-search-bounds":91,"cubic-hermite":145}],227:[function(t,e,r){var n=t("dtype");e.exports=function(t,e,r){if(!t)throw new TypeError("must specify data as first parameter");if(r=0|+(r||0),Array.isArray(t)&&t[0]&&"number"==typeof t[0][0]){var a,i,o,s,l=t[0].length,u=t.length*l;e&&"string"!=typeof e||(e=new(n(e||"float32"))(u+r));var c=e.length-r;if(u!==c)throw new Error("source length "+u+" ("+l+"x"+t.length+") does not match destination length "+c);for(a=0,o=r;a<t.length;a++)for(i=0;i<l;i++)e[o++]=null===t[a][i]?NaN:t[a][i]}else if(e&&"string"!=typeof e)e.set(t,r);else{var h=n(e||"float32");if(Array.isArray(t)||"array"===e)for(a=0,o=r,s=(e=new h(t.length+r)).length;o<s;o++,a++)e[o]=null===t[a]?NaN:t[a];else 0===r?e=new h(t):(e=new h(t.length+r)).set(t,r)}return e}},{dtype:169}],228:[function(t,e,r){var n=t("css-font/stringify"),a=[32,126];e.exports=function(t){var e=(t=t||{}).shape?t.shape:t.canvas?[t.canvas.width,t.canvas.height]:[512,512],r=t.canvas||document.createElement("canvas"),i=t.font,o="number"==typeof t.step?[t.step,t.step]:t.step||[32,32],s=t.chars||a;if(i&&"string"!=typeof i&&(i=n(i)),Array.isArray(s)){if(2===s.length&&"number"==typeof s[0]&&"number"==typeof s[1]){for(var l=[],u=s[0],c=0;u<=s[1];u++)l[c++]=String.fromCharCode(u);s=l}}else s=String(s).split("");e=e.slice(),r.width=e[0],r.height=e[1];var h=r.getContext("2d");h.fillStyle="#000",h.fillRect(0,0,r.width,r.height),h.font=i,h.textAlign="center",h.textBaseline="middle",h.fillStyle="#fff";var d=o[0]/2,f=o[1]/2;for(u=0;u<s.length;u++)h.fillText(s[u],d,f),(d+=o[0])>e[0]-o[0]/2&&(d=o[0]/2,f+=o[1]);return r}},{"css-font/stringify":142}],229:[function(t,e,r){function n(t,e){e||(e={}),("string"==typeof t||Array.isArray(t))&&(e.family=t);var r=Array.isArray(e.family)?e.family.join(", "):e.family;if(!r)throw Error("`family` must be defined");var s=e.size||e.fontSize||e.em||48,l=e.weight||e.fontWeight||"",u=(t=[e.style||e.fontStyle||"",l,s].join(" ")+"px "+r,e.origin||"top");if(n.cache[r]&&s<=n.cache[r].em)return a(n.cache[r],u);var c=e.canvas||n.canvas,h=c.getContext("2d"),d={upper:void 0!==e.upper?e.upper:"H",lower:void 0!==e.lower?e.lower:"x",descent:void 0!==e.descent?e.descent:"p",ascent:void 0!==e.ascent?e.ascent:"h",tittle:void 0!==e.tittle?e.tittle:"i",overshoot:void 0!==e.overshoot?e.overshoot:"O"},f=Math.ceil(1.5*s);c.height=f,c.width=.5*f,h.font=t;var p={top:0};h.clearRect(0,0,f,f),h.textBaseline="top",h.fillStyle="black",h.fillText("H",0,0);var m=i(h.getImageData(0,0,f,f));h.clearRect(0,0,f,f),h.textBaseline="bottom",h.fillText("H",0,f);var g=i(h.getImageData(0,0,f,f));p.lineHeight=p.bottom=f-g+m,h.clearRect(0,0,f,f),h.textBaseline="alphabetic",h.fillText("H",0,f);var y=f-i(h.getImageData(0,0,f,f))-1+m;p.baseline=p.alphabetic=y,h.clearRect(0,0,f,f),h.textBaseline="middle",h.fillText("H",0,.5*f);var v=i(h.getImageData(0,0,f,f));p.median=p.middle=f-v-1+m-.5*f,h.clearRect(0,0,f,f),h.textBaseline="hanging",h.fillText("H",0,.5*f);var _=i(h.getImageData(0,0,f,f));p.hanging=f-_-1+m-.5*f,h.clearRect(0,0,f,f),h.textBaseline="ideographic",h.fillText("H",0,f);var x=i(h.getImageData(0,0,f,f));if(p.ideographic=f-x-1+m,d.upper&&(h.clearRect(0,0,f,f),h.textBaseline="top",h.fillText(d.upper,0,0),p.upper=i(h.getImageData(0,0,f,f)),p.capHeight=p.baseline-p.upper),d.lower&&(h.clearRect(0,0,f,f),h.textBaseline="top",h.fillText(d.lower,0,0),p.lower=i(h.getImageData(0,0,f,f)),p.xHeight=p.baseline-p.lower),d.tittle&&(h.clearRect(0,0,f,f),h.textBaseline="top",h.fillText(d.tittle,0,0),p.tittle=i(h.getImageData(0,0,f,f))),d.ascent&&(h.clearRect(0,0,f,f),h.textBaseline="top",h.fillText(d.ascent,0,0),p.ascent=i(h.getImageData(0,0,f,f))),d.descent&&(h.clearRect(0,0,f,f),h.textBaseline="top",h.fillText(d.descent,0,0),p.descent=o(h.getImageData(0,0,f,f))),d.overshoot){h.clearRect(0,0,f,f),h.textBaseline="top",h.fillText(d.overshoot,0,0);var b=o(h.getImageData(0,0,f,f));p.overshoot=b-y}for(var w in p)p[w]/=s;return p.em=s,n.cache[r]=p,a(p,u)}function a(t,e){var r={};for(var n in"string"==typeof e&&(e=t[e]),t)"em"!==n&&(r[n]=t[n]-e);return r}function i(t){for(var e=t.height,r=t.data,n=3;n<r.length;n+=4)if(0!==r[n])return Math.floor(.25*(n-3)/e)}function o(t){for(var e=t.height,r=t.data,n=r.length-1;n>0;n-=4)if(0!==r[n])return Math.floor(.25*(n-3)/e)}e.exports=n,n.canvas=document.createElement("canvas"),n.cache={}},{}],230:[function(t,e,r){e.exports=function(t){return new s(t||d,null)};function n(t,e,r,n,a,i){this._color=t,this.key=e,this.value=r,this.left=n,this.right=a,this._count=i}function a(t){return new n(t._color,t.key,t.value,t.left,t.right,t._count)}function i(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}var l=s.prototype;function u(t,e){this.tree=t,this._stack=e}Object.defineProperty(l,"keys",{get:function(){var t=[];return this.forEach((function(e,r){t.push(e)})),t}}),Object.defineProperty(l,"values",{get:function(){var t=[];return this.forEach((function(e,r){t.push(r)})),t}}),Object.defineProperty(l,"length",{get:function(){return this.root?this.root._count:0}}),l.insert=function(t,e){for(var r=this._compare,a=this.root,l=[],u=[];a;){var c=r(t,a.key);l.push(a),u.push(c),a=c<=0?a.left:a.right}l.push(new n(0,t,e,null,null,1));for(var h=l.length-2;h>=0;--h)a=l[h],u[h]<=0?l[h]=new n(a._color,a.key,a.value,l[h+1],a.right,a._count+1):l[h]=new n(a._color,a.key,a.value,a.left,l[h+1],a._count+1);for(h=l.length-1;h>1;--h){var d=l[h-1];if(a=l[h],1===d._color||1===a._color)break;var f=l[h-2];if(f.left===d)if(d.left===a){if(!(p=f.right)||0!==p._color){f._color=0,f.left=d.right,d._color=1,d.right=f,l[h-2]=d,l[h-1]=a,o(f),o(d),h>=3&&((m=l[h-3]).left===f?m.left=d:m.right=d);break}d._color=1,f.right=i(1,p),f._color=0,h-=1}else{if(!(p=f.right)||0!==p._color){d.right=a.left,f._color=0,f.left=a.right,a._color=1,a.left=d,a.right=f,l[h-2]=a,l[h-1]=d,o(f),o(d),o(a),h>=3&&((m=l[h-3]).left===f?m.left=a:m.right=a);break}d._color=1,f.right=i(1,p),f._color=0,h-=1}else if(d.right===a){if(!(p=f.left)||0!==p._color){f._color=0,f.right=d.left,d._color=1,d.left=f,l[h-2]=d,l[h-1]=a,o(f),o(d),h>=3&&((m=l[h-3]).right===f?m.right=d:m.left=d);break}d._color=1,f.left=i(1,p),f._color=0,h-=1}else{var p;if(!(p=f.left)||0!==p._color){var m;d.left=a.right,f._color=0,f.right=a.left,a._color=1,a.right=d,a.left=f,l[h-2]=a,l[h-1]=d,o(f),o(d),o(a),h>=3&&((m=l[h-3]).right===f?m.right=a:m.left=a);break}d._color=1,f.left=i(1,p),f._color=0,h-=1}}return l[0]._color=1,new s(r,l[0])},l.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return function t(e,r){var n;return r.left&&(n=t(e,r.left))?n:(n=e(r.key,r.value))||(r.right?t(e,r.right):void 0)}(t,this.root);case 2:return function t(e,r,n,a){if(r(e,a.key)<=0){var i;if(a.left&&(i=t(e,r,n,a.left)))return i;if(i=n(a.key,a.value))return i}if(a.right)return t(e,r,n,a.right)}(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return function t(e,r,n,a,i){var o,s=n(e,i.key),l=n(r,i.key);if(s<=0){if(i.left&&(o=t(e,r,n,a,i.left)))return o;if(l>0&&(o=a(i.key,i.value)))return o}if(l>0&&i.right)return t(e,r,n,a,i.right)}(e,r,this._compare,t,this.root)}},Object.defineProperty(l,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new u(this,t)}}),Object.defineProperty(l,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new u(this,t)}}),l.at=function(t){if(t<0)return new u(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 u(this,r);if(t-=1,!e.right)break;if(t>=e.right._count)break;e=e.right}return new u(this,[])},l.ge=function(t){for(var e=this._compare,r=this.root,n=[],a=0;r;){var i=e(t,r.key);n.push(r),i<=0&&(a=n.length),r=i<=0?r.left:r.right}return n.length=a,new u(this,n)},l.gt=function(t){for(var e=this._compare,r=this.root,n=[],a=0;r;){var i=e(t,r.key);n.push(r),i<0&&(a=n.length),r=i<0?r.left:r.right}return n.length=a,new u(this,n)},l.lt=function(t){for(var e=this._compare,r=this.root,n=[],a=0;r;){var i=e(t,r.key);n.push(r),i>0&&(a=n.length),r=i<=0?r.left:r.right}return n.length=a,new u(this,n)},l.le=function(t){for(var e=this._compare,r=this.root,n=[],a=0;r;){var i=e(t,r.key);n.push(r),i>=0&&(a=n.length),r=i<0?r.left:r.right}return n.length=a,new u(this,n)},l.find=function(t){for(var e=this._compare,r=this.root,n=[];r;){var a=e(t,r.key);if(n.push(r),0===a)return new u(this,n);r=a<=0?r.left:r.right}return new u(this,[])},l.remove=function(t){var e=this.find(t);return e?e.remove():this},l.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 c=u.prototype;function h(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,e){return t<e?-1:t>e?1:0}Object.defineProperty(c,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(c,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),c.clone=function(){return new u(this.tree,this._stack.slice())},c.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 l=t.length-2;l>=0;--l)(r=t[l]).left===t[l+1]?e[l]=new n(r._color,r.key,r.value,e[l+1],r.right,r._count):e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count);if((r=e[e.length-1]).left&&r.right){var u=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var c=e[u-1];for(e.push(new n(r._color,c.key,c.value,r.left,r.right,r._count)),e[u-1].key=r.key,e[u-1].value=r.value,l=e.length-2;l>=u;--l)r=e[l],e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count);e[u-1].left=e[u]}if(0===(r=e[e.length-1])._color){var d=e[e.length-2];for(d.left===r?d.left=null:d.right===r&&(d.right=null),e.pop(),l=0;l<e.length;++l)e[l]._count--;return new s(this.tree._compare,e[0])}if(r.left||r.right){for(r.left?h(r,r.left):r.right&&h(r,r.right),r._color=1,l=0;l<e.length-1;++l)e[l]._count--;return new s(this.tree._compare,e[0])}if(1===e.length)return new s(this.tree._compare,null);for(l=0;l<e.length;++l)e[l]._count--;var f=e[e.length-2];return function(t){for(var e,r,n,s,l=t.length-1;l>=0;--l){if(e=t[l],0===l)return void(e._color=1);if((r=t[l-1]).left===e){if((n=r.right).right&&0===n.right._color)return s=(n=r.right=a(n)).right=a(n.right),r.right=n.left,n.left=r,n.right=s,n._color=r._color,e._color=1,r._color=1,s._color=1,o(r),o(n),l>1&&((u=t[l-2]).left===r?u.left=n:u.right=n),void(t[l-1]=n);if(n.left&&0===n.left._color)return s=(n=r.right=a(n)).left=a(n.left),r.right=s.left,n.left=s.right,s.left=r,s.right=n,s._color=r._color,r._color=1,n._color=1,e._color=1,o(r),o(n),o(s),l>1&&((u=t[l-2]).left===r?u.left=s:u.right=s),void(t[l-1]=s);if(1===n._color){if(0===r._color)return r._color=1,void(r.right=i(0,n));r.right=i(0,n);continue}n=a(n),r.right=n.left,n.left=r,n._color=r._color,r._color=0,o(r),o(n),l>1&&((u=t[l-2]).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).left&&0===n.left._color)return s=(n=r.left=a(n)).left=a(n.left),r.left=n.right,n.right=r,n.left=s,n._color=r._color,e._color=1,r._color=1,s._color=1,o(r),o(n),l>1&&((u=t[l-2]).right===r?u.right=n:u.left=n),void(t[l-1]=n);if(n.right&&0===n.right._color)return s=(n=r.left=a(n)).right=a(n.right),r.left=s.right,n.right=s.left,s.right=r,s.left=n,s._color=r._color,r._color=1,n._color=1,e._color=1,o(r),o(n),o(s),l>1&&((u=t[l-2]).right===r?u.right=s:u.left=s),void(t[l-1]=s);if(1===n._color){if(0===r._color)return r._color=1,void(r.left=i(0,n));r.left=i(0,n);continue}var u;n=a(n),r.left=n.right,n.right=r,n._color=r._color,r._color=0,o(r),o(n),l>1&&((u=t[l-2]).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}}}(e),f.left===r?f.left=null:f.right=null,new s(this.tree._compare,e[0])},Object.defineProperty(c,"key",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(c,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(c,"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}),c.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(c,"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}}),c.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),a=e[e.length-1];r[r.length-1]=new n(a._color,a.key,t,a.left,a.right,a._count);for(var i=e.length-2;i>=0;--i)(a=e[i]).left===e[i+1]?r[i]=new n(a._color,a.key,a.value,r[i+1],a.right,a._count):r[i]=new n(a._color,a.key,a.value,a.left,r[i+1],a._count);return new s(this.tree._compare,r[0])},c.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(c,"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}})},{}],231:[function(t,e,r){var n=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],a=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];function i(t){if(t<0)return Number("0/0");for(var e=a[0],r=a.length-1;r>0;--r)e+=a[r]/(t+r);var n=t+4.7421875+.5;return.5*Math.log(2*Math.PI)+(t+.5)*Math.log(n)-n+Math.log(e)-Math.log(t)}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(i(e));e-=1;for(var r=n[0],a=1;a<9;a++)r+=n[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=i},{}],232:[function(t,e,r){e.exports=function(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,a=e;try{var i=[t];0===t.indexOf("webgl")&&i.push("experimental-"+t);for(var o=0;o<i.length;o++)if(n=r.getContext(i[o],a))return n}catch(t){n=null}return n||null}},{}],233:[function(t,e,r){e.exports=function(t,e){var r=new c(t);return r.update(e),r};var n=t("./lib/text.js"),a=t("./lib/lines.js"),i=t("./lib/background.js"),o=t("./lib/cube.js"),s=t("./lib/ticks.js"),l=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);function u(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function c(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.tickAlign=["auto","auto","auto"],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.labelAlign=["auto","auto","auto"],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=i(t)}var h=c.prototype;function d(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}h.update=function(t){function e(e,r,n){if(n in t){var a,i=t[n],o=this[n];(e?Array.isArray(i)&&Array.isArray(i[0]):Array.isArray(i))?this[n]=a=[r(i[0]),r(i[1]),r(i[2])]:this[n]=a=[r(i),r(i),r(i)];for(var s=0;s<3;++s)if(a[s]!==o[s])return!0}return!1}t=t||{};var r,i=e.bind(this,!1,Number),o=e.bind(this,!1,Boolean),l=e.bind(this,!1,String),u=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]})),c=!1,h=!1;if("bounds"in t)for(var d=t.bounds,f=0;f<2;++f)for(var p=0;p<3;++p)d[f][p]!==this.bounds[f][p]&&(h=!0),this.bounds[f][p]=d[f][p];if("ticks"in t)for(r=t.ticks,c=!0,this.autoTicks=!1,f=0;f<3;++f)this.tickSpacing[f]=0;else i("tickSpacing")&&(this.autoTicks=!0,h=!0);if(this._firstInit&&("ticks"in t||"tickSpacing"in t||(this.autoTicks=!0),h=!0,c=!0,this._firstInit=!1),h&&this.autoTicks&&(r=s.create(this.bounds,this.tickSpacing),c=!0),c){for(f=0;f<3;++f)r[f].sort((function(t,e){return t.x-e.x}));s.equal(r,this.ticks)?c=!1:this.ticks=r}o("tickEnable"),l("tickFont")&&(c=!0),i("tickSize"),i("tickAngle"),i("tickPad"),u("tickColor");var m=l("labels");l("labelFont")&&(m=!0),o("labelEnable"),i("labelSize"),i("labelPad"),u("labelColor"),o("lineEnable"),o("lineMirror"),i("lineWidth"),u("lineColor"),o("lineTickEnable"),o("lineTickMirror"),i("lineTickLength"),i("lineTickWidth"),u("lineTickColor"),o("gridEnable"),i("gridWidth"),u("gridColor"),o("zeroEnable"),u("zeroLineColor"),i("zeroLineWidth"),o("backgroundEnable"),u("backgroundColor"),this._text?this._text&&(m||c)&&this._text.update(this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont):this._text=n(this.gl,this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont),this._lines&&c&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=a(this.gl,this.bounds,this.ticks))};var f=[new d,new d,new d];function p(t,e,r,n,a){for(var i=t.primalOffset,o=t.primalMinor,s=t.mirrorOffset,l=t.mirrorMinor,u=n[e],c=0;c<3;++c)if(e!==c){var h=i,d=s,f=o,p=l;u&1<<c&&(h=s,d=i,f=l,p=o),h[c]=r[0][c],d[c]=r[1][c],a[c]>0?(f[c]=-1,p[c]=0):(f[c]=0,p[c]=1)}}var m=[0,0,0],g={model:l,view:l,projection:l,_ortho:!1};h.isOpaque=function(){return!0},h.isTransparent=function(){return!1},h.drawTransparent=function(t){};var y=[0,0,0],v=[0,0,0],_=[0,0,0];h.draw=function(t){t=t||g;for(var e=this.gl,r=t.model||l,n=t.view||l,a=t.projection||l,i=this.bounds,s=t._ortho||!1,c=o(r,n,a,i,s),h=c.cubeEdges,d=c.axis,x=n[12],b=n[13],w=n[14],M=n[15],k=(s?2:1)*this.pixelRatio*(a[3]*x+a[7]*b+a[11]*w+a[15]*M)/e.drawingBufferHeight,T=0;T<3;++T)this.lastCubeProps.cubeEdges[T]=h[T],this.lastCubeProps.axis[T]=d[T];var L=f;for(T=0;T<3;++T)p(f[T],T,this.bounds,h,d);e=this.gl;var A,S,E,C=m;for(T=0;T<3;++T)this.backgroundEnable[T]?C[T]=d[T]:C[T]=0;for(this._background.draw(r,n,a,i,C,this.backgroundColor),this._lines.bind(r,n,a,this),T=0;T<3;++T){var D=[0,0,0];d[T]>0?D[T]=i[1][T]:D[T]=i[0][T];for(var P=0;P<2;++P){var O=(T+1+P)%3,z=(T+1+(1^P))%3;this.gridEnable[O]&&this._lines.drawGrid(O,z,this.bounds,D,this.gridColor[O],this.gridWidth[O]*this.pixelRatio)}for(P=0;P<2;++P)O=(T+1+P)%3,z=(T+1+(1^P))%3,this.zeroEnable[z]&&Math.min(i[0][z],i[1][z])<=0&&Math.max(i[0][z],i[1][z])>=0&&this._lines.drawZero(O,z,this.bounds,D,this.zeroLineColor[z],this.zeroLineWidth[z]*this.pixelRatio)}for(T=0;T<3;++T){this.lineEnable[T]&&this._lines.drawAxisLine(T,this.bounds,L[T].primalOffset,this.lineColor[T],this.lineWidth[T]*this.pixelRatio),this.lineMirror[T]&&this._lines.drawAxisLine(T,this.bounds,L[T].mirrorOffset,this.lineColor[T],this.lineWidth[T]*this.pixelRatio);var I=u(y,L[T].primalMinor),R=u(v,L[T].mirrorMinor),F=this.lineTickLength;for(P=0;P<3;++P){var N=k/r[5*P];I[P]*=F[P]*N,R[P]*=F[P]*N}this.lineTickEnable[T]&&this._lines.drawAxisTicks(T,L[T].primalOffset,I,this.lineTickColor[T],this.lineTickWidth[T]*this.pixelRatio),this.lineTickMirror[T]&&this._lines.drawAxisTicks(T,L[T].mirrorOffset,R,this.lineTickColor[T],this.lineTickWidth[T]*this.pixelRatio)}function Y(t){(E=[0,0,0])[t]=1}function j(t,e,r){var n=(t+1)%3,a=(t+2)%3,i=e[n],o=e[a],s=r[n],l=r[a];i>0&&l>0||i>0&&l<0||i<0&&l>0||i<0&&l<0?Y(n):(o>0&&s>0||o>0&&s<0||o<0&&s>0||o<0&&s<0)&&Y(a)}for(this._lines.unbind(),this._text.bind(r,n,a,this.pixelRatio),T=0;T<3;++T){var B=L[T].primalMinor,H=L[T].mirrorMinor,U=u(_,L[T].primalOffset);for(P=0;P<3;++P)this.lineTickEnable[T]&&(U[P]+=k*B[P]*Math.max(this.lineTickLength[P],0)/r[5*P]);var V=[0,0,0];if(V[T]=1,this.tickEnable[T]){for(-3600===this.tickAngle[T]?(this.tickAngle[T]=0,this.tickAlign[T]="auto"):this.tickAlign[T]=-1,S=1,"auto"===(A=[this.tickAlign[T],.5,S])[0]?A[0]=0:A[0]=parseInt(""+A[0]),E=[0,0,0],j(T,B,H),P=0;P<3;++P)U[P]+=k*B[P]*this.tickPad[P]/r[5*P];this._text.drawTicks(T,this.tickSize[T],this.tickAngle[T],U,this.tickColor[T],V,E,A)}if(this.labelEnable[T]){for(S=0,E=[0,0,0],this.labels[T].length>4&&(Y(T),S=1),"auto"===(A=[this.labelAlign[T],.5,S])[0]?A[0]=0:A[0]=parseInt(""+A[0]),P=0;P<3;++P)U[P]+=k*B[P]*this.labelPad[P]/r[5*P];U[T]+=.5*(i[0][T]+i[1][T]),this._text.drawLabel(T,this.labelSize[T],this.labelAngle[T],U,this.labelColor[T],[0,0,0],E,A)}}this._text.unbind()},h.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":234,"./lib/cube.js":235,"./lib/lines.js":236,"./lib/text.js":238,"./lib/ticks.js":239}],234:[function(t,e,r){e.exports=function(t){for(var e=[],r=[],s=0,l=0;l<3;++l)for(var u=(l+1)%3,c=(l+2)%3,h=[0,0,0],d=[0,0,0],f=-1;f<=1;f+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),h[l]=f,d[l]=f;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],d[0],d[1],d[2]),s+=1}var g=u;u=c,c=g}var y=n(t,new Float32Array(e)),v=n(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),_=a(t,[{buffer:y,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:y,type:t.FLOAT,size:3,offset:12,stride:24}],v),x=i(t);return x.attributes.position.location=0,x.attributes.normal.location=1,new o(t,y,_,x)};var n=t("gl-buffer"),a=t("gl-vao"),i=t("./shaders").bg;function o(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}var s=o.prototype;s.draw=function(t,e,r,n,a,i){for(var o=!1,s=0;s<3;++s)o=o||a[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:a,colors:i},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders":237,"gl-buffer":241,"gl-vao":327}],235:[function(t,e,r){e.exports=function(t,e,r,i,f){a(s,e,t),a(s,r,s);for(var v=0,_=0;_<2;++_){c[2]=i[_][2];for(var x=0;x<2;++x){c[1]=i[x][1];for(var b=0;b<2;++b)c[0]=i[b][0],d(l[v],c,s),v+=1}}var w=-1;for(_=0;_<8;++_){for(var M=l[_][3],k=0;k<3;++k)u[_][k]=l[_][k]/M;f&&(u[_][2]*=-1),M<0&&(w<0||u[_][2]<u[w][2])&&(w=_)}if(w<0){w=0;for(var T=0;T<3;++T){for(var L=(T+2)%3,A=(T+1)%3,S=-1,E=-1,C=0;C<2;++C){var D=(O=C<<T)+(C<<L)+(1-C<<A),P=O+(1-C<<L)+(C<<A);o(u[O],u[D],u[P],h)<0||(C?S=1:E=1)}if(S<0||E<0)E>S&&(w|=1<<T);else{for(C=0;C<2;++C){D=(O=C<<T)+(C<<L)+(1-C<<A),P=O+(1-C<<L)+(C<<A);var O,z=p([l[O],l[D],l[P],l[O+(1<<L)+(1<<A)]]);C?S=z:E=z}E>S&&(w|=1<<T)}}}var I=7^w,R=-1;for(_=0;_<8;++_)_!==w&&_!==I&&(R<0||u[R][1]>u[_][1])&&(R=_);var F=-1;for(_=0;_<3;++_)(Y=R^1<<_)!==w&&Y!==I&&(F<0&&(F=Y),(A=u[Y])[0]<u[F][0]&&(F=Y));var N=-1;for(_=0;_<3;++_){var Y;(Y=R^1<<_)!==w&&Y!==I&&Y!==F&&(N<0&&(N=Y),(A=u[Y])[0]>u[N][0]&&(N=Y))}var j=m;j[0]=j[1]=j[2]=0,j[n.log2(F^R)]=R&F,j[n.log2(R^N)]=R&N;var B=7^N;B===w||B===I?(B=7^F,j[n.log2(N^B)]=B&N):j[n.log2(F^B)]=B&F;var H=g,U=w;for(T=0;T<3;++T)H[T]=U&1<<T?-1:1;return y};var n=t("bit-twiddle"),a=t("gl-mat4/multiply"),i=t("split-polygon"),o=t("robust-orientation"),s=new Array(16),l=new Array(8),u=new Array(8),c=new Array(3),h=[0,0,0];function d(t,e,r){for(var n=0;n<4;++n){t[n]=r[12+n];for(var a=0;a<3;++a)t[n]+=e[a]*r[4*a+n]}}!function(){for(var t=0;t<8;++t)l[t]=[1,1,1,1],u[t]=[1,1,1]}();var f=[[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]];function p(t){for(var e=0;e<f.length;++e)if((t=i.positive(t,f[e])).length<3)return 0;var r=t[0],n=r[0]/r[3],a=r[1]/r[3],o=0;for(e=1;e+1<t.length;++e){var s=t[e],l=t[e+1],u=s[0]/s[3]-n,c=s[1]/s[3]-a,h=l[0]/l[3]-n,d=l[1]/l[3]-a;o+=Math.abs(u*d-c*h)}return o}var m=[1,1,1],g=[0,0,0],y={cubeEdges:m,axis:g}},{"bit-twiddle":92,"gl-mat4/multiply":267,"robust-orientation":510,"split-polygon":527}],236:[function(t,e,r){e.exports=function(t,e,r){var o=[],s=[0,0,0],l=[0,0,0],u=[0,0,0],c=[0,0,0];o.push(0,0,1,0,1,1,0,0,-1,0,0,-1,0,1,1,0,1,-1);for(var h=0;h<3;++h){for(var d=o.length/3|0,p=0;p<r[h].length;++p){var m=+r[h][p].x;o.push(m,0,1,m,1,1,m,0,-1,m,0,-1,m,1,1,m,1,-1)}var g=o.length/3|0;s[h]=d,l[h]=g-d,d=o.length/3|0;for(var y=0;y<r[h].length;++y)m=+r[h][y].x,o.push(m,0,1,m,1,1,m,0,-1,m,0,-1,m,1,1,m,1,-1);g=o.length/3|0,u[h]=d,c[h]=g-d}var v=n(t,new Float32Array(o)),_=a(t,[{buffer:v,type:t.FLOAT,size:3,stride:0,offset:0}]),x=i(t);return x.attributes.position.location=0,new f(t,v,_,x,l,s,c,u)};var n=t("gl-buffer"),a=t("gl-vao"),i=t("./shaders").line,o=[0,0,0],s=[0,0,0],l=[0,0,0],u=[0,0,0],c=[1,1];function h(t){return t[0]=t[1]=t[2]=0,t}function d(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function f(t,e,r,n,a,i,o,s){this.gl=t,this.vertBuffer=e,this.vao=r,this.shader=n,this.tickCount=a,this.tickOffset=i,this.gridCount=o,this.gridOffset=s}var p=f.prototype;p.bind=function(t,e,r){this.shader.bind(),this.shader.uniforms.model=t,this.shader.uniforms.view=e,this.shader.uniforms.projection=r,c[0]=this.gl.drawingBufferWidth,c[1]=this.gl.drawingBufferHeight,this.shader.uniforms.screenShape=c,this.vao.bind()},p.unbind=function(){this.vao.unbind()},p.drawAxisLine=function(t,e,r,n,a){var i=h(s);this.shader.uniforms.majorAxis=s,i[t]=e[1][t]-e[0][t],this.shader.uniforms.minorAxis=i;var o,c=d(u,r);c[t]+=e[0][t],this.shader.uniforms.offset=c,this.shader.uniforms.lineWidth=a,this.shader.uniforms.color=n,(o=h(l))[(t+2)%3]=1,this.shader.uniforms.screenAxis=o,this.vao.draw(this.gl.TRIANGLES,6),(o=h(l))[(t+1)%3]=1,this.shader.uniforms.screenAxis=o,this.vao.draw(this.gl.TRIANGLES,6)},p.drawAxisTicks=function(t,e,r,n,a){if(this.tickCount[t]){var i=h(o);i[t]=1,this.shader.uniforms.majorAxis=i,this.shader.uniforms.offset=e,this.shader.uniforms.minorAxis=r,this.shader.uniforms.color=n,this.shader.uniforms.lineWidth=a;var s=h(l);s[t]=1,this.shader.uniforms.screenAxis=s,this.vao.draw(this.gl.TRIANGLES,this.tickCount[t],this.tickOffset[t])}},p.drawGrid=function(t,e,r,n,a,i){if(this.gridCount[t]){var c=h(s);c[e]=r[1][e]-r[0][e],this.shader.uniforms.minorAxis=c;var f=d(u,n);f[e]+=r[0][e],this.shader.uniforms.offset=f;var p=h(o);p[t]=1,this.shader.uniforms.majorAxis=p;var m=h(l);m[t]=1,this.shader.uniforms.screenAxis=m,this.shader.uniforms.lineWidth=i,this.shader.uniforms.color=a,this.vao.draw(this.gl.TRIANGLES,this.gridCount[t],this.gridOffset[t])}},p.drawZero=function(t,e,r,n,a,i){var o=h(s);this.shader.uniforms.majorAxis=o,o[t]=r[1][t]-r[0][t],this.shader.uniforms.minorAxis=o;var c=d(u,n);c[t]+=r[0][t],this.shader.uniforms.offset=c;var f=h(l);f[e]=1,this.shader.uniforms.screenAxis=f,this.shader.uniforms.lineWidth=i,this.shader.uniforms.color=a,this.vao.draw(this.gl.TRIANGLES,6)},p.dispose=function(){this.vao.dispose(),this.vertBuffer.dispose(),this.shader.dispose()}},{"./shaders":237,"gl-buffer":241,"gl-vao":327}],237:[function(t,e,r){var n=t("glslify"),a=t("gl-shader"),i=n(["precision highp float;\n#define GLSLIFY 1\n\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"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}"]);r.line=function(t){return a(t,i,o,null,[{name:"position",type:"vec3"}])};var s=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\nuniform vec3 offset, axis, alignDir, alignOpt;\nuniform float scale, angle, pixelScale;\nuniform vec2 resolution;\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\nfloat computeViewAngle(vec3 a, vec3 b) {\n vec3 A = project(a);\n vec3 B = project(b);\n\n return atan(\n (B.y - A.y) * resolution.y,\n (B.x - A.x) * resolution.x\n );\n}\n\nconst float PI = 3.141592;\nconst float TWO_PI = 2.0 * PI;\nconst float HALF_PI = 0.5 * PI;\nconst float ONE_AND_HALF_PI = 1.5 * PI;\n\nint option = int(floor(alignOpt.x + 0.001));\nfloat hv_ratio = alignOpt.y;\nbool enableAlign = (alignOpt.z != 0.0);\n\nfloat mod_angle(float a) {\n return mod(a, PI);\n}\n\nfloat positive_angle(float a) {\n return mod_angle((a < 0.0) ?\n a + TWO_PI :\n a\n );\n}\n\nfloat look_upwards(float a) {\n float b = positive_angle(a);\n return ((b > HALF_PI) && (b <= ONE_AND_HALF_PI)) ?\n b - PI :\n b;\n}\n\nfloat look_horizontal_or_vertical(float a, float ratio) {\n // ratio controls the ratio between being horizontal to (vertical + horizontal)\n // if ratio is set to 0.5 then it is 50%, 50%.\n // when using a higher ratio e.g. 0.75 the result would\n // likely be more horizontal than vertical.\n\n float b = positive_angle(a);\n\n return\n (b < ( ratio) * HALF_PI) ? 0.0 :\n (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI :\n (b < (2.0 + ratio) * HALF_PI) ? 0.0 :\n (b < (4.0 - ratio) * HALF_PI) ? HALF_PI :\n 0.0;\n}\n\nfloat roundTo(float a, float b) {\n return float(b * floor((a + 0.5 * b) / b));\n}\n\nfloat look_round_n_directions(float a, int n) {\n float b = positive_angle(a);\n float div = TWO_PI / float(n);\n float c = roundTo(b, div);\n return look_upwards(c);\n}\n\nfloat applyAlignOption(float rawAngle, float delta) {\n return\n (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions\n (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical\n (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis\n (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards\n (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal\n rawAngle; // otherwise return back raw input angle\n}\n\nbool isAxisTitle = (axis.x == 0.0) &&\n (axis.y == 0.0) &&\n (axis.z == 0.0);\n\nvoid main() {\n //Compute world offset\n float axisDistance = position.z;\n vec3 dataPosition = axisDistance * axis + offset;\n\n float beta = angle; // i.e. user defined attributes for each tick\n\n float axisAngle;\n float clipAngle;\n float flip;\n\n if (enableAlign) {\n axisAngle = (isAxisTitle) ? HALF_PI :\n computeViewAngle(dataPosition, dataPosition + axis);\n clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir);\n\n axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0;\n clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0;\n\n flip = (dot(vec2(cos(axisAngle), sin(axisAngle)),\n vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0;\n\n beta += applyAlignOption(clipAngle, flip * PI);\n }\n\n //Compute plane offset\n vec2 planeCoord = position.xy * pixelScale;\n\n mat2 planeXform = scale * mat2(\n cos(beta), sin(beta),\n -sin(beta), cos(beta)\n );\n\n vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;\n\n //Compute clip position\n vec3 clipPosition = project(dataPosition);\n\n //Apply text offset in clip coordinates\n clipPosition += vec3(viewOffset, 0.0);\n\n //Done\n gl_Position = vec4(clipPosition, 1.0);\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}"]);r.text=function(t){return a(t,s,l,null,[{name:"position",type:"vec3"}])};var u=n(["precision highp float;\n#define GLSLIFY 1\n\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\n vec3 signAxis = sign(bounds[1] - bounds[0]);\n\n vec3 realNormal = signAxis * normal;\n\n if(dot(realNormal, enable) > 0.0) {\n vec3 minRange = min(bounds[0], bounds[1]);\n vec3 maxRange = max(bounds[0], bounds[1]);\n vec3 nPosition = mix(minRange, maxRange, 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\n colorChannel = abs(realNormal);\n}"]),c=n(["precision highp 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}"]);r.bg=function(t){return a(t,u,c,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},{"gl-shader":301,glslify:409}],238:[function(t,e,r){(function(r){e.exports=function(t,e,r,i,s,l){var c=n(t),h=a(t,[{buffer:c,size:3}]),d=o(t);d.attributes.position.location=0;var f=new u(t,d,c,h);return f.update(e,r,i,s,l),f};var n=t("gl-buffer"),a=t("gl-vao"),i=t("vectorize-text"),o=t("./shaders").text,s=window||r.global||{},l=s.__TEXT_CACHE||{};function u(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}s.__TEXT_CACHE={};var c=u.prototype,h=[0,0];c.bind=function(t,e,r,n){this.vao.bind(),this.shader.bind();var a=this.shader.uniforms;a.model=t,a.view=e,a.projection=r,a.pixelScale=n,h[0]=this.gl.drawingBufferWidth,h[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=h},c.unbind=function(){this.vao.unbind()},c.update=function(t,e,r,n,a){var o=[];function s(t,e,r,n,a,s){var u=l[r];u||(u=l[r]={});var c=u[e];c||(c=u[e]=function(t,e){try{return i(t,e)}catch(e){return console.warn('error vectorizing text:"'+t+'" error:',e),{cells:[],positions:[]}}}(e,{triangles:!0,font:r,textAlign:"center",textBaseline:"middle",lineSpacing:a,styletags:s}));for(var h=(n||12)/12,d=c.positions,f=c.cells,p=0,m=f.length;p<m;++p)for(var g=f[p],y=2;y>=0;--y){var v=d[g[y]];o.push(h*v[0],-h*v[1],t)}}for(var u=[0,0,0],c=[0,0,0],h=[0,0,0],d=[0,0,0],f={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},p=0;p<3;++p){h[p]=o.length/3|0,s(.5*(t[0][p]+t[1][p]),e[p],r[p],12,1.25,f),d[p]=(o.length/3|0)-h[p],u[p]=o.length/3|0;for(var m=0;m<n[p].length;++m)n[p][m].text&&s(n[p][m].x,n[p][m].text,n[p][m].font||a,n[p][m].fontSize||12,1.25,f);c[p]=(o.length/3|0)-u[p]}this.buffer.update(o),this.tickOffset=u,this.tickCount=c,this.labelOffset=h,this.labelCount=d},c.drawTicks=function(t,e,r,n,a,i,o,s){this.tickCount[t]&&(this.shader.uniforms.axis=i,this.shader.uniforms.color=a,this.shader.uniforms.angle=r,this.shader.uniforms.scale=e,this.shader.uniforms.offset=n,this.shader.uniforms.alignDir=o,this.shader.uniforms.alignOpt=s,this.vao.draw(this.gl.TRIANGLES,this.tickCount[t],this.tickOffset[t]))},c.drawLabel=function(t,e,r,n,a,i,o,s){this.labelCount[t]&&(this.shader.uniforms.axis=i,this.shader.uniforms.color=a,this.shader.uniforms.angle=r,this.shader.uniforms.scale=e,this.shader.uniforms.offset=n,this.shader.uniforms.alignDir=o,this.shader.uniforms.alignOpt=s,this.vao.draw(this.gl.TRIANGLES,this.labelCount[t],this.labelOffset[t]))},c.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()}}).call(this,t("_process"))},{"./shaders":237,_process:482,"gl-buffer":241,"gl-vao":327,"vectorize-text":550}],239:[function(t,e,r){function n(t,e){var r=t+"",n=r.indexOf("."),a=0;n>=0&&(a=r.length-n-1);var i=Math.pow(10,a),o=Math.round(t*e*i),s=o+"";if(s.indexOf("e")>=0)return s;var l=o/i,u=o%i;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),a){for(var h=""+u;h.length<a;)h="0"+h;return c+"."+h}return c}r.create=function(t,e){for(var r=[],a=0;a<3;++a){for(var i=[],o=(t[0][a],t[1][a],0);o*e[a]<=t[1][a];++o)i.push({x:o*e[a],text:n(e[a],o)});for(o=-1;o*e[a]>=t[0][a];--o)i.push({x:o*e[a],text:n(e[a],o)});r.push(i)}return r},r.equal=function(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 a=t[r][n],i=e[r][n];if(a.x!==i.x||a.text!==i.text||a.font!==i.font||a.fontColor!==i.fontColor||a.fontSize!==i.fontSize||a.dx!==i.dx||a.dy!==i.dy)return!1}}return!0}},{}],240:[function(t,e,r){e.exports=function(t,e,r,l,h){var d=e.model||u,f=e.view||u,y=e.projection||u,v=e._ortho||!1,_=t.bounds,x=(h=h||i(d,f,y,_,v)).axis;o(c,f,d),o(c,y,c);for(var b=m,w=0;w<3;++w)b[w].lo=1/0,b[w].hi=-1/0,b[w].pixelsPerDataUnit=1/0;var M=n(s(c,c));s(c,c);for(var k=0;k<3;++k){var T=(k+1)%3,L=(k+2)%3,A=g;t:for(w=0;w<2;++w){var S=[];if(x[k]<0!=!!w){A[k]=_[w][k];for(var E=0;E<2;++E){A[T]=_[E^w][T];for(var C=0;C<2;++C)A[L]=_[C^E^w][L],S.push(A.slice())}var D=v?5:4;for(E=D;E===D;++E){if(0===S.length)continue t;S=a.positive(S,M[E])}for(E=0;E<S.length;++E){L=S[E];var P=p(g,c,L,r,l);for(C=0;C<3;++C)b[C].lo=Math.min(b[C].lo,L[C]),b[C].hi=Math.max(b[C].hi,L[C]),C!==k&&(b[C].pixelsPerDataUnit=Math.min(b[C].pixelsPerDataUnit,Math.abs(P[C])))}}}}return b};var n=t("extract-frustum-planes"),a=t("split-polygon"),i=t("./lib/cube.js"),o=t("gl-mat4/multiply"),s=t("gl-mat4/transpose"),l=t("gl-vec4/transformMat4"),u=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),c=new Float32Array(16);function h(t,e,r){this.lo=t,this.hi=e,this.pixelsPerDataUnit=r}var d=[0,0,0,1],f=[0,0,0,1];function p(t,e,r,n,a){for(var i=0;i<3;++i){for(var o=d,s=f,u=0;u<3;++u)s[u]=o[u]=r[u];s[3]=o[3]=1,s[i]+=1,l(s,s,e),s[3]<0&&(t[i]=1/0),o[i]-=1,l(o,o,e),o[3]<0&&(t[i]=1/0);var c=(o[0]/o[3]-s[0]/s[3])*n,h=(o[1]/o[3]-s[1]/s[3])*a;t[i]=.25*Math.sqrt(c*c+h*h)}return t}var m=[new h(1/0,-1/0,1/0),new h(1/0,-1/0,1/0),new h(1/0,-1/0,1/0)],g=[0,0,0]},{"./lib/cube.js":235,"extract-frustum-planes":224,"gl-mat4/multiply":267,"gl-mat4/transpose":276,"gl-vec4/transformMat4":398,"split-polygon":527}],241:[function(t,e,r){var n=t("typedarray-pool"),a=t("ndarray-ops"),i=t("ndarray"),o=["uint8","uint8_clamped","uint16","uint32","int8","int16","int32","float32"];function s(t,e,r,n,a){this.gl=t,this.type=e,this.handle=r,this.length=n,this.usage=a}var l=s.prototype;function u(t,e,r,n,a,i){var o=a.length*a.BYTES_PER_ELEMENT;if(i<0)return t.bufferData(e,a,n),o;if(o+i>r)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return t.bufferSubData(e,i,a),r}function c(t,e){for(var r=n.malloc(t.length,e),a=t.length,i=0;i<a;++i)r[i]=t[i];return r}l.bind=function(){this.gl.bindBuffer(this.type,this.handle)},l.unbind=function(){this.gl.bindBuffer(this.type,null)},l.dispose=function(){this.gl.deleteBuffer(this.handle)},l.update=function(t,e){if("number"!=typeof e&&(e=-1),this.bind(),"object"==typeof t&&void 0!==t.shape){var r=t.dtype;if(o.indexOf(r)<0&&(r="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER&&(r=gl.getExtension("OES_element_index_uint")&&"uint16"!==r?"uint32":"uint16"),r===t.dtype&&function(t,e){for(var r=1,n=e.length-1;n>=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=u(this.gl,this.type,this.length,this.usage,t.data,e):this.length=u(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var s=n.malloc(t.size,r),l=i(s,t.shape);a.assign(l,t),this.length=u(this.gl,this.type,this.length,this.usage,e<0?s:s.subarray(0,t.size),e),n.free(s)}}else if(Array.isArray(t)){var h;h=this.type===this.gl.ELEMENT_ARRAY_BUFFER?c(t,"uint16"):c(t,"float32"),this.length=u(this.gl,this.type,this.length,this.usage,e<0?h:h.subarray(0,t.length),e),n.free(h)}else if("object"==typeof t&&"number"==typeof t.length)this.length=u(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)<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},e.exports=function(t,e,r,n){if(r=r||t.ARRAY_BUFFER,n=n||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(n!==t.DYNAMIC_DRAW&&n!==t.STATIC_DRAW&&n!==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(),i=new s(t,r,a,0,n);return i.update(e),i}},{ndarray:450,"ndarray-ops":444,"typedarray-pool":545}],242:[function(t,e,r){var n=t("gl-vec3"),a=function(t,e){for(var r=0;r<t.length;r++)if(t[r]>=e)return r-1;return r},i=n.create(),o=n.create(),s=function(t,e,r){return t<e?e:t>r?r:t},l=function(t,e,r,l){var u=t[0],c=t[1],h=t[2],d=r[0].length,f=r[1].length,p=r[2].length,m=a(r[0],u),g=a(r[1],c),y=a(r[2],h),v=m+1,_=g+1,x=y+1;if(l&&(m=s(m,0,d-1),v=s(v,0,d-1),g=s(g,0,f-1),_=s(_,0,f-1),y=s(y,0,p-1),x=s(x,0,p-1)),m<0||g<0||y<0||v>=d||_>=f||x>=p)return n.create();var b=(u-r[0][m])/(r[0][v]-r[0][m]),w=(c-r[1][g])/(r[1][_]-r[1][g]),M=(h-r[2][y])/(r[2][x]-r[2][y]);(b<0||b>1||isNaN(b))&&(b=0),(w<0||w>1||isNaN(w))&&(w=0),(M<0||M>1||isNaN(M))&&(M=0);var k=y*d*f,T=x*d*f,L=g*d,A=_*d,S=m,E=v,C=e[L+k+S],D=e[L+k+E],P=e[A+k+S],O=e[A+k+E],z=e[L+T+S],I=e[L+T+E],R=e[A+T+S],F=e[A+T+E],N=n.create();return n.lerp(N,C,D,b),n.lerp(i,P,O,b),n.lerp(N,N,i,w),n.lerp(i,z,I,b),n.lerp(o,R,F,b),n.lerp(i,i,o,w),n.lerp(N,N,i,M),N};e.exports=function(t,e){var r;r=t.positions?t.positions:function(t){for(var e=t[0],r=t[1],n=t[2],a=[],i=0;i<n.length;i++)for(var o=0;o<r.length;o++)for(var s=0;s<e.length;s++)a.push([n[i],r[o],e[s]]);return a}(t.meshgrid);var a=t.meshgrid,i=t.vectors,o={positions:[],vertexIntensity:[],vertexIntensityBounds:t.vertexIntensityBounds,vertexNormals:[],vectors:[],cells:[],coneOffset:t.coneOffset,colormap:t.colormap};if(0===t.positions.length)return e&&(e[0]=[0,0,0],e[1]=[0,0,0]),o;for(var s=0,u=1/0,c=-1/0,h=1/0,d=-1/0,f=1/0,p=-1/0,m=null,g=null,y=[],v=1/0,_=0;_<r.length;_++){var x,b=r[_];u=Math.min(b[0],u),c=Math.max(b[0],c),h=Math.min(b[1],h),d=Math.max(b[1],d),f=Math.min(b[2],f),p=Math.max(b[2],p),x=a?l(b,i,a,!0):i[_],n.length(x)>s&&(s=n.length(x)),_&&(v=Math.min(v,2*n.distance(m,b)/(n.length(g)+n.length(x)))),m=b,g=x,y.push(x)}var w=[u,h,f],M=[c,d,p];e&&(e[0]=w,e[1]=M),0===s&&(s=1);var k=1/s;isFinite(v)&&!isNaN(v)||(v=1),o.vectorScale=v;var T=function(t,e,r){var a=n.create();return n.set(a,0,1,0),a}(),L=t.coneSize||.5;t.absoluteConeSize&&(L=t.absoluteConeSize*k),o.coneScale=L,_=0;for(var A=0;_<r.length;_++)for(var S=(b=r[_])[0],E=b[1],C=b[2],D=y[_],P=n.length(D)*k,O=0;O<8;O++){o.positions.push([S,E,C,A++]),o.positions.push([S,E,C,A++]),o.positions.push([S,E,C,A++]),o.positions.push([S,E,C,A++]),o.positions.push([S,E,C,A++]),o.positions.push([S,E,C,A++]),o.vectors.push(D),o.vectors.push(D),o.vectors.push(D),o.vectors.push(D),o.vectors.push(D),o.vectors.push(D),o.vertexIntensity.push(P,P,P),o.vertexIntensity.push(P,P,P),o.vertexNormals.push(T,T,T),o.vertexNormals.push(T,T,T);var z=o.positions.length;o.cells.push([z-6,z-5,z-4],[z-3,z-2,z-1])}return o},e.exports.createConeMesh=t("./lib/conemesh")},{"./lib/conemesh":243,"gl-vec3":346}],243:[function(t,e,r){var n=t("gl-shader"),a=t("gl-buffer"),i=t("gl-vao"),o=t("gl-texture2d"),s=t("normals"),l=t("gl-mat4/multiply"),u=t("gl-mat4/invert"),c=t("ndarray"),h=t("colormap"),d=t("simplicial-complex-contour"),f=t("typedarray-pool"),p=t("./shaders"),m=p.meshShader,g=p.pickShader,y=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function v(t,e,r,n,a,i,o,s,l,u,c,h,d,f,p,m,g,v,_,x,b,w,M,k){this.gl=t,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.pickShader=n,this.trianglePositions=a,this.triangleVectors=i,this.triangleColors=s,this.triangleNormals=u,this.triangleUVs=l,this.triangleIds=o,this.triangleVAO=c,this.triangleCount=0,this.lineWidth=1,this.edgePositions=h,this.edgeColors=f,this.edgeUVs=p,this.edgeIds=d,this.edgeVAO=m,this.edgeCount=0,this.pointPositions=g,this.pointColors=_,this.pointUVs=x,this.pointSizes=b,this.pointIds=v,this.pointVAO=w,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=M,this.contourVAO=k,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.coneScale=2,this.vectorScale=1,this.coneOffset=.25,this._model=y,this._view=y,this._projection=y,this._resolution=[1,1]}var _=v.prototype;function x(t){var e=n(t,g.vertex,g.fragment,null,g.attributes);return e.attributes.position.location=0,e.attributes.id.location=1,e.attributes.vector.location=5,e}_.isOpaque=function(){return this.opacity>=1},_.isTransparent=function(){return this.opacity<1},_.pickSlots=1,_.setPickBase=function(t){this.pickId=t},_.highlight=function(t){if(t&&this.contourEnable){for(var e=d(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,a=e.vertexWeights,i=r.length,o=f.mallocFloat32(6*i),s=0,l=0;l<i;++l)for(var u=r[l],c=0;c<2;++c){var h=u[0];2===u.length&&(h=u[c]);for(var p=n[h][0],m=n[h][1],g=a[h],y=1-g,v=this.positions[p],_=this.positions[m],x=0;x<3;++x)o[s++]=g*v[x]+y*_[x]}this.contourCount=s/3|0,this.contourPositions.update(o.subarray(0,s)),f.free(o)}else this.contourCount=0},_.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),void 0!==t.vectorScale&&(this.vectorScale=t.vectorScale),void 0!==t.coneScale&&(this.coneScale=t.coneScale),void 0!==t.coneOffset&&(this.coneOffset=t.coneOffset),t.texture?(this.texture.dispose(),this.texture=o(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(function(t){for(var e=h({colormap:t,nshades:256,format:"rgba"}),r=new Uint8Array(1024),n=0;n<256;++n){for(var a=e[n],i=0;i<3;++i)r[4*n+i]=a[i];r[4*n+3]=255*a[3]}return c(r,[256,256,4],[4,0,1])}(t.colormap)),this.texture.generateMipmap());var r=t.cells,n=t.positions,a=t.vectors;if(n&&r&&a){var i=[],l=[],u=[],d=[],f=[],p=[],m=[],g=[],y=[],v=[],_=[],x=[],b=[],w=[],M=[];this.cells=r,this.positions=n;var k=t.vertexNormals,T=t.cellNormals,L=void 0===t.vertexNormalsEpsilon?1e-6:t.vertexNormalsEpsilon,A=void 0===t.faceNormalsEpsilon?1e-6:t.faceNormalsEpsilon;t.useFacetNormals&&!T&&(T=s.faceNormals(r,n,A)),T||k||(k=s.vertexNormals(r,n,L));var S=t.vertexColors,E=t.cellColors,C=t.meshColor||[1,1,1,1],D=t.vertexUVs,P=t.vertexIntensity,O=t.cellUVs,z=t.cellIntensity,I=1/0,R=-1/0;if(!D&&!O)if(P)if(t.vertexIntensityBounds)I=+t.vertexIntensityBounds[0],R=+t.vertexIntensityBounds[1];else for(var F=0;F<P.length;++F){var N=P[F];I=Math.min(I,N),R=Math.max(R,N)}else if(z)for(F=0;F<z.length;++F)N=z[F],I=Math.min(I,N),R=Math.max(R,N);else for(F=0;F<n.length;++F)N=n[F][2],I=Math.min(I,N),R=Math.max(R,N);this.intensity=P||(z?function(t,e,r){for(var n=new Array(e),a=0;a<e;++a)n[a]=0;var i=t.length;for(a=0;a<i;++a)for(var o=t[a],s=0;s<o.length;++s)n[o[s]]=r[a];return n}(r,n.length,z):function(t){for(var e=t.length,r=new Array(e),n=0;n<e;++n)r[n]=t[n][2];return r}(n));var Y=t.pointSizes,j=t.pointSize||1;for(this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],F=0;F<n.length;++F)for(var B=n[F],H=0;H<3;++H)!isNaN(B[H])&&isFinite(B[H])&&(this.bounds[0][H]=Math.min(this.bounds[0][H],B[H]),this.bounds[1][H]=Math.max(this.bounds[1][H],B[H]));var U=0,V=0,W=0;t:for(F=0;F<r.length;++F){var G=r[F];switch(G.length){case 1:for(B=n[Z=G[0]],H=0;H<3;++H)if(isNaN(B[H])||!isFinite(B[H]))continue t;_.push(B[0],B[1],B[2],B[3]),3===(X=S?S[Z]:E?E[F]:C).length?x.push(X[0],X[1],X[2],1):x.push(X[0],X[1],X[2],X[3]),J=D?D[Z]:P?[(P[Z]-I)/(R-I),0]:O?O[F]:z?[(z[F]-I)/(R-I),0]:[(B[2]-I)/(R-I),0],b.push(J[0],J[1]),Y?w.push(Y[Z]):w.push(j),M.push(F),W+=1;break;case 2:for(H=0;H<2;++H){B=n[Z=G[H]];for(var q=0;q<3;++q)if(isNaN(B[q])||!isFinite(B[q]))continue t}for(H=0;H<2;++H)B=n[Z=G[H]],m.push(B[0],B[1],B[2]),3===(X=S?S[Z]:E?E[F]:C).length?g.push(X[0],X[1],X[2],1):g.push(X[0],X[1],X[2],X[3]),J=D?D[Z]:P?[(P[Z]-I)/(R-I),0]:O?O[F]:z?[(z[F]-I)/(R-I),0]:[(B[2]-I)/(R-I),0],y.push(J[0],J[1]),v.push(F);V+=1;break;case 3:for(H=0;H<3;++H)for(B=n[Z=G[H]],q=0;q<3;++q)if(isNaN(B[q])||!isFinite(B[q]))continue t;for(H=0;H<3;++H){var Z;B=n[Z=G[2-H]],i.push(B[0],B[1],B[2],B[3]);var X,J,K,$=a[Z];l.push($[0],$[1],$[2]),3===(X=S?S[Z]:E?E[F]:C).length?u.push(X[0],X[1],X[2],1):u.push(X[0],X[1],X[2],X[3]),J=D?D[Z]:P?[(P[Z]-I)/(R-I),0]:O?O[F]:z?[(z[F]-I)/(R-I),0]:[(B[2]-I)/(R-I),0],f.push(J[0],J[1]),K=k?k[Z]:T[F],d.push(K[0],K[1],K[2]),p.push(F)}U+=1}}this.pointCount=W,this.edgeCount=V,this.triangleCount=U,this.pointPositions.update(_),this.pointColors.update(x),this.pointUVs.update(b),this.pointSizes.update(w),this.pointIds.update(new Uint32Array(M)),this.edgePositions.update(m),this.edgeColors.update(g),this.edgeUVs.update(y),this.edgeIds.update(new Uint32Array(v)),this.trianglePositions.update(i),this.triangleVectors.update(l),this.triangleColors.update(u),this.triangleUVs.update(f),this.triangleNormals.update(d),this.triangleIds.update(new Uint32Array(p))}},_.drawTransparent=_.draw=function(t){t=t||{};for(var e=this.gl,r=t.model||y,n=t.view||y,a=t.projection||y,i=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)i[0][o]=Math.max(i[0][o],this.clipBounds[0][o]),i[1][o]=Math.min(i[1][o],this.clipBounds[1][o]);var s={model:r,view:n,projection:a,inverseModel:y.slice(),clipBounds:i,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,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,contourColor:this.contourColor,texture:0};s.inverseModel=u(s.inverseModel,s.model),e.disable(e.CULL_FACE),this.texture.bind(0);var c=new Array(16);for(l(c,s.view,s.model),l(c,s.projection,c),u(c,c),o=0;o<3;++o)s.eyePosition[o]=c[12+o]/c[15];var h=c[15];for(o=0;o<3;++o)h+=this.lightPosition[o]*c[4*o+3];for(o=0;o<3;++o){for(var d=c[12+o],f=0;f<3;++f)d+=c[4*f+o]*this.lightPosition[f];s.lightPosition[o]=d/h}if(this.triangleCount>0){var p=this.triShader;p.bind(),p.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}},_.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||y,n=t.view||y,a=t.projection||y,i=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)i[0][o]=Math.max(i[0][o],this.clipBounds[0][o]),i[1][o]=Math.min(i[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(a),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s={model:r,view:n,projection:a,clipBounds:i,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},l=this.pickShader;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*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind())},_.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions[r[1]].slice(0,3);return{index:Math.floor(r[1]/48),position:n,dataCoordinate:n}},_.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.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()},e.exports=function(t,e){1===arguments.length&&(t=(e=t).gl);var r=e.triShader||function(t){var e=n(t,m.vertex,m.fragment,null,m.attributes);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.vector.location=5,e}(t),s=x(t),l=o(t,c(new Uint8Array([255,255,255,255]),[1,1,4]));l.generateMipmap(),l.minFilter=t.LINEAR_MIPMAP_LINEAR,l.magFilter=t.LINEAR;var u=a(t),h=a(t),d=a(t),f=a(t),p=a(t),g=a(t),y=i(t,[{buffer:u,type:t.FLOAT,size:4},{buffer:g,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:d,type:t.FLOAT,size:4},{buffer:f,type:t.FLOAT,size:2},{buffer:p,type:t.FLOAT,size:3},{buffer:h,type:t.FLOAT,size:3}]),_=a(t),b=a(t),w=a(t),M=a(t),k=i(t,[{buffer:_,type:t.FLOAT,size:3},{buffer:M,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:b,type:t.FLOAT,size:4},{buffer:w,type:t.FLOAT,size:2}]),T=a(t),L=a(t),A=a(t),S=a(t),E=a(t),C=i(t,[{buffer:T,type:t.FLOAT,size:3},{buffer:E,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:L,type:t.FLOAT,size:4},{buffer:A,type:t.FLOAT,size:2},{buffer:S,type:t.FLOAT,size:1}]),D=a(t),P=new v(t,l,r,s,u,h,g,d,f,p,y,_,M,b,w,k,T,E,L,A,S,C,D,i(t,[{buffer:D,type:t.FLOAT,size:3}]));return P.update(e),P}},{"./shaders":244,colormap:126,"gl-buffer":241,"gl-mat4/invert":265,"gl-mat4/multiply":267,"gl-shader":301,"gl-texture2d":322,"gl-vao":327,ndarray:450,normals:453,"simplicial-complex-contour":518,"typedarray-pool":545}],244:[function(t,e,r){var n=t("glslify"),a=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\nuniform float vectorScale;\nuniform float coneScale;\n\nuniform float coneOffset;\n\nuniform mat4 model\n , view\n , projection\n , inverseModel;\nuniform vec3 eyePosition\n , lightPosition;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data\n , f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * conePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal,0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(conePosition, 1.0);\n vec4 t_position = view * conePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = conePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),i=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(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\nfloat cookTorranceSpecular(\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(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\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\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\n , f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\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 = min(1.0, max(0.0, cookTorranceSpecular(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}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nuniform float vectorScale;\nuniform float coneScale;\nuniform float coneOffset;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n gl_Position = projection * view * conePosition;\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);r.meshShader={vertex:a,fragment:i,attributes:[{name:"position",type:"vec4"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},r.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},{glslify:409}],245:[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"}},{}],246:[function(t,e,r){var n=t("./1.0/numbers");e.exports=function(t){return n[t]}},{"./1.0/numbers":245}],247:[function(t,e,r){e.exports=function(t){var e=t.gl,r=n(e),o=a(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}]),l=i(e);l.attributes.position.location=0,l.attributes.color.location=1,l.attributes.offset.location=2;var u=new s(e,r,o,l);return u.update(t),u};var n=t("gl-buffer"),a=t("gl-vao"),i=t("./shaders/index"),o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(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,this.hasAlpha=!1}var l=s.prototype;function u(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])}l.isOpaque=function(){return!this.hasAlpha},l.isTransparent=function(){return this.hasAlpha},l.drawTransparent=l.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||o,a=r.projection=t.projection||o;r.model=t.model||o,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var i=n[12],s=n[13],l=n[14],u=n[15],c=(t._ortho?2:1)*this.pixelRatio*(a[3]*i+a[7]*s+a[11]*l+a[15]*u)/e.drawingBufferHeight;this.vao.bind();for(var h=0;h<3;++h)e.lineWidth(this.lineWidth[h]*this.pixelRatio),r.capSize=this.capSize[h]*c,this.lineCount[h]&&e.drawArrays(e.LINES,this.lineOffset[h],this.lineCount[h]);this.vao.unbind()};var c=function(){for(var t=new Array(3),e=0;e<3;++e){for(var r=[],n=1;n<=2;++n)for(var a=-1;a<=1;a+=2){var i=[0,0,0];i[(n+e)%3]=a,r.push(i)}t[e]=r}return t}();function h(t,e,r,n){for(var a=c[n],i=0;i<a.length;++i){var o=a[i];t.push(e[0],e[1],e[2],r[0],r[1],r[2],r[3],o[0],o[1],o[2])}return a.length}l.update=function(t){"lineWidth"in(t=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])),this.hasAlpha=!1,"opacity"in t&&(this.opacity=+t.opacity,this.opacity<1&&(this.hasAlpha=!0));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 a=[],i=r.length,o=0;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.lineCount=[0,0,0];for(var s=0;s<3;++s){this.lineOffset[s]=o;t:for(var l=0;l<i;++l){for(var c=r[l],d=0;d<3;++d)if(isNaN(c[d])||!isFinite(c[d]))continue t;var f,p=n[l],m=e[s];Array.isArray(m[0])&&(m=e[l]),3===m.length?m=[m[0],m[1],m[2],1]:4===m.length&&(m=[m[0],m[1],m[2],m[3]],!this.hasAlpha&&m[3]<1&&(this.hasAlpha=!0)),isNaN(p[0][s])||isNaN(p[1][s])||(p[0][s]<0&&((f=c.slice())[s]+=p[0][s],a.push(c[0],c[1],c[2],m[0],m[1],m[2],m[3],0,0,0,f[0],f[1],f[2],m[0],m[1],m[2],m[3],0,0,0),u(this.bounds,f),o+=2+h(a,f,m,s)),p[1][s]>0&&((f=c.slice())[s]+=p[1][s],a.push(c[0],c[1],c[2],m[0],m[1],m[2],m[3],0,0,0,f[0],f[1],f[2],m[0],m[1],m[2],m[3],0,0,0),u(this.bounds,f),o+=2+h(a,f,m,s)))}this.lineCount[s]=o-this.lineOffset[s]}this.buffer.update(a)}},l.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{"./shaders/index":248,"gl-buffer":241,"gl-vao":327}],248:[function(t,e,r){var n=t("glslify"),a=t("gl-shader"),i=n(["precision highp 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}"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float opacity;\nvarying vec3 fragPosition;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], fragPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n gl_FragColor = opacity * fragColor;\n}"]);e.exports=function(t){return a(t,i,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},{"gl-shader":301,glslify:409}],249:[function(t,e,r){var n=t("gl-texture2d");e.exports=function(t,e,r,n){a||(a=t.FRAMEBUFFER_UNSUPPORTED,i=t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,o=t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,s=t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var u=t.getExtension("WEBGL_draw_buffers");if(!l&&u&&function(t,e){var r=t.getParameter(e.MAX_COLOR_ATTACHMENTS_WEBGL);l=new Array(r+1);for(var n=0;n<=r;++n){for(var a=new Array(r),i=0;i<n;++i)a[i]=t.COLOR_ATTACHMENT0+i;for(i=n;i<r;++i)a[i]=t.NONE;l[n]=a}}(t,u),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 c=t.getParameter(t.MAX_RENDERBUFFER_SIZE);if(e<0||e>c||r<0||r>c)throw new Error("gl-fbo: Parameters are too large for FBO");var h=1;if("color"in(n=n||{})){if((h=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(h>1){if(!u)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(h>t.getParameter(u.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+h+" draw buffers")}}var d=t.UNSIGNED_BYTE,f=t.getExtension("OES_texture_float");if(n.float&&h>0){if(!f)throw new Error("gl-fbo: Context does not support floating point textures");d=t.FLOAT}else n.preferFloat&&h>0&&f&&(d=t.FLOAT);var m=!0;"depth"in n&&(m=!!n.depth);var g=!1;return"stencil"in n&&(g=!!n.stencil),new p(t,e,r,d,h,m,g,u)};var a,i,o,s,l=null;function u(t){return[t.getParameter(t.FRAMEBUFFER_BINDING),t.getParameter(t.RENDERBUFFER_BINDING),t.getParameter(t.TEXTURE_BINDING_2D)]}function c(t,e){t.bindFramebuffer(t.FRAMEBUFFER,e[0]),t.bindRenderbuffer(t.RENDERBUFFER,e[1]),t.bindTexture(t.TEXTURE_2D,e[2])}function h(t){switch(t){case a:throw new Error("gl-fbo: Framebuffer unsupported");case i:throw new Error("gl-fbo: Framebuffer incomplete attachment");case o:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case s:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function d(t,e,r,a,i,o){if(!a)return null;var s=n(t,e,r,i,a);return s.magFilter=t.NEAREST,s.minFilter=t.NEAREST,s.mipSamples=1,s.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,o,t.TEXTURE_2D,s.handle,0),s}function f(t,e,r,n,a){var i=t.createRenderbuffer();return t.bindRenderbuffer(t.RENDERBUFFER,i),t.renderbufferStorage(t.RENDERBUFFER,n,e,r),t.framebufferRenderbuffer(t.FRAMEBUFFER,a,t.RENDERBUFFER,i),i}function p(t,e,r,n,a,i,o,s){this.gl=t,this._shape=[0|e,0|r],this._destroyed=!1,this._ext=s,this.color=new Array(a);for(var p=0;p<a;++p)this.color[p]=null;this._color_rb=null,this.depth=null,this._depth_rb=null,this._colorType=n,this._useDepth=i,this._useStencil=o;var m=this,g=[0|e,0|r];Object.defineProperties(g,{0:{get:function(){return m._shape[0]},set:function(t){return m.width=t}},1:{get:function(){return m._shape[1]},set:function(t){return m.height=t}}}),this._shapeVector=g,function(t){var e=u(t.gl),r=t.gl,n=t.handle=r.createFramebuffer(),a=t._shape[0],i=t._shape[1],o=t.color.length,s=t._ext,p=t._useStencil,m=t._useDepth,g=t._colorType;r.bindFramebuffer(r.FRAMEBUFFER,n);for(var y=0;y<o;++y)t.color[y]=d(r,a,i,g,r.RGBA,r.COLOR_ATTACHMENT0+y);0===o?(t._color_rb=f(r,a,i,r.RGBA4,r.COLOR_ATTACHMENT0),s&&s.drawBuffersWEBGL(l[0])):o>1&&s.drawBuffersWEBGL(l[o]);var v=r.getExtension("WEBGL_depth_texture");v?p?t.depth=d(r,a,i,v.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):m&&(t.depth=d(r,a,i,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):m&&p?t._depth_rb=f(r,a,i,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):m?t._depth_rb=f(r,a,i,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):p&&(t._depth_rb=f(r,a,i,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var _=r.checkFramebufferStatus(r.FRAMEBUFFER);if(_!==r.FRAMEBUFFER_COMPLETE){for(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),y=0;y<t.color.length;++y)t.color[y].dispose(),t.color[y]=null;t._color_rb&&(r.deleteRenderbuffer(t._color_rb),t._color_rb=null),c(r,e),h(_)}c(r,e)}(this)}var m=p.prototype;function g(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 n=t.gl,a=n.getParameter(n.MAX_RENDERBUFFER_SIZE);if(e<0||e>a||r<0||r>a)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var i=u(n),o=0;o<t.color.length;++o)t.color[o].shape=t._shape;t._color_rb&&(n.bindRenderbuffer(n.RENDERBUFFER,t._color_rb),n.renderbufferStorage(n.RENDERBUFFER,n.RGBA4,t._shape[0],t._shape[1])),t.depth&&(t.depth.shape=t._shape),t._depth_rb&&(n.bindRenderbuffer(n.RENDERBUFFER,t._depth_rb),t._useDepth&&t._useStencil?n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,t._shape[0],t._shape[1]):t._useDepth?n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_COMPONENT16,t._shape[0],t._shape[1]):t._useStencil&&n.renderbufferStorage(n.RENDERBUFFER,n.STENCIL_INDEX,t._shape[0],t._shape[1])),n.bindFramebuffer(n.FRAMEBUFFER,t.handle);var s=n.checkFramebufferStatus(n.FRAMEBUFFER);s!==n.FRAMEBUFFER_COMPLETE&&(t.dispose(),c(n,i),h(s)),c(n,i)}}Object.defineProperties(m,{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 g(this,e,r),[e,r]},enumerable:!1},width:{get:function(){return this._destroyed?0:this._shape[0]},set:function(t){return g(this,t|=0,this._shape[1]),t},enumerable:!1},height:{get:function(){return this._destroyed?0:this._shape[1]},set:function(t){return t|=0,g(this,this._shape[0],t),t},enumerable:!1}}),m.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])}},m.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":322}],250:[function(t,e,r){var n=t("sprintf-js").sprintf,a=t("gl-constants/lookup"),i=t("glsl-shader-name"),o=t("add-line-numbers");e.exports=function(t,e,r){var s=i(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=n("Error compiling %s shader %s:\n",l,s),c=n("%s%s",u,t),h=t.split("\n"),d={},f=0;f<h.length;f++){var p=h[f];if(""!==p&&"\0"!==p){var m=parseInt(p.split(":")[2]);if(isNaN(m))throw new Error(n("Could not parse error: %s",p));d[m]=p}}var g=o(e).split("\n");for(f=0;f<g.length;f++)if((d[f+3]||d[f+2]||d[f+1])&&(u+=g[f]+"\n",d[f+1])){var y=d[f+1];y=y.substr(y.split(":",3).join(":").length+1).trim(),u+=n("^^^ %s\n\n",y)}return{long:u.trim(),short:c.trim()}}},{"add-line-numbers":61,"gl-constants/lookup":246,"glsl-shader-name":401,"sprintf-js":528}],251:[function(t,e,r){e.exports=function(t,e){var r=t.gl,n=new u(t,o(r,l.vertex,l.fragment),o(r,l.pickVertex,l.pickFragment),s(r),s(r),s(r),s(r));return n.update(e),t.addObject(n),n};var n=t("binary-search-bounds"),a=t("iota-array"),i=t("typedarray-pool"),o=t("gl-shader"),s=t("gl-buffer"),l=t("./lib/shaders");function u(t,e,r,n,a,i,o){this.plot=t,this.shader=e,this.pickShader=r,this.positionBuffer=n,this.weightBuffer=a,this.colorBuffer=i,this.idBuffer=o,this.xData=[],this.yData=[],this.shape=[0,0],this.bounds=[1/0,1/0,-1/0,-1/0],this.pickOffset=0}var c,h=u.prototype,d=[0,0,1,0,0,1,1,0,1,1,0,1];h.draw=(c=[1,0,0,0,1,0,0,0,1],function(){var t=this.plot,e=this.shader,r=this.bounds,n=this.numVertices;if(!(n<=0)){var a=t.gl,i=t.dataBox,o=r[2]-r[0],s=r[3]-r[1],l=i[2]-i[0],u=i[3]-i[1];c[0]=2*o/l,c[4]=2*s/u,c[6]=2*(r[0]-i[0])/l-1,c[7]=2*(r[1]-i[1])/u-1,e.bind();var h=e.uniforms;h.viewTransform=c,h.shape=this.shape;var d=e.attributes;this.positionBuffer.bind(),d.position.pointer(),this.weightBuffer.bind(),d.weight.pointer(a.UNSIGNED_BYTE,!1),this.colorBuffer.bind(),d.color.pointer(a.UNSIGNED_BYTE,!0),a.drawArrays(a.TRIANGLES,0,n)}}),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,a=this.pickShader,i=this.bounds,o=this.numVertices;if(!(o<=0)){var s=n.gl,l=n.dataBox,u=i[2]-i[0],c=i[3]-i[1],h=l[2]-l[0],d=l[3]-l[1];t[0]=2*u/h,t[4]=2*c/d,t[6]=2*(i[0]-l[0])/h-1,t[7]=2*(i[1]-l[1])/d-1;for(var f=0;f<4;++f)e[f]=r>>8*f&255;this.pickOffset=r,a.bind();var p=a.uniforms;p.viewTransform=t,p.pickOffset=e,p.shape=this.shape;var m=a.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,a=this.shape[0]*this.shape[1];if(r<n||r>=n+a)return null;var i=r-n,o=this.xData,s=this.yData;return{object:this,pointId:i,dataCoord:[o[i%this.shape[0]],s[i/this.shape[0]|0]]}},h.update=function(t){var e=(t=t||{}).shape||[0,0],r=t.x||a(e[0]),o=t.y||a(e[1]),s=t.z||new Float32Array(e[0]*e[1]);this.xData=r,this.yData=o;var l=t.colorLevels||[0],u=t.colorValues||[0,0,0,1],c=l.length,h=this.bounds,f=h[0]=r[0],p=h[1]=o[0],m=1/((h[2]=r[r.length-1])-f),g=1/((h[3]=o[o.length-1])-p),y=e[0],v=e[1];this.shape=[y,v];var _=(y-1)*(v-1)*(d.length>>>1);this.numVertices=_;for(var x=i.mallocUint8(4*_),b=i.mallocFloat32(2*_),w=i.mallocUint8(2*_),M=i.mallocUint32(_),k=0,T=0;T<v-1;++T)for(var L=g*(o[T]-p),A=g*(o[T+1]-p),S=0;S<y-1;++S)for(var E=m*(r[S]-f),C=m*(r[S+1]-f),D=0;D<d.length;D+=2){var P,O,z,I,R=d[D],F=d[D+1],N=s[(T+F)*y+(S+R)],Y=n.le(l,N);if(Y<0)P=u[0],O=u[1],z=u[2],I=u[3];else if(Y===c-1)P=u[4*c-4],O=u[4*c-3],z=u[4*c-2],I=u[4*c-1];else{var j=(N-l[Y])/(l[Y+1]-l[Y]),B=1-j,H=4*Y,U=4*(Y+1);P=B*u[H]+j*u[U],O=B*u[H+1]+j*u[U+1],z=B*u[H+2]+j*u[U+2],I=B*u[H+3]+j*u[U+3]}x[4*k]=255*P,x[4*k+1]=255*O,x[4*k+2]=255*z,x[4*k+3]=255*I,b[2*k]=.5*E+.5*C,b[2*k+1]=.5*L+.5*A,w[2*k]=R,w[2*k+1]=F,M[k]=T*y+S,k+=1}this.positionBuffer.update(b),this.weightBuffer.update(w),this.colorBuffer.update(x),this.idBuffer.update(M),i.free(b),i.free(x),i.free(w),i.free(M)},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":252,"binary-search-bounds":253,"gl-buffer":241,"gl-shader":301,"iota-array":416,"typedarray-pool":545}],252:[function(t,e,r){var n=t("glslify");e.exports={fragment:n(["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:n(["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:n(["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:n(["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"])}},{glslify:409}],253:[function(t,e,r){arguments[4][111][0].apply(r,arguments)},{dup:111}],254:[function(t,e,r){var n=t("glslify"),a=t("gl-shader"),i=n(["precision highp 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\nvec4 project(vec3 p) {\n return projection * view * model * vec4(p, 1.0);\n}\n\nvoid main() {\n vec4 startPoint = project(position);\n vec4 endPoint = project(nextPosition);\n\n vec2 A = startPoint.xy / startPoint.w;\n vec2 B = endPoint.xy / endPoint.w;\n\n float clipAngle = atan(\n (B.y - A.y) * screenShape.y,\n (B.x - A.x) * screenShape.x\n );\n\n vec2 offset = 0.5 * pixelRatio * lineWidth * vec2(\n sin(clipAngle),\n -cos(clipAngle)\n ) / screenShape;\n\n gl_Position = vec4(startPoint.xy + startPoint.w * offset, startPoint.zw);\n\n worldPosition = position;\n pixelArcLength = arcLength;\n fragColor = color;\n}\n"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (\n outOfRange(clipBounds[0], clipBounds[1], worldPosition) ||\n fragColor.a * opacity == 0.\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"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\n#define FLOAT_MAX 1.70141184e38\n#define FLOAT_MIN 1.17549435e-38\n\nlowp vec4 encode_float_1540259130(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\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard;\n\n gl_FragColor = vec4(pickId/255.0, encode_float_1540259130(pixelArcLength).xyz);\n}"]),l=[{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 a(t,i,o,null,l)},r.createPickShader=function(t){return a(t,i,s,null,l)}},{"gl-shader":301,glslify:409}],255:[function(t,e,r){e.exports=function(t){var e=t.gl||t.scene&&t.scene.gl,r=c(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 o=h(e);o.attributes.position.location=0,o.attributes.nextPosition.location=1,o.attributes.arcLength.location=2,o.attributes.lineWidth.location=3,o.attributes.color.location=4;for(var s=n(e),u=a(e,[{buffer:s,size:3,offset:0,stride:48},{buffer:s,size:3,offset:12,stride:48},{buffer:s,size:1,offset:24,stride:48},{buffer:s,size:1,offset:28,stride:48},{buffer:s,size:4,offset:32,stride:48}]),d=l(new Array(1024),[256,1,4]),f=0;f<1024;++f)d.data[f]=255;var p=i(e,d);p.wrap=e.REPEAT;var m=new g(e,r,o,s,u,p);return m.update(t),m};var n=t("gl-buffer"),a=t("gl-vao"),i=t("gl-texture2d"),o=t("glsl-read-float"),s=t("binary-search-bounds"),l=t("ndarray"),u=t("./lib/shaders"),c=u.createShader,h=u.createPickShader,d=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function f(t,e){for(var r=0,n=0;n<3;++n){var a=t[n]-e[n];r+=a*a}return Math.sqrt(r)}function p(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 m(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function g(t,e,r,n,a,i){this.gl=t,this.shader=e,this.pickShader=r,this.buffer=n,this.vao=a,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=i,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var y=g.prototype;y.isTransparent=function(){return this.hasAlpha},y.isOpaque=function(){return!this.hasAlpha},y.pickSlots=1,y.setPickBase=function(t){this.pickId=t},y.drawTransparent=y.draw=function(t){if(this.vertexCount){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||d,view:t.view||d,projection:t.projection||d,clipBounds:p(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),n.unbind()}},y.drawPick=function(t){if(this.vertexCount){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||d,view:t.view||d,projection:t.projection||d,pickId:this.pickId,clipBounds:p(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},y.update=function(t){var e,r;this.dirty=!0;var n=!!t.connectGaps;"dashScale"in t&&(this.dashScale=t.dashScale),this.hasAlpha=!1,"opacity"in t&&(this.opacity=+t.opacity,this.opacity<1&&(this.hasAlpha=!0));var a=[],i=[],o=[],u=0,c=0,h=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],d=t.position||t.positions;if(d){var p=t.color||t.colors||[0,0,0,1],m=t.lineWidth||1,g=!1;t:for(e=1;e<d.length;++e){var y,v,_,x=d[e-1],b=d[e];for(i.push(u),o.push(x.slice()),r=0;r<3;++r){if(isNaN(x[r])||isNaN(b[r])||!isFinite(x[r])||!isFinite(b[r])){if(!n&&a.length>0){for(var w=0;w<24;++w)a.push(a[a.length-12]);c+=2,g=!0}continue t}h[0][r]=Math.min(h[0][r],x[r],b[r]),h[1][r]=Math.max(h[1][r],x[r],b[r])}Array.isArray(p[0])?(y=p.length>e-1?p[e-1]:p.length>0?p[p.length-1]:[0,0,0,1],v=p.length>e?p[e]:p.length>0?p[p.length-1]:[0,0,0,1]):y=v=p,3===y.length&&(y=[y[0],y[1],y[2],1]),3===v.length&&(v=[v[0],v[1],v[2],1]),!this.hasAlpha&&y[3]<1&&(this.hasAlpha=!0),_=Array.isArray(m)?m.length>e-1?m[e-1]:m.length>0?m[m.length-1]:[0,0,0,1]:m;var M=u;if(u+=f(x,b),g){for(r=0;r<2;++r)a.push(x[0],x[1],x[2],b[0],b[1],b[2],M,_,y[0],y[1],y[2],y[3]);c+=2,g=!1}a.push(x[0],x[1],x[2],b[0],b[1],b[2],M,_,y[0],y[1],y[2],y[3],x[0],x[1],x[2],b[0],b[1],b[2],M,-_,y[0],y[1],y[2],y[3],b[0],b[1],b[2],x[0],x[1],x[2],u,-_,v[0],v[1],v[2],v[3],b[0],b[1],b[2],x[0],x[1],x[2],u,_,v[0],v[1],v[2],v[3]),c+=4}}if(this.buffer.update(a),i.push(u),o.push(d[d.length-1].slice()),this.bounds=h,this.vertexCount=c,this.points=o,this.arcLength=i,"dashes"in t){var k=t.dashes.slice();for(k.unshift(0),e=1;e<k.length;++e)k[e]=k[e-1]+k[e];var T=l(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&s.le(k,k[k.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=o(t.value[0],t.value[1],t.value[2],0),r=s.le(this.arcLength,e);if(r<0)return null;if(r===this.arcLength.length-1)return new m(this.arcLength[this.arcLength.length-1],this.points[this.points.length-1].slice(),r);for(var n=this.points[r],a=this.points[Math.min(r+1,this.points.length-1)],i=(e-this.arcLength[r])/(this.arcLength[r+1]-this.arcLength[r]),l=1-i,u=[0,0,0],c=0;c<3;++c)u[c]=l*n[c]+i*a[c];var h=Math.min(i<.5?r:r+1,this.points.length-1);return new m(e,u,h,this.points[h])}},{"./lib/shaders":254,"binary-search-bounds":256,"gl-buffer":241,"gl-texture2d":322,"gl-vao":327,"glsl-read-float":400,ndarray:450}],256:[function(t,e,r){arguments[4][111][0].apply(r,arguments)},{dup:111}],257:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],a=e[2],i=e[3],o=r*i-a*n;return o?(o=1/o,t[0]=i*o,t[1]=-n*o,t[2]=-a*o,t[3]=r*o,t):null}},{}],258:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=c*o-s*u,d=-c*i+s*l,f=u*i-o*l,p=r*h+n*d+a*f;return p?(p=1/p,t[0]=h*p,t[1]=(-c*n+a*u)*p,t[2]=(s*n-a*o)*p,t[3]=d*p,t[4]=(c*r-a*l)*p,t[5]=(-s*r+a*i)*p,t[6]=f*p,t[7]=(-u*r+n*l)*p,t[8]=(o*r-n*i)*p,t):null}},{}],259:[function(t,e,r){e.exports=function(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}},{}],260:[function(t,e,r){e.exports=function(){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}},{}],261:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2],a=t[3],i=t[4],o=t[5],s=t[6],l=t[7],u=t[8],c=t[9],h=t[10],d=t[11],f=t[12],p=t[13],m=t[14],g=t[15];return(e*o-r*i)*(h*g-d*m)-(e*s-n*i)*(c*g-d*p)+(e*l-a*i)*(c*m-h*p)+(r*s-n*o)*(u*g-d*f)-(r*l-a*o)*(u*m-h*f)+(n*l-a*s)*(u*p-c*f)}},{}],262:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],a=e[2],i=e[3],o=r+r,s=n+n,l=a+a,u=r*o,c=n*o,h=n*s,d=a*o,f=a*s,p=a*l,m=i*o,g=i*s,y=i*l;return t[0]=1-h-p,t[1]=c+y,t[2]=d-g,t[3]=0,t[4]=c-y,t[5]=1-u-p,t[6]=f+m,t[7]=0,t[8]=d+g,t[9]=f-m,t[10]=1-u-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],263:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],a=e[1],i=e[2],o=e[3],s=n+n,l=a+a,u=i+i,c=n*s,h=n*l,d=n*u,f=a*l,p=a*u,m=i*u,g=o*s,y=o*l,v=o*u;return t[0]=1-(f+m),t[1]=h+v,t[2]=d-y,t[3]=0,t[4]=h-v,t[5]=1-(c+m),t[6]=p+g,t[7]=0,t[8]=d+y,t[9]=p-g,t[10]=1-(c+f),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}},{}],264:[function(t,e,r){e.exports=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}},{}],265:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],d=e[10],f=e[11],p=e[12],m=e[13],g=e[14],y=e[15],v=r*s-n*o,_=r*l-a*o,x=r*u-i*o,b=n*l-a*s,w=n*u-i*s,M=a*u-i*l,k=c*m-h*p,T=c*g-d*p,L=c*y-f*p,A=h*g-d*m,S=h*y-f*m,E=d*y-f*g,C=v*E-_*S+x*A+b*L-w*T+M*k;return C?(C=1/C,t[0]=(s*E-l*S+u*A)*C,t[1]=(a*S-n*E-i*A)*C,t[2]=(m*M-g*w+y*b)*C,t[3]=(d*w-h*M-f*b)*C,t[4]=(l*L-o*E-u*T)*C,t[5]=(r*E-a*L+i*T)*C,t[6]=(g*x-p*M-y*_)*C,t[7]=(c*M-d*x+f*_)*C,t[8]=(o*S-s*L+u*k)*C,t[9]=(n*L-r*S-i*k)*C,t[10]=(p*w-m*x+y*v)*C,t[11]=(h*x-c*w-f*v)*C,t[12]=(s*T-o*A-l*k)*C,t[13]=(r*A-n*T+a*k)*C,t[14]=(m*_-p*b-g*v)*C,t[15]=(c*b-h*_+d*v)*C,t):null}},{}],266:[function(t,e,r){var n=t("./identity");e.exports=function(t,e,r,a){var i,o,s,l,u,c,h,d,f,p,m=e[0],g=e[1],y=e[2],v=a[0],_=a[1],x=a[2],b=r[0],w=r[1],M=r[2];return Math.abs(m-b)<1e-6&&Math.abs(g-w)<1e-6&&Math.abs(y-M)<1e-6?n(t):(h=m-b,d=g-w,f=y-M,i=_*(f*=p=1/Math.sqrt(h*h+d*d+f*f))-x*(d*=p),o=x*(h*=p)-v*f,s=v*d-_*h,(p=Math.sqrt(i*i+o*o+s*s))?(i*=p=1/p,o*=p,s*=p):(i=0,o=0,s=0),l=d*s-f*o,u=f*i-h*s,c=h*o-d*i,(p=Math.sqrt(l*l+u*u+c*c))?(l*=p=1/p,u*=p,c*=p):(l=0,u=0,c=0),t[0]=i,t[1]=l,t[2]=h,t[3]=0,t[4]=o,t[5]=u,t[6]=d,t[7]=0,t[8]=s,t[9]=c,t[10]=f,t[11]=0,t[12]=-(i*m+o*g+s*y),t[13]=-(l*m+u*g+c*y),t[14]=-(h*m+d*g+f*y),t[15]=1,t)}},{"./identity":264}],267:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],a=e[1],i=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],d=e[9],f=e[10],p=e[11],m=e[12],g=e[13],y=e[14],v=e[15],_=r[0],x=r[1],b=r[2],w=r[3];return t[0]=_*n+x*s+b*h+w*m,t[1]=_*a+x*l+b*d+w*g,t[2]=_*i+x*u+b*f+w*y,t[3]=_*o+x*c+b*p+w*v,_=r[4],x=r[5],b=r[6],w=r[7],t[4]=_*n+x*s+b*h+w*m,t[5]=_*a+x*l+b*d+w*g,t[6]=_*i+x*u+b*f+w*y,t[7]=_*o+x*c+b*p+w*v,_=r[8],x=r[9],b=r[10],w=r[11],t[8]=_*n+x*s+b*h+w*m,t[9]=_*a+x*l+b*d+w*g,t[10]=_*i+x*u+b*f+w*y,t[11]=_*o+x*c+b*p+w*v,_=r[12],x=r[13],b=r[14],w=r[15],t[12]=_*n+x*s+b*h+w*m,t[13]=_*a+x*l+b*d+w*g,t[14]=_*i+x*u+b*f+w*y,t[15]=_*o+x*c+b*p+w*v,t}},{}],268:[function(t,e,r){e.exports=function(t,e,r,n,a,i,o){var s=1/(e-r),l=1/(n-a),u=1/(i-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]=(a+n)*l,t[14]=(o+i)*u,t[15]=1,t}},{}],269:[function(t,e,r){e.exports=function(t,e,r,n,a){var i=1/Math.tan(e/2),o=1/(n-a);return t[0]=i/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(a+n)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*a*n*o,t[15]=0,t}},{}],270:[function(t,e,r){e.exports=function(t,e,r,n){var a,i,o,s,l,u,c,h,d,f,p,m,g,y,v,_,x,b,w,M,k,T,L,A,S=n[0],E=n[1],C=n[2],D=Math.sqrt(S*S+E*E+C*C);return Math.abs(D)<1e-6?null:(S*=D=1/D,E*=D,C*=D,a=Math.sin(r),o=1-(i=Math.cos(r)),s=e[0],l=e[1],u=e[2],c=e[3],h=e[4],d=e[5],f=e[6],p=e[7],m=e[8],g=e[9],y=e[10],v=e[11],_=S*S*o+i,x=E*S*o+C*a,b=C*S*o-E*a,w=S*E*o-C*a,M=E*E*o+i,k=C*E*o+S*a,T=S*C*o+E*a,L=E*C*o-S*a,A=C*C*o+i,t[0]=s*_+h*x+m*b,t[1]=l*_+d*x+g*b,t[2]=u*_+f*x+y*b,t[3]=c*_+p*x+v*b,t[4]=s*w+h*M+m*k,t[5]=l*w+d*M+g*k,t[6]=u*w+f*M+y*k,t[7]=c*w+p*M+v*k,t[8]=s*T+h*L+m*A,t[9]=l*T+d*L+g*A,t[10]=u*T+f*L+y*A,t[11]=c*T+p*L+v*A,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}},{}],271:[function(t,e,r){e.exports=function(t,e,r){var n=Math.sin(r),a=Math.cos(r),i=e[4],o=e[5],s=e[6],l=e[7],u=e[8],c=e[9],h=e[10],d=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]=i*a+u*n,t[5]=o*a+c*n,t[6]=s*a+h*n,t[7]=l*a+d*n,t[8]=u*a-i*n,t[9]=c*a-o*n,t[10]=h*a-s*n,t[11]=d*a-l*n,t}},{}],272:[function(t,e,r){e.exports=function(t,e,r){var n=Math.sin(r),a=Math.cos(r),i=e[0],o=e[1],s=e[2],l=e[3],u=e[8],c=e[9],h=e[10],d=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]=i*a-u*n,t[1]=o*a-c*n,t[2]=s*a-h*n,t[3]=l*a-d*n,t[8]=i*n+u*a,t[9]=o*n+c*a,t[10]=s*n+h*a,t[11]=l*n+d*a,t}},{}],273:[function(t,e,r){e.exports=function(t,e,r){var n=Math.sin(r),a=Math.cos(r),i=e[0],o=e[1],s=e[2],l=e[3],u=e[4],c=e[5],h=e[6],d=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]=i*a+u*n,t[1]=o*a+c*n,t[2]=s*a+h*n,t[3]=l*a+d*n,t[4]=u*a-i*n,t[5]=c*a-o*n,t[6]=h*a-s*n,t[7]=d*a-l*n,t}},{}],274:[function(t,e,r){e.exports=function(t,e,r){var n=r[0],a=r[1],i=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]*a,t[5]=e[5]*a,t[6]=e[6]*a,t[7]=e[7]*a,t[8]=e[8]*i,t[9]=e[9]*i,t[10]=e[10]*i,t[11]=e[11]*i,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}},{}],275:[function(t,e,r){e.exports=function(t,e,r){var n,a,i,o,s,l,u,c,h,d,f,p,m=r[0],g=r[1],y=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*y+e[12],t[13]=e[1]*m+e[5]*g+e[9]*y+e[13],t[14]=e[2]*m+e[6]*g+e[10]*y+e[14],t[15]=e[3]*m+e[7]*g+e[11]*y+e[15]):(n=e[0],a=e[1],i=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],d=e[9],f=e[10],p=e[11],t[0]=n,t[1]=a,t[2]=i,t[3]=o,t[4]=s,t[5]=l,t[6]=u,t[7]=c,t[8]=h,t[9]=d,t[10]=f,t[11]=p,t[12]=n*m+s*g+h*y+e[12],t[13]=a*m+l*g+d*y+e[13],t[14]=i*m+u*g+f*y+e[14],t[15]=o*m+c*g+p*y+e[15]),t}},{}],276:[function(t,e,r){e.exports=function(t,e){if(t===e){var r=e[1],n=e[2],a=e[3],i=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]=i,t[11]=e[14],t[12]=a,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}},{}],277:[function(t,e,r){e.exports=function(t,e){switch(e.length){case 0:break;case 1:t[0]=1/e[0];break;case 4:n(t,e);break;case 9:a(t,e);break;case 16:i(t,e);break;default:throw new Error("currently supports matrices up to 4x4")}return t};var n=t("gl-mat2/invert"),a=t("gl-mat3/invert"),i=t("gl-mat4/invert")},{"gl-mat2/invert":257,"gl-mat3/invert":258,"gl-mat4/invert":265}],278:[function(t,e,r){var n=t("barycentric"),a=t("polytope-closest-point/lib/closest_point_2d.js");function i(t,e){for(var r=[0,0,0,0],n=0;n<4;++n)for(var a=0;a<4;++a)r[a]+=t[4*n+a]*e[n];return r}function o(t,e,r,n,a){for(var o=i(n,i(r,i(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])]}e.exports=function(t,e,r,i,s,l){if(1===t.length)return[0,t[0].slice()];for(var u=new Array(t.length),c=0;c<t.length;++c)u[c]=o(t[c],r,i,s,l);var h=0,d=1/0;for(c=0;c<u.length;++c){for(var f=0,p=0;p<2;++p)f+=Math.pow(u[c][p]-e[p],2);f<d&&(d=f,h=c)}var m=function(t,e){if(2===t.length){for(var r=0,i=0,o=0;o<2;++o)r+=Math.pow(e[o]-t[0][o],2),i+=Math.pow(e[o]-t[1][o],2);return(r=Math.sqrt(r))+(i=Math.sqrt(i))<1e-6?[1,0]:[i/(r+i),r/(i+r)]}if(3===t.length){var s=[0,0];return a(t[0],t[1],t[2],e,s),n(t,s)}return[]}(u,e),g=0;for(c=0;c<3;++c){if(m[c]<-.001||m[c]>1.0001)return null;g+=m[c]}return Math.abs(g-1)>.001?null:[h,function(t,e){for(var r=[0,0,0],n=0;n<t.length;++n)for(var a=t[n],i=e[n],o=0;o<3;++o)r[o]+=i*a[o];return r}(t,m),m]}},{barycentric:73,"polytope-closest-point/lib/closest_point_2d.js":481}],279:[function(t,e,r){var n=t("glslify"),a=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection\n , inverseModel;\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\nvec4 project(vec3 p) {\n return projection * view * model * vec4(p, 1.0);\n}\n\nvoid main() {\n gl_Position = project(position);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * vec4(position , 1.0);\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n f_color = color;\n f_data = position;\n f_uv = uv;\n}\n"]),i=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(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\nfloat cookTorranceSpecular(\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(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//#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular;\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 (f_color.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], f_data)\n ) discard;\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 = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d\n\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = vec4(f_color.rgb, 1.0) * 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 * f_color.a;\n}\n"]),o=n(["precision highp 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}"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard;\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0 ,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}"]),u=n(["precision highp 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}"]),c=n(["precision highp 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}"]),h=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]),d=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0, 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}"]),f=n(["precision highp 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}"]),p=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor, 1.0);\n}\n"]);r.meshShader={vertex:a,fragment:i,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.wireShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.pointShader={vertex:l,fragment:u,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},r.pickShader={vertex:c,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},r.pointPickShader={vertex:d,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},r.contourShader={vertex:f,fragment:p,attributes:[{name:"position",type:"vec3"}]}},{glslify:409}],280:[function(t,e,r){var n=t("gl-shader"),a=t("gl-buffer"),i=t("gl-vao"),o=t("gl-texture2d"),s=t("normals"),l=t("gl-mat4/multiply"),u=t("gl-mat4/invert"),c=t("ndarray"),h=t("colormap"),d=t("simplicial-complex-contour"),f=t("typedarray-pool"),p=t("./lib/shaders"),m=t("./lib/closest-point"),g=p.meshShader,y=p.wireShader,v=p.pointShader,_=p.pickShader,x=p.pointPickShader,b=p.contourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function M(t,e,r,n,a,i,o,s,l,u,c,h,d,f,p,m,g,y,v,_,x,b,M,k,T,L,A){this.gl=t,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=a,this.pickShader=i,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleColors=c,this.triangleNormals=d,this.triangleUVs=h,this.triangleIds=u,this.triangleVAO=f,this.triangleCount=0,this.lineWidth=1,this.edgePositions=p,this.edgeColors=g,this.edgeUVs=y,this.edgeIds=m,this.edgeVAO=v,this.edgeCount=0,this.pointPositions=_,this.pointColors=b,this.pointUVs=M,this.pointSizes=k,this.pointIds=x,this.pointVAO=T,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=L,this.contourVAO=A,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.hasAlpha=!1,this.opacityscale=!1,this._model=w,this._view=w,this._projection=w,this._resolution=[1,1]}var k=M.prototype;function T(t,e){if(!e)return 1;if(!e.length)return 1;for(var r=0;r<e.length;++r){if(e.length<2)return 1;if(e[r][0]===t)return e[r][1];if(e[r][0]>t&&r>0){var n=(e[r][0]-t)/(e[r][0]-e[r-1][0]);return e[r][1]*(1-n)+n*e[r-1][1]}}return 1}function L(t){var e=n(t,v.vertex,v.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.pointSize.location=4,e}function A(t){var e=n(t,_.vertex,_.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e}function S(t){var e=n(t,x.vertex,x.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e.attributes.pointSize.location=4,e}function E(t){var e=n(t,b.vertex,b.fragment);return e.attributes.position.location=0,e}k.isOpaque=function(){return!this.hasAlpha},k.isTransparent=function(){return this.hasAlpha},k.pickSlots=1,k.setPickBase=function(t){this.pickId=t},k.highlight=function(t){if(t&&this.contourEnable){for(var e=d(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,a=e.vertexWeights,i=r.length,o=f.mallocFloat32(6*i),s=0,l=0;l<i;++l)for(var u=r[l],c=0;c<2;++c){var h=u[0];2===u.length&&(h=u[c]);for(var p=n[h][0],m=n[h][1],g=a[h],y=1-g,v=this.positions[p],_=this.positions[m],x=0;x<3;++x)o[s++]=g*v[x]+y*_[x]}this.contourCount=s/3|0,this.contourPositions.update(o.subarray(0,s)),f.free(o)}else this.contourCount=0},k.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),this.hasAlpha=!1,"opacity"in t&&(this.opacity=t.opacity,this.opacity<1&&(this.hasAlpha=!0)),"opacityscale"in t&&(this.opacityscale=t.opacityscale,this.hasAlpha=!0),"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=o(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(function(t,e){for(var r=h({colormap:t,nshades:256,format:"rgba"}),n=new Uint8Array(1024),a=0;a<256;++a){for(var i=r[a],o=0;o<3;++o)n[4*a+o]=i[o];n[4*a+3]=e?255*T(a/255,e):255*i[3]}return c(n,[256,256,4],[4,0,1])}(t.colormap,this.opacityscale)),this.texture.generateMipmap());var r=t.cells,n=t.positions;if(n&&r){var a=[],i=[],l=[],u=[],d=[],f=[],p=[],m=[],g=[],y=[],v=[],_=[],x=[],b=[];this.cells=r,this.positions=n;var w=t.vertexNormals,M=t.cellNormals,k=void 0===t.vertexNormalsEpsilon?1e-6:t.vertexNormalsEpsilon,L=void 0===t.faceNormalsEpsilon?1e-6:t.faceNormalsEpsilon;t.useFacetNormals&&!M&&(M=s.faceNormals(r,n,L)),M||w||(w=s.vertexNormals(r,n,k));var A=t.vertexColors,S=t.cellColors,E=t.meshColor||[1,1,1,1],C=t.vertexUVs,D=t.vertexIntensity,P=t.cellUVs,O=t.cellIntensity,z=1/0,I=-1/0;if(!C&&!P)if(D)if(t.vertexIntensityBounds)z=+t.vertexIntensityBounds[0],I=+t.vertexIntensityBounds[1];else for(var R=0;R<D.length;++R){var F=D[R];z=Math.min(z,F),I=Math.max(I,F)}else if(O)for(R=0;R<O.length;++R)F=O[R],z=Math.min(z,F),I=Math.max(I,F);else for(R=0;R<n.length;++R)F=n[R][2],z=Math.min(z,F),I=Math.max(I,F);this.intensity=D||(O?function(t,e,r){for(var n=new Array(e),a=0;a<e;++a)n[a]=0;var i=t.length;for(a=0;a<i;++a)for(var o=t[a],s=0;s<o.length;++s)n[o[s]]=r[a];return n}(r,n.length,O):function(t){for(var e=t.length,r=new Array(e),n=0;n<e;++n)r[n]=t[n][2];return r}(n));var N=t.pointSizes,Y=t.pointSize||1;for(this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],R=0;R<n.length;++R)for(var j=n[R],B=0;B<3;++B)!isNaN(j[B])&&isFinite(j[B])&&(this.bounds[0][B]=Math.min(this.bounds[0][B],j[B]),this.bounds[1][B]=Math.max(this.bounds[1][B],j[B]));var H=0,U=0,V=0;t:for(R=0;R<r.length;++R){var W=r[R];switch(W.length){case 1:for(j=n[q=W[0]],B=0;B<3;++B)if(isNaN(j[B])||!isFinite(j[B]))continue t;y.push(j[0],j[1],j[2]),Z=A?A[q]:S?S[R]:E,this.opacityscale&&D?i.push(Z[0],Z[1],Z[2],this.opacity*T((D[q]-z)/(I-z),this.opacityscale)):3===Z.length?v.push(Z[0],Z[1],Z[2],this.opacity):(v.push(Z[0],Z[1],Z[2],Z[3]*this.opacity),!this.hasAlpha&&Z[3]<1&&(this.hasAlpha=!0)),X=C?C[q]:D?[(D[q]-z)/(I-z),0]:P?P[R]:O?[(O[R]-z)/(I-z),0]:[(j[2]-z)/(I-z),0],_.push(X[0],X[1]),N?x.push(N[q]):x.push(Y),b.push(R),V+=1;break;case 2:for(B=0;B<2;++B){j=n[q=W[B]];for(var G=0;G<3;++G)if(isNaN(j[G])||!isFinite(j[G]))continue t}for(B=0;B<2;++B)j=n[q=W[B]],f.push(j[0],j[1],j[2]),Z=A?A[q]:S?S[R]:E,this.opacityscale&&D?i.push(Z[0],Z[1],Z[2],this.opacity*T((D[q]-z)/(I-z),this.opacityscale)):3===Z.length?p.push(Z[0],Z[1],Z[2],this.opacity):(p.push(Z[0],Z[1],Z[2],Z[3]*this.opacity),!this.hasAlpha&&Z[3]<1&&(this.hasAlpha=!0)),X=C?C[q]:D?[(D[q]-z)/(I-z),0]:P?P[R]:O?[(O[R]-z)/(I-z),0]:[(j[2]-z)/(I-z),0],m.push(X[0],X[1]),g.push(R);U+=1;break;case 3:for(B=0;B<3;++B)for(j=n[q=W[B]],G=0;G<3;++G)if(isNaN(j[G])||!isFinite(j[G]))continue t;for(B=0;B<3;++B){var q,Z,X,J;j=n[q=W[2-B]],a.push(j[0],j[1],j[2]),Z=A?A[q]:S?S[R]:E,this.opacityscale&&D?i.push(Z[0],Z[1],Z[2],this.opacity*T((D[q]-z)/(I-z),this.opacityscale)):3===Z.length?i.push(Z[0],Z[1],Z[2],this.opacity):(i.push(Z[0],Z[1],Z[2],Z[3]*this.opacity),!this.hasAlpha&&Z[3]<1&&(this.hasAlpha=!0)),X=C?C[q]:D?[(D[q]-z)/(I-z),0]:P?P[R]:O?[(O[R]-z)/(I-z),0]:[(j[2]-z)/(I-z),0],u.push(X[0],X[1]),J=w?w[q]:M[R],l.push(J[0],J[1],J[2]),d.push(R)}H+=1}}this.pointCount=V,this.edgeCount=U,this.triangleCount=H,this.pointPositions.update(y),this.pointColors.update(v),this.pointUVs.update(_),this.pointSizes.update(x),this.pointIds.update(new Uint32Array(b)),this.edgePositions.update(f),this.edgeColors.update(p),this.edgeUVs.update(m),this.edgeIds.update(new Uint32Array(g)),this.trianglePositions.update(a),this.triangleColors.update(i),this.triangleUVs.update(u),this.triangleNormals.update(l),this.triangleIds.update(new Uint32Array(d))}},k.drawTransparent=k.draw=function(t){t=t||{};for(var e=this.gl,r=t.model||w,n=t.view||w,a=t.projection||w,i=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)i[0][o]=Math.max(i[0][o],this.clipBounds[0][o]),i[1][o]=Math.min(i[1][o],this.clipBounds[1][o]);var s={model:r,view:n,projection:a,inverseModel:w.slice(),clipBounds:i,kambient:this.ambientLight,kdiffuse:this.diffuseLight,kspecular:this.specularLight,roughness:this.roughness,fresnel:this.fresnel,eyePosition:[0,0,0],lightPosition:[0,0,0],contourColor:this.contourColor,texture:0};s.inverseModel=u(s.inverseModel,s.model),e.disable(e.CULL_FACE),this.texture.bind(0);var c=new Array(16);for(l(c,s.view,s.model),l(c,s.projection,c),u(c,c),o=0;o<3;++o)s.eyePosition[o]=c[12+o]/c[15];var h,d=c[15];for(o=0;o<3;++o)d+=this.lightPosition[o]*c[4*o+3];for(o=0;o<3;++o){for(var f=c[12+o],p=0;p<3;++p)f+=c[4*p+o]*this.lightPosition[p];s.lightPosition[o]=f/d}this.triangleCount>0&&((h=this.triShader).bind(),h.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&this.lineWidth>0&&((h=this.lineShader).bind(),h.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((h=this.pointShader).bind(),h.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()),this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((h=this.contourShader).bind(),h.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind())},k.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||w,n=t.view||w,a=t.projection||w,i=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)i[0][o]=Math.max(i[0][o],this.clipBounds[0][o]),i[1][o]=Math.min(i[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(a),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s,l={model:r,view:n,projection:a,clipBounds:i,pickId:this.pickId/255};(s=this.pickShader).bind(),s.uniforms=l,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*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((s=this.pointPickShader).bind(),s.uniforms=l,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind())},k.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,a=new Array(r.length),i=0;i<r.length;++i)a[i]=n[r[i]];var o=m(a,[t.coord[0],this._resolution[1]-t.coord[1]],this._model,this._view,this._projection,this._resolution);if(!o)return null;var s=o[2],l=0;for(i=0;i<r.length;++i)l+=s[i]*this.intensity[r[i]];return{position:o[1],index:r[o[0]],cell:r,cellId:e,intensity:l,dataCoordinate:this.positions[r[o[0]]]}},k.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=function(t,e){if(1===arguments.length&&(t=(e=t).gl),!(t.getExtension("OES_standard_derivatives")||t.getExtension("MOZ_OES_standard_derivatives")||t.getExtension("WEBKIT_OES_standard_derivatives")))throw new Error("derivatives not supported");var r=function(t){var e=n(t,g.vertex,g.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.normal.location=4,e}(t),s=function(t){var e=n(t,y.vertex,y.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e}(t),l=L(t),u=A(t),h=S(t),d=E(t),f=o(t,c(new Uint8Array([255,255,255,255]),[1,1,4]));f.generateMipmap(),f.minFilter=t.LINEAR_MIPMAP_LINEAR,f.magFilter=t.LINEAR;var p=a(t),m=a(t),v=a(t),_=a(t),x=a(t),b=i(t,[{buffer:p,type:t.FLOAT,size:3},{buffer:x,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:m,type:t.FLOAT,size:4},{buffer:v,type:t.FLOAT,size:2},{buffer:_,type:t.FLOAT,size:3}]),w=a(t),k=a(t),T=a(t),C=a(t),D=i(t,[{buffer:w,type:t.FLOAT,size:3},{buffer:C,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:k,type:t.FLOAT,size:4},{buffer:T,type:t.FLOAT,size:2}]),P=a(t),O=a(t),z=a(t),I=a(t),R=a(t),F=i(t,[{buffer:P,type:t.FLOAT,size:3},{buffer:R,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:O,type:t.FLOAT,size:4},{buffer:z,type:t.FLOAT,size:2},{buffer:I,type:t.FLOAT,size:1}]),N=a(t),Y=new M(t,f,r,s,l,u,h,d,p,x,m,v,_,b,w,C,k,T,D,P,R,O,z,I,F,N,i(t,[{buffer:N,type:t.FLOAT,size:3}]));return Y.update(e),Y}},{"./lib/closest-point":278,"./lib/shaders":279,colormap:126,"gl-buffer":241,"gl-mat4/invert":265,"gl-mat4/multiply":267,"gl-shader":301,"gl-texture2d":322,"gl-vao":327,ndarray:450,normals:453,"simplicial-complex-contour":518,"typedarray-pool":545}],281:[function(t,e,r){e.exports=function(t){var e=t.gl;return new o(t,n(e,[0,0,0,1,1,0,1,1]),a(e,i.boxVert,i.lineFrag))};var n=t("gl-buffer"),a=t("gl-shader"),i=t("./shaders");function o(t,e,r){this.plot=t,this.vbo=e,this.shader=r}var s,l,u=o.prototype;u.bind=function(){var t=this.shader;this.vbo.bind(),this.shader.bind(),t.attributes.coord.pointer(),t.uniforms.screenBox=this.plot.screenBox},u.drawBox=(s=[0,0],l=[0,0],function(t,e,r,n,a){var i=this.plot,o=this.shader,u=i.gl;s[0]=t,s[1]=e,l[0]=r,l[1]=n,o.uniforms.lo=s,o.uniforms.hi=l,o.uniforms.color=a,u.drawArrays(u.TRIANGLE_STRIP,0,4)}),u.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{"./shaders":284,"gl-buffer":241,"gl-shader":301}],282:[function(t,e,r){e.exports=function(t){var e=t.gl;return new s(t,n(e),a(e,o.gridVert,o.gridFrag),a(e,o.tickVert,o.gridFrag))};var n=t("gl-buffer"),a=t("gl-shader"),i=t("binary-search-bounds"),o=t("./shaders");function s(t,e,r,n){this.plot=t,this.vbo=e,this.shader=r,this.tickShader=n,this.ticks=[[],[]]}function l(t,e){return t-e}var u,c,h,d,f,p=s.prototype;p.draw=(u=[0,0],c=[0,0],h=[0,0],function(){for(var t=this.plot,e=this.vbo,r=this.shader,n=this.ticks,a=t.gl,i=t._tickBounds,o=t.dataBox,s=t.viewBox,l=t.gridLineWidth,d=t.gridLineColor,f=t.gridLineEnable,p=t.pixelRatio,m=0;m<2;++m){var g=i[m],y=i[m+2]-g,v=.5*(o[m+2]+o[m]),_=o[m+2]-o[m];c[m]=2*y/_,u[m]=2*(g-v)/_}r.bind(),e.bind(),r.attributes.dataCoord.pointer(),r.uniforms.dataShift=u,r.uniforms.dataScale=c;var x=0;for(m=0;m<2;++m){h[0]=h[1]=0,h[m]=1,r.uniforms.dataAxis=h,r.uniforms.lineWidth=l[m]/(s[m+2]-s[m])*p,r.uniforms.color=d[m];var b=6*n[m].length;f[m]&&b&&a.drawArrays(a.TRIANGLES,x,b),x+=b}}),p.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,d=s.gl,f=s._tickBounds,p=s.dataBox,m=s.viewBox,g=s.pixelRatio,y=s.screenBox,v=y[2]-y[0],_=y[3]-y[1],x=m[2]-m[0],b=m[3]-m[1],w=0;w<2;++w){var M=f[w],k=f[w+2]-M,T=.5*(p[w+2]+p[w]),L=p[w+2]-p[w];e[w]=2*k/L,t[w]=2*(M-T)/L}e[0]*=x/v,t[0]*=x/v,e[1]*=b/_,t[1]*=b/_,c.bind(),u.bind(),c.attributes.dataCoord.pointer();var A=c.uniforms;A.dataShift=t,A.dataScale=e;var S=s.tickMarkLength,E=s.tickMarkWidth,C=s.tickMarkColor,D=6*h[0].length,P=Math.min(i.ge(h[0],(p[0]-f[0])/(f[2]-f[0]),l),h[0].length),O=Math.min(i.gt(h[0],(p[2]-f[0])/(f[2]-f[0]),l),h[0].length),z=0+6*P,I=6*Math.max(0,O-P),R=Math.min(i.ge(h[1],(p[1]-f[1])/(f[3]-f[1]),l),h[1].length),F=Math.min(i.gt(h[1],(p[3]-f[1])/(f[3]-f[1]),l),h[1].length),N=D+6*R,Y=6*Math.max(0,F-R);a[0]=2*(m[0]-S[1])/v-1,a[1]=(m[3]+m[1])/_-1,o[0]=S[1]*g/v,o[1]=E[1]*g/_,Y&&(A.color=C[1],A.tickScale=o,A.dataAxis=n,A.screenOffset=a,d.drawArrays(d.TRIANGLES,N,Y)),a[0]=(m[2]+m[0])/v-1,a[1]=2*(m[1]-S[0])/_-1,o[0]=E[0]*g/v,o[1]=S[0]*g/_,I&&(A.color=C[0],A.tickScale=o,A.dataAxis=r,A.screenOffset=a,d.drawArrays(d.TRIANGLES,z,I)),a[0]=2*(m[2]+S[3])/v-1,a[1]=(m[3]+m[1])/_-1,o[0]=S[3]*g/v,o[1]=E[3]*g/_,Y&&(A.color=C[3],A.tickScale=o,A.dataAxis=n,A.screenOffset=a,d.drawArrays(d.TRIANGLES,N,Y)),a[0]=(m[2]+m[0])/v-1,a[1]=2*(m[3]+S[2])/_-1,o[0]=E[2]*g/v,o[1]=S[2]*g/_,I&&(A.color=C[2],A.tickScale=o,A.dataAxis=r,A.screenOffset=a,d.drawArrays(d.TRIANGLES,z,I))}}(),p.update=(d=[1,1,-1,-1,1,-1],f=[1,-1,1,1,-1,-1],function(t){for(var e=t.ticks,r=t.bounds,n=new Float32Array(18*(e[0].length+e[1].length)),a=(this.plot.zeroLineEnable,0),i=[[],[]],o=0;o<2;++o)for(var s=i[o],l=e[o],u=r[o],c=r[o+2],h=0;h<l.length;++h){var p=(l[h].x-u)/(c-u);s.push(p);for(var m=0;m<6;++m)n[a++]=p,n[a++]=d[m],n[a++]=f[m]}this.ticks=i,this.vbo.update(n)}),p.dispose=function(){this.vbo.dispose(),this.shader.dispose(),this.tickShader.dispose()}},{"./shaders":284,"binary-search-bounds":286,"gl-buffer":241,"gl-shader":301}],283:[function(t,e,r){e.exports=function(t){var e=t.gl;return new o(t,n(e,[-1,-1,-1,1,1,-1,1,1]),a(e,i.lineVert,i.lineFrag))};var n=t("gl-buffer"),a=t("gl-shader"),i=t("./shaders");function o(t,e,r){this.plot=t,this.vbo=e,this.shader=r}var s,l,u=o.prototype;u.bind=function(){var t=this.shader;this.vbo.bind(),this.shader.bind(),t.attributes.coord.pointer(),t.uniforms.screenBox=this.plot.screenBox},u.drawLine=(s=[0,0],l=[0,0],function(t,e,r,n,a,i){var o=this.plot,u=this.shader,c=o.gl;s[0]=t,s[1]=e,l[0]=r,l[1]=n,u.uniforms.start=s,u.uniforms.end=l,u.uniforms.width=a*o.pixelRatio,u.uniforms.color=i,c.drawArrays(c.TRIANGLE_STRIP,0,4)}),u.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{"./shaders":284,"gl-buffer":241,"gl-shader":301}],284:[function(t,e,r){var n=t("glslify"),a=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:n(["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:a,textVert:n(["#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:a,gridVert:n(["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:a,boxVert:n(["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:n(["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"])}},{glslify:409}],285:[function(t,e,r){e.exports=function(t){var e=t.gl;return new l(t,n(e),a(e,s.textVert,s.textFrag))};var n=t("gl-buffer"),a=t("gl-shader"),i=t("text-cache"),o=t("binary-search-bounds"),s=t("./shaders");function l(t,e,r){this.plot=t,this.vbo=e,this.shader=r,this.tickOffset=[[],[]],this.tickX=[[],[]],this.labelOffset=[0,0],this.labelCount=[0,0]}var u,c,h,d,f,p,m=l.prototype;m.drawTicks=(u=[0,0],c=[0,0],h=[0,0],function(t){var e=this.plot,r=this.shader,n=this.tickX[t],a=this.tickOffset[t],i=e.gl,s=e.viewBox,l=e.dataBox,d=e.screenBox,f=e.pixelRatio,p=e.tickEnable,m=e.tickPad,g=e.tickColor,y=e.tickAngle,v=e.labelEnable,_=e.labelPad,x=e.labelColor,b=e.labelAngle,w=this.labelOffset[t],M=this.labelCount[t],k=o.lt(n,l[t]),T=o.le(n,l[t+2]);u[0]=u[1]=0,u[t]=1,c[t]=(s[2+t]+s[t])/(d[2+t]-d[t])-1;var L=2/d[2+(1^t)]-d[1^t];c[1^t]=L*s[1^t]-1,p[t]&&(c[1^t]-=L*f*m[t],k<T&&a[T]>a[k]&&(r.uniforms.dataAxis=u,r.uniforms.screenOffset=c,r.uniforms.color=g[t],r.uniforms.angle=y[t],i.drawArrays(i.TRIANGLES,a[k],a[T]-a[k]))),v[t]&&M&&(c[1^t]-=L*f*_[t],r.uniforms.dataAxis=h,r.uniforms.screenOffset=c,r.uniforms.color=x[t],r.uniforms.angle=b[t],i.drawArrays(i.TRIANGLES,w,M)),c[1^t]=L*s[2+(1^t)]-1,p[t+2]&&(c[1^t]+=L*f*m[t+2],k<T&&a[T]>a[k]&&(r.uniforms.dataAxis=u,r.uniforms.screenOffset=c,r.uniforms.color=g[t+2],r.uniforms.angle=y[t+2],i.drawArrays(i.TRIANGLES,a[k],a[T]-a[k]))),v[t+2]&&M&&(c[1^t]+=L*f*_[t+2],r.uniforms.dataAxis=h,r.uniforms.screenOffset=c,r.uniforms.color=x[t+2],r.uniforms.angle=b[t+2],i.drawArrays(i.TRIANGLES,w,M))}),m.drawTitle=function(){var t=[0,0],e=[0,0];return function(){var r=this.plot,n=this.shader,a=r.gl,i=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-i[c])/(i[2+c]-i[c])-1;n.bind(),n.uniforms.dataAxis=t,n.uniforms.screenOffset=e,n.uniforms.angle=s,n.uniforms.color=l,a.drawArrays(a.TRIANGLES,this.titleOffset,this.titleCount)}}}(),m.bind=(d=[0,0],f=[0,0],p=[0,0],function(){var t=this.plot,e=this.shader,r=t._tickBounds,n=t.dataBox,a=t.screenBox,i=t.viewBox;e.bind();for(var o=0;o<2;++o){var s=r[o],l=r[o+2]-s,u=.5*(n[o+2]+n[o]),c=n[o+2]-n[o],h=i[o],m=i[o+2]-h,g=a[o],y=a[o+2]-g;f[o]=2*l/c*m/y,d[o]=2*(s-u)/c*m/y}p[1]=2*t.pixelRatio/(a[3]-a[1]),p[0]=p[1]*(a[3]-a[1])/(a[2]-a[0]),e.uniforms.dataScale=f,e.uniforms.dataShift=d,e.uniforms.textScale=p,this.vbo.bind(),e.attributes.textCoordinate.pointer()}),m.update=function(t){var e,r,n,a,o,s=[],l=t.ticks,u=t.bounds;for(o=0;o<2;++o){var c=[Math.floor(s.length/3)],h=[-1/0],d=l[o];for(e=0;e<d.length;++e){var f=d[e],p=f.x,m=f.text,g=f.font||"sans-serif";a=f.fontSize||12;for(var y=1/(u[o+2]-u[o]),v=u[o],_=m.split("\n"),x=0;x<_.length;x++)for(n=i(g,_[x]).data,r=0;r<n.length;r+=2)s.push(n[r]*a,-n[r+1]*a-x*a*1.2,(p-v)*y);c.push(Math.floor(s.length/3)),h.push(p)}this.tickOffset[o]=c,this.tickX[o]=h}for(o=0;o<2;++o){for(this.labelOffset[o]=Math.floor(s.length/3),n=i(t.labelFont[o],t.labels[o],{textAlign:"center"}).data,a=t.labelSize[o],e=0;e<n.length;e+=2)s.push(n[e]*a,-n[e+1]*a,0);this.labelCount[o]=Math.floor(s.length/3)-this.labelOffset[o]}for(this.titleOffset=Math.floor(s.length/3),n=i(t.titleFont,t.title).data,a=t.titleSize,e=0;e<n.length;e+=2)s.push(n[e]*a,-n[e+1]*a,0);this.titleCount=Math.floor(s.length/3)-this.titleOffset,this.vbo.update(s)},m.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{"./shaders":284,"binary-search-bounds":286,"gl-buffer":241,"gl-shader":301,"text-cache":536}],286:[function(t,e,r){arguments[4][111][0].apply(r,arguments)},{dup:111}],287:[function(t,e,r){e.exports=function(t){var e=t.gl,r=new l(e,n(e,[e.drawingBufferWidth,e.drawingBufferHeight]));return r.grid=a(r),r.text=i(r),r.line=o(r),r.box=s(r),r.update(t),r};var n=t("gl-select-static"),a=t("./lib/grid"),i=t("./lib/text"),o=t("./lib/line"),s=t("./lib/box");function l(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}var u=l.prototype;function c(t){for(var e=t.slice(),r=0;r<e.length;++r)e[r]=e[r].slice();return e}function h(t,e){return t.x-e.x}u.setDirty=function(){this.dirty=this.pickDirty=!0},u.setOverlayDirty=function(){this.dirty=!0},u.nextDepthValue=function(){return this._depthCounter++/65536},u.draw=function(){var t=this.gl,e=this.screenBox,r=this.viewBox,n=this.dataBox,a=this.pixelRatio,i=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){if(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),this.borderColor){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),i.draw();var h=this.zeroLineEnable,d=this.zeroLineColor,f=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],f[p],d[p]):o.drawLine(e[0],m,e[2],m,f[p],d[p])}}for(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 g=this.borderLineEnable,y=this.borderLineWidth,v=this.borderLineColor;for(g[1]&&o.drawLine(r[0],r[1]-.5*y[1]*a,r[0],r[3]+.5*y[3]*a,y[1],v[1]),g[0]&&o.drawLine(r[0]-.5*y[0]*a,r[1],r[2]+.5*y[2]*a,r[1],y[0],v[0]),g[3]&&o.drawLine(r[2],r[1]-.5*y[1]*a,r[2],r[3]+.5*y[3]*a,y[3],v[3]),g[2]&&o.drawLine(r[0]-.5*y[0]*a,r[3],r[2]+.5*y[2]*a,r[3],y[2],v[2]),s.bind(),p=0;p<2;++p)s.drawTicks(p);this.titleEnable&&s.drawTitle();var _=this.overlays;for(p=0;p<_.length;++p)_[p].draw();t.disable(t.SCISSOR_TEST),t.disable(t.BLEND),t.depthMask(!0)}},u.drawPick=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()}},u.pick=function(t,e){if(!this.static){var r=this.pixelRatio,n=this.pickPixelRatio,a=this.viewBox,i=0|Math.round((t-a[0]/r)*n),o=0|Math.round((e-a[1]/r)*n),s=this.pickBuffer.query(i,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(i,o,l);if(h)return h}return null}},u.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()},u.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())},u.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()},u.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,a=(n[2]-n[0])/(n[3]-n[1]);this.setDataBox(t.dataBox||[-10,-10/a,10,10/a]),this.borderColor=!1!==t.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=c(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=c(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=c(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=c(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=c(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=c(t.borderLineColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]);var i=t.ticks||[[],[]],o=this._tickBounds;o[0]=o[1]=1/0,o[2]=o[3]=-1/0;for(var s=0;s<2;++s){var l=i[s].slice(0);0!==l.length&&(l.sort(h),o[s]=Math.min(o[s],l[0].x),o[s+2]=Math.max(o[s+2],l[l.length-1].x))}this.grid.update({bounds:o,ticks:i}),this.text.update({bounds:o,ticks:i,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()},u.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();for(this.objects.length=0,t=this.overlays.length-1;t>=0;--t)this.overlays[t].dispose();this.overlays.length=0,this.gl=null},u.addObject=function(t){this.objects.indexOf(t)<0&&(this.objects.push(t),this.setDirty())},u.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}},u.addOverlay=function(t){this.overlays.indexOf(t)<0&&(this.overlays.push(t),this.setOverlayDirty())},u.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":281,"./lib/grid":282,"./lib/line":283,"./lib/text":285,"gl-select-static":300}],288:[function(t,e,r){e.exports=function(t,e){t=t||document.body;var r=[.01,1/0];"distanceLimits"in(e=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 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:r}),c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],h=0,d=t.clientWidth,f=t.clientHeight,p={keyBindingMode:"rotate",enableWheel:!0,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,_ortho:e._ortho||e.projection&&"orthographic"===e.projection.type||!1,tick:function(){var e=n(),r=this.delay,a=e-2*r;u.idle(e-r),u.recalcMatrix(a),u.flush(e-(100+2*r));for(var i=!0,o=u.computedMatrix,s=0;s<16;++s)i=i&&c[s]===o[s],c[s]=o[s];var l=t.clientWidth===d&&t.clientHeight===f;return d=t.clientWidth,f=t.clientHeight,i?!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)}};return 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){var e=u.computedUp.slice(),r=u.computedEye.slice(),a=u.computedCenter.slice();if(u.setMode(t),"turntable"===t){var i=n();u._active.lookAt(i,r,a,e),u._active.lookAt(i+500,r,a,[0,0,1]),u._active.flush(i)}return u.getMode()},enumerable:!0},center:{get:function(){return u.computedCenter},set:function(t){return u.lookAt(u.lastT(),null,t),u.computedCenter},enumerable:!0},eye:{get:function(){return u.computedEye},set:function(t){return u.lookAt(u.lastT(),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(r)},set:function(t){return u.setDistanceLimits(t),t},enumerable:!0}}),t.addEventListener("contextmenu",(function(t){return t.preventDefault(),!1})),p._lastX=-1,p._lastY=-1,p._lastMods={shift:!1,control:!1,alt:!1,meta:!1},p.enableMouseListeners=function(){function e(e,r,a,i){var o=p.keyBindingMode;if(!1!==o){var s="rotate"===o,l="pan"===o,c="zoom"===o,d=!!i.control,f=!!i.alt,m=!!i.shift,g=!!(1&e),y=!!(2&e),v=!!(4&e),_=1/t.clientHeight,x=_*(r-p._lastX),b=_*(a-p._lastY),w=p.flipX?1:-1,M=p.flipY?1:-1,k=Math.PI*p.rotateSpeed,T=n();if(-1!==p._lastX&&-1!==p._lastY&&((s&&g&&!d&&!f&&!m||g&&!d&&!f&&m)&&u.rotate(T,w*k*x,-M*k*b,0),(l&&g&&!d&&!f&&!m||y||g&&d&&!f&&!m)&&u.pan(T,-p.translateSpeed*x*h,p.translateSpeed*b*h,0),c&&g&&!d&&!f&&!m||v||g&&!d&&f&&!m)){var L=-p.zoomSpeed*b/window.innerHeight*(T-u.lastT())*100;u.pan(T,0,0,h*(Math.exp(L)-1))}return p._lastX=r,p._lastY=a,p._lastMods=i,!0}}p.mouseListener=i(t,e),t.addEventListener("touchstart",(function(r){var n=s(r.changedTouches[0],t);e(0,n[0],n[1],p._lastMods),e(1,n[0],n[1],p._lastMods),r.preventDefault()}),!!l&&{passive:!1}),t.addEventListener("touchmove",(function(r){var n=s(r.changedTouches[0],t);e(1,n[0],n[1],p._lastMods),r.preventDefault()}),!!l&&{passive:!1}),t.addEventListener("touchend",(function(t){e(0,p._lastX,p._lastY,p._lastMods),t.preventDefault()}),!!l&&{passive:!1}),p.wheelListener=o(t,(function(t,e){if(!1!==p.keyBindingMode&&p.enableWheel){var r=p.flipX?1:-1,a=p.flipY?1:-1,i=n();if(Math.abs(t)>Math.abs(e))u.rotate(i,0,0,-t*r*Math.PI*p.rotateSpeed/window.innerWidth);else if(!p._ortho){var o=-p.zoomSpeed*a*e/window.innerHeight*(i-u.lastT())/20;u.pan(i,0,0,h*(Math.exp(o)-1))}}}),!0)},p.enableMouseListeners(),p};var n=t("right-now"),a=t("3d-view"),i=t("mouse-change"),o=t("mouse-wheel"),s=t("mouse-event-offset"),l=t("has-passive-events")},{"3d-view":52,"has-passive-events":411,"mouse-change":435,"mouse-event-offset":436,"mouse-wheel":438,"right-now":504}],289:[function(t,e,r){var n=t("glslify"),a=t("gl-shader"),i=n(["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}"]),o=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}"]);e.exports=function(t){return a(t,i,o,null,[{name:"position",type:"vec2"}])}},{"gl-shader":301,glslify:409}],290:[function(t,e,r){var n=t("./camera.js"),a=t("gl-axes3d"),i=t("gl-axes3d/properties"),o=t("gl-spikes3d"),s=t("gl-select-static"),l=t("gl-fbo"),u=t("a-big-triangle"),c=t("mouse-change"),h=t("mouse-wheel"),d=t("gl-mat4/perspective"),f=t("gl-mat4/ortho"),p=t("./lib/shader"),m=t("is-mobile")({tablet:!0});function g(){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 y(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}return e>0?(r=Math.round(Math.pow(10,e)),Math.ceil(t/r)*r):Math.ceil(t)}function v(t){return"boolean"!=typeof t||t}e.exports={createScene:function(t){(t=t||{}).camera=t.camera||{};var e=t.canvas;e||(e=document.createElement("canvas"),t.container?t.container.appendChild(e):document.body.appendChild(e));var r=t.gl;if(r||(r=function(t,e){var r=null;try{(r=t.getContext("webgl",e))||(r=t.getContext("experimental-webgl",e))}catch(t){return null}return r}(e,t.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:m})),!r)throw new Error("webgl not supported");var _=t.bounds||[[-10,-10,-10],[10,10,10]],x=new g,b=l(r,[r.drawingBufferWidth,r.drawingBufferHeight],{preferFloat:!m}),w=p(r),M=t.cameraObject&&!0===t.cameraObject._ortho||t.camera.projection&&"orthographic"===t.camera.projection.type||!1,k={eye:t.camera.eye||[2,0,0],center:t.camera.center||[0,0,0],up:t.camera.up||[0,1,0],zoomMin:t.camera.zoomMax||.1,zoomMax:t.camera.zoomMin||100,mode:t.camera.mode||"turntable",_ortho:M},T=t.axes||{},L=a(r,T);L.enable=!T.disable;var A=t.spikes||{},S=o(r,A),E=[],C=[],D=[],P=[],O=!0,z=!0,I=new Array(16),R=new Array(16),F={view:null,projection:I,model:R,_ortho:!1},N=(z=!0,[r.drawingBufferWidth,r.drawingBufferHeight]),Y=t.cameraObject||n(e,k),j={gl:r,contextLost:!1,pixelRatio:t.pixelRatio||1,canvas:e,selection:x,camera:Y,axes:L,axesPixels:null,spikes:S,bounds:_,objects:E,shape:N,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:v(t.autoResize),autoBounds:v(t.autoBounds),autoScale:!!t.autoScale,autoCenter:v(t.autoCenter),clipToBounds:v(t.clipToBounds),snapToData:!!t.snapToData,onselect:t.onselect||null,onrender:t.onrender||null,onclick:t.onclick||null,cameraParams:F,oncontextloss:null,mouseListener:null,_stopped:!1},B=[r.drawingBufferWidth/j.pixelRatio|0,r.drawingBufferHeight/j.pixelRatio|0];function H(){if(!j._stopped&&j.autoResize){var t=e.parentNode,r=1,n=1;t&&t!==document.body?(r=t.clientWidth,n=t.clientHeight):(r=window.innerWidth,n=window.innerHeight);var a=0|Math.ceil(r*j.pixelRatio),i=0|Math.ceil(n*j.pixelRatio);if(a!==e.width||i!==e.height){e.width=a,e.height=i;var o=e.style;o.position=o.position||"absolute",o.left="0px",o.top="0px",o.width=r+"px",o.height=n+"px",O=!0}}}function U(){for(var t=E.length,e=P.length,n=0;n<e;++n)D[n]=0;t:for(n=0;n<t;++n){var a=E[n],i=a.pickSlots;if(i){for(var o=0;o<e;++o)if(D[o]+i<255){C[n]=o,a.setPickBase(D[o]+1),D[o]+=i;continue t}var l=s(r,N);C[n]=e,P.push(l),D.push(i),a.setPickBase(1),e+=1}else C[n]=-1}for(;e>0&&0===D[e-1];)D.pop(),P.pop().dispose()}function V(){if(j.contextLost)return!0;r.isContextLost()&&(j.contextLost=!0,j.mouseListener.enabled=!1,j.selection.object=null,j.oncontextloss&&j.oncontextloss())}j.autoResize&&H(),window.addEventListener("resize",H),j.update=function(t){j._stopped||(t=t||{},O=!0,z=!0)},j.add=function(t){j._stopped||(t.axes=L,E.push(t),C.push(-1),O=!0,z=!0,U())},j.remove=function(t){if(!j._stopped){var e=E.indexOf(t);e<0||(E.splice(e,1),C.pop(),O=!0,z=!0,U())}},j.dispose=function(){if(!j._stopped&&(j._stopped=!0,window.removeEventListener("resize",H),e.removeEventListener("webglcontextlost",V),j.mouseListener.enabled=!1,!j.contextLost)){L.dispose(),S.dispose();for(var t=0;t<E.length;++t)E[t].dispose();for(b.dispose(),t=0;t<P.length;++t)P[t].dispose();w.dispose(),r=null,L=null,S=null,E=[]}},j.wheelListener=h(e,(function(t,e){if(!1!==Y.keyBindingMode&&Y.enableWheel&&Y._ortho){var r=t>e?1.1:1/1.1;j.aspect[0]*=r,j.aspect[1]*=r,j.aspect[2]*=r,j.redraw()}}),!0),j._mouseRotating=!1,j._prevButtons=0,j.enableMouseListeners=function(){j.mouseListener=c(e,(function(t,e,r){if(!j._stopped){var n=P.length,a=E.length,i=x.object;x.distance=1/0,x.mouse[0]=e,x.mouse[1]=r,x.object=null,x.screen=null,x.dataCoordinate=x.dataPosition=null;var o=!1;if(t&&j._prevButtons)j._mouseRotating=!0;else{j._mouseRotating&&(z=!0),j._mouseRotating=!1;for(var s=0;s<n;++s){var l=P[s].query(e,B[1]-r-1,j.pickRadius);if(l){if(l.distance>x.distance)continue;for(var u=0;u<a;++u){var c=E[u];if(C[u]===s){var h=c.pick(l);h&&(x.buttons=t,x.screen=l.coord,x.distance=l.distance,x.object=c,x.index=h.distance,x.dataPosition=h.position,x.dataCoordinate=h.dataCoordinate,x.data=h,o=!0)}}}}}i&&i!==x.object&&(i.highlight&&i.highlight(null),O=!0),x.object&&(x.object.highlight&&x.object.highlight(x.data),O=!0),(o=o||x.object!==i)&&j.onselect&&j.onselect(x),1&t&&!(1&j._prevButtons)&&j.onclick&&j.onclick(x),j._prevButtons=t}}))},e.addEventListener("webglcontextlost",V);var W=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],G=[W[0].slice(),W[1].slice()];function q(){if(!V()){H();var t=j.camera.tick();F.view=j.camera.matrix,O=O||t,z=z||t,L.pixelRatio=j.pixelRatio,S.pixelRatio=j.pixelRatio;var e=E.length,n=W[0],a=W[1];n[0]=n[1]=n[2]=1/0,a[0]=a[1]=a[2]=-1/0;for(var o=0;o<e;++o){(Y=E[o]).pixelRatio=j.pixelRatio,Y.axes=j.axes,O=O||!!Y.dirty,z=z||!!Y.dirty;var s=Y.bounds;if(s)for(var l=s[0],c=s[1],h=0;h<3;++h)n[h]=Math.min(n[h],l[h]),a[h]=Math.max(a[h],c[h])}var p=j.bounds;if(j.autoBounds)for(h=0;h<3;++h){if(a[h]<n[h])n[h]=-1,a[h]=1;else{n[h]===a[h]&&(n[h]-=1,a[h]+=1);var m=.05*(a[h]-n[h]);n[h]=n[h]-m,a[h]=a[h]+m}p[0][h]=n[h],p[1][h]=a[h]}var g=!1;for(h=0;h<3;++h)g=g||G[0][h]!==p[0][h]||G[1][h]!==p[1][h],G[0][h]=p[0][h],G[1][h]=p[1][h];if(z=z||g,O=O||g){if(g){var v=[0,0,0];for(o=0;o<3;++o)v[o]=y((p[1][o]-p[0][o])/10);L.autoTicks?L.update({bounds:p,tickSpacing:v}):L.update({bounds:p})}var _=r.drawingBufferWidth,k=r.drawingBufferHeight;for(N[0]=_,N[1]=k,B[0]=0|Math.max(_/j.pixelRatio,1),B[1]=0|Math.max(k/j.pixelRatio,1),M?(f(I,-_/k,_/k,-1,1,j.zNear,j.zFar),F._ortho=!0):(d(I,j.fovy,_/k,j.zNear,j.zFar),F._ortho=!1),o=0;o<16;++o)R[o]=0;R[15]=1;var T=0;for(o=0;o<3;++o)T=Math.max(T,p[1][o]-p[0][o]);for(o=0;o<3;++o)j.autoScale?R[5*o]=j.aspect[o]/(p[1][o]-p[0][o]):R[5*o]=1/T,j.autoCenter&&(R[12+o]=.5*-R[5*o]*(p[0][o]+p[1][o]));for(o=0;o<e;++o)(Y=E[o]).axesBounds=p,j.clipToBounds&&(Y.clipBounds=p);x.object&&(j.snapToData?S.position=x.dataCoordinate:S.position=x.dataPosition,S.bounds=p),z&&(z=!1,function(){if(!V()){r.colorMask(!0,!0,!0,!0),r.depthMask(!0),r.disable(r.BLEND),r.enable(r.DEPTH_TEST);for(var t=E.length,e=P.length,n=0;n<e;++n){var a=P[n];a.shape=B,a.begin();for(var i=0;i<t;++i)if(C[i]===n){var o=E[i];o.drawPick&&(o.pixelRatio=1,o.drawPick(F))}a.end()}}}()),j.axesPixels=i(j.axes,F,_,k),j.onrender&&j.onrender(),r.bindFramebuffer(r.FRAMEBUFFER,null),r.viewport(0,0,_,k);var A=j.clearColor;r.clearColor(A[0],A[1],A[2],A[3]),r.clear(r.COLOR_BUFFER_BIT|r.DEPTH_BUFFER_BIT),r.depthMask(!0),r.colorMask(!0,!0,!0,!0),r.enable(r.DEPTH_TEST),r.depthFunc(r.LEQUAL),r.disable(r.BLEND),r.disable(r.CULL_FACE);var D=!1;for(L.enable&&(D=D||L.isTransparent(),L.draw(F)),S.axes=L,x.object&&S.draw(F),r.disable(r.CULL_FACE),o=0;o<e;++o)(Y=E[o]).axes=L,Y.pixelRatio=j.pixelRatio,Y.isOpaque&&Y.isOpaque()&&Y.draw(F),Y.isTransparent&&Y.isTransparent()&&(D=!0);if(D){for(b.shape=N,b.bind(),r.clear(r.DEPTH_BUFFER_BIT),r.colorMask(!1,!1,!1,!1),r.depthMask(!0),r.depthFunc(r.LESS),L.enable&&L.isTransparent()&&L.drawTransparent(F),o=0;o<e;++o)(Y=E[o]).isOpaque&&Y.isOpaque()&&Y.draw(F);for(r.enable(r.BLEND),r.blendEquation(r.FUNC_ADD),r.blendFunc(r.ONE,r.ONE_MINUS_SRC_ALPHA),r.colorMask(!0,!0,!0,!0),r.depthMask(!1),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),L.isTransparent()&&L.drawTransparent(F),o=0;o<e;++o){var Y;(Y=E[o]).isTransparent&&Y.isTransparent()&&Y.drawTransparent(F)}r.bindFramebuffer(r.FRAMEBUFFER,null),r.blendFunc(r.ONE,r.ONE_MINUS_SRC_ALPHA),r.disable(r.DEPTH_TEST),w.bind(),b.color[0].bind(0),w.uniforms.accumBuffer=0,u(r),r.disable(r.BLEND)}for(O=!1,o=0;o<e;++o)E[o].dirty=!1}}}return j.enableMouseListeners(),function t(){j._stopped||j.contextLost||(q(),requestAnimationFrame(t))}(),j.redraw=function(){j._stopped||(O=!0,q())},j},createCamera:n}},{"./camera.js":288,"./lib/shader":289,"a-big-triangle":59,"gl-axes3d":233,"gl-axes3d/properties":240,"gl-fbo":249,"gl-mat4/ortho":268,"gl-mat4/perspective":269,"gl-select-static":300,"gl-spikes3d":310,"is-mobile":420,"mouse-change":435,"mouse-wheel":438}],291:[function(t,e,r){var n=t("glslify");r.pointVertex=n(["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=n(["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=n(["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=n(["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"])},{glslify:409}],292:[function(t,e,r){var n=t("gl-shader"),a=t("gl-buffer"),i=t("typedarray-pool"),o=t("./lib/shader");function s(t,e,r,n,a){this.plot=t,this.offsetBuffer=e,this.pickBuffer=r,this.shader=n,this.pickShader=a,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}e.exports=function(t,e){var r=t.gl,i=new s(t,a(r),a(r),n(r,o.pointVertex,o.pointFragment),n(r,o.pickVertex,o.pickFragment));return i.update(e),t.addObject(i),i};var l,u,c=s.prototype;c.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.plot.removeObject(this)},c.update=function(t){var e;function r(e,r){return e in t?t[e]:r}t=t||{},this.sizeMin=r("sizeMin",.5),this.sizeMax=r("sizeMax",20),this.color=r("color",[1,0,0,1]).slice(),this.areaRatio=r("areaRatio",1),this.borderColor=r("borderColor",[0,0,0,1]).slice(),this.blend=r("blend",!1);var n=t.positions.length>>>1,a=t.positions instanceof Float32Array,o=t.idToIndex instanceof Int32Array&&t.idToIndex.length>=n,s=t.positions,l=a?s:i.mallocFloat32(s.length),u=o?t.idToIndex:i.mallocInt32(n);if(a||l.set(s),!o)for(l.set(s),e=0;e<n;e++)u[e]=e;this.points=s,this.offsetBuffer.update(l),this.pickBuffer.update(u),a||i.free(l),o||i.free(u),this.pointCount=n,this.pickOffset=0},c.unifiedDraw=(l=[1,0,0,0,1,0,0,0,1],u=[0,0,0,0],function(t){var e=void 0!==t,r=e?this.pickShader:this.shader,n=this.plot.gl,a=this.plot.dataBox;if(0===this.pointCount)return t;var i=a[2]-a[0],o=a[3]-a[1],s=function(t,e){var r,n=0,a=t.length>>>1;for(r=0;r<a;r++){var i=t[2*r],o=t[2*r+1];i>=e[0]&&i<=e[2]&&o>=e[1]&&o<=e[3]&&n++}return n}(this.points,a),c=this.plot.pickPixelRatio*Math.max(Math.min(this.sizeMinCap,this.sizeMin),Math.min(this.sizeMax,this.sizeMax/Math.pow(s,.33333)));l[0]=2/i,l[4]=2/o,l[6]=-2*a[0]/i-1,l[7]=-2*a[1]/o-1,this.offsetBuffer.bind(),r.bind(),r.attributes.position.pointer(),r.uniforms.matrix=l,r.uniforms.color=this.color,r.uniforms.borderColor=this.borderColor,r.uniforms.pointCloud=c<5,r.uniforms.pointSize=c,r.uniforms.centerFraction=Math.min(1,Math.max(0,Math.sqrt(1-this.areaRatio))),e&&(u[0]=255&t,u[1]=t>>8&255,u[2]=t>>16&255,u[3]=t>>24&255,this.pickBuffer.bind(),r.attributes.pickId.pointer(n.UNSIGNED_BYTE),r.uniforms.pickOffset=u,this.pickOffset=t);var h=n.getParameter(n.BLEND),d=n.getParameter(n.DITHER);return h&&!this.blend&&n.disable(n.BLEND),d&&n.disable(n.DITHER),n.drawArrays(n.POINTS,0,this.pointCount),h&&!this.blend&&n.enable(n.BLEND),d&&n.enable(n.DITHER),t+this.pointCount}),c.draw=c.unifiedDraw,c.drawPick=c.unifiedDraw,c.pick=function(t,e,r){var n=this.pickOffset,a=this.pointCount;if(r<n||r>=n+a)return null;var i=r-n,o=this.points;return{object:this,pointId:i,dataCoord:[o[2*i],o[2*i+1]]}}},{"./lib/shader":291,"gl-buffer":241,"gl-shader":301,"typedarray-pool":545}],293:[function(t,e,r){e.exports=function(t,e,r,n){var a,i,o,s,l,u=e[0],c=e[1],h=e[2],d=e[3],f=r[0],p=r[1],m=r[2],g=r[3];return(i=u*f+c*p+h*m+d*g)<0&&(i=-i,f=-f,p=-p,m=-m,g=-g),1-i>1e-6?(a=Math.acos(i),o=Math.sin(a),s=Math.sin((1-n)*a)/o,l=Math.sin(n*a)/o):(s=1-n,l=n),t[0]=s*u+l*f,t[1]=s*c+l*p,t[2]=s*h+l*m,t[3]=s*d+l*g,t}},{}],294:[function(t,e,r){e.exports=function(t){return t||0===t?t.toString():""}},{}],295:[function(t,e,r){var n=t("vectorize-text");e.exports=function(t,e,r){var i=a[e];if(i||(i=a[e]={}),t in i)return i[t];var o={textAlign:"center",textBaseline:"middle",lineHeight:1,font:e,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},triangles:!0},s=n(t,o);o.triangles=!1;var l,u,c=n(t,o);if(r&&1!==r){for(l=0;l<s.positions.length;++l)for(u=0;u<s.positions[l].length;++u)s.positions[l][u]/=r;for(l=0;l<c.positions.length;++l)for(u=0;u<c.positions[l].length;++u)c.positions[l][u]/=r}var h=[[1/0,1/0],[-1/0,-1/0]],d=c.positions.length;for(l=0;l<d;++l){var f=c.positions[l];for(u=0;u<2;++u)h[0][u]=Math.min(h[0][u],f[u]),h[1][u]=Math.max(h[1][u],f[u])}return i[t]=[s,c,h]};var a={}},{"vectorize-text":550}],296:[function(t,e,r){var n=t("gl-shader"),a=t("glslify"),i=a(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\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=a(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\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=a(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\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=a(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float opacity;\n\nvarying vec4 interpColor;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (\n outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) ||\n interpColor.a * opacity == 0.\n ) discard;\n gl_FragColor = interpColor * opacity;\n}\n"]),u=a(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float pickGroup;\n\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard;\n\n gl_FragColor = vec4(pickGroup, pickId.bgr);\n}"]),c=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],h={vertex:i,fragment:l,attributes:c},d={vertex:o,fragment:l,attributes:c},f={vertex:s,fragment:l,attributes:c},p={vertex:i,fragment:u,attributes:c},m={vertex:o,fragment:u,attributes:c},g={vertex:s,fragment:u,attributes:c};function y(t,e){var r=n(t,e),a=r.attributes;return a.position.location=0,a.color.location=1,a.glyph.location=2,a.id.location=3,r}r.createPerspective=function(t){return y(t,h)},r.createOrtho=function(t){return y(t,d)},r.createProject=function(t){return y(t,f)},r.createPickPerspective=function(t){return y(t,p)},r.createPickOrtho=function(t){return y(t,m)},r.createPickProject=function(t){return y(t,g)}},{"gl-shader":301,glslify:409}],297:[function(t,e,r){var n=t("is-string-blank"),a=t("gl-buffer"),i=t("gl-vao"),o=t("typedarray-pool"),s=t("gl-mat4/multiply"),l=t("./lib/shaders"),u=t("./lib/glyphs"),c=t("./lib/get-simple-string"),h=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function d(t,e){var r=t[0],n=t[1],a=t[2],i=t[3];return t[0]=e[0]*r+e[4]*n+e[8]*a+e[12]*i,t[1]=e[1]*r+e[5]*n+e[9]*a+e[13]*i,t[2]=e[2]*r+e[6]*n+e[10]*a+e[14]*i,t[3]=e[3]*r+e[7]*n+e[11]*a+e[15]*i,t}function f(t,e,r,n){return d(n,n),d(n,n),d(n,n)}function p(t,e){this.index=t,this.dataCoordinate=this.position=e}function m(t){return!0===t||t>1?1:t}function g(t,e,r,n,a,i,o,s,l,u,c,h){this.gl=t,this.pixelRatio=1,this.shader=e,this.orthoShader=r,this.projectShader=n,this.pointBuffer=a,this.colorBuffer=i,this.glyphBuffer=o,this.idBuffer=s,this.vao=l,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[2/3,2/3,2/3],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=u,this.pickOrthoShader=c,this.pickProjectShader=h,this.points=[],this._selectResult=new p(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}e.exports=function(t){var e=t.gl,r=l.createPerspective(e),n=l.createOrtho(e),o=l.createProject(e),s=l.createPickPerspective(e),u=l.createPickOrtho(e),c=l.createPickProject(e),h=a(e),d=a(e),f=a(e),p=a(e),m=new g(e,r,n,o,h,d,f,p,i(e,[{buffer:h,size:3,type:e.FLOAT},{buffer:d,size:4,type:e.FLOAT},{buffer:f,size:2,type:e.FLOAT},{buffer:p,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),s,u,c);return m.update(t),m};var y=g.prototype;y.pickSlots=1,y.setPickBase=function(t){this.pickId=t},y.isTransparent=function(){if(this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectHasAlpha)return!0;return!1},y.isOpaque=function(){if(!this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&!this.projectHasAlpha)return!0;return!1};var v=[0,0],_=[0,0,0],x=[0,0,0],b=[0,0,0,1],w=[0,0,0,1],M=h.slice(),k=[0,0,0],T=[[0,0,0],[0,0,0]];function L(t){return t[0]=t[1]=t[2]=0,t}function A(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=1,t}function S(t,e,r,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[r]=n,t}function E(t,e,r,n){var a,i=e.axesProject,o=e.gl,l=t.uniforms,u=r.model||h,c=r.view||h,d=r.projection||h,p=e.axesBounds,m=function(t){for(var e=T,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}(e.clipBounds);a=e.axes&&e.axes.lastCubeProps?e.axes.lastCubeProps.axis:[1,1,1],v[0]=2/o.drawingBufferWidth,v[1]=2/o.drawingBufferHeight,t.bind(),l.view=c,l.projection=d,l.screenSize=v,l.highlightId=e.highlightId,l.highlightScale=e.highlightScale,l.clipBounds=m,l.pickGroup=e.pickId/255,l.pixelRatio=n;for(var g=0;g<3;++g)if(i[g]){l.scale=e.projectScale[g],l.opacity=e.projectOpacity[g];for(var y=M,E=0;E<16;++E)y[E]=0;for(E=0;E<4;++E)y[5*E]=1;y[5*g]=0,a[g]<0?y[12+g]=p[0][g]:y[12+g]=p[1][g],s(y,u,y),l.model=y;var C=(g+1)%3,D=(g+2)%3,P=L(_),O=L(x);P[C]=1,O[D]=1;var z=f(0,0,0,A(b,P)),I=f(0,0,0,A(w,O));if(Math.abs(z[1])>Math.abs(I[1])){var R=z;z=I,I=R,R=P,P=O,O=R;var F=C;C=D,D=F}z[0]<0&&(P[C]=-1),I[1]>0&&(O[D]=-1);var N=0,Y=0;for(E=0;E<4;++E)N+=Math.pow(u[4*C+E],2),Y+=Math.pow(u[4*D+E],2);P[C]/=Math.sqrt(N),O[D]/=Math.sqrt(Y),l.axes[0]=P,l.axes[1]=O,l.fragClipBounds[0]=S(k,m[0],g,-1e8),l.fragClipBounds[1]=S(k,m[1],g,1e8),e.vao.bind(),e.vao.draw(o.TRIANGLES,e.vertexCount),e.lineWidth>0&&(o.lineWidth(e.lineWidth*n),e.vao.draw(o.LINES,e.lineVertexCount,e.vertexCount)),e.vao.unbind()}}var C=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function D(t,e,r,n,a,i,o){var s=r.gl;if((i===r.projectHasAlpha||o)&&E(e,r,n,a),i===r.hasAlpha||o){t.bind();var l=t.uniforms;l.model=n.model||h,l.view=n.view||h,l.projection=n.projection||h,v[0]=2/s.drawingBufferWidth,v[1]=2/s.drawingBufferHeight,l.screenSize=v,l.highlightId=r.highlightId,l.highlightScale=r.highlightScale,l.fragClipBounds=C,l.clipBounds=r.axes.bounds,l.opacity=r.opacity,l.pickGroup=r.pickId/255,l.pixelRatio=a,r.vao.bind(),r.vao.draw(s.TRIANGLES,r.vertexCount),r.lineWidth>0&&(s.lineWidth(r.lineWidth*a),r.vao.draw(s.LINES,r.lineVertexCount,r.vertexCount)),r.vao.unbind()}}function P(t,e,r,a){var i;i=Array.isArray(t)?e<t.length?t[e]:void 0:t,i=c(i);var o=!0;n(i)&&(i="▼",o=!1);var s=u(i,r,a);return{mesh:s[0],lines:s[1],bounds:s[2],visible:o}}y.draw=function(t){D(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,this.pixelRatio,!1,!1)},y.drawTransparent=function(t){D(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,this.pixelRatio,!0,!1)},y.drawPick=function(t){D(this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader,this.pickProjectShader,this,t,1,!0,!0)},y.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 a=0;a<3;++a)n.position[a]=n.dataCoordinate[a]=r[a];return n},y.highlight=function(t){if(t){var e=t.index,r=255&e,n=e>>8&255,a=e>>16&255;this.highlightId=[r/255,n/255,a/255,0]}else this.highlightId=[1,1,1,1]},y.update=function(t){if("perspective"in(t=t||{})&&(this.useOrtho=!t.perspective),"orthographic"in t&&(this.useOrtho=!!t.orthographic),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"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(this.projectHasAlpha=!1,"projectOpacity"in t){Array.isArray(t.projectOpacity)?this.projectOpacity=t.projectOpacity.slice():(r=+t.projectOpacity,this.projectOpacity=[r,r,r]);for(var n=0;n<3;++n)this.projectOpacity[n]=m(this.projectOpacity[n]),this.projectOpacity[n]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in t&&(this.opacity=m(t.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var a,i,s=t.position,l=t.font||"normal",u=t.alignment||[0,0];if(2===u.length)a=u[0],i=u[1];else for(a=[],i=[],n=0;n<u.length;++n)a[n]=u[n][0],i[n]=u[n][1];var c=[1/0,1/0,1/0],h=[-1/0,-1/0,-1/0],d=t.glyph,f=t.color,p=t.size,g=t.angle,y=t.lineColor,v=-1,_=0,x=0,b=0;if(s.length){b=s.length;t:for(n=0;n<b;++n){for(var w=s[n],M=0;M<3;++M)if(isNaN(w[M])||!isFinite(w[M]))continue t;var k=(Y=P(d,n,l,this.pixelRatio)).mesh,T=Y.lines,L=Y.bounds;_+=3*k.cells.length,x+=2*T.edges.length}}var A=_+x,S=o.mallocFloat(3*A),E=o.mallocFloat(4*A),C=o.mallocFloat(2*A),D=o.mallocUint32(A);if(A>0){var O=0,z=_,I=[0,0,0,1],R=[0,0,0,1],F=Array.isArray(f)&&Array.isArray(f[0]),N=Array.isArray(y)&&Array.isArray(y[0]);t:for(n=0;n<b;++n){for(v+=1,w=s[n],M=0;M<3;++M){if(isNaN(w[M])||!isFinite(w[M]))continue t;h[M]=Math.max(h[M],w[M]),c[M]=Math.min(c[M],w[M])}k=(Y=P(d,n,l,this.pixelRatio)).mesh,T=Y.lines,L=Y.bounds;var Y,j=Y.visible;if(j)if(Array.isArray(f)){if(3===(B=F?n<f.length?f[n]:[0,0,0,0]:f).length){for(M=0;M<3;++M)I[M]=B[M];I[3]=1}else if(4===B.length){for(M=0;M<4;++M)I[M]=B[M];!this.hasAlpha&&B[3]<1&&(this.hasAlpha=!0)}}else I[0]=I[1]=I[2]=0,I[3]=1;else I=[1,1,1,0];if(j)if(Array.isArray(y)){var B;if(3===(B=N?n<y.length?y[n]:[0,0,0,0]:y).length){for(M=0;M<3;++M)R[M]=B[M];R[M]=1}else if(4===B.length){for(M=0;M<4;++M)R[M]=B[M];!this.hasAlpha&&B[3]<1&&(this.hasAlpha=!0)}}else R[0]=R[1]=R[2]=0,R[3]=1;else R=[1,1,1,0];var H=.5;j?Array.isArray(p)?H=n<p.length?+p[n]:12:p?H=+p:this.useOrtho&&(H=12):H=0;var U=0;Array.isArray(g)?U=n<g.length?+g[n]:0:g&&(U=+g);var V=Math.cos(U),W=Math.sin(U);for(w=s[n],M=0;M<3;++M)h[M]=Math.max(h[M],w[M]),c[M]=Math.min(c[M],w[M]);var G=a,q=i;G=0,Array.isArray(a)?G=n<a.length?a[n]:0:a&&(G=a),q=0,Array.isArray(i)?q=n<i.length?i[n]:0:i&&(q=i);var Z=[G*=G>0?1-L[0][0]:G<0?1+L[1][0]:1,q*=q>0?1-L[0][1]:q<0?1+L[1][1]:1],X=k.cells||[],J=k.positions||[];for(M=0;M<X.length;++M)for(var K=X[M],$=0;$<3;++$){for(var Q=0;Q<3;++Q)S[3*O+Q]=w[Q];for(Q=0;Q<4;++Q)E[4*O+Q]=I[Q];D[O]=v;var tt=J[K[$]];C[2*O]=H*(V*tt[0]-W*tt[1]+Z[0]),C[2*O+1]=H*(W*tt[0]+V*tt[1]+Z[1]),O+=1}for(X=T.edges,J=T.positions,M=0;M<X.length;++M)for(K=X[M],$=0;$<2;++$){for(Q=0;Q<3;++Q)S[3*z+Q]=w[Q];for(Q=0;Q<4;++Q)E[4*z+Q]=R[Q];D[z]=v,tt=J[K[$]],C[2*z]=H*(V*tt[0]-W*tt[1]+Z[0]),C[2*z+1]=H*(W*tt[0]+V*tt[1]+Z[1]),z+=1}}}this.bounds=[c,h],this.points=s,this.pointCount=s.length,this.vertexCount=_,this.lineVertexCount=x,this.pointBuffer.update(S),this.colorBuffer.update(E),this.glyphBuffer.update(C),this.idBuffer.update(D),o.free(S),o.free(E),o.free(C),o.free(D)},y.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/get-simple-string":294,"./lib/glyphs":295,"./lib/shaders":296,"gl-buffer":241,"gl-mat4/multiply":267,"gl-vao":327,"is-string-blank":423,"typedarray-pool":545}],298:[function(t,e,r){var n=t("glslify");r.boxVertex=n(["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=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 color;\n\nvoid main() {\n gl_FragColor = color;\n}\n"])},{glslify:409}],299:[function(t,e,r){var n=t("gl-shader"),a=t("gl-buffer"),i=t("./lib/shaders");function o(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}e.exports=function(t,e){var r=t.gl,s=new o(t,a(r,[0,0,0,1,1,0,1,1]),n(r,i.boxVertex,i.boxFragment));return s.update(e),t.addOverlay(s),s};var s=o.prototype;s.draw=function(){if(this.enabled){var t=this.plot,e=this.selectBox,r=this.borderWidth,n=(this.innerFill,this.innerColor),a=(this.outerFill,this.outerColor),i=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],d=(e[1]-l[1])*(u[3]-u[1])/(l[3]-l[1])+u[1],f=(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]),d=Math.max(d,u[1]),f=Math.min(f,u[2]),p=Math.min(p,u[3]),!(f<h||p<d)){o.bind();var m=s[2]-s[0],g=s[3]-s[1];if(this.outerFill&&(o.drawBox(0,0,m,d,a),o.drawBox(0,d,h,p,a),o.drawBox(0,p,m,g,a),o.drawBox(f,d,m,p,a)),this.innerFill&&o.drawBox(h,d,f,p,n),r>0){var y=r*c;o.drawBox(h-y,d-y,f+y,d+y,i),o.drawBox(h-y,p-y,f+y,p+y,i),o.drawBox(h-y,d-y,h+y,p+y,i),o.drawBox(f-y,d-y,f+y,p+y,i)}}}},s.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()},s.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},{"./lib/shaders":298,"gl-buffer":241,"gl-shader":301}],300:[function(t,e,r){e.exports=function(t,e){return new u(t,n(t,e),a.mallocUint8(e[0]*e[1]*4))};var n=t("gl-fbo"),a=t("typedarray-pool"),i=t("ndarray"),o=t("bit-twiddle").nextPow2,s=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_16_arg0_<255||_inline_16_arg1_<255||_inline_16_arg2_<255||_inline_16_arg3_<255){var _inline_16_l=_inline_16_arg4_-_inline_16_arg6_[0],_inline_16_a=_inline_16_arg5_-_inline_16_arg6_[1],_inline_16_f=_inline_16_l*_inline_16_l+_inline_16_a*_inline_16_a;_inline_16_f<this_closestD2&&(this_closestD2=_inline_16_f,this_closestX=_inline_16_arg6_[0],this_closestY=_inline_16_arg6_[1])}}",args:[{name:"_inline_16_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg1_",lvalue:!1,rvalue:!0,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},{name:"_inline_16_arg5_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg6_",lvalue:!1,rvalue:!0,count:4}],thisVars:["this_closestD2","this_closestX","this_closestY"],localVars:["_inline_16_a","_inline_16_f","_inline_16_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});function l(t,e,r,n,a){this.coord=[t,e],this.id=r,this.value=n,this.distance=a}function u(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)}}var c=u.prototype;Object.defineProperty(c,"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){a.free(this.buffer);for(var n=this.buffer=a.mallocUint8(o(r*e*4)),i=0;i<r*e*4;++i)n[i]=255}return t}}}),c.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))},c.end=function(){var t=this.gl;t&&(t.bindFramebuffer(t.FRAMEBUFFER,null),this._readTimeout||clearTimeout(this._readTimeout),this._readTimeout=setTimeout(this._readCallback,1))},c.query=function(t,e,r){if(!this.gl)return null;var n=this.fbo.shape.slice();t|=0,e|=0,"number"!=typeof r&&(r=1);var a=0|Math.min(Math.max(t-r,0),n[0]),o=0|Math.min(Math.max(t+r,0),n[0]),u=0|Math.min(Math.max(e-r,0),n[1]),c=0|Math.min(Math.max(e+r,0),n[1]);if(o<=a||c<=u)return null;var h=[o-a,c-u],d=i(this.buffer,[h[0],h[1],4],[4,4*n[0],1],4*(a+n[0]*u)),f=s(d.hi(h[0],h[1],1),r,r),p=f[0],m=f[1];return p<0||Math.pow(this.radius,2)<f[2]?null:new l(p+a|0,m+u|0,d.get(p,m,0),[d.get(p,m,1),d.get(p,m,2),d.get(p,m,3)],Math.sqrt(f[2]))},c.dispose=function(){this.gl&&(this.fbo.dispose(),a.free(this.buffer),this.gl=null,this._readTimeout&&clearTimeout(this._readTimeout))}},{"bit-twiddle":92,"cwise/lib/wrapper":149,"gl-fbo":249,ndarray:450,"typedarray-pool":545}],301:[function(t,e,r){var n=t("./lib/create-uniforms"),a=t("./lib/create-attributes"),i=t("./lib/reflect"),o=t("./lib/shader-cache"),s=t("./lib/runtime-reflect"),l=t("./lib/GLError");function u(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}var c=u.prototype;function h(t,e){return t.name<e.name?-1:1}c.bind=function(){var t;this.program||this._relink();var 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)},c.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},c.update=function(t,e,r,u){if(!e||1===arguments.length){var c=t;t=c.vertex,e=c.fragment,r=c.uniforms,u=c.attributes}var d=this,f=d.gl,p=d._vref;d._vref=o.shader(f,f.VERTEX_SHADER,t),p&&p.dispose(),d.vertShader=d._vref.shader;var m=this._fref;if(d._fref=o.shader(f,f.FRAGMENT_SHADER,e),m&&m.dispose(),d.fragShader=d._fref.shader,!r||!u){var g=f.createProgram();if(f.attachShader(g,d.fragShader),f.attachShader(g,d.vertShader),f.linkProgram(g),!f.getProgramParameter(g,f.LINK_STATUS)){var y=f.getProgramInfoLog(g);throw new l(y,"Error linking program:"+y)}r=r||s.uniforms(f,g),u=u||s.attributes(f,g),f.deleteProgram(g)}(u=u.slice()).sort(h);var v,_=[],x=[],b=[];for(v=0;v<u.length;++v){var w=u[v];if(w.type.indexOf("mat")>=0){for(var M=0|w.type.charAt(w.type.length-1),k=new Array(M),T=0;T<M;++T)k[T]=b.length,x.push(w.name+"["+T+"]"),"number"==typeof w.location?b.push(w.location+T):Array.isArray(w.location)&&w.location.length===M&&"number"==typeof w.location[T]?b.push(0|w.location[T]):b.push(-1);_.push({name:w.name,type:w.type,locations:k})}else _.push({name:w.name,type:w.type,locations:[b.length]}),x.push(w.name),"number"==typeof w.location?b.push(0|w.location):b.push(-1)}var L=0;for(v=0;v<b.length;++v)if(b[v]<0){for(;b.indexOf(L)>=0;)L+=1;b[v]=L}var A=new Array(r.length);function S(){d.program=o.program(f,d._vref,d._fref,x,b);for(var t=0;t<r.length;++t)A[t]=f.getUniformLocation(d.program,r[t].name)}S(),d._relink=S,d.types={uniforms:i(r),attributes:i(u)},d.attributes=a(f,d,_,b),Object.defineProperty(d,"uniforms",n(f,d,r,A))},e.exports=function(t,e,r,n,a){var i=new u(t);return i.update(e,r,n,a),i}},{"./lib/GLError":302,"./lib/create-attributes":303,"./lib/create-uniforms":304,"./lib/reflect":305,"./lib/runtime-reflect":306,"./lib/shader-cache":307}],302:[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},{}],303:[function(t,e,r){e.exports=function(t,e,r,a){for(var i={},l=0,u=r.length;l<u;++l){var c=r[l],h=c.name,d=c.type,f=c.locations;switch(d){case"bool":case"int":case"float":o(t,e,f[0],a,1,i,h);break;default:if(d.indexOf("vec")>=0){if((p=d.charCodeAt(d.length-1)-48)<2||p>4)throw new n("","Invalid data type for attribute "+h+": "+d);o(t,e,f[0],a,p,i,h)}else{if(!(d.indexOf("mat")>=0))throw new n("","Unknown data type for attribute "+h+": "+d);var p;if((p=d.charCodeAt(d.length-1)-48)<2||p>4)throw new n("","Invalid data type for attribute "+h+": "+d);s(t,e,f,a,p,i,h)}}}return i};var n=t("./GLError");function a(t,e,r,n,a,i){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=a,this._constFunc=i}var i=a.prototype;function o(t,e,r,n,i,o,s){for(var l=["gl","v"],u=[],c=0;c<i;++c)l.push("x"+c),u.push("x"+c);l.push("if(x0.length===void 0){return gl.vertexAttrib"+i+"f(v,"+u.join()+")}else{return gl.vertexAttrib"+i+"fv(v,x0)}");var h=Function.apply(null,l),d=new a(t,e,r,n,i,h);Object.defineProperty(o,s,{set:function(e){return t.disableVertexAttribArray(n[r]),h(t,n[r],e),e},get:function(){return d},enumerable:!0})}function s(t,e,r,n,a,i,s){for(var l=new Array(a),u=new Array(a),c=0;c<a;++c)o(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(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),d=t["vertexAttrib"+a+"fv"];Object.defineProperty(i,s,{set:function(e){for(var i=0;i<a;++i){var o=n[r[i]];if(t.disableVertexAttribArray(o),Array.isArray(e[0]))d.call(t,o,e[i]);else{for(var s=0;s<a;++s)h[s]=e[a*i+s];d.call(t,o,h)}}return e},get:function(){return l},enumerable:!0})}i.pointer=function(t,e,r,n){var a=this._gl,i=this._locations[this._index];a.vertexAttribPointer(i,this._dimension,t||a.FLOAT,!!e,r||0,n||0),a.enableVertexAttribArray(i)},i.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(i,"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":302}],304:[function(t,e,r){var n=t("./reflect"),a=t("./GLError");function i(t){return new Function("y","return function(){return y}")(t)}function o(t,e){for(var r=new Array(t),n=0;n<t;++n)r[n]=e;return r}e.exports=function(t,e,r,s){function l(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;if((i=r.charCodeAt(r.length-1)-48)<2||i>4)throw new a("","Invalid uniform dimension type for matrix "+name+": "+r);return"gl.uniformMatrix"+i+"fv(locations["+e+"],false,obj"+t+")"}throw new a("","Unknown uniform data type for "+name+": "+r)}if((i=r.charCodeAt(r.length-1)-48)<2||i>4)throw new a("","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 a("","Unrecognized data type for vector "+name+": "+r)}}}function u(e){for(var n=["return function updateProperty(obj){"],a=function t(e,r){if("object"!=typeof r)return[[e,r]];var n=[];for(var a in r){var i=r[a],o=e;parseInt(a)+""===a?o+="["+a+"]":o+="."+a,"object"==typeof i?n.push.apply(n,t(o,i)):n.push([o,i])}return n}("",e),i=0;i<a.length;++i){var o=a[i],u=o[0],c=o[1];s[c]&&n.push(l(u,c,r[c].type))}return n.push("return obj}"),new Function("gl","locations",n.join("\n"))(t,s)}function c(n,l,c){if("object"==typeof c){var d=h(c);Object.defineProperty(n,l,{get:i(d),set:u(c),enumerable:!0,configurable:!1})}else s[c]?Object.defineProperty(n,l,{get:(f=c,new Function("gl","wrapper","locations","return function(){return gl.getUniform(wrapper.program,locations["+f+"])}")(t,e,s)),set:u(c),enumerable:!0,configurable:!1}):n[l]=function(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){if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new a("","Invalid data type");return"b"===t.charAt(0)?o(r,!1):o(r,0)}if(0===t.indexOf("mat")&&4===t.length){var r;if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new a("","Invalid uniform dimension type for matrix "+name+": "+t);return o(r*r,0)}throw new a("","Unknown uniform data type for "+name+": "+t)}}(r[c].type);var f}function h(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r<t.length;++r)c(e,r,t[r])}else for(var n in e={},t)c(e,n,t[n]);return e}var d=n(r,!0);return{get:i(h(d)),set:u(d),enumerable:!0,configurable:!0}}},{"./GLError":302,"./reflect":305}],305:[function(t,e,r){e.exports=function(t,e){for(var r={},n=0;n<t.length;++n)for(var a=t[n].name.split("."),i=r,o=0;o<a.length;++o){var s=a[o].split("[");if(s.length>1){s[0]in i||(i[s[0]]=[]),i=i[s[0]];for(var l=1;l<s.length;++l){var u=parseInt(s[l]);l<s.length-1||o<a.length-1?(u in i||(l<s.length-1?i[u]=[]:i[u]={}),i=i[u]):i[u]=e?n:t[n].type}}else o<a.length-1?(s[0]in i||(i[s[0]]={}),i=i[s[0]]):i[s[0]]=e?n:t[n].type}return r}},{}],306:[function(t,e,r){r.uniforms=function(t,e){for(var r=t.getProgramParameter(e,t.ACTIVE_UNIFORMS),n=[],a=0;a<r;++a){var o=t.getActiveUniform(e,a);if(o){var s=i(t,o.type);if(o.size>1)for(var l=0;l<o.size;++l)n.push({name:o.name.replace("[0]","["+l+"]"),type:s});else n.push({name:o.name,type:s})}}return n},r.attributes=function(t,e){for(var r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),n=[],a=0;a<r;++a){var o=t.getActiveAttrib(e,a);o&&n.push({name:o.name,type:i(t,o.type)})}return n};var n={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"},a=null;function i(t,e){if(!a){var r=Object.keys(n);a={};for(var i=0;i<r.length;++i){var o=r[i];a[t[o]]=n[o]}}return a[e]}},{}],307:[function(t,e,r){r.shader=function(t,e,r){return c(t).getShaderReference(e,r)},r.program=function(t,e,r,n,a){return c(t).getProgram(e,r,n,a)};var n=t("./GLError"),a=t("gl-format-compiler-error"),i=new("undefined"==typeof WeakMap?t("weakmap-shim"):WeakMap),o=0;function s(t,e,r,n,a,i,o){this.id=t,this.src=e,this.type=r,this.shader=n,this.count=i,this.programs=[],this.cache=o}function l(t){this.gl=t,this.shaders=[{},{}],this.programs={}}s.prototype.dispose=function(){if(0==--this.count){for(var t=this.cache,e=t.gl,r=this.programs,n=0,a=r.length;n<a;++n){var i=t.programs[r[n]];i&&(delete t.programs[n],e.deleteProgram(i))}e.deleteShader(this.shader),delete t.shaders[this.type===e.FRAGMENT_SHADER|0][this.src]}};var u=l.prototype;function c(t){var e=i.get(t);return e||(e=new l(t),i.set(t,e)),e}u.getShaderReference=function(t,e){var r=this.gl,i=this.shaders[t===r.FRAGMENT_SHADER|0],l=i[e];if(l&&r.isShader(l.shader))l.count+=1;else{var u=function(t,e,r){var i=t.createShader(e);if(t.shaderSource(i,r),t.compileShader(i),!t.getShaderParameter(i,t.COMPILE_STATUS)){var o=t.getShaderInfoLog(i);try{var s=a(o,r,e)}catch(t){throw console.warn("Failed to format compiler error: "+t),new n(o,"Error compiling shader:\n"+o)}throw new n(o,s.short,s.long)}return i}(r,t,e);l=i[e]=new s(o++,e,t,u,[],1,this)}return l},u.getProgram=function(t,e,r,a){var i=[t.id,e.id,r.join(":"),a.join(":")].join("@"),o=this.programs[i];return o&&this.gl.isProgram(o)||(this.programs[i]=o=function(t,e,r,a,i){var o=t.createProgram();t.attachShader(o,e),t.attachShader(o,r);for(var s=0;s<a.length;++s)t.bindAttribLocation(o,i[s],a[s]);if(t.linkProgram(o),!t.getProgramParameter(o,t.LINK_STATUS)){var l=t.getProgramInfoLog(o);throw new n(l,"Error linking program: "+l)}return o}(this.gl,t.shader,e.shader,r,a),t.programs.push(i),e.programs.push(i)),o}},{"./GLError":302,"gl-format-compiler-error":250,"weakmap-shim":555}],308:[function(t,e,r){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]}e.exports=function(t,e){var r=new n(t);return r.update(e),t.addOverlay(r),r};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,a=this.plot,i=a.line,o=a.dataBox,s=a.viewBox;if(i.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]&&i.drawLine(l,u,s[0],u,e[0],r[0]),t[1]&&i.drawLine(l,u,l,s[1],e[1],r[1]),t[2]&&i.drawLine(l,u,s[2],u,e[2],r[2]),t[3]&&i.drawLine(l,u,l,s[3],e[3],r[3])}},a.dispose=function(){this.plot.removeOverlay(this)}},{}],309:[function(t,e,r){var n=t("glslify"),a=t("gl-shader"),i=n(["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"]),o=n(["precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}"]);e.exports=function(t){return a(t,i,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec3"},{name:"weight",type:"float"}])}},{"gl-shader":301,glslify:409}],310:[function(t,e,r){var n=t("gl-buffer"),a=t("gl-vao"),i=t("./shaders/index");e.exports=function(t,e){var r=[];function o(t,e,n,a,i,o){var s=[t,e,n,0,0,0,1];s[a+3]=1,s[a]=i,r.push.apply(r,s),s[6]=-1,r.push.apply(r,s),s[a]=o,r.push.apply(r,s),r.push.apply(r,s),s[6]=1,r.push.apply(r,s),s[a]=i,r.push.apply(r,s)}o(0,0,0,0,0,1),o(0,0,0,1,0,1),o(0,0,0,2,0,1),o(1,0,0,1,-1,1),o(1,0,0,2,-1,1),o(0,1,0,0,-1,1),o(0,1,0,2,-1,1),o(0,0,1,0,-1,1),o(0,0,1,1,-1,1);var l=n(t,r),u=a(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=i(t);c.attributes.position.location=0,c.attributes.color.location=1,c.attributes.weight.location=2;var h=new s(t,l,u,c);return h.update(e),h};var o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(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}var l=s.prototype,u=[0,0,0],c=[0,0,0],h=[0,0];l.isTransparent=function(){return!1},l.drawTransparent=function(t){},l.draw=function(t){var e=this.gl,r=this.vao,n=this.shader;r.bind(),n.bind();var a,i=t.model||o,s=t.view||o,l=t.projection||o;this.axes&&(a=this.axes.lastCubeProps.axis);for(var d=u,f=c,p=0;p<3;++p)a&&a[p]<0?(d[p]=this.bounds[0][p],f[p]=this.bounds[1][p]):(d[p]=this.bounds[1][p],f[p]=this.bounds[0][p]);for(h[0]=e.drawingBufferWidth,h[1]=e.drawingBufferHeight,n.uniforms.model=i,n.uniforms.view=s,n.uniforms.projection=l,n.uniforms.coordinates=[this.position,d,f],n.uniforms.colors=this.colors,n.uniforms.screenShape=h,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()},l.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))},l.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders/index":309,"gl-buffer":241,"gl-vao":327}],311:[function(t,e,r){var n=t("glslify"),a=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\nuniform float vectorScale;\nuniform float tubeScale;\n\nuniform mat4 model\n , view\n , projection\n , inverseModel;\nuniform vec3 eyePosition\n , lightPosition;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data\n , f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * tubePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal,0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(tubePosition, 1.0);\n vec4 t_position = view * tubePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = tubePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),i=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(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\nfloat cookTorranceSpecular(\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(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\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\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\n , f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\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 = min(1.0, max(0.0, cookTorranceSpecular(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}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float tubeScale;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n gl_Position = projection * view * tubePosition;\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);r.meshShader={vertex:a,fragment:i,attributes:[{name:"position",type:"vec4"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},r.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},{glslify:409}],312:[function(t,e,r){var n=t("gl-shader"),a=t("gl-buffer"),i=t("gl-vao"),o=t("gl-texture2d"),s=t("normals"),l=t("gl-mat4/multiply"),u=t("gl-mat4/invert"),c=t("ndarray"),h=t("colormap"),d=t("simplicial-complex-contour"),f=t("typedarray-pool"),p=t("./shaders"),m=p.meshShader,g=p.pickShader,y=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function v(t,e,r,n,a,i,o,s,l,u,c,h,d,f,p,m,g,v,_,x,b,w,M,k){this.gl=t,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.pickShader=n,this.trianglePositions=a,this.triangleVectors=i,this.triangleColors=s,this.triangleNormals=u,this.triangleUVs=l,this.triangleIds=o,this.triangleVAO=c,this.triangleCount=0,this.lineWidth=1,this.edgePositions=h,this.edgeColors=f,this.edgeUVs=p,this.edgeIds=d,this.edgeVAO=m,this.edgeCount=0,this.pointPositions=g,this.pointColors=_,this.pointUVs=x,this.pointSizes=b,this.pointIds=v,this.pointVAO=w,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=M,this.contourVAO=k,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!1,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.tubeScale=1,this._model=y,this._view=y,this._projection=y,this._resolution=[1,1],this.pixelRatio=1}var _=v.prototype;function x(t){var e=n(t,g.vertex,g.fragment,null,g.attributes);return e.attributes.position.location=0,e.attributes.id.location=1,e.attributes.vector.location=5,e}_.isOpaque=function(){return this.opacity>=1},_.isTransparent=function(){return this.opacity<1},_.pickSlots=1,_.setPickBase=function(t){this.pickId=t},_.highlight=function(t){if(t&&this.contourEnable){for(var e=d(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,a=e.vertexWeights,i=r.length,o=f.mallocFloat32(6*i),s=0,l=0;l<i;++l)for(var u=r[l],c=0;c<2;++c){var h=u[0];2===u.length&&(h=u[c]);for(var p=n[h][0],m=n[h][1],g=a[h],y=1-g,v=this.positions[p],_=this.positions[m],x=0;x<3;++x)o[s++]=g*v[x]+y*_[x]}this.contourCount=s/3|0,this.contourPositions.update(o.subarray(0,s)),f.free(o)}else this.contourCount=0},_.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=o(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(function(t){for(var e=h({colormap:t,nshades:256,format:"rgba"}),r=new Uint8Array(1024),n=0;n<256;++n){for(var a=e[n],i=0;i<3;++i)r[4*n+i]=a[i];r[4*n+3]=255*a[3]}return c(r,[256,256,4],[4,0,1])}(t.colormap)),this.texture.generateMipmap());var r=t.cells,n=t.positions,a=t.vectors;if(n&&r&&a){void 0!==t.tubeScale&&(this.tubeScale=t.tubeScale);var i=[],l=[],u=[],d=[],f=[],p=[],m=[],g=[],y=[],v=[],_=[],x=[],b=[],w=[],M=[];this.cells=r,this.positions=n,this.vectors=a;var k=t.vertexNormals,T=t.cellNormals,L=void 0===t.vertexNormalsEpsilon?1e-6:t.vertexNormalsEpsilon,A=void 0===t.faceNormalsEpsilon?1e-6:t.faceNormalsEpsilon;t.useFacetNormals&&!T&&(T=s.faceNormals(r,n,A)),T||k||(k=s.vertexNormals(r,n,L));var S=t.vertexColors,E=t.cellColors,C=t.meshColor||[1,1,1,1],D=t.vertexUVs,P=t.vertexIntensity,O=t.cellUVs,z=t.cellIntensity,I=1/0,R=-1/0;if(!D&&!O)if(P)if(t.vertexIntensityBounds)I=+t.vertexIntensityBounds[0],R=+t.vertexIntensityBounds[1];else for(var F=0;F<P.length;++F){var N=P[F];I=Math.min(I,N),R=Math.max(R,N)}else if(z)for(F=0;F<z.length;++F)N=z[F],I=Math.min(I,N),R=Math.max(R,N);else for(F=0;F<n.length;++F)N=n[F][2],I=Math.min(I,N),R=Math.max(R,N);this.intensity=P||(z?function(t,e,r){for(var n=new Array(e),a=0;a<e;++a)n[a]=0;var i=t.length;for(a=0;a<i;++a)for(var o=t[a],s=0;s<o.length;++s)n[o[s]]=r[a];return n}(r,n.length,z):function(t){for(var e=t.length,r=new Array(e),n=0;n<e;++n)r[n]=t[n][2];return r}(n));var Y=t.pointSizes,j=t.pointSize||1;for(this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],F=0;F<n.length;++F)for(var B=n[F],H=0;H<3;++H)!isNaN(B[H])&&isFinite(B[H])&&(this.bounds[0][H]=Math.min(this.bounds[0][H],B[H]),this.bounds[1][H]=Math.max(this.bounds[1][H],B[H]));var U=0,V=0,W=0;t:for(F=0;F<r.length;++F){var G=r[F];switch(G.length){case 1:for(B=n[Z=G[0]],H=0;H<3;++H)if(isNaN(B[H])||!isFinite(B[H]))continue t;_.push(B[0],B[1],B[2],B[3]),3===(X=S?S[Z]:E?E[F]:C).length?x.push(X[0],X[1],X[2],1):x.push(X[0],X[1],X[2],X[3]),J=D?D[Z]:P?[(P[Z]-I)/(R-I),0]:O?O[F]:z?[(z[F]-I)/(R-I),0]:[(B[2]-I)/(R-I),0],b.push(J[0],J[1]),Y?w.push(Y[Z]):w.push(j),M.push(F),W+=1;break;case 2:for(H=0;H<2;++H){B=n[Z=G[H]];for(var q=0;q<3;++q)if(isNaN(B[q])||!isFinite(B[q]))continue t}for(H=0;H<2;++H)B=n[Z=G[H]],m.push(B[0],B[1],B[2]),3===(X=S?S[Z]:E?E[F]:C).length?g.push(X[0],X[1],X[2],1):g.push(X[0],X[1],X[2],X[3]),J=D?D[Z]:P?[(P[Z]-I)/(R-I),0]:O?O[F]:z?[(z[F]-I)/(R-I),0]:[(B[2]-I)/(R-I),0],y.push(J[0],J[1]),v.push(F);V+=1;break;case 3:for(H=0;H<3;++H)for(B=n[Z=G[H]],q=0;q<3;++q)if(isNaN(B[q])||!isFinite(B[q]))continue t;for(H=0;H<3;++H){var Z;B=n[Z=G[2-H]],i.push(B[0],B[1],B[2],B[3]);var X,J,K,$=a[Z];l.push($[0],$[1],$[2],$[3]),3===(X=S?S[Z]:E?E[F]:C).length?u.push(X[0],X[1],X[2],1):u.push(X[0],X[1],X[2],X[3]),J=D?D[Z]:P?[(P[Z]-I)/(R-I),0]:O?O[F]:z?[(z[F]-I)/(R-I),0]:[(B[2]-I)/(R-I),0],f.push(J[0],J[1]),K=k?k[Z]:T[F],d.push(K[0],K[1],K[2]),p.push(F)}U+=1}}this.pointCount=W,this.edgeCount=V,this.triangleCount=U,this.pointPositions.update(_),this.pointColors.update(x),this.pointUVs.update(b),this.pointSizes.update(w),this.pointIds.update(new Uint32Array(M)),this.edgePositions.update(m),this.edgeColors.update(g),this.edgeUVs.update(y),this.edgeIds.update(new Uint32Array(v)),this.trianglePositions.update(i),this.triangleVectors.update(l),this.triangleColors.update(u),this.triangleUVs.update(f),this.triangleNormals.update(d),this.triangleIds.update(new Uint32Array(p))}},_.drawTransparent=_.draw=function(t){t=t||{};for(var e=this.gl,r=t.model||y,n=t.view||y,a=t.projection||y,i=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)i[0][o]=Math.max(i[0][o],this.clipBounds[0][o]),i[1][o]=Math.min(i[1][o],this.clipBounds[1][o]);var s={model:r,view:n,projection:a,inverseModel:y.slice(),clipBounds:i,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,tubeScale:this.tubeScale,contourColor:this.contourColor,texture:0};s.inverseModel=u(s.inverseModel,s.model),e.disable(e.CULL_FACE),this.texture.bind(0);var c=new Array(16);for(l(c,s.view,s.model),l(c,s.projection,c),u(c,c),o=0;o<3;++o)s.eyePosition[o]=c[12+o]/c[15];var h=c[15];for(o=0;o<3;++o)h+=this.lightPosition[o]*c[4*o+3];for(o=0;o<3;++o){for(var d=c[12+o],f=0;f<3;++f)d+=c[4*f+o]*this.lightPosition[f];s.lightPosition[o]=d/h}if(this.triangleCount>0){var p=this.triShader;p.bind(),p.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}},_.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||y,n=t.view||y,a=t.projection||y,i=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)i[0][o]=Math.max(i[0][o],this.clipBounds[0][o]),i[1][o]=Math.min(i[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(a),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s={model:r,view:n,projection:a,clipBounds:i,tubeScale:this.tubeScale,pickId:this.pickId/255},l=this.pickShader;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*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind())},_.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions[r[1]].slice(0,3);return{index:e,position:n,intensity:this.intensity[r[1]],velocity:this.vectors[r[1]].slice(0,3),divergence:this.vectors[r[1]][3],dataCoordinate:n}},_.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.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()},e.exports=function(t,e){1===arguments.length&&(t=(e=t).gl);var r=e.triShader||function(t){var e=n(t,m.vertex,m.fragment,null,m.attributes);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.vector.location=5,e}(t),s=x(t),l=o(t,c(new Uint8Array([255,255,255,255]),[1,1,4]));l.generateMipmap(),l.minFilter=t.LINEAR_MIPMAP_LINEAR,l.magFilter=t.LINEAR;var u=a(t),h=a(t),d=a(t),f=a(t),p=a(t),g=a(t),y=i(t,[{buffer:u,type:t.FLOAT,size:4},{buffer:g,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:d,type:t.FLOAT,size:4},{buffer:f,type:t.FLOAT,size:2},{buffer:p,type:t.FLOAT,size:3},{buffer:h,type:t.FLOAT,size:4}]),_=a(t),b=a(t),w=a(t),M=a(t),k=i(t,[{buffer:_,type:t.FLOAT,size:3},{buffer:M,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:b,type:t.FLOAT,size:4},{buffer:w,type:t.FLOAT,size:2}]),T=a(t),L=a(t),A=a(t),S=a(t),E=a(t),C=i(t,[{buffer:T,type:t.FLOAT,size:3},{buffer:E,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:L,type:t.FLOAT,size:4},{buffer:A,type:t.FLOAT,size:2},{buffer:S,type:t.FLOAT,size:1}]),D=a(t),P=new v(t,l,r,s,u,h,g,d,f,p,y,_,M,b,w,k,T,E,L,A,S,C,D,i(t,[{buffer:D,type:t.FLOAT,size:3}]));return P.update(e),P}},{"./shaders":311,colormap:126,"gl-buffer":241,"gl-mat4/invert":265,"gl-mat4/multiply":267,"gl-shader":301,"gl-texture2d":322,"gl-vao":327,ndarray:450,normals:453,"simplicial-complex-contour":518,"typedarray-pool":545}],313:[function(t,e,r){var n=t("gl-vec3"),a=t("gl-vec4"),i=function(t,e,r,i){for(var o=0,s=0;s<t.length;s++)for(var l=t[s].velocities,u=0;u<l.length;u++){var c=n.length(l[u]);c>o&&(o=c)}var h=t.map((function(t){return function(t,e,r,i){var o,s,l,u=t.points,c=t.velocities,h=t.divergences;n.set(n.create(),0,1,0),n.create(),n.create(),n.create();for(var d=[],f=[],p=[],m=[],g=[],y=[],v=0,_=0,x=a.create(),b=a.create(),w=0;w<u.length;w++){o=u[w],s=c[w],l=h[w],0===e&&(l=.05*r),_=n.length(s)/i,x=a.create(),n.copy(x,s),x[3]=l;for(var M=0;M<8;M++)g[M]=[o[0],o[1],o[2],M];if(m.length>0)for(M=0;M<8;M++){var k=(M+1)%8;d.push(m[M],g[M],g[k],g[k],m[k],m[M]),p.push(b,x,x,x,b,b),y.push(v,_,_,_,v,v),f.push([d.length-6,d.length-5,d.length-4],[d.length-3,d.length-2,d.length-1])}var T=m;m=g,g=T,T=b,b=x,x=T,T=v,v=_,_=T}return{positions:d,cells:f,vectors:p,vertexIntensity:y}}(t,r,i,o)})),d=[],f=[],p=[],m=[];for(s=0;s<h.length;s++){var g=h[s],y=d.length;for(d=d.concat(g.positions),p=p.concat(g.vectors),m=m.concat(g.vertexIntensity),u=0;u<g.cells.length;u++){var v=g.cells[u],_=[];f.push(_);for(var x=0;x<v.length;x++)_.push(v[x]+y)}}return{positions:d,cells:f,vectors:p,vertexIntensity:m,colormap:e}},o=function(t,e){var r=n.create(),a=1e-4;n.add(r,t,[a,0,0]);var i=this.getVelocity(r);n.subtract(i,i,e),n.scale(i,i,1e4),n.add(r,t,[0,a,0]);var o=this.getVelocity(r);n.subtract(o,o,e),n.scale(o,o,1e4),n.add(r,t,[0,0,a]);var s=this.getVelocity(r);return n.subtract(s,s,e),n.scale(s,s,1e4),n.add(r,i,o),n.add(r,r,s),r},s=function(t){return d(t,this.vectors,this.meshgrid,this.clampBorders)},l=function(t,e){for(var r=0;r<t.length;r++){var n=t[r];if(n===e)return r;if(n>e)return r-1}return r},u=n.create(),c=n.create(),h=function(t,e,r){return t<e?e:t>r?r:t},d=function(t,e,r,a){var i=t[0],o=t[1],s=t[2],d=r[0].length,f=r[1].length,p=r[2].length,m=l(r[0],i),g=l(r[1],o),y=l(r[2],s),v=m+1,_=g+1,x=y+1;if(r[0][m]===i&&(v=m),r[1][g]===o&&(_=g),r[2][y]===s&&(x=y),a&&(m=h(m,0,d-1),v=h(v,0,d-1),g=h(g,0,f-1),_=h(_,0,f-1),y=h(y,0,p-1),x=h(x,0,p-1)),m<0||g<0||y<0||v>=d||_>=f||x>=p)return n.create();var b=(i-r[0][m])/(r[0][v]-r[0][m]),w=(o-r[1][g])/(r[1][_]-r[1][g]),M=(s-r[2][y])/(r[2][x]-r[2][y]);(b<0||b>1||isNaN(b))&&(b=0),(w<0||w>1||isNaN(w))&&(w=0),(M<0||M>1||isNaN(M))&&(M=0);var k=y*d*f,T=x*d*f,L=g*d,A=_*d,S=m,E=v,C=e[L+k+S],D=e[L+k+E],P=e[A+k+S],O=e[A+k+E],z=e[L+T+S],I=e[L+T+E],R=e[A+T+S],F=e[A+T+E],N=n.create();return n.lerp(N,C,D,b),n.lerp(u,P,O,b),n.lerp(N,N,u,w),n.lerp(u,z,I,b),n.lerp(c,R,F,b),n.lerp(u,u,c,w),n.lerp(N,N,u,M),N},f=function(t){var e=1/0;t.sort((function(t,e){return t-e}));for(var r=1;r<t.length;r++){var n=Math.abs(t[r]-t[r-1]);n<e&&(e=n)}return e};e.exports=function(t,e){var r=t.startingPositions,a=t.maxLength||1e3,l=t.tubeSize||1,u=t.absoluteTubeSize;t.getDivergence||(t.getDivergence=o),t.getVelocity||(t.getVelocity=s),void 0===t.clampBorders&&(t.clampBorders=!0);var c=[],h=e[0][0],d=e[0][1],p=e[0][2],m=e[1][0],g=e[1][1],y=e[1][2],v=function(t,e){var r=e[0],n=e[1],a=e[2];return r>=h&&r<=m&&n>=d&&n<=g&&a>=p&&a<=y},_=10*n.distance(e[0],e[1])/a,x=_*_,b=1,w=0;n.create(),r.length>=2&&(b=function(t){for(var e=[],r=[],n=[],a={},i={},o={},s=0;s<t.length;s++){var l=t[s],u=l[0],c=l[1],h=l[2];a[u]||(e.push(u),a[u]=!0),i[c]||(r.push(c),i[c]=!0),o[h]||(n.push(h),o[h]=!0)}var d=f(e),p=f(r),m=f(n),g=Math.min(d,p,m);return isFinite(g)?g:1}(r));for(var M=0;M<r.length;M++){var k=n.create();n.copy(k,r[M]);var T=[k],L=[],A=t.getVelocity(k),S=k;L.push(A);var E=[],C=t.getDivergence(k,A);(z=n.length(C))>w&&!isNaN(z)&&isFinite(z)&&(w=z),E.push(z),c.push({points:T,velocities:L,divergences:E});for(var D=0;D<100*a&&T.length<a&&v(0,k);){D++;var P=n.clone(A),O=n.squaredLength(P);if(0===O)break;O>x&&n.scale(P,P,_/Math.sqrt(O)),n.add(P,P,k),A=t.getVelocity(P),n.squaredDistance(S,P)-x>-1e-4*x&&(T.push(P),S=P,L.push(A),C=t.getDivergence(P,A),(z=n.length(C))>w&&!isNaN(z)&&isFinite(z)&&(w=z),E.push(z)),k=P}}for(M=0;M<E.length;M++){var z=E[M];!isNaN(z)&&isFinite(z)||(E[M]=w)}var I=i(c,t.colormap,w,b);return u?I.tubeScale=u:(0===w&&(w=1),I.tubeScale=.5*l*b/w),I},e.exports.createTubeMesh=t("./lib/tubemesh")},{"./lib/tubemesh":312,"gl-vec3":346,"gl-vec4":382}],314:[function(t,e,r){var n=t("gl-shader"),a=t("glslify"),i=a(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute vec3 f;\nattribute vec3 normal;\n\nuniform vec3 objectOffset;\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 vec3 localCoordinate = vec3(uv.zw, f.x);\n worldCoordinate = objectOffset + localCoordinate;\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"]),o=a(["precision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(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\nfloat beckmannSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\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 (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) discard;\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 = max(beckmannSpecular(L, V, N, roughness), 0.);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n //decide how to interpolate color — in vertex or in fragment\n vec4 surfaceColor =\n step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) +\n 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"]),s=a(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform vec3 objectOffset;\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 worldCoordinate = objectOffset + dataCoordinate;\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n\n vec4 clipPosition = projection * view * worldPosition;\n clipPosition.z += zOffset;\n\n gl_Position = clipPosition;\n value = f + objectOffset.z;\n kill = -1.0;\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"]),l=a(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) 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,o,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,l,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,s,o,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,s,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},{"gl-shader":301,glslify:409}],315:[function(t,e,r){arguments[4][111][0].apply(r,arguments)},{dup:111}],316:[function(t,e,r){e.exports=function(t){var e=t.gl,r=v(e),n=x(e),s=_(e),l=b(e),u=a(e),c=i(e,[{buffer:u,size:4,stride:w,offset:0},{buffer:u,size:3,stride:w,offset:16},{buffer:u,size:3,stride:w,offset:28}]),h=a(e),d=i(e,[{buffer:h,size:4,stride:20,offset:0},{buffer:h,size:1,stride:20,offset:16}]),f=a(e),p=i(e,[{buffer:f,size:2,type:e.FLOAT}]),m=o(e,1,A,e.RGBA,e.UNSIGNED_BYTE);m.minFilter=e.LINEAR,m.magFilter=e.LINEAR;var g=new S(e,[0,0],[[0,0,0],[0,0,0]],r,n,u,c,m,s,l,h,d,f,p,[0,0,0]),y={levels:[[],[],[]]};for(var M in t)y[M]=t[M];return y.colormap=y.colormap||"jet",g.update(y),g};var n=t("bit-twiddle"),a=t("gl-buffer"),i=t("gl-vao"),o=t("gl-texture2d"),s=t("typedarray-pool"),l=t("colormap"),u=t("ndarray-ops"),c=t("ndarray-pack"),h=t("ndarray"),d=t("surface-nets"),f=t("gl-mat4/multiply"),p=t("gl-mat4/invert"),m=t("binary-search-bounds"),g=t("ndarray-gradient"),y=t("./lib/shaders"),v=y.createShader,_=y.createContourShader,x=y.createPickShader,b=y.createPickContourShader,w=40,M=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],k=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],T=[[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 L(t,e,r,n,a){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=a}!function(){for(var t=0;t<3;++t){var e=T[t],r=(t+2)%3;e[(t+1)%3+0]=1,e[r+3]=1,e[t+6]=1}}();var A=256;function S(t,e,r,n,a,i,o,l,u,c,d,f,p,m,g){this.gl=t,this.shape=e,this.bounds=r,this.objectOffset=g,this.intensityBounds=[],this._shader=n,this._pickShader=a,this._coordinateBuffer=i,this._vao=o,this._colorMap=l,this._contourShader=u,this._contourPickShader=c,this._contourBuffer=d,this._contourVAO=f,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new L([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=p,this._dynamicVAO=m,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=[NaN,NaN,NaN],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=[h(s.mallocFloat(1024),[0,0]),h(s.mallocFloat(1024),[0,0]),h(s.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.pixelRatio=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}var E=S.prototype;E.isTransparent=function(){return this.opacity<1},E.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},E.pickSlots=1,E.setPickBase=function(t){this.pickId=t};var C=[0,0,0],D={showSurface:!1,showContour:!1,projections:[M.slice(),M.slice(),M.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function P(t,e){var r,n,a,i=e.axes&&e.axes.lastCubeProps.axis||C,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=D.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[+(i[r]>0)][r],f(l,t.model,l);var u=D.clipBounds[r];for(a=0;a<2;++a)for(n=0;n<3;++n)u[a][n]=t.clipBounds[a][n];u[0][r]=-1e8,u[1][r]=1e8}return D.showSurface=o,D.showContour=s,D}var O={model:M,view:M,projection:M,inverseModel:M.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,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},z=M.slice(),I=[1,0,0,0,1,0,0,0,1];function R(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=O;n.model=t.model||M,n.view=t.view||M,n.projection=t.projection||M,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.objectOffset=this.objectOffset,n.contourColor=this.contourColor[0],n.inverseModel=p(n.inverseModel,n.model);for(var a=0;a<2;++a)for(var i=n.clipBounds[a],o=0;o<3;++o)i[o]=Math.min(Math.max(this.clipBounds[a][o],-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=I,n.vertexColor=this.vertexColor;var s=z;for(f(s,n.view,n.model),f(s,n.projection,s),p(s,s),a=0;a<3;++a)n.eyePosition[a]=s[12+a]/s[15];var l=s[15];for(a=0;a<3;++a)l+=this.lightPosition[a]*s[4*a+3];for(a=0;a<3;++a){var u=s[12+a];for(o=0;o<3;++o)u+=s[4*o+a]*this.lightPosition[o];n.lightPosition[a]=u/l}var c=P(n,this);if(c.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),a=0;a<3;++a)this.surfaceProject[a]&&this.vertexCount&&(this._shader.uniforms.model=c.projections[a],this._shader.uniforms.clipBounds=c.clipBounds[a],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(c.showContour&&!e){var h=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,h.bind(),h.uniforms=n;var d=this._contourVAO;for(d.bind(),a=0;a<3;++a)for(h.uniforms.permutation=T[a],r.lineWidth(this.contourWidth[a]*this.pixelRatio),o=0;o<this.contourLevels[a].length;++o)o===this.highlightLevel[a]?(h.uniforms.contourColor=this.highlightColor[a],h.uniforms.contourTint=this.highlightTint[a]):0!==o&&o-1!==this.highlightLevel[a]||(h.uniforms.contourColor=this.contourColor[a],h.uniforms.contourTint=this.contourTint[a]),this._contourCounts[a][o]&&(h.uniforms.height=this.contourLevels[a][o],d.draw(r.LINES,this._contourCounts[a][o],this._contourOffsets[a][o]));for(a=0;a<3;++a)for(h.uniforms.model=c.projections[a],h.uniforms.clipBounds=c.clipBounds[a],o=0;o<3;++o)if(this.contourProject[a][o]){h.uniforms.permutation=T[o],r.lineWidth(this.contourWidth[o]*this.pixelRatio);for(var m=0;m<this.contourLevels[o].length;++m)m===this.highlightLevel[o]?(h.uniforms.contourColor=this.highlightColor[o],h.uniforms.contourTint=this.highlightTint[o]):0!==m&&m-1!==this.highlightLevel[o]||(h.uniforms.contourColor=this.contourColor[o],h.uniforms.contourTint=this.contourTint[o]),this._contourCounts[o][m]&&(h.uniforms.height=this.contourLevels[o][m],d.draw(r.LINES,this._contourCounts[o][m],this._contourOffsets[o][m]))}for(d.unbind(),(d=this._dynamicVAO).bind(),a=0;a<3;++a)if(0!==this._dynamicCounts[a])for(h.uniforms.model=n.model,h.uniforms.clipBounds=n.clipBounds,h.uniforms.permutation=T[a],r.lineWidth(this.dynamicWidth[a]*this.pixelRatio),h.uniforms.contourColor=this.dynamicColor[a],h.uniforms.contourTint=this.dynamicTint[a],h.uniforms.height=this.dynamicLevel[a],d.draw(r.LINES,this._dynamicCounts[a],this._dynamicOffsets[a]),o=0;o<3;++o)this.contourProject[o][a]&&(h.uniforms.model=c.projections[o],h.uniforms.clipBounds=c.clipBounds[o],d.draw(r.LINES,this._dynamicCounts[a],this._dynamicOffsets[a]));d.unbind()}}E.draw=function(t){return R.call(this,t,!1)},E.drawTransparent=function(t){return R.call(this,t,!0)};var F={model:M,view:M,projection:M,inverseModel:M,clipBounds:[[0,0,0],[0,0,0]],height:0,shape:[0,0],pickId:0,lowerBound:[0,0,0],upperBound:[0,0,0],zOffset:0,objectOffset:[0,0,0],permutation:[1,0,0,0,1,0,0,0,1],lightPosition:[0,0,0],eyePosition:[0,0,0]};function N(t,e){return Array.isArray(t)?[e(t[0]),e(t[1]),e(t[2])]:[e(t),e(t),e(t)]}function Y(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 j(t){if(Array.isArray(t)){if(Array.isArray(t))return[Y(t[0]),Y(t[1]),Y(t[2])];var e=Y(t);return[e.slice(),e.slice(),e.slice()]}}E.drawPick=function(t){t=t||{};var e=this.gl;e.disable(e.CULL_FACE);var r=F;r.model=t.model||M,r.view=t.view||M,r.projection=t.projection||M,r.shape=this._field[2].shape,r.pickId=this.pickId/255,r.lowerBound=this.bounds[0],r.upperBound=this.bounds[1],r.objectOffset=this.objectOffset,r.permutation=I;for(var n=0;n<2;++n)for(var a=r.clipBounds[n],i=0;i<3;++i)a[i]=Math.min(Math.max(this.clipBounds[n][i],-1e8),1e8);var o=P(r,this);if(o.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=o.projections[n],this._pickShader.uniforms.clipBounds=o.clipBounds[n],this._vao.draw(e.TRIANGLES,this._vertexCount));this._vao.unbind()}if(o.showContour){var s=this._contourPickShader;s.bind(),s.uniforms=r;var l=this._contourVAO;for(l.bind(),i=0;i<3;++i)for(e.lineWidth(this.contourWidth[i]*this.pixelRatio),s.uniforms.permutation=T[i],n=0;n<this.contourLevels[i].length;++n)this._contourCounts[i][n]&&(s.uniforms.height=this.contourLevels[i][n],l.draw(e.LINES,this._contourCounts[i][n],this._contourOffsets[i][n]));for(n=0;n<3;++n)for(s.uniforms.model=o.projections[n],s.uniforms.clipBounds=o.clipBounds[n],i=0;i<3;++i)if(this.contourProject[n][i]){s.uniforms.permutation=T[i],e.lineWidth(this.contourWidth[i]*this.pixelRatio);for(var u=0;u<this.contourLevels[i].length;++u)this._contourCounts[i][u]&&(s.uniforms.height=this.contourLevels[i][u],l.draw(e.LINES,this._contourCounts[i][u],this._contourOffsets[i][u]))}l.unbind()}},E.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=this._field[2].shape,r=this._pickResult,n=e[0]*(t.value[0]+(t.value[2]>>4)/16)/255,a=Math.floor(n),i=n-a,o=e[1]*(t.value[1]+(15&t.value[2])/16)/255,s=Math.floor(o),l=o-s;a+=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?i:1-i,d=0;d<2;++d)for(var f=a+c,p=s+d,g=h*(d?l:1-l),y=0;y<3;++y)u[y]+=this._field[y].get(f,p)*g;for(var v=this._pickResult.level,_=0;_<3;++_)if(v[_]=m.le(this.contourLevels[_],u[_]),v[_]<0)this.contourLevels[_].length>0&&(v[_]=0);else if(v[_]<this.contourLevels[_].length-1){var x=this.contourLevels[_][v[_]],b=this.contourLevels[_][v[_]+1];Math.abs(x-u[_])>Math.abs(b-u[_])&&(v[_]+=1)}for(r.index[0]=i<.5?a:a+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/e[0],r.uv[1]=o/e[1],y=0;y<3;++y)r.dataCoordinate[y]=this._field[y].get(r.index[0],r.index[1]);return r},E.padField=function(t,e){var r=e.shape.slice(),n=t.shape.slice();u.assign(t.lo(1,1).hi(r[0],r[1]),e),u.assign(t.lo(1).hi(r[0],1),e.hi(r[0],1)),u.assign(t.lo(1,n[1]-1).hi(r[0],1),e.lo(0,r[1]-1).hi(r[0],1)),u.assign(t.lo(0,1).hi(1,r[1]),e.hi(1)),u.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))},E.update=function(t){t=t||{},this.objectOffset=t.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in t&&(this.contourWidth=N(t.contourWidth,Number)),"showContour"in t&&(this.showContour=N(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=N(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=j(t.contourColor)),"contourProject"in t&&(this.contourProject=N(t.contourProject,(function(t){return N(t,Boolean)}))),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=j(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=N(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=N(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 a=(e.shape[0]+2)*(e.shape[1]+2);a>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(n.nextPow2(a))),this._field[2]=h(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),this.padField(this._field[2],e),this.shape=e.shape.slice();for(var i=this.shape,o=0;o<2;++o)this._field[2].size>this._field[o].data.length&&(s.freeFloat(this._field[o].data),this._field[o].data=s.mallocFloat(this._field[2].size)),this._field[o]=h(this._field[o].data,[i[0]+2,i[1]+2]);if(t.coords){var f=t.coords;if(!Array.isArray(f)||3!==f.length)throw new Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var p=f[o];for(x=0;x<2;++x)if(p.shape[x]!==i[x])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[o],p)}}else if(t.ticks){var m=t.ticks;if(!Array.isArray(m)||2!==m.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var y=m[o];if((Array.isArray(y)||y.length)&&(y=h(y)),y.shape[0]!==i[o])throw new Error("gl-surface: invalid tick length");var v=h(y.data,i);v.stride[o]=y.stride[0],v.stride[1^o]=0,this.padField(this._field[o],v)}}else{for(o=0;o<2;++o){var _=[0,0];_[o]=1,this._field[o]=h(this._field[o].data,[i[0]+2,i[1]+2],_,0)}this._field[0].set(0,0,0);for(var x=0;x<i[0];++x)this._field[0].set(x+1,0,x);for(this._field[0].set(i[0]+1,0,i[0]-1),this._field[1].set(0,0,0),x=0;x<i[1];++x)this._field[1].set(0,x+1,x);this._field[1].set(0,i[1]+1,i[1]-1)}var b=this._field,w=h(s.mallocFloat(3*b[2].size*2),[3,i[0]+2,i[1]+2,2]);for(o=0;o<3;++o)g(w.pick(o),b[o],"mirror");var M=h(s.mallocFloat(3*b[2].size),[i[0]+2,i[1]+2,3]);for(o=0;o<i[0]+2;++o)for(x=0;x<i[1]+2;++x){var T=w.get(0,o,x,0),L=w.get(0,o,x,1),S=w.get(1,o,x,0),E=w.get(1,o,x,1),C=w.get(2,o,x,0),D=w.get(2,o,x,1),P=S*D-E*C,O=C*L-D*T,z=T*E-L*S,I=Math.sqrt(P*P+O*O+z*z);I<1e-8?(I=Math.max(Math.abs(P),Math.abs(O),Math.abs(z)))<1e-8?(z=1,O=P=0,I=1):I=1/I:I=1/Math.sqrt(I),M.set(o,x,0,P*I),M.set(o,x,1,O*I),M.set(o,x,2,z*I)}s.free(w.data);var R=[1/0,1/0,1/0],F=[-1/0,-1/0,-1/0],Y=1/0,B=-1/0,H=(i[0]-1)*(i[1]-1)*6,U=s.mallocFloat(n.nextPow2(10*H)),V=0,W=0;for(o=0;o<i[0]-1;++o)t:for(x=0;x<i[1]-1;++x){for(var G=0;G<2;++G)for(var q=0;q<2;++q)for(var Z=0;Z<3;++Z){var X=this._field[Z].get(1+o+G,1+x+q);if(isNaN(X)||!isFinite(X))continue t}for(Z=0;Z<6;++Z){var J=o+k[Z][0],K=x+k[Z][1],$=this._field[0].get(J+1,K+1),Q=this._field[1].get(J+1,K+1);X=this._field[2].get(J+1,K+1),P=M.get(J+1,K+1,0),O=M.get(J+1,K+1,1),z=M.get(J+1,K+1,2),t.intensity&&(tt=t.intensity.get(J,K));var tt=t.intensity?t.intensity.get(J,K):X+this.objectOffset[2];U[V++]=J,U[V++]=K,U[V++]=$,U[V++]=Q,U[V++]=X,U[V++]=0,U[V++]=tt,U[V++]=P,U[V++]=O,U[V++]=z,R[0]=Math.min(R[0],$+this.objectOffset[0]),R[1]=Math.min(R[1],Q+this.objectOffset[1]),R[2]=Math.min(R[2],X+this.objectOffset[2]),Y=Math.min(Y,tt),F[0]=Math.max(F[0],$+this.objectOffset[0]),F[1]=Math.max(F[1],Q+this.objectOffset[1]),F[2]=Math.max(F[2],X+this.objectOffset[2]),B=Math.max(B,tt),W+=1}}for(t.intensityBounds&&(Y=+t.intensityBounds[0],B=+t.intensityBounds[1]),o=6;o<V;o+=10)U[o]=(U[o]-Y)/(B-Y);this._vertexCount=W,this._coordinateBuffer.update(U.subarray(0,V)),s.freeFloat(U),s.free(M.data),this.bounds=[R,F],this.intensity=t.intensity||this._field[2],this.intensityBounds[0]===Y&&this.intensityBounds[1]===B||(r=!0),this.intensityBounds=[Y,B]}if("levels"in t){var et=t.levels;for(et=Array.isArray(et[0])?et.slice():[[],[],et],o=0;o<3;++o)et[o]=et[o].slice(),et[o].sort((function(t,e){return t-e}));for(o=0;o<3;++o)for(x=0;x<et[o].length;++x)et[o][x]-=this.objectOffset[o];t:for(o=0;o<3;++o){if(et[o].length!==this.contourLevels[o].length){r=!0;break}for(x=0;x<et[o].length;++x)if(et[o][x]!==this.contourLevels[o][x]){r=!0;break t}}this.contourLevels=et}if(r){b=this._field,i=this.shape;for(var rt=[],nt=0;nt<3;++nt){var at=this.contourLevels[nt],it=[],ot=[],st=[0,0,0];for(o=0;o<at.length;++o){var lt=d(this._field[nt],at[o]);it.push(rt.length/5|0),W=0;t:for(x=0;x<lt.cells.length;++x){var ut=lt.cells[x];for(Z=0;Z<2;++Z){var ct=lt.positions[ut[Z]],ht=ct[0],dt=0|Math.floor(ht),ft=ht-dt,pt=ct[1],mt=0|Math.floor(pt),gt=pt-mt,yt=!1;e:for(var vt=0;vt<3;++vt){st[vt]=0;var _t=(nt+vt+1)%3;for(G=0;G<2;++G){var xt=G?ft:1-ft;for(J=0|Math.min(Math.max(dt+G,0),i[0]),q=0;q<2;++q){var bt=q?gt:1-gt;if(K=0|Math.min(Math.max(mt+q,0),i[1]),X=vt<2?this._field[_t].get(J,K):(this.intensity.get(J,K)-this.intensityBounds[0])/(this.intensityBounds[1]-this.intensityBounds[0]),!isFinite(X)||isNaN(X)){yt=!0;break e}var wt=xt*bt;st[vt]+=wt*X}}}if(yt){if(Z>0){for(var Mt=0;Mt<5;++Mt)rt.pop();W-=1}continue t}rt.push(st[0],st[1],ct[0],ct[1],st[2]),W+=1}}ot.push(W)}this._contourOffsets[nt]=it,this._contourCounts[nt]=ot}var kt=s.mallocFloat(rt.length);for(o=0;o<rt.length;++o)kt[o]=rt[o];this._contourBuffer.update(kt),s.freeFloat(kt)}t.colormap&&this._colorMap.setPixels(function(t){var e=c([l({colormap:t,nshades:A,format:"rgba"}).map((function(t){return[t[0],t[1],t[2],255*t[3]]}))]);return u.divseq(e,255),e}(t.colormap))},E.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)s.freeFloat(this._field[t].data)},E.highlight=function(t){var e,r;if(!t)return this._dynamicCounts=[0,0,0],this.dyanamicLevel=[NaN,NaN,NaN],void(this.highlightLevel=[-1,-1,-1]);for(e=0;e<3;++e)this.enableHighlight[e]?this.highlightLevel[e]=t.level[e]:this.highlightLevel[e]=-1;for(r=this.snapToData?t.dataCoordinate:t.position,e=0;e<3;++e)r[e]-=this.objectOffset[e];if(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,a=this.shape,i=s.mallocFloat(12*a[0]*a[1]),o=0;o<3;++o)if(this.enableDynamic[o]){this.dynamicLevel[o]=r[o];var l=(o+1)%3,u=(o+2)%3,c=this._field[o],h=this._field[l],f=this._field[u],p=d(c,r[o]),m=p.cells,g=p.positions;for(this._dynamicOffsets[o]=n,e=0;e<m.length;++e)for(var y=m[e],v=0;v<2;++v){var _=g[y[v]],x=+_[0],b=0|x,w=0|Math.min(b+1,a[0]),M=x-b,k=1-M,T=+_[1],L=0|T,A=0|Math.min(L+1,a[1]),S=T-L,E=1-S,C=k*E,D=k*S,P=M*E,O=M*S,z=C*h.get(b,L)+D*h.get(b,A)+P*h.get(w,L)+O*h.get(w,A),I=C*f.get(b,L)+D*f.get(b,A)+P*f.get(w,L)+O*f.get(w,A);if(isNaN(z)||isNaN(I)){v&&(n-=1);break}i[2*n+0]=z,i[2*n+1]=I,n+=1}this._dynamicCounts[o]=n-this._dynamicOffsets[o]}else this.dynamicLevel[o]=NaN,this._dynamicCounts[o]=0;this._dynamicBuffer.update(i.subarray(0,2*n)),s.freeFloat(i)}}},{"./lib/shaders":314,"binary-search-bounds":315,"bit-twiddle":92,colormap:126,"gl-buffer":241,"gl-mat4/invert":265,"gl-mat4/multiply":267,"gl-texture2d":322,"gl-vao":327,ndarray:450,"ndarray-gradient":441,"ndarray-ops":444,"ndarray-pack":445,"surface-nets":531,"typedarray-pool":545}],317:[function(t,e,r){var n=t("css-font"),a=t("pick-by-alias"),i=t("regl"),o=t("gl-util/context"),s=t("es6-weak-map"),l=t("color-normalize"),u=t("font-atlas"),c=t("typedarray-pool"),h=t("parse-rect"),d=t("is-plain-obj"),f=t("parse-unit"),p=t("to-px"),m=t("detect-kerning"),g=t("object-assign"),y=t("font-measure"),v=t("flatten-vertex-data"),_=t("bit-twiddle").nextPow2,x=new s,b=!1;if(document.body){var w=document.body.appendChild(document.createElement("div"));w.style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(w).fontStretch&&(b=!0),document.body.removeChild(w)}var M=function(t){!function(t){return"function"==typeof t&&t._gl&&t.prop&&t.texture&&t.buffer}(t)?this.gl=o(t):(t={regl:t},this.gl=t.regl._gl),this.shader=x.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=t.regl||i({gl:this.gl}),this.charBuffer=this.regl.buffer({type:"uint8",usage:"stream"}),this.sizeBuffer=this.regl.buffer({type:"float",usage:"stream"}),this.shader||(this.shader=this.createShader(),x.set(this.gl,this.shader)),this.batch=[],this.fontSize=[],this.font=[],this.fontAtlas=[],this.draw=this.shader.draw.bind(this),this.render=function(){this.regl._refresh(),this.draw(this.batch)},this.canvas=this.gl.canvas,this.update(d(t)?t:{})};M.prototype.createShader=function(){var t=this.regl,e=t({blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},stencil:{enable:!1},depth:{enable:!1},count:t.prop("count"),offset:t.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:t.this("sizeBuffer")},width:{offset:0,stride:8,buffer:t.this("sizeBuffer")},char:t.this("charBuffer"),position:t.this("position")},uniforms:{atlasSize:function(t,e){return[e.atlas.width,e.atlas.height]},atlasDim:function(t,e){return[e.atlas.cols,e.atlas.rows]},atlas:function(t,e){return e.atlas.texture},charStep:function(t,e){return e.atlas.step},em:function(t,e){return e.atlas.em},color:t.prop("color"),opacity:t.prop("opacity"),viewport:t.this("viewportArray"),scale:t.this("scale"),align:t.prop("align"),baseline:t.prop("baseline"),translate:t.this("translate"),positionOffset:t.prop("positionOffset")},primitive:"points",viewport:t.this("viewport"),vert:"\n\t\t\tprecision highp float;\n\t\t\tattribute float width, charOffset, char;\n\t\t\tattribute vec2 position;\n\t\t\tuniform float fontSize, charStep, em, align, baseline;\n\t\t\tuniform vec4 viewport;\n\t\t\tuniform vec4 color;\n\t\t\tuniform vec2 atlasSize, atlasDim, scale, translate, positionOffset;\n\t\t\tvarying vec2 charCoord, charId;\n\t\t\tvarying float charWidth;\n\t\t\tvarying vec4 fontColor;\n\t\t\tvoid main () {\n\t\t\t\t"+(M.normalViewport?"":"vec2 positionOffset = vec2(positionOffset.x,- positionOffset.y);")+"\n\n\t\t\t\tvec2 offset = floor(em * (vec2(align + charOffset, baseline)\n\t\t\t\t\t+ positionOffset))\n\t\t\t\t\t/ (viewport.zw * scale.xy);\n\n\t\t\t\tvec2 position = (position + translate) * scale;\n\t\t\t\tposition += offset * scale;\n\n\t\t\t\t"+(M.normalViewport?"position.y = 1. - position.y;":"")+"\n\n\t\t\t\tcharCoord = position * viewport.zw + viewport.xy;\n\n\t\t\t\tgl_Position = vec4(position * 2. - 1., 0, 1);\n\n\t\t\t\tgl_PointSize = charStep;\n\n\t\t\t\tcharId.x = mod(char, atlasDim.x);\n\t\t\t\tcharId.y = floor(char / atlasDim.x);\n\n\t\t\t\tcharWidth = width * em;\n\n\t\t\t\tfontColor = color / 255.;\n\t\t\t}",frag:"\n\t\t\tprecision highp float;\n\t\t\tuniform sampler2D atlas;\n\t\t\tuniform float fontSize, charStep, opacity;\n\t\t\tuniform vec2 atlasSize;\n\t\t\tuniform vec4 viewport;\n\t\t\tvarying vec4 fontColor;\n\t\t\tvarying vec2 charCoord, charId;\n\t\t\tvarying float charWidth;\n\n\t\t\tfloat lightness(vec4 color) {\n\t\t\t\treturn color.r * 0.299 + color.g * 0.587 + color.b * 0.114;\n\t\t\t}\n\n\t\t\tvoid main () {\n\t\t\t\tvec2 uv = gl_FragCoord.xy - charCoord + charStep * .5;\n\t\t\t\tfloat halfCharStep = floor(charStep * .5 + .5);\n\n\t\t\t\t// invert y and shift by 1px (FF expecially needs that)\n\t\t\t\tuv.y = charStep - uv.y;\n\n\t\t\t\t// ignore points outside of character bounding box\n\t\t\t\tfloat halfCharWidth = ceil(charWidth * .5);\n\t\t\t\tif (floor(uv.x) > halfCharStep + halfCharWidth ||\n\t\t\t\t\tfloor(uv.x) < halfCharStep - halfCharWidth) return;\n\n\t\t\t\tuv += charId * charStep;\n\t\t\t\tuv = uv / atlasSize;\n\n\t\t\t\tvec4 color = fontColor;\n\t\t\t\tvec4 mask = texture2D(atlas, uv);\n\n\t\t\t\tfloat maskY = lightness(mask);\n\t\t\t\t// float colorY = lightness(color);\n\t\t\t\tcolor.a *= maskY;\n\t\t\t\tcolor.a *= opacity;\n\n\t\t\t\t// color.a += .1;\n\n\t\t\t\t// antialiasing, see yiq color space y-channel formula\n\t\t\t\t// color.rgb += (1. - color.rgb) * (1. - mask.rgb);\n\n\t\t\t\tgl_FragColor = color;\n\t\t\t}"});return{regl:t,draw:e,atlas:{}}},M.prototype.update=function(t){var e=this;if("string"==typeof t)t={text:t};else if(!t)return;null!=(t=a(t,{position:"position positions coord coords coordinates",font:"font fontFace fontface typeface cssFont css-font family fontFamily",fontSize:"fontSize fontsize size font-size",text:"text texts chars characters value values symbols",align:"align alignment textAlign textbaseline",baseline:"baseline textBaseline textbaseline",direction:"dir direction textDirection",color:"color colour fill fill-color fillColor textColor textcolor",kerning:"kerning kern",range:"range dataBox",viewport:"vp viewport viewBox viewbox viewPort",opacity:"opacity alpha transparency visible visibility opaque",offset:"offset positionOffset padding shift indent indentation"},!0)).opacity&&(Array.isArray(t.opacity)?this.opacity=t.opacity.map((function(t){return parseFloat(t)})):this.opacity=parseFloat(t.opacity)),null!=t.viewport&&(this.viewport=h(t.viewport),M.normalViewport&&(this.viewport.y=this.canvas.height-this.viewport.y-this.viewport.height),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null==this.viewport&&(this.viewport={x:0,y:0,width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight},this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null!=t.kerning&&(this.kerning=t.kerning),null!=t.offset&&("number"==typeof t.offset&&(t.offset=[t.offset,0]),this.positionOffset=v(t.offset)),t.direction&&(this.direction=t.direction),t.range&&(this.range=t.range,this.scale=[1/(t.range[2]-t.range[0]),1/(t.range[3]-t.range[1])],this.translate=[-t.range[0],-t.range[1]]),t.scale&&(this.scale=t.scale),t.translate&&(this.translate=t.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),this.font.length||t.font||(t.font=M.baseFontSize+"px sans-serif");var r,i=!1,o=!1;if(t.font&&(Array.isArray(t.font)?t.font:[t.font]).forEach((function(t,r){if("string"==typeof t)try{t=n.parse(t)}catch(e){t=n.parse(M.baseFontSize+"px "+t)}else t=n.parse(n.stringify(t));var a=n.stringify({size:M.baseFontSize,family:t.family,stretch:b?t.stretch:void 0,variant:t.variant,weight:t.weight,style:t.style}),s=f(t.size),l=Math.round(s[0]*p(s[1]));if(l!==e.fontSize[r]&&(o=!0,e.fontSize[r]=l),!(e.font[r]&&a==e.font[r].baseString||(i=!0,e.font[r]=M.fonts[a],e.font[r]))){var u=t.family.join(", "),c=[t.style];t.style!=t.variant&&c.push(t.variant),t.variant!=t.weight&&c.push(t.weight),b&&t.weight!=t.stretch&&c.push(t.stretch),e.font[r]={baseString:a,family:u,weight:t.weight,stretch:t.stretch,style:t.style,variant:t.variant,width:{},kerning:{},metrics:y(u,{origin:"top",fontSize:M.baseFontSize,fontStyle:c.join(" ")})},M.fonts[a]=e.font[r]}})),(i||o)&&this.font.forEach((function(r,a){var i=n.stringify({size:e.fontSize[a],family:r.family,stretch:b?r.stretch:void 0,variant:r.variant,weight:r.weight,style:r.style});if(e.fontAtlas[a]=e.shader.atlas[i],!e.fontAtlas[a]){var o=r.metrics;e.shader.atlas[i]=e.fontAtlas[a]={fontString:i,step:2*Math.ceil(e.fontSize[a]*o.bottom*.5),em:e.fontSize[a],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:e.regl.texture()}}null==t.text&&(t.text=e.text)})),"string"==typeof t.text&&t.position&&t.position.length>2){for(var s=Array(.5*t.position.length),d=0;d<s.length;d++)s[d]=t.text;t.text=s}if(null!=t.text||i){if(this.textOffsets=[0],Array.isArray(t.text)){this.count=t.text[0].length,this.counts=[this.count];for(var x=1;x<t.text.length;x++)this.textOffsets[x]=this.textOffsets[x-1]+t.text[x-1].length,this.count+=t.text[x].length,this.counts.push(t.text[x].length);this.text=t.text.join("")}else this.text=t.text,this.count=this.text.length,this.counts=[this.count];r=[],this.font.forEach((function(t,n){M.atlasContext.font=t.baseString;for(var a=e.fontAtlas[n],i=0;i<e.text.length;i++){var o=e.text.charAt(i);if(null==a.ids[o]&&(a.ids[o]=a.chars.length,a.chars.push(o),r.push(o)),null==t.width[o]&&(t.width[o]=M.atlasContext.measureText(o).width/M.baseFontSize,e.kerning)){var s=[];for(var l in t.width)s.push(l+o,o+l);g(t.kerning,m(t.family,{pairs:s}))}}}))}if(t.position)if(t.position.length>2){for(var w=!t.position[0].length,k=c.mallocFloat(2*this.count),T=0,L=0;T<this.counts.length;T++){var A=this.counts[T];if(w)for(var S=0;S<A;S++)k[L++]=t.position[2*T],k[L++]=t.position[2*T+1];else for(var E=0;E<A;E++)k[L++]=t.position[T][0],k[L++]=t.position[T][1]}this.position.call?this.position({type:"float",data:k}):this.position=this.regl.buffer({type:"float",data:k}),c.freeFloat(k)}else this.position.destroy&&this.position.destroy(),this.position={constant:t.position};if(t.text||i){var C=c.mallocUint8(this.count),D=c.mallocFloat(2*this.count);this.textWidth=[];for(var P=0,O=0;P<this.counts.length;P++){for(var z=this.counts[P],I=this.font[P]||this.font[0],R=this.fontAtlas[P]||this.fontAtlas[0],F=0;F<z;F++){var N=this.text.charAt(O),Y=this.text.charAt(O-1);if(C[O]=R.ids[N],D[2*O]=I.width[N],F){var j=D[2*O-2],B=D[2*O],H=D[2*O-1]+.5*j+.5*B;if(this.kerning){var U=I.kerning[Y+N];U&&(H+=.001*U)}D[2*O+1]=H}else D[2*O+1]=.5*D[2*O];O++}this.textWidth.push(D.length?.5*D[2*O-2]+D[2*O-1]:0)}t.align||(t.align=this.align),this.charBuffer({data:C,type:"uint8",usage:"stream"}),this.sizeBuffer({data:D,type:"float",usage:"stream"}),c.freeUint8(C),c.freeFloat(D),r.length&&this.font.forEach((function(t,r){var n=e.fontAtlas[r],a=n.step,i=Math.floor(M.maxAtlasSize/a),o=Math.min(i,n.chars.length),s=Math.ceil(n.chars.length/o),l=_(o*a),c=_(s*a);n.width=l,n.height=c,n.rows=s,n.cols=o,n.em&&n.texture({data:u({canvas:M.atlasCanvas,font:n.fontString,chars:n.chars,shape:[l,c],step:[a,a]})})}))}if(t.align&&(this.align=t.align,this.alignOffset=this.textWidth.map((function(t,r){var n=Array.isArray(e.align)?e.align.length>1?e.align[r]:e.align[0]:e.align;if("number"==typeof n)return n;switch(n){case"right":case"end":return-t;case"center":case"centre":case"middle":return.5*-t}return 0}))),null==this.baseline&&null==t.baseline&&(t.baseline=0),null!=t.baseline&&(this.baseline=t.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map((function(t,r){var n=(e.font[r]||e.font[0]).metrics,a=0;return a+=.5*n.bottom,a+="number"==typeof t?t-n.baseline:-n[t],M.normalViewport||(a*=-1),a}))),null!=t.color)if(t.color||(t.color="transparent"),"string"!=typeof t.color&&isNaN(t.color)){var V;if("number"==typeof t.color[0]&&t.color.length>this.counts.length){var W=t.color.length;V=c.mallocUint8(W);for(var G=(t.color.subarray||t.color.slice).bind(t.color),q=0;q<W;q+=4)V.set(l(G(q,q+4),"uint8"),q)}else{var Z=t.color.length;V=c.mallocUint8(4*Z);for(var X=0;X<Z;X++)V.set(l(t.color[X]||0,"uint8"),4*X)}this.color=V}else this.color=l(t.color,"uint8");if(t.position||t.text||t.color||t.baseline||t.align||t.font||t.offset||t.opacity)if(this.color.length>4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2){var J=Math.max(.5*this.position.length||0,.25*this.color.length||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,.5*this.positionOffset.length||0);this.batch=Array(J);for(var K=0;K<this.batch.length;K++)this.batch[K]={count:this.counts.length>1?this.counts[K]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[K]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(4*K,4*K+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[K]:this.opacity,baseline:null!=this.baselineOffset[K]?this.baselineOffset[K]:this.baselineOffset[0],align:this.align?null!=this.alignOffset[K]?this.alignOffset[K]:this.alignOffset[0]:0,atlas:this.fontAtlas[K]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(2*K,2*K+2):this.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]},M.prototype.destroy=function(){},M.prototype.kerning=!0,M.prototype.position={constant:new Float32Array(2)},M.prototype.translate=null,M.prototype.scale=null,M.prototype.font=null,M.prototype.text="",M.prototype.positionOffset=[0,0],M.prototype.opacity=1,M.prototype.color=new Uint8Array([0,0,0,255]),M.prototype.alignOffset=[0,0],M.normalViewport=!1,M.maxAtlasSize=1024,M.atlasCanvas=document.createElement("canvas"),M.atlasContext=M.atlasCanvas.getContext("2d",{alpha:!1}),M.baseFontSize=64,M.fonts={},e.exports=M},{"bit-twiddle":92,"color-normalize":120,"css-font":139,"detect-kerning":166,"es6-weak-map":318,"flatten-vertex-data":227,"font-atlas":228,"font-measure":229,"gl-util/context":323,"is-plain-obj":422,"object-assign":454,"parse-rect":459,"parse-unit":461,"pick-by-alias":465,regl:502,"to-px":539,"typedarray-pool":545}],318:[function(t,e,r){e.exports=t("./is-implemented")()?WeakMap:t("./polyfill")},{"./is-implemented":319,"./polyfill":321}],319:[function(t,e,r){e.exports=function(){var t,e;if("function"!=typeof WeakMap)return!1;try{t=new WeakMap([[e={},"one"],[{},"two"],[{},"three"]])}catch(t){return!1}return"[object WeakMap]"===String(t)&&"function"==typeof t.set&&t.set({},1)===t&&"function"==typeof t.delete&&"function"==typeof t.has&&"one"===t.get(e)}},{}],320:[function(t,e,r){e.exports="function"==typeof WeakMap&&"[object WeakMap]"===Object.prototype.toString.call(new WeakMap)},{}],321:[function(t,e,r){var n,a=t("es5-ext/object/is-value"),i=t("es5-ext/object/set-prototype-of"),o=t("es5-ext/object/valid-object"),s=t("es5-ext/object/valid-value"),l=t("es5-ext/string/random-uniq"),u=t("d"),c=t("es6-iterator/get"),h=t("es6-iterator/for-of"),d=t("es6-symbol").toStringTag,f=t("./is-native-implemented"),p=Array.isArray,m=Object.defineProperty,g=Object.prototype.hasOwnProperty,y=Object.getPrototypeOf;e.exports=n=function(){var t,e=arguments[0];if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");return t=f&&i&&WeakMap!==n?i(new WeakMap,y(this)):this,a(e)&&(p(e)||(e=c(e))),m(t,"__weakMapData__",u("c","$weakMap$"+l())),e?(h(e,(function(e){s(e),t.set(e[0],e[1])})),t):t},f&&(i&&i(n,WeakMap),n.prototype=Object.create(WeakMap.prototype,{constructor:u(n)})),Object.defineProperties(n.prototype,{delete:u((function(t){return!!g.call(o(t),this.__weakMapData__)&&(delete t[this.__weakMapData__],!0)})),get:u((function(t){if(g.call(o(t),this.__weakMapData__))return t[this.__weakMapData__]})),has:u((function(t){return g.call(o(t),this.__weakMapData__)})),set:u((function(t,e){return m(o(t),this.__weakMapData__,u("c",e)),this})),toString:u((function(){return"[object WeakMap]"}))}),m(n.prototype,d,u("c","WeakMap"))},{"./is-native-implemented":320,d:151,"es5-ext/object/is-value":194,"es5-ext/object/set-prototype-of":200,"es5-ext/object/valid-object":204,"es5-ext/object/valid-value":205,"es5-ext/string/random-uniq":210,"es6-iterator/for-of":212,"es6-iterator/get":213,"es6-symbol":219}],322:[function(t,e,r){var n=t("ndarray"),a=t("ndarray-ops"),i=t("typedarray-pool");e.exports=function(t){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(o||function(t){o=[t.LINEAR,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_NEAREST],s=[t.NEAREST,t.LINEAR,t.NEAREST_MIPMAP_NEAREST,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_LINEAR],l=[t.REPEAT,t.CLAMP_TO_EDGE,t.MIRRORED_REPEAT]}(t),"number"==typeof arguments[1])return g(t,arguments[1],arguments[2],arguments[3]||t.RGBA,arguments[4]||t.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return g(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=u(e)?e:e.raw;if(r)return function(t,e,r,n,a,i){var o=m(t);return t.texImage2D(t.TEXTURE_2D,0,a,a,i,e),new d(t,o,r,n,a,i)}(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 function(t,e){var r=e.dtype,o=e.shape.slice(),s=t.getParameter(t.MAX_TEXTURE_SIZE);if(o[0]<0||o[0]>s||o[1]<0||o[1]>s)throw new Error("gl-texture2d: Invalid texture size");var l=p(o,e.stride.slice()),u=0;"float32"===r?u=t.FLOAT:"float64"===r?(u=t.FLOAT,l=!1,r="float32"):"uint8"===r?u=t.UNSIGNED_BYTE:(u=t.UNSIGNED_BYTE,l=!1,r="uint8");var h,f,g=0;if(2===o.length)g=t.LUMINANCE,o=[o[0],o[1],1],e=n(e.data,o,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==o.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===o[2])g=t.ALPHA;else if(2===o[2])g=t.LUMINANCE_ALPHA;else if(3===o[2])g=t.RGB;else{if(4!==o[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");g=t.RGBA}}u!==t.FLOAT||t.getExtension("OES_texture_float")||(u=t.UNSIGNED_BYTE,l=!1);var y=e.size;if(l)h=0===e.offset&&e.data.length===y?e.data:e.data.subarray(e.offset,e.offset+y);else{var v=[o[2],o[2]*o[0],1];f=i.malloc(y,r);var _=n(f,o,v,0);"float32"!==r&&"float64"!==r||u!==t.UNSIGNED_BYTE?a.assign(_,e):c(_,e),h=f.subarray(0,y)}var x=m(t);return t.texImage2D(t.TEXTURE_2D,0,g,o[0],o[1],0,g,u,h),l||i.free(f),new d(t,x,o[0],o[1],g,u)}(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var o=null,s=null,l=null;function u(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}var c=function(t,e){a.muls(t,e,255)};function h(t,e,r){var n=t.gl,a=n.getParameter(n.MAX_TEXTURE_SIZE);if(e<0||e>a||r<0||r>a)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 d(t,e,r,n,a,i){this.gl=t,this.handle=e,this.format=a,this.type=i,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}var f=d.prototype;function p(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 m(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 g(t,e,r,n,a){var i=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>i||r<0||r>i)throw new Error("gl-texture2d: Invalid texture shape");if(a===t.FLOAT&&!t.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var o=m(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,a,null),new d(t,o,e,r,n,a)}Object.defineProperties(f,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.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&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.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(),l.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(),l.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(l.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 h(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return h(this,t|=0,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,h(this,this._shape[0],t),t}}}),f.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},f.dispose=function(){this.gl.deleteTexture(this.handle)},f.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)},f.setPixels=function(t,e,r,o){var s=this.gl;this.bind(),Array.isArray(e)?(o=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),o=o||0;var l=u(t)?t:t.raw;if(l)this._mipLevels.indexOf(o)<0?(s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,this.type,l),this._mipLevels.push(o)):s.texSubImage2D(s.TEXTURE_2D,o,e,r,this.format,this.type,l);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]>>>o||r+t.shape[0]>this._shape[0]>>>o||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(t,e,r,o,s,l,u,h){var d=h.dtype,f=h.shape.slice();if(f.length<2||f.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var m=0,g=0,y=p(f,h.stride.slice());if("float32"===d?m=t.FLOAT:"float64"===d?(m=t.FLOAT,y=!1,d="float32"):"uint8"===d?m=t.UNSIGNED_BYTE:(m=t.UNSIGNED_BYTE,y=!1,d="uint8"),2===f.length)g=t.LUMINANCE,f=[f[0],f[1],1],h=n(h.data,f,[h.stride[0],h.stride[1],1],h.offset);else{if(3!==f.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===f[2])g=t.ALPHA;else if(2===f[2])g=t.LUMINANCE_ALPHA;else if(3===f[2])g=t.RGB;else{if(4!==f[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");g=t.RGBA}f[2]}if(g!==t.LUMINANCE&&g!==t.ALPHA||s!==t.LUMINANCE&&s!==t.ALPHA||(g=s),g!==s)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var v=h.size,_=u.indexOf(o)<0;if(_&&u.push(o),m===l&&y)0===h.offset&&h.data.length===v?_?t.texImage2D(t.TEXTURE_2D,o,s,f[0],f[1],0,s,l,h.data):t.texSubImage2D(t.TEXTURE_2D,o,e,r,f[0],f[1],s,l,h.data):_?t.texImage2D(t.TEXTURE_2D,o,s,f[0],f[1],0,s,l,h.data.subarray(h.offset,h.offset+v)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,f[0],f[1],s,l,h.data.subarray(h.offset,h.offset+v));else{var x;x=l===t.FLOAT?i.mallocFloat32(v):i.mallocUint8(v);var b=n(x,f,[f[2],f[2]*f[0],1]);m===t.FLOAT&&l===t.UNSIGNED_BYTE?c(b,h):a.assign(b,h),_?t.texImage2D(t.TEXTURE_2D,o,s,f[0],f[1],0,s,l,x.subarray(0,v)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,f[0],f[1],s,l,x.subarray(0,v)),l===t.FLOAT?i.freeFloat32(x):i.freeUint8(x)}}(s,e,r,o,this.format,this.type,this._mipLevels,t)}}},{ndarray:450,"ndarray-ops":444,"typedarray-pool":545}],323:[function(t,e,n){(function(r){var n=t("pick-by-alias");function a(t){if(t.container)if(t.container==document.body)document.body.style.width||(t.canvas.width=t.width||t.pixelRatio*r.innerWidth),document.body.style.height||(t.canvas.height=t.height||t.pixelRatio*r.innerHeight);else{var e=t.container.getBoundingClientRect();t.canvas.width=t.width||e.right-e.left,t.canvas.height=t.height||e.bottom-e.top}}function i(t){return"function"==typeof t.getContext&&"width"in t&&"height"in t}function o(){var t=document.createElement("canvas");return t.style.position="absolute",t.style.top=0,t.style.left=0,t}e.exports=function(t){var e;if(t?"string"==typeof t&&(t={container:t}):t={},(t=i(t)||"string"==typeof(e=t).nodeName&&"function"==typeof e.appendChild&&"function"==typeof e.getBoundingClientRect?{container:t}:function(t){return"function"==typeof t.drawArrays||"function"==typeof t.drawElements}(t)?{gl:t}:n(t,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0)).pixelRatio||(t.pixelRatio=r.pixelRatio||1),t.gl)return t.gl;if(t.canvas&&(t.container=t.canvas.parentNode),t.container){if("string"==typeof t.container){var s=document.querySelector(t.container);if(!s)throw Error("Element "+t.container+" is not found");t.container=s}i(t.container)?(t.canvas=t.container,t.container=t.canvas.parentNode):t.canvas||(t.canvas=o(),t.container.appendChild(t.canvas),a(t))}else if(!t.canvas){if("undefined"==typeof document)throw Error("Not DOM environment. Use headless-gl.");t.container=document.body||document.documentElement,t.canvas=o(),t.container.appendChild(t.canvas),a(t)}if(!t.gl)try{t.gl=t.canvas.getContext("webgl",t.attrs)}catch(e){try{t.gl=t.canvas.getContext("experimental-webgl",t.attrs)}catch(e){t.gl=t.canvas.getContext("webgl-experimental",t.attrs)}}return t.gl}}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"pick-by-alias":465}],324:[function(t,e,r){e.exports=function(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 a=0;a<r.length;++a){var i=r[a];if(i.buffer){var o=i.buffer,s=i.size||4,l=i.type||t.FLOAT,u=!!i.normalized,c=i.stride||0,h=i.offset||0;o.bind(),t.enableVertexAttribArray(a),t.vertexAttribPointer(a,s,l,u,c,h)}else{if("number"==typeof i)t.vertexAttrib1f(a,i);else if(1===i.length)t.vertexAttrib1f(a,i[0]);else if(2===i.length)t.vertexAttrib2f(a,i[0],i[1]);else if(3===i.length)t.vertexAttrib3f(a,i[0],i[1],i[2]);else{if(4!==i.length)throw new Error("gl-vao: Invalid vertex attribute");t.vertexAttrib4f(a,i[0],i[1],i[2],i[3])}t.disableVertexAttribArray(a)}}for(;a<n;++a)t.disableVertexAttribArray(a)}else for(t.bindBuffer(t.ARRAY_BUFFER,null),a=0;a<n;++a)t.disableVertexAttribArray(a)}},{}],325:[function(t,e,r){var n=t("./do-bind.js");function a(t){this.gl=t,this._elements=null,this._attributes=null,this._elementsType=t.UNSIGNED_SHORT}a.prototype.bind=function(){n(this.gl,this._elements,this._attributes)},a.prototype.update=function(t,e,r){this._elements=e,this._attributes=t,this._elementsType=r||this.gl.UNSIGNED_SHORT},a.prototype.dispose=function(){},a.prototype.unbind=function(){},a.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=function(t){return new a(t)}},{"./do-bind.js":324}],326:[function(t,e,r){var n=t("./do-bind.js");function a(t,e,r,n,a,i){this.location=t,this.dimension=e,this.a=r,this.b=n,this.c=a,this.d=i}function i(t,e,r){this.gl=t,this._ext=e,this.handle=r,this._attribs=[],this._useElements=!1,this._elementsType=t.UNSIGNED_SHORT}a.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(),n(this.gl,e,t),this.unbind(),this._attribs.length=0,t)for(var i=0;i<t.length;++i){var o=t[i];"number"==typeof o?this._attribs.push(new a(i,1,o)):Array.isArray(o)&&this._attribs.push(new a(i,o.length,o[0],o[1],o[2],o[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=function(t,e){return new i(t,e,e.createVertexArrayOES())}},{"./do-bind.js":324}],327:[function(t,e,r){var n=t("./lib/vao-native.js"),a=t("./lib/vao-emulated.js");function i(t){this.bindVertexArrayOES=t.bindVertexArray.bind(t),this.createVertexArrayOES=t.createVertexArray.bind(t),this.deleteVertexArrayOES=t.deleteVertexArray.bind(t)}e.exports=function(t,e,r,o){var s,l=t.createVertexArray?new i(t):t.getExtension("OES_vertex_array_object");return(s=l?n(t,l):a(t)).update(e,r,o),s}},{"./lib/vao-emulated.js":325,"./lib/vao-native.js":326}],328:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}},{}],329:[function(t,e,r){e.exports=function(t,e){var r=n(t[0],t[1],t[2]),o=n(e[0],e[1],e[2]);a(r,r),a(o,o);var s=i(r,o);return s>1?0:Math.acos(s)};var n=t("./fromValues"),a=t("./normalize"),i=t("./dot")},{"./dot":339,"./fromValues":345,"./normalize":356}],330:[function(t,e,r){e.exports=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}},{}],331:[function(t,e,r){e.exports=function(t){var e=new Float32Array(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}},{}],332:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}},{}],333:[function(t,e,r){e.exports=function(){var t=new Float32Array(3);return t[0]=0,t[1]=0,t[2]=0,t}},{}],334:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],a=e[1],i=e[2],o=r[0],s=r[1],l=r[2];return t[0]=a*l-i*s,t[1]=i*o-n*l,t[2]=n*s-a*o,t}},{}],335:[function(t,e,r){e.exports=t("./distance")},{"./distance":336}],336:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],a=e[2]-t[2];return Math.sqrt(r*r+n*n+a*a)}},{}],337:[function(t,e,r){e.exports=t("./divide")},{"./divide":338}],338:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}},{}],339:[function(t,e,r){e.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}},{}],340:[function(t,e,r){e.exports=1e-6},{}],341:[function(t,e,r){e.exports=function(t,e){var r=t[0],a=t[1],i=t[2],o=e[0],s=e[1],l=e[2];return Math.abs(r-o)<=n*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(a-s)<=n*Math.max(1,Math.abs(a),Math.abs(s))&&Math.abs(i-l)<=n*Math.max(1,Math.abs(i),Math.abs(l))};var n=t("./epsilon")},{"./epsilon":340}],342:[function(t,e,r){e.exports=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}},{}],343:[function(t,e,r){e.exports=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}},{}],344:[function(t,e,r){e.exports=function(t,e,r,a,i,o){var s,l;for(e||(e=3),r||(r=0),l=a?Math.min(a*e+r,t.length):t.length,s=r;s<l;s+=e)n[0]=t[s],n[1]=t[s+1],n[2]=t[s+2],i(n,n,o),t[s]=n[0],t[s+1]=n[1],t[s+2]=n[2];return t};var n=t("./create")()},{"./create":333}],345:[function(t,e,r){e.exports=function(t,e,r){var n=new Float32Array(3);return n[0]=t,n[1]=e,n[2]=r,n}},{}],346:[function(t,e,r){e.exports={EPSILON:t("./epsilon"),create:t("./create"),clone:t("./clone"),angle:t("./angle"),fromValues:t("./fromValues"),copy:t("./copy"),set:t("./set"),equals:t("./equals"),exactEquals:t("./exactEquals"),add:t("./add"),subtract:t("./subtract"),sub:t("./sub"),multiply:t("./multiply"),mul:t("./mul"),divide:t("./divide"),div:t("./div"),min:t("./min"),max:t("./max"),floor:t("./floor"),ceil:t("./ceil"),round:t("./round"),scale:t("./scale"),scaleAndAdd:t("./scaleAndAdd"),distance:t("./distance"),dist:t("./dist"),squaredDistance:t("./squaredDistance"),sqrDist:t("./sqrDist"),length:t("./length"),len:t("./len"),squaredLength:t("./squaredLength"),sqrLen:t("./sqrLen"),negate:t("./negate"),inverse:t("./inverse"),normalize:t("./normalize"),dot:t("./dot"),cross:t("./cross"),lerp:t("./lerp"),random:t("./random"),transformMat4:t("./transformMat4"),transformMat3:t("./transformMat3"),transformQuat:t("./transformQuat"),rotateX:t("./rotateX"),rotateY:t("./rotateY"),rotateZ:t("./rotateZ"),forEach:t("./forEach")}},{"./add":328,"./angle":329,"./ceil":330,"./clone":331,"./copy":332,"./create":333,"./cross":334,"./dist":335,"./distance":336,"./div":337,"./divide":338,"./dot":339,"./epsilon":340,"./equals":341,"./exactEquals":342,"./floor":343,"./forEach":344,"./fromValues":345,"./inverse":347,"./len":348,"./length":349,"./lerp":350,"./max":351,"./min":352,"./mul":353,"./multiply":354,"./negate":355,"./normalize":356,"./random":357,"./rotateX":358,"./rotateY":359,"./rotateZ":360,"./round":361,"./scale":362,"./scaleAndAdd":363,"./set":364,"./sqrDist":365,"./sqrLen":366,"./squaredDistance":367,"./squaredLength":368,"./sub":369,"./subtract":370,"./transformMat3":371,"./transformMat4":372,"./transformQuat":373}],347:[function(t,e,r){e.exports=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}},{}],348:[function(t,e,r){e.exports=t("./length")},{"./length":349}],349:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}},{}],350:[function(t,e,r){e.exports=function(t,e,r,n){var a=e[0],i=e[1],o=e[2];return t[0]=a+n*(r[0]-a),t[1]=i+n*(r[1]-i),t[2]=o+n*(r[2]-o),t}},{}],351:[function(t,e,r){e.exports=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}},{}],352:[function(t,e,r){e.exports=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}},{}],353:[function(t,e,r){e.exports=t("./multiply")},{"./multiply":354}],354:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}},{}],355:[function(t,e,r){e.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}},{}],356:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],a=e[2],i=r*r+n*n+a*a;return i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i),t}},{}],357:[function(t,e,r){e.exports=function(t,e){e=e||1;var r=2*Math.random()*Math.PI,n=2*Math.random()-1,a=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*a,t[1]=Math.sin(r)*a,t[2]=n*e,t}},{}],358:[function(t,e,r){e.exports=function(t,e,r,n){var a=r[1],i=r[2],o=e[1]-a,s=e[2]-i,l=Math.sin(n),u=Math.cos(n);return t[0]=e[0],t[1]=a+o*u-s*l,t[2]=i+o*l+s*u,t}},{}],359:[function(t,e,r){e.exports=function(t,e,r,n){var a=r[0],i=r[2],o=e[0]-a,s=e[2]-i,l=Math.sin(n),u=Math.cos(n);return t[0]=a+s*l+o*u,t[1]=e[1],t[2]=i+s*u-o*l,t}},{}],360:[function(t,e,r){e.exports=function(t,e,r,n){var a=r[0],i=r[1],o=e[0]-a,s=e[1]-i,l=Math.sin(n),u=Math.cos(n);return t[0]=a+o*u-s*l,t[1]=i+o*l+s*u,t[2]=e[2],t}},{}],361:[function(t,e,r){e.exports=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}},{}],362:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}},{}],363:[function(t,e,r){e.exports=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}},{}],364:[function(t,e,r){e.exports=function(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}},{}],365:[function(t,e,r){e.exports=t("./squaredDistance")},{"./squaredDistance":367}],366:[function(t,e,r){e.exports=t("./squaredLength")},{"./squaredLength":368}],367:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],a=e[2]-t[2];return r*r+n*n+a*a}},{}],368:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}},{}],369:[function(t,e,r){e.exports=t("./subtract")},{"./subtract":370}],370:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}},{}],371:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],a=e[1],i=e[2];return t[0]=n*r[0]+a*r[3]+i*r[6],t[1]=n*r[1]+a*r[4]+i*r[7],t[2]=n*r[2]+a*r[5]+i*r[8],t}},{}],372:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],a=e[1],i=e[2],o=r[3]*n+r[7]*a+r[11]*i+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*a+r[8]*i+r[12])/o,t[1]=(r[1]*n+r[5]*a+r[9]*i+r[13])/o,t[2]=(r[2]*n+r[6]*a+r[10]*i+r[14])/o,t}},{}],373:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],a=e[1],i=e[2],o=r[0],s=r[1],l=r[2],u=r[3],c=u*n+s*i-l*a,h=u*a+l*n-o*i,d=u*i+o*a-s*n,f=-o*n-s*a-l*i;return t[0]=c*u+f*-o+h*-l-d*-s,t[1]=h*u+f*-s+d*-o-c*-l,t[2]=d*u+f*-l+c*-s-h*-o,t}},{}],374:[function(t,e,r){e.exports=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}},{}],375:[function(t,e,r){e.exports=function(t){var e=new Float32Array(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}},{}],376:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}},{}],377:[function(t,e,r){e.exports=function(){var t=new Float32Array(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}},{}],378:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],a=e[2]-t[2],i=e[3]-t[3];return Math.sqrt(r*r+n*n+a*a+i*i)}},{}],379:[function(t,e,r){e.exports=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}},{}],380:[function(t,e,r){e.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}},{}],381:[function(t,e,r){e.exports=function(t,e,r,n){var a=new Float32Array(4);return a[0]=t,a[1]=e,a[2]=r,a[3]=n,a}},{}],382:[function(t,e,r){e.exports={create:t("./create"),clone:t("./clone"),fromValues:t("./fromValues"),copy:t("./copy"),set:t("./set"),add:t("./add"),subtract:t("./subtract"),multiply:t("./multiply"),divide:t("./divide"),min:t("./min"),max:t("./max"),scale:t("./scale"),scaleAndAdd:t("./scaleAndAdd"),distance:t("./distance"),squaredDistance:t("./squaredDistance"),length:t("./length"),squaredLength:t("./squaredLength"),negate:t("./negate"),inverse:t("./inverse"),normalize:t("./normalize"),dot:t("./dot"),lerp:t("./lerp"),random:t("./random"),transformMat4:t("./transformMat4"),transformQuat:t("./transformQuat")}},{"./add":374,"./clone":375,"./copy":376,"./create":377,"./distance":378,"./divide":379,"./dot":380,"./fromValues":381,"./inverse":383,"./length":384,"./lerp":385,"./max":386,"./min":387,"./multiply":388,"./negate":389,"./normalize":390,"./random":391,"./scale":392,"./scaleAndAdd":393,"./set":394,"./squaredDistance":395,"./squaredLength":396,"./subtract":397,"./transformMat4":398,"./transformQuat":399}],383:[function(t,e,r){e.exports=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}},{}],384:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2],a=t[3];return Math.sqrt(e*e+r*r+n*n+a*a)}},{}],385:[function(t,e,r){e.exports=function(t,e,r,n){var a=e[0],i=e[1],o=e[2],s=e[3];return t[0]=a+n*(r[0]-a),t[1]=i+n*(r[1]-i),t[2]=o+n*(r[2]-o),t[3]=s+n*(r[3]-s),t}},{}],386:[function(t,e,r){e.exports=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}},{}],387:[function(t,e,r){e.exports=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}},{}],388:[function(t,e,r){e.exports=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}},{}],389:[function(t,e,r){e.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}},{}],390:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],a=e[2],i=e[3],o=r*r+n*n+a*a+i*i;return o>0&&(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=a*o,t[3]=i*o),t}},{}],391:[function(t,e,r){var n=t("./normalize"),a=t("./scale");e.exports=function(t,e){return e=e||1,t[0]=Math.random(),t[1]=Math.random(),t[2]=Math.random(),t[3]=Math.random(),n(t,t),a(t,t,e),t}},{"./normalize":390,"./scale":392}],392:[function(t,e,r){e.exports=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}},{}],393:[function(t,e,r){e.exports=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}},{}],394:[function(t,e,r){e.exports=function(t,e,r,n,a){return t[0]=e,t[1]=r,t[2]=n,t[3]=a,t}},{}],395:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],a=e[2]-t[2],i=e[3]-t[3];return r*r+n*n+a*a+i*i}},{}],396:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2],a=t[3];return e*e+r*r+n*n+a*a}},{}],397:[function(t,e,r){e.exports=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}},{}],398:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],a=e[1],i=e[2],o=e[3];return t[0]=r[0]*n+r[4]*a+r[8]*i+r[12]*o,t[1]=r[1]*n+r[5]*a+r[9]*i+r[13]*o,t[2]=r[2]*n+r[6]*a+r[10]*i+r[14]*o,t[3]=r[3]*n+r[7]*a+r[11]*i+r[15]*o,t}},{}],399:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],a=e[1],i=e[2],o=r[0],s=r[1],l=r[2],u=r[3],c=u*n+s*i-l*a,h=u*a+l*n-o*i,d=u*i+o*a-s*n,f=-o*n-s*a-l*i;return t[0]=c*u+f*-o+h*-l-d*-s,t[1]=h*u+f*-s+d*-o-c*-l,t[2]=d*u+f*-l+c*-s-h*-o,t[3]=e[3],t}},{}],400:[function(t,e,r){e.exports=function(t,e,r,i){return n[0]=i,n[1]=r,n[2]=e,n[3]=t,a[0]};var n=new Uint8Array(4),a=new Float32Array(n.buffer)},{}],401:[function(t,e,r){var n=t("glsl-tokenizer"),a=t("atob-lite");e.exports=function(t){for(var e=Array.isArray(t)?t:n(t),r=0;r<e.length;r++){var i=e[r];if("preprocessor"===i.type){var o=i.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()}}}}},{"atob-lite":72,"glsl-tokenizer":408}],402:[function(t,e,r){e.exports=function(t){var e,r,M,k=0,T=0,L=l,A=[],S=[],E=1,C=0,D=0,P=!1,O=!1,z="",I=i,R=n;return"300 es"===(t=t||{}).version&&(I=s,R=o),function(t){return S=[],null!==t?function(t){var r;for(k=0,M=(z+=t).length;e=z[k],k<M;){switch(r=k,L){case c:k=B();break;case h:case d:k=j();break;case f:k=H();break;case p:k=W();break;case b:k=V();break;case m:k=G();break;case u:k=q();break;case _:k=Y();break;case l:k=N()}r!==k&&("\n"===z[r]?(C=0,++E):++C)}return T+=k,z=z.slice(k),S}(t.replace?t.replace(/\r\n/g,"\n"):t):(A.length&&F(A.join("")),L=x,F("(eof)"),S)};function F(t){t.length&&S.push({type:w[L],data:t,position:D,line:E,column:C})}function N(){return A=A.length?[]:A,"/"===r&&"*"===e?(D=T+k-1,L=c,r=e,k+1):"/"===r&&"/"===e?(D=T+k-1,L=h,r=e,k+1):"#"===e?(L=d,D=T+k,k):/\s/.test(e)?(L=_,D=T+k,k):(P=/\d/.test(e),O=/[^\w_]/.test(e),D=T+k,L=P?p:O?f:u,k)}function Y(){return/[^\s]/g.test(e)?(F(A.join("")),L=l,k):(A.push(e),r=e,k+1)}function j(){return"\r"!==e&&"\n"!==e||"\\"===r?(A.push(e),r=e,k+1):(F(A.join("")),L=l,k)}function B(){return"/"===e&&"*"===r?(A.push(e),F(A.join("")),L=l,k+1):(A.push(e),r=e,k+1)}function H(){if("."===r&&/\d/.test(e))return L=m,k;if("/"===r&&"*"===e)return L=c,k;if("/"===r&&"/"===e)return L=h,k;if("."===e&&A.length){for(;U(A););return L=m,k}if(";"===e||")"===e||"("===e){if(A.length)for(;U(A););return F(e),L=l,k+1}var t=2===A.length&&"="!==e;if(/[\w_\d\s]/.test(e)||t){for(;U(A););return L=l,k}return A.push(e),r=e,k+1}function U(t){for(var e,r,n=0;;){if(e=a.indexOf(t.slice(0,t.length+n).join("")),r=a[e],-1===e){if(n--+t.length>0)continue;r=t.slice(0,1).join("")}return F(r),D+=r.length,(A=A.slice(r.length)).length}}function V(){return/[^a-fA-F0-9]/.test(e)?(F(A.join("")),L=l,k):(A.push(e),r=e,k+1)}function W(){return"."===e||/[eE]/.test(e)?(A.push(e),L=m,r=e,k+1):"x"===e&&1===A.length&&"0"===A[0]?(L=b,A.push(e),r=e,k+1):/[^\d]/.test(e)?(F(A.join("")),L=l,k):(A.push(e),r=e,k+1)}function G(){return"f"===e&&(A.push(e),r=e,k+=1),/[eE]/.test(e)||"-"===e&&/[eE]/.test(r)?(A.push(e),r=e,k+1):/[^\d]/.test(e)?(F(A.join("")),L=l,k):(A.push(e),r=e,k+1)}function q(){if(/[^\d\w_]/.test(e)){var t=A.join("");return L=R.indexOf(t)>-1?v:I.indexOf(t)>-1?y:g,F(A.join("")),L=l,k}return A.push(e),r=e,k+1}};var n=t("./lib/literals"),a=t("./lib/operators"),i=t("./lib/builtins"),o=t("./lib/literals-300es"),s=t("./lib/builtins-300es"),l=999,u=9999,c=0,h=1,d=2,f=3,p=4,m=5,g=6,y=7,v=8,_=9,x=10,b=11,w=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":404,"./lib/builtins-300es":403,"./lib/literals":406,"./lib/literals-300es":405,"./lib/operators":407}],403:[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":404}],404:[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"]},{}],405:[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":406}],406:[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"]},{}],407:[function(t,e,r){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],408:[function(t,e,r){var n=t("./index");e.exports=function(t,e){var r=n(e),a=[];return(a=a.concat(r(t))).concat(r(null))}},{"./index":402}],409:[function(t,e,r){e.exports=function(t){"string"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n<t.length-1;n++)r.push(t[n],e[n]||"");return r.push(t[n]),r.join("")}},{}],410:[function(t,e,n){(function(r){var n,a=t("is-browser");n="function"==typeof r.matchMedia?!r.matchMedia("(hover: none)").matches:a,e.exports=n}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"is-browser":417}],411:[function(t,e,r){var n=t("is-browser");e.exports=n&&function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){t=!1}return t}()},{"is-browser":417}],412:[function(t,e,r){r.read=function(t,e,r,n,a){var i,o,s=8*a-n-1,l=(1<<s)-1,u=l>>1,c=-7,h=r?a-1:0,d=r?-1:1,f=t[e+h];for(h+=d,i=f&(1<<-c)-1,f>>=-c,c+=s;c>0;i=256*i+t[e+h],h+=d,c-=8);for(o=i&(1<<-c)-1,i>>=-c,c+=n;c>0;o=256*o+t[e+h],h+=d,c-=8);if(0===i)i=1-u;else{if(i===l)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),i-=u}return(f?-1:1)*o*Math.pow(2,i-n)},r.write=function(t,e,r,n,a,i){var o,s,l,u=8*i-a-1,c=(1<<u)-1,h=c>>1,d=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:i-1,p=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=c?(s=0,o=c):o+h>=1?(s=(e*l-1)*Math.pow(2,a),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,a),o=0));a>=8;t[r+f]=255&s,f+=p,s/=256,a-=8);for(o=o<<a|s,u+=a;u>0;t[r+f]=255&o,f+=p,o/=256,u-=8);t[r+f-p]|=128*m}},{}],413:[function(t,e,r){e.exports=function(t,e){var r=t.length;if(0===r)throw new Error("Must have at least d+1 points");var a=t[0].length;if(r<=a)throw new Error("Must input at least d+1 points");var o=t.slice(0,a+1),s=n.apply(void 0,o);if(0===s)throw new Error("Input not in general position");for(var l=new Array(a+1),c=0;c<=a;++c)l[c]=c;s<0&&(l[0]=1,l[1]=0);var h=new i(l,new Array(a+1),!1),d=h.adjacent,f=new Array(a+2);for(c=0;c<=a;++c){for(var p=l.slice(),m=0;m<=a;++m)m===c&&(p[m]=-1);var g=p[0];p[0]=p[1],p[1]=g;var y=new i(p,new Array(a+1),!0);d[c]=y,f[c]=y}for(f[a+1]=h,c=0;c<=a;++c){p=d[c].vertices;var v=d[c].adjacent;for(m=0;m<=a;++m){var _=p[m];if(_<0)v[m]=h;else for(var x=0;x<=a;++x)d[x].vertices.indexOf(_)<0&&(v[m]=d[x])}}var b=new u(a,o,f),w=!!e;for(c=a+1;c<r;++c)b.insert(t[c],w);return b.boundary()};var n=t("robust-orientation"),a=t("simplicial-complex").compareCells;function i(t,e,r){this.vertices=t,this.adjacent=e,this.boundary=r,this.lastVisited=-1}function o(t,e,r){this.vertices=t,this.cell=e,this.index=r}function s(t,e){return a(t.vertices,e.vertices)}i.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 l=[];function u(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 a=0;a<=t;++a)this.tuple[a]=this.vertices[a];var i=l[t];i||(i=l[t]=function(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 a=new Function("test",e.join("")),i=n[t+1];return i||(i=n),a(i)}(t)),this.orient=i}var c=u.prototype;c.handleBoundaryDegeneracy=function(t,e){var r=this.dimension,n=this.vertices.length-1,a=this.tuple,i=this.vertices,o=[t];for(t.lastVisited=-n;o.length>0;){(t=o.pop()).vertices;for(var s=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 d=c[h];a[h]=d<0?e:i[d]}var f=this.orient();if(f>0)return u;u.lastVisited=-n,0===f&&o.push(u)}}}return null},c.walk=function(t,e){var r=this.vertices.length-1,n=this.dimension,a=this.vertices,i=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)i[c]=a[l[c]];for(s.lastVisited=r,c=0;c<=n;++c){var h=u[c];if(!(h.lastVisited>=r)){var d=i[c];i[c]=t;var f=this.orient();if(i[c]=d,f<0){s=h;continue t}h.boundary?h.lastVisited=-r:h.lastVisited=r}}return}return s},c.addPeaks=function(t,e){var r=this.vertices.length-1,n=this.dimension,a=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 d=[];h.length>0;){var f=(e=h.pop()).vertices,p=e.adjacent,m=f.indexOf(r);if(!(m<0))for(var g=0;g<=n;++g)if(g!==m){var y=p[g];if(y.boundary&&!(y.lastVisited>=r)){var v=y.vertices;if(y.lastVisited!==-r){for(var _=0,x=0;x<=n;++x)v[x]<0?(_=x,l[x]=t):l[x]=a[v[x]];if(this.orient()>0){v[_]=r,y.boundary=!1,u.push(y),h.push(y),y.lastVisited=r;continue}y.lastVisited=-r}var b=y.adjacent,w=f.slice(),M=p.slice(),k=new i(w,M,!0);c.push(k);var T=b.indexOf(e);if(!(T<0))for(b[T]=k,M[m]=y,w[g]=-1,M[g]=e,p[g]=k,k.flip(),x=0;x<=n;++x){var L=w[x];if(!(L<0||L===r)){for(var A=new Array(n-1),S=0,E=0;E<=n;++E){var C=w[E];C<0||E===x||(A[S++]=C)}d.push(new o(A,k,x))}}}}}for(d.sort(s),g=0;g+1<d.length;g+=2){var D=d[g],P=d[g+1],O=D.index,z=P.index;O<0||z<0||(D.cell.adjacent[D.index]=P.cell,P.cell.adjacent[P.index]=D.cell)}},c.insert=function(t,e){var r=this.vertices;r.push(t);var n=this.walk(t,e);if(n){for(var a=this.dimension,i=this.tuple,o=0;o<=a;++o){var s=n.vertices[o];i[o]=s<0?t:r[s]}var l=this.orient(i);l<0||(0!==l||(n=this.handleBoundaryDegeneracy(n,t)))&&this.addPeaks(t,n)}},c.boundary=function(){for(var t=this.dimension,e=[],r=this.simplices,n=r.length,a=0;a<n;++a){var i=r[a];if(i.boundary){for(var o=new Array(t),s=i.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":510,"simplicial-complex":520}],414:[function(t,e,r){var n=t("binary-search-bounds");function a(t,e,r,n,a){this.mid=t,this.left=e,this.right=r,this.leftPoints=n,this.rightPoints=a,this.count=(e?e.count:0)+(r?r.count:0)+n.length}e.exports=function(t){return t&&0!==t.length?new y(g(t)):new y(null)};var i=a.prototype;function o(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 s(t,e){var r=g(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 l(t,e){var r=t.intervals([]);r.push(e),s(t,r)}function u(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?0:(r.splice(n,1),s(t,r),1)}function c(t,e,r){for(var n=0;n<t.length&&t[n][0]<=e;++n){var a=r(t[n]);if(a)return a}}function h(t,e,r){for(var n=t.length-1;n>=0&&t[n][1]>=e;--n){var a=r(t[n]);if(a)return a}}function d(t,e){for(var r=0;r<t.length;++r){var n=e(t[r]);if(n)return n}}function f(t,e){return t-e}function p(t,e){return t[0]-e[0]||t[1]-e[1]}function m(t,e){return t[1]-e[1]||t[0]-e[0]}function g(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(f);var n=e[e.length>>1],i=[],o=[],s=[];for(r=0;r<t.length;++r){var l=t[r];l[1]<n?i.push(l):n<l[0]?o.push(l):s.push(l)}var u=s,c=s.slice();return u.sort(p),c.sort(m),new a(n,g(i),g(o),u,c)}function y(t){this.root=t}i.intervals=function(t){return t.push.apply(t,this.leftPoints),this.left&&this.left.intervals(t),this.right&&this.right.intervals(t),t},i.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)?l(this,t):this.left.insert(t):this.left=g([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?l(this,t):this.right.insert(t):this.right=g([t]);else{var r=n.ge(this.leftPoints,t,p),a=n.ge(this.rightPoints,t,m);this.leftPoints.splice(r,0,t),this.rightPoints.splice(a,0,t)}},i.remove=function(t){var e=this.count-this.leftPoints;if(t[1]<this.mid)return this.left?4*(this.right?this.right.count:0)>3*(e-1)?u(this,t):2===(s=this.left.remove(t))?(this.left=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(t[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(e-1)?u(this,t):2===(s=this.right.remove(t))?(this.right=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(1===this.count)return this.leftPoints[0]===t?2:0;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var r=this,a=this.left;a.right;)r=a,a=a.right;if(r===this)a.right=this.right;else{var i=this.left,s=this.right;r.count-=a.count,r.right=a.left,a.left=i,a.right=s}o(this,a),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?o(this,this.left):o(this,this.right);return 1}for(i=n.ge(this.leftPoints,t,p);i<this.leftPoints.length&&this.leftPoints[i][0]===t[0];++i)if(this.leftPoints[i]===t)for(this.count-=1,this.leftPoints.splice(i,1),s=n.ge(this.rightPoints,t,m);s<this.rightPoints.length&&this.rightPoints[s][1]===t[1];++s)if(this.rightPoints[s]===t)return this.rightPoints.splice(s,1),1;return 0},i.queryPoint=function(t,e){return t<this.mid?this.left&&(r=this.left.queryPoint(t,e))?r:c(this.leftPoints,t,e):t>this.mid?this.right&&(r=this.right.queryPoint(t,e))?r:h(this.rightPoints,t,e):d(this.leftPoints,e);var r},i.queryInterval=function(t,e,r){var n;return t<this.mid&&this.left&&(n=this.left.queryInterval(t,e,r))||e>this.mid&&this.right&&(n=this.right.queryInterval(t,e,r))?n:e<this.mid?c(this.leftPoints,e,r):t>this.mid?h(this.rightPoints,t,r):d(this.leftPoints,r)};var v=y.prototype;v.insert=function(t){this.root?this.root.insert(t):this.root=new a(t[0],null,null,[t],[t])},v.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),0!==e}return!1},v.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},v.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(v,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(v,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":91}],415:[function(t,e,r){e.exports=function(t,e){e=e||new Array(t.length);for(var r=0;r<t.length;++r)e[t[r]]=r;return e}},{}],416:[function(t,e,r){e.exports=function(t){for(var e=new Array(t),r=0;r<t;++r)e[r]=r;return e}},{}],417:[function(t,e,r){e.exports=!0},{}],418:[function(t,e,r){function n(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}e.exports=function(t){return null!=t&&(n(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&n(t.slice(0,0))}(t)||!!t._isBuffer)}},{}],419:[function(t,e,r){e.exports="undefined"!=typeof navigator&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion))},{}],420:[function(t,e,r){e.exports=i,e.exports.isMobile=i;var n=/(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,a=/(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|android|ipad|playbook|silk/i;function i(t){t||(t={});var e=t.ua;return e||"undefined"==typeof navigator||(e=navigator.userAgent),e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]),"string"==typeof e&&(t.tablet?a.test(e):n.test(e))}},{}],421:[function(t,e,r){e.exports=function(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}},{}],422:[function(t,e,r){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({}))}},{}],423:[function(t,e,r){e.exports=function(t){for(var e,r=t.length,n=0;n<r;n++)if(((e=t.charCodeAt(n))<9||e>13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}},{}],424:[function(t,e,r){e.exports=function(t){return"string"==typeof t&&(t=t.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(t)&&/[\dz]$/i.test(t)&&t.length>4))}},{}],425:[function(t,e,r){e.exports=function(t,e,r){return t*(1-r)+e*r}},{}],426:[function(t,e,r){var n,a;n=this,a=function(){var t,e,r;function n(n,a){if(t)if(e){var i="var sharedChunk = {}; ("+t+")(sharedChunk); ("+e+")(sharedChunk);",o={};t(o),(r=a(o)).workerUrl=window.URL.createObjectURL(new Blob([i],{type:"text/javascript"}))}else e=a;else t=a}return n(0,(function(t){function e(t,e){return t(e={exports:{}},e.exports),e.exports}var r=n;function n(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=r,this.p2y=n}n.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},n.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},n.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},n.prototype.solveCurveX=function(t,e){var r,n,a,i,o;for(void 0===e&&(e=1e-6),a=t,o=0;o<8;o++){if(i=this.sampleCurveX(a)-t,Math.abs(i)<e)return a;var s=this.sampleCurveDerivativeX(a);if(Math.abs(s)<1e-6)break;a-=i/s}if((a=t)<(r=0))return r;if(a>(n=1))return n;for(;r<n;){if(i=this.sampleCurveX(a),Math.abs(i-t)<e)return a;t>i?r=a:n=a,a=.5*(n-r)+r}return a},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var a=i;function i(t,e){this.x=t,this.y=e}function o(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(!o(t[r],e[r]))return!1;return!0}if("object"==typeof t&&null!==t&&null!==e){if("object"!=typeof e)return!1;if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(!o(t[n],e[n]))return!1;return!0}return t===e}function s(t,e,n,a){var i=new r(t,e,n,a);return function(t){return i.solve(t)}}i.prototype={clone:function(){return new i(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,a=r*this.x+e*this.y;return this.x=n,this.y=a,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),a=e.x+r*(this.x-e.x)-n*(this.y-e.y),i=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=a,this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},i.convert=function(t){return t instanceof i?t:Array.isArray(t)?new i(t[0],t[1]):t};var l=s(.25,.1,.25,1);function u(t,e,r){return Math.min(r,Math.max(e,t))}function c(t,e,r){var n=r-e,a=((t-e)%n+n)%n+e;return a===e?r:a}function h(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,a=e;n<a.length;n+=1){var i=a[n];for(var o in i)t[o]=i[o]}return t}var d=1;function f(){return d++}function p(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function m(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function g(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function y(t,e){return-1!==t.indexOf(e,t.length-e.length)}function v(t,e,r){var n={};for(var a in t)n[a]=e.call(r||this,t[a],a,t);return n}function _(t,e,r){var n={};for(var a in t)e.call(r||this,t[a],a,t)&&(n[a]=t[a]);return n}function x(t){return Array.isArray(t)?t.map(x):"object"==typeof t&&t?v(t,x):t}var b={};function w(t){b[t]||("undefined"!=typeof console&&console.warn(t),b[t]=!0)}function M(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function k(t){for(var e=0,r=0,n=t.length,a=n-1,i=void 0,o=void 0;r<n;a=r++)i=t[r],e+=((o=t[a]).x-i.x)*(i.y+o.y);return e}function T(t){var e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,n,a){var i=n||a;return e[r]=!i||i.toLowerCase(),""})),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}function L(t){try{var e=self[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var A,S,E,C=self.performance&&self.performance.now?self.performance.now.bind(self.performance):Date.now.bind(Date),D=self.requestAnimationFrame||self.mozRequestAnimationFrame||self.webkitRequestAnimationFrame||self.msRequestAnimationFrame,P=self.cancelAnimationFrame||self.mozCancelAnimationFrame||self.webkitCancelAnimationFrame||self.msCancelAnimationFrame,O={now:C,frame:function(t){var e=D(t);return{cancel:function(){return P(e)}}},getImageData:function(t){var e=self.document.createElement("canvas"),r=e.getContext("2d");if(!r)throw new Error("failed to create canvas 2d context");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0,t.width,t.height),r.getImageData(0,0,t.width,t.height)},resolveURL:function(t){return A||(A=self.document.createElement("a")),A.href=t,A.href},hardwareConcurrency:self.navigator.hardwareConcurrency||4,get devicePixelRatio(){return self.devicePixelRatio}},z={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},I={supported:!1,testSupport:function(t){!R&&E&&(F?N(t):S=t)}},R=!1,F=!1;function N(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,E),t.isContextLost())return;I.supported=!0}catch(t){}t.deleteTexture(e),R=!0}self.document&&((E=self.document.createElement("img")).onload=function(){S&&N(S),S=null,F=!0},E.onerror=function(){R=!0,S=null},E.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var Y="01",j=function(t){this._transformRequestFn=t,this._createSkuToken()};j.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",Y,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},j.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},j.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},j.prototype.normalizeStyleURL=function(t,e){return G(t,e)},j.prototype.normalizeGlyphsURL=function(t,e){return q(t,e)},j.prototype.normalizeSourceURL=function(t,e){return Z(t,e)},j.prototype.normalizeSpriteURL=function(t,e,r,n){return X(t,e,r,n)},j.prototype.normalizeTileURL=function(t,e,r){return this._isSkuTokenExpired()&&this._createSkuToken(),K(t,e,r,this._skuToken)},j.prototype.canonicalizeTileURL=function(t){return Q(t)},j.prototype.canonicalizeTileset=function(t,e){return tt(t,e)};var B="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes";function H(t,e){var r=rt(z.API_URL);if(t.protocol=r.protocol,t.authority=r.authority,"/"!==r.path&&(t.path=""+r.path+t.path),!z.REQUIRE_ACCESS_TOKEN)return nt(t);if(!(e=e||z.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+B);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+B);return t.params.push("access_token="+e),nt(t)}function U(t){return 0===t.indexOf("mapbox:")}var V=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function W(t){return V.test(t)}var G=function(t,e){if(!U(t))return t;var r=rt(t);return r.path="/styles/v1"+r.path,H(r,e)},q=function(t,e){if(!U(t))return t;var r=rt(t);return r.path="/fonts/v1"+r.path,H(r,e)},Z=function(t,e){if(!U(t))return t;var r=rt(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),H(r,e)},X=function(t,e,r,n){var a=rt(t);return U(t)?(a.path="/styles/v1"+a.path+"/sprite"+e+r,H(a,n)):(a.path+=""+e+r,nt(a))},J=/(\.(png|jpg)\d*)(?=$)/,K=function(t,e,r,n){if(!e||!U(e))return t;var a=rt(t),i=O.devicePixelRatio>=2||512===r?"@2x":"",o=I.supported?".webp":"$1";return a.path=a.path.replace(J,""+i+o),a.path="/v4"+a.path,z.REQUIRE_ACCESS_TOKEN&&z.ACCESS_TOKEN&&n&&a.params.push("sku="+n),H(a)},$=/\.[\w]+$/,Q=function(t){var e=rt(t);if(!e.path.match(/(^\/v4\/)/)||!e.path.match($))return t;var r="mapbox://tiles/";r+=e.path.replace("/v4/","");var n=e.params.filter((function(t){return!t.match(/^access_token=/)}));return n.length&&(r+="?"+n.join("&")),r},tt=function(t,e){if(!U(e))return t.tiles||[];for(var r=[],n=0,a=t.tiles;n<a.length;n+=1){var i=a[n],o=Q(i);r.push(o)}return r},et=/^(\w+):\/\/([^\/?]*)(\/[^?]+)?\??(.+)?/;function rt(t){var e=t.match(et);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function nt(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}function at(t){if(!t)return null;var e,r=t.split(".");if(!r||3!==r.length)return null;try{return JSON.parse((e=r[1],decodeURIComponent(self.atob(e).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join(""))))}catch(t){return null}}var it=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};it.prototype.getStorageKey=function(t){var e,r=at(z.ACCESS_TOKEN),n="";return r&&r.u?(e=r.u,n=self.btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(Number("0x"+e))})))):n=z.ACCESS_TOKEN||"",t?"mapbox.eventData."+t+":"+n:"mapbox.eventData:"+n},it.prototype.fetchEventData=function(){var t=L("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{var n=self.localStorage.getItem(e);n&&(this.eventData=JSON.parse(n));var a=self.localStorage.getItem(r);a&&(this.anonId=a)}catch(t){w("Unable to read from LocalStorage")}},it.prototype.saveEventData=function(){var t=L("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{self.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&self.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){w("Unable to write to LocalStorage")}},it.prototype.processRequests=function(){},it.prototype.postEvent=function(t,e,r){var n=this;if(z.EVENTS_URL){var a=rt(z.EVENTS_URL);a.params.push("access_token="+(z.ACCESS_TOKEN||""));var i={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.1.1",skuId:Y,userId:this.anonId},o=e?h(i,e):i,s={url:nt(a),headers:{"Content-Type":"text/plain"},body:JSON.stringify([o])};this.pendingRequest=Tt(s,(function(t){n.pendingRequest=null,r(t),n.saveEventData(),n.processRequests()}))}},it.prototype.queueRequest=function(t){this.queue.push(t),this.processRequests()};var ot,st=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postMapLoadEvent=function(t,e,r){this.skuToken=r,z.EVENTS_URL&&z.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return U(t)||W(t)}))&&this.queueRequest({id:e,timestamp:Date.now()})},e.prototype.processRequests=function(){var t=this;if(!this.pendingRequest&&0!==this.queue.length){var e=this.queue.shift(),r=e.id,n=e.timestamp;r&&this.success[r]||(this.anonId||this.fetchEventData(),m(this.anonId)||(this.anonId=p()),this.postEvent(n,{skuToken:this.skuToken},(function(e){e||r&&(t.success[r]=!0)})))}},e}(it),lt=new(function(t){function e(){t.call(this,"appUserTurnstile")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postTurnstileEvent=function(t){z.EVENTS_URL&&z.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return U(t)||W(t)}))&&this.queueRequest(Date.now())},e.prototype.processRequests=function(){var t=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var e=at(z.ACCESS_TOKEN),r=e?e.u:z.ACCESS_TOKEN,n=r!==this.eventData.tokenU;m(this.anonId)||(this.anonId=p(),n=!0);var a=this.queue.shift();if(this.eventData.lastSuccess){var i=new Date(this.eventData.lastSuccess),o=new Date(a),s=(a-this.eventData.lastSuccess)/864e5;n=n||s>=1||s<-1||i.getDate()!==o.getDate()}else n=!0;if(!n)return this.processRequests();this.postEvent(a,{"enabled.telemetry":!1},(function(e){e||(t.eventData.lastSuccess=a,t.eventData.tokenU=r)}))}},e}(it)),ut=lt.postTurnstileEvent.bind(lt),ct=new st,ht=ct.postMapLoadEvent.bind(ct),dt="mapbox-tiles",ft=500,pt=50;function mt(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var gt=1/0,yt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(yt);var vt=function(t){function e(e,r,n){401===r&&W(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=n,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error);function _t(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}var xt=_t()?function(){return self.worker&&self.worker.referrer}:function(){var t=self.location.origin;if(t&&"null"!==t&&"file://"!==t)return t+self.location.pathname};var bt,wt,Mt=function(t,e){if(!/^file:/.test(t.url)){if(self.fetch&&self.Request&&self.AbortController&&self.Request.prototype.hasOwnProperty("signal"))return function(t,e){var r,n=new self.AbortController,a=new self.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:xt(),signal:n.signal}),i=!1,o=!1,s=(r=a.url).indexOf("sku=")>0&&W(r);"json"===t.type&&a.headers.set("Accept","application/json");var l=function(r,n,i){if(!o){if(r&&"SecurityError"!==r.message&&w(r),n&&i)return u(n);var l=Date.now();self.fetch(a).then((function(r){if(r.ok){var n=s?r.clone():null;return u(r,n,l)}return e(new vt(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},u=function(r,n,s){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){o||(n&&s&&function(t,e,r){if(self.caches){var n={status:e.status,statusText:e.statusText,headers:new self.Headers};e.headers.forEach((function(t,e){return n.headers.set(e,t)}));var a=T(e.headers.get("Cache-Control")||"");a["no-store"]||(a["max-age"]&&n.headers.set("Expires",new Date(r+1e3*a["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<42e4||function(t,e){if(void 0===ot)try{new Response(new ReadableStream),ot=!0}catch(t){ot=!1}ot?e(t.body):t.blob().then(e)}(e,(function(e){var r=new self.Response(e,n);self.caches.open(dt).then((function(e){return e.put(mt(t.url),r)}))})))}}(a,n,s),i=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(t){return e(new Error(t.message))}))};return s?function(t,e){if(!self.caches)return e(null);var r=mt(t.url);self.caches.open(dt).catch(e).then((function(t){t.match(r).catch(e).then((function(n){var a=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")),r=T(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(n);t.delete(r),a&&t.put(r,n.clone()),e(null,n,a)}))}))}(a,l):l(null,null),{cancel:function(){o=!0,i||n.abort()}}}(t,e);if(_t()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e)}return function(t,e){var r=new self.XMLHttpRequest;for(var n in r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(n,t.headers[n]);return"json"===t.type&&r.setRequestHeader("Accept","application/json"),r.withCredentials="include"===t.credentials,r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===t.type)try{n=JSON.parse(r.response)}catch(t){return e(t)}e(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else e(new vt(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},kt=function(t,e){return Mt(h(t,{type:"arrayBuffer"}),e)},Tt=function(t,e){return Mt(h(t,{method:"POST"}),e)};bt=[],wt=0;var Lt=function(t,e){if(wt>=z.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return bt.push(r),r}wt++;var n=!1,a=function(){if(!n)for(n=!0,wt--;bt.length&&wt<z.MAX_PARALLEL_IMAGE_REQUESTS;){var t=bt.shift(),e=t.requestParameters,r=t.callback;t.cancelled||(t.cancel=Lt(e,r).cancel)}},i=kt(t,(function(t,r,n,i){if(a(),t)e(t);else if(r){var o=new self.Image,s=self.URL||self.webkitURL;o.onload=function(){e(null,o),s.revokeObjectURL(o.src)},o.onerror=function(){return e(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var l=new self.Blob([new Uint8Array(r)],{type:"image/png"});o.cacheControl=n,o.expires=i,o.src=r.byteLength?s.createObjectURL(l):"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII="}}));return{cancel:function(){i.cancel(),a()}}};function At(t,e,r){r[t]&&-1!==r[t].indexOf(e)||(r[t]=r[t]||[],r[t].push(e))}function St(t,e,r){if(r&&r[t]){var n=r[t].indexOf(e);-1!==n&&r[t].splice(n,1)}}var Et=function(t,e){void 0===e&&(e={}),h(this,e),this.type=t},Ct=function(t){function e(e,r){void 0===r&&(r={}),t.call(this,"error",h({error:e},r))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Et),Dt=function(){};Dt.prototype.on=function(t,e){return this._listeners=this._listeners||{},At(t,e,this._listeners),this},Dt.prototype.off=function(t,e){return St(t,e,this._listeners),St(t,e,this._oneTimeListeners),this},Dt.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},At(t,e,this._oneTimeListeners),this},Dt.prototype.fire=function(t,e){"string"==typeof t&&(t=new Et(t,e||{}));var r=t.type;if(this.listens(r)){t.target=this;for(var n=0,a=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];n<a.length;n+=1)a[n].call(this,t);for(var i=0,o=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];i<o.length;i+=1){var s=o[i];St(r,s,this._oneTimeListeners),s.call(this,t)}var l=this._eventedParent;l&&(h(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),l.fire(t))}else t instanceof Ct&&console.error(t.error);return this},Dt.prototype.listens=function(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},Dt.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Pt={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"string",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:[{"!":"text-offset"}],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:[{"!":"text-anchor"},{"!":"text-offset"},{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",requires:["text-field"],values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:22,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"string",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"string",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"string",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"string",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}}},Ot=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function zt(t){var e=t.key,r=t.value;return r?[new Ot(e,r,"constants have been deprecated as of v8")]:[]}function It(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,a=e;n<a.length;n+=1){var i=a[n];for(var o in i)t[o]=i[o]}return t}function Rt(t){return t instanceof Number||t instanceof String||t instanceof Boolean}function Ft(t){return Rt(t)?t.valueOf():t}function Nt(t){if(Array.isArray(t))return t.map(Nt);if(t instanceof Object&&!Rt(t)){var e={};for(var r in t)e[r]=Nt(t[r]);return e}return Ft(t)}var Yt=function(t){function e(e,r){t.call(this,r),this.message=r,this.key=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),jt=function(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var r=0,n=e;r<n.length;r+=1){var a=n[r],i=a[0],o=a[1];this.bindings[i]=o}};jt.prototype.concat=function(t){return new jt(this,t)},jt.prototype.get=function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")},jt.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var Bt={kind:"null"},Ht={kind:"number"},Ut={kind:"string"},Vt={kind:"boolean"},Wt={kind:"color"},Gt={kind:"object"},qt={kind:"value"},Zt={kind:"collator"},Xt={kind:"formatted"};function Jt(t,e){return{kind:"array",itemType:t,N:e}}function Kt(t){if("array"===t.kind){var e=Kt(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var $t=[Bt,Ht,Ut,Vt,Wt,Xt,Gt,Jt(qt)];function Qt(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Qt(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=$t;r<n.length;r+=1)if(!Qt(n[r],e))return null}return"Expected "+Kt(t)+" but found "+Kt(e)+" instead."}var te=e((function(t,e){var r={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function n(t){return(t=Math.round(t))<0?0:t>255?255:t}function a(t){return t<0?0:t>1?1:t}function i(t){return"%"===t[t.length-1]?n(parseFloat(t)/100*255):n(parseInt(t))}function o(t){return"%"===t[t.length-1]?a(parseFloat(t)/100):a(parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{e.parseCSSColor=function(t){var e,a=t.replace(/ /g,"").toLowerCase();if(a in r)return r[a].slice();if("#"===a[0])return 4===a.length?(e=parseInt(a.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===a.length&&(e=parseInt(a.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=a.indexOf("("),u=a.indexOf(")");if(-1!==l&&u+1===a.length){var c=a.substr(0,l),h=a.substr(l+1,u-(l+1)).split(","),d=1;switch(c){case"rgba":if(4!==h.length)return null;d=o(h.pop());case"rgb":return 3!==h.length?null:[i(h[0]),i(h[1]),i(h[2]),d];case"hsla":if(4!==h.length)return null;d=o(h.pop());case"hsl":if(3!==h.length)return null;var f=(parseFloat(h[0])%360+360)%360/360,p=o(h[1]),m=o(h[2]),g=m<=.5?m*(p+1):m+p-m*p,y=2*m-g;return[n(255*s(y,g,f+1/3)),n(255*s(y,g,f)),n(255*s(y,g,f-1/3)),d];default:return null}}return null}}catch(t){}})).parseCSSColor,ee=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};ee.parse=function(t){if(t){if(t instanceof ee)return t;if("string"==typeof t){var e=te(t);if(e)return new ee(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},ee.prototype.toString=function(){var t=this.toArray(),e=t[0],r=t[1],n=t[2],a=t[3];return"rgba("+Math.round(e)+","+Math.round(r)+","+Math.round(n)+","+a+")"},ee.prototype.toArray=function(){var t=this.r,e=this.g,r=this.b,n=this.a;return 0===n?[0,0,0,0]:[255*t/n,255*e/n,255*r/n,n]},ee.black=new ee(0,0,0,1),ee.white=new ee(1,1,1,1),ee.transparent=new ee(0,0,0,0),ee.red=new ee(1,0,0,1);var re=function(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};re.prototype.compare=function(t,e){return this.collator.compare(t,e)},re.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var ne=function(t,e,r){this.text=t,this.scale=e,this.fontStack=r},ae=function(t){this.sections=t};function ie(t,e,r,n){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function oe(t){if(null===t)return Bt;if("string"==typeof t)return Ut;if("boolean"==typeof t)return Vt;if("number"==typeof t)return Ht;if(t instanceof ee)return Wt;if(t instanceof re)return Zt;if(t instanceof ae)return Xt;if(Array.isArray(t)){for(var e,r=t.length,n=0,a=t;n<a.length;n+=1){var i=oe(a[n]);if(e){if(e===i)continue;e=qt;break}e=i}return Jt(e||qt,r)}return Gt}function se(t){var e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof ee||t instanceof ae?t.toString():JSON.stringify(t)}ae.fromString=function(t){return new ae([new ne(t,null,null)])},ae.prototype.toString=function(){return this.sections.map((function(t){return t.text})).join("")},ae.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t.push(n.text);var a={};n.fontStack&&(a["text-font"]=["literal",n.fontStack.split(",")]),n.scale&&(a["font-scale"]=n.scale),t.push(a)}return t};var le=function(t,e){this.type=t,this.value=e};le.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!function t(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof ee)return!0;if(e instanceof re)return!0;if(e instanceof ae)return!0;if(Array.isArray(e)){for(var r=0,n=e;r<n.length;r+=1)if(!t(n[r]))return!1;return!0}if("object"==typeof e){for(var a in e)if(!t(e[a]))return!1;return!0}return!1}(t[1]))return e.error("invalid value");var r=t[1],n=oe(r),a=e.expectedType;return"array"!==n.kind||0!==n.N||!a||"array"!==a.kind||"number"==typeof a.N&&0!==a.N||(n=a),new le(n,r)},le.prototype.evaluate=function(){return this.value},le.prototype.eachChild=function(){},le.prototype.possibleOutputs=function(){return[this.value]},le.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof ee?["rgba"].concat(this.value.toArray()):this.value instanceof ae?this.value.serialize():this.value};var ue=function(t){this.name="ExpressionEvaluationError",this.message=t};ue.prototype.toJSON=function(){return this.message};var ce={string:Ut,number:Ht,boolean:Vt,object:Gt},he=function(t,e){this.type=t,this.args=e};he.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r,n=1,a=t[0];if("array"===a){var i,o;if(t.length>2){var s=t[1];if("string"!=typeof s||!(s in ce)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);i=ce[s],n++}else i=qt;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);o=t[2],n++}r=Jt(i,o)}else r=ce[a];for(var l=[];n<t.length;n++){var u=e.parse(t[n],n,qt);if(!u)return null;l.push(u)}return new he(r,l)},he.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var r=this.args[e].evaluate(t);if(!Qt(this.type,oe(r)))return r;if(e===this.args.length-1)throw new ue("Expected value to be of type "+Kt(this.type)+", but found "+Kt(oe(r))+" instead.")}return null},he.prototype.eachChild=function(t){this.args.forEach(t)},he.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.args.map((function(t){return t.possibleOutputs()})))},he.prototype.serialize=function(){var t=this.type,e=[t.kind];if("array"===t.kind){var r=t.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){e.push(r.kind);var n=t.N;("number"==typeof n||this.args.length>1)&&e.push(n)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var de=function(t){this.type=Xt,this.sections=t};de.parse=function(t,e){if(t.length<3)return e.error("Expected at least two arguments.");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");for(var r=[],n=1;n<t.length-1;n+=2){var a=e.parse(t[n],1,qt);if(!a)return null;var i=a.type.kind;if("string"!==i&&"value"!==i&&"null"!==i)return e.error("Formatted text type must be 'string', 'value', or 'null'.");var o=t[n+1];if("object"!=typeof o||Array.isArray(o))return e.error("Format options argument must be an object.");var s=null;if(o["font-scale"]&&!(s=e.parse(o["font-scale"],1,Ht)))return null;var l=null;if(o["text-font"]&&!(l=e.parse(o["text-font"],1,Jt(Ut))))return null;r.push({text:a,scale:s,font:l})}return new de(r)},de.prototype.evaluate=function(t){return new ae(this.sections.map((function(e){return new ne(se(e.text.evaluate(t)),e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null)})))},de.prototype.eachChild=function(t){for(var e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t(n.text),n.scale&&t(n.scale),n.font&&t(n.font)}},de.prototype.possibleOutputs=function(){return[void 0]},de.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t.push(n.text.serialize());var a={};n.scale&&(a["font-scale"]=n.scale.serialize()),n.font&&(a["text-font"]=n.font.serialize()),t.push(a)}return t};var fe={"to-boolean":Vt,"to-color":Wt,"to-number":Ht,"to-string":Ut},pe=function(t,e){this.type=t,this.args=e};pe.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var n=fe[r],a=[],i=1;i<t.length;i++){var o=e.parse(t[i],i,qt);if(!o)return null;a.push(o)}return new pe(n,a)},pe.prototype.evaluate=function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){for(var e,r,n=0,a=this.args;n<a.length;n+=1){if(r=null,(e=a[n].evaluate(t))instanceof ee)return e;if("string"==typeof e){var i=t.parseColor(e);if(i)return i}else if(Array.isArray(e)&&!(r=e.length<3||e.length>4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":ie(e[0],e[1],e[2],e[3])))return new ee(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ue(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var o=null,s=0,l=this.args;s<l.length;s+=1){if(null===(o=l[s].evaluate(t)))return 0;var u=Number(o);if(!isNaN(u))return u}throw new ue("Could not convert "+JSON.stringify(o)+" to number.")}return"formatted"===this.type.kind?ae.fromString(se(this.args[0].evaluate(t))):se(this.args[0].evaluate(t))},pe.prototype.eachChild=function(t){this.args.forEach(t)},pe.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.args.map((function(t){return t.possibleOutputs()})))},pe.prototype.serialize=function(){if("formatted"===this.type.kind)return new de([{text:this.args[0],scale:null,font:null}]).serialize();var t=["to-"+this.type.kind];return this.eachChild((function(e){t.push(e.serialize())})),t};var me=["Unknown","Point","LineString","Polygon"],ge=function(){this.globals=null,this.feature=null,this.featureState=null,this._parseColorCache={}};ge.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},ge.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?me[this.feature.type]:this.feature.type:null},ge.prototype.properties=function(){return this.feature&&this.feature.properties||{}},ge.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=ee.parse(t)),e};var ye=function(t,e,r,n){this.name=t,this.type=e,this._evaluate=r,this.args=n};ye.prototype.evaluate=function(t){return this._evaluate(t,this.args)},ye.prototype.eachChild=function(t){this.args.forEach(t)},ye.prototype.possibleOutputs=function(){return[void 0]},ye.prototype.serialize=function(){return[this.name].concat(this.args.map((function(t){return t.serialize()})))},ye.parse=function(t,e){var r,n=t[0],a=ye.definitions[n];if(!a)return e.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0);for(var i=Array.isArray(a)?a[0]:a.type,o=Array.isArray(a)?[[a[1],a[2]]]:a.overloads,s=o.filter((function(e){var r=e[0];return!Array.isArray(r)||r.length===t.length-1})),l=null,u=0,c=s;u<c.length;u+=1){var h=c[u],d=h[0],f=h[1];l=new Me(e.registry,e.path,null,e.scope);for(var p=[],m=!1,g=1;g<t.length;g++){var y=t[g],v=Array.isArray(d)?d[g-1]:d.type,_=l.parse(y,1+p.length,v);if(!_){m=!0;break}p.push(_)}if(!m)if(Array.isArray(d)&&d.length!==p.length)l.error("Expected "+d.length+" arguments, but found "+p.length+" instead.");else{for(var x=0;x<p.length;x++){var b=Array.isArray(d)?d[x]:d.type,w=p[x];l.concat(x+1).checkSubtype(b,w.type)}if(0===l.errors.length)return new ye(n,i,f,p)}}if(1===s.length)(r=e.errors).push.apply(r,l.errors);else{for(var M=(s.length?s:o).map((function(t){var e;return e=t[0],Array.isArray(e)?"("+e.map(Kt).join(", ")+")":"("+Kt(e.type)+"...)"})).join(" | "),k=[],T=1;T<t.length;T++){var L=e.parse(t[T],1+k.length);if(!L)return null;k.push(Kt(L.type))}e.error("Expected arguments of type "+M+", but found ("+k.join(", ")+") instead.")}return null},ye.register=function(t,e){for(var r in ye.definitions=e,e)t[r]=ye};var ve=function(t,e,r){this.type=Zt,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e};function _e(t){if(t instanceof ye){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}var e=!0;return t.eachChild((function(t){e&&!_e(t)&&(e=!1)})),e}function xe(t){if(t instanceof ye&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild((function(t){e&&!xe(t)&&(e=!1)})),e}function be(t,e){if(t instanceof ye&&e.indexOf(t.name)>=0)return!1;var r=!0;return t.eachChild((function(t){r&&!be(t,e)&&(r=!1)})),r}ve.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var r=t[1];if("object"!=typeof r||Array.isArray(r))return e.error("Collator options argument must be an object.");var n=e.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,Vt);if(!n)return null;var a=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,Vt);if(!a)return null;var i=null;return r.locale&&!(i=e.parse(r.locale,1,Ut))?null:new ve(n,a,i)},ve.prototype.evaluate=function(t){return new re(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},ve.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},ve.prototype.possibleOutputs=function(){return[void 0]},ve.prototype.serialize=function(){var t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]};var we=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};we.parse=function(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var r=t[1];return e.scope.has(r)?new we(r,e.scope.get(r)):e.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},we.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},we.prototype.eachChild=function(){},we.prototype.possibleOutputs=function(){return[void 0]},we.prototype.serialize=function(){return["var",this.name]};var Me=function(t,e,r,n,a){void 0===e&&(e=[]),void 0===n&&(n=new jt),void 0===a&&(a=[]),this.registry=t,this.path=e,this.key=e.map((function(t){return"["+t+"]"})).join(""),this.scope=n,this.errors=a,this.expectedType=r};function ke(t,e){for(var r,n,a=t.length-1,i=0,o=a,s=0;i<=o;)if(r=t[s=Math.floor((i+o)/2)],n=t[s+1],r<=e){if(s===a||e<n)return s;i=s+1}else{if(!(r>e))throw new ue("Input is not a number.");o=s-1}return 0}Me.prototype.parse=function(t,e,r,n,a){return void 0===a&&(a={}),e?this.concat(e,r,n)._parse(t,a):this._parse(t,a)},Me.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new he(e,[t]):"coerce"===r?new pe(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=t[0];if("string"!=typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var a=this.registry[n];if(a){var i=a.parse(t,this);if(!i)return null;if(this.expectedType){var o=this.expectedType,s=i.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==s.kind)if("color"!==o.kind&&"formatted"!==o.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(o,s))return null}else i=r(i,o,e.typeAnnotation||"coerce");else i=r(i,o,e.typeAnnotation||"assert")}if(!(i instanceof le)&&function t(e){if(e instanceof we)return t(e.boundExpression);if(e instanceof ye&&"error"===e.name)return!1;if(e instanceof ve)return!1;var r=e instanceof pe||e instanceof he,n=!0;return e.eachChild((function(e){n=r?n&&t(e):n&&e instanceof le})),!!n&&_e(e)&&be(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(i)){var l=new ge;try{i=new le(i.type,i.evaluate(l))}catch(t){return this.error(t.message),null}}return i}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},Me.prototype.concat=function(t,e,r){var n="number"==typeof t?this.path.concat(t):this.path,a=r?this.scope.concat(r):this.scope;return new Me(this.registry,n,e||null,a,this.errors)},Me.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var n=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new Yt(n,t))},Me.prototype.checkSubtype=function(t,e){var r=Qt(t,e);return r&&this.error(r),r};var Te=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,a=r;n<a.length;n+=1){var i=a[n],o=i[0],s=i[1];this.labels.push(o),this.outputs.push(s)}};function Le(t,e,r){return t*(1-r)+e*r}Te.parse=function(t,e){if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");var r=e.parse(t[1],1,Ht);if(!r)return null;var n=[],a=null;e.expectedType&&"value"!==e.expectedType.kind&&(a=e.expectedType);for(var i=1;i<t.length;i+=2){var o=1===i?-1/0:t[i],s=t[i+1],l=i,u=i+1;if("number"!=typeof o)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',l);if(n.length&&n[n.length-1][0]>=o)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var c=e.parse(s,u,a);if(!c)return null;a=a||c.type,n.push([o,c])}return new Te(a,r,n)},Te.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var a=e.length;return n>=e[a-1]?r[a-1].evaluate(t):r[ke(e,n)].evaluate(t)},Te.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},Te.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.outputs.map((function(t){return t.possibleOutputs()})))},Te.prototype.serialize=function(){for(var t=["step",this.input.serialize()],e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var Ae=Object.freeze({number:Le,color:function(t,e,r){return new ee(Le(t.r,e.r,r),Le(t.g,e.g,r),Le(t.b,e.b,r),Le(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return Le(t,e[n],r)}))}}),Se=.95047,Ee=1.08883,Ce=4/29,De=6/29,Pe=3*De*De,Oe=Math.PI/180,ze=180/Math.PI;function Ie(t){return t>.008856451679035631?Math.pow(t,1/3):t/Pe+Ce}function Re(t){return t>De?t*t*t:Pe*(t-Ce)}function Fe(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Ne(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ye(t){var e=Ne(t.r),r=Ne(t.g),n=Ne(t.b),a=Ie((.4124564*e+.3575761*r+.1804375*n)/Se),i=Ie((.2126729*e+.7151522*r+.072175*n)/1);return{l:116*i-16,a:500*(a-i),b:200*(i-Ie((.0193339*e+.119192*r+.9503041*n)/Ee)),alpha:t.a}}function je(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*Re(e),r=Se*Re(r),n=Ee*Re(n),new ee(Fe(3.2404542*r-1.5371385*e-.4985314*n),Fe(-.969266*r+1.8760108*e+.041556*n),Fe(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}var Be={forward:Ye,reverse:je,interpolate:function(t,e,r){return{l:Le(t.l,e.l,r),a:Le(t.a,e.a,r),b:Le(t.b,e.b,r),alpha:Le(t.alpha,e.alpha,r)}}},He={forward:function(t){var e=Ye(t),r=e.l,n=e.a,a=e.b,i=Math.atan2(a,n)*ze;return{h:i<0?i+360:i,c:Math.sqrt(n*n+a*a),l:r,alpha:t.a}},reverse:function(t){var e=t.h*Oe,r=t.c;return je({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:function(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}(t.h,e.h,r),c:Le(t.c,e.c,r),l:Le(t.l,e.l,r),alpha:Le(t.alpha,e.alpha,r)}}},Ue=Object.freeze({lab:Be,hcl:He}),Ve=function(t,e,r,n,a){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var i=0,o=a;i<o.length;i+=1){var s=o[i],l=s[0],u=s[1];this.labels.push(l),this.outputs.push(u)}};function We(t,e,r,n){var a=n-r,i=t-r;return 0===a?0:1===e?i/a:(Math.pow(e,i)-1)/(Math.pow(e,a)-1)}Ve.interpolationFactor=function(t,e,n,a){var i=0;if("exponential"===t.name)i=We(e,t.base,n,a);else if("linear"===t.name)i=We(e,1,n,a);else if("cubic-bezier"===t.name){var o=t.controlPoints;i=new r(o[0],o[1],o[2],o[3]).solve(We(e,1,n,a))}return i},Ve.parse=function(t,e){var r=t[0],n=t[1],a=t[2],i=t.slice(3);if(!Array.isArray(n)||0===n.length)return e.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){var o=n[1];if("number"!=typeof o)return e.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:o}}else{if("cubic-bezier"!==n[0])return e.error("Unknown interpolation type "+String(n[0]),1,0);var s=n.slice(1);if(4!==s.length||s.some((function(t){return"number"!=typeof t||t<0||t>1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(a=e.parse(a,2,Ht)))return null;var l=[],u=null;"interpolate-hcl"===r||"interpolate-lab"===r?u=Wt:e.expectedType&&"value"!==e.expectedType.kind&&(u=e.expectedType);for(var c=0;c<i.length;c+=2){var h=i[c],d=i[c+1],f=c+3,p=c+4;if("number"!=typeof h)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',f);if(l.length&&l[l.length-1][0]>=h)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var m=e.parse(d,p,u);if(!m)return null;u=u||m.type,l.push([h,m])}return"number"===u.kind||"color"===u.kind||"array"===u.kind&&"number"===u.itemType.kind&&"number"==typeof u.N?new Ve(u,r,n,a,l):e.error("Type "+Kt(u)+" is not interpolatable.")},Ve.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var a=e.length;if(n>=e[a-1])return r[a-1].evaluate(t);var i=ke(e,n),o=e[i],s=e[i+1],l=Ve.interpolationFactor(this.interpolation,n,o,s),u=r[i].evaluate(t),c=r[i+1].evaluate(t);return"interpolate"===this.operator?Ae[this.type.kind.toLowerCase()](u,c,l):"interpolate-hcl"===this.operator?He.reverse(He.interpolate(He.forward(u),He.forward(c),l)):Be.reverse(Be.interpolate(Be.forward(u),Be.forward(c),l))},Ve.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},Ve.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.outputs.map((function(t){return t.possibleOutputs()})))},Ve.prototype.serialize=function(){var t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var e=[this.operator,t,this.input.serialize()],r=0;r<this.labels.length;r++)e.push(this.labels[r],this.outputs[r].serialize());return e};var Ge=function(t,e){this.type=t,this.args=e};Ge.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var r=null,n=e.expectedType;n&&"value"!==n.kind&&(r=n);for(var a=[],i=0,o=t.slice(1);i<o.length;i+=1){var s=o[i],l=e.parse(s,1+a.length,r,void 0,{typeAnnotation:"omit"});if(!l)return null;r=r||l.type,a.push(l)}var u=n&&a.some((function(t){return Qt(n,t.type)}));return new Ge(u?qt:r,a)},Ge.prototype.evaluate=function(t){for(var e=null,r=0,n=this.args;r<n.length&&null===(e=n[r].evaluate(t));r+=1);return e},Ge.prototype.eachChild=function(t){this.args.forEach(t)},Ge.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.args.map((function(t){return t.possibleOutputs()})))},Ge.prototype.serialize=function(){var t=["coalesce"];return this.eachChild((function(e){t.push(e.serialize())})),t};var qe=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};qe.prototype.evaluate=function(t){return this.result.evaluate(t)},qe.prototype.eachChild=function(t){for(var e=0,r=this.bindings;e<r.length;e+=1)t(r[e][1]);t(this.result)},qe.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var r=[],n=1;n<t.length-1;n+=2){var a=t[n];if("string"!=typeof a)return e.error("Expected string, but found "+typeof a+" instead.",n);if(/[^a-zA-Z0-9_]/.test(a))return e.error("Variable names must contain only alphanumeric characters or '_'.",n);var i=e.parse(t[n+1],n+1);if(!i)return null;r.push([a,i])}var o=e.parse(t[t.length-1],t.length-1,e.expectedType,r);return o?new qe(r,o):null},qe.prototype.possibleOutputs=function(){return this.result.possibleOutputs()},qe.prototype.serialize=function(){for(var t=["let"],e=0,r=this.bindings;e<r.length;e+=1){var n=r[e],a=n[0],i=n[1];t.push(a,i.serialize())}return t.push(this.result.serialize()),t};var Ze=function(t,e,r){this.type=t,this.index=e,this.input=r};Ze.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Ht),n=e.parse(t[2],2,Jt(e.expectedType||qt));if(!r||!n)return null;var a=n.type;return new Ze(a.itemType,r,n)},Ze.prototype.evaluate=function(t){var e=this.index.evaluate(t),r=this.input.evaluate(t);if(e<0)throw new ue("Array index out of bounds: "+e+" < 0.");if(e>=r.length)throw new ue("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new ue("Array index must be an integer, but found "+e+" instead.");return r[e]},Ze.prototype.eachChild=function(t){t(this.index),t(this.input)},Ze.prototype.possibleOutputs=function(){return[void 0]},Ze.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Xe=function(t,e,r,n,a,i){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=a,this.otherwise=i};Xe.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var a={},i=[],o=2;o<t.length-1;o+=2){var s=t[o],l=t[o+1];Array.isArray(s)||(s=[s]);var u=e.concat(o);if(0===s.length)return u.error("Expected at least one branch label.");for(var c=0,h=s;c<h.length;c+=1){var d=h[c];if("number"!=typeof d&&"string"!=typeof d)return u.error("Branch labels must be numbers or strings.");if("number"==typeof d&&Math.abs(d)>Number.MAX_SAFE_INTEGER)return u.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof d&&Math.floor(d)!==d)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,oe(d)))return null}else r=oe(d);if(void 0!==a[String(d)])return u.error("Branch labels must be unique.");a[String(d)]=i.length}var f=e.parse(l,o,n);if(!f)return null;n=n||f.type,i.push(f)}var p=e.parse(t[1],1,qt);if(!p)return null;var m=e.parse(t[t.length-1],t.length-1,n);return m?"value"!==p.type.kind&&e.concat(1).checkSubtype(r,p.type)?null:new Xe(r,n,p,a,i,m):null},Xe.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(oe(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},Xe.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},Xe.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.outputs.map((function(t){return t.possibleOutputs()}))).concat(this.otherwise.possibleOutputs())},Xe.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},a=0,i=Object.keys(this.cases).sort();a<i.length;a+=1){var o=i[a];void 0===(h=n[this.cases[o]])?(n[this.cases[o]]=r.length,r.push([this.cases[o],[o]])):r[h][1].push(o)}for(var s=function(e){return"number"===t.inputType.kind?Number(e):e},l=0,u=r;l<u.length;l+=1){var c=u[l],h=c[0],d=c[1];1===d.length?e.push(s(d[0])):e.push(d.map(s)),e.push(this.outputs[outputIndex$1].serialize())}return e.push(this.otherwise.serialize()),e};var Je=function(t,e,r){this.type=t,this.branches=e,this.otherwise=r};function Ke(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function $e(t,e,r,n){return 0===n.compare(e,r)}function Qe(t,e,r){var n="=="!==t&&"!="!==t;return function(){function a(t,e,r){this.type=Vt,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}return a.parse=function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var r=t[0],i=e.parse(t[1],1,qt);if(!i)return null;if(!Ke(r,i.type))return e.concat(1).error('"'+r+"\" comparisons are not supported for type '"+Kt(i.type)+"'.");var o=e.parse(t[2],2,qt);if(!o)return null;if(!Ke(r,o.type))return e.concat(2).error('"'+r+"\" comparisons are not supported for type '"+Kt(o.type)+"'.");if(i.type.kind!==o.type.kind&&"value"!==i.type.kind&&"value"!==o.type.kind)return e.error("Cannot compare types '"+Kt(i.type)+"' and '"+Kt(o.type)+"'.");n&&("value"===i.type.kind&&"value"!==o.type.kind?i=new he(o.type,[i]):"value"!==i.type.kind&&"value"===o.type.kind&&(o=new he(i.type,[o])));var s=null;if(4===t.length){if("string"!==i.type.kind&&"string"!==o.type.kind&&"value"!==i.type.kind&&"value"!==o.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(s=e.parse(t[3],3,Zt)))return null}return new a(i,o,s)},a.prototype.evaluate=function(a){var i=this.lhs.evaluate(a),o=this.rhs.evaluate(a);if(n&&this.hasUntypedArgument){var s=oe(i),l=oe(o);if(s.kind!==l.kind||"string"!==s.kind&&"number"!==s.kind)throw new ue('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+s.kind+", "+l.kind+") instead.")}if(this.collator&&!n&&this.hasUntypedArgument){var u=oe(i),c=oe(o);if("string"!==u.kind||"string"!==c.kind)return e(a,i,o)}return this.collator?r(a,i,o,this.collator.evaluate(a)):e(a,i,o)},a.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)},a.prototype.possibleOutputs=function(){return[!0,!1]},a.prototype.serialize=function(){var e=[t];return this.eachChild((function(t){e.push(t.serialize())})),e},a}()}Je.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found only "+(t.length-1)+".");if(t.length%2!=0)return e.error("Expected an odd number of arguments.");var r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(var n=[],a=1;a<t.length-1;a+=2){var i=e.parse(t[a],a,Vt);if(!i)return null;var o=e.parse(t[a+1],a+1,r);if(!o)return null;n.push([i,o]),r=r||o.type}var s=e.parse(t[t.length-1],t.length-1,r);return s?new Je(r,n,s):null},Je.prototype.evaluate=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var n=r[e],a=n[0],i=n[1];if(a.evaluate(t))return i.evaluate(t)}return this.otherwise.evaluate(t)},Je.prototype.eachChild=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var n=r[e],a=n[0],i=n[1];t(a),t(i)}t(this.otherwise)},Je.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.branches.map((function(t){return t[0],t[1].possibleOutputs()}))).concat(this.otherwise.possibleOutputs())},Je.prototype.serialize=function(){var t=["case"];return this.eachChild((function(e){t.push(e.serialize())})),t};var tr=Qe("==",(function(t,e,r){return e===r}),$e),er=Qe("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!$e(0,e,r,n)})),rr=Qe("<",(function(t,e,r){return e<r}),(function(t,e,r,n){return n.compare(e,r)<0})),nr=Qe(">",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),ar=Qe("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),ir=Qe(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),or=function(t,e,r,n,a){this.type=Ut,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=a};or.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Ht);if(!r)return null;var n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");var a=null;if(n.locale&&!(a=e.parse(n.locale,1,Ut)))return null;var i=null;if(n.currency&&!(i=e.parse(n.currency,1,Ut)))return null;var o=null;if(n["min-fraction-digits"]&&!(o=e.parse(n["min-fraction-digits"],1,Ht)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,Ht))?null:new or(r,a,i,o,s)},or.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},or.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},or.prototype.possibleOutputs=function(){return[void 0]},or.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var sr=function(t){this.type=Ht,this.input=t};sr.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+Kt(r.type)+" instead."):new sr(r):null},sr.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new ue("Expected value to be of type string or array, but found "+Kt(oe(e))+" instead.")},sr.prototype.eachChild=function(t){t(this.input)},sr.prototype.possibleOutputs=function(){return[void 0]},sr.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var lr={"==":tr,"!=":er,">":nr,"<":rr,">=":ir,"<=":ar,array:he,at:Ze,boolean:he,case:Je,coalesce:Ge,collator:ve,format:de,interpolate:Ve,"interpolate-hcl":Ve,"interpolate-lab":Ve,length:sr,let:qe,literal:le,match:Xe,number:he,"number-format":or,object:he,step:Te,string:he,"to-boolean":pe,"to-color":pe,"to-number":pe,"to-string":pe,var:we};function ur(t,e){var r=e[0],n=e[1],a=e[2],i=e[3];r=r.evaluate(t),n=n.evaluate(t),a=a.evaluate(t);var o=i?i.evaluate(t):1,s=ie(r,n,a,o);if(s)throw new ue(s);return new ee(r/255*o,n/255*o,a/255*o,o)}function cr(t,e){return t in e}function hr(t,e){var r=e[t];return void 0===r?null:r}function dr(t){return{type:t}}function fr(t){return{result:"success",value:t}}function pr(t){return{result:"error",value:t}}function mr(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function gr(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function yr(t){return!!t.expression&&t.expression.interpolated}function vr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function _r(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function xr(t){return t}function br(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function wr(t,e,r,n,a){return br(typeof r===a?n[r]:void 0,t.default,e.default)}function Mr(t,e,r){if("number"!==vr(r))return br(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];var a=ke(t.stops.map((function(t){return t[0]})),r);return t.stops[a][1]}function kr(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==vr(r))return br(t.default,e.default);var a=t.stops.length;if(1===a)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[a-1][0])return t.stops[a-1][1];var i=ke(t.stops.map((function(t){return t[0]})),r),o=function(t,e,r,n){var a=n-r,i=t-r;return 0===a?0:1===e?i/a:(Math.pow(e,i)-1)/(Math.pow(e,a)-1)}(r,n,t.stops[i][0],t.stops[i+1][0]),s=t.stops[i][1],l=t.stops[i+1][1],u=Ae[e.type]||xr;if(t.colorSpace&&"rgb"!==t.colorSpace){var c=Ue[t.colorSpace];u=function(t,e){return c.reverse(c.interpolate(c.forward(t),c.forward(e),o))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=l.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return u(r,n,o)}}:u(s,l,o)}function Tr(t,e,r){return"color"===e.type?r=ee.parse(r):"formatted"===e.type?r=ae.fromString(r.toString()):vr(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),br(r,t.default,e.default)}ye.register(lr,{error:[{kind:"error"},[Ut],function(t,e){var r=e[0];throw new ue(r.evaluate(t))}],typeof:[Ut,[qt],function(t,e){return Kt(oe(e[0].evaluate(t)))}],"to-rgba":[Jt(Ht,4),[Wt],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Wt,[Ht,Ht,Ht],ur],rgba:[Wt,[Ht,Ht,Ht,Ht],ur],has:{type:Vt,overloads:[[[Ut],function(t,e){return cr(e[0].evaluate(t),t.properties())}],[[Ut,Gt],function(t,e){var r=e[0],n=e[1];return cr(r.evaluate(t),n.evaluate(t))}]]},get:{type:qt,overloads:[[[Ut],function(t,e){return hr(e[0].evaluate(t),t.properties())}],[[Ut,Gt],function(t,e){var r=e[0],n=e[1];return hr(r.evaluate(t),n.evaluate(t))}]]},"feature-state":[qt,[Ut],function(t,e){return hr(e[0].evaluate(t),t.featureState||{})}],properties:[Gt,[],function(t){return t.properties()}],"geometry-type":[Ut,[],function(t){return t.geometryType()}],id:[qt,[],function(t){return t.id()}],zoom:[Ht,[],function(t){return t.globals.zoom}],"heatmap-density":[Ht,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Ht,[],function(t){return t.globals.lineProgress||0}],accumulated:[qt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Ht,dr(Ht),function(t,e){for(var r=0,n=0,a=e;n<a.length;n+=1)r+=a[n].evaluate(t);return r}],"*":[Ht,dr(Ht),function(t,e){for(var r=1,n=0,a=e;n<a.length;n+=1)r*=a[n].evaluate(t);return r}],"-":{type:Ht,overloads:[[[Ht,Ht],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)-n.evaluate(t)}],[[Ht],function(t,e){return-e[0].evaluate(t)}]]},"/":[Ht,[Ht,Ht],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)/n.evaluate(t)}],"%":[Ht,[Ht,Ht],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)%n.evaluate(t)}],ln2:[Ht,[],function(){return Math.LN2}],pi:[Ht,[],function(){return Math.PI}],e:[Ht,[],function(){return Math.E}],"^":[Ht,[Ht,Ht],function(t,e){var r=e[0],n=e[1];return Math.pow(r.evaluate(t),n.evaluate(t))}],sqrt:[Ht,[Ht],function(t,e){var r=e[0];return Math.sqrt(r.evaluate(t))}],log10:[Ht,[Ht],function(t,e){var r=e[0];return Math.log(r.evaluate(t))/Math.LN10}],ln:[Ht,[Ht],function(t,e){var r=e[0];return Math.log(r.evaluate(t))}],log2:[Ht,[Ht],function(t,e){var r=e[0];return Math.log(r.evaluate(t))/Math.LN2}],sin:[Ht,[Ht],function(t,e){var r=e[0];return Math.sin(r.evaluate(t))}],cos:[Ht,[Ht],function(t,e){var r=e[0];return Math.cos(r.evaluate(t))}],tan:[Ht,[Ht],function(t,e){var r=e[0];return Math.tan(r.evaluate(t))}],asin:[Ht,[Ht],function(t,e){var r=e[0];return Math.asin(r.evaluate(t))}],acos:[Ht,[Ht],function(t,e){var r=e[0];return Math.acos(r.evaluate(t))}],atan:[Ht,[Ht],function(t,e){var r=e[0];return Math.atan(r.evaluate(t))}],min:[Ht,dr(Ht),function(t,e){return Math.min.apply(Math,e.map((function(e){return e.evaluate(t)})))}],max:[Ht,dr(Ht),function(t,e){return Math.max.apply(Math,e.map((function(e){return e.evaluate(t)})))}],abs:[Ht,[Ht],function(t,e){var r=e[0];return Math.abs(r.evaluate(t))}],round:[Ht,[Ht],function(t,e){var r=e[0].evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[Ht,[Ht],function(t,e){var r=e[0];return Math.floor(r.evaluate(t))}],ceil:[Ht,[Ht],function(t,e){var r=e[0];return Math.ceil(r.evaluate(t))}],"filter-==":[Vt,[Ut,qt],function(t,e){var r=e[0],n=e[1];return t.properties()[r.value]===n.value}],"filter-id-==":[Vt,[qt],function(t,e){var r=e[0];return t.id()===r.value}],"filter-type-==":[Vt,[Ut],function(t,e){var r=e[0];return t.geometryType()===r.value}],"filter-<":[Vt,[Ut,qt],function(t,e){var r=e[0],n=e[1],a=t.properties()[r.value],i=n.value;return typeof a==typeof i&&a<i}],"filter-id-<":[Vt,[qt],function(t,e){var r=e[0],n=t.id(),a=r.value;return typeof n==typeof a&&n<a}],"filter->":[Vt,[Ut,qt],function(t,e){var r=e[0],n=e[1],a=t.properties()[r.value],i=n.value;return typeof a==typeof i&&a>i}],"filter-id->":[Vt,[qt],function(t,e){var r=e[0],n=t.id(),a=r.value;return typeof n==typeof a&&n>a}],"filter-<=":[Vt,[Ut,qt],function(t,e){var r=e[0],n=e[1],a=t.properties()[r.value],i=n.value;return typeof a==typeof i&&a<=i}],"filter-id-<=":[Vt,[qt],function(t,e){var r=e[0],n=t.id(),a=r.value;return typeof n==typeof a&&n<=a}],"filter->=":[Vt,[Ut,qt],function(t,e){var r=e[0],n=e[1],a=t.properties()[r.value],i=n.value;return typeof a==typeof i&&a>=i}],"filter-id->=":[Vt,[qt],function(t,e){var r=e[0],n=t.id(),a=r.value;return typeof n==typeof a&&n>=a}],"filter-has":[Vt,[qt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Vt,[],function(t){return null!==t.id()}],"filter-type-in":[Vt,[Jt(Ut)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Vt,[Jt(qt)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Vt,[Ut,Jt(qt)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[Vt,[Ut,Jt(qt)],function(t,e){var r=e[0],n=e[1];return function(t,e,r,n){for(;r<=n;){var a=r+n>>1;if(e[a]===t)return!0;e[a]>t?n=a-1:r=a+1}return!1}(t.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:Vt,overloads:[[[Vt,Vt],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)&&n.evaluate(t)}],[dr(Vt),function(t,e){for(var r=0,n=e;r<n.length;r+=1)if(!n[r].evaluate(t))return!1;return!0}]]},any:{type:Vt,overloads:[[[Vt,Vt],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)||n.evaluate(t)}],[dr(Vt),function(t,e){for(var r=0,n=e;r<n.length;r+=1)if(n[r].evaluate(t))return!0;return!1}]]},"!":[Vt,[Vt],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[Vt,[Ut],function(t,e){var r=e[0],n=t.globals&&t.globals.isSupportedScript;return!n||n(r.evaluate(t))}],upcase:[Ut,[Ut],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[Ut,[Ut],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[Ut,dr(qt),function(t,e){return e.map((function(e){return se(e.evaluate(t))})).join("")}],"resolved-locale":[Ut,[Zt],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var Lr=function(t,e){var r;this.expression=t,this._warningHistory={},this._evaluator=new ge,this._defaultValue=e?"color"===(r=e).type&&_r(r.default)?new ee(0,0,0,0):"color"===r.type?ee.parse(r.default)||null:void 0===r.default?null:r.default:null,this._enumValues=e&&"enum"===e.type?e.values:null};function Ar(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in lr}function Sr(t,e){var r=new Me(lr,[],e?function(t){var e={color:Wt,string:Ut,number:Ht,enum:Ut,boolean:Vt,formatted:Xt};return"array"===t.type?Jt(e[t.value]||qt,t.length):e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?fr(new Lr(n,e)):pr(r.errors)}Lr.prototype.evaluateWithoutErrorHandling=function(t,e,r){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this.expression.evaluate(this._evaluator)},Lr.prototype.evaluate=function(t,e,r){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null;try{var n=this.expression.evaluate(this._evaluator);if(null==n)return this._defaultValue;if(this._enumValues&&!(n in this._enumValues))throw new ue("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(n)+" instead.");return n}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Er=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!xe(e.expression)};Er.prototype.evaluateWithoutErrorHandling=function(t,e,r){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r)},Er.prototype.evaluate=function(t,e,r){return this._styleExpression.evaluate(t,e,r)};var Cr=function(t,e,r){this.kind=t,this.zoomStops=r.labels,this._styleExpression=e,this.isStateDependent="camera"!==t&&!xe(e.expression),r instanceof Ve&&(this.interpolationType=r.interpolation)};function Dr(t,e){if("error"===(t=Sr(t,e)).result)return t;var r=t.value.expression,n=_e(r);if(!n&&!mr(e))return pr([new Yt("","data expressions not supported")]);var a=be(r,["zoom"]);if(!a&&!gr(e))return pr([new Yt("","zoom expressions not supported")]);var i=function t(e){var r=null;if(e instanceof qe)r=t(e.result);else if(e instanceof Ge)for(var n=0,a=e.args;n<a.length;n+=1){var i=a[n];if(r=t(i))break}else(e instanceof Te||e instanceof Ve)&&e.input instanceof ye&&"zoom"===e.input.name&&(r=e);return r instanceof Yt||e.eachChild((function(e){var n=t(e);n instanceof Yt?r=n:!r&&n?r=new Yt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&n&&r!==n&&(r=new Yt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),r}(r);return i||a?i instanceof Yt?pr([i]):i instanceof Ve&&!yr(e)?pr([new Yt("",'"interpolate" expressions cannot be used with this property')]):fr(i?new Cr(n?"camera":"composite",t.value,i):new Er(n?"constant":"source",t.value)):pr([new Yt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}Cr.prototype.evaluateWithoutErrorHandling=function(t,e,r){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r)},Cr.prototype.evaluate=function(t,e,r){return this._styleExpression.evaluate(t,e,r)},Cr.prototype.interpolationFactor=function(t,e,r){return this.interpolationType?Ve.interpolationFactor(this.interpolationType,t,e,r):0};var Pr=function(t,e){this._parameters=t,this._specification=e,It(this,function t(e,r){var n,a,i,o="color"===r.type,s=e.stops&&"object"==typeof e.stops[0][0],l=s||void 0!==e.property,u=s||!l,c=e.type||(yr(r)?"exponential":"interval");if(o&&((e=It({},e)).stops&&(e.stops=e.stops.map((function(t){return[t[0],ee.parse(t[1])]}))),e.default?e.default=ee.parse(e.default):e.default=ee.parse(r.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!Ue[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===c)n=kr;else if("interval"===c)n=Mr;else if("categorical"===c){n=wr,a=Object.create(null);for(var h=0,d=e.stops;h<d.length;h+=1){var f=d[h];a[f[0]]=f[1]}i=typeof e.stops[0][0]}else{if("identity"!==c)throw new Error('Unknown function type "'+c+'"');n=Tr}if(s){for(var p={},m=[],g=0;g<e.stops.length;g++){var y=e.stops[g],v=y[0].zoom;void 0===p[v]&&(p[v]={zoom:v,type:e.type,property:e.property,default:e.default,stops:[]},m.push(v)),p[v].stops.push([y[0].value,y[1]])}for(var _=[],x=0,b=m;x<b.length;x+=1){var w=b[x];_.push([p[w].zoom,t(p[w],r)])}var M={name:"linear"};return{kind:"composite",interpolationType:M,interpolationFactor:Ve.interpolationFactor.bind(void 0,M),zoomStops:_.map((function(t){return t[0]})),evaluate:function(t,n){var a=t.zoom;return kr({stops:_,base:e.base},r,a).evaluate(a,n)}}}if(u){var k="exponential"===c?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:k,interpolationFactor:Ve.interpolationFactor.bind(void 0,k),zoomStops:e.stops.map((function(t){return t[0]})),evaluate:function(t){var o=t.zoom;return n(e,r,o,a,i)}}}return{kind:"source",evaluate:function(t,o){var s=o&&o.properties?o.properties[e.property]:void 0;return void 0===s?br(e.default,r.default):n(e,r,s,a,i)}}}(this._parameters,this._specification))};function Or(t){var e=t.key,r=t.value,n=t.valueSpec||{},a=t.objectElementValidators||{},i=t.style,o=t.styleSpec,s=[],l=vr(r);if("object"!==l)return[new Ot(e,r,"object expected, "+l+" found")];for(var u in r){var c=u.split(".")[0],h=n[c]||n["*"],d=void 0;if(a[c])d=a[c];else if(n[c])d=nn;else if(a["*"])d=a["*"];else{if(!n["*"]){s.push(new Ot(e,r[u],'unknown property "'+u+'"'));continue}d=nn}s=s.concat(d({key:(e?e+".":e)+u,value:r[u],valueSpec:h,style:i,styleSpec:o,object:r,objectKey:u},r))}for(var f in n)a[f]||n[f].required&&void 0===n[f].default&&void 0===r[f]&&s.push(new Ot(e,r,'missing required property "'+f+'"'));return s}function zr(t){var e=t.value,r=t.valueSpec,n=t.style,a=t.styleSpec,i=t.key,o=t.arrayElementValidator||nn;if("array"!==vr(e))return[new Ot(i,e,"array expected, "+vr(e)+" found")];if(r.length&&e.length!==r.length)return[new Ot(i,e,"array length "+r.length+" expected, length "+e.length+" found")];if(r["min-length"]&&e.length<r["min-length"])return[new Ot(i,e,"array length at least "+r["min-length"]+" expected, length "+e.length+" found")];var s={type:r.value,values:r.values};a.$version<7&&(s.function=r.function),"object"===vr(r.value)&&(s=r.value);for(var l=[],u=0;u<e.length;u++)l=l.concat(o({array:e,arrayIndex:u,value:e[u],valueSpec:s,style:n,styleSpec:a,key:i+"["+u+"]"}));return l}function Ir(t){var e=t.key,r=t.value,n=t.valueSpec,a=vr(r);return"number"!==a?[new Ot(e,r,"number expected, "+a+" found")]:"minimum"in n&&r<n.minimum?[new Ot(e,r,r+" is less than the minimum value "+n.minimum)]:"maximum"in n&&r>n.maximum?[new Ot(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function Rr(t){var e,r,n,a=t.valueSpec,i=Ft(t.value.type),o={},s="categorical"!==i&&void 0===t.value.property,l=!s,u="array"===vr(t.value.stops)&&"array"===vr(t.value.stops[0])&&"object"===vr(t.value.stops[0][0]),c=Or({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===i)return[new Ot(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(zr({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===vr(r)&&0===r.length&&e.push(new Ot(t.key,r,"array must have at least one stop")),e},default:function(t){return nn({key:t.key,value:t.value,valueSpec:a,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===i&&s&&c.push(new Ot(t.key,t.value,'missing required property "property"')),"identity"===i||t.value.stops||c.push(new Ot(t.key,t.value,'missing required property "stops"')),"exponential"===i&&t.valueSpec.expression&&!yr(t.valueSpec)&&c.push(new Ot(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!mr(t.valueSpec)?c.push(new Ot(t.key,t.value,"property functions not supported")):s&&!gr(t.valueSpec)&&c.push(new Ot(t.key,t.value,"zoom functions not supported"))),"categorical"!==i&&!u||void 0!==t.value.property||c.push(new Ot(t.key,t.value,'"property" property is required')),c;function h(t){var e=[],i=t.value,s=t.key;if("array"!==vr(i))return[new Ot(s,i,"array expected, "+vr(i)+" found")];if(2!==i.length)return[new Ot(s,i,"array length 2 expected, length "+i.length+" found")];if(u){if("object"!==vr(i[0]))return[new Ot(s,i,"object expected, "+vr(i[0])+" found")];if(void 0===i[0].zoom)return[new Ot(s,i,"object stop key must have zoom")];if(void 0===i[0].value)return[new Ot(s,i,"object stop key must have value")];if(n&&n>Ft(i[0].zoom))return[new Ot(s,i[0].zoom,"stop zoom values must appear in ascending order")];Ft(i[0].zoom)!==n&&(n=Ft(i[0].zoom),r=void 0,o={}),e=e.concat(Or({key:s+"[0]",value:i[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Ir,value:d}}))}else e=e.concat(d({key:s+"[0]",value:i[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},i));return Ar(Nt(i[1]))?e.concat([new Ot(s+"[1]",i[1],"expressions are not allowed in function stops.")]):e.concat(nn({key:s+"[1]",value:i[1],valueSpec:a,style:t.style,styleSpec:t.styleSpec}))}function d(t,n){var s=vr(t.value),l=Ft(t.value),u=null!==t.value?t.value:n;if(e){if(s!==e)return[new Ot(t.key,u,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new Ot(t.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==i){var c="number expected, "+s+" found";return mr(a)&&void 0===i&&(c+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Ot(t.key,u,c)]}return"categorical"!==i||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==i&&"number"===s&&void 0!==r&&l<r?[new Ot(t.key,u,"stop domain values must appear in ascending order")]:(r=l,"categorical"===i&&l in o?[new Ot(t.key,u,"stop domain values must be unique")]:(o[l]=!0,[])):[new Ot(t.key,u,"integer expected, found "+l)]}}function Fr(t){var e=("property"===t.expressionContext?Dr:Sr)(Nt(t.value),t.valueSpec);if("error"===e.result)return e.value.map((function(e){return new Ot(""+t.key+e.key,t.value,e.message)}));var r=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&-1!==r.possibleOutputs().indexOf(void 0))return[new Ot(t.key,t.value,'Invalid data expression for "'+t.propertyKey+'". Output values must be contained as literals within the expression.')];if("property"===t.expressionContext&&"layout"===t.propertyType&&!xe(r))return[new Ot(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!xe(r))return[new Ot(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!be(r,["zoom","feature-state"]))return[new Ot(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!_e(r))return[new Ot(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Nr(t){var e=t.key,r=t.value,n=t.valueSpec,a=[];return Array.isArray(n.values)?-1===n.values.indexOf(Ft(r))&&a.push(new Ot(e,r,"expected one of ["+n.values.join(", ")+"], "+JSON.stringify(r)+" found")):-1===Object.keys(n.values).indexOf(Ft(r))&&a.push(new Ot(e,r,"expected one of ["+Object.keys(n.values).join(", ")+"], "+JSON.stringify(r)+" found")),a}function Yr(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);e<r.length;e+=1){var n=r[e];if(!Yr(n)&&"boolean"!=typeof n)return!1}return!0;default:return!0}}Pr.deserialize=function(t){return new Pr(t._parameters,t._specification)},Pr.serialize=function(t){return{_parameters:t._parameters,_specification:t._specification}};var jr={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Br(t){if(null==t)return function(){return!0};Yr(t)||(t=Ur(t));var e=Sr(t,jr);if("error"===e.result)throw new Error(e.value.map((function(t){return t.key+": "+t.message})).join(", "));return function(t,r){return e.value.evaluate(t,r)}}function Hr(t,e){return t<e?-1:t>e?1:0}function Ur(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?Vr(t[1],t[2],"=="):"!="===r?qr(Vr(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?Vr(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(Ur))):"all"===r?["all"].concat(t.slice(1).map(Ur)):"none"===r?["all"].concat(t.slice(1).map(Ur).map(qr)):"in"===r?Wr(t[1],t.slice(2)):"!in"===r?qr(Wr(t[1],t.slice(2))):"has"===r?Gr(t[1]):"!has"!==r||qr(Gr(t[1]))}function Vr(t,e,r){switch(t){case"$type":return["filter-type-"+r,e];case"$id":return["filter-id-"+r,e];default:return["filter-"+r,t,e]}}function Wr(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(Hr)]]:["filter-in-small",t,["literal",e]]}}function Gr(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function qr(t){return["!",t]}function Zr(t){return Yr(Nt(t.value))?Fr(It({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,n=e.key;if("array"!==vr(r))return[new Ot(n,r,"array expected, "+vr(r)+" found")];var a,i=e.styleSpec,o=[];if(r.length<1)return[new Ot(n,r,"filter array must have at least 1 element")];switch(o=o.concat(Nr({key:n+"[0]",value:r[0],valueSpec:i.filter_operator,style:e.style,styleSpec:e.styleSpec})),Ft(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===Ft(r[1])&&o.push(new Ot(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&o.push(new Ot(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(a=vr(r[1]))&&o.push(new Ot(n+"[1]",r[1],"string expected, "+a+" found"));for(var s=2;s<r.length;s++)a=vr(r[s]),"$type"===Ft(r[1])?o=o.concat(Nr({key:n+"["+s+"]",value:r[s],valueSpec:i.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==a&&"number"!==a&&"boolean"!==a&&o.push(new Ot(n+"["+s+"]",r[s],"string, number, or boolean expected, "+a+" found"));break;case"any":case"all":case"none":for(var l=1;l<r.length;l++)o=o.concat(t({key:n+"["+l+"]",value:r[l],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":a=vr(r[1]),2!==r.length?o.push(new Ot(n,r,'filter array for "'+r[0]+'" operator must have 2 elements')):"string"!==a&&o.push(new Ot(n+"[1]",r[1],"string expected, "+a+" found"))}return o}(t)}function Xr(t,e){var r=t.key,n=t.style,a=t.styleSpec,i=t.value,o=t.objectKey,s=a[e+"_"+t.layerType];if(!s)return[];var l=o.match(/^(.*)-transition$/);if("paint"===e&&l&&s[l[1]]&&s[l[1]].transition)return nn({key:r,value:i,valueSpec:a.transition,style:n,styleSpec:a});var u,c=t.valueSpec||s[o];if(!c)return[new Ot(r,i,'unknown property "'+o+'"')];if("string"===vr(i)&&mr(c)&&!c.tokens&&(u=/^{([^}]+)}$/.exec(i)))return[new Ot(r,i,'"'+o+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(u[1])+" }`.")];var h=[];return"symbol"===t.layerType&&("text-field"===o&&n&&!n.glyphs&&h.push(new Ot(r,i,'use of "text-field" requires a style "glyphs" property')),"text-font"===o&&_r(Nt(i))&&"identity"===Ft(i.type)&&h.push(new Ot(r,i,'"text-font" does not support identity functions'))),h.concat(nn({key:t.key,value:i,valueSpec:c,style:n,styleSpec:a,expressionContext:"property",propertyType:e,propertyKey:o}))}function Jr(t){return Xr(t,"paint")}function Kr(t){return Xr(t,"layout")}function $r(t){var e=[],r=t.value,n=t.key,a=t.style,i=t.styleSpec;r.type||r.ref||e.push(new Ot(n,r,'either "type" or "ref" is required'));var o,s=Ft(r.type),l=Ft(r.ref);if(r.id)for(var u=Ft(r.id),c=0;c<t.arrayIndex;c++){var h=a.layers[c];Ft(h.id)===u&&e.push(new Ot(n,r.id,'duplicate layer id "'+r.id+'", previously used at line '+h.id.__line__))}if("ref"in r)["type","source","source-layer","filter","layout"].forEach((function(t){t in r&&e.push(new Ot(n,r[t],'"'+t+'" is prohibited for ref layers'))})),a.layers.forEach((function(t){Ft(t.id)===l&&(o=t)})),o?o.ref?e.push(new Ot(n,r.ref,"ref cannot reference another ref layer")):s=Ft(o.type):e.push(new Ot(n,r.ref,'ref layer "'+l+'" not found'));else if("background"!==s)if(r.source){var d=a.sources&&a.sources[r.source],f=d&&Ft(d.type);d?"vector"===f&&"raster"===s?e.push(new Ot(n,r.source,'layer "'+r.id+'" requires a raster source')):"raster"===f&&"raster"!==s?e.push(new Ot(n,r.source,'layer "'+r.id+'" requires a vector source')):"vector"!==f||r["source-layer"]?"raster-dem"===f&&"hillshade"!==s?e.push(new Ot(n,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==s||!r.paint||!r.paint["line-gradient"]||"geojson"===f&&d.lineMetrics||e.push(new Ot(n,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):e.push(new Ot(n,r,'layer "'+r.id+'" must specify a "source-layer"')):e.push(new Ot(n,r.source,'source "'+r.source+'" not found'))}else e.push(new Ot(n,r,'missing required property "source"'));return e=e.concat(Or({key:n,value:r,valueSpec:i.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return nn({key:n+".type",value:r.type,valueSpec:i.layer.type,style:t.style,styleSpec:t.styleSpec,object:r,objectKey:"type"})},filter:Zr,layout:function(t){return Or({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return Kr(It({layerType:s},t))}}})},paint:function(t){return Or({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return Jr(It({layerType:s},t))}}})}}}))}function Qr(t){var e=t.value,r=t.key,n=t.styleSpec,a=t.style;if(!e.type)return[new Ot(r,e,'"type" is required')];var i,o=Ft(e.type);switch(o){case"vector":case"raster":case"raster-dem":if(i=Or({key:r,value:e,valueSpec:n["source_"+o.replace("-","_")],style:t.style,styleSpec:n}),"url"in e)for(var s in e)["type","url","tileSize"].indexOf(s)<0&&i.push(new Ot(r+"."+s,e[s],'a source with a "url" property may not include a "'+s+'" property'));return i;case"geojson":if(i=Or({key:r,value:e,valueSpec:n.source_geojson,style:a,styleSpec:n}),e.cluster)for(var l in e.clusterProperties){var u=e.clusterProperties[l],c=u[0],h=u[1],d="string"==typeof c?[c,["accumulated"],["get",l]]:c;i.push.apply(i,Fr({key:r+"."+l+".map",value:h,expressionContext:"cluster-map"})),i.push.apply(i,Fr({key:r+"."+l+".reduce",value:d,expressionContext:"cluster-reduce"}))}return i;case"video":return Or({key:r,value:e,valueSpec:n.source_video,style:a,styleSpec:n});case"image":return Or({key:r,value:e,valueSpec:n.source_image,style:a,styleSpec:n});case"canvas":return[new Ot(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Nr({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:a,styleSpec:n})}}function tn(t){var e=t.value,r=t.styleSpec,n=r.light,a=t.style,i=[],o=vr(e);if(void 0===e)return i;if("object"!==o)return i.concat([new Ot("light",e,"object expected, "+o+" found")]);for(var s in e){var l=s.match(/^(.*)-transition$/);i=l&&n[l[1]]&&n[l[1]].transition?i.concat(nn({key:s,value:e[s],valueSpec:r.transition,style:a,styleSpec:r})):n[s]?i.concat(nn({key:s,value:e[s],valueSpec:n[s],style:a,styleSpec:r})):i.concat([new Ot(s,e[s],'unknown property "'+s+'"')])}return i}function en(t){var e=t.value,r=t.key,n=vr(e);return"string"!==n?[new Ot(r,e,"string expected, "+n+" found")]:[]}var rn={"*":function(){return[]},array:zr,boolean:function(t){var e=t.value,r=t.key,n=vr(e);return"boolean"!==n?[new Ot(r,e,"boolean expected, "+n+" found")]:[]},number:Ir,color:function(t){var e=t.key,r=t.value,n=vr(r);return"string"!==n?[new Ot(e,r,"color expected, "+n+" found")]:null===te(r)?[new Ot(e,r,'color expected, "'+r+'" found')]:[]},constants:zt,enum:Nr,filter:Zr,function:Rr,layer:$r,object:Or,source:Qr,light:tn,string:en,formatted:function(t){return 0===en(t).length?[]:Fr(t)}};function nn(t){var e=t.value,r=t.valueSpec,n=t.styleSpec;return r.expression&&_r(Ft(e))?Rr(t):r.expression&&Ar(Nt(e))?Fr(t):r.type&&rn[r.type]?rn[r.type](t):Or(It({},t,{valueSpec:r.type?n[r.type]:r}))}function an(t){var e=t.value,r=t.key,n=en(t);return n.length||(-1===e.indexOf("{fontstack}")&&n.push(new Ot(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&n.push(new Ot(r,e,'"glyphs" url must include a "{range}" token'))),n}function on(t,e){e=e||Pt;var r=[];return r=r.concat(nn({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:an,"*":function(){return[]}}})),t.constants&&(r=r.concat(zt({key:"constants",value:t.constants,style:t,styleSpec:e}))),sn(r)}function sn(t){return[].concat(t).sort((function(t,e){return t.line-e.line}))}function ln(t){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return sn(t.apply(this,e))}}on.source=ln(Qr),on.light=ln(tn),on.layer=ln($r),on.filter=ln(Zr),on.paintProperty=ln(Jr),on.layoutProperty=ln(Kr);var un=on,cn=un.light,hn=un.paintProperty,dn=un.layoutProperty;function fn(t,e){var r=!1;if(e&&e.length)for(var n=0,a=e;n<a.length;n+=1){var i=a[n];t.fire(new Ct(new Error(i.message))),r=!0}return r}var pn=mn;function mn(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 i=0;i<this.d*this.d;i++){var o=a[3+i],s=a[3+i+1];n.push(o===s?null:a.subarray(o,s))}var l=a[3+n.length],u=a[3+n.length+1];this.keys=a.subarray(l,u),this.bboxes=a.subarray(u),this.insert=this._insertReadonly}else{this.d=e+2*r;for(var c=0;c<this.d*this.d;c++)n.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=r,this.scale=e/t,this.uid=0;var h=r/e*t;this.min=-h,this.max=t+h}mn.prototype.insert=function(t,e,r,n,a){this._forEachCell(e,r,n,a,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(a)},mn.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},mn.prototype._insertCell=function(t,e,r,n,a,i){this.cells[a].push(i)},mn.prototype.query=function(t,e,r,n,a){var i=this.min,o=this.max;if(t<=i&&e<=i&&o<=r&&o<=n&&!a)return Array.prototype.slice.call(this.keys);var s=[];return this._forEachCell(t,e,r,n,this._queryCell,s,{},a),s},mn.prototype._queryCell=function(t,e,r,n,a,i,o,s){var l=this.cells[a];if(null!==l)for(var u=this.keys,c=this.bboxes,h=0;h<l.length;h++){var d=l[h];if(void 0===o[d]){var f=4*d;(s?s(c[f+0],c[f+1],c[f+2],c[f+3]):t<=c[f+2]&&e<=c[f+3]&&r>=c[f+0]&&n>=c[f+1])?(o[d]=!0,i.push(u[d])):o[d]=!1}}},mn.prototype._forEachCell=function(t,e,r,n,a,i,o,s){for(var l=this._convertToCellCoord(t),u=this._convertToCellCoord(e),c=this._convertToCellCoord(r),h=this._convertToCellCoord(n),d=l;d<=c;d++)for(var f=u;f<=h;f++){var p=this.d*f+d;if((!s||s(this._convertFromCellCoord(d),this._convertFromCellCoord(f),this._convertFromCellCoord(d+1),this._convertFromCellCoord(f+1)))&&a.call(this,t,e,r,n,p,i,o,s))return}},mn.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},mn.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},mn.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+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 i=e,o=0;o<t.length;o++){var s=t[o];a[3+o]=i,a.set(s,i),i+=s.length}return a[3+t.length]=i,a.set(this.keys,i),i+=this.keys.length,a[3+t.length+1]=i,a.set(this.bboxes,i),i+=this.bboxes.length,a.buffer};var gn=self.ImageData,yn={};function vn(t,e,r){void 0===r&&(r={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),yn[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}for(var _n in vn("Object",Object),pn.serialize=function(t,e){var r=t.toArrayBuffer();return e&&e.push(r),{buffer:r}},pn.deserialize=function(t){return new pn(t.buffer)},vn("Grid",pn),vn("Color",ee),vn("Error",Error),vn("StylePropertyFunction",Pr),vn("StyleExpression",Lr,{omit:["_evaluator"]}),vn("ZoomDependentExpression",Cr),vn("ZoomConstantExpression",Er),vn("CompoundExpression",ye,{omit:["_evaluate"]}),lr)lr[_n]._classRegistryKey||vn("Expression_"+_n,lr[_n]);function xn(t,e){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if(t instanceof ArrayBuffer)return e&&e.push(t),t;if(ArrayBuffer.isView(t)){var r=t;return e&&e.push(r.buffer),r}if(t instanceof gn)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){for(var n=[],a=0,i=t;a<i.length;a+=1){var o=i[a];n.push(xn(o,e))}return n}if("object"==typeof t){var s=t.constructor,l=s._classRegistryKey;if(!l)throw new Error("can't serialize object of unregistered class");var u=s.serialize?s.serialize(t,e):{};if(!s.serialize){for(var c in t)if(t.hasOwnProperty(c)&&!(yn[l].omit.indexOf(c)>=0)){var h=t[c];u[c]=yn[l].shallow.indexOf(c)>=0?h:xn(h,e)}t instanceof Error&&(u.message=t.message)}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==l&&(u.$name=l),u}throw new Error("can't serialize object of type "+typeof t)}function bn(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||t instanceof ArrayBuffer||ArrayBuffer.isView(t)||t instanceof gn)return t;if(Array.isArray(t))return t.map(bn);if("object"==typeof t){var e=t.$name||"Object",r=yn[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var n=Object.create(r.prototype),a=0,i=Object.keys(t);a<i.length;a+=1){var o=i[a];if("$name"!==o){var s=t[o];n[o]=yn[e].shallow.indexOf(o)>=0?s:bn(s)}}return n}throw new Error("can't deserialize object of type "+typeof t)}var wn=function(){this.first=!0};wn.prototype.update=function(t,e){var r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=r,!0))};var Mn={"Latin-1 Supplement":function(t){return t>=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function kn(t){for(var e=0,r=t;e<r.length;e+=1)if(An(r[e].charCodeAt(0)))return!0;return!1}function Tn(t){for(var e=0,r=t;e<r.length;e+=1)if(!Ln(r[e].charCodeAt(0)))return!1;return!0}function Ln(t){return!(Mn.Arabic(t)||Mn["Arabic Supplement"](t)||Mn["Arabic Extended-A"](t)||Mn["Arabic Presentation Forms-A"](t)||Mn["Arabic Presentation Forms-B"](t))}function An(t){return!(746!==t&&747!==t&&(t<4352||!(Mn["Bopomofo Extended"](t)||Mn.Bopomofo(t)||Mn["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||Mn["CJK Compatibility Ideographs"](t)||Mn["CJK Compatibility"](t)||Mn["CJK Radicals Supplement"](t)||Mn["CJK Strokes"](t)||!(!Mn["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Mn["CJK Unified Ideographs Extension A"](t)||Mn["CJK Unified Ideographs"](t)||Mn["Enclosed CJK Letters and Months"](t)||Mn["Hangul Compatibility Jamo"](t)||Mn["Hangul Jamo Extended-A"](t)||Mn["Hangul Jamo Extended-B"](t)||Mn["Hangul Jamo"](t)||Mn["Hangul Syllables"](t)||Mn.Hiragana(t)||Mn["Ideographic Description Characters"](t)||Mn.Kanbun(t)||Mn["Kangxi Radicals"](t)||Mn["Katakana Phonetic Extensions"](t)||Mn.Katakana(t)&&12540!==t||!(!Mn["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!Mn["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Mn["Unified Canadian Aboriginal Syllabics"](t)||Mn["Unified Canadian Aboriginal Syllabics Extended"](t)||Mn["Vertical Forms"](t)||Mn["Yijing Hexagram Symbols"](t)||Mn["Yi Syllables"](t)||Mn["Yi Radicals"](t))))}function Sn(t){return!(An(t)||function(t){return!!(Mn["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||Mn["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||Mn["Letterlike Symbols"](t)||Mn["Number Forms"](t)||Mn["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||Mn["Control Pictures"](t)&&9251!==t||Mn["Optical Character Recognition"](t)||Mn["Enclosed Alphanumerics"](t)||Mn["Geometric Shapes"](t)||Mn["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Mn["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Mn["CJK Symbols and Punctuation"](t)||Mn.Katakana(t)||Mn["Private Use Area"](t)||Mn["CJK Compatibility Forms"](t)||Mn["Small Form Variants"](t)||Mn["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function En(t,e){return!(!e&&(t>=1424&&t<=2303||Mn["Arabic Presentation Forms-A"](t)||Mn["Arabic Presentation Forms-B"](t))||t>=2304&&t<=3583||t>=3840&&t<=4255||Mn.Khmer(t))}var Cn,Dn=!1,Pn=null,On=!1,zn=new Dt,In={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return On||null!=In.applyArabicShaping}},Rn=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new wn,this.transition={})};Rn.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;r<n.length;r+=1)if(!En(n[r].charCodeAt(0),e))return!1;return!0}(t,In.isLoaded())},Rn.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},Rn.prototype.getCrossfadeParameters=function(){var t=this.zoom,e=t-Math.floor(t),r=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}};var Fn=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(_r(t))return new Pr(t,e);if(Ar(t)){var r=Dr(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}var n=t;return"string"==typeof t&&"color"===e.type&&(n=ee.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification)};Fn.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},Fn.prototype.possiblyEvaluate=function(t){return this.property.possiblyEvaluate(this,t)};var Nn=function(t){this.property=t,this.value=new Fn(t,void 0)};Nn.prototype.transitioned=function(t,e){return new jn(this.property,this.value,e,h({},t.transition,this.transition),t.now)},Nn.prototype.untransitioned=function(){return new jn(this.property,this.value,null,{},0)};var Yn=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};Yn.prototype.getValue=function(t){return x(this._values[t].value.value)},Yn.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Nn(this._values[t].property)),this._values[t].value=new Fn(this._values[t].property,null===e?void 0:x(e))},Yn.prototype.getTransition=function(t){return x(this._values[t].transition)},Yn.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Nn(this._values[t].property)),this._values[t].transition=x(e)||void 0},Yn.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e],a=this.getValue(n);void 0!==a&&(t[n]=a);var i=this.getTransition(n);void 0!==i&&(t[n+"-transition"]=i)}return t},Yn.prototype.transitioned=function(t,e){for(var r=new Bn(this._properties),n=0,a=Object.keys(this._values);n<a.length;n+=1){var i=a[n];r._values[i]=this._values[i].transitioned(t,e._values[i])}return r},Yn.prototype.untransitioned=function(){for(var t=new Bn(this._properties),e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e];t._values[n]=this._values[n].untransitioned()}return t};var jn=function(t,e,r,n,a){this.property=t,this.value=e,this.begin=a+n.delay||0,this.end=this.begin+n.duration||0,t.specification.transition&&(n.delay||n.duration)&&(this.prior=r)};jn.prototype.possiblyEvaluate=function(t){var e=t.now||0,r=this.value.possiblyEvaluate(t),n=this.prior;if(n){if(e>this.end)return this.prior=null,r;if(this.value.isDataDriven())return this.prior=null,r;if(e<this.begin)return n.possiblyEvaluate(t);var a=(e-this.begin)/(this.end-this.begin);return this.property.interpolate(n.possiblyEvaluate(t),r,function(t){if(a<=0)return 0;if(a>=1)return 1;var e=a*a,r=e*a;return 4*(a<.5?r:3*(a-e)+r-.75)}())}return r};var Bn=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};Bn.prototype.possiblyEvaluate=function(t){for(var e=new Vn(this._properties),r=0,n=Object.keys(this._values);r<n.length;r+=1){var a=n[r];e._values[a]=this._values[a].possiblyEvaluate(t)}return e},Bn.prototype.hasTransition=function(){for(var t=0,e=Object.keys(this._values);t<e.length;t+=1){var r=e[t];if(this._values[r].prior)return!0}return!1};var Hn=function(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)};Hn.prototype.getValue=function(t){return x(this._values[t].value)},Hn.prototype.setValue=function(t,e){this._values[t]=new Fn(this._values[t].property,null===e?void 0:x(e))},Hn.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e],a=this.getValue(n);void 0!==a&&(t[n]=a)}return t},Hn.prototype.possiblyEvaluate=function(t){for(var e=new Vn(this._properties),r=0,n=Object.keys(this._values);r<n.length;r+=1){var a=n[r];e._values[a]=this._values[a].possiblyEvaluate(t)}return e};var Un=function(t,e,r){this.property=t,this.value=e,this.parameters=r};Un.prototype.isConstant=function(){return"constant"===this.value.kind},Un.prototype.constantOr=function(t){return"constant"===this.value.kind?this.value.value:t},Un.prototype.evaluate=function(t,e){return this.property.evaluate(this.value,this.parameters,t,e)};var Vn=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)};Vn.prototype.get=function(t){return this._values[t]};var Wn=function(t){this.specification=t};Wn.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},Wn.prototype.interpolate=function(t,e,r){var n=Ae[this.specification.type];return n?n(t,e,r):t};var Gn=function(t){this.specification=t};Gn.prototype.possiblyEvaluate=function(t,e){return"constant"===t.expression.kind||"camera"===t.expression.kind?new Un(this,{kind:"constant",value:t.expression.evaluate(e)},e):new Un(this,t.expression,e)},Gn.prototype.interpolate=function(t,e,r){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new Un(this,{kind:"constant",value:void 0},t.parameters);var n=Ae[this.specification.type];return n?new Un(this,{kind:"constant",value:n(t.value.value,e.value.value,r)},t.parameters):t},Gn.prototype.evaluate=function(t,e,r,n){return"constant"===t.kind?t.value:t.evaluate(e,r,n)};var qn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.possiblyEvaluate=function(t,e){if(void 0===t.value)return new Un(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){var r=t.expression.evaluate(e),n=this._calculate(r,r,r,e);return new Un(this,{kind:"constant",value:n},e)}if("camera"===t.expression.kind){var a=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new Un(this,{kind:"constant",value:a},e)}return new Un(this,t.expression,e)},e.prototype.evaluate=function(t,e,r,n){if("source"===t.kind){var a=t.evaluate(e,r,n);return this._calculate(a,a,a,e)}return"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},r,n),t.evaluate({zoom:Math.floor(e.zoom)},r,n),t.evaluate({zoom:Math.floor(e.zoom)+1},r,n),e):t.value},e.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(Gn),Zn=function(t){this.specification=t};Zn.prototype.possiblyEvaluate=function(t,e){if(void 0!==t.value){if("constant"===t.expression.kind){var r=t.expression.evaluate(e);return this._calculate(r,r,r,e)}return this._calculate(t.expression.evaluate(new Rn(Math.floor(e.zoom-1),e)),t.expression.evaluate(new Rn(Math.floor(e.zoom),e)),t.expression.evaluate(new Rn(Math.floor(e.zoom+1),e)),e)}},Zn.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},Zn.prototype.interpolate=function(t){return t};var Xn=function(t){this.specification=t};Xn.prototype.possiblyEvaluate=function(t,e){return!!t.expression.evaluate(e)},Xn.prototype.interpolate=function(){return!1};var Jn=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},t){var r=t[e],n=this.defaultPropertyValues[e]=new Fn(r,void 0),a=this.defaultTransitionablePropertyValues[e]=new Nn(r);this.defaultTransitioningPropertyValues[e]=a.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};vn("DataDrivenProperty",Gn),vn("DataConstantProperty",Wn),vn("CrossFadedDataDrivenProperty",qn),vn("CrossFadedProperty",Zn),vn("ColorRampProperty",Xn);var Kn=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter=function(){return!0},"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new Hn(r.layout)),r.paint)){for(var n in this._transitionablePaint=new Yn(r.paint),e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(var a in e.layout)this.setLayoutProperty(a,e.layout[a],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned()}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e){var n="layers."+this.id+".layout."+t;if(this._validate(dn,n,t,e,r))return}"visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e},e.prototype.getPaintProperty=function(t){return y(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e){var n="layers."+this.id+".paint."+t;if(this._validate(hn,n,t,e,r))return!1}if(y(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var a=this._transitionablePaint._values[t],i="cross-faded-data-driven"===a.property.specification["property-type"],o=a.value.isDataDriven();return this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t),this._transitionablePaint._values[t].value.isDataDriven()||o||i},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype.isHidden=function(t){return!!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t)),this.paint=this._transitioningPaint.possiblyEvaluate(t)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),_(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,r,n,a){return void 0===a&&(a={}),(!a||!1!==a.validate)&&fn(this,t.call(un,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:Pt,style:{glyphs:!0,sprite:!0}}))},e.prototype.is3D=function(){return!1},e.prototype.isTileClipped=function(){return!1},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof Un&&mr(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(Dt),$n={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Qn=function(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},ta=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function ea(t,e){void 0===e&&(e=1);var r=0,n=0;return{members:t.map((function(t){var a,i=(a=t.type,$n[a].BYTES_PER_ELEMENT),o=r=ra(r,Math.max(e,i)),s=t.components||1;return n=Math.max(n,i),r+=i*s,{name:t.name,type:t.type,components:s,offset:o}})),size:ra(r,Math.max(n,e)),alignment:e}}function ra(t,e){return Math.ceil(t/e)*e}ta.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},ta.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},ta.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},ta.prototype.clear=function(){this.length=0},ta.prototype.resize=function(t){this.reserve(t),this.length=t},ta.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},ta.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var na=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t},e}(ta);na.prototype.bytesPerElement=4,vn("StructArrayLayout2i4",na);var aa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,a){var i=4*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,this.int16[i+3]=a,t},e}(ta);aa.prototype.bytesPerElement=8,vn("StructArrayLayout4i8",aa);var ia=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,a,i){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,a,i)},e.prototype.emplace=function(t,e,r,n,a,i,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=a,this.int16[s+4]=i,this.int16[s+5]=o,t},e}(ta);ia.prototype.bytesPerElement=12,vn("StructArrayLayout2i4i12",ia);var oa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,a,i){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,a,i)},e.prototype.emplace=function(t,e,r,n,a,i,o){var s=4*t,l=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[l+4]=n,this.uint8[l+5]=a,this.uint8[l+6]=i,this.uint8[l+7]=o,t},e}(ta);oa.prototype.bytesPerElement=8,vn("StructArrayLayout2i4ub8",oa);var sa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,a,i,o,s){var l=this.length;return this.resize(l+1),this.emplace(l,t,e,r,n,a,i,o,s)},e.prototype.emplace=function(t,e,r,n,a,i,o,s,l){var u=8*t;return this.uint16[u+0]=e,this.uint16[u+1]=r,this.uint16[u+2]=n,this.uint16[u+3]=a,this.uint16[u+4]=i,this.uint16[u+5]=o,this.uint16[u+6]=s,this.uint16[u+7]=l,t},e}(ta);sa.prototype.bytesPerElement=16,vn("StructArrayLayout8ui16",sa);var la=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,a,i,o,s){var l=this.length;return this.resize(l+1),this.emplace(l,t,e,r,n,a,i,o,s)},e.prototype.emplace=function(t,e,r,n,a,i,o,s,l){var u=8*t;return this.int16[u+0]=e,this.int16[u+1]=r,this.int16[u+2]=n,this.int16[u+3]=a,this.uint16[u+4]=i,this.uint16[u+5]=o,this.uint16[u+6]=s,this.uint16[u+7]=l,t},e}(ta);la.prototype.bytesPerElement=16,vn("StructArrayLayout4i4ui16",la);var ua=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var a=3*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,t},e}(ta);ua.prototype.bytesPerElement=12,vn("StructArrayLayout3f12",ua);var ca=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint32[r+0]=e,t},e}(ta);ca.prototype.bytesPerElement=4,vn("StructArrayLayout1ul4",ca);var ha=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,a,i,o,s,l,u,c){var h=this.length;return this.resize(h+1),this.emplace(h,t,e,r,n,a,i,o,s,l,u,c)},e.prototype.emplace=function(t,e,r,n,a,i,o,s,l,u,c,h){var d=12*t,f=6*t;return this.int16[d+0]=e,this.int16[d+1]=r,this.int16[d+2]=n,this.int16[d+3]=a,this.int16[d+4]=i,this.int16[d+5]=o,this.uint32[f+3]=s,this.uint16[d+8]=l,this.uint16[d+9]=u,this.int16[d+10]=c,this.int16[d+11]=h,t},e}(ta);ha.prototype.bytesPerElement=24,vn("StructArrayLayout6i1ul2ui2i24",ha);var da=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,a,i){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,a,i)},e.prototype.emplace=function(t,e,r,n,a,i,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=a,this.int16[s+4]=i,this.int16[s+5]=o,t},e}(ta);da.prototype.bytesPerElement=12,vn("StructArrayLayout2i2i2i12",da);var fa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,a){var i=12*t,o=3*t;return this.uint8[i+0]=e,this.uint8[i+1]=r,this.float32[o+1]=n,this.float32[o+2]=a,t},e}(ta);fa.prototype.bytesPerElement=12,vn("StructArrayLayout2ub2f12",fa);var pa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,a,i,o,s,l,u,c,h,d,f,p){var m=this.length;return this.resize(m+1),this.emplace(m,t,e,r,n,a,i,o,s,l,u,c,h,d,f,p)},e.prototype.emplace=function(t,e,r,n,a,i,o,s,l,u,c,h,d,f,p,m){var g=22*t,y=11*t,v=44*t;return this.int16[g+0]=e,this.int16[g+1]=r,this.uint16[g+2]=n,this.uint16[g+3]=a,this.uint32[y+2]=i,this.uint32[y+3]=o,this.uint32[y+4]=s,this.uint16[g+10]=l,this.uint16[g+11]=u,this.uint16[g+12]=c,this.float32[y+7]=h,this.float32[y+8]=d,this.uint8[v+36]=f,this.uint8[v+37]=p,this.uint32[y+10]=m,t},e}(ta);pa.prototype.bytesPerElement=44,vn("StructArrayLayout2i2ui3ul3ui2f2ub1ul44",pa);var ma=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,a,i,o,s,l,u,c,h,d,f,p,m,g,y){var v=this.length;return this.resize(v+1),this.emplace(v,t,e,r,n,a,i,o,s,l,u,c,h,d,f,p,m,g,y)},e.prototype.emplace=function(t,e,r,n,a,i,o,s,l,u,c,h,d,f,p,m,g,y,v){var _=22*t,x=11*t;return this.int16[_+0]=e,this.int16[_+1]=r,this.int16[_+2]=n,this.int16[_+3]=a,this.int16[_+4]=i,this.int16[_+5]=o,this.uint16[_+6]=s,this.uint16[_+7]=l,this.uint16[_+8]=u,this.uint16[_+9]=c,this.uint16[_+10]=h,this.uint16[_+11]=d,this.uint16[_+12]=f,this.uint16[_+13]=p,this.uint16[_+14]=m,this.uint32[x+8]=g,this.float32[x+9]=y,this.float32[x+10]=v,t},e}(ta);ma.prototype.bytesPerElement=44,vn("StructArrayLayout6i9ui1ul2f44",ma);var ga=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.float32[r+0]=e,t},e}(ta);ga.prototype.bytesPerElement=4,vn("StructArrayLayout1f4",ga);var ya=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var a=3*t;return this.int16[a+0]=e,this.int16[a+1]=r,this.int16[a+2]=n,t},e}(ta);ya.prototype.bytesPerElement=6,vn("StructArrayLayout3i6",ya);var va=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var a=2*t,i=4*t;return this.uint32[a+0]=e,this.uint16[i+2]=r,this.uint16[i+3]=n,t},e}(ta);va.prototype.bytesPerElement=8,vn("StructArrayLayout1ul2ui8",va);var _a=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var a=3*t;return this.uint16[a+0]=e,this.uint16[a+1]=r,this.uint16[a+2]=n,t},e}(ta);_a.prototype.bytesPerElement=6,vn("StructArrayLayout3ui6",_a);var xa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t},e}(ta);xa.prototype.bytesPerElement=4,vn("StructArrayLayout2ui4",xa);var ba=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint16[r+0]=e,t},e}(ta);ba.prototype.bytesPerElement=2,vn("StructArrayLayout1ui2",ba);var wa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t},e}(ta);wa.prototype.bytesPerElement=8,vn("StructArrayLayout2f8",wa);var Ma=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,a){var i=4*t;return this.float32[i+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,this.float32[i+3]=a,t},e}(ta);Ma.prototype.bytesPerElement=16,vn("StructArrayLayout4f16",Ma);var ka=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},radius:{configurable:!0},signedDistanceFromAnchor:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointX.set=function(t){this._structArray.int16[this._pos2+0]=t},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.anchorPointY.set=function(t){this._structArray.int16[this._pos2+1]=t},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.x1.set=function(t){this._structArray.int16[this._pos2+2]=t},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.y1.set=function(t){this._structArray.int16[this._pos2+3]=t},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.x2.set=function(t){this._structArray.int16[this._pos2+4]=t},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.y2.set=function(t){this._structArray.int16[this._pos2+5]=t},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.featureIndex.set=function(t){this._structArray.uint32[this._pos4+3]=t},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+8]=t},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+9]=t},r.radius.get=function(){return this._structArray.int16[this._pos2+10]},r.radius.set=function(t){this._structArray.int16[this._pos2+10]=t},r.signedDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+11]},r.signedDistanceFromAnchor.set=function(t){this._structArray.int16[this._pos2+11]=t},r.anchorPoint.get=function(){return new a(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(Qn);ka.prototype.size=24;var Ta=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new ka(this,t)},e}(ha);vn("CollisionBoxArray",Ta);var La=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorX.set=function(t){this._structArray.int16[this._pos2+0]=t},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.anchorY.set=function(t){this._structArray.int16[this._pos2+1]=t},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.glyphStartIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.numGlyphs.set=function(t){this._structArray.uint16[this._pos2+3]=t},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.vertexStartIndex.set=function(t){this._structArray.uint32[this._pos4+2]=t},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineStartIndex.set=function(t){this._structArray.uint32[this._pos4+3]=t},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.lineLength.set=function(t){this._structArray.uint32[this._pos4+4]=t},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.segment.set=function(t){this._structArray.uint16[this._pos2+10]=t},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.lowerSize.set=function(t){this._structArray.uint16[this._pos2+11]=t},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.upperSize.set=function(t){this._structArray.uint16[this._pos2+12]=t},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetX.set=function(t){this._structArray.float32[this._pos4+7]=t},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.lineOffsetY.set=function(t){this._structArray.float32[this._pos4+8]=t},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.writingMode.set=function(t){this._structArray.uint8[this._pos1+36]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+37]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+37]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},Object.defineProperties(e.prototype,r),e}(Qn);La.prototype.size=44;var Aa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new La(this,t)},e}(pa);vn("PlacedSymbolArray",Aa);var Sa=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},radialTextOffset:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorX.set=function(t){this._structArray.int16[this._pos2+0]=t},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.anchorY.set=function(t){this._structArray.int16[this._pos2+1]=t},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.rightJustifiedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+2]=t},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.centerJustifiedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+3]=t},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.leftJustifiedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+4]=t},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.verticalPlacedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+5]=t},r.key.get=function(){return this._structArray.uint16[this._pos2+6]},r.key.set=function(t){this._structArray.uint16[this._pos2+6]=t},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+7]},r.textBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+7]=t},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+8]=t},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.iconBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+9]=t},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.iconBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+10]=t},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.featureIndex.set=function(t){this._structArray.uint16[this._pos2+11]=t},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+12]},r.numHorizontalGlyphVertices.set=function(t){this._structArray.uint16[this._pos2+12]=t},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+13]},r.numVerticalGlyphVertices.set=function(t){this._structArray.uint16[this._pos2+13]=t},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+14]},r.numIconVertices.set=function(t){this._structArray.uint16[this._pos2+14]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+8]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+8]=t},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+9]},r.textBoxScale.set=function(t){this._structArray.float32[this._pos4+9]=t},r.radialTextOffset.get=function(){return this._structArray.float32[this._pos4+10]},r.radialTextOffset.set=function(t){this._structArray.float32[this._pos4+10]=t},Object.defineProperties(e.prototype,r),e}(Qn);Sa.prototype.size=44;var Ea=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Sa(this,t)},e}(ma);vn("SymbolInstanceArray",Ea);var Ca=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={offsetX:{configurable:!0}};return r.offsetX.get=function(){return this._structArray.float32[this._pos4+0]},r.offsetX.set=function(t){this._structArray.float32[this._pos4+0]=t},Object.defineProperties(e.prototype,r),e}(Qn);Ca.prototype.size=4;var Da=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e.prototype.get=function(t){return new Ca(this,t)},e}(ga);vn("GlyphOffsetArray",Da);var Pa=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={x:{configurable:!0},y:{configurable:!0},tileUnitDistanceFromAnchor:{configurable:!0}};return r.x.get=function(){return this._structArray.int16[this._pos2+0]},r.x.set=function(t){this._structArray.int16[this._pos2+0]=t},r.y.get=function(){return this._structArray.int16[this._pos2+1]},r.y.set=function(t){this._structArray.int16[this._pos2+1]=t},r.tileUnitDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+2]},r.tileUnitDistanceFromAnchor.set=function(t){this._structArray.int16[this._pos2+2]=t},Object.defineProperties(e.prototype,r),e}(Qn);Pa.prototype.size=6;var Oa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e.prototype.get=function(t){return new Pa(this,t)},e}(ya);vn("SymbolLineVertexArray",Oa);var za=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.featureIndex.set=function(t){this._structArray.uint32[this._pos4+0]=t},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},r.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+3]=t},Object.defineProperties(e.prototype,r),e}(Qn);za.prototype.size=8;var Ia=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new za(this,t)},e}(va);vn("FeatureIndexArray",Ia);var Ra=ea([{name:"a_pos",components:2,type:"Int16"}],4).members,Fa=function(t){void 0===t&&(t=[]),this.segments=t};function Na(t,e){return 256*(t=u(Math.floor(t),0,255))+u(Math.floor(e),0,255)}Fa.prototype.prepareSegment=function(t,e,r,n){var a=this.segments[this.segments.length-1];return t>Fa.MAX_VERTEX_ARRAY_LENGTH&&w("Max vertices per segment is "+Fa.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!a||a.vertexLength+t>Fa.MAX_VERTEX_ARRAY_LENGTH||a.sortKey!==n)&&(a={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(a.sortKey=n),this.segments.push(a)),a},Fa.prototype.get=function(){return this.segments},Fa.prototype.destroy=function(){for(var t=0,e=this.segments;t<e.length;t+=1){var r=e[t];for(var n in r.vaos)r.vaos[n].destroy()}},Fa.simpleSegment=function(t,e,r,n){return new Fa([{vertexOffset:t,primitiveOffset:e,vertexLength:r,primitiveLength:n,vaos:{},sortKey:0}])},Fa.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,vn("SegmentVector",Fa);var Ya=function(){this.ids=[],this.positions=[],this.indexed=!1};function ja(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}Ya.prototype.add=function(t,e,r,n){this.ids.push(t),this.positions.push(e,r,n)},Ya.prototype.getPositions=function(t){for(var e=0,r=this.ids.length-1;e<r;){var n=e+r>>1;this.ids[n]>=t?r=n:e=n+1}for(var a=[];this.ids[e]===t;){var i=this.positions[3*e],o=this.positions[3*e+1],s=this.positions[3*e+2];a.push({index:i,start:o,end:s}),e++}return a},Ya.serialize=function(t,e){var r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return function t(e,r,n,a){if(!(n>=a)){for(var i=e[n+a>>1],o=n-1,s=a+1;;){do{o++}while(e[o]<i);do{s--}while(e[s]>i);if(o>=s)break;ja(e,o,s),ja(r,3*o,3*s),ja(r,3*o+1,3*s+1),ja(r,3*o+2,3*s+2)}t(e,r,n,s),t(e,r,s+1,a)}}(r,n,0,r.length-1),e.push(r.buffer,n.buffer),{ids:r,positions:n}},Ya.deserialize=function(t){var e=new Ya;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e},vn("FeaturePositionMap",Ya);var Ba=function(t,e){this.gl=t.gl,this.location=e},Ha=function(t){function e(e,r){t.call(this,e,r),this.current=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))},e}(Ba),Ua=function(t){function e(e,r){t.call(this,e,r),this.current=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))},e}(Ba),Va=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]||(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]))},e}(Ba),Wa=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]||(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]))},e}(Ba),Ga=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))},e}(Ba),qa=function(t){function e(e,r){t.call(this,e,r),this.current=ee.transparent}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))},e}(Ba),Za=new Float32Array(16),Xa=function(t){function e(e,r){t.call(this,e,r),this.current=Za}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t);for(var e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}},e}(Ba);function Ja(t){return[Na(255*t.r,255*t.g),Na(255*t.b,255*t.a)]}var Ka=function(t,e,r){this.value=t,this.names=e,this.uniformNames=this.names.map((function(t){return"u_"+t})),this.type=r,this.maxValue=-1/0};Ka.prototype.defines=function(){return this.names.map((function(t){return"#define HAS_UNIFORM_u_"+t}))},Ka.prototype.setConstantPatternPositions=function(){},Ka.prototype.populatePaintArray=function(){},Ka.prototype.updatePaintArray=function(){},Ka.prototype.upload=function(){},Ka.prototype.destroy=function(){},Ka.prototype.setUniforms=function(t,e,r,n){e.set(n.constantOr(this.value))},Ka.prototype.getBinding=function(t,e){return"color"===this.type?new qa(t,e):new Ua(t,e)},Ka.serialize=function(t){var e=t.value,r=t.names,n=t.type;return{value:xn(e),names:r,type:n}},Ka.deserialize=function(t){var e=t.value,r=t.names,n=t.type;return new Ka(bn(e),r,n)};var $a=function(t,e,r){this.value=t,this.names=e,this.uniformNames=this.names.map((function(t){return"u_"+t})),this.type=r,this.maxValue=-1/0,this.patternPositions={patternTo:null,patternFrom:null}};$a.prototype.defines=function(){return this.names.map((function(t){return"#define HAS_UNIFORM_u_"+t}))},$a.prototype.populatePaintArray=function(){},$a.prototype.updatePaintArray=function(){},$a.prototype.upload=function(){},$a.prototype.destroy=function(){},$a.prototype.setConstantPatternPositions=function(t,e){this.patternPositions.patternTo=t.tlbr,this.patternPositions.patternFrom=e.tlbr},$a.prototype.setUniforms=function(t,e,r,n,a){var i=this.patternPositions;"u_pattern_to"===a&&i.patternTo&&e.set(i.patternTo),"u_pattern_from"===a&&i.patternFrom&&e.set(i.patternFrom)},$a.prototype.getBinding=function(t,e){return new Ga(t,e)};var Qa=function(t,e,r,n){this.expression=t,this.names=e,this.type=r,this.uniformNames=this.names.map((function(t){return"a_"+t})),this.maxValue=-1/0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===r?2:1,offset:0}})),this.paintVertexArray=new n};Qa.prototype.defines=function(){return[]},Qa.prototype.setConstantPatternPositions=function(){},Qa.prototype.populatePaintArray=function(t,e){var r=this.paintVertexArray,n=r.length;r.reserve(t);var a=this.expression.evaluate(new Rn(0),e,{});if("color"===this.type)for(var i=Ja(a),o=n;o<t;o++)r.emplaceBack(i[0],i[1]);else{for(var s=n;s<t;s++)r.emplaceBack(a);this.maxValue=Math.max(this.maxValue,a)}},Qa.prototype.updatePaintArray=function(t,e,r,n){var a=this.paintVertexArray,i=this.expression.evaluate({zoom:0},r,n);if("color"===this.type)for(var o=Ja(i),s=t;s<e;s++)a.emplace(s,o[0],o[1]);else{for(var l=t;l<e;l++)a.emplace(l,i);this.maxValue=Math.max(this.maxValue,i)}},Qa.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Qa.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},Qa.prototype.setUniforms=function(t,e){e.set(0)},Qa.prototype.getBinding=function(t,e){return new Ua(t,e)};var ti=function(t,e,r,n,a,i){this.expression=t,this.names=e,this.uniformNames=this.names.map((function(t){return"u_"+t+"_t"})),this.type=r,this.useIntegerZoom=n,this.zoom=a,this.maxValue=-1/0;var o=i;this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===r?4:2,offset:0}})),this.paintVertexArray=new o};ti.prototype.defines=function(){return[]},ti.prototype.setConstantPatternPositions=function(){},ti.prototype.populatePaintArray=function(t,e){var r=this.paintVertexArray,n=r.length;r.reserve(t);var a=this.expression.evaluate(new Rn(this.zoom),e,{}),i=this.expression.evaluate(new Rn(this.zoom+1),e,{});if("color"===this.type)for(var o=Ja(a),s=Ja(i),l=n;l<t;l++)r.emplaceBack(o[0],o[1],s[0],s[1]);else{for(var u=n;u<t;u++)r.emplaceBack(a,i);this.maxValue=Math.max(this.maxValue,a,i)}},ti.prototype.updatePaintArray=function(t,e,r,n){var a=this.paintVertexArray,i=this.expression.evaluate({zoom:this.zoom},r,n),o=this.expression.evaluate({zoom:this.zoom+1},r,n);if("color"===this.type)for(var s=Ja(i),l=Ja(o),u=t;u<e;u++)a.emplace(u,s[0],s[1],l[0],l[1]);else{for(var c=t;c<e;c++)a.emplace(c,i,o);this.maxValue=Math.max(this.maxValue,i,o)}},ti.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},ti.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},ti.prototype.interpolationFactor=function(t){return this.useIntegerZoom?this.expression.interpolationFactor(Math.floor(t),this.zoom,this.zoom+1):this.expression.interpolationFactor(t,this.zoom,this.zoom+1)},ti.prototype.setUniforms=function(t,e,r){e.set(this.interpolationFactor(r.zoom))},ti.prototype.getBinding=function(t,e){return new Ua(t,e)};var ei=function(t,e,r,n,a,i,o){this.expression=t,this.names=e,this.type=r,this.uniformNames=this.names.map((function(t){return"u_"+t+"_t"})),this.useIntegerZoom=n,this.zoom=a,this.maxValue=-1/0,this.layerId=o,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Uint16",components:4,offset:0}})),this.zoomInPaintVertexArray=new i,this.zoomOutPaintVertexArray=new i};ei.prototype.defines=function(){return[]},ei.prototype.setConstantPatternPositions=function(){},ei.prototype.populatePaintArray=function(t,e,r){var n=this.zoomInPaintVertexArray,a=this.zoomOutPaintVertexArray,i=this.layerId,o=n.length;if(n.reserve(t),a.reserve(t),r&&e.patterns&&e.patterns[i]){var s=e.patterns[i],l=s.min,u=s.mid,c=s.max,h=r[l],d=r[u],f=r[c];if(!h||!d||!f)return;for(var p=o;p<t;p++)n.emplaceBack(d.tl[0],d.tl[1],d.br[0],d.br[1],h.tl[0],h.tl[1],h.br[0],h.br[1]),a.emplaceBack(d.tl[0],d.tl[1],d.br[0],d.br[1],f.tl[0],f.tl[1],f.br[0],f.br[1])}},ei.prototype.updatePaintArray=function(t,e,r,n,a){var i=this.zoomInPaintVertexArray,o=this.zoomOutPaintVertexArray,s=this.layerId;if(a&&r.patterns&&r.patterns[s]){var l=r.patterns[s],u=l.min,c=l.mid,h=l.max,d=a[u],f=a[c],p=a[h];if(!d||!f||!p)return;for(var m=t;m<e;m++)i.emplace(m,f.tl[0],f.tl[1],f.br[0],f.br[1],d.tl[0],d.tl[1],d.br[0],d.br[1]),o.emplace(m,f.tl[0],f.tl[1],f.br[0],f.br[1],p.tl[0],p.tl[1],p.br[0],p.br[1])}},ei.prototype.upload=function(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},ei.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()},ei.prototype.setUniforms=function(t,e){e.set(0)},ei.prototype.getBinding=function(t,e){return new Ua(t,e)};var ri=function(){this.binders={},this.cacheKey="",this._buffers=[],this._featureMap=new Ya,this._bufferOffset=0};ri.createDynamic=function(t,e,r){var n=new ri,a=[];for(var i in t.paint._values)if(r(i)){var o=t.paint.get(i);if(o instanceof Un&&mr(o.property.specification)){var s=ai(i,t.type),l=o.property.specification.type,u=o.property.useIntegerZoom;if("cross-faded"===o.property.specification["property-type"]||"cross-faded-data-driven"===o.property.specification["property-type"])if("constant"===o.value.kind)n.binders[i]=new $a(o.value.value,s,l),a.push("/u_"+i);else{var c=ii(i,l,"source");n.binders[i]=new ei(o.value,s,l,u,e,c,t.id),a.push("/a_"+i)}else if("constant"===o.value.kind)n.binders[i]=new Ka(o.value.value,s,l),a.push("/u_"+i);else if("source"===o.value.kind){var h=ii(i,l,"source");n.binders[i]=new Qa(o.value,s,l,h),a.push("/a_"+i)}else{var d=ii(i,l,"composite");n.binders[i]=new ti(o.value,s,l,u,e,d),a.push("/z_"+i)}}}return n.cacheKey=a.sort().join(""),n},ri.prototype.populatePaintArrays=function(t,e,r,n){for(var a in this.binders)this.binders[a].populatePaintArray(t,e,n);void 0!==e.id&&this._featureMap.add(+e.id,r,this._bufferOffset,t),this._bufferOffset=t},ri.prototype.setConstantPatternPositions=function(t,e){for(var r in this.binders)this.binders[r].setConstantPatternPositions(t,e)},ri.prototype.updatePaintArrays=function(t,e,r,n){var a=!1;for(var i in t)for(var o=0,s=this._featureMap.getPositions(+i);o<s.length;o+=1){var l=s[o],u=e.feature(l.index);for(var c in this.binders){var h=this.binders[c];if(!(h instanceof Ka||h instanceof $a)&&!0===h.expression.isStateDependent){var d=r.paint.get(c);h.expression=d.value,h.updatePaintArray(l.start,l.end,u,t[i],n),a=!0}}}return a},ri.prototype.defines=function(){var t=[];for(var e in this.binders)t.push.apply(t,this.binders[e].defines());return t},ri.prototype.getPaintVertexBuffers=function(){return this._buffers},ri.prototype.getUniforms=function(t,e){var r=[];for(var n in this.binders)for(var a=this.binders[n],i=0,o=a.uniformNames;i<o.length;i+=1){var s=o[i];if(e[s]){var l=a.getBinding(t,e[s]);r.push({name:s,property:n,binding:l})}}return r},ri.prototype.setUniforms=function(t,e,r,n){for(var a=0,i=e;a<i.length;a+=1){var o=i[a],s=o.name,l=o.property,u=o.binding;this.binders[l].setUniforms(t,u,n,r.get(l),s)}},ri.prototype.updatePatternPaintBuffers=function(t){var e=[];for(var r in this.binders){var n=this.binders[r];if(n instanceof ei){var a=2===t.fromScale?n.zoomInPaintVertexBuffer:n.zoomOutPaintVertexBuffer;a&&e.push(a)}else(n instanceof Qa||n instanceof ti)&&n.paintVertexBuffer&&e.push(n.paintVertexBuffer)}this._buffers=e},ri.prototype.upload=function(t){for(var e in this.binders)this.binders[e].upload(t);var r=[];for(var n in this.binders){var a=this.binders[n];(a instanceof Qa||a instanceof ti)&&a.paintVertexBuffer&&r.push(a.paintVertexBuffer)}this._buffers=r},ri.prototype.destroy=function(){for(var t in this.binders)this.binders[t].destroy()};var ni=function(t,e,r,n){void 0===n&&(n=function(){return!0}),this.programConfigurations={};for(var a=0,i=e;a<i.length;a+=1){var o=i[a];this.programConfigurations[o.id]=ri.createDynamic(o,r,n),this.programConfigurations[o.id].layoutAttributes=t}this.needsUpload=!1};function ai(t,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from"],"fill-pattern":["pattern_to","pattern_from"],"fill-extrusion-pattern":["pattern_to","pattern_from"]}[t]||[t.replace(e+"-","").replace(/-/g,"_")]}function ii(t,e,r){var n={color:{source:wa,composite:Ma},number:{source:ga,composite:wa}},a=function(t){return{"line-pattern":{source:sa,composite:sa},"fill-pattern":{source:sa,composite:sa},"fill-extrusion-pattern":{source:sa,composite:sa}}[t]}(t);return a&&a[r]||n[e][r]}ni.prototype.populatePaintArrays=function(t,e,r,n){for(var a in this.programConfigurations)this.programConfigurations[a].populatePaintArrays(t,e,r,n);this.needsUpload=!0},ni.prototype.updatePaintArrays=function(t,e,r,n){for(var a=0,i=r;a<i.length;a+=1){var o=i[a];this.needsUpload=this.programConfigurations[o.id].updatePaintArrays(t,e,o,n)||this.needsUpload}},ni.prototype.get=function(t){return this.programConfigurations[t]},ni.prototype.upload=function(t){if(this.needsUpload){for(var e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}},ni.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy()},vn("ConstantBinder",Ka),vn("CrossFadedConstantBinder",$a),vn("SourceExpressionBinder",Qa),vn("CrossFadedCompositeBinder",ei),vn("CompositeExpressionBinder",ti),vn("ProgramConfiguration",ri,{omit:["_buffers"]}),vn("ProgramConfigurationSet",ni);var oi=8192,si=-1*Math.pow(2,15),li=Math.pow(2,15)-1;function ui(t){for(var e=oi/t.extent,r=t.loadGeometry(),n=0;n<r.length;n++)for(var a=r[n],i=0;i<a.length;i++){var o=a[i];o.x=Math.round(o.x*e),o.y=Math.round(o.y*e),(o.x<si||o.x>li||o.y<si||o.y>li)&&w("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function ci(t,e,r,n,a){t.emplaceBack(2*e+(n+1)/2,2*r+(a+1)/2)}var hi=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new na,this.indexArray=new _a,this.segments=new Fa,this.programConfigurations=new ni(Ra,t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function di(t,e){for(var r=0;r<t.length;r++)if(bi(e,t[r]))return!0;for(var n=0;n<e.length;n++)if(bi(t,e[n]))return!0;return!!gi(t,e)}function fi(t,e,r){return!!bi(t,e)||!!vi(e,t,r)}function pi(t,e){if(1===t.length)return xi(e,t[0]);for(var r=0;r<e.length;r++)for(var n=e[r],a=0;a<n.length;a++)if(bi(t,n[a]))return!0;for(var i=0;i<t.length;i++)if(xi(e,t[i]))return!0;for(var o=0;o<e.length;o++)if(gi(t,e[o]))return!0;return!1}function mi(t,e,r){if(t.length>1){if(gi(t,e))return!0;for(var n=0;n<e.length;n++)if(vi(e[n],t,r))return!0}for(var a=0;a<t.length;a++)if(vi(t[a],e,r))return!0;return!1}function gi(t,e){if(0===t.length||0===e.length)return!1;for(var r=0;r<t.length-1;r++)for(var n=t[r],a=t[r+1],i=0;i<e.length-1;i++)if(yi(n,a,e[i],e[i+1]))return!0;return!1}function yi(t,e,r,n){return M(t,r,n)!==M(e,r,n)&&M(t,e,r)!==M(t,e,n)}function vi(t,e,r){var n=r*r;if(1===e.length)return t.distSqr(e[0])<n;for(var a=1;a<e.length;a++)if(_i(t,e[a-1],e[a])<n)return!0;return!1}function _i(t,e,r){var n=e.distSqr(r);if(0===n)return t.distSqr(e);var a=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/n;return a<0?t.distSqr(e):a>1?t.distSqr(r):t.distSqr(r.sub(e)._mult(a)._add(e))}function xi(t,e){for(var r,n,a,i=!1,o=0;o<t.length;o++)for(var s=0,l=(r=t[o]).length-1;s<r.length;l=s++)n=r[s],a=r[l],n.y>e.y!=a.y>e.y&&e.x<(a.x-n.x)*(e.y-n.y)/(a.y-n.y)+n.x&&(i=!i);return i}function bi(t,e){for(var r=!1,n=0,a=t.length-1;n<t.length;a=n++){var i=t[n],o=t[a];i.y>e.y!=o.y>e.y&&e.x<(o.x-i.x)*(e.y-i.y)/(o.y-i.y)+i.x&&(r=!r)}return r}function wi(t,e,r){var n=r[0],a=r[2];if(t.x<n.x&&e.x<n.x||t.x>a.x&&e.x>a.x||t.y<n.y&&e.y<n.y||t.y>a.y&&e.y>a.y)return!1;var i=M(t,e,r[0]);return i!==M(t,e,r[1])||i!==M(t,e,r[2])||i!==M(t,e,r[3])}function Mi(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).binders[t].maxValue}function ki(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Ti(t,e,r,n,i){if(!e[0]&&!e[1])return t;var o=a.convert(e)._mult(i);"viewport"===r&&o._rotate(-n);for(var s=[],l=0;l<t.length;l++){var u=t[l];s.push(u.sub(o))}return s}hi.prototype.populate=function(t,e){for(var r=0,n=t;r<n.length;r+=1){var a=n[r],i=a.feature,o=a.index,s=a.sourceLayerIndex;if(this.layers[0]._featureFilter(new Rn(this.zoom),i)){var l=ui(i);this.addFeature(i,l,o),e.featureIndex.insert(i,l,o,s,this.index)}}},hi.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},hi.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},hi.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},hi.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ra),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},hi.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},hi.prototype.addFeature=function(t,e,r){for(var n=0,a=e;n<a.length;n+=1)for(var i=0,o=a[n];i<o.length;i+=1){var s=o[i],l=s.x,u=s.y;if(!(l<0||l>=oi||u<0||u>=oi)){var c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),h=c.vertexLength;ci(this.layoutVertexArray,l,u,-1,-1),ci(this.layoutVertexArray,l,u,1,-1),ci(this.layoutVertexArray,l,u,1,1),ci(this.layoutVertexArray,l,u,-1,1),this.indexArray.emplaceBack(h,h+1,h+2),this.indexArray.emplaceBack(h,h+3,h+2),c.vertexLength+=4,c.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{})},vn("CircleBucket",hi,{omit:["layers"]});var Li={paint:new Jn({"circle-radius":new Gn(Pt.paint_circle["circle-radius"]),"circle-color":new Gn(Pt.paint_circle["circle-color"]),"circle-blur":new Gn(Pt.paint_circle["circle-blur"]),"circle-opacity":new Gn(Pt.paint_circle["circle-opacity"]),"circle-translate":new Wn(Pt.paint_circle["circle-translate"]),"circle-translate-anchor":new Wn(Pt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Wn(Pt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Wn(Pt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Gn(Pt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Gn(Pt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Gn(Pt.paint_circle["circle-stroke-opacity"])})},Ai="undefined"!=typeof Float32Array?Float32Array:Array;function Si(){var t=new Ai(9);return Ai!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function Ei(){var t=new Ai(3);return Ai!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Ci(t,e,r){var n=new Ai(3);return n[0]=t,n[1]=e,n[2]=r,n}function Di(t,e,r){var n=e[0],a=e[1],i=e[2],o=e[3];return t[0]=r[0]*n+r[4]*a+r[8]*i+r[12]*o,t[1]=r[1]*n+r[5]*a+r[9]*i+r[13]*o,t[2]=r[2]*n+r[6]*a+r[10]*i+r[14]*o,t[3]=r[3]*n+r[7]*a+r[11]*i+r[15]*o,t}function Pi(){var t=new Ai(4);return Ai!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}Math.PI,Ei(),function(){var t;t=new Ai(4),Ai!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}(),Ei(),Ci(1,0,0),Ci(0,1,0),Pi(),Pi(),Si(),function(){var t;t=new Ai(2),Ai!=Float32Array&&(t[0]=0,t[1]=0)}();var Oi=function(t){function e(e){t.call(this,e,Li)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new hi(t)},e.prototype.queryRadius=function(t){var e=t;return Mi("circle-radius",this,e)+Mi("circle-stroke-width",this,e)+ki(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,a,i,o,s){for(var l=Ti(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),i.angle,o),u=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),c="map"===this.paint.get("circle-pitch-alignment"),h=c?l:function(t,e){return l.map((function(t){return zi(t,e)}))}(0,s),d=c?u*o:u,f=0,p=n;f<p.length;f+=1)for(var m=0,g=p[f];m<g.length;m+=1){var y=g[m],v=c?y:zi(y,s),_=d,x=Di([],[y.x,y.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?_*=x[3]/i.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(_*=i.cameraToCenterDistance/x[3]),fi(h,v,_))return!0}return!1},e}(Kn);function zi(t,e){var r=Di([],[t.x,t.y,0,1],e);return new a(r[0]/r[3],r[1]/r[3])}var Ii=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(hi);function Ri(t,e,r,n){var a=e.width,i=e.height;if(n){if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==a*i*r)throw new RangeError("mismatched image size")}else n=new Uint8Array(a*i*r);return t.width=a,t.height=i,t.data=n,t}function Fi(t,e,r){var n=e.width,a=e.height;if(n!==t.width||a!==t.height){var i=Ri({},{width:n,height:a},r);Ni(t,i,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,n),height:Math.min(t.height,a)},r),t.width=n,t.height=a,t.data=i.data}}function Ni(t,e,r,n,a,i){if(0===a.width||0===a.height)return e;if(a.width>t.width||a.height>t.height||r.x>t.width-a.width||r.y>t.height-a.height)throw new RangeError("out of range source coordinates for image copy");if(a.width>e.width||a.height>e.height||n.x>e.width-a.width||n.y>e.height-a.height)throw new RangeError("out of range destination coordinates for image copy");for(var o=t.data,s=e.data,l=0;l<a.height;l++)for(var u=((r.y+l)*t.width+r.x)*i,c=((n.y+l)*e.width+n.x)*i,h=0;h<a.width*i;h++)s[c+h]=o[u+h];return e}vn("HeatmapBucket",Ii,{omit:["layers"]});var Yi=function(t,e){Ri(this,t,1,e)};Yi.prototype.resize=function(t){Fi(this,t,1)},Yi.prototype.clone=function(){return new Yi({width:this.width,height:this.height},new Uint8Array(this.data))},Yi.copy=function(t,e,r,n,a){Ni(t,e,r,n,a,1)};var ji=function(t,e){Ri(this,t,4,e)};ji.prototype.resize=function(t){Fi(this,t,4)},ji.prototype.replace=function(t,e){e?this.data.set(t):t instanceof Uint8ClampedArray?this.data=new Uint8Array(t.buffer):this.data=t},ji.prototype.clone=function(){return new ji({width:this.width,height:this.height},new Uint8Array(this.data))},ji.copy=function(t,e,r,n,a){Ni(t,e,r,n,a,4)},vn("AlphaImage",Yi),vn("RGBAImage",ji);var Bi={paint:new Jn({"heatmap-radius":new Gn(Pt.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Gn(Pt.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Wn(Pt.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Xn(Pt.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Wn(Pt.paint_heatmap["heatmap-opacity"])})};function Hi(t,e){for(var r=new Uint8Array(1024),n={},a=0,i=0;a<256;a++,i+=4){n[e]=a/255;var o=t.evaluate(n);r[i+0]=Math.floor(255*o.r/o.a),r[i+1]=Math.floor(255*o.g/o.a),r[i+2]=Math.floor(255*o.b/o.a),r[i+3]=Math.floor(255*o.a)}return new ji({width:256,height:1},r)}var Ui=function(t){function e(e){t.call(this,e,Bi),this._updateColorRamp()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new Ii(t)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){"heatmap-color"===t&&this._updateColorRamp()},e.prototype._updateColorRamp=function(){var t=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=Hi(t,"heatmapDensity"),this.colorRampTexture=null},e.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility},e}(Kn),Vi={paint:new Jn({"hillshade-illumination-direction":new Wn(Pt.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Wn(Pt.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Wn(Pt.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Wn(Pt.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Wn(Pt.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Wn(Pt.paint_hillshade["hillshade-accent-color"])})},Wi=function(t){function e(e){t.call(this,e,Vi)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility},e}(Kn),Gi=ea([{name:"a_pos",components:2,type:"Int16"}],4).members,qi=Xi,Zi=Xi;function Xi(t,e,r){r=r||2;var n,a,i,o,s,l,u,c=e&&e.length,h=c?e[0]*r:t.length,d=Ji(t,0,h,r,!0),f=[];if(!d||d.next===d.prev)return f;if(c&&(d=function(t,e,r,n){var a,i,o,s=[];for(a=0,i=e.length;a<i;a++)(o=Ji(t,e[a]*n,a<i-1?e[a+1]*n:t.length,n,!1))===o.next&&(o.steiner=!0),s.push(oo(o));for(s.sort(no),a=0;a<s.length;a++)ao(s[a],r),r=Ki(r,r.next);return r}(t,e,d,r)),t.length>80*r){n=i=t[0],a=o=t[1];for(var p=r;p<h;p+=r)(s=t[p])<n&&(n=s),(l=t[p+1])<a&&(a=l),s>i&&(i=s),l>o&&(o=l);u=0!==(u=Math.max(i-n,o-a))?1/u:0}return $i(d,f,r,n,a,u),f}function Ji(t,e,r,n,a){var i,o;if(a===vo(t,e,r,n)>0)for(i=e;i<r;i+=n)o=mo(i,t[i],t[i+1],o);else for(i=r-n;i>=e;i-=n)o=mo(i,t[i],t[i+1],o);return o&&co(o,o.next)&&(go(o),o=o.next),o}function Ki(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!co(n,n.next)&&0!==uo(n.prev,n,n.next))n=n.next;else{if(go(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function $i(t,e,r,n,a,i,o){if(t){!o&&i&&function(t,e,r,n){var a=t;do{null===a.z&&(a.z=io(a.x,a.y,e,r,n)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next}while(a!==t);a.prevZ.nextZ=null,a.prevZ=null,function(t){var e,r,n,a,i,o,s,l,u=1;do{for(r=t,t=null,i=null,o=0;r;){for(o++,n=r,s=0,e=0;e<u&&(s++,n=n.nextZ);e++);for(l=u;s>0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,l--),i?i.nextZ=a:t=a,a.prevZ=i,i=a;r=n}i.nextZ=null,u*=2}while(o>1)}(a)}(t,n,a,i);for(var s,l,u=t;t.prev!==t.next;)if(s=t.prev,l=t.next,i?to(t,n,a,i):Qi(t))e.push(s.i/r),e.push(t.i/r),e.push(l.i/r),go(t),t=l.next,u=l.next;else if((t=l)===u){o?1===o?$i(t=eo(t,e,r),e,r,n,a,i,2):2===o&&ro(t,e,r,n,a,i):$i(Ki(t),e,r,n,a,i,1);break}}}function Qi(t){var e=t.prev,r=t,n=t.next;if(uo(e,r,n)>=0)return!1;for(var a=t.next.next;a!==t.prev;){if(so(e.x,e.y,r.x,r.y,n.x,n.y,a.x,a.y)&&uo(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function to(t,e,r,n){var a=t.prev,i=t,o=t.next;if(uo(a,i,o)>=0)return!1;for(var s=a.x<i.x?a.x<o.x?a.x:o.x:i.x<o.x?i.x:o.x,l=a.y<i.y?a.y<o.y?a.y:o.y:i.y<o.y?i.y:o.y,u=a.x>i.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,c=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,h=io(s,l,e,r,n),d=io(u,c,e,r,n),f=t.prevZ,p=t.nextZ;f&&f.z>=h&&p&&p.z<=d;){if(f!==t.prev&&f!==t.next&&so(a.x,a.y,i.x,i.y,o.x,o.y,f.x,f.y)&&uo(f.prev,f,f.next)>=0)return!1;if(f=f.prevZ,p!==t.prev&&p!==t.next&&so(a.x,a.y,i.x,i.y,o.x,o.y,p.x,p.y)&&uo(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;f&&f.z>=h;){if(f!==t.prev&&f!==t.next&&so(a.x,a.y,i.x,i.y,o.x,o.y,f.x,f.y)&&uo(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;p&&p.z<=d;){if(p!==t.prev&&p!==t.next&&so(a.x,a.y,i.x,i.y,o.x,o.y,p.x,p.y)&&uo(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function eo(t,e,r){var n=t;do{var a=n.prev,i=n.next.next;!co(a,i)&&ho(a,n,n.next,i)&&fo(a,i)&&fo(i,a)&&(e.push(a.i/r),e.push(n.i/r),e.push(i.i/r),go(n),go(n.next),n=t=i),n=n.next}while(n!==t);return n}function ro(t,e,r,n,a,i){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&lo(o,s)){var l=po(o,s);return o=Ki(o,o.next),l=Ki(l,l.next),$i(o,e,r,n,a,i),void $i(l,e,r,n,a,i)}s=s.next}o=o.next}while(o!==t)}function no(t,e){return t.x-e.x}function ao(t,e){if(e=function(t,e){var r,n=e,a=t.x,i=t.y,o=-1/0;do{if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){var s=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=a&&s>o){if(o=s,s===a){if(i===n.y)return n;if(i===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(a===o)return r.prev;var l,u=r,c=r.x,h=r.y,d=1/0;for(n=r.next;n!==u;)a>=n.x&&n.x>=c&&a!==n.x&&so(i<h?a:o,i,c,h,i<h?o:a,i,n.x,n.y)&&((l=Math.abs(i-n.y)/(a-n.x))<d||l===d&&n.x>r.x)&&fo(n,t)&&(r=n,d=l),n=n.next;return r}(t,e)){var r=po(e,t);Ki(r,r.next)}}function io(t,e,r,n,a){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*a)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*a)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function oo(t){var e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==t);return r}function so(t,e,r,n,a,i,o,s){return(a-o)*(e-s)-(t-o)*(i-s)>=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(i-s)-(a-o)*(n-s)>=0}function lo(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&ho(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&fo(t,e)&&fo(e,t)&&function(t,e){var r=t,n=!1,a=(t.x+e.x)/2,i=(t.y+e.y)/2;do{r.y>i!=r.next.y>i&&r.next.y!==r.y&&a<(r.next.x-r.x)*(i-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)}function uo(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function co(t,e){return t.x===e.x&&t.y===e.y}function ho(t,e,r,n){return!!(co(t,e)&&co(r,n)||co(t,n)&&co(r,e))||uo(t,e,r)>0!=uo(t,e,n)>0&&uo(r,n,t)>0!=uo(r,n,e)>0}function fo(t,e){return uo(t.prev,t,t.next)<0?uo(t,e,t.next)>=0&&uo(t,t.prev,e)>=0:uo(t,e,t.prev)<0||uo(t,t.next,e)<0}function po(t,e){var r=new yo(t.i,t.x,t.y),n=new yo(e.i,e.x,e.y),a=t.next,i=e.prev;return t.next=e,e.prev=t,r.next=a,a.prev=r,n.next=r,r.prev=n,i.next=n,n.prev=i,n}function mo(t,e,r,n){var a=new yo(t,e,r);return n?(a.next=n.next,a.prev=n,n.next.prev=a,n.next=a):(a.prev=a,a.next=a),a}function go(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 yo(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 vo(t,e,r,n){for(var a=0,i=e,o=r-n;i<r;i+=n)a+=(t[o]-t[i])*(t[i+1]+t[o+1]),o=i;return a}function _o(t,e,r,n,a){!function t(e,r,n,a,i){for(;a>n;){if(a-n>600){var o=a-n+1,s=r-n+1,l=Math.log(o),u=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*u*(o-u)/o)*(s-o/2<0?-1:1);t(e,r,Math.max(n,Math.floor(r-s*u/o+c)),Math.min(a,Math.floor(r+(o-s)*u/o+c)),i)}var h=e[r],d=n,f=a;for(xo(e,n,r),i(e[a],h)>0&&xo(e,n,a);d<f;){for(xo(e,d,f),d++,f--;i(e[d],h)<0;)d++;for(;i(e[f],h)>0;)f--}0===i(e[n],h)?xo(e,n,f):xo(e,++f,a),f<=r&&(n=f+1),r<=f&&(a=f-1)}}(t,e,r||0,n||t.length-1,a||bo)}function xo(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function bo(t,e){return t<e?-1:t>e?1:0}function wo(t,e){var r=t.length;if(r<=1)return[t];for(var n,a,i=[],o=0;o<r;o++){var s=k(t[o]);0!==s&&(t[o].area=Math.abs(s),void 0===a&&(a=s<0),a===s<0?(n&&i.push(n),n=[t[o]]):n.push(t[o]))}if(n&&i.push(n),e>1)for(var l=0;l<i.length;l++)i[l].length<=e||(_o(i[l],e,1,i[l].length-1,Mo),i[l]=i[l].slice(0,e));return i}function Mo(t,e){return e.area-t.area}function ko(t,e,r){for(var n=r.patternDependencies,a=!1,i=0,o=e;i<o.length;i+=1){var s=o[i].paint.get(t+"-pattern");s.isConstant()||(a=!0);var l=s.constantOr(null);l&&(a=!0,n[l.to]=!0,n[l.from]=!0)}return a}function To(t,e,r,n,a){for(var i=a.patternDependencies,o=0,s=e;o<s.length;o+=1){var l=s[o],u=l.paint.get(t+"-pattern").value;if("constant"!==u.kind){var c=u.evaluate({zoom:n-1},r,{}),h=u.evaluate({zoom:n},r,{}),d=u.evaluate({zoom:n+1},r,{});i[c]=!0,i[h]=!0,i[d]=!0,r.patterns[l.id]={min:c,mid:h,max:d}}}return r}Xi.deviation=function(t,e,r,n){var a=e&&e.length,i=a?e[0]*r:t.length,o=Math.abs(vo(t,0,i,r));if(a)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(vo(t,u,c,r))}var h=0;for(s=0;s<n.length;s+=3){var d=n[s]*r,f=n[s+1]*r,p=n[s+2]*r;h+=Math.abs((t[d]-t[p])*(t[f+1]-t[d+1])-(t[d]-t[f])*(t[p+1]-t[d+1]))}return 0===o&&0===h?0:Math.abs((h-o)/o)},Xi.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},n=0,a=0;a<t.length;a++){for(var i=0;i<t[a].length;i++)for(var o=0;o<e;o++)r.vertices.push(t[a][i][o]);a>0&&(n+=t[a-1].length,r.holes.push(n))}return r},qi.default=Zi;var Lo=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new na,this.indexArray=new _a,this.indexArray2=new xa,this.programConfigurations=new ni(Gi,t.layers,t.zoom),this.segments=new Fa,this.segments2=new Fa,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};Lo.prototype.populate=function(t,e){this.features=[],this.hasPattern=ko("fill",this.layers,e);for(var r=0,n=t;r<n.length;r+=1){var a=n[r],i=a.feature,o=a.index,s=a.sourceLayerIndex;if(this.layers[0]._featureFilter(new Rn(this.zoom),i)){var l=ui(i),u={sourceLayerIndex:s,index:o,geometry:l,properties:i.properties,type:i.type,patterns:{}};void 0!==i.id&&(u.id=i.id),this.hasPattern?this.features.push(To("fill",this.layers,u,this.zoom,e)):this.addFeature(u,l,o,{}),e.featureIndex.insert(i,l,o,s,this.index)}}},Lo.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},Lo.prototype.addFeatures=function(t,e){for(var r=0,n=this.features;r<n.length;r+=1){var a=n[r],i=a.geometry;this.addFeature(a,i,a.index,e)}},Lo.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Lo.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Lo.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Gi),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0},Lo.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},Lo.prototype.addFeature=function(t,e,r,n){for(var a=0,i=wo(e,500);a<i.length;a+=1){for(var o=i[a],s=0,l=0,u=o;l<u.length;l+=1)s+=u[l].length;for(var c=this.segments.prepareSegment(s,this.layoutVertexArray,this.indexArray),h=c.vertexLength,d=[],f=[],p=0,m=o;p<m.length;p+=1){var g=m[p];if(0!==g.length){g!==o[0]&&f.push(d.length/2);var y=this.segments2.prepareSegment(g.length,this.layoutVertexArray,this.indexArray2),v=y.vertexLength;this.layoutVertexArray.emplaceBack(g[0].x,g[0].y),this.indexArray2.emplaceBack(v+g.length-1,v),d.push(g[0].x),d.push(g[0].y);for(var _=1;_<g.length;_++)this.layoutVertexArray.emplaceBack(g[_].x,g[_].y),this.indexArray2.emplaceBack(v+_-1,v+_),d.push(g[_].x),d.push(g[_].y);y.vertexLength+=g.length,y.primitiveLength+=g.length}}for(var x=qi(d,f),b=0;b<x.length;b+=3)this.indexArray.emplaceBack(h+x[b],h+x[b+1],h+x[b+2]);c.vertexLength+=s,c.primitiveLength+=x.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,n)},vn("FillBucket",Lo,{omit:["layers","features"]});var Ao={paint:new Jn({"fill-antialias":new Wn(Pt.paint_fill["fill-antialias"]),"fill-opacity":new Gn(Pt.paint_fill["fill-opacity"]),"fill-color":new Gn(Pt.paint_fill["fill-color"]),"fill-outline-color":new Gn(Pt.paint_fill["fill-outline-color"]),"fill-translate":new Wn(Pt.paint_fill["fill-translate"]),"fill-translate-anchor":new Wn(Pt.paint_fill["fill-translate-anchor"]),"fill-pattern":new qn(Pt.paint_fill["fill-pattern"])})},So=function(t){function e(e){t.call(this,e,Ao)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e){t.prototype.recalculate.call(this,e);var r=this.paint._values["fill-outline-color"];"constant"===r.value.kind&&void 0===r.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},e.prototype.createBucket=function(t){return new Lo(t)},e.prototype.queryRadius=function(){return ki(this.paint.get("fill-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,a,i,o){return pi(Ti(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),i.angle,o),n)},e.prototype.isTileClipped=function(){return!0},e}(Kn),Eo=ea([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,Co=Do;function Do(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(Po,this,e)}function Po(t,e,r){1==t?e.id=r.readVarint():2==t?function(t,e){for(var r=t.readVarint()+t.pos;t.pos<r;){var n=e._keys[t.readVarint()],a=e._values[t.readVarint()];e.properties[n]=a}}(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos)}function Oo(t){for(var e,r,n=0,a=0,i=t.length,o=i-1;a<i;o=a++)e=t[a],n+=((r=t[o]).x-e.x)*(e.y+r.y);return n}Do.types=["Unknown","Point","LineString","Polygon"],Do.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,r=t.readVarint()+t.pos,n=1,i=0,o=0,s=0,l=[];t.pos<r;){if(i<=0){var u=t.readVarint();n=7&u,i=u>>3}if(i--,1===n||2===n)o+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&l.push(e),e=[]),e.push(new a(o,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&l.push(e),l},Do.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,a=0,i=0,o=1/0,s=-1/0,l=1/0,u=-1/0;t.pos<e;){if(n<=0){var c=t.readVarint();r=7&c,n=c>>3}if(n--,1===r||2===r)(a+=t.readSVarint())<o&&(o=a),a>s&&(s=a),(i+=t.readSVarint())<l&&(l=i),i>u&&(u=i);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,u]},Do.prototype.toGeoJSON=function(t,e,r){var n,a,i=this.extent*Math.pow(2,r),o=this.extent*t,s=this.extent*e,l=this.loadGeometry(),u=Do.types[this.type];function c(t){for(var e=0;e<t.length;e++){var r=t[e],n=180-360*(r.y+s)/i;t[e]=[360*(r.x+o)/i-180,360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(n=0;n<l.length;n++)h[n]=l[n][0];c(l=h);break;case 2:for(n=0;n<l.length;n++)c(l[n]);break;case 3:for(l=function(t){var e=t.length;if(e<=1)return[t];for(var r,n,a=[],i=0;i<e;i++){var o=Oo(t[i]);0!==o&&(void 0===n&&(n=o<0),n===o<0?(r&&a.push(r),r=[t[i]]):r.push(t[i]))}return r&&a.push(r),a}(l),n=0;n<l.length;n++)for(a=0;a<l[n].length;a++)c(l[n][a])}1===l.length?l=l[0]:u="Multi"+u;var d={type:"Feature",geometry:{type:u,coordinates:l},properties:this.properties};return"id"in this&&(d.id=this.id),d};var zo=Io;function Io(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(Ro,this,e),this.length=this._features.length}function Ro(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(function(t){for(var e=null,r=t.readVarint()+t.pos;t.pos<r;){var n=t.readVarint()>>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(r))}function Fo(t,e,r){if(3===t){var n=new zo(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}Io.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 Co(this._pbf,e,this.extent,this._keys,this._values)};var No={VectorTile:function(t,e){this.layers=t.readFields(Fo,{},e)},VectorTileFeature:Co,VectorTileLayer:zo},Yo=No.VectorTileFeature.types,jo=Math.pow(2,13);function Bo(t,e,r,n,a,i,o,s){t.emplaceBack(e,r,2*Math.floor(n*jo)+o,a*jo*2,i*jo*2,Math.round(s))}var Ho=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new ia,this.indexArray=new _a,this.programConfigurations=new ni(Eo,t.layers,t.zoom),this.segments=new Fa,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Uo(t,e){return t.x===e.x&&(t.x<0||t.x>oi)||t.y===e.y&&(t.y<0||t.y>oi)}function Vo(t){return t.every((function(t){return t.x<0}))||t.every((function(t){return t.x>oi}))||t.every((function(t){return t.y<0}))||t.every((function(t){return t.y>oi}))}Ho.prototype.populate=function(t,e){this.features=[],this.hasPattern=ko("fill-extrusion",this.layers,e);for(var r=0,n=t;r<n.length;r+=1){var a=n[r],i=a.feature,o=a.index,s=a.sourceLayerIndex;if(this.layers[0]._featureFilter(new Rn(this.zoom),i)){var l=ui(i),u={sourceLayerIndex:s,index:o,geometry:l,properties:i.properties,type:i.type,patterns:{}};void 0!==i.id&&(u.id=i.id),this.hasPattern?this.features.push(To("fill-extrusion",this.layers,u,this.zoom,e)):this.addFeature(u,l,o,{}),e.featureIndex.insert(i,l,o,s,this.index,!0)}}},Ho.prototype.addFeatures=function(t,e){for(var r=0,n=this.features;r<n.length;r+=1){var a=n[r],i=a.geometry;this.addFeature(a,i,a.index,e)}},Ho.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},Ho.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Ho.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Ho.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Eo),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Ho.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Ho.prototype.addFeature=function(t,e,r,n){for(var a=0,i=wo(e,500);a<i.length;a+=1){for(var o=i[a],s=0,l=0,u=o;l<u.length;l+=1)s+=u[l].length;for(var c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),h=0,d=o;h<d.length;h+=1){var f=d[h];if(0!==f.length&&!Vo(f))for(var p=0,m=0;m<f.length;m++){var g=f[m];if(m>=1){var y=f[m-1];if(!Uo(g,y)){c.vertexLength+4>Fa.MAX_VERTEX_ARRAY_LENGTH&&(c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var v=g.sub(y)._perp()._unit(),_=y.dist(g);p+_>32768&&(p=0),Bo(this.layoutVertexArray,g.x,g.y,v.x,v.y,0,0,p),Bo(this.layoutVertexArray,g.x,g.y,v.x,v.y,0,1,p),p+=_,Bo(this.layoutVertexArray,y.x,y.y,v.x,v.y,0,0,p),Bo(this.layoutVertexArray,y.x,y.y,v.x,v.y,0,1,p);var x=c.vertexLength;this.indexArray.emplaceBack(x,x+2,x+1),this.indexArray.emplaceBack(x+1,x+2,x+3),c.vertexLength+=4,c.primitiveLength+=2}}}}if(c.vertexLength+s>Fa.MAX_VERTEX_ARRAY_LENGTH&&(c=this.segments.prepareSegment(s,this.layoutVertexArray,this.indexArray)),"Polygon"===Yo[t.type]){for(var b=[],w=[],M=c.vertexLength,k=0,T=o;k<T.length;k+=1){var L=T[k];if(0!==L.length){L!==o[0]&&w.push(b.length/2);for(var A=0;A<L.length;A++){var S=L[A];Bo(this.layoutVertexArray,S.x,S.y,0,0,1,1,0),b.push(S.x),b.push(S.y)}}}for(var E=qi(b,w),C=0;C<E.length;C+=3)this.indexArray.emplaceBack(M+E[C],M+E[C+2],M+E[C+1]);c.primitiveLength+=E.length/3,c.vertexLength+=s}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,n)},vn("FillExtrusionBucket",Ho,{omit:["layers","features"]});var Wo={paint:new Jn({"fill-extrusion-opacity":new Wn(Pt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Gn(Pt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Wn(Pt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Wn(Pt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new qn(Pt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Gn(Pt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Gn(Pt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Wn(Pt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},Go=function(t){function e(e){t.call(this,e,Wo)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new Ho(t)},e.prototype.queryRadius=function(){return ki(this.paint.get("fill-extrusion-translate"))},e.prototype.is3D=function(){return!0},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,s,l){var u=Ti(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),o.angle,s),c=this.paint.get("fill-extrusion-height").evaluate(e,r),h=this.paint.get("fill-extrusion-base").evaluate(e,r),d=function(t,e,r,n){for(var i=[],o=0,s=t;o<s.length;o+=1){var l=s[o],u=[l.x,l.y,0,1];Di(u,u,e),i.push(new a(u[0]/u[3],u[1]/u[3]))}return i}(u,l),f=function(t,e,r,n){for(var i=[],o=[],s=n[8]*e,l=n[9]*e,u=n[10]*e,c=n[11]*e,h=n[8]*r,d=n[9]*r,f=n[10]*r,p=n[11]*r,m=0,g=t;m<g.length;m+=1){for(var y=[],v=[],_=0,x=g[m];_<x.length;_+=1){var b=x[_],w=b.x,M=b.y,k=n[0]*w+n[4]*M+n[12],T=n[1]*w+n[5]*M+n[13],L=n[2]*w+n[6]*M+n[14],A=n[3]*w+n[7]*M+n[15],S=L+u,E=A+c,C=k+h,D=T+d,P=L+f,O=A+p,z=new a((k+s)/E,(T+l)/E);z.z=S/E,y.push(z);var I=new a(C/O,D/O);I.z=P/O,v.push(I)}i.push(y),o.push(v)}return[i,o]}(n,h,c,l);return function(t,e,r){var n=1/0;pi(r,e)&&(n=Zo(r,e[0]));for(var a=0;a<e.length;a++)for(var i=e[a],o=t[a],s=0;s<i.length-1;s++){var l=i[s],u=i[s+1],c=o[s],h=[l,u,o[s+1],c,l];di(r,h)&&(n=Math.min(n,Zo(r,h)))}return n!==1/0&&n}(f[0],f[1],d)},e}(Kn);function qo(t,e){return t.x*e.x+t.y*e.y}function Zo(t,e){if(1===t.length){var r=e[0],n=e[1],a=e[3],i=t[0],o=n.sub(r),s=a.sub(r),l=i.sub(r),u=qo(o,o),c=qo(o,s),h=qo(s,s),d=qo(l,o),f=qo(l,s),p=u*h-c*c,m=(h*d-c*f)/p,g=(u*f-c*d)/p,y=1-m-g;return r.z*y+n.z*m+a.z*g}for(var v=1/0,_=0,x=e;_<x.length;_+=1){var b=x[_];v=Math.min(v,b.z)}return v}var Xo=ea([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,Jo=No.VectorTileFeature.types,Ko=Math.cos(Math.PI/180*37.5),$o=Math.pow(2,14)/.5;function Qo(t,e,r,n,a,i,o){t.emplaceBack((e.x<<1)+(n?1:0),(e.y<<1)+(a?1:0),Math.round(63*r.x)+128,Math.round(63*r.y)+128,1+(0===i?0:i<0?-1:1)|(.5*o&63)<<2,.5*o>>6)}var ts=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.features=[],this.hasPattern=!1,this.layoutVertexArray=new oa,this.indexArray=new _a,this.programConfigurations=new ni(Xo,t.layers,t.zoom),this.segments=new Fa,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function es(t,e){return(t/e.tileTotal*(e.end-e.start)+e.start)*($o-1)}ts.prototype.populate=function(t,e){this.features=[],this.hasPattern=ko("line",this.layers,e);for(var r=0,n=t;r<n.length;r+=1){var a=n[r],i=a.feature,o=a.index,s=a.sourceLayerIndex;if(this.layers[0]._featureFilter(new Rn(this.zoom),i)){var l=ui(i),u={sourceLayerIndex:s,index:o,geometry:l,properties:i.properties,type:i.type,patterns:{}};void 0!==i.id&&(u.id=i.id),this.hasPattern?this.features.push(To("line",this.layers,u,this.zoom,e)):this.addFeature(u,l,o,{}),e.featureIndex.insert(i,l,o,s,this.index)}}},ts.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},ts.prototype.addFeatures=function(t,e){for(var r=0,n=this.features;r<n.length;r+=1){var a=n[r],i=a.geometry;this.addFeature(a,i,a.index,e)}},ts.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},ts.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},ts.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Xo),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},ts.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},ts.prototype.addFeature=function(t,e,r,n){for(var a=this.layers[0].layout,i=a.get("line-join").evaluate(t,{}),o=a.get("line-cap"),s=a.get("line-miter-limit"),l=a.get("line-round-limit"),u=0,c=e;u<c.length;u+=1){var h=c[u];this.addLine(h,t,i,o,s,l,r,n)}},ts.prototype.addLine=function(t,e,r,n,a,i,o,s){var l=null;e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end")&&(l={start:e.properties.mapbox_clip_start,end:e.properties.mapbox_clip_end,tileTotal:void 0});for(var u="Polygon"===Jo[e.type],c=t.length;c>=2&&t[c-1].equals(t[c-2]);)c--;for(var h=0;h<c-1&&t[h].equals(t[h+1]);)h++;if(!(c<(u?3:2))){l&&(l.tileTotal=function(t,e,r){for(var n,a,i=0,o=h;o<r-1;o++)n=t[o],a=t[o+1],i+=n.dist(a);return i}(t,0,c)),"bevel"===r&&(a=1.05);var d=oi/(512*this.overscaling)*15,f=t[h],p=this.segments.prepareSegment(10*c,this.layoutVertexArray,this.indexArray);this.distance=0;var m,g,y,v=n,_=u?"butt":n,x=!0,b=void 0,w=void 0,M=void 0,k=void 0;this.e1=this.e2=this.e3=-1,u&&(m=t[c-2],k=f.sub(m)._unit()._perp());for(var T=h;T<c;T++)if(!(w=u&&T===c-1?t[h+1]:t[T+1])||!t[T].equals(w)){k&&(M=k),m&&(b=m),m=t[T],k=w?w.sub(m)._unit()._perp():M;var L=(M=M||k).add(k);0===L.x&&0===L.y||L._unit();var A=L.x*k.x+L.y*k.y,S=0!==A?1/A:1/0,E=A<Ko&&b&&w;if(E&&T>h){var C=m.dist(b);if(C>2*d){var D=m.sub(m.sub(b)._mult(d/C)._round());this.distance+=D.dist(b),this.addCurrentVertex(D,this.distance,M.mult(1),0,0,!1,p,l),b=D}}var P=b&&w,O=P?r:w?v:_;if(P&&"round"===O&&(S<i?O="miter":S<=2&&(O="fakeround")),"miter"===O&&S>a&&(O="bevel"),"bevel"===O&&(S>2&&(O="flipbevel"),S<a&&(O="miter")),b&&(this.distance+=m.dist(b)),"miter"===O)L._mult(S),this.addCurrentVertex(m,this.distance,L,0,0,!1,p,l);else if("flipbevel"===O){if(S>100)L=k.clone().mult(-1);else{var z=M.x*k.y-M.y*k.x>0?-1:1,I=S*M.add(k).mag()/M.sub(k).mag();L._perp()._mult(I*z)}this.addCurrentVertex(m,this.distance,L,0,0,!1,p,l),this.addCurrentVertex(m,this.distance,L.mult(-1),0,0,!1,p,l)}else if("bevel"===O||"fakeround"===O){var R=M.x*k.y-M.y*k.x>0,F=-Math.sqrt(S*S-1);if(R?(y=0,g=F):(g=0,y=F),x||this.addCurrentVertex(m,this.distance,M,g,y,!1,p,l),"fakeround"===O){for(var N=Math.floor(8*(.5-(A-.5))),Y=void 0,j=0;j<N;j++)Y=k.mult((j+1)/(N+1))._add(M)._unit(),this.addPieSliceVertex(m,this.distance,Y,R,p,l);this.addPieSliceVertex(m,this.distance,L,R,p,l);for(var B=N-1;B>=0;B--)Y=M.mult((B+1)/(N+1))._add(k)._unit(),this.addPieSliceVertex(m,this.distance,Y,R,p,l)}w&&this.addCurrentVertex(m,this.distance,k,-g,-y,!1,p,l)}else"butt"===O?(x||this.addCurrentVertex(m,this.distance,M,0,0,!1,p,l),w&&this.addCurrentVertex(m,this.distance,k,0,0,!1,p,l)):"square"===O?(x||(this.addCurrentVertex(m,this.distance,M,1,1,!1,p,l),this.e1=this.e2=-1),w&&this.addCurrentVertex(m,this.distance,k,-1,-1,!1,p,l)):"round"===O&&(x||(this.addCurrentVertex(m,this.distance,M,0,0,!1,p,l),this.addCurrentVertex(m,this.distance,M,1,1,!0,p,l),this.e1=this.e2=-1),w&&(this.addCurrentVertex(m,this.distance,k,-1,-1,!0,p,l),this.addCurrentVertex(m,this.distance,k,0,0,!1,p,l)));if(E&&T<c-1){var H=m.dist(w);if(H>2*d){var U=m.add(w.sub(m)._mult(d/H)._round());this.distance+=U.dist(m),this.addCurrentVertex(U,this.distance,k.mult(1),0,0,!1,p,l),m=U}}x=!1}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,s)}},ts.prototype.addCurrentVertex=function(t,e,r,n,a,i,o,s){var l,u=this.layoutVertexArray,c=this.indexArray;s&&(e=es(e,s)),l=r.clone(),n&&l._sub(r.perp()._mult(n)),Qo(u,t,l,i,!1,n,e),this.e3=o.vertexLength++,this.e1>=0&&this.e2>=0&&(c.emplaceBack(this.e1,this.e2,this.e3),o.primitiveLength++),this.e1=this.e2,this.e2=this.e3,l=r.mult(-1),a&&l._sub(r.perp()._mult(a)),Qo(u,t,l,i,!0,-a,e),this.e3=o.vertexLength++,this.e1>=0&&this.e2>=0&&(c.emplaceBack(this.e1,this.e2,this.e3),o.primitiveLength++),this.e1=this.e2,this.e2=this.e3,e>$o/2&&!s&&(this.distance=0,this.addCurrentVertex(t,this.distance,r,n,a,i,o))},ts.prototype.addPieSliceVertex=function(t,e,r,n,a,i){r=r.mult(n?-1:1);var o=this.layoutVertexArray,s=this.indexArray;i&&(e=es(e,i)),Qo(o,t,r,!1,n,0,e),this.e3=a.vertexLength++,this.e1>=0&&this.e2>=0&&(s.emplaceBack(this.e1,this.e2,this.e3),a.primitiveLength++),n?this.e2=this.e3:this.e1=this.e3},vn("LineBucket",ts,{omit:["layers","features"]});var rs=new Jn({"line-cap":new Wn(Pt.layout_line["line-cap"]),"line-join":new Gn(Pt.layout_line["line-join"]),"line-miter-limit":new Wn(Pt.layout_line["line-miter-limit"]),"line-round-limit":new Wn(Pt.layout_line["line-round-limit"])}),ns={paint:new Jn({"line-opacity":new Gn(Pt.paint_line["line-opacity"]),"line-color":new Gn(Pt.paint_line["line-color"]),"line-translate":new Wn(Pt.paint_line["line-translate"]),"line-translate-anchor":new Wn(Pt.paint_line["line-translate-anchor"]),"line-width":new Gn(Pt.paint_line["line-width"]),"line-gap-width":new Gn(Pt.paint_line["line-gap-width"]),"line-offset":new Gn(Pt.paint_line["line-offset"]),"line-blur":new Gn(Pt.paint_line["line-blur"]),"line-dasharray":new Zn(Pt.paint_line["line-dasharray"]),"line-pattern":new qn(Pt.paint_line["line-pattern"]),"line-gradient":new Xn(Pt.paint_line["line-gradient"])}),layout:rs},as=new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new Rn(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,n,a){return r=h({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,a)},e}(Gn))(ns.paint.properties["line-width"].specification);as.useIntegerZoom=!0;var is=function(t){function e(e){t.call(this,e,ns)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&this._updateGradient()},e.prototype._updateGradient=function(){var t=this._transitionablePaint._values["line-gradient"].value.expression;this.gradient=Hi(t,"lineProgress"),this.gradientTexture=null},e.prototype.recalculate=function(e){t.prototype.recalculate.call(this,e),this.paint._values["line-floorwidth"]=as.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new ts(t)},e.prototype.queryRadius=function(t){var e=t,r=os(Mi("line-width",this,e),Mi("line-gap-width",this,e)),n=Mi("line-offset",this,e);return r/2+Math.abs(n)+ki(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,s){var l=Ti(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,s),u=s/2*os(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),c=this.paint.get("line-offset").evaluate(e,r);return c&&(n=function(t,e){for(var r=[],n=new a(0,0),i=0;i<t.length;i++){for(var o=t[i],s=[],l=0;l<o.length;l++){var u=o[l-1],c=o[l],h=o[l+1],d=0===l?n:c.sub(u)._unit()._perp(),f=l===o.length-1?n:h.sub(c)._unit()._perp(),p=d._add(f)._unit(),m=p.x*f.x+p.y*f.y;p._mult(1/m),s.push(p._mult(e)._add(c))}r.push(s)}return r}(n,c*s)),function(t,e,r){for(var n=0;n<e.length;n++){var a=e[n];if(t.length>=3)for(var i=0;i<a.length;i++)if(bi(t,a[i]))return!0;if(mi(t,a,r))return!0}return!1}(l,n,u)},e.prototype.isTileClipped=function(){return!0},e}(Kn);function os(t,e){return e>0?e+2*t:t}var ss=ea([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"}]),ls=ea([{name:"a_projected_pos",components:3,type:"Float32"}],4),us=(ea([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),ea([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),cs=(ea([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"},{type:"Int16",name:"radius"},{type:"Int16",name:"signedDistanceFromAnchor"}]),ea([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),hs=ea([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4);function ds(t,e,r){return t.sections.forEach((function(t){t.text=function(t,e,r){var n=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),In.applyArabicShaping&&(t=In.applyArabicShaping(t)),t}(t.text,e,r)})),t}ea([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"}]),ea([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"radialTextOffset"}]),ea([{type:"Float32",name:"offsetX"}]),ea([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var fs={"!":"︕","#":"",$:"","%":"","&":"","(":"︵",")":"︶","*":"","+":"",",":"︐","-":"︲",".":"・","/":"",":":"︓",";":"︔","<":"︿","=":"",">":"﹀","?":"︖","@":"","[":"﹇","\\":"","]":"﹈","^":"",_:"︳","`":"","{":"︷","|":"―","}":"︸","~":"","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","":"︲","—":"︱","":"﹃","":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","":"︹","":"︺","〖":"︗","〗":"︘","":"︕","":"︵","":"︶","":"︐","":"︲","":"・","":"︓","":"︔","":"︿","":"﹀","":"︖","":"﹇","":"﹈","_":"︳","":"︷","":"―","":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},ps=function(t){function e(e,r,n,a){t.call(this,e,r),this.angle=n,void 0!==a&&(this.segment=a)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.x,this.y,this.angle,this.segment)},e}(a);vn("Anchor",ps);var ms=256;function gs(t,e){var r=e.expression;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new Rn(t+1))};if("source"===r.kind)return{kind:"source"};for(var n=r.zoomStops,a=r.interpolationType,i=0;i<n.length&&n[i]<=t;)i++;for(var o=i=Math.max(0,i-1);o<n.length&&n[o]<t+1;)o++;o=Math.min(n.length-1,o);var s=n[i],l=n[o];return"composite"===r.kind?{kind:"composite",minZoom:s,maxZoom:l,interpolationType:a}:{kind:"camera",minZoom:s,maxZoom:l,minSize:r.evaluate(new Rn(s)),maxSize:r.evaluate(new Rn(l)),interpolationType:a}}function ys(t,e,r){var n=e.uSize,a=e.uSizeT,i=r.lowerSize,o=r.upperSize;return"source"===t.kind?i/ms:"composite"===t.kind?Le(i/ms,o/ms,a):n}function vs(t,e){var r=0,n=0;if("constant"===t.kind)n=t.layoutSize;else if("source"!==t.kind){var a=t.interpolationType,i=t.minZoom,o=t.maxZoom,s=a?u(Ve.interpolationFactor(a,e,i,o),0,1):0;"camera"===t.kind?n=Le(t.minSize,t.maxSize,s):r=s}return{uSizeT:r,uSize:n}}var _s=Object.freeze({getSizeData:gs,evaluateSizeForFeature:ys,evaluateSizeForZoom:vs,SIZE_PACK_FACTOR:ms}),xs=No.VectorTileFeature.types,bs=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function ws(t,e,r,n,a,i,o,s){t.emplaceBack(e,r,Math.round(32*n),Math.round(32*a),i,o,s?s[0]:0,s?s[1]:0)}function Ms(t,e,r){t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r)}var ks=function(t){this.layoutVertexArray=new la,this.indexArray=new _a,this.programConfigurations=t,this.segments=new Fa,this.dynamicLayoutVertexArray=new ua,this.opacityVertexArray=new ca,this.placedSymbolArray=new Aa};ks.prototype.upload=function(t,e,r,n){r&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ss.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,ls.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,bs,!0),this.opacityVertexBuffer.itemSize=1),(r||n)&&this.programConfigurations.upload(t)},ks.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},vn("SymbolBuffers",ks);var Ts=function(t,e,r){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new r,this.segments=new Fa,this.collisionVertexArray=new fa};Ts.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,us.members,!0)},Ts.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},vn("CollisionBuffers",Ts);var Ls=function(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1;var e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=gs(this.zoom,e["text-size"]),this.iconSizeData=gs(this.zoom,e["icon-size"]);var r=this.layers[0].layout,n=r.get("symbol-sort-key"),a=r.get("symbol-z-order");this.sortFeaturesByKey="viewport-y"!==a&&void 0!==n.constantOr(1);var i="viewport-y"===a||"auto"===a&&!this.sortFeaturesByKey;this.sortFeaturesByY=i&&(r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement")),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id})),this.sourceID=t.sourceID};Ls.prototype.createArrays=function(){this.text=new ks(new ni(ss.members,this.layers,this.zoom,(function(t){return/^text/.test(t)}))),this.icon=new ks(new ni(ss.members,this.layers,this.zoom,(function(t){return/^icon/.test(t)}))),this.collisionBox=new Ts(da,cs.members,xa),this.collisionCircle=new Ts(da,hs.members,_a),this.glyphOffsetArray=new Da,this.lineVertexArray=new Oa,this.symbolInstances=new Ea},Ls.prototype.calculateGlyphDependencies=function(t,e,r,n){for(var a=0;a<t.length;a++)if(e[t.charCodeAt(a)]=!0,r&&n){var i=fs[t.charAt(a)];i&&(e[i.charCodeAt(0)]=!0)}},Ls.prototype.populate=function(t,e){var r=this.layers[0],n=r.layout,a=n.get("text-font"),i=n.get("text-field"),o=n.get("icon-image"),s=("constant"!==i.value.kind||i.value.value.toString().length>0)&&("constant"!==a.value.kind||a.value.value.length>0),l="constant"!==o.value.kind||o.value.value&&o.value.value.length>0,u=n.get("symbol-sort-key");if(this.features=[],s||l){for(var c=e.iconDependencies,h=e.glyphDependencies,d=new Rn(this.zoom),f=0,p=t;f<p.length;f+=1){var m=p[f],g=m.feature,y=m.index,v=m.sourceLayerIndex;if(r._featureFilter(d,g)){var _=void 0;if(s){var x=r.getValueAndResolveTokens("text-field",g);_=ds(x instanceof ae?x:ae.fromString(x),r,g)}var b=void 0;if(l&&(b=r.getValueAndResolveTokens("icon-image",g)),_||b){var w=this.sortFeaturesByKey?u.evaluate(g,{}):void 0,M={text:_,icon:b,index:y,sourceLayerIndex:v,geometry:ui(g),properties:g.properties,type:xs[g.type],sortKey:w};if(void 0!==g.id&&(M.id=g.id),this.features.push(M),b&&(c[b]=!0),_)for(var k=a.evaluate(g,{}).join(","),T="map"===n.get("text-rotation-alignment")&&"point"!==n.get("symbol-placement"),L=0,A=_.sections;L<A.length;L+=1){var S=A[L],E=kn(_.toString()),C=S.fontStack||k,D=h[C]=h[C]||{};this.calculateGlyphDependencies(S.text,D,T,E)}}}}"line"===n.get("symbol-placement")&&(this.features=function(t){var e={},r={},n=[],a=0;function i(e){n.push(t[e]),a++}function o(t,e,a){var i=r[t];return delete r[t],r[e]=i,n[i].geometry[0].pop(),n[i].geometry[0]=n[i].geometry[0].concat(a[0]),i}function s(t,r,a){var i=e[r];return delete e[r],e[t]=i,n[i].geometry[0].shift(),n[i].geometry[0]=a[0].concat(n[i].geometry[0]),i}function l(t,e,r){var n=r?e[0][e[0].length-1]:e[0][0];return t+":"+n.x+":"+n.y}for(var u=0;u<t.length;u++){var c=t[u],h=c.geometry,d=c.text?c.text.toString():null;if(d){var f=l(d,h),p=l(d,h,!0);if(f in r&&p in e&&r[f]!==e[p]){var m=s(f,p,h),g=o(f,p,n[m].geometry);delete e[f],delete r[p],r[l(d,n[g].geometry,!0)]=g,n[m].geometry=null}else f in r?o(f,p,h):p in e?s(f,p,h):(i(u),e[f]=a-1,r[p]=a-1)}else i(u)}return n.filter((function(t){return t.geometry}))}(this.features)),this.sortFeaturesByKey&&this.features.sort((function(t,e){return t.sortKey-e.sortKey}))}},Ls.prototype.update=function(t,e,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,r),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,r))},Ls.prototype.isEmpty=function(){return 0===this.symbolInstances.length},Ls.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},Ls.prototype.upload=function(t){this.uploaded||(this.collisionBox.upload(t),this.collisionCircle.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},Ls.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.collisionBox.destroy(),this.collisionCircle.destroy()},Ls.prototype.addToLineVertexArray=function(t,e){var r=this.lineVertexArray.length;if(void 0!==t.segment){for(var n=t.dist(e[t.segment+1]),a=t.dist(e[t.segment]),i={},o=t.segment+1;o<e.length;o++)i[o]={x:e[o].x,y:e[o].y,tileUnitDistanceFromAnchor:n},o<e.length-1&&(n+=e[o+1].dist(e[o]));for(var s=t.segment||0;s>=0;s--)i[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:a},s>0&&(a+=e[s-1].dist(e[s]));for(var l=0;l<e.length;l++){var u=i[l];this.lineVertexArray.emplaceBack(u.x,u.y,u.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}},Ls.prototype.addSymbols=function(t,e,r,n,a,i,o,s,l,u){for(var c=t.indexArray,h=t.layoutVertexArray,d=t.dynamicLayoutVertexArray,f=t.segments.prepareSegment(4*e.length,t.layoutVertexArray,t.indexArray,i.sortKey),p=this.glyphOffsetArray.length,m=f.vertexLength,g=0,y=e;g<y.length;g+=1){var v=y[g],_=v.tl,x=v.tr,b=v.bl,w=v.br,M=v.tex,k=f.vertexLength,T=v.glyphOffset[1];ws(h,s.x,s.y,_.x,T+_.y,M.x,M.y,r),ws(h,s.x,s.y,x.x,T+x.y,M.x+M.w,M.y,r),ws(h,s.x,s.y,b.x,T+b.y,M.x,M.y+M.h,r),ws(h,s.x,s.y,w.x,T+w.y,M.x+M.w,M.y+M.h,r),Ms(d,s,0),c.emplaceBack(k,k+1,k+2),c.emplaceBack(k+1,k+2,k+3),f.vertexLength+=4,f.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(v.glyphOffset[0])}t.placedSymbolArray.emplaceBack(s.x,s.y,p,this.glyphOffsetArray.length-p,m,l,u,s.segment,r?r[0]:0,r?r[1]:0,n[0],n[1],o,!1,0),t.programConfigurations.populatePaintArrays(t.layoutVertexArray.length,i,i.index,{})},Ls.prototype._addCollisionDebugVertex=function(t,e,r,n,a,i){return e.emplaceBack(0,0),t.emplaceBack(r.x,r.y,n,a,Math.round(i.x),Math.round(i.y))},Ls.prototype.addCollisionDebugVertices=function(t,e,r,n,i,o,s,l){var u=i.segments.prepareSegment(4,i.layoutVertexArray,i.indexArray),c=u.vertexLength,h=i.layoutVertexArray,d=i.collisionVertexArray,f=s.anchorX,p=s.anchorY;if(this._addCollisionDebugVertex(h,d,o,f,p,new a(t,e)),this._addCollisionDebugVertex(h,d,o,f,p,new a(r,e)),this._addCollisionDebugVertex(h,d,o,f,p,new a(r,n)),this._addCollisionDebugVertex(h,d,o,f,p,new a(t,n)),u.vertexLength+=4,l){var m=i.indexArray;m.emplaceBack(c,c+1,c+2),m.emplaceBack(c,c+2,c+3),u.primitiveLength+=2}else{var g=i.indexArray;g.emplaceBack(c,c+1),g.emplaceBack(c+1,c+2),g.emplaceBack(c+2,c+3),g.emplaceBack(c+3,c),u.primitiveLength+=4}},Ls.prototype.addDebugCollisionBoxes=function(t,e,r){for(var n=t;n<e;n++){var a=this.collisionBoxArray.get(n),i=a.x1,o=a.y1,s=a.x2,l=a.y2,u=a.radius>0;this.addCollisionDebugVertices(i,o,s,l,u?this.collisionCircle:this.collisionBox,a.anchorPoint,r,u)}},Ls.prototype.generateCollisionDebugBuffers=function(){for(var t=0;t<this.symbolInstances.length;t++){var e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e)}},Ls.prototype._deserializeCollisionBoxesForSymbol=function(t,e,r,n,a){for(var i={},o=e;o<r;o++){var s=t.get(o);if(0===s.radius){i.textBox={x1:s.x1,y1:s.y1,x2:s.x2,y2:s.y2,anchorPointX:s.anchorPointX,anchorPointY:s.anchorPointY},i.textFeatureIndex=s.featureIndex;break}i.textCircles||(i.textCircles=[],i.textFeatureIndex=s.featureIndex),i.textCircles.push(s.anchorPointX,s.anchorPointY,s.radius,s.signedDistanceFromAnchor,1)}for(var l=n;l<a;l++){var u=t.get(l);if(0===u.radius){i.iconBox={x1:u.x1,y1:u.y1,x2:u.x2,y2:u.y2,anchorPointX:u.anchorPointX,anchorPointY:u.anchorPointY},i.iconFeatureIndex=u.featureIndex;break}}return i},Ls.prototype.deserializeCollisionBoxes=function(t){this.collisionArrays=[];for(var e=0;e<this.symbolInstances.length;e++){var r=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,r.textBoxStartIndex,r.textBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex))}},Ls.prototype.hasTextData=function(){return this.text.segments.get().length>0},Ls.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Ls.prototype.hasCollisionBoxData=function(){return this.collisionBox.segments.get().length>0},Ls.prototype.hasCollisionCircleData=function(){return this.collisionCircle.segments.get().length>0},Ls.prototype.addIndicesForPlacedTextSymbol=function(t){for(var e=this.text.placedSymbolArray.get(t),r=e.vertexStartIndex+4*e.numGlyphs,n=e.vertexStartIndex;n<r;n+=4)this.text.indexArray.emplaceBack(n,n+1,n+2),this.text.indexArray.emplaceBack(n+1,n+2,n+3)},Ls.prototype.getSortedSymbolIndexes=function(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;for(var e=Math.sin(t),r=Math.cos(t),n=[],a=[],i=[],o=0;o<this.symbolInstances.length;++o){i.push(o);var s=this.symbolInstances.get(o);n.push(0|Math.round(e*s.anchorX+r*s.anchorY)),a.push(s.featureIndex)}return i.sort((function(t,e){return n[t]-n[e]||a[e]-a[t]})),i},Ls.prototype.sortFeatures=function(t){var e=this;if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,n=this.symbolInstanceIndexes;r<n.length;r+=1){var a=n[r],i=this.symbolInstances.get(a);this.featureSortOrder.push(i.featureIndex),[i.rightJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.leftJustifiedTextSymbolIndex].forEach((function(t,r,n){t>=0&&n.indexOf(t)===r&&e.addIndicesForPlacedTextSymbol(t)})),i.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedTextSymbol(i.verticalPlacedTextSymbolIndex);var o=this.icon.placedSymbolArray.get(a);if(o.numGlyphs){var s=o.vertexStartIndex;this.icon.indexArray.emplaceBack(s,s+1,s+2),this.icon.indexArray.emplaceBack(s+1,s+2,s+3)}}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},vn("SymbolBucket",Ls,{omit:["layers","collisionBoxArray","features","compareText"]}),Ls.MAX_GLYPHS=65535,Ls.addDynamicAttributes=Ms;var As=new Jn({"symbol-placement":new Wn(Pt.layout_symbol["symbol-placement"]),"symbol-spacing":new Wn(Pt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Wn(Pt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Gn(Pt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Wn(Pt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Wn(Pt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Wn(Pt.layout_symbol["icon-ignore-placement"]),"icon-optional":new Wn(Pt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Wn(Pt.layout_symbol["icon-rotation-alignment"]),"icon-size":new Gn(Pt.layout_symbol["icon-size"]),"icon-text-fit":new Wn(Pt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Wn(Pt.layout_symbol["icon-text-fit-padding"]),"icon-image":new Gn(Pt.layout_symbol["icon-image"]),"icon-rotate":new Gn(Pt.layout_symbol["icon-rotate"]),"icon-padding":new Wn(Pt.layout_symbol["icon-padding"]),"icon-keep-upright":new Wn(Pt.layout_symbol["icon-keep-upright"]),"icon-offset":new Gn(Pt.layout_symbol["icon-offset"]),"icon-anchor":new Gn(Pt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Wn(Pt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Wn(Pt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Wn(Pt.layout_symbol["text-rotation-alignment"]),"text-field":new Gn(Pt.layout_symbol["text-field"]),"text-font":new Gn(Pt.layout_symbol["text-font"]),"text-size":new Gn(Pt.layout_symbol["text-size"]),"text-max-width":new Gn(Pt.layout_symbol["text-max-width"]),"text-line-height":new Wn(Pt.layout_symbol["text-line-height"]),"text-letter-spacing":new Gn(Pt.layout_symbol["text-letter-spacing"]),"text-justify":new Gn(Pt.layout_symbol["text-justify"]),"text-radial-offset":new Gn(Pt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Wn(Pt.layout_symbol["text-variable-anchor"]),"text-anchor":new Gn(Pt.layout_symbol["text-anchor"]),"text-max-angle":new Wn(Pt.layout_symbol["text-max-angle"]),"text-rotate":new Gn(Pt.layout_symbol["text-rotate"]),"text-padding":new Wn(Pt.layout_symbol["text-padding"]),"text-keep-upright":new Wn(Pt.layout_symbol["text-keep-upright"]),"text-transform":new Gn(Pt.layout_symbol["text-transform"]),"text-offset":new Gn(Pt.layout_symbol["text-offset"]),"text-allow-overlap":new Wn(Pt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Wn(Pt.layout_symbol["text-ignore-placement"]),"text-optional":new Wn(Pt.layout_symbol["text-optional"])}),Ss={paint:new Jn({"icon-opacity":new Gn(Pt.paint_symbol["icon-opacity"]),"icon-color":new Gn(Pt.paint_symbol["icon-color"]),"icon-halo-color":new Gn(Pt.paint_symbol["icon-halo-color"]),"icon-halo-width":new Gn(Pt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Gn(Pt.paint_symbol["icon-halo-blur"]),"icon-translate":new Wn(Pt.paint_symbol["icon-translate"]),"icon-translate-anchor":new Wn(Pt.paint_symbol["icon-translate-anchor"]),"text-opacity":new Gn(Pt.paint_symbol["text-opacity"]),"text-color":new Gn(Pt.paint_symbol["text-color"]),"text-halo-color":new Gn(Pt.paint_symbol["text-halo-color"]),"text-halo-width":new Gn(Pt.paint_symbol["text-halo-width"]),"text-halo-blur":new Gn(Pt.paint_symbol["text-halo-blur"]),"text-translate":new Wn(Pt.paint_symbol["text-translate"]),"text-translate-anchor":new Wn(Pt.paint_symbol["text-translate-anchor"])}),layout:As},Es=function(t){function e(e){t.call(this,e,Ss)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e){t.prototype.recalculate.call(this,e),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"))},e.prototype.getValueAndResolveTokens=function(t,e){var r,n=this.layout.get(t).evaluate(e,{}),a=this._unevaluatedLayout._values[t];return a.isDataDriven()||Ar(a.value)?n:(r=e.properties,n.replace(/{([^{}]+)}/g,(function(t,e){return e in r?String(r[e]):""})))},e.prototype.createBucket=function(t){return new Ls(t)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e}(Kn),Cs={paint:new Jn({"background-color":new Wn(Pt.paint_background["background-color"]),"background-pattern":new Zn(Pt.paint_background["background-pattern"]),"background-opacity":new Wn(Pt.paint_background["background-opacity"])})},Ds=function(t){function e(e){t.call(this,e,Cs)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Kn),Ps={paint:new Jn({"raster-opacity":new Wn(Pt.paint_raster["raster-opacity"]),"raster-hue-rotate":new Wn(Pt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Wn(Pt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Wn(Pt.paint_raster["raster-brightness-max"]),"raster-saturation":new Wn(Pt.paint_raster["raster-saturation"]),"raster-contrast":new Wn(Pt.paint_raster["raster-contrast"]),"raster-resampling":new Wn(Pt.paint_raster["raster-resampling"]),"raster-fade-duration":new Wn(Pt.paint_raster["raster-fade-duration"])})},Os=function(t){function e(e){t.call(this,e,Ps)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Kn),zs=function(t){function e(e){t.call(this,e,{}),this.implementation=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.is3D=function(){return"3d"===this.implementation.renderingMode},e.prototype.hasOffscreenPass=function(){return void 0!==this.implementation.prerender},e.prototype.recalculate=function(){},e.prototype.updateTransitions=function(){},e.prototype.hasTransition=function(){},e.prototype.serialize=function(){},e.prototype.onAdd=function(t){this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},e.prototype.onRemove=function(t){this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)},e}(Kn),Is={circle:Oi,heatmap:Ui,hillshade:Wi,fill:So,"fill-extrusion":Go,line:is,symbol:Es,background:Ds,raster:Os};function Rs(t){for(var e=0,r=0,n=0,a=t;n<a.length;n+=1){var i=a[n];e+=i.w*i.h,r=Math.max(r,i.w)}t.sort((function(t,e){return e.h-t.h}));for(var o=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],s=0,l=0,u=0,c=t;u<c.length;u+=1)for(var h=c[u],d=o.length-1;d>=0;d--){var f=o[d];if(!(h.w>f.w||h.h>f.h)){if(h.x=f.x,h.y=f.y,l=Math.max(l,h.y+h.h),s=Math.max(s,h.x+h.w),h.w===f.w&&h.h===f.h){var p=o.pop();d<o.length&&(o[d]=p)}else h.h===f.h?(f.x+=h.w,f.w-=h.w):h.w===f.w?(f.y+=h.h,f.h-=h.h):(o.push({x:f.x+h.w,y:f.y,w:f.w-h.w,h:h.h}),f.y+=h.h,f.h-=h.h);break}}return{w:s,h:l,fill:e/(s*l)||0}}var Fs=function(t,e){var r=e.pixelRatio,n=e.version;this.paddedRect=t,this.pixelRatio=r,this.version=n},Ns={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};Ns.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},Ns.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},Ns.tlbr.get=function(){return this.tl.concat(this.br)},Ns.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(Fs.prototype,Ns);var Ys=function(t,e){var r={},n={};this.haveRenderCallbacks=[];var a=[];this.addImages(t,r,a),this.addImages(e,n,a);var i=Rs(a),o=i.w,s=i.h,l=new ji({width:o||1,height:s||1});for(var u in t){var c=t[u],h=r[u].paddedRect;ji.copy(c.data,l,{x:0,y:0},{x:h.x+1,y:h.y+1},c.data)}for(var d in e){var f=e[d],p=n[d].paddedRect,m=p.x+1,g=p.y+1,y=f.data.width,v=f.data.height;ji.copy(f.data,l,{x:0,y:0},{x:m,y:g},f.data),ji.copy(f.data,l,{x:0,y:v-1},{x:m,y:g-1},{width:y,height:1}),ji.copy(f.data,l,{x:0,y:0},{x:m,y:g+v},{width:y,height:1}),ji.copy(f.data,l,{x:y-1,y:0},{x:m-1,y:g},{width:1,height:v}),ji.copy(f.data,l,{x:0,y:0},{x:m+y,y:g},{width:1,height:v})}this.image=l,this.iconPositions=r,this.patternPositions=n};Ys.prototype.addImages=function(t,e,r){for(var n in t){var a=t[n],i={x:0,y:0,w:a.data.width+2,h:a.data.height+2};r.push(i),e[n]=new Fs(i,a),a.hasRenderCallback&&this.haveRenderCallbacks.push(n)}},Ys.prototype.patchUpdatedImages=function(t,e){for(var r in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[r],t.getImage(r),e),this.patchUpdatedImage(this.patternPositions[r],t.getImage(r),e)},Ys.prototype.patchUpdatedImage=function(t,e,r){if(t&&e&&t.version!==e.version){t.version=e.version;var n=t.tl,a=n[0],i=n[1];r.update(e.data,void 0,{x:a,y:i})}},vn("ImagePosition",Fs),vn("ImageAtlas",Ys);var js=self.HTMLImageElement,Bs=self.HTMLCanvasElement,Hs=self.HTMLVideoElement,Us=self.ImageData,Vs=function(t,e,r,n){this.context=t,this.format=r,this.texture=t.gl.createTexture(),this.update(e,n)};Vs.prototype.update=function(t,e,r){var n=t.width,a=t.height,i=!(this.size&&this.size[0]===n&&this.size[1]===a||r),o=this.context,s=o.gl;if(this.useMipmap=Boolean(e&&e.useMipmap),s.bindTexture(s.TEXTURE_2D,this.texture),o.pixelStoreUnpackFlipY.set(!1),o.pixelStoreUnpack.set(1),o.pixelStoreUnpackPremultiplyAlpha.set(this.format===s.RGBA&&(!e||!1!==e.premultiply)),i)this.size=[n,a],t instanceof js||t instanceof Bs||t instanceof Hs||t instanceof Us?s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,s.UNSIGNED_BYTE,t):s.texImage2D(s.TEXTURE_2D,0,this.format,n,a,0,this.format,s.UNSIGNED_BYTE,t.data);else{var l=r||{x:0,y:0},u=l.x,c=l.y;t instanceof js||t instanceof Bs||t instanceof Hs||t instanceof Us?s.texSubImage2D(s.TEXTURE_2D,0,u,c,s.RGBA,s.UNSIGNED_BYTE,t):s.texSubImage2D(s.TEXTURE_2D,0,u,c,n,a,s.RGBA,s.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&s.generateMipmap(s.TEXTURE_2D)},Vs.prototype.bind=function(t,e,r){var n=this.context.gl;n.bindTexture(n.TEXTURE_2D,this.texture),r!==n.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=n.LINEAR),t!==this.filter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,r||t),this.filter=t),e!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,e),this.wrap=e)},Vs.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},Vs.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var Ws=function(t,e,r,n,a){var i,o,s=8*a-n-1,l=(1<<s)-1,u=l>>1,c=-7,h=r?a-1:0,d=r?-1:1,f=t[e+h];for(h+=d,i=f&(1<<-c)-1,f>>=-c,c+=s;c>0;i=256*i+t[e+h],h+=d,c-=8);for(o=i&(1<<-c)-1,i>>=-c,c+=n;c>0;o=256*o+t[e+h],h+=d,c-=8);if(0===i)i=1-u;else{if(i===l)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),i-=u}return(f?-1:1)*o*Math.pow(2,i-n)},Gs=function(t,e,r,n,a,i){var o,s,l,u=8*i-a-1,c=(1<<u)-1,h=c>>1,d=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:i-1,p=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=c?(s=0,o=c):o+h>=1?(s=(e*l-1)*Math.pow(2,a),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,a),o=0));a>=8;t[r+f]=255&s,f+=p,s/=256,a-=8);for(o=o<<a|s,u+=a;u>0;t[r+f]=255&o,f+=p,o/=256,u-=8);t[r+f-p]|=128*m},qs=Zs;function Zs(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}function Xs(t){return t.type===Zs.Bytes?t.readVarint()+t.pos:t.pos+1}function Js(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Ks(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var a=r.pos-1;a>=t;a--)r.buf[a+n]=r.buf[a]}function $s(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function Qs(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function tl(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function el(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function rl(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function nl(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function al(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function il(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function ol(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function sl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function ll(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function ul(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}Zs.Varint=0,Zs.Fixed64=1,Zs.Bytes=2,Zs.Fixed32=5,Zs.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),a=n>>3,i=this.pos;this.type=7&n,t(a,e,this),this.pos===i&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=sl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=ul(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=sl(this.buf,this.pos)+4294967296*sl(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=sl(this.buf,this.pos)+4294967296*ul(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Ws(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Ws(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,a,i=r.buf;if(n=(112&(a=i[r.pos++]))>>4,a<128)return Js(t,n,e);if(n|=(127&(a=i[r.pos++]))<<3,a<128)return Js(t,n,e);if(n|=(127&(a=i[r.pos++]))<<10,a<128)return Js(t,n,e);if(n|=(127&(a=i[r.pos++]))<<17,a<128)return Js(t,n,e);if(n|=(127&(a=i[r.pos++]))<<24,a<128)return Js(t,n,e);if(n|=(1&(a=i[r.pos++]))<<31,a<128)return Js(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=function(t,e,r){for(var n="",a=e;a<r;){var i,o,s,l=t[a],u=null,c=l>239?4:l>223?3:l>191?2:1;if(a+c>r)break;1===c?l<128&&(u=l):2===c?128==(192&(i=t[a+1]))&&(u=(31&l)<<6|63&i)<=127&&(u=null):3===c?(i=t[a+1],o=t[a+2],128==(192&i)&&128==(192&o)&&((u=(15&l)<<12|(63&i)<<6|63&o)<=2047||u>=55296&&u<=57343)&&(u=null)):4===c&&(i=t[a+1],o=t[a+2],s=t[a+3],128==(192&i)&&128==(192&o)&&128==(192&s)&&((u=(15&l)<<18|(63&i)<<12|(63&o)<<6|63&s)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,c=1):u>65535&&(u-=65536,n+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),n+=String.fromCharCode(u),a+=c}return n}(this.buf,this.pos,t);return this.pos=t,e},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Zs.Bytes)return t.push(this.readVarint(e));var r=Xs(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Zs.Bytes)return t.push(this.readSVarint());var e=Xs(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Zs.Bytes)return t.push(this.readBoolean());var e=Xs(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Zs.Bytes)return t.push(this.readFloat());var e=Xs(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Zs.Bytes)return t.push(this.readDouble());var e=Xs(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Zs.Bytes)return t.push(this.readFixed32());var e=Xs(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Zs.Bytes)return t.push(this.readSFixed32());var e=Xs(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Zs.Bytes)return t.push(this.readFixed64());var e=Xs(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Zs.Bytes)return t.push(this.readSFixed64());var e=Xs(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Zs.Varint)for(;this.buf[this.pos++]>127;);else if(e===Zs.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Zs.Fixed32)this.pos+=4;else{if(e!==Zs.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),ll(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),ll(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),ll(this.buf,-1&t,this.pos),ll(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),ll(this.buf,-1&t,this.pos),ll(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var r,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,a,i=0;i<e.length;i++){if((n=e.charCodeAt(i))>55295&&n<57344){if(!a){n>56319||i+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):a=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,a=n;continue}n=a-55296<<10|n-56320|65536,a=null}else a&&(t[r++]=239,t[r++]=191,t[r++]=189,a=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&Ks(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),Gs(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Gs(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&Ks(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,Zs.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,$s,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Qs,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,rl,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,tl,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,el,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,nl,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,al,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,il,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,ol,e)},writeBytesField:function(t,e){this.writeTag(t,Zs.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Zs.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Zs.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Zs.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Zs.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Zs.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Zs.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Zs.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Zs.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Zs.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};function cl(t,e,r){1===t&&r.readMessage(hl,e)}function hl(t,e,r){if(3===t){var n=r.readMessage(dl,{}),a=n.id,i=n.bitmap,o=n.width,s=n.height,l=n.left,u=n.top,c=n.advance;e.push({id:a,bitmap:new Yi({width:o+6,height:s+6},i),metrics:{width:o,height:s,left:l,top:u,advance:c}})}}function dl(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}var fl=function(t,e,r){this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.callbackID=0,g(["receive"],this),this.target.addEventListener("message",this.receive,!1)};function pl(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]}fl.prototype.send=function(t,e,r,n){var a=this,i=r?this.mapId+":"+this.callbackID++:null;r&&(this.callbacks[i]=r);var o=[];if(this.target.postMessage({targetMapId:n,sourceMapId:this.mapId,type:t,id:String(i),data:xn(e,o)},o),r)return{cancel:function(){a.callbacks[i]=null,a.target.postMessage({targetMapId:n,sourceMapId:a.mapId,type:"<cancel>",id:String(i)})}}},fl.prototype.receive=function(t){var e,r=this,n=t.data,a=n.id;if(!n.targetMapId||this.mapId===n.targetMapId){var i=function(t,e){delete r.callbacks[a];var n=[];r.target.postMessage({sourceMapId:r.mapId,type:"<response>",id:String(a),error:t?xn(t):null,data:xn(e,n)},n)};if("<response>"===n.type||"<cancel>"===n.type)e=this.callbacks[n.id],delete this.callbacks[n.id],e&&n.error?e(bn(n.error)):e&&e(null,bn(n.data));else if(void 0!==n.id&&this.parent[n.type]){this.callbacks[n.id]=null;var o=this.parent[n.type](n.sourceMapId,bn(n.data),i);o&&null===this.callbacks[n.id]&&(this.callbacks[n.id]=o.cancel)}else if(void 0!==n.id&&this.parent.getWorkerSource){var s=n.type.split("."),l=bn(n.data);this.parent.getWorkerSource(n.sourceMapId,s[0],l.source)[s[1]](l,i)}else this.parent[n.type](bn(n.data))}},fl.prototype.remove=function(){this.target.removeEventListener("message",this.receive,!1)};var ml=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};ml.prototype.setNorthEast=function(t){return this._ne=t instanceof gl?new gl(t.lng,t.lat):gl.convert(t),this},ml.prototype.setSouthWest=function(t){return this._sw=t instanceof gl?new gl(t.lng,t.lat):gl.convert(t),this},ml.prototype.extend=function(t){var e,r,n=this._sw,a=this._ne;if(t instanceof gl)e=t,r=t;else{if(!(t instanceof ml))return Array.isArray(t)?t.every(Array.isArray)?this.extend(ml.convert(t)):this.extend(gl.convert(t)):this;if(e=t._sw,r=t._ne,!e||!r)return this}return n||a?(n.lng=Math.min(e.lng,n.lng),n.lat=Math.min(e.lat,n.lat),a.lng=Math.max(r.lng,a.lng),a.lat=Math.max(r.lat,a.lat)):(this._sw=new gl(e.lng,e.lat),this._ne=new gl(r.lng,r.lat)),this},ml.prototype.getCenter=function(){return new gl((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},ml.prototype.getSouthWest=function(){return this._sw},ml.prototype.getNorthEast=function(){return this._ne},ml.prototype.getNorthWest=function(){return new gl(this.getWest(),this.getNorth())},ml.prototype.getSouthEast=function(){return new gl(this.getEast(),this.getSouth())},ml.prototype.getWest=function(){return this._sw.lng},ml.prototype.getSouth=function(){return this._sw.lat},ml.prototype.getEast=function(){return this._ne.lng},ml.prototype.getNorth=function(){return this._ne.lat},ml.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},ml.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},ml.prototype.isEmpty=function(){return!(this._sw&&this._ne)},ml.convert=function(t){return!t||t instanceof ml?t:new ml(t)};var gl=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};function yl(t){return 2*Math.PI*6378137*Math.cos(t*Math.PI/180)}function vl(t){return(180+t)/360}function _l(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function xl(t,e){return t/yl(e)}function bl(t){var e=180-360*t;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}gl.prototype.wrap=function(){return new gl(c(this.lng,-180,180),this.lat)},gl.prototype.toArray=function(){return[this.lng,this.lat]},gl.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},gl.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new ml(new gl(this.lng-r,this.lat-e),new gl(this.lng+r,this.lat+e))},gl.convert=function(t){if(t instanceof gl)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new gl(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new gl(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")};var wl=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};wl.fromLngLat=function(t,e){void 0===e&&(e=0);var r=gl.convert(t);return new wl(vl(r.lng),_l(r.lat),xl(e,r.lat))},wl.prototype.toLngLat=function(){return new gl(360*this.x-180,bl(this.y))},wl.prototype.toAltitude=function(){return this.z*yl(bl(this.y))};var Ml=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=Ll(0,t,e,r)};Ml.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Ml.prototype.url=function(t,e){var r,n,a,i,o,s=(r=this.x,n=this.y,a=this.z,i=pl(256*r,256*(n=Math.pow(2,a)-n-1),a),o=pl(256*(r+1),256*(n+1),a),i[0]+","+i[1]+","+o[0]+","+o[1]),l=function(t,e,r){for(var n,a="",i=t;i>0;i--)a+=(e&(n=1<<i-1)?1:0)+(r&n?2:0);return a}(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String("tms"===e?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",l).replace("{bbox-epsg-3857}",s)},Ml.prototype.getTilePoint=function(t){var e=Math.pow(2,this.z);return new a((t.x*e-this.x)*oi,(t.y*e-this.y)*oi)};var kl=function(t,e){this.wrap=t,this.canonical=e,this.key=Ll(t,e.z,e.x,e.y)},Tl=function(t,e,r,n,a){this.overscaledZ=t,this.wrap=e,this.canonical=new Ml(r,+n,+a),this.key=Ll(e,t,n,a)};function Ll(t,e,r,n){(t*=2)<0&&(t=-1*t-1);var a=1<<e;return 32*(a*a*t+a*n+r)+e}Tl.prototype.equals=function(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)},Tl.prototype.scaledTo=function(t){var e=this.canonical.z-t;return t>this.canonical.z?new Tl(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Tl(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Tl.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e},Tl.prototype.children=function(t){if(this.overscaledZ>=t)return[new Tl(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new Tl(e,this.wrap,e,r,n),new Tl(e,this.wrap,e,r+1,n),new Tl(e,this.wrap,e,r,n+1),new Tl(e,this.wrap,e,r+1,n+1)]},Tl.prototype.isLessThan=function(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))},Tl.prototype.wrapped=function(){return new Tl(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},Tl.prototype.unwrapTo=function(t){return new Tl(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)},Tl.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},Tl.prototype.toUnwrapped=function(){return new kl(this.wrap,this.canonical)},Tl.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},Tl.prototype.getTilePoint=function(t){return this.canonical.getTilePoint(new wl(t.x-this.wrap,t.y))},vn("CanonicalTileID",Ml),vn("OverscaledTileID",Tl,{omit:["posMatrix"]});var Al=function(t,e,r){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return w('"'+r+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');var n=this.dim=e.height;this.stride=this.dim+2,this.data=new Int32Array(this.stride*this.stride);for(var a=e.data,i="terrarium"===r?this._unpackTerrarium:this._unpackMapbox,o=0;o<n;o++)for(var s=0;s<n;s++){var l=4*(o*n+s);this.set(s,o,i(a[l],a[l+1],a[l+2]))}for(var u=0;u<n;u++)this.set(-1,u,this.get(0,u)),this.set(n,u,this.get(n-1,u)),this.set(u,-1,this.get(u,0)),this.set(u,n,this.get(u,n-1));this.set(-1,-1,this.get(0,0)),this.set(n,-1,this.get(n-1,0)),this.set(-1,n,this.get(0,n-1)),this.set(n,n,this.get(n-1,n-1))};Al.prototype.set=function(t,e,r){this.data[this._idx(t,e)]=r+65536},Al.prototype.get=function(t,e){return this.data[this._idx(t,e)]-65536},Al.prototype._idx=function(t,e){if(t<-1||t>=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},Al.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},Al.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},Al.prototype.getPixels=function(){return new ji({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Al.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var n=e*this.dim,a=e*this.dim+this.dim,i=r*this.dim,o=r*this.dim+this.dim;switch(e){case-1:n=a-1;break;case 1:a=n+1}switch(r){case-1:i=o-1;break;case 1:o=i+1}for(var s=-e*this.dim,l=-r*this.dim,u=i;u<o;u++)for(var c=n;c<a;c++)this.set(c,u,t.get(c+s,u+l))},vn("DEMData",Al);var Sl=ea([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),El=function(t){this._stringToNumber={},this._numberToString=[];for(var e=0;e<t.length;e++){var r=t[e];this._stringToNumber[r]=e,this._numberToString[e]=r}};El.prototype.encode=function(t){return this._stringToNumber[t]},El.prototype.decode=function(t){return this._numberToString[t]};var Cl=function(t,e,r,n){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,null!=t.id&&(this.id=t.id)},Dl={geometry:{configurable:!0}};Dl.geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},Dl.geometry.set=function(t){this._geometry=t},Cl.prototype.toJSON=function(){var t={geometry:this.geometry};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&(t[e]=this[e]);return t},Object.defineProperties(Cl.prototype,Dl);var Pl=function(){this.state={},this.stateChanges={},this.deletedStates={}};Pl.prototype.updateState=function(t,e,r){var n=String(e);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][n]=this.stateChanges[t][n]||{},h(this.stateChanges[t][n],r),null===this.deletedStates[t])for(var a in this.deletedStates[t]={},this.state[t])a!==n&&(this.deletedStates[t][a]=null);else if(this.deletedStates[t]&&null===this.deletedStates[t][n])for(var i in this.deletedStates[t][n]={},this.state[t][n])r[i]||(this.deletedStates[t][n][i]=null);else for(var o in r)this.deletedStates[t]&&this.deletedStates[t][n]&&null===this.deletedStates[t][n][o]&&delete this.deletedStates[t][n][o]},Pl.prototype.removeFeatureState=function(t,e,r){if(null!==this.deletedStates[t]){var n=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},r&&void 0!==e&&e>=0)null!==this.deletedStates[t][n]&&(this.deletedStates[t][n]=this.deletedStates[t][n]||{},this.deletedStates[t][n][r]=null);else if(void 0!==e&&e>=0)if(this.stateChanges[t]&&this.stateChanges[t][n])for(r in this.deletedStates[t][n]={},this.stateChanges[t][n])this.deletedStates[t][n][r]=null;else this.deletedStates[t][n]=null;else this.deletedStates[t]=null}},Pl.prototype.getState=function(t,e){var r=String(e),n=this.state[t]||{},a=this.stateChanges[t]||{},i=h({},n[r],a[r]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){var o=this.deletedStates[t][e];if(null===o)return{};for(var s in o)delete i[s]}return i},Pl.prototype.initializeTileState=function(t,e){t.setFeatureState(this.state,e)},Pl.prototype.coalesceChanges=function(t,e){var r={};for(var n in this.stateChanges){this.state[n]=this.state[n]||{};var a={};for(var i in this.stateChanges[n])this.state[n][i]||(this.state[n][i]={}),h(this.state[n][i],this.stateChanges[n][i]),a[i]=this.state[n][i];r[n]=a}for(var o in this.deletedStates){this.state[o]=this.state[o]||{};var s={};if(null===this.deletedStates[o])for(var l in this.state[o])s[l]={},this.state[o][l]={};else for(var u in this.deletedStates[o]){if(null===this.deletedStates[o][u])this.state[o][u]={};else for(var c=0,d=Object.keys(this.deletedStates[o][u]);c<d.length;c+=1){var f=d[c];delete this.state[o][u][f]}s[u]=this.state[o][u]}r[o]=r[o]||{},h(r[o],s)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(r).length)for(var p in t)t[p].setFeatureState(r,e)};var Ol=function(t,e,r){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=e||new pn(oi,16,0),this.grid3D=new pn(oi,16,0),this.featureIndexArray=r||new Ia};function zl(t){for(var e=1/0,r=1/0,n=-1/0,a=-1/0,i=0,o=t;i<o.length;i+=1){var s=o[i];e=Math.min(e,s.x),r=Math.min(r,s.y),n=Math.max(n,s.x),a=Math.max(a,s.y)}return{minX:e,minY:r,maxX:n,maxY:a}}function Il(t,e){return e-t}Ol.prototype.insert=function(t,e,r,n,a,i){var o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,n,a);for(var s=i?this.grid3D:this.grid,l=0;l<e.length;l++){for(var u=e[l],c=[1/0,1/0,-1/0,-1/0],h=0;h<u.length;h++){var d=u[h];c[0]=Math.min(c[0],d.x),c[1]=Math.min(c[1],d.y),c[2]=Math.max(c[2],d.x),c[3]=Math.max(c[3],d.y)}c[0]<oi&&c[1]<oi&&c[2]>=0&&c[3]>=0&&s.insert(o,c[0],c[1],c[2],c[3])}},Ol.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new No.VectorTile(new qs(this.rawTileData)).layers,this.sourceLayerCoder=new El(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Ol.prototype.query=function(t,e,r){var n=this;this.loadVTLayers();for(var i=t.params||{},o=oi/t.tileSize/t.scale,s=Br(i.filter),l=t.queryGeometry,u=t.queryPadding*o,c=zl(l),h=this.grid.query(c.minX-u,c.minY-u,c.maxX+u,c.maxY+u),d=zl(t.cameraQueryGeometry),f=0,p=this.grid3D.query(d.minX-u,d.minY-u,d.maxX+u,d.maxY+u,(function(e,r,n,i){return function(t,e,r,n,i){for(var o=0,s=t;o<s.length;o+=1){var l=s[o];if(e<=l.x&&r<=l.y&&n>=l.x&&i>=l.y)return!0}var u=[new a(e,r),new a(e,i),new a(n,i),new a(n,r)];if(t.length>2)for(var c=0,h=u;c<h.length;c+=1)if(bi(t,h[c]))return!0;for(var d=0;d<t.length-1;d++)if(wi(t[d],t[d+1],u))return!0;return!1}(t.cameraQueryGeometry,e-u,r-u,n+u,i+u)}));f<p.length;f+=1){var m=p[f];h.push(m)}h.sort(Il);for(var g,y={},v=function(a){var u=h[a];if(u!==g){g=u;var c=n.featureIndexArray.get(u),d=null;n.loadMatchingFeature(y,c.bucketIndex,c.sourceLayerIndex,c.featureIndex,s,i.layers,e,(function(e,a){d||(d=ui(e));var i={};return e.id&&(i=r.getState(a.sourceLayer||"_geojsonTileLayer",e.id)),a.queryIntersectsFeature(l,e,i,d,n.z,t.transform,o,t.pixelPosMatrix)}))}},_=0;_<h.length;_++)v(_);return y},Ol.prototype.loadMatchingFeature=function(t,e,r,n,a,i,o,s){var l=this.bucketLayerIDs[e];if(!i||function(t,e){for(var r=0;r<t.length;r++)if(e.indexOf(t[r])>=0)return!0;return!1}(i,l)){var u=this.sourceLayerCoder.decode(r),c=this.vtLayers[u].feature(n);if(a(new Rn(this.tileID.overscaledZ),c))for(var h=0;h<l.length;h++){var d=l[h];if(!(i&&i.indexOf(d)<0)){var f=o[d];if(f){var p=!s||s(c,f);if(p){var m=new Cl(c,this.z,this.x,this.y);m.layer=f.serialize();var g=t[d];void 0===g&&(g=t[d]=[]),g.push({featureIndex:n,feature:m,intersectionZ:p})}}}}}},Ol.prototype.lookupSymbolFeatures=function(t,e,r,n,a,i){var o={};this.loadVTLayers();for(var s=Br(n),l=0,u=t;l<u.length;l+=1){var c=u[l];this.loadMatchingFeature(o,e,r,c,s,a,i)}return o},Ol.prototype.hasLayer=function(t){for(var e=0,r=this.bucketLayerIDs;e<r.length;e+=1)for(var n=0,a=r[e];n<a.length;n+=1)if(t===a[n])return!0;return!1},vn("FeatureIndex",Ol,{omit:["rawTileData","sourceLayerCoder"]});var Rl=function(t,e){this.tileID=t,this.uid=f(),this.uses=0,this.tileSize=e,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.expiredRequestCount=0,this.state="loading"};Rl.prototype.registerFadeDuration=function(t){var e=t+this.timeAdded;e<O.now()||this.fadeEndTime&&e<this.fadeEndTime||(this.fadeEndTime=e)},Rl.prototype.wasRequested=function(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state},Rl.prototype.loadVectorData=function(t,e,r){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){for(var n in t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(t,e){var r={};if(!e)return r;for(var n=function(){var t=i[a],n=t.layerIds.map((function(t){return e.getLayer(t)})).filter(Boolean);if(0!==n.length){t.layers=n,t.stateDependentLayerIds&&(t.stateDependentLayers=t.stateDependentLayerIds.map((function(t){return n.filter((function(e){return e.id===t}))[0]})));for(var o=0,s=n;o<s.length;o+=1){var l=s[o];r[l.id]=t}}},a=0,i=t;a<i.length;a+=1)n();return r}(t.buckets,e.style),this.hasSymbolBuckets=!1,this.buckets){var a=this.buckets[n];if(a instanceof Ls){if(this.hasSymbolBuckets=!0,!r)break;a.justReloaded=!0}}for(var i in this.queryPadding=0,this.buckets){var o=this.buckets[i];this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(i).queryRadius(o))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new Ta},Rl.prototype.unloadVectorData=function(){for(var t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},Rl.prototype.unloadDEMData=function(){this.dem=null,this.neighboringTiles=null,this.state="unloaded"},Rl.prototype.getBucket=function(t){return this.buckets[t.id]},Rl.prototype.upload=function(t){for(var e in this.buckets){var r=this.buckets[e];r.uploadPending()&&r.upload(t)}var n=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Vs(t,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Vs(t,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)},Rl.prototype.prepare=function(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)},Rl.prototype.queryRenderedFeatures=function(t,e,r,n,a,i,o,s,l){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:r,cameraQueryGeometry:n,scale:a,tileSize:this.tileSize,pixelPosMatrix:l,transform:o,params:i,queryPadding:this.queryPadding*s},t,e):{}},Rl.prototype.querySourceFeatures=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData){var r=this.latestFeatureIndex.loadVTLayers(),n=e?e.sourceLayer:"",a=r._geojsonTileLayer||r[n];if(a)for(var i=Br(e&&e.filter),o=this.tileID.canonical,s=o.z,l=o.x,u=o.y,c={z:s,x:l,y:u},h=0;h<a.length;h++){var d=a.feature(h);if(i(new Rn(this.tileID.overscaledZ),d)){var f=new Cl(d,s,l,u);f.tile=c,t.push(f)}}}},Rl.prototype.clearMask=function(){this.segments&&(this.segments.destroy(),delete this.segments),this.maskedBoundsBuffer&&(this.maskedBoundsBuffer.destroy(),delete this.maskedBoundsBuffer),this.maskedIndexBuffer&&(this.maskedIndexBuffer.destroy(),delete this.maskedIndexBuffer)},Rl.prototype.setMask=function(t,e){if(!o(this.mask,t)&&(this.mask=t,this.clearMask(),!o(t,{0:!0}))){var r=new aa,n=new _a;this.segments=new Fa,this.segments.prepareSegment(0,r,n);for(var i=Object.keys(t),s=0;s<i.length;s++){var l=t[+i[s]],u=oi>>l.z,c=new a(l.x*u,l.y*u),h=new a(c.x+u,c.y+u),d=this.segments.prepareSegment(4,r,n);r.emplaceBack(c.x,c.y,c.x,c.y),r.emplaceBack(h.x,c.y,h.x,c.y),r.emplaceBack(c.x,h.y,c.x,h.y),r.emplaceBack(h.x,h.y,h.x,h.y);var f=d.vertexLength;n.emplaceBack(f,f+1,f+2),n.emplaceBack(f+1,f+2,f+3),d.vertexLength+=4,d.primitiveLength+=2}this.maskedBoundsBuffer=e.createVertexBuffer(r,Sl.members),this.maskedIndexBuffer=e.createIndexBuffer(n)}},Rl.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state},Rl.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},Rl.prototype.setExpiryData=function(t){var e=this.expirationTime;if(t.cacheControl){var r=T(t.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){var n=Date.now(),a=!1;if(this.expirationTime>n)a=!1;else if(e)if(this.expirationTime<e)a=!0;else{var i=this.expirationTime-e;i?this.expirationTime=n+Math.max(i,3e4):a=!0}else a=!0;a?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},Rl.prototype.getExpiryTimeout=function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)},Rl.prototype.setFeatureState=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&0!==Object.keys(t).length){var r=this.latestFeatureIndex.loadVTLayers();for(var n in this.buckets){var a=this.buckets[n],i=a.layers[0].sourceLayer||"_geojsonTileLayer",o=r[i],s=t[i];o&&s&&0!==Object.keys(s).length&&(a.update(s,o,this.imageAtlas&&this.imageAtlas.patternPositions||{}),e&&e.style&&(this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(n).queryRadius(a))))}}},Rl.prototype.holdingForFade=function(){return void 0!==this.symbolFadeHoldUntil},Rl.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<O.now()},Rl.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},Rl.prototype.setHoldDuration=function(t){this.symbolFadeHoldUntil=O.now()+t};var Fl=24,Nl={horizontal:1,vertical:2,horizontalOnly:3},Yl=function(){this.text="",this.sectionIndex=[],this.sections=[]};function jl(t,e,r,n,a,i,o,s,l,u){var c,h=Yl.fromFeature(t,r);u===Nl.vertical&&h.verticalizePunctuation();var d=In.processBidirectionalText,f=In.processStyledBidirectionalText;if(d&&1===h.sections.length){c=[];for(var p=0,m=d(h.toString(),Gl(h,s,n,e));p<m.length;p+=1){var g=m[p],y=new Yl;y.text=g,y.sections=h.sections;for(var v=0;v<g.length;v++)y.sectionIndex.push(0);c.push(y)}}else if(f){c=[];for(var _=0,x=f(h.text,h.sectionIndex,Gl(h,s,n,e));_<x.length;_+=1){var b=x[_],w=new Yl;w.text=b[0],w.sectionIndex=b[1],w.sections=h.sections,c.push(w)}}else c=function(t,e){for(var r=[],n=t.text,a=0,i=0,o=e;i<o.length;i+=1){var s=o[i];r.push(t.substring(a,s)),a=s}return a<n.length&&r.push(t.substring(a,n.length)),r}(h,Gl(h,s,n,e));var M=[],k={positionedGlyphs:M,text:h.toString(),top:l[1],bottom:l[1],left:l[0],right:l[0],writingMode:u,lineCount:c.length};return function(t,e,r,n,a,i,o,s){for(var l=0,u=-17,c=0,h=t.positionedGlyphs,d="right"===i?1:"left"===i?0:.5,f=0,p=r;f<p.length;f+=1){var m=p[f];m.trim();var g=m.getMaxScale();if(m.length()){for(var y=h.length,v=0;v<m.length();v++){var _=m.getSection(v),x=m.getCharCode(v),b=24*(g-_.scale),w=e[_.fontStack],M=w&&w[x];M&&(An(x)&&o!==Nl.horizontal?(h.push({glyph:x,x:l,y:b,vertical:!0,scale:_.scale,fontStack:_.fontStack}),l+=Fl*_.scale+s):(h.push({glyph:x,x:l,y:u+b,vertical:!1,scale:_.scale,fontStack:_.fontStack}),l+=M.metrics.advance*_.scale+s))}if(h.length!==y){var k=l-s;c=Math.max(k,c),Zl(h,e,y,h.length-1,d)}l=0,u+=n*g}else u+=n}var T=ql(a),L=T.horizontalAlign,A=T.verticalAlign;!function(t,e,r,n,a,i,o){for(var s=(e-r)*a,l=(-n*o+.5)*i,u=0;u<t.length;u++)t[u].x+=s,t[u].y+=l}(h,d,L,A,c,n,r.length);var S=u- -17;t.top+=-A*S,t.bottom=t.top+S,t.left+=-L*c,t.right=t.left+c}(k,e,c,a,i,o,u,s),!!M.length&&k}Yl.fromFeature=function(t,e){for(var r=new Yl,n=0;n<t.sections.length;n++){var a=t.sections[n];r.sections.push({scale:a.scale||1,fontStack:a.fontStack||e}),r.text+=a.text;for(var i=0;i<a.text.length;i++)r.sectionIndex.push(n)}return r},Yl.prototype.length=function(){return this.text.length},Yl.prototype.getSection=function(t){return this.sections[this.sectionIndex[t]]},Yl.prototype.getCharCode=function(t){return this.text.charCodeAt(t)},Yl.prototype.verticalizePunctuation=function(){this.text=function(t){for(var e="",r=0;r<t.length;r++){var n=t.charCodeAt(r+1)||null,a=t.charCodeAt(r-1)||null;n&&Sn(n)&&!fs[t[r+1]]||a&&Sn(a)&&!fs[t[r-1]]||!fs[t[r]]?e+=t[r]:e+=fs[t[r]]}return e}(this.text)},Yl.prototype.trim=function(){for(var t=0,e=0;e<this.text.length&&Bl[this.text.charCodeAt(e)];e++)t++;for(var r=this.text.length,n=this.text.length-1;n>=0&&n>=t&&Bl[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},Yl.prototype.substring=function(t,e){var r=new Yl;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},Yl.prototype.toString=function(){return this.text},Yl.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)};var Bl={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Hl={};function Ul(t,e,r,n){var a=Math.pow(t-e,2);return n?t<e?a/2:2*a:a+Math.abs(r)*r}function Vl(t,e,r){var n=0;return 10===t&&(n-=1e4),r&&(n+=150),40!==t&&65288!==t||(n+=50),41!==e&&65289!==e||(n+=50),n}function Wl(t,e,r,n,a,i){for(var o=null,s=Ul(e,r,a,i),l=0,u=n;l<u.length;l+=1){var c=u[l],h=Ul(e-c.x,r,a,i)+c.badness;h<=s&&(o=c,s=h)}return{index:t,x:e,priorBreak:o,badness:s}}function Gl(t,e,r,n){if(!r)return[];if(!t)return[];for(var a,i=[],o=function(t,e,r,n){for(var a=0,i=0;i<t.length();i++){var o=t.getSection(i),s=n[o.fontStack],l=s&&s[t.getCharCode(i)];l&&(a+=l.metrics.advance*o.scale+e)}return a/Math.max(1,Math.ceil(a/r))}(t,e,r,n),s=t.text.indexOf("")>=0,l=0,u=0;u<t.length();u++){var c=t.getSection(u),h=t.getCharCode(u),d=n[c.fontStack],f=d&&d[h];if(f&&!Bl[h]&&(l+=f.metrics.advance*c.scale+e),u<t.length()-1){var p=!((a=h)<11904||!(Mn["Bopomofo Extended"](a)||Mn.Bopomofo(a)||Mn["CJK Compatibility Forms"](a)||Mn["CJK Compatibility Ideographs"](a)||Mn["CJK Compatibility"](a)||Mn["CJK Radicals Supplement"](a)||Mn["CJK Strokes"](a)||Mn["CJK Symbols and Punctuation"](a)||Mn["CJK Unified Ideographs Extension A"](a)||Mn["CJK Unified Ideographs"](a)||Mn["Enclosed CJK Letters and Months"](a)||Mn["Halfwidth and Fullwidth Forms"](a)||Mn.Hiragana(a)||Mn["Ideographic Description Characters"](a)||Mn["Kangxi Radicals"](a)||Mn["Katakana Phonetic Extensions"](a)||Mn.Katakana(a)||Mn["Vertical Forms"](a)||Mn["Yi Radicals"](a)||Mn["Yi Syllables"](a)));(Hl[h]||p)&&i.push(Wl(u+1,l,o,i,Vl(h,t.getCharCode(u+1),p&&s),!1))}}return function t(e){return e?t(e.priorBreak).concat(e.index):[]}(Wl(t.length(),l,o,i,0,!0))}function ql(t){var e=.5,r=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:e,verticalAlign:r}}function Zl(t,e,r,n,a){if(a){var i=t[n],o=e[i.fontStack],s=o&&o[i.glyph];if(s)for(var l=s.metrics.advance*i.scale,u=(t[n].x+l)*a,c=r;c<=n;c++)t[c].x-=u}}function Xl(t,e,r){var n=ql(r),a=n.horizontalAlign,i=n.verticalAlign,o=e[0],s=e[1],l=o-t.displaySize[0]*a,u=l+t.displaySize[0],c=s-t.displaySize[1]*i;return{image:t,top:c,bottom:c+t.displaySize[1],left:l,right:u}}function Jl(t,e,r,n,a){if(void 0===e.segment)return!0;for(var i=e,o=e.segment+1,s=0;s>-r/2;){if(--o<0)return!1;s-=t[o].dist(i),i=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],d=t[o+1];if(!d)return!1;var f=c.angleTo(h)-h.angleTo(d);for(f=Math.abs((f+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:s,angleDelta:f}),u+=f;s-l[0].distance>n;)u-=l.shift().angleDelta;if(u>a)return!1;o++,s+=h.dist(d)}return!0}function Kl(t){for(var e=0,r=0;r<t.length-1;r++)e+=t[r].dist(t[r+1]);return e}function $l(t,e,r){return t?.6*e*r:0}function Ql(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function tu(t,e,r,n,a,i){for(var o=$l(r,a,i),s=Ql(r,n)*i,l=0,u=Kl(t)/2,c=0;c<t.length-1;c++){var h=t[c],d=t[c+1],f=h.dist(d);if(l+f>u){var p=(u-l)/f,m=Le(h.x,d.x,p),g=Le(h.y,d.y,p),y=new ps(m,g,d.angleTo(h),c);return y._round(),!o||Jl(t,y,s,o,e)?y:void 0}l+=f}}function eu(t,e,r,n,a,i,o,s,l){var u=$l(n,i,o),c=Ql(n,a),h=c*o,d=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-h<e/4&&(e=h+e/4),function t(e,r,n,a,i,o,s,l,u){for(var c=o/2,h=Kl(e),d=0,f=r-n,p=[],m=0;m<e.length-1;m++){for(var g=e[m],y=e[m+1],v=g.dist(y),_=y.angleTo(g);f+n<d+v;){var x=((f+=n)-d)/v,b=Le(g.x,y.x,x),w=Le(g.y,y.y,x);if(b>=0&&b<u&&w>=0&&w<u&&f-c>=0&&f+c<=h){var M=new ps(b,w,_,m);M._round(),a&&!Jl(e,M,o,a,i)||p.push(M)}}d+=v}return l||p.length||s||(p=t(e,d/2,n,a,i,o,s,!0,u)),p}(t,d?e/2*s%e:(c/2+2*i)*o*s%e,e,u,r,h,d,!1,l)}Hl[10]=!0,Hl[32]=!0,Hl[38]=!0,Hl[40]=!0,Hl[41]=!0,Hl[43]=!0,Hl[45]=!0,Hl[47]=!0,Hl[173]=!0,Hl[183]=!0,Hl[8203]=!0,Hl[8208]=!0,Hl[8211]=!0,Hl[8231]=!0;var ru=function(t,e,r,n,i,o,s,l,u,c,h,d){var f=s.top*l-u,p=s.bottom*l+u,m=s.left*l-u,g=s.right*l+u;if(this.boxStartIndex=t.length,c){var y=p-f,v=g-m;y>0&&(y=Math.max(10*l,y),this._addLineCollisionCircles(t,e,r,r.segment,v,y,n,i,o,h))}else{if(d){var _=new a(m,f),x=new a(g,f),b=new a(m,p),w=new a(g,p),M=d*Math.PI/180;_._rotate(M),x._rotate(M),b._rotate(M),w._rotate(M),m=Math.min(_.x,x.x,b.x,w.x),g=Math.max(_.x,x.x,b.x,w.x),f=Math.min(_.y,x.y,b.y,w.y),p=Math.max(_.y,x.y,b.y,w.y)}t.emplaceBack(r.x,r.y,m,f,g,p,n,i,o,0,0)}this.boxEndIndex=t.length};ru.prototype._addLineCollisionCircles=function(t,e,r,n,a,i,o,s,l,u){var c=i/2,h=Math.floor(a/c)||1,d=1+.4*Math.log(u)/Math.LN2,f=Math.floor(h*d/2),p=-i/2,m=r,g=n+1,y=p,v=-a/2,_=v-a/4;do{if(--g<0){if(y>v)return;g=0;break}y-=e[g].dist(m),m=e[g]}while(y>_);for(var x=e[g].dist(e[g+1]),b=-f;b<h+f;b++){var w=b*c,M=v+w;if(w<0&&(M+=w),w>a&&(M+=w-a),!(M<y)){for(;y+x<M;){if(y+=x,1+ ++g>=e.length)return;x=e[g].dist(e[g+1])}var k=M-y,T=e[g],L=e[g+1].sub(T)._unit()._mult(k)._add(T)._round(),A=Math.abs(M-p)<c?0:.8*(M-p);t.emplaceBack(L.x,L.y,-i/2,-i/2,i/2,i/2,o,s,l,i/2,A)}}};var nu=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=au),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function au(t,e){return t<e?-1:t>e?1:0}function iu(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var n=1/0,i=1/0,o=-1/0,s=-1/0,l=t[0],u=0;u<l.length;u++){var c=l[u];(!u||c.x<n)&&(n=c.x),(!u||c.y<i)&&(i=c.y),(!u||c.x>o)&&(o=c.x),(!u||c.y>s)&&(s=c.y)}var h=o-n,d=s-i,f=Math.min(h,d),p=f/2,m=new nu([],ou);if(0===f)return new a(n,i);for(var g=n;g<o;g+=f)for(var y=i;y<s;y+=f)m.push(new su(g+p,y+p,p,t));for(var v=function(t){for(var e=0,r=0,n=0,a=t[0],i=0,o=a.length,s=o-1;i<o;s=i++){var l=a[i],u=a[s],c=l.x*u.y-u.x*l.y;r+=(l.x+u.x)*c,n+=(l.y+u.y)*c,e+=3*c}return new su(r/e,n/e,0,t)}(t),_=m.length;m.length;){var x=m.pop();(x.d>v.d||!v.d)&&(v=x,r&&console.log("found best %d after %d probes",Math.round(1e4*x.d)/1e4,_)),x.max-v.d<=e||(p=x.h/2,m.push(new su(x.p.x-p,x.p.y-p,p,t)),m.push(new su(x.p.x+p,x.p.y-p,p,t)),m.push(new su(x.p.x-p,x.p.y+p,p,t)),m.push(new su(x.p.x+p,x.p.y+p,p,t)),_+=4)}return r&&(console.log("num probes: "+_),console.log("best distance: "+v.d)),v.p}function ou(t,e){return e.max-t.max}function su(t,e,r,n){this.p=new a(t,e),this.h=r,this.d=function(t,e){for(var r=!1,n=1/0,a=0;a<e.length;a++)for(var i=e[a],o=0,s=i.length,l=s-1;o<s;l=o++){var u=i[o],c=i[l];u.y>t.y!=c.y>t.y&&t.x<(c.x-u.x)*(t.y-u.y)/(c.y-u.y)+u.x&&(r=!r),n=Math.min(n,_i(t,u,c))}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}nu.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},nu.prototype.pop=function(){if(0!==this.length){var t=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),t}},nu.prototype.peek=function(){return this.data[0]},nu.prototype._up=function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var a=t-1>>1,i=e[a];if(r(n,i)>=0)break;e[t]=i,t=a}e[t]=n},nu.prototype._down=function(t){for(var e=this.data,r=this.compare,n=this.length>>1,a=e[t];t<n;){var i=1+(t<<1),o=e[i],s=i+1;if(s<this.length&&r(e[s],o)<0&&(i=s,o=e[s]),r(o,a)>=0)break;e[t]=o,t=i}e[t]=a};var lu=e((function(t){t.exports=function(t,e){var r,n,a,i,o,s,l,u;for(r=3&t.length,n=t.length-r,a=e,o=3432918353,s=461845907,u=0;u<n;)l=255&t.charCodeAt(u)|(255&t.charCodeAt(++u))<<8|(255&t.charCodeAt(++u))<<16|(255&t.charCodeAt(++u))<<24,++u,a=27492+(65535&(i=5*(65535&(a=(a^=l=(65535&(l=(l=(65535&l)*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|a>>>19))+((5*(a>>>16)&65535)<<16)&4294967295))+((58964+(i>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&t.charCodeAt(u+2))<<16;case 2:l^=(255&t.charCodeAt(u+1))<<8;case 1:a^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(u)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return a^=t.length,a=2246822507*(65535&(a^=a>>>16))+((2246822507*(a>>>16)&65535)<<16)&4294967295,a=3266489909*(65535&(a^=a>>>13))+((3266489909*(a>>>16)&65535)<<16)&4294967295,(a^=a>>>16)>>>0}})),uu=e((function(t){t.exports=function(t,e){for(var r,n=t.length,a=e^n,i=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(i)|(255&t.charCodeAt(++i))<<8|(255&t.charCodeAt(++i))<<16|(255&t.charCodeAt(++i))<<24))+((1540483477*(r>>>16)&65535)<<16),a=1540483477*(65535&a)+((1540483477*(a>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++i;switch(n){case 3:a^=(255&t.charCodeAt(i+2))<<16;case 2:a^=(255&t.charCodeAt(i+1))<<8;case 1:a=1540483477*(65535&(a^=255&t.charCodeAt(i)))+((1540483477*(a>>>16)&65535)<<16)}return a=1540483477*(65535&(a^=a>>>13))+((1540483477*(a>>>16)&65535)<<16),(a^=a>>>15)>>>0}})),cu=lu,hu=lu,du=uu;cu.murmur3=hu,cu.murmur2=du;function fu(t,e){var r=0,n=0,a=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":n=a-7;break;case"bottom-right":case"bottom-left":n=7-a;break;case"bottom":n=7-e;break;case"top":n=e-7}switch(t){case"top-right":case"bottom-right":r=-a;break;case"top-left":case"bottom-left":r=a;break;case"left":r=e;break;case"right":r=-e}return[r,n]}function pu(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function mu(t,e,r,n,i,o,s){var l=o.layoutTextSize.evaluate(e,{}),u=o.layoutIconSize.evaluate(e,{}),c=o.textMaxSize.evaluate(e,{});void 0===c&&(c=l);var h=t.layers[0].layout,d=h.get("icon-offset").evaluate(e,{}),f=vu(r.horizontal),p=l/24,m=t.tilePixelRatio*p,g=t.tilePixelRatio*c/24,y=t.tilePixelRatio*u,v=t.tilePixelRatio*h.get("symbol-spacing"),_=h.get("text-padding")*t.tilePixelRatio,x=h.get("icon-padding")*t.tilePixelRatio,b=h.get("text-max-angle")/180*Math.PI,M="map"===h.get("text-rotation-alignment")&&"point"!==h.get("symbol-placement"),k="map"===h.get("icon-rotation-alignment")&&"point"!==h.get("symbol-placement"),T=h.get("symbol-placement"),L=v/2,A=function(l,u){u.x<0||u.x>=oi||u.y<0||u.y>=oi||function(t,e,r,n,i,o,s,l,u,c,h,d,f,p,m,g,y,v,_,x,b){var M,k,T=t.addToLineVertexArray(e,r),L=0,A=0,S=0,E={},C=cu(""),D=(o.layout.get("text-radial-offset").evaluate(_,{})||0)*Fl;for(var P in n.horizontal){var O=n.horizontal[P];if(!M){C=cu(O.text);var z=o.layout.get("text-rotate").evaluate(_,{});M=new ru(s,r,e,l,u,c,O,h,d,f,t.overscaling,z)}var I=1===O.lineCount;if(A+=yu(t,e,O,o,f,_,p,T,n.vertical?Nl.horizontal:Nl.horizontalOnly,I?Object.keys(n.horizontal):[P],E,x,b),I)break}n.vertical&&(S+=yu(t,e,n.vertical,o,f,_,p,T,Nl.vertical,["vertical"],E,x,b));var R=M?M.boxStartIndex:t.collisionBoxArray.length,F=M?M.boxEndIndex:t.collisionBoxArray.length;if(i){var N=function(t,e,r,n,i,o){var s,l,u,c,h=e.image,d=r.layout,f=e.top-1/h.pixelRatio,p=e.left-1/h.pixelRatio,m=e.bottom+1/h.pixelRatio,g=e.right+1/h.pixelRatio;if("none"!==d.get("icon-text-fit")&&i){var y=g-p,v=m-f,_=d.get("text-size").evaluate(o,{})/24,x=i.left*_,b=i.right*_,w=i.top*_,M=b-x,k=i.bottom*_-w,T=d.get("icon-text-fit-padding")[0],L=d.get("icon-text-fit-padding")[1],A=d.get("icon-text-fit-padding")[2],S=d.get("icon-text-fit-padding")[3],E="width"===d.get("icon-text-fit")?.5*(k-v):0,C="height"===d.get("icon-text-fit")?.5*(M-y):0,D="width"===d.get("icon-text-fit")||"both"===d.get("icon-text-fit")?M:y,P="height"===d.get("icon-text-fit")||"both"===d.get("icon-text-fit")?k:v;s=new a(x+C-S,w+E-T),l=new a(x+C+L+D,w+E-T),u=new a(x+C+L+D,w+E+A+P),c=new a(x+C-S,w+E+A+P)}else s=new a(p,f),l=new a(g,f),u=new a(g,m),c=new a(p,m);var O=r.layout.get("icon-rotate").evaluate(o,{})*Math.PI/180;if(O){var z=Math.sin(O),I=Math.cos(O),R=[I,-z,z,I];s._matMult(R),l._matMult(R),c._matMult(R),u._matMult(R)}return[{tl:s,tr:l,bl:c,br:u,tex:h.paddedRect,writingMode:void 0,glyphOffset:[0,0]}]}(0,i,o,0,vu(n.horizontal),_),Y=o.layout.get("icon-rotate").evaluate(_,{});k=new ru(s,r,e,l,u,c,i,m,g,!1,t.overscaling,Y),L=4*N.length;var j=t.iconSizeData,B=null;"source"===j.kind?(B=[ms*o.layout.get("icon-size").evaluate(_,{})])[0]>gu&&w(t.layerIds[0]+': Value for "icon-size" is >= 256. Reduce your "icon-size".'):"composite"===j.kind&&((B=[ms*b.compositeIconSizes[0].evaluate(_,{}),ms*b.compositeIconSizes[1].evaluate(_,{})])[0]>gu||B[1]>gu)&&w(t.layerIds[0]+': Value for "icon-size" is >= 256. Reduce your "icon-size".'),t.addSymbols(t.icon,N,B,v,y,_,!1,e,T.lineStartIndex,T.lineLength)}var H=k?k.boxStartIndex:t.collisionBoxArray.length,U=k?k.boxEndIndex:t.collisionBoxArray.length;t.glyphOffsetArray.length>=Ls.MAX_GLYPHS&&w("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),t.symbolInstances.emplaceBack(e.x,e.y,E.right>=0?E.right:-1,E.center>=0?E.center:-1,E.left>=0?E.left:-1,E.vertical||-1,C,R,F,H,U,l,A,S,L,0,h,D)}(t,u,l,r,n,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,m,_,M,s,y,x,k,d,e,i,o)};if("line"===T)for(var S=0,E=function(t,e,r,n,i){for(var o=[],s=0;s<t.length;s++)for(var l=t[s],u=void 0,c=0;c<l.length-1;c++){var h=l[c],d=l[c+1];h.x<0&&d.x<0||(h.x<0?h=new a(0,h.y+(d.y-h.y)*((0-h.x)/(d.x-h.x)))._round():d.x<0&&(d=new a(0,h.y+(d.y-h.y)*((0-h.x)/(d.x-h.x)))._round()),h.y<0&&d.y<0||(h.y<0?h=new a(h.x+(d.x-h.x)*((0-h.y)/(d.y-h.y)),0)._round():d.y<0&&(d=new a(h.x+(d.x-h.x)*((0-h.y)/(d.y-h.y)),0)._round()),h.x>=n&&d.x>=n||(h.x>=n?h=new a(n,h.y+(d.y-h.y)*((n-h.x)/(d.x-h.x)))._round():d.x>=n&&(d=new a(n,h.y+(d.y-h.y)*((n-h.x)/(d.x-h.x)))._round()),h.y>=i&&d.y>=i||(h.y>=i?h=new a(h.x+(d.x-h.x)*((i-h.y)/(d.y-h.y)),i)._round():d.y>=i&&(d=new a(h.x+(d.x-h.x)*((i-h.y)/(d.y-h.y)),i)._round()),u&&h.equals(u[u.length-1])||(u=[h],o.push(u)),u.push(d)))))}return o}(e.geometry,0,0,oi,oi);S<E.length;S+=1)for(var C=E[S],D=0,P=eu(C,v,b,r.vertical||f,n,24,g,t.overscaling,oi);D<P.length;D+=1){var O=P[D];f&&_u(t,f.text,L,O)||A(C,O)}else if("line-center"===T)for(var z=0,I=e.geometry;z<I.length;z+=1){var R=I[z];if(R.length>1){var F=tu(R,b,r.vertical||f,n,24,g);F&&A(R,F)}}else if("Polygon"===e.type)for(var N=0,Y=wo(e.geometry,0);N<Y.length;N+=1){var j=Y[N],B=iu(j,16);A(j[0],new ps(B.x,B.y,0))}else if("LineString"===e.type)for(var H=0,U=e.geometry;H<U.length;H+=1){var V=U[H];A(V,new ps(V[0].x,V[0].y,0))}else if("Point"===e.type)for(var W=0,G=e.geometry;W<G.length;W+=1)for(var q=0,Z=G[W];q<Z.length;q+=1){var X=Z[q];A([X],new ps(X.x,X.y,0))}}var gu=65535;function yu(t,e,r,n,i,o,s,l,u,c,h,d,f){var p=function(t,e,r,n,i,o,s){for(var l=n.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,u=e.positionedGlyphs,c=[],h=0;h<u.length;h++){var d=u[h],f=s[d.fontStack],p=f&&f[d.glyph];if(p){var m=p.rect;if(m){var g=p.metrics.advance*d.scale/2,y=i?[d.x+g,d.y]:[0,0],v=i?[0,0]:[d.x+g+r[0],d.y+r[1]],_=(p.metrics.left-4)*d.scale-g+v[0],x=(-p.metrics.top-4)*d.scale+v[1],b=_+m.w*d.scale,w=x+m.h*d.scale,M=new a(_,x),k=new a(b,x),T=new a(_,w),L=new a(b,w);if(i&&d.vertical){var A=new a(-g,g),S=-Math.PI/2,E=new a(5,0);M._rotateAround(S,A)._add(E),k._rotateAround(S,A)._add(E),T._rotateAround(S,A)._add(E),L._rotateAround(S,A)._add(E)}if(l){var C=Math.sin(l),D=Math.cos(l),P=[D,-C,C,D];M._matMult(P),k._matMult(P),T._matMult(P),L._matMult(P)}c.push({tl:M,tr:k,bl:T,br:L,tex:m,writingMode:e.writingMode,glyphOffset:y})}}}return c}(0,r,s,n,i,o,d),m=t.textSizeData,g=null;"source"===m.kind?(g=[ms*n.layout.get("text-size").evaluate(o,{})])[0]>gu&&w(t.layerIds[0]+': Value for "text-size" is >= 256. Reduce your "text-size".'):"composite"===m.kind&&((g=[ms*f.compositeTextSizes[0].evaluate(o,{}),ms*f.compositeTextSizes[1].evaluate(o,{})])[0]>gu||g[1]>gu)&&w(t.layerIds[0]+': Value for "text-size" is >= 256. Reduce your "text-size".'),t.addSymbols(t.text,p,g,s,i,o,u,e,l.lineStartIndex,l.lineLength);for(var y=0,v=c;y<v.length;y+=1)h[v[y]]=t.text.placedSymbolArray.length-1;return 4*p.length}function vu(t){for(var e in t)return t[e];return null}function _u(t,e,r,n){var a=t.compareText;if(e in a){for(var i=a[e],o=i.length-1;o>=0;o--)if(n.dist(i[o])<r)return!0}else a[e]=[];return a[e].push(n),!1}t.Actor=fl,t.AlphaImage=Yi,t.CanonicalTileID=Ml,t.CollisionBoxArray=Ta,t.Color=ee,t.DEMData=Al,t.DataConstantProperty=Wn,t.DictionaryCoder=El,t.EXTENT=oi,t.ErrorEvent=Ct,t.EvaluationParameters=Rn,t.Event=Et,t.Evented=Dt,t.FeatureIndex=Ol,t.FillBucket=Lo,t.FillExtrusionBucket=Ho,t.ImageAtlas=Ys,t.ImagePosition=Fs,t.LineBucket=ts,t.LngLat=gl,t.LngLatBounds=ml,t.MercatorCoordinate=wl,t.ONE_EM=Fl,t.OverscaledTileID=Tl,t.Point=a,t.Point$1=a,t.ProgramConfiguration=ri,t.Properties=Jn,t.Protobuf=qs,t.RGBAImage=ji,t.RequestManager=j,t.ResourceType=yt,t.SegmentVector=Fa,t.SourceFeatureState=Pl,t.StructArrayLayout1ui2=ba,t.StructArrayLayout2i4=na,t.StructArrayLayout2ui4=xa,t.StructArrayLayout3ui6=_a,t.StructArrayLayout4i8=aa,t.SymbolBucket=Ls,t.Texture=Vs,t.Tile=Rl,t.Transitionable=Yn,t.Uniform1f=Ua,t.Uniform1i=Ha,t.Uniform2f=Va,t.Uniform3f=Wa,t.Uniform4f=Ga,t.UniformColor=qa,t.UniformMatrix4f=Xa,t.UnwrappedTileID=kl,t.ValidationError=Ot,t.WritingMode=Nl,t.ZoomHistory=wn,t.addDynamicAttributes=Ms,t.asyncAll=function(t,e,r){if(!t.length)return r(null,[]);var n=t.length,a=new Array(t.length),i=null;t.forEach((function(t,o){e(t,(function(t,e){t&&(i=t),a[o]=e,0==--n&&r(i,a)}))}))},t.bezier=s,t.bindAll=g,t.browser=O,t.cacheEntryPossiblyAdded=function(t){++gt>pt&&(t.send("enforceCacheSizeLimit",ft),gt=0)},t.clamp=u,t.clearTileCache=function(t){var e=self.caches.delete(dt);t&&e.catch(t).then((function(){return t()}))},t.clone=function(t){var e=new Ai(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.clone$1=x,t.config=z,t.create=function(){var t=new Ai(16);return Ai!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$1=Si,t.create$2=function(){var t=new Ai(4);return Ai!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=Sr,t.createLayout=ea,t.createStyleLayer=function(t){return"custom"===t.type?new zs(t):new Is[t.type](t)},t.deepEqual=o,t.ease=l,t.emitValidationErrors=fn,t.endsWith=y,t.enforceCacheSizeLimit=function(t){self.caches&&self.caches.open(dt).then((function(e){e.keys().then((function(r){for(var n=0;n<r.length-t;n++)e.delete(r[n])}))}))},t.evaluateRadialOffset=fu,t.evaluateSizeForFeature=ys,t.evaluateSizeForZoom=vs,t.evented=zn,t.extend=h,t.featureFilter=Br,t.filterObject=_,t.fromRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},t.getAnchorAlignment=ql,t.getAnchorJustification=pu,t.getArrayBuffer=kt,t.getImage=Lt,t.getJSON=function(t,e){return Mt(h(t,{type:"json"}),e)},t.getReferrer=xt,t.getVideo=function(t,e){var r,n,a=self.document.createElement("video");a.muted=!0,a.onloadstart=function(){e(null,a)};for(var i=0;i<t.length;i++){var o=self.document.createElement("source");r=t[i],n=void 0,(n=self.document.createElement("a")).href=r,(n.protocol!==self.document.location.protocol||n.host!==self.document.location.host)&&(a.crossOrigin="Anonymous"),o.src=t[i],a.appendChild(o)}return{cancel:function(){}}},t.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.invert=function(t,e){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],d=e[10],f=e[11],p=e[12],m=e[13],g=e[14],y=e[15],v=r*s-n*o,_=r*l-a*o,x=r*u-i*o,b=n*l-a*s,w=n*u-i*s,M=a*u-i*l,k=c*m-h*p,T=c*g-d*p,L=c*y-f*p,A=h*g-d*m,S=h*y-f*m,E=d*y-f*g,C=v*E-_*S+x*A+b*L-w*T+M*k;return C?(C=1/C,t[0]=(s*E-l*S+u*A)*C,t[1]=(a*S-n*E-i*A)*C,t[2]=(m*M-g*w+y*b)*C,t[3]=(d*w-h*M-f*b)*C,t[4]=(l*L-o*E-u*T)*C,t[5]=(r*E-a*L+i*T)*C,t[6]=(g*x-p*M-y*_)*C,t[7]=(c*M-d*x+f*_)*C,t[8]=(o*S-s*L+u*k)*C,t[9]=(n*L-r*S-i*k)*C,t[10]=(p*w-m*x+y*v)*C,t[11]=(h*x-c*w-f*v)*C,t[12]=(s*T-o*A-l*k)*C,t[13]=(r*A-n*T+a*k)*C,t[14]=(m*_-p*b-g*v)*C,t[15]=(c*b-h*_+d*v)*C,t):null},t.isChar=Mn,t.isMapboxURL=U,t.keysDifference=function(t,e){var r=[];for(var n in t)n in e||r.push(n);return r},t.makeRequest=Mt,t.mapObject=v,t.mercatorXfromLng=vl,t.mercatorYfromLat=_l,t.mercatorZfromAltitude=xl,t.multiply=function(t,e,r){var n=e[0],a=e[1],i=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],d=e[9],f=e[10],p=e[11],m=e[12],g=e[13],y=e[14],v=e[15],_=r[0],x=r[1],b=r[2],w=r[3];return t[0]=_*n+x*s+b*h+w*m,t[1]=_*a+x*l+b*d+w*g,t[2]=_*i+x*u+b*f+w*y,t[3]=_*o+x*c+b*p+w*v,_=r[4],x=r[5],b=r[6],w=r[7],t[4]=_*n+x*s+b*h+w*m,t[5]=_*a+x*l+b*d+w*g,t[6]=_*i+x*u+b*f+w*y,t[7]=_*o+x*c+b*p+w*v,_=r[8],x=r[9],b=r[10],w=r[11],t[8]=_*n+x*s+b*h+w*m,t[9]=_*a+x*l+b*d+w*g,t[10]=_*i+x*u+b*f+w*y,t[11]=_*o+x*c+b*p+w*v,_=r[12],x=r[13],b=r[14],w=r[15],t[12]=_*n+x*s+b*h+w*m,t[13]=_*a+x*l+b*d+w*g,t[14]=_*i+x*u+b*f+w*y,t[15]=_*o+x*c+b*p+w*v,t},t.mvt=No,t.number=Le,t.ortho=function(t,e,r,n,a,i,o){var s=1/(e-r),l=1/(n-a),u=1/(i-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]=(a+n)*l,t[14]=(o+i)*u,t[15]=1,t},t.parseGlyphPBF=function(t){return new qs(t).readFields(cl,[])},t.pbf=qs,t.performSymbolLayout=function(t,e,r,n,a,i){t.createArrays();var o=512*t.overscaling;t.tilePixelRatio=oi/o,t.compareText={},t.iconsNeedLinear=!1;var s=t.layers[0].layout,l=t.layers[0]._unevaluatedLayout._values,u={};if("composite"===t.textSizeData.kind){var c=t.textSizeData,h=c.minZoom,d=c.maxZoom;u.compositeTextSizes=[l["text-size"].possiblyEvaluate(new Rn(h)),l["text-size"].possiblyEvaluate(new Rn(d))]}if("composite"===t.iconSizeData.kind){var f=t.iconSizeData,p=f.minZoom,m=f.maxZoom;u.compositeIconSizes=[l["icon-size"].possiblyEvaluate(new Rn(p)),l["icon-size"].possiblyEvaluate(new Rn(m))]}u.layoutTextSize=l["text-size"].possiblyEvaluate(new Rn(t.zoom+1)),u.layoutIconSize=l["icon-size"].possiblyEvaluate(new Rn(t.zoom+1)),u.textMaxSize=l["text-size"].possiblyEvaluate(new Rn(18));for(var g=s.get("text-line-height")*Fl,y="map"===s.get("text-rotation-alignment")&&"point"!==s.get("symbol-placement"),v=s.get("text-keep-upright"),_=0,x=t.features;_<x.length;_+=1){var b=x[_],M=s.get("text-font").evaluate(b,{}).join(","),k=r,T={horizontal:{},vertical:void 0},L=b.text,A=[0,0];if(L){var S=L.toString(),E=s.get("text-letter-spacing").evaluate(b,{})*Fl,C=Tn(S)?E:0,D=s.get("text-anchor").evaluate(b,{}),P=s.get("text-variable-anchor"),O=s.get("text-radial-offset").evaluate(b,{});P||(A=O?fu(D,O*Fl):s.get("text-offset").evaluate(b,{}).map((function(t){return t*Fl})));var z=y?"center":s.get("text-justify").evaluate(b,{}),I="point"===s.get("symbol-placement")?s.get("text-max-width").evaluate(b,{})*Fl:0;if(!y&&P)for(var R="auto"===z?P.map((function(t){return pu(t)})):[z],F=!1,N=0;N<R.length;N++){var Y=R[N];if(!T.horizontal[Y])if(F)T.horizontal[Y]=T.horizontal[0];else{var j=jl(L,e,M,I,g,"center",Y,C,A,Nl.horizontal);j&&(T.horizontal[Y]=j,F=1===j.lineCount)}}else{"auto"===z&&(z=pu(D));var B=jl(L,e,M,I,g,D,z,C,A,Nl.horizontal);B&&(T.horizontal[z]=B),kn(S)&&y&&v&&(T.vertical=jl(L,e,M,I,g,D,z,C,A,Nl.vertical))}}var H=void 0;if(b.icon){var U=n[b.icon];U&&(H=Xl(a[b.icon],s.get("icon-offset").evaluate(b,{}),s.get("icon-anchor").evaluate(b,{})),void 0===t.sdfIcons?t.sdfIcons=U.sdf:t.sdfIcons!==U.sdf&&w("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(U.pixelRatio!==t.pixelRatio||0!==s.get("icon-rotate").constantOr(1))&&(t.iconsNeedLinear=!0))}(Object.keys(T.horizontal).length||H)&&mu(t,b,T,H,k,u,A)}i&&t.generateCollisionDebugBuffers()},t.perspective=function(t,e,r,n,a){var i,o=1/Math.tan(e/2);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=a&&a!==1/0?(i=1/(n-a),t[10]=(a+n)*i,t[14]=2*a*n*i):(t[10]=-1,t[14]=-2*n),t},t.pick=function(t,e){for(var r={},n=0;n<e.length;n++){var a=e[n];a in t&&(r[a]=t[a])}return r},t.plugin=In,t.polygonIntersectsPolygon=di,t.postMapLoadEvent=ht,t.postTurnstileEvent=ut,t.potpack=Rs,t.rasterBoundsAttributes=Sl,t.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],t.register=vn,t.registerForPluginAvailability=function(t){return Pn?t({pluginURL:Pn,completionCallback:Cn}):zn.once("pluginAvailable",t),t},t.rotate=function(t,e,r){var n=e[0],a=e[1],i=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+i*s,t[1]=a*l+o*s,t[2]=n*-s+i*l,t[3]=a*-s+o*l,t},t.rotateX=function(t,e,r){var n=Math.sin(r),a=Math.cos(r),i=e[4],o=e[5],s=e[6],l=e[7],u=e[8],c=e[9],h=e[10],d=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]=i*a+u*n,t[5]=o*a+c*n,t[6]=s*a+h*n,t[7]=l*a+d*n,t[8]=u*a-i*n,t[9]=c*a-o*n,t[10]=h*a-s*n,t[11]=d*a-l*n,t},t.rotateZ=function(t,e,r){var n=Math.sin(r),a=Math.cos(r),i=e[0],o=e[1],s=e[2],l=e[3],u=e[4],c=e[5],h=e[6],d=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]=i*a+u*n,t[1]=o*a+c*n,t[2]=s*a+h*n,t[3]=l*a+d*n,t[4]=u*a-i*n,t[5]=c*a-o*n,t[6]=h*a-s*n,t[7]=d*a-l*n,t},t.scale=function(t,e,r){var n=r[0],a=r[1],i=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]*a,t[5]=e[5]*a,t[6]=e[6]*a,t[7]=e[7]*a,t[8]=e[8]*i,t[9]=e[9]*i,t[10]=e[10]*i,t[11]=e[11]*i,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.setCacheLimits=function(t,e){ft=t,pt=e},t.setRTLTextPlugin=function(t,e){if(Dn)throw new Error("setRTLTextPlugin cannot be called multiple times.");Dn=!0,Pn=O.resolveURL(t),Cn=function(t){t?(Dn=!1,Pn=null,e&&e(t)):On=!0},zn.fire(new Et("pluginAvailable",{pluginURL:Pn,completionCallback:Cn}))},t.sphericalToCartesian=function(t){var e=t[0],r=t[1],n=t[2];return r+=90,r*=Math.PI/180,n*=Math.PI/180,{x:e*Math.cos(r)*Math.sin(n),y:e*Math.sin(r)*Math.sin(n),z:e*Math.cos(n)}},t.styleSpec=Pt,t.symbolSize=_s,t.transformMat3=function(t,e,r){var n=e[0],a=e[1],i=e[2];return t[0]=n*r[0]+a*r[3]+i*r[6],t[1]=n*r[1]+a*r[4]+i*r[7],t[2]=n*r[2]+a*r[5]+i*r[8],t},t.transformMat4=Di,t.translate=function(t,e,r){var n,a,i,o,s,l,u,c,h,d,f,p,m=r[0],g=r[1],y=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*y+e[12],t[13]=e[1]*m+e[5]*g+e[9]*y+e[13],t[14]=e[2]*m+e[6]*g+e[10]*y+e[14],t[15]=e[3]*m+e[7]*g+e[11]*y+e[15]):(n=e[0],a=e[1],i=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],d=e[9],f=e[10],p=e[11],t[0]=n,t[1]=a,t[2]=i,t[3]=o,t[4]=s,t[5]=l,t[6]=u,t[7]=c,t[8]=h,t[9]=d,t[10]=f,t[11]=p,t[12]=n*m+s*g+h*y+e[12],t[13]=a*m+l*g+d*y+e[13],t[14]=i*m+u*g+f*y+e[14],t[15]=o*m+c*g+p*y+e[15]),t},t.uniqueId=f,t.validateCustomStyleLayer=function(t){var e=[],r=t.id;return void 0===r&&e.push({message:"layers."+r+': missing required property "id"'}),void 0===t.render&&e.push({message:"layers."+r+': missing required method "render"'}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:"layers."+r+': property "renderingMode" must be either "2d" or "3d"'}),e},t.validateLight=cn,t.validateStyle=un,t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.vectorTile=No,t.version="1.1.1",t.warnOnce=w,t.webpSupported=I,t.window=self,t.wrap=c})),n(0,(function(t){function e(t){var r=typeof t;if("number"===r||"boolean"===r||"string"===r||null==t)return JSON.stringify(t);if(Array.isArray(t)){for(var n="[",a=0,i=t;a<i.length;a+=1)n+=e(i[a])+",";return n+"]"}for(var o=Object.keys(t).sort(),s="{",l=0;l<o.length;l++)s+=JSON.stringify(o[l])+":"+e(t[o[l]])+",";return s+"}"}function r(r){for(var n="",a=0,i=t.refProperties;a<i.length;a+=1)n+="/"+e(r[i[a]]);return n}var n=function(t){this.keyCache={},t&&this.replace(t)};n.prototype.replace=function(t){this._layerConfigs={},this._layers={},this.update(t,[])},n.prototype.update=function(e,n){for(var a=this,i=0,o=e;i<o.length;i+=1){var s=o[i];this._layerConfigs[s.id]=s;var l=this._layers[s.id]=t.createStyleLayer(s);l._featureFilter=t.featureFilter(l.filter),this.keyCache[s.id]&&delete this.keyCache[s.id]}for(var u=0,c=n;u<c.length;u+=1){var h=c[u];delete this.keyCache[h],delete this._layerConfigs[h],delete this._layers[h]}this.familiesBySource={};for(var d=0,f=function(t,e){for(var n={},a=0;a<t.length;a++){var i=e&&e[t[a].id]||r(t[a]);e&&(e[t[a].id]=i);var o=n[i];o||(o=n[i]=[]),o.push(t[a])}var s=[];for(var l in n)s.push(n[l]);return s}(t.values(this._layerConfigs),this.keyCache);d<f.length;d+=1){var p=f[d].map((function(t){return a._layers[t.id]})),m=p[0];if("none"!==m.visibility){var g=m.source||"",y=this.familiesBySource[g];y||(y=this.familiesBySource[g]={});var v=m.sourceLayer||"_geojsonTileLayer",_=y[v];_||(_=y[v]=[]),_.push(p)}}};var a=function(e){var r={},n=[];for(var a in e){var i=e[a],o=r[a]={};for(var s in i){var l=i[+s];if(l&&0!==l.bitmap.width&&0!==l.bitmap.height){var u={x:0,y:0,w:l.bitmap.width+2,h:l.bitmap.height+2};n.push(u),o[s]={rect:u,metrics:l.metrics}}}}var c=t.potpack(n),h=c.w,d=c.h,f=new t.AlphaImage({width:h||1,height:d||1});for(var p in e){var m=e[p];for(var g in m){var y=m[+g];if(y&&0!==y.bitmap.width&&0!==y.bitmap.height){var v=r[p][g].rect;t.AlphaImage.copy(y.bitmap,f,{x:0,y:0},{x:v.x+1,y:v.y+1},y.bitmap)}}}this.image=f,this.positions=r};t.register("GlyphAtlas",a);var i=function(e){this.tileID=new t.OverscaledTileID(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies};function o(e,r){for(var n=new t.EvaluationParameters(r),a=0,i=e;a<i.length;a+=1)i[a].recalculate(n)}i.prototype.parse=function(e,r,n,i){var s=this;this.status="parsing",this.data=e,this.collisionBoxArray=new t.CollisionBoxArray;var l=new t.DictionaryCoder(Object.keys(e.layers).sort()),u=new t.FeatureIndex(this.tileID);u.bucketLayerIDs=[];var c,h,d,f,p={},m={featureIndex:u,iconDependencies:{},patternDependencies:{},glyphDependencies:{}},g=r.familiesBySource[this.source];for(var y in g){var v=e.layers[y];if(v){1===v.version&&t.warnOnce('Vector tile source "'+this.source+'" layer "'+y+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var _=l.encode(y),x=[],b=0;b<v.length;b++){var w=v.feature(b);x.push({feature:w,index:b,sourceLayerIndex:_})}for(var M=0,k=g[y];M<k.length;M+=1){var T=k[M],L=T[0];L.minzoom&&this.zoom<Math.floor(L.minzoom)||L.maxzoom&&this.zoom>=L.maxzoom||"none"!==L.visibility&&(o(T,this.zoom),(p[L.id]=L.createBucket({index:u.bucketLayerIDs.length,layers:T,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:_,sourceID:this.source})).populate(x,m),u.bucketLayerIDs.push(T.map((function(t){return t.id}))))}}}var A=t.mapObject(m.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(A).length?n.send("getGlyphs",{uid:this.uid,stacks:A},(function(t,e){c||(c=t,h=e,C.call(s))})):h={};var S=Object.keys(m.iconDependencies);S.length?n.send("getImages",{icons:S},(function(t,e){c||(c=t,d=e,C.call(s))})):d={};var E=Object.keys(m.patternDependencies);function C(){if(c)return i(c);if(h&&d&&f){var e=new a(h),r=new t.ImageAtlas(d,f);for(var n in p){var s=p[n];s instanceof t.SymbolBucket?(o(s.layers,this.zoom),t.performSymbolLayout(s,h,e.positions,d,r.iconPositions,this.showCollisionBoxes)):s.hasPattern&&(s instanceof t.LineBucket||s instanceof t.FillBucket||s instanceof t.FillExtrusionBucket)&&(o(s.layers,this.zoom),s.addFeatures(m,r.patternPositions))}this.status="done",i(null,{buckets:t.values(p).filter((function(t){return!t.isEmpty()})),featureIndex:u,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:r,glyphMap:this.returnDependencies?h:null,iconMap:this.returnDependencies?d:null,glyphPositions:this.returnDependencies?e.positions:null})}}E.length?n.send("getImages",{icons:E},(function(t,e){c||(c=t,f=e,C.call(s))})):f={},C.call(this)};var s="undefined"!=typeof performance,l={getEntriesByName:function(t){return!!(s&&performance&&performance.getEntriesByName)&&performance.getEntriesByName(t)},mark:function(t){return!!(s&&performance&&performance.mark)&&performance.mark(t)},measure:function(t,e,r){return!!(s&&performance&&performance.measure)&&performance.measure(t,e,r)},clearMarks:function(t){return!!(s&&performance&&performance.clearMarks)&&performance.clearMarks(t)},clearMeasures:function(t){return!!(s&&performance&&performance.clearMeasures)&&performance.clearMeasures(t)}},u=function(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},l.mark(this._marks.start)};function c(e,r){var n=t.getArrayBuffer(e.request,(function(e,n,a,i){e?r(e):n&&r(null,{vectorTile:new t.vectorTile.VectorTile(new t.pbf(n)),rawData:n,cacheControl:a,expires:i})}));return function(){n.cancel(),r()}}u.prototype.finish=function(){l.mark(this._marks.end);var t=l.getEntriesByName(this._marks.measure);return 0===t.length&&(l.measure(this._marks.measure,this._marks.start,this._marks.end),t=l.getEntriesByName(this._marks.measure),l.clearMarks(this._marks.start),l.clearMarks(this._marks.end),l.clearMeasures(this._marks.measure)),t},l.Performance=u;var h=function(t,e,r){this.actor=t,this.layerIndex=e,this.loadVectorData=r||c,this.loading={},this.loaded={}};h.prototype.loadTile=function(e,r){var n=this,a=e.uid;this.loading||(this.loading={});var o=!!(e&&e.request&&e.request.collectResourceTiming)&&new l.Performance(e.request),s=this.loading[a]=new i(e);s.abort=this.loadVectorData(e,(function(e,i){if(delete n.loading[a],e||!i)return s.status="done",n.loaded[a]=s,r(e);var l=i.rawData,u={};i.expires&&(u.expires=i.expires),i.cacheControl&&(u.cacheControl=i.cacheControl);var c={};if(o){var h=o.finish();h&&(c.resourceTiming=JSON.parse(JSON.stringify(h)))}s.vectorTile=i.vectorTile,s.parse(i.vectorTile,n.layerIndex,n.actor,(function(e,n){if(e||!n)return r(e);r(null,t.extend({rawTileData:l.slice(0)},n,u,c))})),n.loaded=n.loaded||{},n.loaded[a]=s}))},h.prototype.reloadTile=function(t,e){var r=this.loaded,n=t.uid,a=this;if(r&&r[n]){var i=r[n];i.showCollisionBoxes=t.showCollisionBoxes;var o=function(t,r){var n=i.reloadCallback;n&&(delete i.reloadCallback,i.parse(i.vectorTile,a.layerIndex,a.actor,n)),e(t,r)};"parsing"===i.status?i.reloadCallback=o:"done"===i.status&&(i.vectorTile?i.parse(i.vectorTile,this.layerIndex,this.actor,o):o())}},h.prototype.abortTile=function(t,e){var r=this.loading,n=t.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),e()},h.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e()};var d=function(){this.loaded={}};d.prototype.loadTile=function(e,r){var n=e.uid,a=e.encoding,i=e.rawImageData,o=new t.DEMData(n,i,a);this.loaded=this.loaded||{},this.loaded[n]=o,r(null,o)},d.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var f=6378137;function p(t){var e=0;if(t&&t.length>0){e+=Math.abs(m(t[0]));for(var r=1;r<t.length;r++)e-=Math.abs(m(t[r]))}return e}function m(t){var e,r,n,a,i,o,s=0,l=t.length;if(l>2){for(o=0;o<l;o++)o===l-2?(n=l-2,a=l-1,i=0):o===l-1?(n=l-1,a=0,i=1):(n=o,a=o+1,i=o+2),e=t[n],r=t[a],s+=(g(t[i][0])-g(e[0]))*Math.sin(g(r[1]));s=s*f*f/2}return s}function g(t){return t*Math.PI/180}var y={geometry:function t(e){var r,n=0;switch(e.type){case"Polygon":return p(e.coordinates);case"MultiPolygon":for(r=0;r<e.coordinates.length;r++)n+=p(e.coordinates[r]);return n;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(r=0;r<e.geometries.length;r++)n+=t(e.geometries[r]);return n}},ring:m};function v(t,e){return function(r){return t(r,e)}}function _(t,e){e=!!e,t[0]=x(t[0],e);for(var r=1;r<t.length;r++)t[r]=x(t[r],!e);return t}function x(t,e){return function(t){return y.ring(t)>=0}(t)===e?t:t.reverse()}var b=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,w=function(e){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};w.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],r=0,n=this._feature.geometry;r<n.length;r+=1){var a=n[r];e.push([new t.Point$1(a[0],a[1])])}return e}for(var i=[],o=0,s=this._feature.geometry;o<s.length;o+=1){for(var l=[],u=0,c=s[o];u<c.length;u+=1){var h=c[u];l.push(new t.Point$1(h[0],h[1]))}i.push(l)}return i},w.prototype.toGeoJSON=function(t,e,r){return b.call(this,t,e,r)};var M=function(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=t.EXTENT,this.length=e.length,this._features=e};M.prototype.feature=function(t){return new w(this._features[t])};var k=t.vectorTile.VectorTileFeature,T=L;function L(t,e){this.options=e||{},this.features=t,this.length=t.length}function A(t,e){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=e||4096}L.prototype.feature=function(t){return new A(this.features[t],this.options.extent)},A.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var r=0;r<e.length;r++){for(var n=e[r],a=[],i=0;i<n.length;i++)a.push(new t.Point$1(n[i][0],n[i][1]));this.geometry.push(a)}return this.geometry},A.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,r=-1/0,n=1/0,a=-1/0,i=0;i<t.length;i++)for(var o=t[i],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),a=Math.max(a,l.y)}return[e,n,r,a]},A.prototype.toGeoJSON=k.prototype.toGeoJSON;var S=D,E=D,C=T;function D(e){var r=new t.pbf;return function(t,e){for(var r in t.layers)e.writeMessage(3,P,t.layers[r])}(e,r),r.finish()}function P(t,e){var r;e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);var n={keys:[],values:[],keycache:{},valuecache:{}};for(r=0;r<t.length;r++)n.feature=t.feature(r),e.writeMessage(2,O,n);var a=n.keys;for(r=0;r<a.length;r++)e.writeStringField(3,a[r]);var i=n.values;for(r=0;r<i.length;r++)e.writeMessage(4,N,i[r])}function O(t,e){var r=t.feature;void 0!==r.id&&e.writeVarintField(1,r.id),e.writeMessage(2,z,t),e.writeVarintField(3,r.type),e.writeMessage(4,F,r)}function z(t,e){var r=t.feature,n=t.keys,a=t.values,i=t.keycache,o=t.valuecache;for(var s in r.properties){var l=i[s];void 0===l&&(n.push(s),l=n.length-1,i[s]=l),e.writeVarint(l);var u=r.properties[s],c=typeof u;"string"!==c&&"boolean"!==c&&"number"!==c&&(u=JSON.stringify(u));var h=c+":"+u,d=o[h];void 0===d&&(a.push(u),d=a.length-1,o[h]=d),e.writeVarint(d)}}function I(t,e){return(e<<3)+(7&t)}function R(t){return t<<1^t>>31}function F(t,e){for(var r=t.loadGeometry(),n=t.type,a=0,i=0,o=r.length,s=0;s<o;s++){var l=r[s],u=1;1===n&&(u=l.length),e.writeVarint(I(1,u));for(var c=3===n?l.length-1:l.length,h=0;h<c;h++){1===h&&1!==n&&e.writeVarint(I(2,c-1));var d=l[h].x-a,f=l[h].y-i;e.writeVarint(R(d)),e.writeVarint(R(f)),a+=d,i+=f}3===n&&e.writeVarint(I(7,1))}}function N(t,e){var r=typeof t;"string"===r?e.writeStringField(1,t):"boolean"===r?e.writeBooleanField(7,t):"number"===r&&(t%1!=0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}function Y(t,e,r,n){j(t,r,n),j(e,2*r,2*n),j(e,2*r+1,2*n+1)}function j(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function B(t,e,r,n){var a=t-r,i=e-n;return a*a+i*i}S.fromVectorTileJs=E,S.fromGeojsonVt=function(t,e){e=e||{};var r={};for(var n in t)r[n]=new T(t[n].features,e),r[n].name=n,r[n].version=e.version,r[n].extent=e.extent;return D({layers:r})},S.GeoJSONWrapper=C;var H=function(t){return t[0]},U=function(t){return t[1]},V=function(t,e,r,n,a){void 0===e&&(e=H),void 0===r&&(r=U),void 0===n&&(n=64),void 0===a&&(a=Float64Array),this.nodeSize=n,this.points=t;for(var i=t.length<65536?Uint16Array:Uint32Array,o=this.ids=new i(t.length),s=this.coords=new a(2*t.length),l=0;l<t.length;l++)o[l]=l,s[2*l]=e(t[l]),s[2*l+1]=r(t[l]);!function t(e,r,n,a,i,o){if(!(i-a<=n)){var s=a+i>>1;!function t(e,r,n,a,i,o){for(;i>a;){if(i-a>600){var s=i-a+1,l=n-a+1,u=Math.log(s),c=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*c*(s-c)/s)*(l-s/2<0?-1:1);t(e,r,n,Math.max(a,Math.floor(n-l*c/s+h)),Math.min(i,Math.floor(n+(s-l)*c/s+h)),o)}var d=r[2*n+o],f=a,p=i;for(Y(e,r,a,n),r[2*i+o]>d&&Y(e,r,a,i);f<p;){for(Y(e,r,f,p),f++,p--;r[2*f+o]<d;)f++;for(;r[2*p+o]>d;)p--}r[2*a+o]===d?Y(e,r,a,p):Y(e,r,++p,i),p<=n&&(a=p+1),n<=p&&(i=p-1)}}(e,r,s,a,i,o%2),t(e,r,n,a,s-1,o+1),t(e,r,n,s+1,i,o+1)}}(o,s,n,0,o.length-1,0)};V.prototype.range=function(t,e,r,n){return function(t,e,r,n,a,i,o){for(var s,l,u=[0,t.length-1,0],c=[];u.length;){var h=u.pop(),d=u.pop(),f=u.pop();if(d-f<=o)for(var p=f;p<=d;p++)s=e[2*p],l=e[2*p+1],s>=r&&s<=a&&l>=n&&l<=i&&c.push(t[p]);else{var m=Math.floor((f+d)/2);s=e[2*m],l=e[2*m+1],s>=r&&s<=a&&l>=n&&l<=i&&c.push(t[m]);var g=(h+1)%2;(0===h?r<=s:n<=l)&&(u.push(f),u.push(m-1),u.push(g)),(0===h?a>=s:i>=l)&&(u.push(m+1),u.push(d),u.push(g))}}return c}(this.ids,this.coords,t,e,r,n,this.nodeSize)},V.prototype.within=function(t,e,r){return function(t,e,r,n,a,i){for(var o=[0,t.length-1,0],s=[],l=a*a;o.length;){var u=o.pop(),c=o.pop(),h=o.pop();if(c-h<=i)for(var d=h;d<=c;d++)B(e[2*d],e[2*d+1],r,n)<=l&&s.push(t[d]);else{var f=Math.floor((h+c)/2),p=e[2*f],m=e[2*f+1];B(p,m,r,n)<=l&&s.push(t[f]);var g=(u+1)%2;(0===u?r-a<=p:n-a<=m)&&(o.push(h),o.push(f-1),o.push(g)),(0===u?r+a>=p:n+a>=m)&&(o.push(f+1),o.push(c),o.push(g))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)};var W={minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,reduce:null,map:function(t){return t}},G=function(t){this.options=Q(Object.create(W),t),this.trees=new Array(this.options.maxZoom+1)};function q(t,e,r,n,a){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:a}}function Z(t,e){var r=t.geometry.coordinates,n=r[0],a=r[1];return{x:K(n),y:$(a),zoom:1/0,index:e,parentId:-1}}function X(t){return{type:"Feature",id:t.id,properties:J(t),geometry:{type:"Point",coordinates:[(n=t.x,360*(n-.5)),(e=t.y,r=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var e,r,n}function J(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return Q(Q({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function K(t){return t/360+.5}function $(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function Q(t,e){for(var r in e)t[r]=e[r];return t}function tt(t){return t.x}function et(t){return t.y}function rt(t,e,r,n,a,i){var o=a-r,s=i-n;if(0!==o||0!==s){var l=((t-r)*o+(e-n)*s)/(o*o+s*s);l>1?(r=a,n=i):l>0&&(r+=o*l,n+=s*l)}return(o=t-r)*o+(s=e-n)*s}function nt(t,e,r,n){var a={id:void 0===t?null:t,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)at(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n<e.length;n++)at(t,e[n]);else if("MultiPolygon"===r)for(n=0;n<e.length;n++)for(var a=0;a<e[n].length;a++)at(t,e[n][a])}(a),a}function at(t,e){for(var r=0;r<e.length;r+=3)t.minX=Math.min(t.minX,e[r]),t.minY=Math.min(t.minY,e[r+1]),t.maxX=Math.max(t.maxX,e[r]),t.maxY=Math.max(t.maxY,e[r+1])}function it(t,e,r,n){if(e.geometry){var a=e.geometry.coordinates,i=e.geometry.type,o=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),s=[],l=e.id;if(r.promoteId?l=e.properties[r.promoteId]:r.generateId&&(l=n||0),"Point"===i)ot(a,s);else if("MultiPoint"===i)for(var u=0;u<a.length;u++)ot(a[u],s);else if("LineString"===i)st(a,s,o,!1);else if("MultiLineString"===i){if(r.lineMetrics){for(u=0;u<a.length;u++)s=[],st(a[u],s,o,!1),t.push(nt(l,"LineString",s,e.properties));return}lt(a,s,o,!1)}else if("Polygon"===i)lt(a,s,o,!0);else{if("MultiPolygon"!==i){if("GeometryCollection"===i){for(u=0;u<e.geometry.geometries.length;u++)it(t,{id:l,geometry:e.geometry.geometries[u],properties:e.properties},r,n);return}throw new Error("Input data is not a valid GeoJSON object.")}for(u=0;u<a.length;u++){var c=[];lt(a[u],c,o,!0),s.push(c)}}t.push(nt(l,i,s,e.properties))}}function ot(t,e){e.push(ut(t[0])),e.push(ct(t[1])),e.push(0)}function st(t,e,r,n){for(var a,i,o=0,s=0;s<t.length;s++){var l=ut(t[s][0]),u=ct(t[s][1]);e.push(l),e.push(u),e.push(0),s>0&&(o+=n?(a*u-l*i)/2:Math.sqrt(Math.pow(l-a,2)+Math.pow(u-i,2))),a=l,i=u}var c=e.length-3;e[2]=1,function t(e,r,n,a){for(var i,o=a,s=n-r>>1,l=n-r,u=e[r],c=e[r+1],h=e[n],d=e[n+1],f=r+3;f<n;f+=3){var p=rt(e[f],e[f+1],u,c,h,d);if(p>o)i=f,o=p;else if(p===o){var m=Math.abs(f-s);m<l&&(i=f,l=m)}}o>a&&(i-r>3&&t(e,r,i,a),e[i+2]=o,n-i>3&&t(e,i,n,a))}(e,0,c,r),e[c+2]=1,e.size=Math.abs(o),e.start=0,e.end=e.size}function lt(t,e,r,n){for(var a=0;a<t.length;a++){var i=[];st(t[a],i,r,n),e.push(i)}}function ut(t){return t/360+.5}function ct(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function ht(t,e,r,n,a,i,o,s){if(n/=e,i>=(r/=e)&&o<n)return t;if(o<r||i>=n)return null;for(var l=[],u=0;u<t.length;u++){var c=t[u],h=c.geometry,d=c.type,f=0===a?c.minX:c.minY,p=0===a?c.maxX:c.maxY;if(f>=r&&p<n)l.push(c);else if(!(p<r||f>=n)){var m=[];if("Point"===d||"MultiPoint"===d)dt(h,m,r,n,a);else if("LineString"===d)ft(h,m,r,n,a,!1,s.lineMetrics);else if("MultiLineString"===d)mt(h,m,r,n,a,!1);else if("Polygon"===d)mt(h,m,r,n,a,!0);else if("MultiPolygon"===d)for(var g=0;g<h.length;g++){var y=[];mt(h[g],y,r,n,a,!0),y.length&&m.push(y)}if(m.length){if(s.lineMetrics&&"LineString"===d){for(g=0;g<m.length;g++)l.push(nt(c.id,d,m[g],c.tags));continue}"LineString"!==d&&"MultiLineString"!==d||(1===m.length?(d="LineString",m=m[0]):d="MultiLineString"),"Point"!==d&&"MultiPoint"!==d||(d=3===m.length?"Point":"MultiPoint"),l.push(nt(c.id,d,m,c.tags))}}}return l.length?l:null}function dt(t,e,r,n,a){for(var i=0;i<t.length;i+=3){var o=t[i+a];o>=r&&o<=n&&(e.push(t[i]),e.push(t[i+1]),e.push(t[i+2]))}}function ft(t,e,r,n,a,i,o){for(var s,l,u=pt(t),c=0===a?yt:vt,h=t.start,d=0;d<t.length-3;d+=3){var f=t[d],p=t[d+1],m=t[d+2],g=t[d+3],y=t[d+4],v=0===a?f:p,_=0===a?g:y,x=!1;o&&(s=Math.sqrt(Math.pow(f-g,2)+Math.pow(p-y,2))),v<r?_>r&&(l=c(u,f,p,g,y,r),o&&(u.start=h+s*l)):v>n?_<n&&(l=c(u,f,p,g,y,n),o&&(u.start=h+s*l)):gt(u,f,p,m),_<r&&v>=r&&(l=c(u,f,p,g,y,r),x=!0),_>n&&v<=n&&(l=c(u,f,p,g,y,n),x=!0),!i&&x&&(o&&(u.end=h+s*l),e.push(u),u=pt(t)),o&&(h+=s)}var b=t.length-3;f=t[b],p=t[b+1],m=t[b+2],(v=0===a?f:p)>=r&&v<=n&&gt(u,f,p,m),b=u.length-3,i&&b>=3&&(u[b]!==u[0]||u[b+1]!==u[1])&&gt(u,u[0],u[1],u[2]),u.length&&e.push(u)}function pt(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function mt(t,e,r,n,a,i){for(var o=0;o<t.length;o++)ft(t[o],e,r,n,a,i,!1)}function gt(t,e,r,n){t.push(e),t.push(r),t.push(n)}function yt(t,e,r,n,a,i){var o=(i-e)/(n-e);return t.push(i),t.push(r+(a-r)*o),t.push(1),o}function vt(t,e,r,n,a,i){var o=(i-r)/(a-r);return t.push(e+(n-e)*o),t.push(i),t.push(1),o}function _t(t,e){for(var r=[],n=0;n<t.length;n++){var a,i=t[n],o=i.type;if("Point"===o||"MultiPoint"===o||"LineString"===o)a=xt(i.geometry,e);else if("MultiLineString"===o||"Polygon"===o){a=[];for(var s=0;s<i.geometry.length;s++)a.push(xt(i.geometry[s],e))}else if("MultiPolygon"===o)for(a=[],s=0;s<i.geometry.length;s++){for(var l=[],u=0;u<i.geometry[s].length;u++)l.push(xt(i.geometry[s][u],e));a.push(l)}r.push(nt(i.id,o,a,i.tags))}return r}function xt(t,e){var r=[];r.size=t.size,void 0!==t.start&&(r.start=t.start,r.end=t.end);for(var n=0;n<t.length;n+=3)r.push(t[n]+e,t[n+1],t[n+2]);return r}function bt(t,e){if(t.transformed)return t;var r,n,a,i=1<<t.z,o=t.x,s=t.y;for(r=0;r<t.features.length;r++){var l=t.features[r],u=l.geometry,c=l.type;if(l.geometry=[],1===c)for(n=0;n<u.length;n+=2)l.geometry.push(wt(u[n],u[n+1],e,i,o,s));else for(n=0;n<u.length;n++){var h=[];for(a=0;a<u[n].length;a+=2)h.push(wt(u[n][a],u[n][a+1],e,i,o,s));l.geometry.push(h)}}return t.transformed=!0,t}function wt(t,e,r,n,a,i){return[Math.round(r*(t*n-a)),Math.round(r*(e*n-i))]}function Mt(t,e,r,n,a){for(var i=e===a.maxZoom?0:a.tolerance/((1<<e)*a.extent),o={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<t.length;s++){o.numFeatures++,kt(o,t[s],i,a);var l=t[s].minX,u=t[s].minY,c=t[s].maxX,h=t[s].maxY;l<o.minX&&(o.minX=l),u<o.minY&&(o.minY=u),c>o.maxX&&(o.maxX=c),h>o.maxY&&(o.maxY=h)}return o}function kt(t,e,r,n){var a=e.geometry,i=e.type,o=[];if("Point"===i||"MultiPoint"===i)for(var s=0;s<a.length;s+=3)o.push(a[s]),o.push(a[s+1]),t.numPoints++,t.numSimplified++;else if("LineString"===i)Tt(o,a,t,r,!1,!1);else if("MultiLineString"===i||"Polygon"===i)for(s=0;s<a.length;s++)Tt(o,a[s],t,r,"Polygon"===i,0===s);else if("MultiPolygon"===i)for(var l=0;l<a.length;l++){var u=a[l];for(s=0;s<u.length;s++)Tt(o,u[s],t,r,!0,0===s)}if(o.length){var c=e.tags||null;if("LineString"===i&&n.lineMetrics){for(var h in c={},e.tags)c[h]=e.tags[h];c.mapbox_clip_start=a.start/a.size,c.mapbox_clip_end=a.end/a.size}var d={geometry:o,type:"Polygon"===i||"MultiPolygon"===i?3:"LineString"===i||"MultiLineString"===i?2:1,tags:c};null!==e.id&&(d.id=e.id),t.features.push(d)}}function Tt(t,e,r,n,a,i){var o=n*n;if(n>0&&e.size<(a?o:n))r.numPoints+=e.length/3;else{for(var s=[],l=0;l<e.length;l+=3)(0===n||e[l+2]>o)&&(r.numSimplified++,s.push(e[l]),s.push(e[l+1])),r.numPoints++;a&&function(t,e){for(var r=0,n=0,a=t.length,i=a-2;n<a;i=n,n+=2)r+=(t[n]-t[i])*(t[n+1]+t[i+1]);if(r>0===e)for(n=0,a=t.length;n<a/2;n+=2){var o=t[n],s=t[n+1];t[n]=t[a-2-n],t[n+1]=t[a-1-n],t[a-2-n]=o,t[a-1-n]=s}}(s,i),t.push(s)}}function Lt(t,e){var r=(e=this.options=function(t,e){for(var r in e)t[r]=e[r];return t}(Object.create(this.options),e)).debug;if(r&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n<t.features.length;n++)it(r,t.features[n],e,n);else"Feature"===t.type?it(r,t,e):it(r,{geometry:t},e);return r}(t,e);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(n=function(t,e){var r=e.buffer/e.extent,n=t,a=ht(t,1,-1-r,r,0,-1,2,e),i=ht(t,1,1-r,2+r,0,-1,2,e);return(a||i)&&(n=ht(t,1,-r,1+r,0,-1,2,e)||[],a&&(n=_t(a,1).concat(n)),i&&(n=n.concat(_t(i,-1)))),n}(n,e)).length&&this.splitTile(n,0,0,0),r&&(n.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function At(t,e,r){return 32*((1<<t)*r+e)+t}function St(t,e){var r=t.tileID.canonical;if(!this._geoJSONIndex)return e(null,null);var n=this._geoJSONIndex.getTile(r.z,r.x,r.y);if(!n)return e(null,null);var a=new M(n.features),i=S(a);0===i.byteOffset&&i.byteLength===i.buffer.byteLength||(i=new Uint8Array(i)),e(null,{vectorTile:a,rawData:i.buffer})}G.prototype.load=function(t){var e=this.options,r=e.log,n=e.minZoom,a=e.maxZoom,i=e.nodeSize;r&&console.time("total time");var o="prepare "+t.length+" points";r&&console.time(o),this.points=t;for(var s=[],l=0;l<t.length;l++)t[l].geometry&&s.push(Z(t[l],l));this.trees[a+1]=new V(s,tt,et,i,Float32Array),r&&console.timeEnd(o);for(var u=a;u>=n;u--){var c=+Date.now();s=this._cluster(s,u),this.trees[u]=new V(s,tt,et,i,Float32Array),r&&console.log("z%d: %d clusters in %dms",u,s.length,+Date.now()-c)}return r&&console.timeEnd("total time"),this},G.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),a=180===t[2]?180:((t[2]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,a=180;else if(r>a){var o=this.getClusters([r,n,180,i],e),s=this.getClusters([-180,n,a,i],e);return o.concat(s)}for(var l=this.trees[this._limitZoom(e)],u=[],c=0,h=l.range(K(r),$(i),K(a),$(n));c<h.length;c+=1){var d=h[c],f=l.points[d];u.push(f.numPoints?X(f):this.points[f.index])}return u},G.prototype.getChildren=function(t){var e=t>>5,r=t%32,n="No cluster with the specified id.",a=this.trees[r];if(!a)throw new Error(n);var i=a.points[e];if(!i)throw new Error(n);for(var o=this.options.radius/(this.options.extent*Math.pow(2,r-1)),s=[],l=0,u=a.within(i.x,i.y,o);l<u.length;l+=1){var c=u[l],h=a.points[c];h.parentId===t&&s.push(h.numPoints?X(h):this.points[h.index])}if(0===s.length)throw new Error(n);return s},G.prototype.getLeaves=function(t,e,r){e=e||10,r=r||0;var n=[];return this._appendLeaves(n,t,e,r,0),n},G.prototype.getTile=function(t,e,r){var n=this.trees[this._limitZoom(t)],a=Math.pow(2,t),i=this.options,o=i.extent,s=i.radius/o,l=(r-s)/a,u=(r+1+s)/a,c={features:[]};return this._addTileFeatures(n.range((e-s)/a,l,(e+1+s)/a,u),n.points,e,r,a,c),0===e&&this._addTileFeatures(n.range(1-s/a,l,1,u),n.points,a,r,a,c),e===a-1&&this._addTileFeatures(n.range(0,l,s/a,u),n.points,-1,r,a,c),c.features.length?c:null},G.prototype.getClusterExpansionZoom=function(t){for(var e=t%32-1;e<=this.options.maxZoom;){var r=this.getChildren(t);if(e++,1!==r.length)break;t=r[0].properties.cluster_id}return e},G.prototype._appendLeaves=function(t,e,r,n,a){for(var i=0,o=this.getChildren(e);i<o.length;i+=1){var s=o[i],l=s.properties;if(l&&l.cluster?a+l.point_count<=n?a+=l.point_count:a=this._appendLeaves(t,l.cluster_id,r,n,a):a<n?a++:t.push(s),t.length===r)break}return a},G.prototype._addTileFeatures=function(t,e,r,n,a,i){for(var o=0,s=t;o<s.length;o+=1){var l=e[s[o]],u={type:1,geometry:[[Math.round(this.options.extent*(l.x*a-r)),Math.round(this.options.extent*(l.y*a-n))]],tags:l.numPoints?J(l):this.points[l.index].properties},c=l.numPoints?l.id:this.points[l.index].id;void 0!==c&&(u.id=c),i.features.push(u)}},G.prototype._limitZoom=function(t){return Math.max(this.options.minZoom,Math.min(t,this.options.maxZoom+1))},G.prototype._cluster=function(t,e){for(var r=[],n=this.options,a=n.radius,i=n.extent,o=n.reduce,s=a/(i*Math.pow(2,e)),l=0;l<t.length;l++){var u=t[l];if(!(u.zoom<=e)){u.zoom=e;for(var c=this.trees[e+1],h=c.within(u.x,u.y,s),d=u.numPoints||1,f=u.x*d,p=u.y*d,m=o?this._map(u,!0):null,g=(l<<5)+(e+1),y=0,v=h;y<v.length;y+=1){var _=v[y],x=c.points[_];if(!(x.zoom<=e)){x.zoom=e;var b=x.numPoints||1;f+=x.x*b,p+=x.y*b,d+=b,x.parentId=g,o&&o(m,this._map(x))}}1===d?r.push(u):(u.parentId=g,r.push(q(f/d,p/d,g,d,m)))}}return r},G.prototype._map=function(t,e){if(t.numPoints)return e?Q({},t.properties):t.properties;var r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?Q({},n):n},Lt.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Lt.prototype.splitTile=function(t,e,r,n,a,i,o){for(var s=[t,e,r,n],l=this.options,u=l.debug;s.length;){n=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var c=1<<e,h=At(e,r,n),d=this.tiles[h];if(!d&&(u>1&&console.time("creation"),d=this.tiles[h]=Mt(t,e,r,n,l),this.tileCoords.push({z:e,x:r,y:n}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,d.numFeatures,d.numPoints,d.numSimplified),console.timeEnd("creation"));var f="z"+e;this.stats[f]=(this.stats[f]||0)+1,this.total++}if(d.source=t,a){if(e===l.maxZoom||e===a)continue;var p=1<<a-e;if(r!==Math.floor(i/p)||n!==Math.floor(o/p))continue}else if(e===l.indexMaxZoom||d.numPoints<=l.indexMaxPoints)continue;if(d.source=null,0!==t.length){u>1&&console.time("clipping");var m,g,y,v,_,x,b=.5*l.buffer/l.extent,w=.5-b,M=.5+b,k=1+b;m=g=y=v=null,_=ht(t,c,r-b,r+M,0,d.minX,d.maxX,l),x=ht(t,c,r+w,r+k,0,d.minX,d.maxX,l),t=null,_&&(m=ht(_,c,n-b,n+M,1,d.minY,d.maxY,l),g=ht(_,c,n+w,n+k,1,d.minY,d.maxY,l),_=null),x&&(y=ht(x,c,n-b,n+M,1,d.minY,d.maxY,l),v=ht(x,c,n+w,n+k,1,d.minY,d.maxY,l),x=null),u>1&&console.timeEnd("clipping"),s.push(m||[],e+1,2*r,2*n),s.push(g||[],e+1,2*r,2*n+1),s.push(y||[],e+1,2*r+1,2*n),s.push(v||[],e+1,2*r+1,2*n+1)}}},Lt.prototype.getTile=function(t,e,r){var n=this.options,a=n.extent,i=n.debug;if(t<0||t>24)return null;var o=1<<t,s=At(t,e=(e%o+o)%o,r);if(this.tiles[s])return bt(this.tiles[s],a);i>1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var l,u=t,c=e,h=r;!l&&u>0;)u--,c=Math.floor(c/2),h=Math.floor(h/2),l=this.tiles[At(u,c,h)];return l&&l.source?(i>1&&console.log("found parent tile z%d-%d-%d",u,c,h),i>1&&console.time("drilling down"),this.splitTile(l.source,u,c,h,t,e,r),i>1&&console.timeEnd("drilling down"),this.tiles[s]?bt(this.tiles[s],a):null):null};var Et=function(e){function r(t,r,n){e.call(this,t,r,St),n&&(this.loadGeoJSON=n)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},r.prototype._loadData=function(){var e=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,n=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var a=!!(n&&n.request&&n.request.collectResourceTiming)&&new l.Performance(n.request);this.loadGeoJSON(n,(function(i,o){if(i||!o)return r(i);if("object"!=typeof o)return r(new Error("Input data given to '"+n.source+"' is not a valid GeoJSON object."));!function t(e,r){switch(e&&e.type||null){case"FeatureCollection":return e.features=e.features.map(v(t,r)),e;case"GeometryCollection":return e.geometries=e.geometries.map(v(t,r)),e;case"Feature":return e.geometry=t(e.geometry,r),e;case"Polygon":case"MultiPolygon":return function(t,e){return"Polygon"===t.type?t.coordinates=_(t.coordinates,e):"MultiPolygon"===t.type&&(t.coordinates=t.coordinates.map(v(_,e))),t}(e,r);default:return e}}(o,!0);try{e._geoJSONIndex=n.cluster?new G(function(e){var r=e.superclusterOptions,n=e.clusterProperties;if(!n||!r)return r;for(var a={},i={},o={accumulated:null,zoom:0},s={properties:null},l=Object.keys(n),u=0,c=l;u<c.length;u+=1){var h=c[u],d=n[h],f=d[0],p=d[1],m=t.createExpression(p),g=t.createExpression("string"==typeof f?[f,["accumulated"],["get",h]]:f);a[h]=m.value,i[h]=g.value}return r.map=function(t){s.properties=t;for(var e={},r=0,n=l;r<n.length;r+=1){var i=n[r];e[i]=a[i].evaluate(o,s)}return e},r.reduce=function(t,e){s.properties=e;for(var r=0,n=l;r<n.length;r+=1){var a=n[r];o.accumulated=t[a],t[a]=i[a].evaluate(o,s)}},r}(n)).load(o.features):new Lt(o,n.geojsonVtOptions)}catch(i){return r(i)}e.loaded={};var s={};if(a){var l=a.finish();l&&(s.resourceTiming={},s.resourceTiming[n.source]=JSON.parse(JSON.stringify(l)))}r(null,s)}))}},r.prototype.coalesce=function(){"Coalescing"===this._state?this._state="Idle":"NeedsLoadData"===this._state&&(this._state="Coalescing",this._loadData())},r.prototype.reloadTile=function(t,r){var n=this.loaded,a=t.uid;return n&&n[a]?e.prototype.reloadTile.call(this,t,r):this.loadTile(t,r)},r.prototype.loadGeoJSON=function(e,r){if(e.request)t.getJSON(e.request,r);else{if("string"!=typeof e.data)return r(new Error("Input data given to '"+e.source+"' is not a valid GeoJSON object."));try{return r(null,JSON.parse(e.data))}catch(t){return r(new Error("Input data given to '"+e.source+"' is not a valid GeoJSON object."))}}},r.prototype.removeSource=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),e()},r.prototype.getClusterExpansionZoom=function(t,e){e(null,this._geoJSONIndex.getClusterExpansionZoom(t.clusterId))},r.prototype.getClusterChildren=function(t,e){e(null,this._geoJSONIndex.getChildren(t.clusterId))},r.prototype.getClusterLeaves=function(t,e){e(null,this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset))},r}(h),Ct=function(e){var r=this;this.self=e,this.actor=new t.Actor(e,this),this.layerIndexes={},this.workerSourceTypes={vector:h,geojson:Et},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(t,e){if(r.workerSourceTypes[t])throw new Error('Worker source with name "'+t+'" already registered.');r.workerSourceTypes[t]=e},this.self.registerRTLTextPlugin=function(e){if(t.plugin.isLoaded())throw new Error("RTL text plugin already registered.");t.plugin.applyArabicShaping=e.applyArabicShaping,t.plugin.processBidirectionalText=e.processBidirectionalText,t.plugin.processStyledBidirectionalText=e.processStyledBidirectionalText}};return Ct.prototype.setReferrer=function(t,e){this.referrer=e},Ct.prototype.setLayers=function(t,e,r){this.getLayerIndex(t).replace(e),r()},Ct.prototype.updateLayers=function(t,e,r){this.getLayerIndex(t).update(e.layers,e.removedIds),r()},Ct.prototype.loadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).loadTile(e,r)},Ct.prototype.loadDEMTile=function(t,e,r){this.getDEMWorkerSource(t,e.source).loadTile(e,r)},Ct.prototype.reloadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).reloadTile(e,r)},Ct.prototype.abortTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).abortTile(e,r)},Ct.prototype.removeTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).removeTile(e,r)},Ct.prototype.removeDEMTile=function(t,e){this.getDEMWorkerSource(t,e.source).removeTile(e)},Ct.prototype.removeSource=function(t,e,r){if(this.workerSources[t]&&this.workerSources[t][e.type]&&this.workerSources[t][e.type][e.source]){var n=this.workerSources[t][e.type][e.source];delete this.workerSources[t][e.type][e.source],void 0!==n.removeSource?n.removeSource(e,r):r()}},Ct.prototype.loadWorkerSource=function(t,e,r){try{this.self.importScripts(e.url),r()}catch(t){r(t.toString())}},Ct.prototype.loadRTLTextPlugin=function(e,r,n){try{t.plugin.isLoaded()||(this.self.importScripts(r),n(t.plugin.isLoaded()?null:new Error("RTL Text Plugin failed to import scripts from "+r)))}catch(t){n(t.toString())}},Ct.prototype.getLayerIndex=function(t){var e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new n),e},Ct.prototype.getWorkerSource=function(t,e,r){var n=this;if(this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),!this.workerSources[t][e][r]){var a={send:function(e,r,a){n.actor.send(e,r,a,t)}};this.workerSources[t][e][r]=new this.workerSourceTypes[e](a,this.getLayerIndex(t))}return this.workerSources[t][e][r]},Ct.prototype.getDEMWorkerSource=function(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new d),this.demWorkerSources[t][e]},Ct.prototype.enforceCacheSizeLimit=function(e,r){t.enforceCacheSizeLimit(r)},"undefined"!=typeof WorkerGlobalScope&&void 0!==t.window&&t.window instanceof WorkerGlobalScope&&(t.window.worker=new Ct(t.window)),Ct})),n(0,(function(t){var e=t.createCommonjsModule((function(t){function e(t){return!!("undefined"!=typeof window&&"undefined"!=typeof document&&Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray&&Function.prototype&&Function.prototype.bind&&Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions&&"JSON"in window&&"parse"in JSON&&"stringify"in JSON&&function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var t,e,r=new Blob([""],{type:"text/javascript"}),n=URL.createObjectURL(r);try{e=new Worker(n),t=!0}catch(e){t=!1}return e&&e.terminate(),URL.revokeObjectURL(n),t}()&&"Uint8ClampedArray"in window&&ArrayBuffer.isView&&function(t){return void 0===r[t]&&(r[t]=function(t){var r=document.createElement("canvas"),n=Object.create(e.webGLContextAttributes);return n.failIfMajorPerformanceCaveat=t,r.probablySupportsContext?r.probablySupportsContext("webgl",n)||r.probablySupportsContext("experimental-webgl",n):r.supportsContext?r.supportsContext("webgl",n)||r.supportsContext("experimental-webgl",n):r.getContext("webgl",n)||r.getContext("experimental-webgl",n)}(t)),r[t]}(t&&t.failIfMajorPerformanceCaveat))}t.exports?t.exports=e:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=e);var r={};e.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}})),r={create:function(e,r,n){var a=t.window.document.createElement(e);return void 0!==r&&(a.className=r),n&&n.appendChild(a),a},createNS:function(e,r){return t.window.document.createElementNS(e,r)}},n=t.window.document.documentElement.style;function a(t){if(!n)return t[0];for(var e=0;e<t.length;e++)if(t[e]in n)return t[e];return t[0]}var i,o=a(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);r.disableDrag=function(){n&&o&&(i=n[o],n[o]="none")},r.enableDrag=function(){n&&o&&(n[o]=i)};var s=a(["transform","WebkitTransform"]);r.setTransform=function(t,e){t.style[s]=e};var l=!1;try{var u=Object.defineProperty({},"passive",{get:function(){l=!0}});t.window.addEventListener("test",u,u),t.window.removeEventListener("test",u,u)}catch(t){l=!1}r.addEventListener=function(t,e,r,n){void 0===n&&(n={}),"passive"in n&&l?t.addEventListener(e,r,n):t.addEventListener(e,r,n.capture)},r.removeEventListener=function(t,e,r,n){void 0===n&&(n={}),"passive"in n&&l?t.removeEventListener(e,r,n):t.removeEventListener(e,r,n.capture)};var c=function(e){e.preventDefault(),e.stopPropagation(),t.window.removeEventListener("click",c,!0)};function h(t){var e=t.userImage;return!!(e&&e.render&&e.render())&&(t.data.replace(new Uint8Array(e.data.buffer)),!0)}r.suppressClick=function(){t.window.addEventListener("click",c,!0),t.window.setTimeout((function(){t.window.removeEventListener("click",c,!0)}),0)},r.mousePos=function(e,r){var n=e.getBoundingClientRect(),a=t.window.TouchEvent&&r instanceof t.window.TouchEvent?r.touches[0]:r;return new t.Point(a.clientX-n.left-e.clientLeft,a.clientY-n.top-e.clientTop)},r.touchPos=function(e,r){for(var n=e.getBoundingClientRect(),a=[],i="touchend"===r.type?r.changedTouches:r.touches,o=0;o<i.length;o++)a.push(new t.Point(i[o].clientX-n.left-e.clientLeft,i[o].clientY-n.top-e.clientTop));return a},r.mouseButton=function(e){return void 0!==t.window.InstallTrigger&&2===e.button&&e.ctrlKey&&t.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:e.button},r.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var d=function(e){function r(){e.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.isLoaded=function(){return this.loaded},r.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,r=this.requestors;e<r.length;e+=1){var n=r[e],a=n.ids,i=n.callback;this._notify(a,i)}this.requestors=[]}},r.prototype.getImage=function(t){return this.images[t]},r.prototype.addImage=function(t,e){this.images[t]=e},r.prototype.updateImage=function(t,e){var r=this.images[t];e.version=r.version+1,this.images[t]=e,this.updatedImages[t]=!0},r.prototype.removeImage=function(t){var e=this.images[t];delete this.images[t],delete this.patterns[t],e.userImage&&e.userImage.onRemove&&e.userImage.onRemove()},r.prototype.listImages=function(){return Object.keys(this.images)},r.prototype.getImages=function(t,e){var r=!0;if(!this.isLoaded())for(var n=0,a=t;n<a.length;n+=1){var i=a[n];this.images[i]||(r=!1)}this.isLoaded()||r?this._notify(t,e):this.requestors.push({ids:t,callback:e})},r.prototype._notify=function(e,r){for(var n={},a=0,i=e;a<i.length;a+=1){var o=i[a];this.images[o]||this.fire(new t.Event("styleimagemissing",{id:o}));var s=this.images[o];s?n[o]={data:s.data.clone(),pixelRatio:s.pixelRatio,sdf:s.sdf,version:s.version,hasRenderCallback:Boolean(s.userImage&&s.userImage.render)}:t.warnOnce('Image "'+o+'" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.')}r(null,n)},r.prototype.getPixelSize=function(){var t=this.atlasImage;return{width:t.width,height:t.height}},r.prototype.getPattern=function(e){var r=this.patterns[e],n=this.getImage(e);if(!n)return null;if(r&&r.position.version===n.version)return r.position;if(r)r.position.version=n.version;else{var a={w:n.data.width+2,h:n.data.height+2,x:0,y:0},i=new t.ImagePosition(a,n);this.patterns[e]={bin:a,position:i}}return this._updatePatternAtlas(),this.patterns[e].position},r.prototype.bind=function(e){var r=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new t.Texture(e,this.atlasImage,r.RGBA),this.atlasTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)},r.prototype._updatePatternAtlas=function(){var e=[];for(var r in this.patterns)e.push(this.patterns[r].bin);var n=t.potpack(e),a=n.w,i=n.h,o=this.atlasImage;for(var s in o.resize({width:a||1,height:i||1}),this.patterns){var l=this.patterns[s].bin,u=l.x+1,c=l.y+1,h=this.images[s].data,d=h.width,f=h.height;t.RGBAImage.copy(h,o,{x:0,y:0},{x:u,y:c},{width:d,height:f}),t.RGBAImage.copy(h,o,{x:0,y:f-1},{x:u,y:c-1},{width:d,height:1}),t.RGBAImage.copy(h,o,{x:0,y:0},{x:u,y:c+f},{width:d,height:1}),t.RGBAImage.copy(h,o,{x:d-1,y:0},{x:u-1,y:c},{width:1,height:f}),t.RGBAImage.copy(h,o,{x:0,y:0},{x:u+d,y:c},{width:1,height:f})}this.dirty=!0},r.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},r.prototype.dispatchRenderCallbacks=function(t){for(var e=0,r=t;e<r.length;e+=1){var n=r[e];if(!this.callbackDispatchedThisFrame[n]){this.callbackDispatchedThisFrame[n]=!0;var a=this.images[n];h(a)&&this.updateImage(n,a)}}},r}(t.Evented),f=m,p=1e20;function m(t,e,r,n,a,i){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=n||.25,this.fontFamily=a||"sans-serif",this.fontWeight=i||"normal",this.radius=r||8;var o=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=o,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(o*o),this.gridInner=new Float64Array(o*o),this.f=new Float64Array(o),this.d=new Float64Array(o),this.z=new Float64Array(o+1),this.v=new Int16Array(o),this.middle=Math.round(o/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function g(t,e,r,n,a,i,o){for(var s=0;s<e;s++){for(var l=0;l<r;l++)n[l]=t[l*e+s];for(y(n,a,i,o,r),l=0;l<r;l++)t[l*e+s]=a[l]}for(l=0;l<r;l++){for(s=0;s<e;s++)n[s]=t[l*e+s];for(y(n,a,i,o,e),s=0;s<e;s++)t[l*e+s]=Math.sqrt(a[s])}}function y(t,e,r,n,a){r[0]=0,n[0]=-p,n[1]=+p;for(var i=1,o=0;i<a;i++){for(var s=(t[i]+i*i-(t[r[o]]+r[o]*r[o]))/(2*i-2*r[o]);s<=n[o];)o--,s=(t[i]+i*i-(t[r[o]]+r[o]*r[o]))/(2*i-2*r[o]);r[++o]=i,n[o]=s,n[o+1]=+p}for(i=0,o=0;i<a;i++){for(;n[o+1]<i;)o++;e[i]=(i-r[o])*(i-r[o])+t[r[o]]}}m.prototype.draw=function(t){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(t,this.buffer,this.middle);for(var e=this.ctx.getImageData(0,0,this.size,this.size),r=new Uint8ClampedArray(this.size*this.size),n=0;n<this.size*this.size;n++){var a=e.data[4*n+3]/255;this.gridOuter[n]=1===a?0:0===a?p:Math.pow(Math.max(0,.5-a),2),this.gridInner[n]=1===a?p:0===a?0:Math.pow(Math.max(0,a-.5),2)}for(g(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),g(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),n=0;n<this.size*this.size;n++){var i=this.gridOuter[n]-this.gridInner[n];r[n]=Math.max(0,Math.min(255,Math.round(255-255*(i/this.radius+this.cutoff))))}return r};var v=function(t,e){this.requestManager=t,this.localIdeographFontFamily=e,this.entries={}};v.prototype.setURL=function(t){this.url=t},v.prototype.getGlyphs=function(e,r){var n=this,a=[];for(var i in e)for(var o=0,s=e[i];o<s.length;o+=1){var l=s[o];a.push({stack:i,id:l})}t.asyncAll(a,(function(t,e){var r=t.stack,a=t.id,i=n.entries[r];i||(i=n.entries[r]={glyphs:{},requests:{}});var o=i.glyphs[a];if(void 0===o)if(o=n._tinySDF(i,r,a))e(null,{stack:r,id:a,glyph:o});else{var s=Math.floor(a/256);if(256*s>65535)e(new Error("glyphs > 65535 not supported"));else{var l=i.requests[s];l||(l=i.requests[s]=[],v.loadGlyphRange(r,s,n.url,n.requestManager,(function(t,e){if(e)for(var r in e)i.glyphs[+r]=e[+r];for(var n=0,a=l;n<a.length;n+=1)(0,a[n])(t,e);delete i.requests[s]}))),l.push((function(t,n){t?e(t):n&&e(null,{stack:r,id:a,glyph:n[a]||null})}))}}else e(null,{stack:r,id:a,glyph:o})}),(function(t,e){if(t)r(t);else if(e){for(var n={},a=0,i=e;a<i.length;a+=1){var o=i[a],s=o.stack,l=o.id,u=o.glyph;(n[s]||(n[s]={}))[l]=u&&{id:u.id,bitmap:u.bitmap.clone(),metrics:u.metrics}}r(null,n)}}))},v.prototype._tinySDF=function(e,r,n){var a=this.localIdeographFontFamily;if(a&&(t.isChar["CJK Unified Ideographs"](n)||t.isChar["Hangul Syllables"](n)||t.isChar.Hiragana(n)||t.isChar.Katakana(n))){var i=e.tinySDF;if(!i){var o="400";/bold/i.test(r)?o="900":/medium/i.test(r)?o="500":/light/i.test(r)&&(o="200"),i=e.tinySDF=new v.TinySDF(24,3,8,.25,a,o)}return{id:n,bitmap:new t.AlphaImage({width:30,height:30},i.draw(String.fromCharCode(n))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},v.loadGlyphRange=function(e,r,n,a,i){var o=256*r,s=o+255,l=a.transformRequest(a.normalizeGlyphsURL(n).replace("{fontstack}",e).replace("{range}",o+"-"+s),t.ResourceType.Glyphs);t.getArrayBuffer(l,(function(e,r){if(e)i(e);else if(r){for(var n={},a=0,o=t.parseGlyphPBF(r);a<o.length;a+=1){var s=o[a];n[s.id]=s}i(null,n)}}))},v.TinySDF=f;var _=function(){this.specification=t.styleSpec.light.position};_.prototype.possiblyEvaluate=function(e,r){return t.sphericalToCartesian(e.expression.evaluate(r))},_.prototype.interpolate=function(e,r,n){return{x:t.number(e.x,r.x,n),y:t.number(e.y,r.y,n),z:t.number(e.z,r.z,n)}};var x=new t.Properties({anchor:new t.DataConstantProperty(t.styleSpec.light.anchor),position:new _,color:new t.DataConstantProperty(t.styleSpec.light.color),intensity:new t.DataConstantProperty(t.styleSpec.light.intensity)}),b=function(e){function r(r){e.call(this),this._transitionable=new t.Transitionable(x),this.setLight(r),this._transitioning=this._transitionable.untransitioned()}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.getLight=function(){return this._transitionable.serialize()},r.prototype.setLight=function(e,r){if(void 0===r&&(r={}),!this._validate(t.validateLight,e,r))for(var n in e){var a=e[n];t.endsWith(n,"-transition")?this._transitionable.setTransition(n.slice(0,-"-transition".length),a):this._transitionable.setValue(n,a)}},r.prototype.updateTransitions=function(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)},r.prototype.hasTransition=function(){return this._transitioning.hasTransition()},r.prototype.recalculate=function(t){this.properties=this._transitioning.possiblyEvaluate(t)},r.prototype._validate=function(e,r,n){return(!n||!1!==n.validate)&&t.emitValidationErrors(this,e.call(t.validateStyle,t.extend({value:r,style:{glyphs:!0,sprite:!0},styleSpec:t.styleSpec})))},r}(t.Evented),w=function(t,e){this.width=t,this.height=e,this.nextRow=0,this.bytes=4,this.data=new Uint8Array(this.width*this.height*this.bytes),this.positions={}};w.prototype.getDash=function(t,e){var r=t.join(",")+String(e);return this.positions[r]||(this.positions[r]=this.addDash(t,e)),this.positions[r]},w.prototype.addDash=function(e,r){var n=r?7:0,a=2*n+1;if(this.nextRow+a>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var i=0,o=0;o<e.length;o++)i+=e[o];for(var s=this.width/i,l=s/2,u=e.length%2==1,c=-n;c<=n;c++)for(var h=this.nextRow+n+c,d=this.width*h,f=u?-e[e.length-1]:0,p=e[0],m=1,g=0;g<this.width;g++){for(;p<g/s;)f=p,p+=e[m],u&&m===e.length-1&&(p+=e[0]),m++;var y=Math.abs(g-f*s),v=Math.abs(g-p*s),_=Math.min(y,v),x=m%2==1,b=void 0;if(r){var w=n?c/n*(l+1):0;if(x){var M=l-Math.abs(w);b=Math.sqrt(_*_+M*M)}else b=l-Math.sqrt(_*_+w*w)}else b=(x?1:-1)*_;this.data[3+4*(d+g)]=Math.max(0,Math.min(255,b+128))}var k={y:(this.nextRow+n+.5)/this.height,height:2*n/this.height,width:i};return this.nextRow+=a,this.dirty=!0,k},w.prototype.bind=function(t){var e=t.gl;this.texture?(e.bindTexture(e.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,e.texSubImage2D(e.TEXTURE_2D,0,0,0,this.width,this.height,e.RGBA,e.UNSIGNED_BYTE,this.data))):(this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,this.width,this.height,0,e.RGBA,e.UNSIGNED_BYTE,this.data))};var M=function e(r,n){this.workerPool=r,this.actors=[],this.currentActor=0,this.id=t.uniqueId();for(var a=this.workerPool.acquire(this.id),i=0;i<a.length;i++){var o=a[i],s=new e.Actor(o,n,this.id);s.name="Worker "+i,this.actors.push(s)}};function k(e,r,n){var a=function(a,i){if(a)return n(a);if(i){var o=t.pick(i,["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds"]);i.vector_layers&&(o.vectorLayers=i.vector_layers,o.vectorLayerIds=o.vectorLayers.map((function(t){return t.id}))),e.url&&(o.tiles=r.canonicalizeTileset(o,e.url)),n(null,o)}};return e.url?t.getJSON(r.transformRequest(r.normalizeSourceURL(e.url),t.ResourceType.Source),a):t.browser.frame((function(){return a(null,e)}))}M.prototype.broadcast=function(e,r,n){n=n||function(){},t.asyncAll(this.actors,(function(t,n){t.send(e,r,n)}),n)},M.prototype.send=function(t,e,r,n){return("number"!=typeof n||isNaN(n))&&(n=this.currentActor=(this.currentActor+1)%this.actors.length),this.actors[n].send(t,e,r),n},M.prototype.remove=function(){this.actors.forEach((function(t){t.remove()})),this.actors=[],this.workerPool.release(this.id)},M.Actor=t.Actor;var T=function(e,r,n){this.bounds=t.LngLatBounds.convert(this.validateBounds(e)),this.minzoom=r||0,this.maxzoom=n||24};T.prototype.validateBounds=function(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]},T.prototype.contains=function(e){var r=Math.pow(2,e.z),n=Math.floor(t.mercatorXfromLng(this.bounds.getWest())*r),a=Math.floor(t.mercatorYfromLat(this.bounds.getNorth())*r),i=Math.ceil(t.mercatorXfromLng(this.bounds.getEast())*r),o=Math.ceil(t.mercatorYfromLat(this.bounds.getSouth())*r);return e.x>=n&&e.x<i&&e.y>=a&&e.y<o};var L=function(e){function r(r,n,a,i){if(e.call(this),this.id=r,this.dispatcher=a,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,t.extend(this,t.pick(n,["url","scheme","tileSize"])),this._options=t.extend({type:"vector"},n),this._collectResourceTiming=n.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(i)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){var e=this;this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=k(this._options,this.map._requestManager,(function(r,n){e._tileJSONRequest=null,r?e.fire(new t.ErrorEvent(r)):n&&(t.extend(e,n),n.bounds&&(e.tileBounds=new T(n.bounds,e.minzoom,e.maxzoom)),t.postTurnstileEvent(n.tiles),t.postMapLoadEvent(n.tiles,e.map._getMapId(),e.map._requestManager._skuToken),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))}))},r.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},r.prototype.serialize=function(){return t.extend({},this._options)},r.prototype.loadTile=function(e,r){var n=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.url,null),a={request:this.map._requestManager.transformRequest(n,t.ResourceType.Tile),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes};function i(n,a){return e.aborted?r(null):n&&404!==n.status?r(n):(a&&a.resourceTiming&&(e.resourceTiming=a.resourceTiming),this.map._refreshExpiredTiles&&a&&e.setExpiryData(a),e.loadVectorData(a,this.map.painter),t.cacheEntryPossiblyAdded(this.dispatcher),r(null),void(e.reloadCallback&&(this.loadTile(e,e.reloadCallback),e.reloadCallback=null)))}a.request.collectResourceTiming=this._collectResourceTiming,void 0===e.workerID||"expired"===e.state?e.workerID=this.dispatcher.send("loadTile",a,i.bind(this)):"loading"===e.state?e.reloadCallback=r:this.dispatcher.send("reloadTile",a,i.bind(this),e.workerID)},r.prototype.abortTile=function(t){this.dispatcher.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0,t.workerID)},r.prototype.unloadTile=function(t){t.unloadVectorData(),this.dispatcher.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0,t.workerID)},r.prototype.hasTransition=function(){return!1},r}(t.Evented),A=function(e){function r(r,n,a,i){e.call(this),this.id=r,this.dispatcher=a,this.setEventedParent(i),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=t.extend({},n),t.extend(this,t.pick(n,["url","scheme","tileSize"]))}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){var e=this;this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=k(this._options,this.map._requestManager,(function(r,n){e._tileJSONRequest=null,r?e.fire(new t.ErrorEvent(r)):n&&(t.extend(e,n),n.bounds&&(e.tileBounds=new T(n.bounds,e.minzoom,e.maxzoom)),t.postTurnstileEvent(n.tiles),t.postMapLoadEvent(n.tiles,e.map._getMapId(),e.map._requestManager._skuToken),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))}))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},r.prototype.serialize=function(){return t.extend({},this._options)},r.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},r.prototype.loadTile=function(e,r){var n=this,a=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.url,this.tileSize);e.request=t.getImage(this.map._requestManager.transformRequest(a,t.ResourceType.Tile),(function(a,i){if(delete e.request,e.aborted)e.state="unloaded",r(null);else if(a)e.state="errored",r(a);else if(i){n.map._refreshExpiredTiles&&e.setExpiryData(i),delete i.cacheControl,delete i.expires;var o=n.map.painter.context,s=o.gl;e.texture=n.map.painter.getTileTexture(i.width),e.texture?e.texture.update(i,{useMipmap:!0}):(e.texture=new t.Texture(o,i,s.RGBA,{useMipmap:!0}),e.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_NEAREST),o.extTextureFilterAnisotropic&&s.texParameterf(s.TEXTURE_2D,o.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,o.extTextureFilterAnisotropicMax)),e.state="loaded",t.cacheEntryPossiblyAdded(n.dispatcher),r(null)}}))},r.prototype.abortTile=function(t,e){t.request&&(t.request.cancel(),delete t.request),e()},r.prototype.unloadTile=function(t,e){t.texture&&this.map.painter.saveTileTexture(t.texture),e()},r.prototype.hasTransition=function(){return!1},r}(t.Evented),S=function(e){function r(r,n,a,i){e.call(this,r,n,a,i),this.type="raster-dem",this.maxzoom=22,this._options=t.extend({},n),this.encoding=n.encoding||"mapbox"}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},r.prototype.loadTile=function(e,r){var n=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.url,this.tileSize);e.request=t.getImage(this.map._requestManager.transformRequest(n,t.ResourceType.Tile),function(n,a){if(delete e.request,e.aborted)e.state="unloaded",r(null);else if(n)e.state="errored",r(n);else if(a){this.map._refreshExpiredTiles&&e.setExpiryData(a),delete a.cacheControl,delete a.expires;var i=t.browser.getImageData(a),o={uid:e.uid,coord:e.tileID,source:this.id,rawImageData:i,encoding:this.encoding};e.workerID&&"expired"!==e.state||(e.workerID=this.dispatcher.send("loadDEMTile",o,function(t,n){t&&(e.state="errored",r(t)),n&&(e.dem=n,e.needsHillshadePrepare=!0,e.state="loaded",r(null))}.bind(this)))}}.bind(this)),e.neighboringTiles=this._getNeighboringTiles(e.tileID)},r.prototype._getNeighboringTiles=function(e){var r=e.canonical,n=Math.pow(2,r.z),a=(r.x-1+n)%n,i=0===r.x?e.wrap-1:e.wrap,o=(r.x+1+n)%n,s=r.x+1===n?e.wrap+1:e.wrap,l={};return l[new t.OverscaledTileID(e.overscaledZ,i,r.z,a,r.y).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,o,r.y).key]={backfilled:!1},r.y>0&&(l[new t.OverscaledTileID(e.overscaledZ,i,r.z,a,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,o,r.y-1).key]={backfilled:!1}),r.y+1<n&&(l[new t.OverscaledTileID(e.overscaledZ,i,r.z,a,r.y+1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y+1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,o,r.y+1).key]={backfilled:!1}),l},r.prototype.unloadTile=function(t){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",this.dispatcher.send("removeDEMTile",{uid:t.uid,source:this.id},void 0,t.workerID)},r}(A),E=function(e){function r(r,n,a,i){e.call(this),this.id=r,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this.dispatcher=a,this.setEventedParent(i),this._data=n.data,this._options=t.extend({},n),this._collectResourceTiming=n.collectResourceTiming,this._resourceTiming=[],void 0!==n.maxzoom&&(this.maxzoom=n.maxzoom),n.type&&(this.type=n.type),n.attribution&&(this.attribution=n.attribution);var o=t.EXTENT/this.tileSize;this.workerOptions=t.extend({source:this.id,cluster:n.cluster||!1,geojsonVtOptions:{buffer:(void 0!==n.buffer?n.buffer:128)*o,tolerance:(void 0!==n.tolerance?n.tolerance:.375)*o,extent:t.EXTENT,maxZoom:this.maxzoom,lineMetrics:n.lineMetrics||!1,generateId:n.generateId||!1},superclusterOptions:{maxZoom:void 0!==n.clusterMaxZoom?Math.min(n.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,extent:t.EXTENT,radius:(n.clusterRadius||50)*o,log:!1},clusterProperties:n.clusterProperties},n.workerOptions)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){var e=this;this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(r){if(r)e.fire(new t.ErrorEvent(r));else{var n={dataType:"source",sourceDataType:"metadata"};e._collectResourceTiming&&e._resourceTiming&&e._resourceTiming.length>0&&(n.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",n))}}))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setData=function(e){var r=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)r.fire(new t.ErrorEvent(e));else{var n={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(n.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new t.Event("data",n))}})),this},r.prototype.getClusterExpansionZoom=function(t,e){return this.dispatcher.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e,this.workerID),this},r.prototype.getClusterChildren=function(t,e){return this.dispatcher.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e,this.workerID),this},r.prototype.getClusterLeaves=function(t,e,r,n){return this.dispatcher.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:r},n,this.workerID),this},r.prototype._updateWorkerData=function(e){var r=this,n=t.extend({},this.workerOptions),a=this._data;"string"==typeof a?(n.request=this.map._requestManager.transformRequest(t.browser.resolveURL(a),t.ResourceType.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(a),this.workerID=this.dispatcher.send(this.type+".loadData",n,(function(t,a){r._removed||a&&a.abandoned||(r._loaded=!0,a&&a.resourceTiming&&a.resourceTiming[r.id]&&(r._resourceTiming=a.resourceTiming[r.id].slice(0)),r.dispatcher.send(r.type+".coalesce",{source:n.source},null,r.workerID),e(t))}),this.workerID)},r.prototype.loadTile=function(e,r){var n=this,a=void 0===e.workerID?"loadTile":"reloadTile",i={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes};e.workerID=this.dispatcher.send(a,i,(function(t,i){return e.unloadVectorData(),e.aborted?r(null):t?r(t):(e.loadVectorData(i,n.map.painter,"reloadTile"===a),r(null))}),this.workerID)},r.prototype.abortTile=function(t){t.aborted=!0},r.prototype.unloadTile=function(t){t.unloadVectorData(),this.dispatcher.send("removeTile",{uid:t.uid,type:this.type,source:this.id},null,t.workerID)},r.prototype.onRemove=function(){this._removed=!0,this.dispatcher.send("removeSource",{type:this.type,source:this.id},null,this.workerID)},r.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(t.Evented),C=function(e){function r(t,r,n,a){e.call(this),this.id=t,this.dispatcher=n,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this.setEventedParent(a),this.options=r}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(e,r){var n=this;this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),(function(a,i){a?n.fire(new t.ErrorEvent(a)):i&&(n.image=i,e&&(n.coordinates=e),r&&r(),n._finishLoading())}))},r.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null})),this):this},r.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setCoordinates=function(e){var r=this;this.coordinates=e;var n=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var r=1/0,n=1/0,a=-1/0,i=-1/0,o=0,s=e;o<s.length;o+=1){var l=s[o];r=Math.min(r,l.x),n=Math.min(n,l.y),a=Math.max(a,l.x),i=Math.max(i,l.y)}var u=a-r,c=i-n,h=Math.max(u,c),d=Math.max(0,Math.floor(-Math.log(h)/Math.LN2)),f=Math.pow(2,d);return new t.CanonicalTileID(d,Math.floor((r+a)/2*f),Math.floor((n+i)/2*f))}(n),this.minzoom=this.maxzoom=this.tileID.z;var a=n.map((function(t){return r.tileID.getTilePoint(t)._round()}));return this._boundsArray=new t.StructArrayLayout4i8,this._boundsArray.emplaceBack(a[0].x,a[0].y,0,0),this._boundsArray.emplaceBack(a[1].x,a[1].y,t.EXTENT,0),this._boundsArray.emplaceBack(a[3].x,a[3].y,0,t.EXTENT),this._boundsArray.emplaceBack(a[2].x,a[2].y,t.EXTENT,t.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})),this},r.prototype.prepare=function(){if(0!==Object.keys(this.tiles).length&&this.image){var e=this.map.painter.context,r=e.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,t.rasterBoundsAttributes.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new t.Texture(e,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var a=this.tiles[n];"loaded"!==a.state&&(a.state="loaded",a.texture=this.texture)}}},r.prototype.loadTile=function(t,e){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},e(null)):(t.state="errored",e(null))},r.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return!1},r}(t.Evented),D=function(e){function r(t,r,n,a){e.call(this,t,r,n,a),this.roundZoom=!0,this.type="video",this.options=r}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){var e=this,r=this.options;this.urls=[];for(var n=0,a=r.urls;n<a.length;n+=1){var i=a[n];this.urls.push(this.map._requestManager.transformRequest(i,t.ResourceType.Source).url)}t.getVideo(this.urls,(function(r,n){r?e.fire(new t.ErrorEvent(r)):n&&(e.video=n,e.video.loop=!0,e.video.addEventListener("playing",(function(){e.map.triggerRepaint()})),e.map&&e.video.play(),e._finishLoading())}))},r.prototype.getVideo=function(){return this.video},r.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},r.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,r=e.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,t.rasterBoundsAttributes.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var a=this.tiles[n];"loaded"!==a.state&&(a.state="loaded",a.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this.video&&!this.video.paused},r}(C),P=function(e){function r(r,n,a,i){e.call(this,r,n,a,i),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some((function(t){return!Array.isArray(t)||2!==t.length||t.some((function(t){return"number"!=typeof t}))}))||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "coordinates"'))),n.animate&&"boolean"!=typeof n.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"==typeof n.canvas||n.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},r.prototype.getCanvas=function(){return this.canvas},r.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},r.prototype.onRemove=function(){this.pause()},r.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var r=this.map.painter.context,n=r.gl;for(var a in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,t.rasterBoundsAttributes.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(r,this.canvas,n.RGBA,{premultiply:!0}),this.tiles){var i=this.tiles[a];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this._playing},r.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];t<e.length;t+=1){var r=e[t];if(isNaN(r)||r<=0)return!0}return!1},r}(C),O={vector:L,raster:A,"raster-dem":S,geojson:E,video:D,image:C,canvas:P};function z(e,r){var n=t.identity([]);return t.translate(n,n,[1,1,0]),t.scale(n,n,[.5*e.width,.5*e.height,1]),t.multiply(n,n,e.calculatePosMatrix(r.toUnwrapped()))}function I(t,e,r,n,a){var i=function(t,e,r){if(t)for(var n=0,a=t;n<a.length;n+=1){var i=e[a[n]];if(i&&i.source===r&&"fill-extrusion"===i.type)return!0}else for(var o in e){var s=e[o];if(s.source===r&&"fill-extrusion"===s.type)return!0}return!1}(n&&n.layers,e,t.id),o=a.maxPitchScaleFactor(),s=t.tilesIn(r,o,i);s.sort(R);for(var l=[],u=0,c=s;u<c.length;u+=1){var h=c[u];l.push({wrappedTileID:h.tileID.wrapped().key,queryResults:h.tile.queryRenderedFeatures(e,t._state,h.queryGeometry,h.cameraQueryGeometry,h.scale,n,a,o,z(t.transform,h.tileID))})}var d=function(t){for(var e={},r={},n=0,a=t;n<a.length;n+=1){var i=a[n],o=i.queryResults,s=i.wrappedTileID,l=r[s]=r[s]||{};for(var u in o)for(var c=o[u],h=l[u]=l[u]||{},d=e[u]=e[u]||[],f=0,p=c;f<p.length;f+=1){var m=p[f];h[m.featureIndex]||(h[m.featureIndex]=!0,d.push(m))}}return e}(l);for(var f in d)d[f].forEach((function(e){var r=e.feature,n=t.getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=n}));return d}function R(t,e){var r=t.tileID,n=e.tileID;return r.overscaledZ-n.overscaledZ||r.canonical.y-n.canonical.y||r.wrap-n.wrap||r.canonical.x-n.canonical.x}var F=function(t,e){this.max=t,this.onRemove=e,this.reset()};F.prototype.reset=function(){for(var t in this.data)for(var e=0,r=this.data[t];e<r.length;e+=1){var n=r[e];n.timeout&&clearTimeout(n.timeout),this.onRemove(n.value)}return this.data={},this.order=[],this},F.prototype.add=function(t,e,r){var n=this,a=t.wrapped().key;void 0===this.data[a]&&(this.data[a]=[]);var i={value:e,timeout:void 0};if(void 0!==r&&(i.timeout=setTimeout((function(){n.remove(t,i)}),r)),this.data[a].push(i),this.order.push(a),this.order.length>this.max){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this},F.prototype.has=function(t){return t.wrapped().key in this.data},F.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},F.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},F.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},F.prototype.remove=function(t,e){if(!this.has(t))return this;var r=t.wrapped().key,n=void 0===e?0:this.data[r].indexOf(e),a=this.data[r][n];return this.data[r].splice(n,1),a.timeout&&clearTimeout(a.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(a.value),this.order.splice(this.order.indexOf(r),1),this},F.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this};var N=function(t,e,r){this.context=t;var n=t.gl;this.buffer=n.createBuffer(),this.dynamicDraw=Boolean(r),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};N.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},N.prototype.updateData=function(t){var e=this.context.gl;this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)},N.prototype.destroy=function(){var t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer)};var Y={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},j=function(t,e,r,n){this.length=e.length,this.attributes=r,this.itemSize=e.bytesPerElement,this.dynamicDraw=n,this.context=t;var a=t.gl;this.buffer=a.createBuffer(),t.bindVertexBuffer.set(this.buffer),a.bufferData(a.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?a.DYNAMIC_DRAW:a.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};j.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},j.prototype.updateData=function(t){var e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)},j.prototype.enableAttributes=function(t,e){for(var r=0;r<this.attributes.length;r++){var n=this.attributes[r],a=e.attributes[n.name];void 0!==a&&t.enableVertexAttribArray(a)}},j.prototype.setVertexAttribPointers=function(t,e,r){for(var n=0;n<this.attributes.length;n++){var a=this.attributes[n],i=e.attributes[a.name];void 0!==i&&t.vertexAttribPointer(i,a.components,t[Y[a.type]],!1,this.itemSize,a.offset+this.itemSize*(r||0))}},j.prototype.destroy=function(){var t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer)};var B=function(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};B.prototype.get=function(){return this.current},B.prototype.set=function(t){},B.prototype.getDefault=function(){return this.default},B.prototype.setDefault=function(){this.set(this.default)};var H=function(e){function r(){e.apply(this,arguments)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.getDefault=function(){return t.Color.transparent},r.prototype.set=function(t){var e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)},r}(B),U=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return 1},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)},e}(B),V=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return 0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)},e}(B),W=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return[!0,!0,!0,!0]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)},e}(B),G=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)},e}(B),q=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return 255},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)},e}(B),Z=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},e.prototype.set=function(t){var e=this.current;(t.func!==e.func||t.ref!==e.ref||t.mask!==e.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)},e}(B),X=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)},e}(B),J=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.current=t,this.dirty=!1}},e}(B),K=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return[0,1]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)},e}(B),$=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.current=t,this.dirty=!1}},e}(B),Q=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return this.gl.LESS},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)},e}(B),tt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.current=t,this.dirty=!1}},e}(B),et=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[t.ONE,t.ZERO]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)},e}(B),rt=function(e){function r(){e.apply(this,arguments)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.getDefault=function(){return t.Color.transparent},r.prototype.set=function(t){var e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)},r}(B),nt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return this.gl.FUNC_ADD},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)},e}(B),at=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this.current=t,this.dirty=!1}},e}(B),it=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return this.gl.BACK},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)},e}(B),ot=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return this.gl.CCW},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)},e}(B),st=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)},e}(B),lt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return this.gl.TEXTURE0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)},e}(B),ut=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)},e}(B),ct=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,t),this.current=t,this.dirty=!1}},e}(B),ht=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindRenderbuffer(e.RENDERBUFFER,t),this.current=t,this.dirty=!1}},e}(B),dt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindTexture(e.TEXTURE_2D,t),this.current=t,this.dirty=!1}},e}(B),ft=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}},e}(B),pt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){var e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1},e}(B),mt=function(t){function e(e){t.call(this,e),this.vao=e.extVertexArrayObject}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){this.vao&&(t!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(t),this.current=t,this.dirty=!1)},e}(B),gt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return 4},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}},e}(B),yt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}},e}(B),vt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}},e}(B),_t=function(t){function e(e,r){t.call(this,e),this.context=e,this.parent=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e}(B),xt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setDirty=function(){this.dirty=!0},e.prototype.set=function(t){if(t!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var e=this.gl;e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}},e}(_t),bt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){if(t!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}},e}(_t),wt=function(t,e,r){this.context=t,this.width=e,this.height=r;var n=t.gl,a=this.framebuffer=n.createFramebuffer();this.colorAttachment=new xt(t,a),this.depthAttachment=new bt(t,a)};wt.prototype.destroy=function(){var t=this.context.gl,e=this.colorAttachment.get();e&&t.deleteTexture(e);var r=this.depthAttachment.get();r&&t.deleteRenderbuffer(r),t.deleteFramebuffer(this.framebuffer)};var Mt=function(t,e,r){this.func=t,this.mask=e,this.range=r};Mt.ReadOnly=!1,Mt.ReadWrite=!0,Mt.disabled=new Mt(519,Mt.ReadOnly,[0,1]);var kt=function(t,e,r,n,a,i){this.test=t,this.ref=e,this.mask=r,this.fail=n,this.depthFail=a,this.pass=i};kt.disabled=new kt({func:519,mask:0},0,0,7680,7680,7680);var Tt=function(t,e,r){this.blendFunction=t,this.blendColor=e,this.mask=r};Tt.disabled=new Tt(Tt.Replace=[1,0],t.Color.transparent,[!1,!1,!1,!1]),Tt.unblended=new Tt(Tt.Replace,t.Color.transparent,[!0,!0,!0,!0]),Tt.alphaBlended=new Tt([1,771],t.Color.transparent,[!0,!0,!0,!0]);var Lt=function(t,e,r){this.enable=t,this.mode=e,this.frontFace=r};Lt.disabled=new Lt(!1,1029,2305),Lt.backCCW=new Lt(!0,1029,2305);var At=function(t){this.gl=t,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new H(this),this.clearDepth=new U(this),this.clearStencil=new V(this),this.colorMask=new W(this),this.depthMask=new G(this),this.stencilMask=new q(this),this.stencilFunc=new Z(this),this.stencilOp=new X(this),this.stencilTest=new J(this),this.depthRange=new K(this),this.depthTest=new $(this),this.depthFunc=new Q(this),this.blend=new tt(this),this.blendFunc=new et(this),this.blendColor=new rt(this),this.blendEquation=new nt(this),this.cullFace=new at(this),this.cullFaceSide=new it(this),this.frontFace=new ot(this),this.program=new st(this),this.activeTexture=new lt(this),this.viewport=new ut(this),this.bindFramebuffer=new ct(this),this.bindRenderbuffer=new ht(this),this.bindTexture=new dt(this),this.bindVertexBuffer=new ft(this),this.bindElementBuffer=new pt(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new mt(this),this.pixelStoreUnpack=new gt(this),this.pixelStoreUnpackPremultiplyAlpha=new yt(this),this.pixelStoreUnpackFlipY=new vt(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=t.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&t.getExtension("OES_texture_half_float_linear")};At.prototype.setDefault=function(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()},At.prototype.setDirty=function(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0},At.prototype.createIndexBuffer=function(t,e){return new N(this,t,e)},At.prototype.createVertexBuffer=function(t,e,r){return new j(this,t,e,r)},At.prototype.createRenderbuffer=function(t,e,r){var n=this.gl,a=n.createRenderbuffer();return this.bindRenderbuffer.set(a),n.renderbufferStorage(n.RENDERBUFFER,t,e,r),this.bindRenderbuffer.set(null),a},At.prototype.createFramebuffer=function(t,e){return new wt(this,t,e)},At.prototype.clear=function(t){var e=t.color,r=t.depth,n=this.gl,a=0;e&&(a|=n.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==r&&(a|=n.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(r),this.depthMask.set(!0)),n.clear(a)},At.prototype.setCullFace=function(t){!1===t.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))},At.prototype.setDepthMode=function(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)},At.prototype.setStencilMode=function(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)},At.prototype.setColorMode=function(e){t.deepEqual(e.blendFunction,Tt.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)},At.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var St=function(e){function r(r,n,a){var i=this;e.call(this),this.id=r,this.dispatcher=a,this.on("data",(function(t){"source"===t.dataType&&"metadata"===t.sourceDataType&&(i._sourceLoaded=!0),i._sourceLoaded&&!i._paused&&"source"===t.dataType&&"content"===t.sourceDataType&&(i.reload(),i.transform&&i.update(i.transform))})),this.on("error",(function(){i._sourceErrored=!0})),this._source=function(e,r,n,a){var i=new O[r.type](e,r,n,a);if(i.id!==e)throw new Error("Expected Source id to be "+e+" instead of "+i.id);return t.bindAll(["load","abort","unload","serialize","prepare"],i),i}(r,n,a,this),this._tiles={},this._cache=new F(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._coveredTiles={},this._state=new t.SourceFeatureState}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.onAdd=function(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(t)},r.prototype.onRemove=function(t){this._source&&this._source.onRemove&&this._source.onRemove(t)},r.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;for(var t in this._tiles){var e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}return!0},r.prototype.getSource=function(){return this._source},r.prototype.pause=function(){this._paused=!0},r.prototype.resume=function(){if(this._paused){var t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform)}},r.prototype._loadTile=function(t,e){return this._source.loadTile(t,e)},r.prototype._unloadTile=function(t){if(this._source.unloadTile)return this._source.unloadTile(t,(function(){}))},r.prototype._abortTile=function(t){if(this._source.abortTile)return this._source.abortTile(t,(function(){}))},r.prototype.serialize=function(){return this._source.serialize()},r.prototype.prepare=function(t){for(var e in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var r=this._tiles[e];r.upload(t),r.prepare(this.map.style.imageManager)}},r.prototype.getIds=function(){return Object.keys(this._tiles).map(Number).sort(Et)},r.prototype.getRenderableIds=function(e){var r=this,n=[];for(var a in this._tiles)this._isIdRenderable(+a,e)&&n.push(+a);return e?n.sort((function(e,n){var a=r._tiles[e].tileID,i=r._tiles[n].tileID,o=new t.Point(a.canonical.x,a.canonical.y)._rotate(r.transform.angle),s=new t.Point(i.canonical.x,i.canonical.y)._rotate(r.transform.angle);return a.overscaledZ-i.overscaledZ||s.y-o.y||s.x-o.x})):n.sort(Et)},r.prototype.hasRenderableParent=function(t){var e=this.findLoadedParent(t,0);return!!e&&this._isIdRenderable(e.tileID.key)},r.prototype._isIdRenderable=function(t,e){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(e||!this._tiles[t].holdingForFade())},r.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var t in this._cache.reset(),this._tiles)"errored"!==this._tiles[t].state&&this._reloadTile(t,"reloading")},r.prototype._reloadTile=function(t,e){var r=this._tiles[t];r&&("loading"!==r.state&&(r.state=e),this._loadTile(r,this._tileLoaded.bind(this,r,t,e)))},r.prototype._tileLoaded=function(e,r,n,a){if(a)return e.state="errored",void(404!==a.status?this._source.fire(new t.ErrorEvent(a,{tile:e})):this.update(this.transform));e.timeAdded=t.browser.now(),"expired"===n&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(r,e),"raster-dem"===this.getSource().type&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),this._source.fire(new t.Event("data",{dataType:"source",tile:e,coord:e.tileID}))},r.prototype._backfillDEM=function(t){for(var e=this.getRenderableIds(),r=0;r<e.length;r++){var n=e[r];if(t.neighboringTiles&&t.neighboringTiles[n]){var a=this.getTileByID(n);i(t,a),i(a,t)}}function i(t,e){t.needsHillshadePrepare=!0;var r=e.tileID.canonical.x-t.tileID.canonical.x,n=e.tileID.canonical.y-t.tileID.canonical.y,a=Math.pow(2,t.tileID.canonical.z),i=e.tileID.key;0===r&&0===n||Math.abs(n)>1||(Math.abs(r)>1&&(1===Math.abs(r+a)?r+=a:1===Math.abs(r-a)&&(r-=a)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,n),t.neighboringTiles&&t.neighboringTiles[i]&&(t.neighboringTiles[i].backfilled=!0)))}},r.prototype.getTile=function(t){return this.getTileByID(t.key)},r.prototype.getTileByID=function(t){return this._tiles[t]},r.prototype.getZoom=function(t){return t.zoom+t.scaleZoom(t.tileSize/this._source.tileSize)},r.prototype._retainLoadedChildren=function(t,e,r,n){for(var a in this._tiles){var i=this._tiles[a];if(!(n[a]||!i.hasData()||i.tileID.overscaledZ<=e||i.tileID.overscaledZ>r)){for(var o=i.tileID;i&&i.tileID.overscaledZ>e+1;){var s=i.tileID.scaledTo(i.tileID.overscaledZ-1);(i=this._tiles[s.key])&&i.hasData()&&(o=s)}for(var l=o;l.overscaledZ>e;)if(t[(l=l.scaledTo(l.overscaledZ-1)).key]){n[o.key]=o;break}}}},r.prototype.findLoadedParent=function(t,e){for(var r=t.overscaledZ-1;r>=e;r--){var n=t.scaledTo(r);if(!n)return;var a=String(n.key),i=this._tiles[a];if(i&&i.hasData())return i;if(this._cache.has(n))return this._cache.get(n)}},r.prototype.updateCacheSize=function(t){var e=(Math.ceil(t.width/this._source.tileSize)+1)*(Math.ceil(t.height/this._source.tileSize)+1),r=Math.floor(5*e),n="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._cache.setMaxSize(n)},r.prototype.handleWrapJump=function(t){var e=(t-(void 0===this._prevLng?t:this._prevLng))/360,r=Math.round(e);if(this._prevLng=t,r){var n={};for(var a in this._tiles){var i=this._tiles[a];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+r),n[i.tileID.key]=i}for(var o in this._tiles=n,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var s in this._tiles){var l=this._tiles[s];this._setTileReloadTimer(s,l)}}},r.prototype.update=function(e){var n=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var a;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?a=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(e){return new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)})):(a=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(a=a.filter((function(t){return n._source.hasTile(t)})))):a=[];var i=(this._source.roundZoom?Math.round:Math.floor)(this.getZoom(e)),o=Math.max(i-r.maxOverzooming,this._source.minzoom),s=Math.max(i+r.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(a,i);if(Ct(this._source.type)){for(var u={},c={},h=0,d=Object.keys(l);h<d.length;h+=1){var f=d[h],p=l[f],m=this._tiles[f];if(m&&!(m.fadeEndTime&&m.fadeEndTime<=t.browser.now())){var g=this.findLoadedParent(p,o);g&&(this._addTile(g.tileID),u[g.tileID.key]=g.tileID),c[f]=p}}for(var y in this._retainLoadedChildren(c,i,s,l),u)l[y]||(this._coveredTiles[y]=!0,l[y]=u[y])}for(var v in l)this._tiles[v].clearFadeHold();for(var _=0,x=t.keysDifference(this._tiles,l);_<x.length;_+=1){var b=x[_],w=this._tiles[b];w.hasSymbolBuckets&&!w.holdingForFade()?w.setHoldDuration(this.map._fadeDuration):w.hasSymbolBuckets&&!w.symbolFadeFinished()||this._removeTile(b)}}},r.prototype.releaseSymbolFadeTiles=function(){for(var t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)},r.prototype._updateRetainedTiles=function(t,e){for(var n={},a={},i=Math.max(e-r.maxOverzooming,this._source.minzoom),o=Math.max(e+r.maxUnderzooming,this._source.minzoom),s={},l=0,u=t;l<u.length;l+=1){var c=u[l],h=this._addTile(c);n[c.key]=c,h.hasData()||e<this._source.maxzoom&&(s[c.key]=c)}this._retainLoadedChildren(s,e,o,n);for(var d=0,f=t;d<f.length;d+=1){var p=f[d],m=this._tiles[p.key];if(!m.hasData()){if(e+1>this._source.maxzoom){var g=p.children(this._source.maxzoom)[0],y=this.getTile(g);if(y&&y.hasData()){n[g.key]=g;continue}}else{var v=p.children(this._source.maxzoom);if(n[v[0].key]&&n[v[1].key]&&n[v[2].key]&&n[v[3].key])continue}for(var _=m.wasRequested(),x=p.overscaledZ-1;x>=i;--x){var b=p.scaledTo(x);if(a[b.key])break;if(a[b.key]=!0,!(m=this.getTile(b))&&_&&(m=this._addTile(b)),m&&(n[b.key]=b,_=m.wasRequested(),m.hasData()))break}}}return n},r.prototype._addTile=function(e){var r=this._tiles[e.key];if(r)return r;(r=this._cache.getAndRemove(e))&&(this._setTileReloadTimer(e.key,r),r.tileID=e,this._state.initializeTileState(r,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,r)));var n=Boolean(r);return n||(r=new t.Tile(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(r,this._tileLoaded.bind(this,r,e.key,r.state))),r?(r.uses++,this._tiles[e.key]=r,n||this._source.fire(new t.Event("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r):null},r.prototype._setTileReloadTimer=function(t,e){var r=this;t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);var n=e.getExpiryTimeout();n&&(this._timers[t]=setTimeout((function(){r._reloadTile(t,"expired"),delete r._timers[t]}),n))},r.prototype._removeTile=function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),e.uses>0||(e.hasData()?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},r.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},r.prototype.tilesIn=function(e,r,n){var a=this,i=[],o=this.transform;if(!o)return i;for(var s=n?o.getCameraQueryGeometry(e):e,l=e.map((function(t){return o.pointCoordinate(t)})),u=s.map((function(t){return o.pointCoordinate(t)})),c=this.getIds(),h=1/0,d=1/0,f=-1/0,p=-1/0,m=0,g=u;m<g.length;m+=1){var y=g[m];h=Math.min(h,y.x),d=Math.min(d,y.y),f=Math.max(f,y.x),p=Math.max(p,y.y)}for(var v=function(e){var n=a._tiles[c[e]];if(!n.holdingForFade()){var s=n.tileID,m=Math.pow(2,o.zoom-n.tileID.overscaledZ),g=r*n.queryPadding*t.EXTENT/n.tileSize/m,y=[s.getTilePoint(new t.MercatorCoordinate(h,d)),s.getTilePoint(new t.MercatorCoordinate(f,p))];if(y[0].x-g<t.EXTENT&&y[0].y-g<t.EXTENT&&y[1].x+g>=0&&y[1].y+g>=0){var v=l.map((function(t){return s.getTilePoint(t)})),_=u.map((function(t){return s.getTilePoint(t)}));i.push({tile:n,tileID:s,queryGeometry:v,cameraQueryGeometry:_,scale:m})}}},_=0;_<c.length;_++)v(_);return i},r.prototype.getVisibleCoordinates=function(t){for(var e=this,r=this.getRenderableIds(t).map((function(t){return e._tiles[t].tileID})),n=0,a=r;n<a.length;n+=1){var i=a[n];i.posMatrix=this.transform.calculatePosMatrix(i.toUnwrapped())}return r},r.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(Ct(this._source.type))for(var e in this._tiles){var r=this._tiles[e];if(void 0!==r.fadeEndTime&&r.fadeEndTime>=t.browser.now())return!0}return!1},r.prototype.setFeatureState=function(t,e,r){t=t||"_geojsonTileLayer",this._state.updateState(t,e,r)},r.prototype.removeFeatureState=function(t,e,r){t=t||"_geojsonTileLayer",this._state.removeFeatureState(t,e,r)},r.prototype.getFeatureState=function(t,e){return t=t||"_geojsonTileLayer",this._state.getState(t,e)},r}(t.Evented);function Et(t,e){return t%32-e%32||e-t}function Ct(t){return"raster"===t||"image"===t||"video"===t}function Dt(){return new t.window.Worker(qn.workerUrl)}St.maxOverzooming=10,St.maxUnderzooming=3;var Pt=function(){this.active={}};Pt.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length<Pt.workerCount;)this.workers.push(new Dt);return this.active[t]=!0,this.workers.slice()},Pt.prototype.release=function(t){delete this.active[t],0===Object.keys(this.active).length&&(this.workers.forEach((function(t){t.terminate()})),this.workers=null)};var Ot,zt=Math.floor(t.browser.hardwareConcurrency/2);function It(e,r){var n={};for(var a in e)"ref"!==a&&(n[a]=e[a]);return t.refProperties.forEach((function(t){t in r&&(n[t]=r[t])})),n}function Rt(t){t=t.slice();for(var e=Object.create(null),r=0;r<t.length;r++)e[t[r].id]=t[r];for(var n=0;n<t.length;n++)"ref"in t[n]&&(t[n]=It(t[n],e[t[n].ref]));return t}Pt.workerCount=Math.max(Math.min(zt,6),1);var Ft={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function Nt(t,e,r){r.push({command:Ft.addSource,args:[t,e[t]]})}function Yt(t,e,r){e.push({command:Ft.removeSource,args:[t]}),r[t]=!0}function jt(t,e,r,n){Yt(t,r,n),Nt(t,e,r)}function Bt(e,r,n){var a;for(a in e[n])if(e[n].hasOwnProperty(a)&&"data"!==a&&!t.deepEqual(e[n][a],r[n][a]))return!1;for(a in r[n])if(r[n].hasOwnProperty(a)&&"data"!==a&&!t.deepEqual(e[n][a],r[n][a]))return!1;return!0}function Ht(e,r,n,a,i,o){var s;for(s in r=r||{},e=e||{})e.hasOwnProperty(s)&&(t.deepEqual(e[s],r[s])||n.push({command:o,args:[a,s,r[s],i]}));for(s in r)r.hasOwnProperty(s)&&!e.hasOwnProperty(s)&&(t.deepEqual(e[s],r[s])||n.push({command:o,args:[a,s,r[s],i]}))}function Ut(t){return t.id}function Vt(t,e){return t[e.id]=e,t}var Wt=function(t,e,r){var n=this.boxCells=[],a=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(e/r);for(var i=0;i<this.xCellCount*this.yCellCount;i++)n.push([]),a.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=e,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/e,this.boxUid=0,this.circleUid=0};function Gt(e,r,n,a,i){var o=t.create();return r?(t.scale(o,o,[1/i,1/i,1]),n||t.rotateZ(o,o,a.angle)):t.multiply(o,a.labelPlaneMatrix,e),o}function qt(e,r,n,a,i){if(r){var o=t.clone(e);return t.scale(o,o,[i,i,1]),n||t.rotateZ(o,o,-a.angle),o}return a.glCoordMatrix}function Zt(e,r){var n=[e.x,e.y,0,1];ae(n,n,r);var a=n[3];return{point:new t.Point(n[0]/a,n[1]/a),signedDistanceFromCamera:a}}function Xt(t,e){var r=t[0]/t[3],n=t[1]/t[3];return r>=-e[0]&&r<=e[0]&&n>=-e[1]&&n<=e[1]}function Jt(e,r,n,a,i,o,s,l){var u=a?e.textSizeData:e.iconSizeData,c=t.evaluateSizeForZoom(u,n.transform.zoom),h=[256/n.width*2+1,256/n.height*2+1],d=a?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;d.clear();for(var f=e.lineVertexArray,p=a?e.text.placedSymbolArray:e.icon.placedSymbolArray,m=n.transform.width/n.transform.height,g=!1,y=0;y<p.length;y++){var v=p.get(y);if(v.hidden||v.writingMode===t.WritingMode.vertical&&!g)ne(v.numGlyphs,d);else{g=!1;var _=[v.anchorX,v.anchorY,0,1];if(t.transformMat4(_,_,r),Xt(_,h)){var x=.5+_[3]/n.transform.cameraToCenterDistance*.5,b=t.evaluateSizeForFeature(u,c,v),w=s?b*x:b/x,M=new t.Point(v.anchorX,v.anchorY),k=Zt(M,i).point,T={},L=Qt(v,w,!1,l,r,i,o,e.glyphOffsetArray,f,d,k,M,T,m);g=L.useVertical,(L.notEnoughRoom||g||L.needsFlipping&&Qt(v,w,!0,l,r,i,o,e.glyphOffsetArray,f,d,k,M,T,m).notEnoughRoom)&&ne(v.numGlyphs,d)}else ne(v.numGlyphs,d)}}a?e.text.dynamicLayoutVertexBuffer.updateData(d):e.icon.dynamicLayoutVertexBuffer.updateData(d)}function Kt(t,e,r,n,a,i,o,s,l,u,c,h){var d=s.glyphStartIndex+s.numGlyphs,f=s.lineStartIndex,p=s.lineStartIndex+s.lineLength,m=e.getoffsetX(s.glyphStartIndex),g=e.getoffsetX(d-1),y=ee(t*m,r,n,a,i,o,s.segment,f,p,l,u,c,h);if(!y)return null;var v=ee(t*g,r,n,a,i,o,s.segment,f,p,l,u,c,h);return v?{first:y,last:v}:null}function $t(e,r,n,a){return e===t.WritingMode.horizontal&&Math.abs(n.y-r.y)>Math.abs(n.x-r.x)*a?{useVertical:!0}:(e===t.WritingMode.vertical?r.y<n.y:r.x>n.x)?{needsFlipping:!0}:null}function Qt(e,r,n,a,i,o,s,l,u,c,h,d,f,p){var m,g=r/24,y=e.lineOffsetX*g,v=e.lineOffsetY*g;if(e.numGlyphs>1){var _=e.glyphStartIndex+e.numGlyphs,x=e.lineStartIndex,b=e.lineStartIndex+e.lineLength,w=Kt(g,l,y,v,n,h,d,e,u,o,f,!1);if(!w)return{notEnoughRoom:!0};var M=Zt(w.first.point,s).point,k=Zt(w.last.point,s).point;if(a&&!n){var T=$t(e.writingMode,M,k,p);if(T)return T}m=[w.first];for(var L=e.glyphStartIndex+1;L<_-1;L++)m.push(ee(g*l.getoffsetX(L),y,v,n,h,d,e.segment,x,b,u,o,f,!1));m.push(w.last)}else{if(a&&!n){var A=Zt(d,i).point,S=e.lineStartIndex+e.segment+1,E=new t.Point(u.getx(S),u.gety(S)),C=Zt(E,i),D=C.signedDistanceFromCamera>0?C.point:te(d,E,A,1,i),P=$t(e.writingMode,A,D,p);if(P)return P}var O=ee(g*l.getoffsetX(e.glyphStartIndex),y,v,n,h,d,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,u,o,f,!1);if(!O)return{notEnoughRoom:!0};m=[O]}for(var z=0,I=m;z<I.length;z+=1){var R=I[z];t.addDynamicAttributes(c,R.point,R.angle)}return{}}function te(t,e,r,n,a){var i=Zt(t.add(t.sub(e)._unit()),a).point,o=r.sub(i);return r.add(o._mult(n/o.mag()))}function ee(e,r,n,a,i,o,s,l,u,c,h,d,f){var p=a?e-r:e+r,m=p>0?1:-1,g=0;a&&(m*=-1,g=Math.PI),m<0&&(g+=Math.PI);for(var y=m>0?l+s:l+s+1,v=y,_=i,x=i,b=0,w=0,M=Math.abs(p);b+w<=M;){if((y+=m)<l||y>=u)return null;if(x=_,void 0===(_=d[y])){var k=new t.Point(c.getx(y),c.gety(y)),T=Zt(k,h);if(T.signedDistanceFromCamera>0)_=d[y]=T.point;else{var L=y-m;_=te(0===b?o:new t.Point(c.getx(L),c.gety(L)),k,x,M-b+1,h)}}b+=w,w=x.dist(_)}var A=(M-b)/w,S=_.sub(x),E=S.mult(A)._add(x);return E._add(S._unit()._perp()._mult(n*m)),{point:E,angle:g+Math.atan2(_.y-x.y,_.x-x.x),tileDistance:f?{prevTileDistance:y-m===v?0:c.gettileUnitDistanceFromAnchor(y-m),lastSegmentViewportDistance:M-b}:null}}Wt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Wt.prototype.insert=function(t,e,r,n,a){this._forEachCell(e,r,n,a,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(a)},Wt.prototype.insertCircle=function(t,e,r,n){this._forEachCell(e-n,r-n,e+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(r),this.circles.push(n)},Wt.prototype._insertBoxCell=function(t,e,r,n,a,i){this.boxCells[a].push(i)},Wt.prototype._insertCircleCell=function(t,e,r,n,a,i){this.circleCells[a].push(i)},Wt.prototype._query=function(t,e,r,n,a,i){if(r<0||t>this.width||n<0||e>this.height)return!a&&[];var o=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=n){if(a)return!0;for(var s=0;s<this.boxKeys.length;s++)o.push({key:this.boxKeys[s],x1:this.bboxes[4*s],y1:this.bboxes[4*s+1],x2:this.bboxes[4*s+2],y2:this.bboxes[4*s+3]});for(var l=0;l<this.circleKeys.length;l++){var u=this.circles[3*l],c=this.circles[3*l+1],h=this.circles[3*l+2];o.push({key:this.circleKeys[l],x1:u-h,y1:c-h,x2:u+h,y2:c+h})}return i?o.filter(i):o}var d={hitTest:a,seenUids:{box:{},circle:{}}};return this._forEachCell(t,e,r,n,this._queryCell,o,d,i),a?o.length>0:o},Wt.prototype._queryCircle=function(t,e,r,n,a){var i=t-r,o=t+r,s=e-r,l=e+r;if(o<0||i>this.width||l<0||s>this.height)return!n&&[];var u=[],c={hitTest:n,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}};return this._forEachCell(i,s,o,l,this._queryCellCircle,u,c,a),n?u.length>0:u},Wt.prototype.query=function(t,e,r,n,a){return this._query(t,e,r,n,!1,a)},Wt.prototype.hitTest=function(t,e,r,n,a){return this._query(t,e,r,n,!0,a)},Wt.prototype.hitTestCircle=function(t,e,r,n){return this._queryCircle(t,e,r,!0,n)},Wt.prototype._queryCell=function(t,e,r,n,a,i,o,s){var l=o.seenUids,u=this.boxCells[a];if(null!==u)for(var c=this.bboxes,h=0,d=u;h<d.length;h+=1){var f=d[h];if(!l.box[f]){l.box[f]=!0;var p=4*f;if(t<=c[p+2]&&e<=c[p+3]&&r>=c[p+0]&&n>=c[p+1]&&(!s||s(this.boxKeys[f]))){if(o.hitTest)return i.push(!0),!0;i.push({key:this.boxKeys[f],x1:c[p],y1:c[p+1],x2:c[p+2],y2:c[p+3]})}}}var m=this.circleCells[a];if(null!==m)for(var g=this.circles,y=0,v=m;y<v.length;y+=1){var _=v[y];if(!l.circle[_]){l.circle[_]=!0;var x=3*_;if(this._circleAndRectCollide(g[x],g[x+1],g[x+2],t,e,r,n)&&(!s||s(this.circleKeys[_]))){if(o.hitTest)return i.push(!0),!0;var b=g[x],w=g[x+1],M=g[x+2];i.push({key:this.circleKeys[_],x1:b-M,y1:w-M,x2:b+M,y2:w+M})}}}},Wt.prototype._queryCellCircle=function(t,e,r,n,a,i,o,s){var l=o.circle,u=o.seenUids,c=this.boxCells[a];if(null!==c)for(var h=this.bboxes,d=0,f=c;d<f.length;d+=1){var p=f[d];if(!u.box[p]){u.box[p]=!0;var m=4*p;if(this._circleAndRectCollide(l.x,l.y,l.radius,h[m+0],h[m+1],h[m+2],h[m+3])&&(!s||s(this.boxKeys[p])))return i.push(!0),!0}}var g=this.circleCells[a];if(null!==g)for(var y=this.circles,v=0,_=g;v<_.length;v+=1){var x=_[v];if(!u.circle[x]){u.circle[x]=!0;var b=3*x;if(this._circlesCollide(y[b],y[b+1],y[b+2],l.x,l.y,l.radius)&&(!s||s(this.circleKeys[x])))return i.push(!0),!0}}},Wt.prototype._forEachCell=function(t,e,r,n,a,i,o,s){for(var l=this._convertToXCellCoord(t),u=this._convertToYCellCoord(e),c=this._convertToXCellCoord(r),h=this._convertToYCellCoord(n),d=l;d<=c;d++)for(var f=u;f<=h;f++){var p=this.xCellCount*f+d;if(a.call(this,t,e,r,n,p,i,o,s))return}},Wt.prototype._convertToXCellCoord=function(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))},Wt.prototype._convertToYCellCoord=function(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))},Wt.prototype._circlesCollide=function(t,e,r,n,a,i){var o=n-t,s=a-e,l=r+i;return l*l>o*o+s*s},Wt.prototype._circleAndRectCollide=function(t,e,r,n,a,i,o){var s=(i-n)/2,l=Math.abs(t-(n+s));if(l>s+r)return!1;var u=(o-a)/2,c=Math.abs(e-(a+u));if(c>u+r)return!1;if(l<=s||c<=u)return!0;var h=l-s,d=c-u;return h*h+d*d<=r*r};var re=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ne(t,e){for(var r=0;r<t;r++){var n=e.length;e.resize(n+4),e.float32.set(re,3*n)}}function ae(t,e,r){var n=e[0],a=e[1];return t[0]=r[0]*n+r[4]*a+r[12],t[1]=r[1]*n+r[5]*a+r[13],t[3]=r[3]*n+r[7]*a+r[15],t}var ie=function(t,e,r){void 0===e&&(e=new Wt(t.width+200,t.height+200,25)),void 0===r&&(r=new Wt(t.width+200,t.height+200,25)),this.transform=t,this.grid=e,this.ignoredGrid=r,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+100,this.screenBottomBoundary=t.height+100,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200};function oe(t,e,r){t[e+4]=r?1:0}function se(e,r,n){return r*(t.EXTENT/(e.tileSize*Math.pow(2,n-e.tileID.overscaledZ)))}ie.prototype.placeCollisionBox=function(t,e,r,n,a){var i=this.projectAndGetPerspectiveRatio(n,t.anchorPointX,t.anchorPointY),o=r*i.perspectiveRatio,s=t.x1*o+i.point.x,l=t.y1*o+i.point.y,u=t.x2*o+i.point.x,c=t.y2*o+i.point.y;return!this.isInsideGrid(s,l,u,c)||!e&&this.grid.hitTest(s,l,u,c,a)?{box:[],offscreen:!1}:{box:[s,l,u,c],offscreen:this.isOffscreen(s,l,u,c)}},ie.prototype.approximateTileDistance=function(t,e,r,n,a){var i=a?1:n/this.pitchfactor,o=t.lastSegmentViewportDistance*r;return t.prevTileDistance+o+(i-1)*o*Math.abs(Math.sin(e))},ie.prototype.placeCollisionCircles=function(e,r,n,a,i,o,s,l,u,c,h,d,f){var p=[],m=this.projectAnchor(u,i.anchorX,i.anchorY),g=l/24,y=i.lineOffsetX*l,v=i.lineOffsetY*l,_=new t.Point(i.anchorX,i.anchorY),x=Kt(g,s,y,v,!1,Zt(_,c).point,_,i,o,c,{},!0),b=!1,w=!1,M=!0,k=m.perspectiveRatio*a,T=1/(a*n),L=0,A=0;x&&(L=this.approximateTileDistance(x.first.tileDistance,x.first.angle,T,m.cameraDistance,d),A=this.approximateTileDistance(x.last.tileDistance,x.last.angle,T,m.cameraDistance,d));for(var S=0;S<e.length;S+=5){var E=e[S],C=e[S+1],D=e[S+2],P=e[S+3];if(!x||P<-L||P>A)oe(e,S,!1);else{var O=this.projectPoint(u,E,C),z=D*k;if(p.length>0){var I=O.x-p[p.length-4],R=O.y-p[p.length-3];if(z*z*2>I*I+R*R&&S+8<e.length){var F=e[S+8];if(F>-L&&F<A){oe(e,S,!1);continue}}}var N=S/5;p.push(O.x,O.y,z,N),oe(e,S,!0);var Y=O.x-z,j=O.y-z,B=O.x+z,H=O.y+z;if(M=M&&this.isOffscreen(Y,j,B,H),w=w||this.isInsideGrid(Y,j,B,H),!r&&this.grid.hitTestCircle(O.x,O.y,z,f)){if(!h)return{circles:[],offscreen:!1};b=!0}}}return{circles:b||!w?[]:p,offscreen:M}},ie.prototype.queryRenderedSymbols=function(e){if(0===e.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};for(var r=[],n=1/0,a=1/0,i=-1/0,o=-1/0,s=0,l=e;s<l.length;s+=1){var u=l[s],c=new t.Point(u.x+100,u.y+100);n=Math.min(n,c.x),a=Math.min(a,c.y),i=Math.max(i,c.x),o=Math.max(o,c.y),r.push(c)}for(var h={},d={},f=0,p=this.grid.query(n,a,i,o).concat(this.ignoredGrid.query(n,a,i,o));f<p.length;f+=1){var m=p[f],g=m.key;if(void 0===h[g.bucketInstanceId]&&(h[g.bucketInstanceId]={}),!h[g.bucketInstanceId][g.featureIndex]){var y=[new t.Point(m.x1,m.y1),new t.Point(m.x2,m.y1),new t.Point(m.x2,m.y2),new t.Point(m.x1,m.y2)];t.polygonIntersectsPolygon(r,y)&&(h[g.bucketInstanceId][g.featureIndex]=!0,void 0===d[g.bucketInstanceId]&&(d[g.bucketInstanceId]=[]),d[g.bucketInstanceId].push(g.featureIndex))}}return d},ie.prototype.insertCollisionBox=function(t,e,r,n,a){var i={bucketInstanceId:r,featureIndex:n,collisionGroupID:a};(e?this.ignoredGrid:this.grid).insert(i,t[0],t[1],t[2],t[3])},ie.prototype.insertCollisionCircles=function(t,e,r,n,a){for(var i=e?this.ignoredGrid:this.grid,o={bucketInstanceId:r,featureIndex:n,collisionGroupID:a},s=0;s<t.length;s+=4)i.insertCircle(o,t[s],t[s+1],t[s+2])},ie.prototype.projectAnchor=function(t,e,r){var n=[e,r,0,1];return ae(n,n,t),{perspectiveRatio:.5+this.transform.cameraToCenterDistance/n[3]*.5,cameraDistance:n[3]}},ie.prototype.projectPoint=function(e,r,n){var a=[r,n,0,1];return ae(a,a,e),new t.Point((a[0]/a[3]+1)/2*this.transform.width+100,(-a[1]/a[3]+1)/2*this.transform.height+100)},ie.prototype.projectAndGetPerspectiveRatio=function(e,r,n){var a=[r,n,0,1];return ae(a,a,e),{point:new t.Point((a[0]/a[3]+1)/2*this.transform.width+100,(-a[1]/a[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/a[3]*.5}},ie.prototype.isOffscreen=function(t,e,r,n){return r<100||t>=this.screenRightBoundary||n<100||e>this.screenBottomBoundary},ie.prototype.isInsideGrid=function(t,e,r,n){return r>=0&&t<this.gridRightBoundary&&n>=0&&e<this.gridBottomBoundary};var le=function(t,e,r,n){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):n&&r?1:0,this.placed=r};le.prototype.isHidden=function(){return 0===this.opacity&&!this.placed};var ue=function(t,e,r,n,a){this.text=new le(t?t.text:null,e,r,a),this.icon=new le(t?t.icon:null,e,n,a)};ue.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var ce=function(t,e,r){this.text=t,this.icon=e,this.skipFade=r},he=function(t,e,r,n,a){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=r,this.bucketIndex=n,this.tileID=a},de=function(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}};function fe(e,r,n,a,i){var o=t.getAnchorAlignment(e),s=-(o.horizontalAlign-.5)*r,l=-(o.verticalAlign-.5)*n,u=t.evaluateRadialOffset(e,a);return new t.Point(s+u[0]*i,l+u[1]*i)}de.prototype.get=function(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){var e=++this.maxGroupID;this.collisionGroups[t]={ID:e,predicate:function(t){return t.collisionGroupID===e}}}return this.collisionGroups[t]};var pe=function(t,e,r,n){this.transform=t.clone(),this.collisionIndex=new ie(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=e,this.retainedQueryData={},this.collisionGroups=new de(r),this.prevPlacement=n,n&&(n.prevPlacement=void 0)};function me(t,e,r,n,a){t.emplaceBack(e?1:0,r?1:0,n||0,a||0),t.emplaceBack(e?1:0,r?1:0,n||0,a||0),t.emplaceBack(e?1:0,r?1:0,n||0,a||0),t.emplaceBack(e?1:0,r?1:0,n||0,a||0)}pe.prototype.placeLayerTile=function(e,r,n,a){var i=r.getBucket(e),o=r.latestFeatureIndex;if(i&&o&&e.id===i.layerIds[0]){var s=r.collisionBoxArray,l=i.layers[0].layout,u=Math.pow(2,this.transform.zoom-r.tileID.overscaledZ),c=r.tileSize/t.EXTENT,h=this.transform.calculatePosMatrix(r.tileID.toUnwrapped()),d=Gt(h,"map"===l.get("text-pitch-alignment"),"map"===l.get("text-rotation-alignment"),this.transform,se(r,1,this.transform.zoom)),f=Gt(h,"map"===l.get("icon-pitch-alignment"),"map"===l.get("icon-rotation-alignment"),this.transform,se(r,1,this.transform.zoom));this.retainedQueryData[i.bucketInstanceId]=new he(i.bucketInstanceId,o,i.sourceLayerIndex,i.index,r.tileID),this.placeLayerBucket(i,h,d,f,u,c,n,r.holdingForFade(),a,s)}},pe.prototype.attemptAnchorPlacement=function(e,r,n,a,i,o,s,l,u,c,h,d,f,p){var m,g=fe(e,n,a,i,o),y=this.collisionIndex.placeCollisionBox(function(e,r,n,a,i,o){var s=e.x1,l=e.x2,u=e.y1,c=e.y2,h=e.anchorPointX,d=e.anchorPointY,f=new t.Point(r,n);return a&&f._rotate(i?o:-o),{x1:s+f.x,y1:u+f.y,x2:l+f.x,y2:c+f.y,anchorPointX:h,anchorPointY:d}}(r,g.x,g.y,s,l,this.transform.angle),d,u,c,h.predicate);if(y.box.length>0)return this.prevPlacement&&this.prevPlacement.variableOffsets[f.crossTileID]&&this.prevPlacement.placements[f.crossTileID]&&this.prevPlacement.placements[f.crossTileID].text&&(m=this.prevPlacement.variableOffsets[f.crossTileID].anchor),this.variableOffsets[f.crossTileID]={radialOffset:i,width:n,height:a,anchor:e,textBoxScale:o,prevAnchor:m},this.markUsedJustification(p,e,f),y},pe.prototype.placeLayerBucket=function(e,r,n,a,i,o,s,l,u,c){var h=this,d=e.layers[0].layout,f=t.evaluateSizeForZoom(e.textSizeData,this.transform.zoom),p=d.get("text-optional"),m=d.get("icon-optional"),g=d.get("text-allow-overlap"),y=d.get("icon-allow-overlap"),v=g&&(y||!e.hasIconData()||m),_=y&&(g||!e.hasTextData()||p),x=this.collisionGroups.get(e.sourceID),b="map"===d.get("text-rotation-alignment"),w="map"===d.get("text-pitch-alignment"),M="viewport-y"===d.get("symbol-z-order");!e.collisionArrays&&c&&e.deserializeCollisionBoxes(c);var k=function(a,c){if(!u[a.crossTileID])if(l)h.placements[a.crossTileID]=new ce(!1,!1,!1);else{var y=!1,M=!1,k=!0,T=null,L=null,A=null,S=0,E=0;c.textFeatureIndex&&(S=c.textFeatureIndex);var C=c.textBox;if(C)if(d.get("text-variable-anchor")){var D=C.x2-C.x1,P=C.y2-C.y1,O=a.textBoxScale,z=d.get("text-variable-anchor");if(h.prevPlacement&&h.prevPlacement.variableOffsets[a.crossTileID]){var I=h.prevPlacement.variableOffsets[a.crossTileID];z[0]!==I.anchor&&(z=z.filter((function(t){return t!==I.anchor}))).unshift(I.anchor)}for(var R=0,F=z;R<F.length;R+=1){var N=F[R];if(T=h.attemptAnchorPlacement(N,C,D,P,a.radialTextOffset,O,b,w,o,r,x,g,a,e)){y=!0;break}}if(!h.variableOffsets[a.crossTileID]&&h.prevPlacement){var Y=h.prevPlacement.variableOffsets[a.crossTileID];Y&&(h.variableOffsets[a.crossTileID]=Y,h.markUsedJustification(e,Y.anchor,a))}}else y=(T=h.collisionIndex.placeCollisionBox(C,d.get("text-allow-overlap"),o,r,x.predicate)).box.length>0;k=T&&T.offscreen;var j=c.textCircles;if(j){var B=e.text.placedSymbolArray.get(a.centerJustifiedTextSymbolIndex),H=t.evaluateSizeForFeature(e.textSizeData,f,B);L=h.collisionIndex.placeCollisionCircles(j,d.get("text-allow-overlap"),i,o,B,e.lineVertexArray,e.glyphOffsetArray,H,r,n,s,w,x.predicate),y=d.get("text-allow-overlap")||L.circles.length>0,k=k&&L.offscreen}c.iconFeatureIndex&&(E=c.iconFeatureIndex),c.iconBox&&(M=(A=h.collisionIndex.placeCollisionBox(c.iconBox,d.get("icon-allow-overlap"),o,r,x.predicate)).box.length>0,k=k&&A.offscreen);var U=p||0===a.numHorizontalGlyphVertices&&0===a.numVerticalGlyphVertices,V=m||0===a.numIconVertices;U||V?V?U||(M=M&&y):y=M&&y:M=y=M&&y,y&&T&&h.collisionIndex.insertCollisionBox(T.box,d.get("text-ignore-placement"),e.bucketInstanceId,S,x.ID),M&&A&&h.collisionIndex.insertCollisionBox(A.box,d.get("icon-ignore-placement"),e.bucketInstanceId,E,x.ID),y&&L&&h.collisionIndex.insertCollisionCircles(L.circles,d.get("text-ignore-placement"),e.bucketInstanceId,S,x.ID),h.placements[a.crossTileID]=new ce(y||v,M||_,k||e.justReloaded),u[a.crossTileID]=!0}};if(M)for(var T=e.getSortedSymbolIndexes(this.transform.angle),L=T.length-1;L>=0;--L){var A=T[L];k(e.symbolInstances.get(A),e.collisionArrays[A])}else for(var S=0;S<e.symbolInstances.length;++S)k(e.symbolInstances.get(S),e.collisionArrays[S]);e.justReloaded=!1},pe.prototype.markUsedJustification=function(e,r,n){var a={left:n.leftJustifiedTextSymbolIndex,center:n.centerJustifiedTextSymbolIndex,right:n.rightJustifiedTextSymbolIndex},i=a[t.getAnchorJustification(r)];for(var o in a){var s=a[o];s>=0&&(e.text.placedSymbolArray.get(s).crossTileID=i>=0&&s!==i?0:n.crossTileID)}},pe.prototype.commit=function(t){this.commitTime=t;var e=this.prevPlacement,r=!1,n=e&&0!==this.fadeDuration?(this.commitTime-e.commitTime)/this.fadeDuration:1,a=e?e.opacities:{},i=e?e.variableOffsets:{};for(var o in this.placements){var s=this.placements[o],l=a[o];l?(this.opacities[o]=new ue(l,n,s.text,s.icon),r=r||s.text!==l.text.placed||s.icon!==l.icon.placed):(this.opacities[o]=new ue(null,n,s.text,s.icon,s.skipFade),r=r||s.text||s.icon)}for(var u in a){var c=a[u];if(!this.opacities[u]){var h=new ue(c,n,!1,!1);h.isHidden()||(this.opacities[u]=h,r=r||c.text.placed||c.icon.placed)}}for(var d in i)this.variableOffsets[d]||!this.opacities[d]||this.opacities[d].isHidden()||(this.variableOffsets[d]=i[d]);r?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t)},pe.prototype.updateLayerOpacities=function(t,e){for(var r={},n=0,a=e;n<a.length;n+=1){var i=a[n],o=i.getBucket(t);o&&i.latestFeatureIndex&&t.id===o.layerIds[0]&&this.updateBucketOpacities(o,r,i.collisionBoxArray)}},pe.prototype.updateBucketOpacities=function(e,r,n){e.hasTextData()&&e.text.opacityVertexArray.clear(),e.hasIconData()&&e.icon.opacityVertexArray.clear(),e.hasCollisionBoxData()&&e.collisionBox.collisionVertexArray.clear(),e.hasCollisionCircleData()&&e.collisionCircle.collisionVertexArray.clear();var a=e.layers[0].layout,i=new ue(null,0,!1,!1,!0),o=a.get("text-allow-overlap"),s=a.get("icon-allow-overlap"),l=a.get("text-variable-anchor"),u="map"===a.get("text-rotation-alignment"),c="map"===a.get("text-pitch-alignment"),h=new ue(null,0,o&&(s||!e.hasIconData()||a.get("icon-optional")),s&&(o||!e.hasTextData()||a.get("text-optional")),!0);!e.collisionArrays&&n&&(e.hasCollisionBoxData()||e.hasCollisionCircleData())&&e.deserializeCollisionBoxes(n);for(var d=0;d<e.symbolInstances.length;d++){var f=e.symbolInstances.get(d),p=f.numHorizontalGlyphVertices,m=f.numVerticalGlyphVertices,g=f.crossTileID,y=r[g],v=this.opacities[g];y?v=i:v||(v=h,this.opacities[g]=v),r[g]=!0;var _=p>0||m>0,x=f.numIconVertices>0;if(_){for(var b=Me(v.text),w=(p+m)/4,M=0;M<w;M++)e.text.opacityVertexArray.emplaceBack(b);var k=v.text.isHidden()?1:0;[f.rightJustifiedTextSymbolIndex,f.centerJustifiedTextSymbolIndex,f.leftJustifiedTextSymbolIndex,f.verticalPlacedTextSymbolIndex].forEach((function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=k)}));var T=this.variableOffsets[f.crossTileID];T&&this.markUsedJustification(e,T.anchor,f)}if(x){for(var L=Me(v.icon),A=0;A<f.numIconVertices/4;A++)e.icon.opacityVertexArray.emplaceBack(L);e.icon.placedSymbolArray.get(d).hidden=v.icon.isHidden()}if(e.hasCollisionBoxData()||e.hasCollisionCircleData()){var S=e.collisionArrays[d];if(S){if(S.textBox){var E=new t.Point(0,0),C=!0;if(l){var D=this.variableOffsets[g];D?(E=fe(D.anchor,D.width,D.height,D.radialOffset,D.textBoxScale),u&&E._rotate(c?this.transform.angle:-this.transform.angle)):C=!1}me(e.collisionBox.collisionVertexArray,v.text.placed,!C,E.x,E.y)}S.iconBox&&me(e.collisionBox.collisionVertexArray,v.icon.placed,!1);var P=S.textCircles;if(P&&e.hasCollisionCircleData())for(var O=0;O<P.length;O+=5){var z=y||0===P[O+4];me(e.collisionCircle.collisionVertexArray,v.text.placed,z)}}}}e.sortFeatures(this.transform.angle),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasCollisionBoxData()&&e.collisionBox.collisionVertexBuffer&&e.collisionBox.collisionVertexBuffer.updateData(e.collisionBox.collisionVertexArray),e.hasCollisionCircleData()&&e.collisionCircle.collisionVertexBuffer&&e.collisionCircle.collisionVertexBuffer.updateData(e.collisionCircle.collisionVertexArray)},pe.prototype.symbolFadeChange=function(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration},pe.prototype.hasTransitions=function(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration},pe.prototype.stillRecent=function(t){return this.commitTime+this.fadeDuration>t},pe.prototype.setStale=function(){this.stale=!0};var ge=Math.pow(2,25),ye=Math.pow(2,24),ve=Math.pow(2,17),_e=Math.pow(2,16),xe=Math.pow(2,9),be=Math.pow(2,8),we=Math.pow(2,1);function Me(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,r=Math.floor(127*t.opacity);return r*ge+e*ye+r*ve+e*_e+r*xe+e*be+r*we+e}var ke=function(){this._currentTileIndex=0,this._seenCrossTileIDs={}};ke.prototype.continuePlacement=function(t,e,r,n,a){for(;this._currentTileIndex<t.length;){var i=t[this._currentTileIndex];if(e.placeLayerTile(n,i,r,this._seenCrossTileIDs),this._currentTileIndex++,a())return!0}};var Te=function(t,e,r,n,a,i,o){this.placement=new pe(t,a,i,o),this._currentPlacementIndex=e.length-1,this._forceFullPlacement=r,this._showCollisionBoxes=n,this._done=!1};Te.prototype.isDone=function(){return this._done},Te.prototype.continuePlacement=function(e,r,n){for(var a=this,i=t.browser.now(),o=function(){var e=t.browser.now()-i;return!a._forceFullPlacement&&e>2};this._currentPlacementIndex>=0;){var s=r[e[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(this._inProgressLayer||(this._inProgressLayer=new ke),this._inProgressLayer.continuePlacement(n[s.source],this.placement,this._showCollisionBoxes,s,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Te.prototype.commit=function(t){return this.placement.commit(t),this.placement};var Le=512/t.EXTENT/2,Ae=function(t,e,r){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var n=0;n<e.length;n++){var a=e.get(n),i=a.key;this.indexedSymbolInstances[i]||(this.indexedSymbolInstances[i]=[]),this.indexedSymbolInstances[i].push({crossTileID:a.crossTileID,coord:this.getScaledCoordinates(a,t)})}};Ae.prototype.getScaledCoordinates=function(e,r){var n=r.canonical.z-this.tileID.canonical.z,a=Le/Math.pow(2,n);return{x:Math.floor((r.canonical.x*t.EXTENT+e.anchorX)*a),y:Math.floor((r.canonical.y*t.EXTENT+e.anchorY)*a)}},Ae.prototype.findMatches=function(t,e,r){for(var n=this.tileID.canonical.z<e.canonical.z?1:Math.pow(2,this.tileID.canonical.z-e.canonical.z),a=0;a<t.length;a++){var i=t.get(a);if(!i.crossTileID){var o=this.indexedSymbolInstances[i.key];if(o)for(var s=this.getScaledCoordinates(i,e),l=0,u=o;l<u.length;l+=1){var c=u[l];if(Math.abs(c.coord.x-s.x)<=n&&Math.abs(c.coord.y-s.y)<=n&&!r[c.crossTileID]){r[c.crossTileID]=!0,i.crossTileID=c.crossTileID;break}}}}};var Se=function(){this.maxCrossTileID=0};Se.prototype.generate=function(){return++this.maxCrossTileID};var Ee=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};Ee.prototype.handleWrapJump=function(t){var e=Math.round((t-this.lng)/360);if(0!==e)for(var r in this.indexes){var n=this.indexes[r],a={};for(var i in n){var o=n[i];o.tileID=o.tileID.unwrapTo(o.tileID.wrap+e),a[o.tileID.key]=o}this.indexes[r]=a}this.lng=t},Ee.prototype.addBucket=function(t,e,r){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===e.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(var n=0;n<e.symbolInstances.length;n++)e.symbolInstances.get(n).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});var a=this.usedCrossTileIDs[t.overscaledZ];for(var i in this.indexes){var o=this.indexes[i];if(Number(i)>t.overscaledZ)for(var s in o){var l=o[s];l.tileID.isChildOf(t)&&l.findMatches(e.symbolInstances,t,a)}else{var u=o[t.scaledTo(Number(i)).key];u&&u.findMatches(e.symbolInstances,t,a)}}for(var c=0;c<e.symbolInstances.length;c++){var h=e.symbolInstances.get(c);h.crossTileID||(h.crossTileID=r.generate(),a[h.crossTileID]=!0)}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new Ae(t,e.symbolInstances,e.bucketInstanceId),!0},Ee.prototype.removeBucketCrossTileIDs=function(t,e){for(var r in e.indexedSymbolInstances)for(var n=0,a=e.indexedSymbolInstances[r];n<a.length;n+=1){var i=a[n];delete this.usedCrossTileIDs[t][i.crossTileID]}},Ee.prototype.removeStaleBuckets=function(t){var e=!1;for(var r in this.indexes){var n=this.indexes[r];for(var a in n)t[n[a].bucketInstanceId]||(this.removeBucketCrossTileIDs(r,n[a]),delete n[a],e=!0)}return e};var Ce=function(){this.layerIndexes={},this.crossTileIDs=new Se,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};Ce.prototype.addLayer=function(t,e,r){var n=this.layerIndexes[t.id];void 0===n&&(n=this.layerIndexes[t.id]=new Ee);var a=!1,i={};n.handleWrapJump(r);for(var o=0,s=e;o<s.length;o+=1){var l=s[o],u=l.getBucket(t);u&&t.id===u.layerIds[0]&&(u.bucketInstanceId||(u.bucketInstanceId=++this.maxBucketInstanceId),n.addBucket(l.tileID,u,this.crossTileIDs)&&(a=!0),i[u.bucketInstanceId]=!0)}return n.removeStaleBuckets(i)&&(a=!0),a},Ce.prototype.pruneUnusedLayers=function(t){var e={};for(var r in t.forEach((function(t){e[t]=!0})),this.layerIndexes)e[r]||delete this.layerIndexes[r]};var De=function(e,r){return t.emitValidationErrors(e,r&&r.filter((function(t){return"source.canvas"!==t.identifier})))},Pe=t.pick(Ft,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Oe=t.pick(Ft,["setCenter","setZoom","setBearing","setPitch"]),ze=function(e){function r(n,a){var i=this;void 0===a&&(a={}),e.call(this),this.map=n,this.dispatcher=new M((Ot||(Ot=new Pt),Ot),this),this.imageManager=new d,this.imageManager.setEventedParent(this),this.glyphManager=new v(n._requestManager,a.localIdeographFontFamily),this.lineAtlas=new w(256,512),this.crossTileSymbolIndex=new Ce,this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new t.ZoomHistory,this._loaded=!1,this._resetUpdates(),this.dispatcher.broadcast("setReferrer",t.getReferrer());var o=this;this._rtlTextPluginCallback=r.registerForPluginAvailability((function(t){for(var e in o.dispatcher.broadcast("loadRTLTextPlugin",t.pluginURL,t.completionCallback),o.sourceCaches)o.sourceCaches[e].reload()})),this.on("data",(function(t){if("source"===t.dataType&&"metadata"===t.sourceDataType){var e=i.sourceCaches[t.sourceId];if(e){var r=e.getSource();if(r&&r.vectorLayerIds)for(var n in i._layers){var a=i._layers[n];a.source===r.id&&i._validateLayer(a)}}}}))}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.loadURL=function(e,r){var n=this;void 0===r&&(r={}),this.fire(new t.Event("dataloading",{dataType:"style"}));var a="boolean"==typeof r.validate?r.validate:!t.isMapboxURL(e);e=this.map._requestManager.normalizeStyleURL(e,r.accessToken);var i=this.map._requestManager.transformRequest(e,t.ResourceType.Style);this._request=t.getJSON(i,(function(e,r){n._request=null,e?n.fire(new t.ErrorEvent(e)):r&&n._load(r,a)}))},r.prototype.loadJSON=function(e,r){var n=this;void 0===r&&(r={}),this.fire(new t.Event("dataloading",{dataType:"style"})),this._request=t.browser.frame((function(){n._request=null,n._load(e,!1!==r.validate)}))},r.prototype._load=function(e,r){var n=this;if(!r||!De(this,t.validateStyle(e))){for(var a in this._loaded=!0,this.stylesheet=e,e.sources)this.addSource(a,e.sources[a],{validate:!1});e.sprite?this._spriteRequest=function(e,r,n){var a,i,o,s=t.browser.devicePixelRatio>1?"@2x":"",l=t.getJSON(r.transformRequest(r.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),(function(t,e){l=null,o||(o=t,a=e,c())})),u=t.getImage(r.transformRequest(r.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),(function(t,e){u=null,o||(o=t,i=e,c())}));function c(){if(o)n(o);else if(a&&i){var e=t.browser.getImageData(i),r={};for(var s in a){var l=a[s],u=l.width,c=l.height,h=l.x,d=l.y,f=l.sdf,p=l.pixelRatio,m=new t.RGBAImage({width:u,height:c});t.RGBAImage.copy(e,m,{x:h,y:d},{x:0,y:0},{width:u,height:c}),r[s]={data:m,pixelRatio:p,sdf:f}}n(null,r)}}return{cancel:function(){l&&(l.cancel(),l=null),u&&(u.cancel(),u=null)}}}(e.sprite,this.map._requestManager,(function(e,r){if(n._spriteRequest=null,e)n.fire(new t.ErrorEvent(e));else if(r)for(var a in r)n.imageManager.addImage(a,r[a]);n.imageManager.setLoaded(!0),n.fire(new t.Event("data",{dataType:"style"}))})):this.imageManager.setLoaded(!0),this.glyphManager.setURL(e.glyphs);var i=Rt(this.stylesheet.layers);this._order=i.map((function(t){return t.id})),this._layers={};for(var o=0,s=i;o<s.length;o+=1){var l=s[o];(l=t.createStyleLayer(l)).setEventedParent(this,{layer:{id:l.id}}),this._layers[l.id]=l}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new b(this.stylesheet.light),this.fire(new t.Event("data",{dataType:"style"})),this.fire(new t.Event("style.load"))}},r.prototype._validateLayer=function(e){var r=this.sourceCaches[e.source];if(r){var n=e.sourceLayer;if(n){var a=r.getSource();("geojson"===a.type||a.vectorLayerIds&&-1===a.vectorLayerIds.indexOf(n))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+n+'" does not exist on source "'+a.id+'" as specified by style layer "'+e.id+'"')))}}},r.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},r.prototype._serializeLayers=function(t){for(var e=[],r=0,n=t;r<n.length;r+=1){var a=n[r],i=this._layers[a];"custom"!==i.type&&e.push(i.serialize())}return e},r.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(var e in this._layers)if(this._layers[e].hasTransition())return!0;return!1},r.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},r.prototype.update=function(e){if(this._loaded){var r=this._changed;if(this._changed){var n=Object.keys(this._updatedLayers),a=Object.keys(this._removedLayers);for(var i in(n.length||a.length)&&this._updateWorkerLayers(n,a),this._updatedSources){var o=this._updatedSources[i];"reload"===o?this._reloadSource(i):"clear"===o&&this._clearSource(i)}for(var s in this._updatedPaintProps)this._layers[s].updateTransitions(e);this.light.updateTransitions(e),this._resetUpdates()}for(var l in this.sourceCaches)this.sourceCaches[l].used=!1;for(var u=0,c=this._order;u<c.length;u+=1){var h=c[u],d=this._layers[h];d.recalculate(e),!d.isHidden(e.zoom)&&d.source&&(this.sourceCaches[d.source].used=!0)}this.light.recalculate(e),this.z=e.zoom,r&&this.fire(new t.Event("data",{dataType:"style"}))}},r.prototype._updateWorkerLayers=function(t,e){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:e})},r.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={}},r.prototype.setState=function(e){var r=this;if(this._checkLoaded(),De(this,t.validateStyle(e)))return!1;(e=t.clone$1(e)).layers=Rt(e.layers);var n=function(e,r){if(!e)return[{command:Ft.setStyle,args:[r]}];var n=[];try{if(!t.deepEqual(e.version,r.version))return[{command:Ft.setStyle,args:[r]}];t.deepEqual(e.center,r.center)||n.push({command:Ft.setCenter,args:[r.center]}),t.deepEqual(e.zoom,r.zoom)||n.push({command:Ft.setZoom,args:[r.zoom]}),t.deepEqual(e.bearing,r.bearing)||n.push({command:Ft.setBearing,args:[r.bearing]}),t.deepEqual(e.pitch,r.pitch)||n.push({command:Ft.setPitch,args:[r.pitch]}),t.deepEqual(e.sprite,r.sprite)||n.push({command:Ft.setSprite,args:[r.sprite]}),t.deepEqual(e.glyphs,r.glyphs)||n.push({command:Ft.setGlyphs,args:[r.glyphs]}),t.deepEqual(e.transition,r.transition)||n.push({command:Ft.setTransition,args:[r.transition]}),t.deepEqual(e.light,r.light)||n.push({command:Ft.setLight,args:[r.light]});var a={},i=[];!function(e,r,n,a){var i;for(i in r=r||{},e=e||{})e.hasOwnProperty(i)&&(r.hasOwnProperty(i)||Yt(i,n,a));for(i in r)r.hasOwnProperty(i)&&(e.hasOwnProperty(i)?t.deepEqual(e[i],r[i])||("geojson"===e[i].type&&"geojson"===r[i].type&&Bt(e,r,i)?n.push({command:Ft.setGeoJSONSourceData,args:[i,r[i].data]}):jt(i,r,n,a)):Nt(i,r,n))}(e.sources,r.sources,i,a);var o=[];e.layers&&e.layers.forEach((function(t){a[t.source]?n.push({command:Ft.removeLayer,args:[t.id]}):o.push(t)})),n=n.concat(i),function(e,r,n){r=r||[];var a,i,o,s,l,u,c,h=(e=e||[]).map(Ut),d=r.map(Ut),f=e.reduce(Vt,{}),p=r.reduce(Vt,{}),m=h.slice(),g=Object.create(null);for(a=0,i=0;a<h.length;a++)o=h[a],p.hasOwnProperty(o)?i++:(n.push({command:Ft.removeLayer,args:[o]}),m.splice(m.indexOf(o,i),1));for(a=0,i=0;a<d.length;a++)o=d[d.length-1-a],m[m.length-1-a]!==o&&(f.hasOwnProperty(o)?(n.push({command:Ft.removeLayer,args:[o]}),m.splice(m.lastIndexOf(o,m.length-i),1)):i++,u=m[m.length-a],n.push({command:Ft.addLayer,args:[p[o],u]}),m.splice(m.length-a,0,o),g[o]=!0);for(a=0;a<d.length;a++)if(s=f[o=d[a]],l=p[o],!g[o]&&!t.deepEqual(s,l))if(t.deepEqual(s.source,l.source)&&t.deepEqual(s["source-layer"],l["source-layer"])&&t.deepEqual(s.type,l.type)){for(c in Ht(s.layout,l.layout,n,o,null,Ft.setLayoutProperty),Ht(s.paint,l.paint,n,o,null,Ft.setPaintProperty),t.deepEqual(s.filter,l.filter)||n.push({command:Ft.setFilter,args:[o,l.filter]}),t.deepEqual(s.minzoom,l.minzoom)&&t.deepEqual(s.maxzoom,l.maxzoom)||n.push({command:Ft.setLayerZoomRange,args:[o,l.minzoom,l.maxzoom]}),s)s.hasOwnProperty(c)&&"layout"!==c&&"paint"!==c&&"filter"!==c&&"metadata"!==c&&"minzoom"!==c&&"maxzoom"!==c&&(0===c.indexOf("paint.")?Ht(s[c],l[c],n,o,c.slice(6),Ft.setPaintProperty):t.deepEqual(s[c],l[c])||n.push({command:Ft.setLayerProperty,args:[o,c,l[c]]}));for(c in l)l.hasOwnProperty(c)&&!s.hasOwnProperty(c)&&"layout"!==c&&"paint"!==c&&"filter"!==c&&"metadata"!==c&&"minzoom"!==c&&"maxzoom"!==c&&(0===c.indexOf("paint.")?Ht(s[c],l[c],n,o,c.slice(6),Ft.setPaintProperty):t.deepEqual(s[c],l[c])||n.push({command:Ft.setLayerProperty,args:[o,c,l[c]]}))}else n.push({command:Ft.removeLayer,args:[o]}),u=m[m.lastIndexOf(o)+1],n.push({command:Ft.addLayer,args:[l,u]})}(o,r.layers,n)}catch(t){console.warn("Unable to compute style diff:",t),n=[{command:Ft.setStyle,args:[r]}]}return n}(this.serialize(),e).filter((function(t){return!(t.command in Oe)}));if(0===n.length)return!1;var a=n.filter((function(t){return!(t.command in Pe)}));if(a.length>0)throw new Error("Unimplemented: "+a.map((function(t){return t.command})).join(", ")+".");return n.forEach((function(t){"setTransition"!==t.command&&r[t.command].apply(r,t.args)})),this.stylesheet=e,!0},r.prototype.addImage=function(e,r){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,r),this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},r.prototype.getImage=function(t){return this.imageManager.getImage(t)},r.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},r.prototype.addSource=function(e,r,n){var a=this;if(void 0===n&&(n={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(r).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(t.validateStyle.source,"sources."+e,r,null,n))){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var i=this.sourceCaches[e]=new St(e,r,this.dispatcher);i.style=this,i.setEventedParent(this,(function(){return{isSourceLoaded:a.loaded(),source:i.serialize(),sourceId:e}})),i.onAdd(this.map),this._changed=!0}},r.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+r+'" is using it.')));var n=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],n.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),n.setEventedParent(null),n.clearTiles(),n.onRemove&&n.onRemove(this.map),this._changed=!0},r.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},r.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},r.prototype.addLayer=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var a=e.id;if(this.getLayer(a))this.fire(new t.ErrorEvent(new Error('Layer with id "'+a+'" already exists on this map')));else{var i;if("custom"===e.type){if(De(this,t.validateCustomStyleLayer(e)))return;i=t.createStyleLayer(e)}else{if("object"==typeof e.source&&(this.addSource(a,e.source),e=t.clone$1(e),e=t.extend(e,{source:a})),this._validate(t.validateStyle.layer,"layers."+a,e,{arrayIndex:-1},n))return;i=t.createStyleLayer(e),this._validateLayer(i),i.setEventedParent(this,{layer:{id:a}})}var o=r?this._order.indexOf(r):this._order.length;if(r&&-1===o)this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));else{if(this._order.splice(o,0,a),this._layerOrderChanged=!0,this._layers[a]=i,this._removedLayers[a]&&i.source&&"custom"!==i.type){var s=this._removedLayers[a];delete this._removedLayers[a],s.type!==i.type?this._updatedSources[i.source]="clear":(this._updatedSources[i.source]="reload",this.sourceCaches[i.source].pause())}this._updateLayer(i),i.onAdd&&i.onAdd(this.map)}}},r.prototype.moveLayer=function(e,r){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==r){var n=this._order.indexOf(e);this._order.splice(n,1);var a=r?this._order.indexOf(r):this._order.length;r&&-1===a?this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.'))):(this._order.splice(a,0,e),this._layerOrderChanged=!0)}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")))},r.prototype.removeLayer=function(e){this._checkLoaded();var r=this._layers[e];if(r){r.setEventedParent(null);var n=this._order.indexOf(e);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],r.onRemove&&r.onRemove(this.map)}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")))},r.prototype.getLayer=function(t){return this._layers[t]},r.prototype.setLayerZoomRange=function(e,r,n){this._checkLoaded();var a=this.getLayer(e);a?a.minzoom===r&&a.maxzoom===n||(null!=r&&(a.minzoom=r),null!=n&&(a.maxzoom=n),this._updateLayer(a)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},r.prototype.setFilter=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var a=this.getLayer(e);if(a){if(!t.deepEqual(a.filter,r))return null==r?(a.filter=void 0,void this._updateLayer(a)):void(this._validate(t.validateStyle.filter,"layers."+a.id+".filter",r,null,n)||(a.filter=t.clone$1(r),this._updateLayer(a)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},r.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},r.prototype.setLayoutProperty=function(e,r,n,a){void 0===a&&(a={}),this._checkLoaded();var i=this.getLayer(e);i?t.deepEqual(i.getLayoutProperty(r),n)||(i.setLayoutProperty(r,n,a),this._updateLayer(i)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getLayoutProperty=function(e,r){var n=this.getLayer(e);if(n)return n.getLayoutProperty(r);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")))},r.prototype.setPaintProperty=function(e,r,n,a){void 0===a&&(a={}),this._checkLoaded();var i=this.getLayer(e);i?t.deepEqual(i.getPaintProperty(r),n)||(i.setPaintProperty(r,n,a)&&this._updateLayer(i),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},r.prototype.setFeatureState=function(e,r){this._checkLoaded();var n=e.source,a=e.sourceLayer,i=this.sourceCaches[n],o=parseInt(e.id,10);if(void 0!==i){var s=i.getSource().type;"geojson"===s&&a?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==s||a?isNaN(o)||o<0?this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided and non-negative."))):i.setFeatureState(a,o,r):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.removeFeatureState=function(e,r){this._checkLoaded();var n=e.source,a=this.sourceCaches[n];if(void 0!==a){var i=a.getSource().type,o="vector"===i?e.sourceLayer:void 0,s=parseInt(e.id,10);"vector"!==i||o?void 0!==e.id&&isNaN(s)||s<0?this.fire(new t.ErrorEvent(new Error("The feature id parameter must be non-negative."))):r&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is requred to remove its specific state property."))):a.removeFeatureState(o,s,r):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.getFeatureState=function(e){this._checkLoaded();var r=e.source,n=e.sourceLayer,a=this.sourceCaches[r],i=parseInt(e.id,10);if(void 0!==a)if("vector"!==a.getSource().type||n){if(!(isNaN(i)||i<0))return a.getFeatureState(n,i);this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided and non-negative.")))}else this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},r.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:t.mapObject(this.sourceCaches,(function(t){return t.serialize()})),layers:this._serializeLayers(this._order)},(function(t){return void 0!==t}))},r.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},r.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,r=function(t){return"fill-extrusion"===e._layers[t].type},n={},a=[],i=this._order.length-1;i>=0;i--){var o=this._order[i];if(r(o)){n[o]=i;for(var s=0,l=t;s<l.length;s+=1){var u=l[s][o];if(u)for(var c=0,h=u;c<h.length;c+=1){var d=h[c];a.push(d)}}}}a.sort((function(t,e){return e.intersectionZ-t.intersectionZ}));for(var f=[],p=this._order.length-1;p>=0;p--){var m=this._order[p];if(r(m))for(var g=a.length-1;g>=0;g--){var y=a[g].feature;if(n[y.layer.id]<p)break;f.push(y),a.pop()}else for(var v=0,_=t;v<_.length;v+=1){var x=_[v][m];if(x)for(var b=0,w=x;b<w.length;b+=1){var M=w[b];f.push(M.feature)}}}return f},r.prototype.queryRenderedFeatures=function(e,r,n){r&&r.filter&&this._validate(t.validateStyle.filter,"queryRenderedFeatures.filter",r.filter,null,r);var a={};if(r&&r.layers){if(!Array.isArray(r.layers))return this.fire(new t.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var i=0,o=r.layers;i<o.length;i+=1){var s=o[i],l=this._layers[s];if(!l)return this.fire(new t.ErrorEvent(new Error("The layer '"+s+"' does not exist in the map's style and cannot be queried for features."))),[];a[l.source]=!0}}var u=[];for(var c in this.sourceCaches)r.layers&&!a[c]||u.push(I(this.sourceCaches[c],this._layers,e,r,n));return this.placement&&u.push(function(t,e,r,n,a,i){for(var o={},s=a.queryRenderedSymbols(r),l=[],u=0,c=Object.keys(s).map(Number);u<c.length;u+=1){var h=c[u];l.push(i[h])}l.sort(R);for(var d=function(){var e=p[f],r=e.featureIndex.lookupSymbolFeatures(s[e.bucketInstanceId],e.bucketIndex,e.sourceLayerIndex,n.filter,n.layers,t);for(var a in r){var i=o[a]=o[a]||[],l=r[a];l.sort((function(t,r){var n=e.featureSortOrder;if(n){var a=n.indexOf(t.featureIndex);return n.indexOf(r.featureIndex)-a}return r.featureIndex-t.featureIndex}));for(var u=0,c=l;u<c.length;u+=1){var h=c[u];i.push(h)}}},f=0,p=l;f<p.length;f+=1)d();var m=function(r){o[r].forEach((function(n){var a=n.feature,i=t[r],o=e[i.source].getFeatureState(a.layer["source-layer"],a.id);a.source=a.layer.source,a.layer["source-layer"]&&(a.sourceLayer=a.layer["source-layer"]),a.state=o}))};for(var g in o)m(g);return o}(this._layers,this.sourceCaches,e,r,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(u)},r.prototype.querySourceFeatures=function(e,r){r&&r.filter&&this._validate(t.validateStyle.filter,"querySourceFeatures.filter",r.filter,null,r);var n=this.sourceCaches[e];return n?function(t,e){for(var r=t.getRenderableIds().map((function(e){return t.getTileByID(e)})),n=[],a={},i=0;i<r.length;i++){var o=r[i],s=o.tileID.canonical.key;a[s]||(a[s]=!0,o.querySourceFeatures(n,e))}return n}(n,r):[]},r.prototype.addSourceType=function(t,e,n){return r.getSourceType(t)?n(new Error('A source type called "'+t+'" already exists.')):(r.setSourceType(t,e),e.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:e.workerSourceURL},n):n(null,null))},r.prototype.getLight=function(){return this.light.getLight()},r.prototype.setLight=function(e,r){void 0===r&&(r={}),this._checkLoaded();var n=this.light.getLight(),a=!1;for(var i in e)if(!t.deepEqual(e[i],n[i])){a=!0;break}if(a){var o={now:t.browser.now(),transition:t.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,r),this.light.updateTransitions(o)}},r.prototype._validate=function(e,r,n,a,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&De(this,e.call(t.validateStyle,t.extend({key:r,style:this.serialize(),value:n,styleSpec:t.styleSpec},a)))},r.prototype._remove=function(){for(var e in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),t.evented.off("pluginAvailable",this._rtlTextPluginCallback),this.sourceCaches)this.sourceCaches[e].clearTiles();this.dispatcher.remove()},r.prototype._clearSource=function(t){this.sourceCaches[t].clearTiles()},r.prototype._reloadSource=function(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()},r.prototype._updateSources=function(t){for(var e in this.sourceCaches)this.sourceCaches[e].update(t)},r.prototype._generateCollisionBoxes=function(){for(var t in this.sourceCaches)this._reloadSource(t)},r.prototype._updatePlacement=function(e,r,n,a){for(var i=!1,o=!1,s={},l=0,u=this._order;l<u.length;l+=1){var c=u[l],h=this._layers[c];if("symbol"===h.type){if(!s[h.source]){var d=this.sourceCaches[h.source];s[h.source]=d.getRenderableIds(!0).map((function(t){return d.getTileByID(t)})).sort((function(t,e){return e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1)}))}var f=this.crossTileSymbolIndex.addLayer(h,s[h.source],e.center.lng);i=i||f}}this.crossTileSymbolIndex.pruneUnusedLayers(this._order);var p=this._layerOrderChanged||0===n;if((p||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(t.browser.now()))&&(this.pauseablePlacement=new Te(e,this._order,p,r,n,a,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,s),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(t.browser.now()),o=!0),i&&this.pauseablePlacement.placement.setStale()),o||i)for(var m=0,g=this._order;m<g.length;m+=1){var y=g[m],v=this._layers[y];"symbol"===v.type&&this.placement.updateLayerOpacities(v,s[v.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(t.browser.now())},r.prototype._releaseSymbolFadeTiles=function(){for(var t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()},r.prototype.getImages=function(t,e,r){this.imageManager.getImages(e.icons,r)},r.prototype.getGlyphs=function(t,e,r){this.glyphManager.getGlyphs(e.stacks,r)},r.prototype.getResource=function(e,r,n){return t.makeRequest(r,n)},r}(t.Evented);ze.getSourceType=function(t){return O[t]},ze.setSourceType=function(t,e){O[t]=e},ze.registerForPluginAvailability=t.registerForPluginAvailability;var Ie=t.createLayout([{name:"a_pos",type:"Int16",components:2}]),Re=sr("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}"),Fe=sr("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),Ne=sr("uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),Ye=sr("varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,0,1);} else {gl_Position=u_matrix*vec4(circle_center,0,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"),je=sr("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),Be=sr("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}"),He=sr("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),Ue=sr("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),Ve=sr("uniform float u_overscale_factor;varying float v_placed;varying float v_notUsed;varying float v_radius;varying vec2 v_extrude;varying vec2 v_extrude_scale;void main() {float alpha=0.5;vec4 color=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {color=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {color*=.2;}float extrude_scale_length=length(v_extrude_scale);float extrude_length=length(v_extrude)*extrude_scale_length;float stroke_width=15.0*extrude_scale_length/u_overscale_factor;float radius=v_radius*extrude_scale_length;float distance_to_edge=abs(extrude_length-radius);float opacity_t=smoothstep(-stroke_width,0.0,-distance_to_edge);gl_FragColor=opacity_t*color;}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;varying float v_radius;varying vec2 v_extrude;varying vec2 v_extrude_scale;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);highp float padding_factor=1.2;gl_Position.xy+=a_extrude*u_extrude_scale*padding_factor*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;v_radius=abs(a_extrude.y);v_extrude=a_extrude*padding_factor;v_extrude_scale=u_extrude_scale*u_camera_to_center_distance*collision_perspective_ratio;}"),We=sr("uniform highp vec4 u_color;void main() {gl_FragColor=u_color;}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),Ge=sr("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),qe=sr("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),Ze=sr("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec4 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float pixelRatio=u_scale.x;float tileRatio=u_scale.y;float fromScale=u_scale.z;float toScale=u_scale.w;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);vec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),Xe=sr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec4 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float pixelRatio=u_scale.x;float tileZoomRatio=u_scale.y;float fromScale=u_scale.z;float toScale=u_scale.w;vec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);vec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),Je=sr("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),Ke=sr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec4 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float pixelRatio=u_scale.x;float tileRatio=u_scale.y;float fromScale=u_scale.z;float toScale=u_scale.w;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);vec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),$e=sr("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform float u_maxzoom;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;return (data.r+data.g*256.0+data.b*256.0*256.0)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggeration=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/ pow(2.0,(u_zoom-u_maxzoom)*exaggeration+19.2562-u_zoom);gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),Qe=sr("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),tr=sr("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),er=sr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp float v_lineprogress;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,vec2(v_lineprogress,0.5));gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define MAX_LINE_DISTANCE 32767.0\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_lineprogress;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_lineprogress=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0/MAX_LINE_DISTANCE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),rr=sr("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec4 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float pixelRatio=u_scale.x;float tileZoomRatio=u_scale.y;float fromScale=u_scale.z;float toScale=u_scale.w;vec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);vec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x,1.0);float x_b=mod(v_linesofar/pattern_size_b.x,1.0);float y_a=0.5+(v_normal.y*clamp(v_width2.s,0.0,(pattern_size_a.y+2.0)/2.0)/pattern_size_a.y);float y_b=0.5+(v_normal.y*clamp(v_width2.s,0.0,(pattern_size_b.y+2.0)/2.0)/pattern_size_b.y);vec2 pos_a=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,vec2(x_a,y_a));vec2 pos_b=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,vec2(x_b,y_b));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);}"),nr=sr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),ar=sr("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),ir=sr("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size[0],a_size[1],u_size_t)/256.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size[0]/256.0;} else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {size=u_size;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),or=sr("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size[0],a_size[1],u_size_t)/256.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size[0]/256.0;} else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {size=u_size;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=vec2(tex.x,tex.y);v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}");function sr(t,e){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n={};return{fragmentSource:t=t.replace(r,(function(t,e,r,a,i){return n[i]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nvarying "+r+" "+a+" "+i+";\n#else\nuniform "+r+" "+a+" u_"+i+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+i+"\n "+r+" "+a+" "+i+" = u_"+i+";\n#endif\n"})),vertexSource:e=e.replace(r,(function(t,e,r,a,i){var o="float"===a?"vec2":"vec4",s=i.match(/color/)?"color":o;return n[i]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+o+" a_"+i+";\nvarying "+r+" "+a+" "+i+";\n#else\nuniform "+r+" "+a+" u_"+i+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = a_"+i+";\n#else\n "+r+" "+a+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = unpack_mix_"+s+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+a+" "+i+" = u_"+i+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+o+" a_"+i+";\n#else\nuniform "+r+" "+a+" u_"+i+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+a+" "+i+" = a_"+i+";\n#else\n "+r+" "+a+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+a+" "+i+" = unpack_mix_"+s+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+a+" "+i+" = u_"+i+";\n#endif\n"}))}}var lr=Object.freeze({prelude:Re,background:Fe,backgroundPattern:Ne,circle:Ye,clippingMask:je,heatmap:Be,heatmapTexture:He,collisionBox:Ue,collisionCircle:Ve,debug:We,fill:Ge,fillOutline:qe,fillOutlinePattern:Ze,fillPattern:Xe,fillExtrusion:Je,fillExtrusionPattern:Ke,hillshadePrepare:$e,hillshade:Qe,line:tr,lineGradient:er,linePattern:rr,lineSDF:nr,raster:ar,symbolIcon:ir,symbolSDF:or}),ur=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};ur.prototype.bind=function(t,e,r,n,a,i,o,s){this.context=t;for(var l=this.boundPaintVertexBuffers.length!==n.length,u=0;!l&&u<n.length;u++)this.boundPaintVertexBuffers[u]!==n[u]&&(l=!0);var c=!this.vao||this.boundProgram!==e||this.boundLayoutVertexBuffer!==r||l||this.boundIndexBuffer!==a||this.boundVertexOffset!==i||this.boundDynamicVertexBuffer!==o||this.boundDynamicVertexBuffer2!==s;!t.extVertexArrayObject||c?this.freshBind(e,r,n,a,i,o,s):(t.bindVertexArrayOES.set(this.vao),o&&o.bind(),a&&a.dynamicDraw&&a.bind(),s&&s.bind())},ur.prototype.freshBind=function(t,e,r,n,a,i,o){var s,l=t.numAttributes,u=this.context,c=u.gl;if(u.extVertexArrayObject)this.vao&&this.destroy(),this.vao=u.extVertexArrayObject.createVertexArrayOES(),u.bindVertexArrayOES.set(this.vao),s=0,this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=r,this.boundIndexBuffer=n,this.boundVertexOffset=a,this.boundDynamicVertexBuffer=i,this.boundDynamicVertexBuffer2=o;else{s=u.currentNumAttributes||0;for(var h=l;h<s;h++)c.disableVertexAttribArray(h)}e.enableAttributes(c,t);for(var d=0,f=r;d<f.length;d+=1)f[d].enableAttributes(c,t);i&&i.enableAttributes(c,t),o&&o.enableAttributes(c,t),e.bind(),e.setVertexAttribPointers(c,t,a);for(var p=0,m=r;p<m.length;p+=1){var g=m[p];g.bind(),g.setVertexAttribPointers(c,t,a)}i&&(i.bind(),i.setVertexAttribPointers(c,t,a)),n&&n.bind(),o&&(o.bind(),o.setVertexAttribPointers(c,t,a)),u.currentNumAttributes=l},ur.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};var cr=function(t,e,r,n,a){var i=t.gl;this.program=i.createProgram();var o=r.defines();a&&o.push("#define OVERDRAW_INSPECTOR;");var s=o.concat(Re.fragmentSource,e.fragmentSource).join("\n"),l=o.concat(Re.vertexSource,e.vertexSource).join("\n"),u=i.createShader(i.FRAGMENT_SHADER);i.shaderSource(u,s),i.compileShader(u),i.attachShader(this.program,u);var c=i.createShader(i.VERTEX_SHADER);i.shaderSource(c,l),i.compileShader(c),i.attachShader(this.program,c);for(var h=r.layoutAttributes||[],d=0;d<h.length;d++)i.bindAttribLocation(this.program,d,h[d].name);i.linkProgram(this.program),this.numAttributes=i.getProgramParameter(this.program,i.ACTIVE_ATTRIBUTES),this.attributes={};for(var f={},p=0;p<this.numAttributes;p++){var m=i.getActiveAttrib(this.program,p);m&&(this.attributes[m.name]=i.getAttribLocation(this.program,m.name))}for(var g=i.getProgramParameter(this.program,i.ACTIVE_UNIFORMS),y=0;y<g;y++){var v=i.getActiveUniform(this.program,y);v&&(f[v.name]=i.getUniformLocation(this.program,v.name))}this.fixedUniforms=n(t,f),this.binderUniforms=r.getUniforms(t,f)};function hr(e,r,n){var a=1/se(n,1,r.transform.tileZoom),i=Math.pow(2,n.tileID.overscaledZ),o=n.tileSize*Math.pow(2,r.transform.tileZoom)/i,s=o*(n.tileID.canonical.x+n.tileID.wrap*i),l=o*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[t.browser.devicePixelRatio,a,e.fromScale,e.toScale],u_fade:e.t,u_pixel_coord_upper:[s>>16,l>>16],u_pixel_coord_lower:[65535&s,65535&l]}}cr.prototype.draw=function(t,e,r,n,a,i,o,s,l,u,c,h,d,f,p,m){var g,y=t.gl;for(var v in t.program.set(this.program),t.setDepthMode(r),t.setStencilMode(n),t.setColorMode(a),t.setCullFace(i),this.fixedUniforms)this.fixedUniforms[v].set(o[v]);f&&f.setUniforms(t,this.binderUniforms,h,{zoom:d});for(var _=(g={},g[y.LINES]=2,g[y.TRIANGLES]=3,g[y.LINE_STRIP]=1,g)[e],x=0,b=c.get();x<b.length;x+=1){var w=b[x],M=w.vaos||(w.vaos={});(M[s]||(M[s]=new ur)).bind(t,this,l,f?f.getPaintVertexBuffers():[],u,w.vertexOffset,p,m),y.drawElements(e,w.primitiveLength*_,y.UNSIGNED_SHORT,w.primitiveOffset*_*2)}};var dr=function(e,r,n,a){var i=r.style.light,o=i.properties.get("position"),s=[o.x,o.y,o.z],l=t.create$1();"viewport"===i.properties.get("anchor")&&t.fromRotation(l,-r.transform.angle),t.transformMat3(s,s,l);var u=i.properties.get("color");return{u_matrix:e,u_lightpos:s,u_lightintensity:i.properties.get("intensity"),u_lightcolor:[u.r,u.g,u.b],u_vertical_gradient:+n,u_opacity:a}},fr=function(e,r,n,a,i,o,s){return t.extend(dr(e,r,n,a),hr(o,r,s),{u_height_factor:-Math.pow(2,i.overscaledZ)/s.tileSize/8})},pr=function(t){return{u_matrix:t}},mr=function(e,r,n,a){return t.extend(pr(e),hr(n,r,a))},gr=function(t,e){return{u_matrix:t,u_world:e}},yr=function(e,r,n,a,i){return t.extend(mr(e,r,n,a),{u_world:i})},vr=function(e,r,n,a){var i,o,s=e.transform;if("map"===a.paint.get("circle-pitch-alignment")){var l=se(n,1,s.zoom);i=!0,o=[l,l]}else i=!1,o=s.pixelsToGLUnits;return{u_camera_to_center_distance:s.cameraToCenterDistance,u_scale_with_map:+("map"===a.paint.get("circle-pitch-scale")),u_matrix:e.translatePosMatrix(r.posMatrix,n,a.paint.get("circle-translate"),a.paint.get("circle-translate-anchor")),u_pitch_with_map:+i,u_device_pixel_ratio:t.browser.devicePixelRatio,u_extrude_scale:o}},_r=function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,r.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,r.u_overscale_factor)}},xr=function(t,e,r){var n=se(r,1,e.zoom),a=Math.pow(2,e.zoom-r.tileID.overscaledZ),i=r.tileID.overscaleFactor();return{u_matrix:t,u_camera_to_center_distance:e.cameraToCenterDistance,u_pixels_to_tile_units:n,u_extrude_scale:[e.pixelsToGLUnits[0]/(n*a),e.pixelsToGLUnits[1]/(n*a)],u_overscale_factor:i}},br=function(t,e){return{u_matrix:t,u_color:e}},wr=function(t){return{u_matrix:t}},Mr=function(t,e,r,n){return{u_matrix:t,u_extrude_scale:se(e,1,r),u_intensity:n}};function kr(e,r){var n=Math.pow(2,r.canonical.z),a=r.canonical.y;return[new t.MercatorCoordinate(0,a/n).toLngLat().lat,new t.MercatorCoordinate(0,(a+1)/n).toLngLat().lat]}var Tr=function(e,r,n){var a=e.transform;return{u_matrix:Cr(e,r,n),u_ratio:1/se(r,1,a.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},Lr=function(e,r,n){return t.extend(Tr(e,r,n),{u_image:0})},Ar=function(e,r,n,a){var i=e.transform,o=Er(r,i);return{u_matrix:Cr(e,r,n),u_texsize:r.imageAtlasTexture.size,u_ratio:1/se(r,1,i.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_image:0,u_scale:[t.browser.devicePixelRatio,o,a.fromScale,a.toScale],u_fade:a.t,u_units_to_pixels:[1/i.pixelsToGLUnits[0],1/i.pixelsToGLUnits[1]]}},Sr=function(e,r,n,a,i){var o=e.transform,s=e.lineAtlas,l=Er(r,o),u="round"===n.layout.get("line-cap"),c=s.getDash(a.from,u),h=s.getDash(a.to,u),d=c.width*i.fromScale,f=h.width*i.toScale;return t.extend(Tr(e,r,n),{u_patternscale_a:[l/d,-c.height/2],u_patternscale_b:[l/f,-h.height/2],u_sdfgamma:s.width/(256*Math.min(d,f)*t.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:c.y,u_tex_y_b:h.y,u_mix:i.t})};function Er(t,e){return 1/se(t,1,e.tileZoom)}function Cr(t,e,r){return t.translatePosMatrix(e.tileID.posMatrix,e,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}var Dr=function(t,e,r,n,a){return{u_matrix:t,u_tl_parent:e,u_scale_parent:r,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.opacity*a.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:a.paint.get("raster-brightness-min"),u_brightness_high:a.paint.get("raster-brightness-max"),u_saturation_factor:(o=a.paint.get("raster-saturation"),o>0?1-1/(1.001-o):-o),u_contrast_factor:(i=a.paint.get("raster-contrast"),i>0?1/(1-i):1+i),u_spin_weights:function(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]}(a.paint.get("raster-hue-rotate"))};var i,o},Pr=function(t,e,r,n,a,i,o,s,l,u){var c=a.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:c.cameraToCenterDistance,u_pitch:c.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:c.width/c.height,u_fade_change:a.options.fadeDuration?a.symbolFadeChange:1,u_matrix:i,u_label_plane_matrix:o,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+n,u_texsize:u,u_texture:0}},Or=function(e,r,n,a,i,o,s,l,u,c,h){var d=i.transform;return t.extend(Pr(e,r,n,a,i,o,s,l,u,c),{u_gamma_scale:a?Math.cos(d._pitch)*d.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+h})},zr=function(t,e,r){return{u_matrix:t,u_opacity:e,u_color:r}},Ir=function(e,r,n,a,i,o){return t.extend(function(t,e,r,n){var a=r.imageManager.getPattern(t.from),i=r.imageManager.getPattern(t.to),o=r.imageManager.getPixelSize(),s=o.width,l=o.height,u=Math.pow(2,n.tileID.overscaledZ),c=n.tileSize*Math.pow(2,r.transform.tileZoom)/u,h=c*(n.tileID.canonical.x+n.tileID.wrap*u),d=c*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:a.tl,u_pattern_br_a:a.br,u_pattern_tl_b:i.tl,u_pattern_br_b:i.br,u_texsize:[s,l],u_mix:e.t,u_pattern_size_a:a.displaySize,u_pattern_size_b:i.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/se(n,1,r.transform.tileZoom),u_pixel_coord_upper:[h>>16,d>>16],u_pixel_coord_lower:[65535&h,65535&d]}}(a,o,n,i),{u_matrix:e,u_opacity:r})},Rr={fillExtrusion:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fillExtrusionPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,r.u_height_factor),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform4f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fill:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},fillPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform4f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},fillOutline:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world)}},fillOutlinePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform4f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},circle:function(e,r){return{u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,r.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},collisionBox:_r,collisionCircle:_r,debug:function(e,r){return{u_color:new t.UniformColor(e,r.u_color),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},clippingMask:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmap:function(e,r){return{u_extrude_scale:new t.Uniform1f(e,r.u_extrude_scale),u_intensity:new t.Uniform1f(e,r.u_intensity),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmapTexture:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_color_ramp:new t.Uniform1i(e,r.u_color_ramp),u_opacity:new t.Uniform1f(e,r.u_opacity)}},hillshade:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_latrange:new t.Uniform2f(e,r.u_latrange),u_light:new t.Uniform2f(e,r.u_light),u_shadow:new t.UniformColor(e,r.u_shadow),u_highlight:new t.UniformColor(e,r.u_highlight),u_accent:new t.UniformColor(e,r.u_accent)}},hillshadePrepare:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_dimension:new t.Uniform2f(e,r.u_dimension),u_zoom:new t.Uniform1f(e,r.u_zoom),u_maxzoom:new t.Uniform1f(e,r.u_maxzoom)}},line:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels)}},lineGradient:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_image:new t.Uniform1i(e,r.u_image)}},linePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_texsize:new t.Uniform2f(e,r.u_texsize),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_image:new t.Uniform1i(e,r.u_image),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_scale:new t.Uniform4f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},lineSDF:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,r.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,r.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,r.u_sdfgamma),u_image:new t.Uniform1i(e,r.u_image),u_tex_y_a:new t.Uniform1f(e,r.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,r.u_tex_y_b),u_mix:new t.Uniform1f(e,r.u_mix)}},raster:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_tl_parent:new t.Uniform2f(e,r.u_tl_parent),u_scale_parent:new t.Uniform1f(e,r.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,r.u_buffer_scale),u_fade_t:new t.Uniform1f(e,r.u_fade_t),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image0:new t.Uniform1i(e,r.u_image0),u_image1:new t.Uniform1i(e,r.u_image1),u_brightness_low:new t.Uniform1f(e,r.u_brightness_low),u_brightness_high:new t.Uniform1f(e,r.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,r.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,r.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,r.u_spin_weights)}},symbolIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1f(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture)}},symbolSDF:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1f(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1f(e,r.u_is_halo)}},background:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_color:new t.UniformColor(e,r.u_color)}},backgroundPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image:new t.Uniform1i(e,r.u_image),u_pattern_tl_a:new t.Uniform2f(e,r.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,r.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,r.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,r.u_pattern_br_b),u_texsize:new t.Uniform2f(e,r.u_texsize),u_mix:new t.Uniform1f(e,r.u_mix),u_pattern_size_a:new t.Uniform2f(e,r.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,r.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,r.u_scale_a),u_scale_b:new t.Uniform1f(e,r.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,r.u_tile_units_to_pixels)}}};function Fr(e,r){for(var n=e.sort((function(t,e){return t.tileID.isLessThan(e.tileID)?-1:e.tileID.isLessThan(t.tileID)?1:0})),a=0;a<n.length;a++){var i={},o=n[a],s=n.slice(a+1);Nr(o.tileID.wrapped(),o.tileID,s,new t.OverscaledTileID(0,o.tileID.wrap+1,0,0,0),i),o.setMask(i,r)}}function Nr(e,r,n,a,i){for(var o=0;o<n.length;o++){var s=n[o];if(a.isLessThan(s.tileID))break;if(r.key===s.tileID.key)return;if(s.tileID.isChildOf(r)){for(var l=r.children(1/0),u=0;u<l.length;u++)Nr(e,l[u],n.slice(o),a,i);return}}var c=r.overscaledZ-e.overscaledZ,h=new t.CanonicalTileID(c,r.canonical.x-(e.canonical.x<<c),r.canonical.y-(e.canonical.y<<c));i[h.key]=i[h.key]||h}function Yr(t,e,r,n,a){for(var i=t.context,o=i.gl,s=a?t.useProgram("collisionCircle"):t.useProgram("collisionBox"),l=0;l<n.length;l++){var u=n[l],c=e.getTile(u),h=c.getBucket(r);if(h){var d=a?h.collisionCircle:h.collisionBox;d&&s.draw(i,a?o.TRIANGLES:o.LINES,Mt.disabled,kt.disabled,t.colorModeForRenderPass(),Lt.disabled,xr(u.posMatrix,t.transform,c),r.id,d.layoutVertexBuffer,d.indexBuffer,d.segments,null,t.transform.zoom,null,null,d.collisionVertexBuffer)}}}var jr=t.identity(new Float32Array(16));function Br(e,r,n,a,i,o){var s=t.getAnchorAlignment(e),l=-(s.horizontalAlign-.5)*r,u=-(s.verticalAlign-.5)*n,c=t.evaluateRadialOffset(e,a);return new t.Point((l/i+c[0])*o,(u/i+c[1])*o)}function Hr(e,r,n,a,i,o,s,l,u,c){var h=e.text.placedSymbolArray,d=e.text.dynamicLayoutVertexArray;d.clear();for(var f=0;f<h.length;f++){var p=h.get(f),m=!p.hidden&&p.crossTileID?a[p.crossTileID]:null;if(m){var g=new t.Point(p.anchorX,p.anchorY),y=Zt(g,n?l:s),v=.5+o.cameraToCenterDistance/y.signedDistanceFromCamera*.5,_=i.evaluateSizeForFeature(e.textSizeData,c,p)*v/t.ONE_EM;n&&(_*=e.tilePixelRatio/u);for(var x=m.width,b=m.height,w=m.radialOffset,M=m.textBoxScale,k=Br(m.anchor,x,b,w,M,_),T=n?Zt(g.add(k),s).point:y.point.add(r?k.rotate(-o.angle):k),L=0;L<p.numGlyphs;L++)t.addDynamicAttributes(d,T,0)}else ne(p.numGlyphs,d)}e.text.dynamicLayoutVertexBuffer.updateData(d)}function Ur(e,r,n,a,i,o,s,l,u,c,h,d,f){for(var p,m,g=e.context,y=g.gl,v=e.transform,_="map"===l,x="map"===u,b=_&&"point"!==n.layout.get("symbol-placement"),w=_&&!x&&!b,M=void 0!==n.layout.get("symbol-sort-key").constantOr(1),k=e.depthModeForSublayer(0,Mt.ReadOnly),T=n.layout.get("text-variable-anchor"),L=[],A=0,S=a;A<S.length;A+=1){var E=S[A],C=r.getTile(E),D=C.getBucket(n);if(D){var P=i?D.text:D.icon;if(P&&P.segments.get().length){var O=P.programConfigurations.get(n.id),z=i||D.sdfIcons,I=i?D.textSizeData:D.iconSizeData;p||(p=e.useProgram(z?"symbolSDF":"symbolIcon",O),m=t.evaluateSizeForZoom(I,v.zoom)),g.activeTexture.set(y.TEXTURE0);var R=void 0,F=void 0,N=void 0;if(i)F=C.glyphAtlasTexture,N=y.LINEAR,R=C.glyphAtlasTexture.size;else{var Y=1!==n.layout.get("icon-size").constantOr(0)||D.iconsNeedLinear,j=x||0!==v.pitch;F=C.imageAtlasTexture,N=z||e.options.rotating||e.options.zooming||Y||j?y.LINEAR:y.NEAREST,R=C.imageAtlasTexture.size}var B=se(C,1,e.transform.zoom),H=Gt(E.posMatrix,x,_,e.transform,B),U=qt(E.posMatrix,x,_,e.transform,B);if(b)Jt(D,E.posMatrix,e,i,H,U,x,c);else if(i&&m&&T){var V=Math.pow(2,v.zoom-C.tileID.overscaledZ);Hr(D,_,x,f,t.symbolSize,v,H,E.posMatrix,V,m)}var W=e.translatePosMatrix(E.posMatrix,C,o,s),G=b||i&&T?jr:H,q=e.translatePosMatrix(U,C,o,s,!0),Z=z&&0!==n.paint.get(i?"text-halo-width":"icon-halo-width").constantOr(1),X={program:p,buffers:P,uniformValues:z?Or(I.kind,m,w,x,e,W,G,q,i,R,!0):Pr(I.kind,m,w,x,e,W,G,q,i,R),atlasTexture:F,atlasInterpolation:N,isSDF:z,hasHalo:Z};if(M)for(var J=0,K=P.segments.get();J<K.length;J+=1){var $=K[J];L.push({segments:new t.SegmentVector([$]),sortKey:$.sortKey,state:X})}else L.push({segments:P.segments,sortKey:0,state:X})}}}M&&L.sort((function(t,e){return t.sortKey-e.sortKey}));for(var Q=0,tt=L;Q<tt.length;Q+=1){var et=tt[Q],rt=et.state;if(rt.atlasTexture.bind(rt.atlasInterpolation,y.CLAMP_TO_EDGE),rt.isSDF){var nt=rt.uniformValues;rt.hasHalo&&(nt.u_is_halo=1,Vr(rt.buffers,et.segments,n,e,rt.program,k,h,d,nt)),nt.u_is_halo=0}Vr(rt.buffers,et.segments,n,e,rt.program,k,h,d,rt.uniformValues)}}function Vr(t,e,r,n,a,i,o,s,l){var u=n.context,c=u.gl;a.draw(u,c.TRIANGLES,i,o,s,Lt.disabled,l,r.id,t.layoutVertexBuffer,t.indexBuffer,e,r.paint,n.transform.zoom,t.programConfigurations.get(r.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function Wr(t,e,r,n,a,i,o){var s,l,u,c,h,d=t.context.gl,f=r.paint.get("fill-pattern"),p=f&&f.constantOr(1),m=r.getCrossfadeParameters();o?(l=p&&!r.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",s=d.LINES):(l=p?"fillPattern":"fill",s=d.TRIANGLES);for(var g=0,y=n;g<y.length;g+=1){var v=y[g],_=e.getTile(v);if(!p||_.patternsLoaded()){var x=_.getBucket(r);if(x){var b=x.programConfigurations.get(r.id),w=t.useProgram(l,b);p&&(t.context.activeTexture.set(d.TEXTURE0),_.imageAtlasTexture.bind(d.LINEAR,d.CLAMP_TO_EDGE),b.updatePatternPaintBuffers(m));var M=f.constantOr(null);if(M&&_.imageAtlas){var k=_.imageAtlas.patternPositions[M.to],T=_.imageAtlas.patternPositions[M.from];k&&T&&b.setConstantPatternPositions(k,T)}var L=t.translatePosMatrix(v.posMatrix,_,r.paint.get("fill-translate"),r.paint.get("fill-translate-anchor"));if(o){c=x.indexBuffer2,h=x.segments2;var A=[d.drawingBufferWidth,d.drawingBufferHeight];u="fillOutlinePattern"===l&&p?yr(L,t,m,_,A):gr(L,A)}else c=x.indexBuffer,h=x.segments,u=p?mr(L,t,m,_):pr(L);w.draw(t.context,s,a,t.stencilModeForClipping(v),i,Lt.disabled,u,r.id,x.layoutVertexBuffer,c,h,r.paint,t.transform.zoom,b)}}}}function Gr(t,e,r,n,a,i,o){for(var s=t.context,l=s.gl,u=r.paint.get("fill-extrusion-pattern"),c=u.constantOr(1),h=r.getCrossfadeParameters(),d=r.paint.get("fill-extrusion-opacity"),f=0,p=n;f<p.length;f+=1){var m=p[f],g=e.getTile(m),y=g.getBucket(r);if(y){var v=y.programConfigurations.get(r.id),_=t.useProgram(c?"fillExtrusionPattern":"fillExtrusion",v);c&&(t.context.activeTexture.set(l.TEXTURE0),g.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),v.updatePatternPaintBuffers(h));var x=u.constantOr(null);if(x&&g.imageAtlas){var b=g.imageAtlas.patternPositions[x.to],w=g.imageAtlas.patternPositions[x.from];b&&w&&v.setConstantPatternPositions(b,w)}var M=t.translatePosMatrix(m.posMatrix,g,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),k=r.paint.get("fill-extrusion-vertical-gradient"),T=c?fr(M,t,k,d,m,h,g):dr(M,t,k,d);_.draw(s,s.gl.TRIANGLES,a,i,o,Lt.backCCW,T,r.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,r.paint,t.transform.zoom,v)}}}function qr(t,e,r,n,a,i){var o=t.context,s=o.gl,l=e.fbo;if(l){var u=t.useProgram("hillshade");o.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,l.colorAttachment.get());var c=function(t,e,r){var n=r.paint.get("hillshade-shadow-color"),a=r.paint.get("hillshade-highlight-color"),i=r.paint.get("hillshade-accent-color"),o=r.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===r.paint.get("hillshade-illumination-anchor")&&(o-=t.transform.angle);var s=!t.options.moving;return{u_matrix:t.transform.calculatePosMatrix(e.tileID.toUnwrapped(),s),u_image:0,u_latrange:kr(0,e.tileID),u_light:[r.paint.get("hillshade-exaggeration"),o],u_shadow:n,u_highlight:a,u_accent:i}}(t,e,r);e.maskedBoundsBuffer&&e.maskedIndexBuffer&&e.segments?u.draw(o,s.TRIANGLES,n,a,i,Lt.disabled,c,r.id,e.maskedBoundsBuffer,e.maskedIndexBuffer,e.segments):u.draw(o,s.TRIANGLES,n,a,i,Lt.disabled,c,r.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}}function Zr(e,r,n,a,i,o,s){var l=e.context,u=l.gl;if(r.dem&&r.dem.data){var c=r.dem.dim,h=r.dem.stride,d=r.dem.getPixels();if(l.activeTexture.set(u.TEXTURE1),l.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||e.getTileTexture(h),r.demTexture){var f=r.demTexture;f.update(d,{premultiply:!1}),f.bind(u.NEAREST,u.CLAMP_TO_EDGE)}else r.demTexture=new t.Texture(l,d,u.RGBA,{premultiply:!1}),r.demTexture.bind(u.NEAREST,u.CLAMP_TO_EDGE);l.activeTexture.set(u.TEXTURE0);var p=r.fbo;if(!p){var m=new t.Texture(l,{width:c,height:c,data:null},u.RGBA);m.bind(u.LINEAR,u.CLAMP_TO_EDGE),(p=r.fbo=l.createFramebuffer(c,c)).colorAttachment.set(m.texture)}l.bindFramebuffer.set(p.framebuffer),l.viewport.set([0,0,c,c]),e.useProgram("hillshadePrepare").draw(l,u.TRIANGLES,i,o,s,Lt.disabled,function(e,r){var n=e.dem.stride,a=t.create();return t.ortho(a,0,t.EXTENT,-t.EXTENT,0,0,1),t.translate(a,a,[0,-t.EXTENT,0]),{u_matrix:a,u_image:1,u_dimension:[n,n],u_zoom:e.tileID.overscaledZ,u_maxzoom:r}}(r,a),n.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments),r.needsHillshadePrepare=!1}}function Xr(e,r,n,a,i){var o=a.paint.get("raster-fade-duration");if(o>0){var s=t.browser.now(),l=(s-e.timeAdded)/o,u=r?(s-r.timeAdded)/o:-1,c=n.getSource(),h=i.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),d=!r||Math.abs(r.tileID.overscaledZ-h)>Math.abs(e.tileID.overscaledZ-h),f=d&&e.refreshedUponExpiration?1:t.clamp(d?l:1-u,0,1);return e.refreshedUponExpiration&&l>=1&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-f}:{opacity:f,mix:0}}return{opacity:1,mix:0}}function Jr(e,r,n){var a=e.context,i=a.gl,o=n.posMatrix,s=e.useProgram("debug"),l=Mt.disabled,u=kt.disabled,c=e.colorModeForRenderPass(),h="$debug";s.draw(a,i.LINE_STRIP,l,u,c,Lt.disabled,br(o,t.Color.red),h,e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);for(var d=r.getTileByID(n.key).latestRawTileData,f=d&&d.byteLength||0,p=Math.floor(f/1024),m=function(t,e,r,n){n=n||1;var a,i,o,s,l,u,c,h,d=[];for(a=0,i=t.length;a<i;a++)if(l=Kr[t[a]]){for(h=null,o=0,s=l[1].length;o<s;o+=2)-1===l[1][o]&&-1===l[1][o+1]?h=null:(u=e+l[1][o]*n,c=200-l[1][o+1]*n,h&&d.push(h.x,h.y,u,c),h={x:u,y:c});e+=l[0]*n}return d}(n.toString()+" "+p+"kb",50,0,5),g=new t.StructArrayLayout2i4,y=new t.StructArrayLayout2ui4,v=0;v<m.length;v+=2)g.emplaceBack(m[v],m[v+1]),y.emplaceBack(v,v+1);for(var _=a.createVertexBuffer(g,Ie.members),x=a.createIndexBuffer(y),b=t.SegmentVector.simpleSegment(0,0,g.length/2,g.length/2),w=r.getTile(n).tileSize,M=t.EXTENT/(Math.pow(2,e.transform.zoom-n.overscaledZ)*w),k=[[-1,-1],[-1,1],[1,-1],[1,1]],T=0;T<k.length;T++){var L=k[T];s.draw(a,i.LINES,l,u,c,Lt.disabled,br(t.translate([],o,[M*L[0],M*L[1],0]),t.Color.white),h,_,x,b)}s.draw(a,i.LINES,l,u,c,Lt.disabled,br(o,t.Color.black),h,_,x,b)}var Kr={" ":[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]]},$r={symbol:function(t,e,r,n,a){if("translucent"===t.renderPass){var i=kt.disabled,o=t.colorModeForRenderPass();0!==r.paint.get("icon-opacity").constantOr(1)&&Ur(t,e,r,n,!1,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),r.layout.get("icon-rotation-alignment"),r.layout.get("icon-pitch-alignment"),r.layout.get("icon-keep-upright"),i,o,a),0!==r.paint.get("text-opacity").constantOr(1)&&Ur(t,e,r,n,!0,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),r.layout.get("text-keep-upright"),i,o,a),e.map.showCollisionBoxes&&function(t,e,r,n){Yr(t,e,r,n,!1),Yr(t,e,r,n,!0)}(t,e,r,n)}},circle:function(t,e,r,n){if("translucent"===t.renderPass){var a=r.paint.get("circle-opacity"),i=r.paint.get("circle-stroke-width"),o=r.paint.get("circle-stroke-opacity");if(0!==a.constantOr(1)||0!==i.constantOr(1)&&0!==o.constantOr(1))for(var s=t.context,l=s.gl,u=t.depthModeForSublayer(0,Mt.ReadOnly),c=kt.disabled,h=t.colorModeForRenderPass(),d=0;d<n.length;d++){var f=n[d],p=e.getTile(f),m=p.getBucket(r);if(m){var g=m.programConfigurations.get(r.id);t.useProgram("circle",g).draw(s,l.TRIANGLES,u,c,h,Lt.disabled,vr(t,f,p,r),r.id,m.layoutVertexBuffer,m.indexBuffer,m.segments,r.paint,t.transform.zoom,g)}}}},heatmap:function(e,r,n,a){if(0!==n.paint.get("heatmap-opacity"))if("offscreen"===e.renderPass){var i=e.context,o=i.gl,s=e.depthModeForSublayer(0,Mt.ReadOnly),l=kt.disabled,u=new Tt([o.ONE,o.ONE],t.Color.transparent,[!0,!0,!0,!0]);!function(t,e,r){var n=t.gl;t.activeTexture.set(n.TEXTURE1),t.viewport.set([0,0,e.width/4,e.height/4]);var a=r.heatmapFbo;if(a)n.bindTexture(n.TEXTURE_2D,a.colorAttachment.get()),t.bindFramebuffer.set(a.framebuffer);else{var i=n.createTexture();n.bindTexture(n.TEXTURE_2D,i),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),a=r.heatmapFbo=t.createFramebuffer(e.width/4,e.height/4),function t(e,r,n,a){var i=e.gl;i.texImage2D(i.TEXTURE_2D,0,i.RGBA,r.width/4,r.height/4,0,i.RGBA,e.extTextureHalfFloat?e.extTextureHalfFloat.HALF_FLOAT_OES:i.UNSIGNED_BYTE,null),a.colorAttachment.set(n),e.extTextureHalfFloat&&i.checkFramebufferStatus(i.FRAMEBUFFER)!==i.FRAMEBUFFER_COMPLETE&&(e.extTextureHalfFloat=null,a.colorAttachment.setDirty(),t(e,r,n,a))}(t,e,i,a)}}(i,e,n),i.clear({color:t.Color.transparent});for(var c=0;c<a.length;c++){var h=a[c];if(!r.hasRenderableParent(h)){var d=r.getTile(h),f=d.getBucket(n);if(f){var p=f.programConfigurations.get(n.id),m=e.useProgram("heatmap",p),g=e.transform.zoom;m.draw(i,o.TRIANGLES,s,l,u,Lt.disabled,Mr(h.posMatrix,d,g,n.paint.get("heatmap-intensity")),n.id,f.layoutVertexBuffer,f.indexBuffer,f.segments,n.paint,e.transform.zoom,p)}}}i.viewport.set([0,0,e.width,e.height])}else"translucent"===e.renderPass&&(e.context.setColorMode(e.colorModeForRenderPass()),function(e,r){var n=e.context,a=n.gl,i=r.heatmapFbo;if(i){n.activeTexture.set(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,i.colorAttachment.get()),n.activeTexture.set(a.TEXTURE1);var o=r.colorRampTexture;o||(o=r.colorRampTexture=new t.Texture(n,r.colorRamp,a.RGBA)),o.bind(a.LINEAR,a.CLAMP_TO_EDGE),e.useProgram("heatmapTexture").draw(n,a.TRIANGLES,Mt.disabled,kt.disabled,e.colorModeForRenderPass(),Lt.disabled,function(e,r,n,a){var i=t.create();t.ortho(i,0,e.width,e.height,0,0,1);var o=e.context.gl;return{u_matrix:i,u_world:[o.drawingBufferWidth,o.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:r.paint.get("heatmap-opacity")}}(e,r),r.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,r.paint,e.transform.zoom)}}(e,n))},line:function(e,r,n,a){if("translucent"===e.renderPass){var i=n.paint.get("line-opacity"),o=n.paint.get("line-width");if(0!==i.constantOr(1)&&0!==o.constantOr(1)){var s=e.depthModeForSublayer(0,Mt.ReadOnly),l=e.colorModeForRenderPass(),u=n.paint.get("line-dasharray"),c=n.paint.get("line-pattern"),h=c.constantOr(1),d=n.paint.get("line-gradient"),f=n.getCrossfadeParameters(),p=u?"lineSDF":h?"linePattern":d?"lineGradient":"line",m=e.context,g=m.gl,y=!0;if(d){m.activeTexture.set(g.TEXTURE0);var v=n.gradientTexture;if(!n.gradient)return;v||(v=n.gradientTexture=new t.Texture(m,n.gradient,g.RGBA)),v.bind(g.LINEAR,g.CLAMP_TO_EDGE)}for(var _=0,x=a;_<x.length;_+=1){var b=x[_],w=r.getTile(b);if(!h||w.patternsLoaded()){var M=w.getBucket(n);if(M){var k=M.programConfigurations.get(n.id),T=e.context.program.get(),L=e.useProgram(p,k),A=y||L.program!==T,S=c.constantOr(null);if(S&&w.imageAtlas){var E=w.imageAtlas.patternPositions[S.to],C=w.imageAtlas.patternPositions[S.from];E&&C&&k.setConstantPatternPositions(E,C)}var D=u?Sr(e,w,n,u,f):h?Ar(e,w,n,f):d?Lr(e,w,n):Tr(e,w,n);u&&(A||e.lineAtlas.dirty)?(m.activeTexture.set(g.TEXTURE0),e.lineAtlas.bind(m)):h&&(m.activeTexture.set(g.TEXTURE0),w.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),k.updatePatternPaintBuffers(f)),L.draw(m,g.TRIANGLES,s,e.stencilModeForClipping(b),l,Lt.disabled,D,n.id,M.layoutVertexBuffer,M.indexBuffer,M.segments,n.paint,e.transform.zoom,k),y=!1}}}}}},fill:function(e,r,n,a){var i=n.paint.get("fill-color"),o=n.paint.get("fill-opacity");if(0!==o.constantOr(1)){var s=e.colorModeForRenderPass(),l=n.paint.get("fill-pattern"),u=e.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===i.constantOr(t.Color.transparent).a&&1===o.constantOr(0)?"opaque":"translucent";if(e.renderPass===u){var c=e.depthModeForSublayer(1,"opaque"===e.renderPass?Mt.ReadWrite:Mt.ReadOnly);Wr(e,r,n,a,c,s,!1)}if("translucent"===e.renderPass&&n.paint.get("fill-antialias")){var h=e.depthModeForSublayer(n.getPaintProperty("fill-outline-color")?2:0,Mt.ReadOnly);Wr(e,r,n,a,h,s,!0)}}},"fill-extrusion":function(t,e,r,n){var a=r.paint.get("fill-extrusion-opacity");if(0!==a&&"translucent"===t.renderPass){var i=new Mt(t.context.gl.LEQUAL,Mt.ReadWrite,t.depthRangeFor3D);if(1!==a||r.paint.get("fill-extrusion-pattern").constantOr(1))Gr(t,e,r,n,i,kt.disabled,Tt.disabled),Gr(t,e,r,n,i,t.stencilModeFor3D(),t.colorModeForRenderPass());else{var o=t.colorModeForRenderPass();Gr(t,e,r,n,i,kt.disabled,o)}}},hillshade:function(t,e,r,n){if("offscreen"===t.renderPass||"translucent"===t.renderPass){for(var a=t.context,i=e.getSource().maxzoom,o=t.depthModeForSublayer(0,Mt.ReadOnly),s=kt.disabled,l=t.colorModeForRenderPass(),u=0,c=n;u<c.length;u+=1){var h=c[u],d=e.getTile(h);d.needsHillshadePrepare&&"offscreen"===t.renderPass?Zr(t,d,r,i,o,s,l):"translucent"===t.renderPass&&qr(t,d,r,o,s,l)}a.viewport.set([0,0,t.width,t.height])}},raster:function(t,e,r,n){if("translucent"===t.renderPass&&0!==r.paint.get("raster-opacity"))for(var a=t.context,i=a.gl,o=e.getSource(),s=t.useProgram("raster"),l=kt.disabled,u=t.colorModeForRenderPass(),c=n.length&&n[0].overscaledZ,h=!t.options.moving,d=0,f=n;d<f.length;d+=1){var p=f[d],m=t.depthModeForSublayer(p.overscaledZ-c,1===r.paint.get("raster-opacity")?Mt.ReadWrite:Mt.ReadOnly,i.LESS),g=e.getTile(p),y=t.transform.calculatePosMatrix(p.toUnwrapped(),h);g.registerFadeDuration(r.paint.get("raster-fade-duration"));var v=e.findLoadedParent(p,0),_=Xr(g,v,e,r,t.transform),x=void 0,b=void 0,w="nearest"===r.paint.get("raster-resampling")?i.NEAREST:i.LINEAR;a.activeTexture.set(i.TEXTURE0),g.texture.bind(w,i.CLAMP_TO_EDGE,i.LINEAR_MIPMAP_NEAREST),a.activeTexture.set(i.TEXTURE1),v?(v.texture.bind(w,i.CLAMP_TO_EDGE,i.LINEAR_MIPMAP_NEAREST),x=Math.pow(2,v.tileID.overscaledZ-g.tileID.overscaledZ),b=[g.tileID.canonical.x*x%1,g.tileID.canonical.y*x%1]):g.texture.bind(w,i.CLAMP_TO_EDGE,i.LINEAR_MIPMAP_NEAREST);var M=Dr(y,b||[0,0],x||1,_,r);o instanceof C?s.draw(a,i.TRIANGLES,m,l,u,Lt.disabled,M,r.id,o.boundsBuffer,t.quadTriangleIndexBuffer,o.boundsSegments):g.maskedBoundsBuffer&&g.maskedIndexBuffer&&g.segments?s.draw(a,i.TRIANGLES,m,l,u,Lt.disabled,M,r.id,g.maskedBoundsBuffer,g.maskedIndexBuffer,g.segments,r.paint,t.transform.zoom):s.draw(a,i.TRIANGLES,m,l,u,Lt.disabled,M,r.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}},background:function(t,e,r){var n=r.paint.get("background-color"),a=r.paint.get("background-opacity");if(0!==a){var i=t.context,o=i.gl,s=t.transform,l=s.tileSize,u=r.paint.get("background-pattern");if(!t.isPatternMissing(u)){var c=u||1!==n.a||1!==a?"translucent":"opaque";if(t.renderPass===c){var h=kt.disabled,d=t.depthModeForSublayer(0,"opaque"===c?Mt.ReadWrite:Mt.ReadOnly),f=t.colorModeForRenderPass(),p=t.useProgram(u?"backgroundPattern":"background"),m=s.coveringTiles({tileSize:l});u&&(i.activeTexture.set(o.TEXTURE0),t.imageManager.bind(t.context));for(var g=r.getCrossfadeParameters(),y=0,v=m;y<v.length;y+=1){var _=v[y],x=t.transform.calculatePosMatrix(_.toUnwrapped()),b=u?Ir(x,a,t,u,{tileID:_,tileSize:l},g):zr(x,a,n);p.draw(i,o.TRIANGLES,d,h,f,Lt.disabled,b,r.id,t.tileExtentBuffer,t.quadTriangleIndexBuffer,t.tileExtentSegments)}}}}},debug:function(t,e,r){for(var n=0;n<r.length;n++)Jr(t,e,r[n])},custom:function(t,e,r){var n=t.context,a=r.implementation;if("offscreen"===t.renderPass){var i=a.prerender;i&&(t.setCustomLayerDefaults(),n.setColorMode(t.colorModeForRenderPass()),i.call(a,n.gl,t.transform.customLayerMatrix()),n.setDirty(),t.setBaseState())}else if("translucent"===t.renderPass){t.setCustomLayerDefaults(),n.setColorMode(t.colorModeForRenderPass()),n.setStencilMode(kt.disabled);var o="3d"===a.renderingMode?new Mt(t.context.gl.LEQUAL,Mt.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,Mt.ReadOnly);n.setDepthMode(o),a.render(n.gl,t.transform.customLayerMatrix()),n.setDirty(),t.setBaseState(),n.bindFramebuffer.set(null)}}},Qr=function(e,r){this.context=new At(e),this.transform=r,this._tileTextures={},this.setup(),this.numSublayers=St.maxUnderzooming+St.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.depthRboNeedsClear=!0,this.emptyProgramConfiguration=new t.ProgramConfiguration,this.crossTileSymbolIndex=new Ce};function tn(t,e){if(t.y>e.y){var r=t;t=e,e=r}return{x0:t.x,y0:t.y,x1:e.x,y1:e.y,dx:e.x-t.x,dy:e.y-t.y}}function en(t,e,r,n,a){var i=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,d=i;d<o;d++){var f=l*Math.max(0,Math.min(t.dy,d+c-t.y0))+t.x0,p=u*Math.max(0,Math.min(e.dy,d+h-e.y0))+e.x0;a(Math.floor(p),Math.ceil(f),d)}}function rn(t,e,r,n,a,i){var o,s=tn(t,e),l=tn(e,r),u=tn(r,t);s.dy>l.dy&&(o=s,s=l,l=o),s.dy>u.dy&&(o=s,s=u,u=o),l.dy>u.dy&&(o=l,l=u,u=o),s.dy&&en(u,s,n,a,i),l.dy&&en(u,l,n,a,i)}Qr.prototype.resize=function(e,r){var n=this.context.gl;if(this.width=e*t.browser.devicePixelRatio,this.height=r*t.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var a=0,i=this.style._order;a<i.length;a+=1){var o=i[a];this.style._layers[o].resize()}this.depthRbo&&(n.deleteRenderbuffer(this.depthRbo),this.depthRbo=null)},Qr.prototype.setup=function(){var e=this.context,r=new t.StructArrayLayout2i4;r.emplaceBack(0,0),r.emplaceBack(t.EXTENT,0),r.emplaceBack(0,t.EXTENT),r.emplaceBack(t.EXTENT,t.EXTENT),this.tileExtentBuffer=e.createVertexBuffer(r,Ie.members),this.tileExtentSegments=t.SegmentVector.simpleSegment(0,0,4,2);var n=new t.StructArrayLayout2i4;n.emplaceBack(0,0),n.emplaceBack(t.EXTENT,0),n.emplaceBack(0,t.EXTENT),n.emplaceBack(t.EXTENT,t.EXTENT),this.debugBuffer=e.createVertexBuffer(n,Ie.members),this.debugSegments=t.SegmentVector.simpleSegment(0,0,4,5);var a=new t.StructArrayLayout4i8;a.emplaceBack(0,0,0,0),a.emplaceBack(t.EXTENT,0,t.EXTENT,0),a.emplaceBack(0,t.EXTENT,0,t.EXTENT),a.emplaceBack(t.EXTENT,t.EXTENT,t.EXTENT,t.EXTENT),this.rasterBoundsBuffer=e.createVertexBuffer(a,t.rasterBoundsAttributes.members),this.rasterBoundsSegments=t.SegmentVector.simpleSegment(0,0,4,2);var i=new t.StructArrayLayout2i4;i.emplaceBack(0,0),i.emplaceBack(1,0),i.emplaceBack(0,1),i.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(i,Ie.members),this.viewportSegments=t.SegmentVector.simpleSegment(0,0,4,2);var o=new t.StructArrayLayout1ui2;o.emplaceBack(0),o.emplaceBack(1),o.emplaceBack(3),o.emplaceBack(2),o.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(o);var s=new t.StructArrayLayout3ui6;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(s);var l=this.context.gl;this.stencilClearMode=new kt({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO)},Qr.prototype.clearStencil=function(){var e=this.context,r=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var n=t.create();t.ortho(n,0,this.width,this.height,0,0,1),t.scale(n,n,[r.drawingBufferWidth,r.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(e,r.TRIANGLES,Mt.disabled,this.stencilClearMode,Tt.disabled,Lt.disabled,wr(n),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},Qr.prototype._renderTileClippingMasks=function(t,e){if(this.currentStencilSource!==t.source&&t.isTileClipped()&&e&&e.length){this.currentStencilSource=t.source;var r=this.context,n=r.gl;this.nextStencilID+e.length>256&&this.clearStencil(),r.setColorMode(Tt.disabled),r.setDepthMode(Mt.disabled);var a=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var i=0,o=e;i<o.length;i+=1){var s=o[i],l=this._tileClippingMaskIDs[s.key]=this.nextStencilID++;a.draw(r,n.TRIANGLES,Mt.disabled,new kt({func:n.ALWAYS,mask:0},l,255,n.KEEP,n.KEEP,n.REPLACE),Tt.disabled,Lt.disabled,wr(s.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},Qr.prototype.stencilModeFor3D=function(){this.nextStencilID+1>256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new kt({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},Qr.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new kt({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},Qr.prototype.colorModeForRenderPass=function(){var e=this.context.gl;return this._showOverdrawInspector?new Tt([e.CONSTANT_COLOR,e.ONE],new t.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):"opaque"===this.renderPass?Tt.unblended:Tt.alphaBlended},Qr.prototype.depthModeForSublayer=function(t,e,r){if(!this.opaquePassEnabledForLayer())return Mt.disabled;var n=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new Mt(r||this.context.gl.LEQUAL,e,[n,n])},Qr.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},Qr.prototype.render=function(e,r){this.style=e,this.options=r,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(t.browser.now()),this.imageManager.beginFrame();var n=this.style._order,a=this.style.sourceCaches;for(var i in a){var o=a[i];o.used&&o.prepare(this.context)}var s={},l={},u={};for(var c in a){var h=a[c];s[c]=h.getVisibleCoordinates(),l[c]=s[c].slice().reverse(),u[c]=h.getVisibleCoordinates(!0).reverse()}for(var d in a){var f=a[d],p=f.getSource();if("raster"===p.type||"raster-dem"===p.type){for(var m=[],g=0,y=s[d];g<y.length;g+=1){var v=y[g];m.push(f.getTile(v))}Fr(m,this.context)}}this.opaquePassCutoff=1/0;for(var _=0;_<n.length;_++){var x=n[_];if(this.style._layers[x].is3D()){this.opaquePassCutoff=_;break}}this.renderPass="offscreen",this.depthRboNeedsClear=!0;for(var b=0,w=n;b<w.length;b+=1){var M=w[b],k=this.style._layers[M];if(k.hasOffscreenPass()&&!k.isHidden(this.transform.zoom)){var T=l[k.source];("custom"===k.type||T.length)&&this.renderLayer(this,a[k.source],k,T)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:r.showOverdrawInspector?t.Color.black:t.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=r.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=n.length-1;this.currentLayer>=0;this.currentLayer--){var L=this.style._layers[n[this.currentLayer]],A=a[L.source],S=s[L.source];this._renderTileClippingMasks(L,S),this.renderLayer(this,A,L,S)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<n.length;this.currentLayer++){var E=this.style._layers[n[this.currentLayer]],C=a[E.source],D=("symbol"===E.type?u:l)[E.source];this._renderTileClippingMasks(E,s[E.source]),this.renderLayer(this,C,E,D)}if(this.options.showTileBoundaries)for(var P in a){$r.debug(this,a[P],s[P]);break}this.context.setDefault()},Qr.prototype.setupOffscreenDepthRenderbuffer=function(){var t=this.context;this.depthRbo||(this.depthRbo=t.createRenderbuffer(t.gl.DEPTH_COMPONENT16,this.width,this.height))},Qr.prototype.renderLayer=function(t,e,r,n){r.isHidden(this.transform.zoom)||("background"===r.type||"custom"===r.type||n.length)&&(this.id=r.id,$r[r.type](t,e,r,n,this.style.placement.variableOffsets))},Qr.prototype.translatePosMatrix=function(e,r,n,a,i){if(!n[0]&&!n[1])return e;var o=i?"map"===a?this.transform.angle:0:"viewport"===a?-this.transform.angle:0;if(o){var s=Math.sin(o),l=Math.cos(o);n=[n[0]*l-n[1]*s,n[0]*s+n[1]*l]}var u=[i?n[0]:se(r,n[0],this.transform.zoom),i?n[1]:se(r,n[1],this.transform.zoom),0],c=new Float32Array(16);return t.translate(c,e,u),c},Qr.prototype.saveTileTexture=function(t){var e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]},Qr.prototype.getTileTexture=function(t){var e=this._tileTextures[t];return e&&e.length>0?e.pop():null},Qr.prototype.isPatternMissing=function(t){if(!t)return!1;var e=this.imageManager.getPattern(t.from),r=this.imageManager.getPattern(t.to);return!e||!r},Qr.prototype.useProgram=function(t,e){void 0===e&&(e=this.emptyProgramConfiguration),this.cache=this.cache||{};var r=""+t+(e.cacheKey||"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new cr(this.context,lr[t],e,Rr[t],this._showOverdrawInspector)),this.cache[r]},Qr.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},Qr.prototype.setBaseState=function(){var t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)};var nn=function(e,r,n){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===n||n,this._minZoom=e||0,this._maxZoom=r||22,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._posMatrixCache={},this._alignedPosMatrixCache={}},an={minZoom:{configurable:!0},maxZoom:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerPoint:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};nn.prototype.clone=function(){var t=new nn(this._minZoom,this._maxZoom,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._calcMatrices(),t},an.minZoom.get=function(){return this._minZoom},an.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},an.maxZoom.get=function(){return this._maxZoom},an.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},an.renderWorldCopies.get=function(){return this._renderWorldCopies},an.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},an.worldSize.get=function(){return this.tileSize*this.scale},an.centerPoint.get=function(){return this.size._div(2)},an.size.get=function(){return new t.Point(this.width,this.height)},an.bearing.get=function(){return-this.angle/Math.PI*180},an.bearing.set=function(e){var r=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},an.pitch.get=function(){return this._pitch/Math.PI*180},an.pitch.set=function(e){var r=t.clamp(e,0,60)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},an.fov.get=function(){return this._fov/Math.PI*180},an.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},an.zoom.get=function(){return this._zoom},an.zoom.set=function(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._constrain(),this._calcMatrices())},an.center.get=function(){return this._center},an.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},nn.prototype.coveringZoomLevel=function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},nn.prototype.getVisibleUnwrappedCoordinates=function(e){var r=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new t.Point(0,0)),a=this.pointCoordinate(new t.Point(this.width,0)),i=this.pointCoordinate(new t.Point(this.width,this.height)),o=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(n.x,a.x,i.x,o.x)),l=Math.floor(Math.max(n.x,a.x,i.x,o.x)),u=s-1;u<=l+1;u++)0!==u&&r.push(new t.UnwrappedTileID(u,e));return r},nn.prototype.coveringTiles=function(e){var r=this.coveringZoomLevel(e),n=r;if(void 0!==e.minzoom&&r<e.minzoom)return[];void 0!==e.maxzoom&&r>e.maxzoom&&(r=e.maxzoom);var a=t.MercatorCoordinate.fromLngLat(this.center),i=Math.pow(2,r),o=new t.Point(i*a.x-.5,i*a.y-.5);return function(e,r,n,a){void 0===a&&(a=!0);var i=1<<e,o={};function s(r,s,l){var u,c,h,d;if(l>=0&&l<=i)for(u=r;u<s;u++)c=Math.floor(u/i),h=(u%i+i)%i,0!==c&&!0!==a||(d=new t.OverscaledTileID(n,c,e,h,l),o[d.key]=d)}var l=r.map((function(e){return new t.Point(e.x,e.y)._mult(i)}));return rn(l[0],l[1],l[2],0,i,s),rn(l[2],l[3],l[0],0,i,s),Object.keys(o).map((function(t){return o[t]}))}(r,[this.pointCoordinate(new t.Point(0,0)),this.pointCoordinate(new t.Point(this.width,0)),this.pointCoordinate(new t.Point(this.width,this.height)),this.pointCoordinate(new t.Point(0,this.height))],e.reparseOverscaled?n:r,this._renderWorldCopies).sort((function(t,e){return o.dist(t.canonical)-o.dist(e.canonical)}))},nn.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},an.unmodified.get=function(){return this._unmodified},nn.prototype.zoomScale=function(t){return Math.pow(2,t)},nn.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},nn.prototype.project=function(e){var r=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(e.lng)*this.worldSize,t.mercatorYfromLat(r)*this.worldSize)},nn.prototype.unproject=function(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize).toLngLat()},an.point.get=function(){return this.project(this.center)},nn.prototype.setLocationAtPoint=function(e,r){var n=this.pointCoordinate(r),a=this.pointCoordinate(this.centerPoint),i=this.locationCoordinate(e),o=new t.MercatorCoordinate(i.x-(n.x-a.x),i.y-(n.y-a.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())},nn.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},nn.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},nn.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},nn.prototype.coordinateLocation=function(t){return t.toLngLat()},nn.prototype.pointCoordinate=function(e){var r=[e.x,e.y,0,1],n=[e.x,e.y,1,1];t.transformMat4(r,r,this.pixelMatrixInverse),t.transformMat4(n,n,this.pixelMatrixInverse);var a=r[3],i=n[3],o=r[0]/a,s=n[0]/i,l=r[1]/a,u=n[1]/i,c=r[2]/a,h=n[2]/i,d=c===h?0:(0-c)/(h-c);return new t.MercatorCoordinate(t.number(o,s,d)/this.worldSize,t.number(l,u,d)/this.worldSize)},nn.prototype.coordinatePoint=function(e){var r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix),new t.Point(r[0]/r[3],r[1]/r[3])},nn.prototype.getBounds=function(){return(new t.LngLatBounds).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},nn.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},nn.prototype.setMaxBounds=function(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},nn.prototype.calculatePosMatrix=function(e,r){void 0===r&&(r=!1);var n=e.key,a=r?this._alignedPosMatrixCache:this._posMatrixCache;if(a[n])return a[n];var i=e.canonical,o=this.worldSize/this.zoomScale(i.z),s=i.x+Math.pow(2,i.z)*e.wrap,l=t.identity(new Float64Array(16));return t.translate(l,l,[s*o,i.y*o,0]),t.scale(l,l,[o/t.EXTENT,o/t.EXTENT,1]),t.multiply(l,r?this.alignedProjMatrix:this.projMatrix,l),a[n]=new Float32Array(l),a[n]},nn.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},nn.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,r,n,a,i=-90,o=90,s=-180,l=180,u=this.size,c=this._unmodified;if(this.latRange){var h=this.latRange;i=t.mercatorYfromLat(h[1])*this.worldSize,e=(o=t.mercatorYfromLat(h[0])*this.worldSize)-i<u.y?u.y/(o-i):0}if(this.lngRange){var d=this.lngRange;s=t.mercatorXfromLng(d[0])*this.worldSize,r=(l=t.mercatorXfromLng(d[1])*this.worldSize)-s<u.x?u.x/(l-s):0}var f=this.point,p=Math.max(r||0,e||0);if(p)return this.center=this.unproject(new t.Point(r?(l+s)/2:f.x,e?(o+i)/2:f.y)),this.zoom+=this.scaleZoom(p),this._unmodified=c,void(this._constraining=!1);if(this.latRange){var m=f.y,g=u.y/2;m-g<i&&(a=i+g),m+g>o&&(a=o-g)}if(this.lngRange){var y=f.x,v=u.x/2;y-v<s&&(n=s+v),y+v>l&&(n=l-v)}void 0===n&&void 0===a||(this.center=this.unproject(new t.Point(void 0!==n?n:f.x,void 0!==a?a:f.y))),this._unmodified=c,this._constraining=!1}},nn.prototype._calcMatrices=function(){if(this.height){this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var e=this._fov/2,r=Math.PI/2+this._pitch,n=Math.sin(e)*this.cameraToCenterDistance/Math.sin(Math.PI-r-e),a=this.point,i=a.x,o=a.y,s=1.01*(Math.cos(Math.PI/2-this._pitch)*n+this.cameraToCenterDistance),l=new Float64Array(16);t.perspective(l,this._fov,this.width/this.height,1,s),t.scale(l,l,[1,-1,1]),t.translate(l,l,[0,0,-this.cameraToCenterDistance]),t.rotateX(l,l,this._pitch),t.rotateZ(l,l,this.angle),t.translate(l,l,[-i,-o,0]),this.mercatorMatrix=t.scale([],l,[this.worldSize,this.worldSize,this.worldSize]),t.scale(l,l,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=l;var u=this.width%2/2,c=this.height%2/2,h=Math.cos(this.angle),d=Math.sin(this.angle),f=i-Math.round(i)+h*u+d*c,p=o-Math.round(o)+h*c+d*u,m=new Float64Array(l);if(t.translate(m,m,[f>.5?f-1:f,p>.5?p-1:p,0]),this.alignedProjMatrix=m,l=t.create(),t.scale(l,l,[this.width/2,-this.height/2,1]),t.translate(l,l,[1,-1,0]),this.labelPlaneMatrix=l,l=t.create(),t.scale(l,l,[1,-1,1]),t.translate(l,l,[-1,-1,0]),t.scale(l,l,[2/this.width,2/this.height,1]),this.glCoordMatrix=l,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(l=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=l,this._posMatrixCache={},this._alignedPosMatrixCache={}}},nn.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},nn.prototype.getCameraPoint=function(){var e=this._pitch,r=Math.tan(e)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,r))},nn.prototype.getCameraQueryGeometry=function(e){var r=this.getCameraPoint();if(1===e.length)return[e[0],r];for(var n=r.x,a=r.y,i=r.x,o=r.y,s=0,l=e;s<l.length;s+=1){var u=l[s];n=Math.min(n,u.x),a=Math.min(a,u.y),i=Math.max(i,u.x),o=Math.max(o,u.y)}return[new t.Point(n,a),new t.Point(i,a),new t.Point(i,o),new t.Point(n,o),new t.Point(n,a)]},Object.defineProperties(nn.prototype,an);var on=function(){var e,r,n,a;t.bindAll(["_onHashChange","_updateHash"],this),this._updateHash=(e=this._updateHashUnthrottled.bind(this),r=!1,n=null,a=function(){n=null,r&&(e(),n=setTimeout(a,300),r=!1)},function(){return r=!0,n||a(),n})};on.prototype.addTo=function(e){return this._map=e,t.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},on.prototype.remove=function(){return t.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},on.prototype.getHashString=function(t){var e=this._map.getCenter(),r=Math.round(100*this._map.getZoom())/100,n=Math.ceil((r*Math.LN2+Math.log(512/360/.5))/Math.LN10),a=Math.pow(10,n),i=Math.round(e.lng*a)/a,o=Math.round(e.lat*a)/a,s=this._map.getBearing(),l=this._map.getPitch(),u="";return u+=t?"#/"+i+"/"+o+"/"+r:"#"+r+"/"+o+"/"+i,(s||l)&&(u+="/"+Math.round(10*s)/10),l&&(u+="/"+Math.round(l)),u},on.prototype._onHashChange=function(){var e=t.window.location.hash.replace("#","").split("/");return e.length>=3&&(this._map.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:+(e[3]||0),pitch:+(e[4]||0)}),!0)},on.prototype._updateHashUnthrottled=function(){var e=this.getHashString();try{t.window.history.replaceState(t.window.history.state,"",e)}catch(t){}};var sn=function(e){function n(n,a,i,o){void 0===o&&(o={});var s=r.mousePos(a.getCanvasContainer(),i),l=a.unproject(s);e.call(this,n,t.extend({point:s,lngLat:l,originalEvent:i},o)),this._defaultPrevented=!1,this.target=a}e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n;var a={defaultPrevented:{configurable:!0}};return n.prototype.preventDefault=function(){this._defaultPrevented=!0},a.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(n.prototype,a),n}(t.Event),ln=function(e){function n(n,a,i){var o=r.touchPos(a.getCanvasContainer(),i),s=o.map((function(t){return a.unproject(t)})),l=o.reduce((function(t,e,r,n){return t.add(e.div(n.length))}),new t.Point(0,0)),u=a.unproject(l);e.call(this,n,{points:o,point:l,lngLats:s,lngLat:u,originalEvent:i}),this._defaultPrevented=!1}e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n;var a={defaultPrevented:{configurable:!0}};return n.prototype.preventDefault=function(){this._defaultPrevented=!0},a.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(n.prototype,a),n}(t.Event),un=function(t){function e(e,r,n){t.call(this,e,{originalEvent:n}),this._defaultPrevented=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={defaultPrevented:{configurable:!0}};return e.prototype.preventDefault=function(){this._defaultPrevented=!0},r.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(e.prototype,r),e}(t.Event),cn=function(e){this._map=e,this._el=e.getCanvasContainer(),this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onWheel","_onTimeout","_onScrollFrame","_onScrollFinished"],this)};cn.prototype.setZoomRate=function(t){this._defaultZoomRate=t},cn.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},cn.prototype.isEnabled=function(){return!!this._enabled},cn.prototype.isActive=function(){return!!this._active},cn.prototype.isZooming=function(){return!!this._zooming},cn.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},cn.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},cn.prototype.onWheel=function(e){if(this.isEnabled()){var r=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,n=t.browser.now(),a=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==r&&r%4.000244140625==0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":a>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(a*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this.isActive()||this._start(e)),e.preventDefault()}},cn.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this.isActive()||this._start(t)},cn.prototype._start=function(e){if(this._delta){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0,this._map.fire(new t.Event("movestart",{originalEvent:e})),this._map.fire(new t.Event("zoomstart",{originalEvent:e}))),this._finishTimeout&&clearTimeout(this._finishTimeout);var n=r.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(n)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame))}},cn.prototype._onScrollFrame=function(){var e=this;if(this._frameId=null,this.isActive()){var r=this._map.transform;if(0!==this._delta){var n="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,a=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==a&&(a=1/a);var i="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(i*a))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var o="number"==typeof this._targetZoom?this._targetZoom:r.zoom,s=this._startZoom,l=this._easing,u=!1;if("wheel"===this._type&&s&&l){var c=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),h=l(c);r.zoom=t.number(s,o,h),c<1?this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame)):u=!0}else r.zoom=o,u=!0;r.setLocationAtPoint(this._around,this._aroundPoint),this._map.fire(new t.Event("move",{originalEvent:this._lastWheelEvent})),this._map.fire(new t.Event("zoom",{originalEvent:this._lastWheelEvent})),u&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._map.fire(new t.Event("zoomend",{originalEvent:e._lastWheelEvent})),e._map.fire(new t.Event("moveend",{originalEvent:e._lastWheelEvent})),delete e._targetZoom}),200))}},cn.prototype._smoothOutEasing=function(e){var r=t.ease;if(this._prevEase){var n=this._prevEase,a=(t.browser.now()-n.start)/n.duration,i=n.easing(a+.01)-n.easing(a),o=.27/Math.sqrt(i*i+1e-4)*.01,s=Math.sqrt(.0729-o*o);r=t.bezier(o,s,.25,1)}return this._prevEase={start:t.browser.now(),duration:e,easing:r},r};var hn=function(e,r){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=r.clickTolerance||1,t.bindAll(["_onMouseMove","_onMouseUp","_onKeyDown"],this)};hn.prototype.isEnabled=function(){return!!this._enabled},hn.prototype.isActive=function(){return!!this._active},hn.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},hn.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},hn.prototype.onMouseDown=function(e){this.isEnabled()&&e.shiftKey&&0===e.button&&(t.window.document.addEventListener("mousemove",this._onMouseMove,!1),t.window.document.addEventListener("keydown",this._onKeyDown,!1),t.window.document.addEventListener("mouseup",this._onMouseUp,!1),r.disableDrag(),this._startPos=this._lastPos=r.mousePos(this._el,e),this._active=!0)},hn.prototype._onMouseMove=function(t){var e=r.mousePos(this._el,t);if(!(this._lastPos.equals(e)||!this._box&&e.dist(this._startPos)<this._clickTolerance)){var n=this._startPos;this._lastPos=e,this._box||(this._box=r.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var a=Math.min(n.x,e.x),i=Math.max(n.x,e.x),o=Math.min(n.y,e.y),s=Math.max(n.y,e.y);r.setTransform(this._box,"translate("+a+"px,"+o+"px)"),this._box.style.width=i-a+"px",this._box.style.height=s-o+"px"}},hn.prototype._onMouseUp=function(e){if(0===e.button){var n=this._startPos,a=r.mousePos(this._el,e);this._finish(),r.suppressClick(),n.x===a.x&&n.y===a.y?this._fireEvent("boxzoomcancel",e):this._map.fitScreenCoordinates(n,a,this._map.getBearing(),{linear:!0}).fire(new t.Event("boxzoomend",{originalEvent:e}))}},hn.prototype._onKeyDown=function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},hn.prototype._finish=function(){this._active=!1,t.window.document.removeEventListener("mousemove",this._onMouseMove,!1),t.window.document.removeEventListener("keydown",this._onKeyDown,!1),t.window.document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(r.remove(this._box),this._box=null),r.enableDrag(),delete this._startPos,delete this._lastPos},hn.prototype._fireEvent=function(e,r){return this._map.fire(new t.Event(e,{originalEvent:r}))};var dn=t.bezier(0,0,.25,1),fn=function(e,r){this._map=e,this._el=r.element||e.getCanvasContainer(),this._state="disabled",this._button=r.button||"right",this._bearingSnap=r.bearingSnap||0,this._pitchWithRotate=!1!==r.pitchWithRotate,t.bindAll(["onMouseDown","_onMouseMove","_onMouseUp","_onBlur","_onDragFrame"],this)};fn.prototype.isEnabled=function(){return"disabled"!==this._state},fn.prototype.isActive=function(){return"active"===this._state},fn.prototype.enable=function(){this.isEnabled()||(this._state="enabled")},fn.prototype.disable=function(){if(this.isEnabled())switch(this._state){case"active":this._state="disabled",this._unbind(),this._deactivate(),this._fireEvent("rotateend"),this._pitchWithRotate&&this._fireEvent("pitchend"),this._fireEvent("moveend");break;case"pending":this._state="disabled",this._unbind();break;default:this._state="disabled"}},fn.prototype.onMouseDown=function(e){if("enabled"===this._state){if("right"===this._button){if(this._eventButton=r.mouseButton(e),this._eventButton!==(e.ctrlKey?0:2))return}else{if(e.ctrlKey||0!==r.mouseButton(e))return;this._eventButton=0}r.disableDrag(),t.window.document.addEventListener("mousemove",this._onMouseMove,{capture:!0}),t.window.document.addEventListener("mouseup",this._onMouseUp),t.window.addEventListener("blur",this._onBlur),this._state="pending",this._inertia=[[t.browser.now(),this._map.getBearing()]],this._startPos=this._lastPos=r.mousePos(this._el,e),this._center=this._map.transform.centerPoint,e.preventDefault()}},fn.prototype._onMouseMove=function(t){var e=r.mousePos(this._el,t);this._lastPos.equals(e)||(this._lastMoveEvent=t,this._lastPos=e,"pending"===this._state&&(this._state="active",this._fireEvent("rotatestart",t),this._fireEvent("movestart",t),this._pitchWithRotate&&this._fireEvent("pitchstart",t)),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onDragFrame)))},fn.prototype._onDragFrame=function(){this._frameId=null;var e=this._lastMoveEvent;if(e){var r=this._map.transform,n=this._startPos,a=this._lastPos,i=.8*(n.x-a.x),o=-.5*(n.y-a.y),s=r.bearing-i,l=r.pitch-o,u=this._inertia,c=u[u.length-1];this._drainInertiaBuffer(),u.push([t.browser.now(),this._map._normalizeBearing(s,c[1])]),r.bearing=s,this._pitchWithRotate&&(this._fireEvent("pitch",e),r.pitch=l),this._fireEvent("rotate",e),this._fireEvent("move",e),delete this._lastMoveEvent,this._startPos=this._lastPos}},fn.prototype._onMouseUp=function(t){if(r.mouseButton(t)===this._eventButton)switch(this._state){case"active":this._state="enabled",r.suppressClick(),this._unbind(),this._deactivate(),this._inertialRotate(t);break;case"pending":this._state="enabled",this._unbind()}},fn.prototype._onBlur=function(t){switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._fireEvent("rotateend",t),this._pitchWithRotate&&this._fireEvent("pitchend",t),this._fireEvent("moveend",t);break;case"pending":this._state="enabled",this._unbind()}},fn.prototype._unbind=function(){t.window.document.removeEventListener("mousemove",this._onMouseMove,{capture:!0}),t.window.document.removeEventListener("mouseup",this._onMouseUp),t.window.removeEventListener("blur",this._onBlur),r.enableDrag()},fn.prototype._deactivate=function(){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._lastMoveEvent,delete this._startPos,delete this._lastPos},fn.prototype._inertialRotate=function(t){var e=this;this._fireEvent("rotateend",t),this._drainInertiaBuffer();var r=this._map,n=r.getBearing(),a=this._inertia,i=function(){Math.abs(n)<e._bearingSnap?r.resetNorth({noMoveStart:!0},{originalEvent:t}):e._fireEvent("moveend",t),e._pitchWithRotate&&e._fireEvent("pitchend",t)};if(a.length<2)i();else{var o=a[0],s=a[a.length-1],l=a[a.length-2],u=r._normalizeBearing(n,l[1]),c=s[1]-o[1],h=c<0?-1:1,d=(s[0]-o[0])/1e3;if(0!==c&&0!==d){var f=Math.abs(c*(.25/d));f>180&&(f=180);var p=f/180;u+=h*f*(p/2),Math.abs(r._normalizeBearing(u,0))<this._bearingSnap&&(u=r._normalizeBearing(0,u)),r.rotateTo(u,{duration:1e3*p,easing:dn,noMoveStart:!0},{originalEvent:t})}else i()}},fn.prototype._fireEvent=function(e,r){return this._map.fire(new t.Event(e,r?{originalEvent:r}:{}))},fn.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,r=t.browser.now();e.length>0&&r-e[0][0]>160;)e.shift()};var pn=t.bezier(0,0,.3,1),mn=function(e,r){this._map=e,this._el=e.getCanvasContainer(),this._state="disabled",this._clickTolerance=r.clickTolerance||1,t.bindAll(["_onMove","_onMouseUp","_onTouchEnd","_onBlur","_onDragFrame"],this)};mn.prototype.isEnabled=function(){return"disabled"!==this._state},mn.prototype.isActive=function(){return"active"===this._state},mn.prototype.enable=function(){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-drag-pan"),this._state="enabled")},mn.prototype.disable=function(){if(this.isEnabled())switch(this._el.classList.remove("mapboxgl-touch-drag-pan"),this._state){case"active":this._state="disabled",this._unbind(),this._deactivate(),this._fireEvent("dragend"),this._fireEvent("moveend");break;case"pending":this._state="disabled",this._unbind();break;default:this._state="disabled"}},mn.prototype.onMouseDown=function(e){"enabled"===this._state&&(e.ctrlKey||0!==r.mouseButton(e)||(r.addEventListener(t.window.document,"mousemove",this._onMove,{capture:!0}),r.addEventListener(t.window.document,"mouseup",this._onMouseUp),this._start(e)))},mn.prototype.onTouchStart=function(e){"enabled"===this._state&&(e.touches.length>1||(r.addEventListener(t.window.document,"touchmove",this._onMove,{capture:!0,passive:!1}),r.addEventListener(t.window.document,"touchend",this._onTouchEnd),this._start(e)))},mn.prototype._start=function(e){t.window.addEventListener("blur",this._onBlur),this._state="pending",this._startPos=this._mouseDownPos=this._lastPos=r.mousePos(this._el,e),this._inertia=[[t.browser.now(),this._startPos]]},mn.prototype._onMove=function(e){e.preventDefault();var n=r.mousePos(this._el,e);this._lastPos.equals(n)||"pending"===this._state&&n.dist(this._mouseDownPos)<this._clickTolerance||(this._lastMoveEvent=e,this._lastPos=n,this._drainInertiaBuffer(),this._inertia.push([t.browser.now(),this._lastPos]),"pending"===this._state&&(this._state="active",this._fireEvent("dragstart",e),this._fireEvent("movestart",e)),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onDragFrame)))},mn.prototype._onDragFrame=function(){this._frameId=null;var t=this._lastMoveEvent;if(t){var e=this._map.transform;e.setLocationAtPoint(e.pointLocation(this._startPos),this._lastPos),this._fireEvent("drag",t),this._fireEvent("move",t),this._startPos=this._lastPos,delete this._lastMoveEvent}},mn.prototype._onMouseUp=function(t){if(0===r.mouseButton(t))switch(this._state){case"active":this._state="enabled",r.suppressClick(),this._unbind(),this._deactivate(),this._inertialPan(t);break;case"pending":this._state="enabled",this._unbind()}},mn.prototype._onTouchEnd=function(t){switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._inertialPan(t);break;case"pending":this._state="enabled",this._unbind()}},mn.prototype._onBlur=function(t){switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._fireEvent("dragend",t),this._fireEvent("moveend",t);break;case"pending":this._state="enabled",this._unbind()}},mn.prototype._unbind=function(){r.removeEventListener(t.window.document,"touchmove",this._onMove,{capture:!0,passive:!1}),r.removeEventListener(t.window.document,"touchend",this._onTouchEnd),r.removeEventListener(t.window.document,"mousemove",this._onMove,{capture:!0}),r.removeEventListener(t.window.document,"mouseup",this._onMouseUp),r.removeEventListener(t.window,"blur",this._onBlur)},mn.prototype._deactivate=function(){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._lastMoveEvent,delete this._startPos,delete this._mouseDownPos,delete this._lastPos},mn.prototype._inertialPan=function(t){this._fireEvent("dragend",t),this._drainInertiaBuffer();var e=this._inertia;if(e.length<2)this._fireEvent("moveend",t);else{var r=e[e.length-1],n=e[0],a=r[1].sub(n[1]),i=(r[0]-n[0])/1e3;if(0===i||r[1].equals(n[1]))this._fireEvent("moveend",t);else{var o=a.mult(.3/i),s=o.mag();s>1400&&(s=1400,o._unit()._mult(s));var l=s/750,u=o.mult(-l/2);this._map.panBy(u,{duration:1e3*l,easing:pn,noMoveStart:!0},{originalEvent:t})}}},mn.prototype._fireEvent=function(e,r){return this._map.fire(new t.Event(e,r?{originalEvent:r}:{}))},mn.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,r=t.browser.now();e.length>0&&r-e[0][0]>160;)e.shift()};var gn=function(e){this._map=e,this._el=e.getCanvasContainer(),t.bindAll(["_onKeyDown"],this)};function yn(t){return t*(2-t)}gn.prototype.isEnabled=function(){return!!this._enabled},gn.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},gn.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},gn.prototype._onKeyDown=function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=0,r=0,n=0,a=0,i=0;switch(t.keyCode){case 61:case 107:case 171:case 187:e=1;break;case 189:case 109:case 173:e=-1;break;case 37:t.shiftKey?r=-1:(t.preventDefault(),a=-1);break;case 39:t.shiftKey?r=1:(t.preventDefault(),a=1);break;case 38:t.shiftKey?n=1:(t.preventDefault(),i=-1);break;case 40:t.shiftKey?n=-1:(i=1,t.preventDefault());break;default:return}var o=this._map,s=o.getZoom(),l={duration:300,delayEndEvents:500,easing:yn,zoom:e?Math.round(s)+e*(t.shiftKey?2:1):s,bearing:o.getBearing()+15*r,pitch:o.getPitch()+10*n,offset:[100*-a,100*-i],center:o.getCenter()};o.easeTo(l,{originalEvent:t})}};var vn=function(e){this._map=e,t.bindAll(["_onDblClick","_onZoomEnd"],this)};vn.prototype.isEnabled=function(){return!!this._enabled},vn.prototype.isActive=function(){return!!this._active},vn.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},vn.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},vn.prototype.onTouchStart=function(t){var e=this;if(this.isEnabled()&&!(t.points.length>1))if(this._tapped){var r=t.points[0],n=this._tappedPoint;if(n&&n.dist(r)<=30){t.originalEvent.preventDefault();var a=function(){e._tapped&&e._zoom(t),e._map.off("touchcancel",i),e._resetTapped()},i=function(){e._map.off("touchend",a),e._resetTapped()};this._map.once("touchend",a),this._map.once("touchcancel",i)}else this._resetTapped()}else this._tappedPoint=t.points[0],this._tapped=setTimeout((function(){e._tapped=null,e._tappedPoint=null}),300)},vn.prototype._resetTapped=function(){clearTimeout(this._tapped),this._tapped=null,this._tappedPoint=null},vn.prototype.onDblClick=function(t){this.isEnabled()&&(t.originalEvent.preventDefault(),this._zoom(t))},vn.prototype._zoom=function(t){this._active=!0,this._map.on("zoomend",this._onZoomEnd),this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t)},vn.prototype._onZoomEnd=function(){this._active=!1,this._map.off("zoomend",this._onZoomEnd)};var _n=t.bezier(0,0,.15,1),xn=function(e){this._map=e,this._el=e.getCanvasContainer(),t.bindAll(["_onMove","_onEnd","_onTouchFrame"],this)};xn.prototype.isEnabled=function(){return!!this._enabled},xn.prototype.enable=function(t){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-zoom-rotate"),this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around)},xn.prototype.disable=function(){this.isEnabled()&&(this._el.classList.remove("mapboxgl-touch-zoom-rotate"),this._enabled=!1)},xn.prototype.disableRotation=function(){this._rotationDisabled=!0},xn.prototype.enableRotation=function(){this._rotationDisabled=!1},xn.prototype.onStart=function(e){if(this.isEnabled()&&2===e.touches.length){var n=r.mousePos(this._el,e.touches[0]),a=r.mousePos(this._el,e.touches[1]),i=n.add(a).div(2);this._startVec=n.sub(a),this._startAround=this._map.transform.pointLocation(i),this._gestureIntent=void 0,this._inertia=[],r.addEventListener(t.window.document,"touchmove",this._onMove,{passive:!1}),r.addEventListener(t.window.document,"touchend",this._onEnd)}},xn.prototype._getTouchEventData=function(t){var e=r.mousePos(this._el,t.touches[0]),n=r.mousePos(this._el,t.touches[1]),a=e.sub(n);return{vec:a,center:e.add(n).div(2),scale:a.mag()/this._startVec.mag(),bearing:this._rotationDisabled?0:180*a.angleWith(this._startVec)/Math.PI}},xn.prototype._onMove=function(e){if(2===e.touches.length){var r=this._getTouchEventData(e),n=r.vec,a=r.scale,i=r.bearing;if(!this._gestureIntent){var o=this._rotationDisabled&&1!==a||Math.abs(1-a)>.15;Math.abs(i)>10?this._gestureIntent="rotate":o&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._map.fire(new t.Event(this._gestureIntent+"start",{originalEvent:e})),this._map.fire(new t.Event("movestart",{originalEvent:e})),this._startVec=n)}this._lastTouchEvent=e,this._frameId||(this._frameId=this._map._requestRenderFrame(this._onTouchFrame)),e.preventDefault()}},xn.prototype._onTouchFrame=function(){this._frameId=null;var e=this._gestureIntent;if(e){var r=this._map.transform;this._startScale||(this._startScale=r.scale,this._startBearing=r.bearing);var n=this._getTouchEventData(this._lastTouchEvent),a=n.center,i=n.bearing,o=n.scale,s=r.pointLocation(a),l=r.locationPoint(s);"rotate"===e&&(r.bearing=this._startBearing+i),r.zoom=r.scaleZoom(this._startScale*o),r.setLocationAtPoint(this._startAround,l),this._map.fire(new t.Event(e,{originalEvent:this._lastTouchEvent})),this._map.fire(new t.Event("move",{originalEvent:this._lastTouchEvent})),this._drainInertiaBuffer(),this._inertia.push([t.browser.now(),o,a])}},xn.prototype._onEnd=function(e){r.removeEventListener(t.window.document,"touchmove",this._onMove,{passive:!1}),r.removeEventListener(t.window.document,"touchend",this._onEnd);var n=this._gestureIntent,a=this._startScale;if(this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._gestureIntent,delete this._startScale,delete this._startBearing,delete this._lastTouchEvent,n){this._map.fire(new t.Event(n+"end",{originalEvent:e})),this._drainInertiaBuffer();var i=this._inertia,o=this._map;if(i.length<2)o.snapToNorth({},{originalEvent:e});else{var s=i[i.length-1],l=i[0],u=o.transform.scaleZoom(a*s[1]),c=o.transform.scaleZoom(a*l[1]),h=u-c,d=(s[0]-l[0])/1e3,f=s[2];if(0!==d&&u!==c){var p=.15*h/d;Math.abs(p)>2.5&&(p=p>0?2.5:-2.5);var m=1e3*Math.abs(p/(12*.15)),g=u+p*m/2e3;g<0&&(g=0),o.easeTo({zoom:g,duration:m,easing:_n,around:this._aroundCenter?o.getCenter():o.unproject(f),noMoveStart:!0},{originalEvent:e})}else o.snapToNorth({},{originalEvent:e})}}},xn.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,r=t.browser.now();e.length>2&&r-e[0][0]>160;)e.shift()};var bn={scrollZoom:cn,boxZoom:hn,dragRotate:fn,dragPan:mn,keyboard:gn,doubleClickZoom:vn,touchZoomRotate:xn},wn=function(e){function r(r,n){e.call(this),this._moving=!1,this._zooming=!1,this.transform=r,this._bearingSnap=n.bearingSnap,t.bindAll(["_renderFrameCallback"],this)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.getCenter=function(){return new t.LngLat(this.transform.center.lng,this.transform.center.lat)},r.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e)},r.prototype.panBy=function(e,r,n){return e=t.Point.convert(e).mult(-1),this.panTo(this.transform.center,t.extend({offset:e},r),n)},r.prototype.panTo=function(e,r,n){return this.easeTo(t.extend({center:e},r),n)},r.prototype.getZoom=function(){return this.transform.zoom},r.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},r.prototype.zoomTo=function(e,r,n){return this.easeTo(t.extend({zoom:e},r),n)},r.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},r.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},r.prototype.getBearing=function(){return this.transform.bearing},r.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},r.prototype.rotateTo=function(e,r,n){return this.easeTo(t.extend({bearing:e},r),n)},r.prototype.resetNorth=function(e,r){return this.rotateTo(0,t.extend({duration:1e3},e),r),this},r.prototype.snapToNorth=function(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this},r.prototype.getPitch=function(){return this.transform.pitch},r.prototype.setPitch=function(t,e){return this.jumpTo({pitch:t},e),this},r.prototype.cameraForBounds=function(e,r){return e=t.LngLatBounds.convert(e),this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),0,r)},r.prototype._cameraForBoxAndBearing=function(e,r,n,a){if("number"==typeof(a=t.extend({padding:{top:0,bottom:0,right:0,left:0},offset:[0,0],maxZoom:this.transform.maxZoom},a)).padding){var i=a.padding;a.padding={top:i,bottom:i,right:i,left:i}}if(t.deepEqual(Object.keys(a.padding).sort((function(t,e){return t<e?-1:t>e?1:0})),["bottom","left","right","top"])){var o=this.transform,s=o.project(t.LngLat.convert(e)),l=o.project(t.LngLat.convert(r)),u=s.rotate(-n*Math.PI/180),c=l.rotate(-n*Math.PI/180),h=new t.Point(Math.max(u.x,c.x),Math.max(u.y,c.y)),d=new t.Point(Math.min(u.x,c.x),Math.min(u.y,c.y)),f=h.sub(d),p=(o.width-a.padding.left-a.padding.right)/f.x,m=(o.height-a.padding.top-a.padding.bottom)/f.y;if(!(m<0||p<0)){var g=Math.min(o.scaleZoom(o.scale*Math.min(p,m)),a.maxZoom),y=t.Point.convert(a.offset),v=(a.padding.left-a.padding.right)/2,_=(a.padding.top-a.padding.bottom)/2,x=new t.Point(y.x+v,y.y+_).mult(o.scale/o.zoomScale(g));return{center:o.unproject(s.add(l).div(2).sub(x)),zoom:g,bearing:n}}t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}else t.warnOnce("options.padding must be a positive number, or an Object with keys 'bottom', 'left', 'right', 'top'")},r.prototype.fitBounds=function(t,e,r){return this._fitInternal(this.cameraForBounds(t,e),e,r)},r.prototype.fitScreenCoordinates=function(e,r,n,a,i){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.Point.convert(e)),this.transform.pointLocation(t.Point.convert(r)),n,a),a,i)},r.prototype._fitInternal=function(e,r,n){return e?(r=t.extend(e,r)).linear?this.easeTo(r,n):this.flyTo(r,n):this},r.prototype.jumpTo=function(e,r){this.stop();var n=this.transform,a=!1,i=!1,o=!1;return"zoom"in e&&n.zoom!==+e.zoom&&(a=!0,n.zoom=+e.zoom),void 0!==e.center&&(n.center=t.LngLat.convert(e.center)),"bearing"in e&&n.bearing!==+e.bearing&&(i=!0,n.bearing=+e.bearing),"pitch"in e&&n.pitch!==+e.pitch&&(o=!0,n.pitch=+e.pitch),this.fire(new t.Event("movestart",r)).fire(new t.Event("move",r)),a&&this.fire(new t.Event("zoomstart",r)).fire(new t.Event("zoom",r)).fire(new t.Event("zoomend",r)),i&&this.fire(new t.Event("rotatestart",r)).fire(new t.Event("rotate",r)).fire(new t.Event("rotateend",r)),o&&this.fire(new t.Event("pitchstart",r)).fire(new t.Event("pitch",r)).fire(new t.Event("pitchend",r)),this.fire(new t.Event("moveend",r))},r.prototype.easeTo=function(e,r){var n=this;this.stop(),!1===(e=t.extend({offset:[0,0],duration:500,easing:t.ease},e)).animate&&(e.duration=0);var a=this.transform,i=this.getZoom(),o=this.getBearing(),s=this.getPitch(),l="zoom"in e?+e.zoom:i,u="bearing"in e?this._normalizeBearing(e.bearing,o):o,c="pitch"in e?+e.pitch:s,h=a.centerPoint.add(t.Point.convert(e.offset)),d=a.pointLocation(h),f=t.LngLat.convert(e.center||d);this._normalizeCenter(f);var p,m,g=a.project(d),y=a.project(f).sub(g),v=a.zoomScale(l-i);return e.around&&(p=t.LngLat.convert(e.around),m=a.locationPoint(p)),this._zooming=l!==i,this._rotating=o!==u,this._pitching=c!==s,this._prepareEase(r,e.noMoveStart),clearTimeout(this._easeEndTimeoutID),this._ease((function(e){if(n._zooming&&(a.zoom=t.number(i,l,e)),n._rotating&&(a.bearing=t.number(o,u,e)),n._pitching&&(a.pitch=t.number(s,c,e)),p)a.setLocationAtPoint(p,m);else{var d=a.zoomScale(a.zoom-i),f=l>i?Math.min(2,v):Math.max(.5,v),_=Math.pow(f,1-e),x=a.unproject(g.add(y.mult(e*_)).mult(d));a.setLocationAtPoint(a.renderWorldCopies?x.wrap():x,h)}n._fireMoveEvents(r)}),(function(){e.delayEndEvents?n._easeEndTimeoutID=setTimeout((function(){return n._afterEase(r)}),e.delayEndEvents):n._afterEase(r)}),e),this},r.prototype._prepareEase=function(e,r){this._moving=!0,r||this.fire(new t.Event("movestart",e)),this._zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&this.fire(new t.Event("pitchstart",e))},r.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))},r.prototype._afterEase=function(e){var r=this._zooming,n=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,r&&this.fire(new t.Event("zoomend",e)),n&&this.fire(new t.Event("rotateend",e)),a&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))},r.prototype.flyTo=function(e,r){var n=this;this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var a=this.transform,i=this.getZoom(),o=this.getBearing(),s=this.getPitch(),l="zoom"in e?t.clamp(+e.zoom,a.minZoom,a.maxZoom):i,u="bearing"in e?this._normalizeBearing(e.bearing,o):o,c="pitch"in e?+e.pitch:s,h=a.zoomScale(l-i),d=a.centerPoint.add(t.Point.convert(e.offset)),f=a.pointLocation(d),p=t.LngLat.convert(e.center||f);this._normalizeCenter(p);var m=a.project(f),g=a.project(p).sub(m),y=e.curve,v=Math.max(a.width,a.height),_=v/h,x=g.mag();if("minZoom"in e){var b=t.clamp(Math.min(e.minZoom,i,l),a.minZoom,a.maxZoom),w=v/a.zoomScale(b-i);y=Math.sqrt(w/x*2)}var M=y*y;function k(t){var e=(_*_-v*v+(t?-1:1)*M*M*x*x)/(2*(t?_:v)*M*x);return Math.log(Math.sqrt(e*e+1)-e)}function T(t){return(Math.exp(t)-Math.exp(-t))/2}function L(t){return(Math.exp(t)+Math.exp(-t))/2}var A=k(0),S=function(t){return L(A)/L(A+y*t)},E=function(t){return v*((L(A)*(T(e=A+y*t)/L(e))-T(A))/M)/x;var e},C=(k(1)-A)/y;if(Math.abs(x)<1e-6||!isFinite(C)){if(Math.abs(v-_)<1e-6)return this.easeTo(e,r);var D=_<v?-1:1;C=Math.abs(Math.log(_/v))/y,E=function(){return 0},S=function(t){return Math.exp(D*y*t)}}if("duration"in e)e.duration=+e.duration;else{var P="screenSpeed"in e?+e.screenSpeed/y:+e.speed;e.duration=1e3*C/P}return e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=o!==u,this._pitching=c!==s,this._prepareEase(r,!1),this._ease((function(e){var h=e*C,f=1/S(h);a.zoom=1===e?l:i+a.scaleZoom(f),n._rotating&&(a.bearing=t.number(o,u,e)),n._pitching&&(a.pitch=t.number(s,c,e));var y=1===e?p:a.unproject(m.add(g.mult(E(h))).mult(f));a.setLocationAtPoint(a.renderWorldCopies?y.wrap():y,d),n._fireMoveEvents(r)}),(function(){return n._afterEase(r)}),e),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var t=this._onEaseEnd;delete this._onEaseEnd,t.call(this)}return this},r.prototype._ease=function(e,r,n){!1===n.animate||0===n.duration?(e(1),r()):(this._easeStart=t.browser.now(),this._easeOptions=n,this._onEaseFrame=e,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},r.prototype._normalizeBearing=function(e,r){e=t.wrap(e,-180,180);var n=Math.abs(e-r);return Math.abs(e-360-r)<n&&(e-=360),Math.abs(e+360-r)<n&&(e+=360),e},r.prototype._normalizeCenter=function(t){var e=this.transform;if(e.renderWorldCopies&&!e.lngRange){var r=t.lng-e.center.lng;t.lng+=r>180?-360:r<-180?360:0}},r}(t.Evented),Mn=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_updateEditLink","_updateData","_updateCompact"],this)};Mn.prototype.getDefaultPosition=function(){return"bottom-right"},Mn.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},Mn.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0},Mn.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:t.config.ACCESS_TOKEN}];if(e){var n=r.reduce((function(t,e,n){return e.value&&(t+=e.key+"="+e.value+(n<r.length-1?"&":"")),t}),"?");e.href=t.config.FEEDBACK_URL+"/"+n+(this._map._hash?this._map._hash.getHashString(!0):""),e.rel="noopener nofollow"}},Mn.prototype._updateData=function(t){!t||"metadata"!==t.sourceDataType&&"style"!==t.dataType||(this._updateAttributions(),this._updateEditLink())},Mn.prototype._updateAttributions=function(){if(this._map.style){var t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map((function(t){return"string"!=typeof t?"":t}))):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){var e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}var r=this._map.style.sourceCaches;for(var n in r){var a=r[n];if(a.used){var i=a.getSource();i.attribution&&t.indexOf(i.attribution)<0&&t.push(i.attribution)}}t.sort((function(t,e){return t.length-e.length}));var o=(t=t.filter((function(e,r){for(var n=r+1;n<t.length;n++)if(t[n].indexOf(e)>=0)return!1;return!0}))).join(" | ");o!==this._attribHTML&&(this._attribHTML=o,t.length?(this._innerContainer.innerHTML=o,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},Mn.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")};var kn=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};kn.prototype.onAdd=function(t){this._map=t,this._container=r.create("div","mapboxgl-ctrl");var e=r.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label","Mapbox logo"),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},kn.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},kn.prototype.getDefaultPosition=function(){return"bottom-left"},kn.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},kn.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t)if(t[e].getSource().mapbox_logo)return!0;return!1}},kn.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}};var Tn=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Tn.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},Tn.prototype.remove=function(t){for(var e=this._currentlyRunning,r=0,n=e?this._queue.concat(e):this._queue;r<n.length;r+=1){var a=n[r];if(a.id===t)return void(a.cancelled=!0)}},Tn.prototype.run=function(){var t=this._currentlyRunning=this._queue;this._queue=[];for(var e=0,r=t;e<r.length;e+=1){var n=r[e];if(!n.cancelled&&(n.callback(),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},Tn.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var Ln=t.window.HTMLImageElement,An=t.window.HTMLElement,Sn={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:0,maxZoom:22,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,bearingSnap:7,clickTolerance:3,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,fadeDuration:300,crossSourceCollisions:!0},En=function(n){function a(e){var a=this;if(null!=(e=t.extend({},Sn,e)).minZoom&&null!=e.maxZoom&&e.minZoom>e.maxZoom)throw new Error("maxZoom must be greater than minZoom");var i=new nn(e.minZoom,e.maxZoom,e.renderWorldCopies);if(n.call(this,i,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new Tn,this._controls=[],this._mapId=t.uniqueId(),this._requestManager=new t.RequestManager(e.transformRequest),"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof An))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return a._update(!1)})),this.on("moveend",(function(){return a._update(!1)})),this.on("zoom",(function(){return a._update(!0)})),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1)),function(t,e){var n=t.getCanvasContainer(),a=null,i=!1,o=null;for(var s in bn)t[s]=new bn[s](t,e),e.interactive&&e[s]&&t[s].enable(e[s]);r.addEventListener(n,"mouseout",(function(e){t.fire(new sn("mouseout",t,e))})),r.addEventListener(n,"mousedown",(function(a){i=!0,o=r.mousePos(n,a);var s=new sn("mousedown",t,a);t.fire(s),s.defaultPrevented||(e.interactive&&!t.doubleClickZoom.isActive()&&t.stop(),t.boxZoom.onMouseDown(a),t.boxZoom.isActive()||t.dragPan.isActive()||t.dragRotate.onMouseDown(a),t.boxZoom.isActive()||t.dragRotate.isActive()||t.dragPan.onMouseDown(a))})),r.addEventListener(n,"mouseup",(function(e){var r=t.dragRotate.isActive();a&&!r&&t.fire(new sn("contextmenu",t,a)),a=null,i=!1,t.fire(new sn("mouseup",t,e))})),r.addEventListener(n,"mousemove",(function(e){if(!t.dragPan.isActive()&&!t.dragRotate.isActive()){for(var r=e.target;r&&r!==n;)r=r.parentNode;r===n&&t.fire(new sn("mousemove",t,e))}})),r.addEventListener(n,"mouseover",(function(e){for(var r=e.target;r&&r!==n;)r=r.parentNode;r===n&&t.fire(new sn("mouseover",t,e))})),r.addEventListener(n,"touchstart",(function(r){var n=new ln("touchstart",t,r);t.fire(n),n.defaultPrevented||(e.interactive&&t.stop(),t.boxZoom.isActive()||t.dragRotate.isActive()||t.dragPan.onTouchStart(r),t.touchZoomRotate.onStart(r),t.doubleClickZoom.onTouchStart(n))}),{passive:!1}),r.addEventListener(n,"touchmove",(function(e){t.fire(new ln("touchmove",t,e))}),{passive:!1}),r.addEventListener(n,"touchend",(function(e){t.fire(new ln("touchend",t,e))})),r.addEventListener(n,"touchcancel",(function(e){t.fire(new ln("touchcancel",t,e))})),r.addEventListener(n,"click",(function(a){var i=r.mousePos(n,a);(i.equals(o)||i.dist(o)<e.clickTolerance)&&t.fire(new sn("click",t,a))})),r.addEventListener(n,"dblclick",(function(e){var r=new sn("dblclick",t,e);t.fire(r),r.defaultPrevented||t.doubleClickZoom.onDblClick(r)})),r.addEventListener(n,"contextmenu",(function(e){var r=t.dragRotate.isActive();i||r?i&&(a=e):t.fire(new sn("contextmenu",t,e)),(t.dragRotate.isEnabled()||t.listens("contextmenu"))&&e.preventDefault()})),r.addEventListener(n,"wheel",(function(r){e.interactive&&t.stop();var n=new un("wheel",t,r);t.fire(n),n.defaultPrevented||t.scrollZoom.onWheel(r)}),{passive:!1})}(this,e),this._hash=e.hash&&(new on).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new Mn({customAttribution:e.customAttribution})),this.addControl(new kn,e.logoPosition),this.on("style.load",(function(){a.transform.unmodified&&a.jumpTo(a.style.stylesheet)})),this.on("data",(function(e){a._update("style"===e.dataType),a.fire(new t.Event(e.dataType+"data",e))})),this.on("dataloading",(function(e){a.fire(new t.Event(e.dataType+"dataloading",e))}))}n&&(a.__proto__=n),a.prototype=Object.create(n&&n.prototype),a.prototype.constructor=a;var i={showTileBoundaries:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0}};return a.prototype._getMapId=function(){return this._mapId},a.prototype.addControl=function(e,r){if(void 0===r&&e.getDefaultPosition&&(r=e.getDefaultPosition()),void 0===r&&(r="top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var n=e.onAdd(this);this._controls.push(e);var a=this._controlPositions[r];return-1!==r.indexOf("bottom")?a.insertBefore(n,a.firstChild):a.appendChild(n),this},a.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var r=this._controls.indexOf(e);return r>-1&&this._controls.splice(r,1),e.onRemove(this),this},a.prototype.resize=function(e){var r=this._containerDimensions(),n=r[0],a=r[1];return this._resizeCanvas(n,a),this.transform.resize(n,a),this.painter.resize(n,a),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e)).fire(new t.Event("resize",e)).fire(new t.Event("moveend",e)),this},a.prototype.getBounds=function(){return this.transform.getBounds()},a.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},a.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},a.prototype.setMinZoom=function(t){if((t=null==t?0:t)>=0&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t&&this.setZoom(t),this;throw new Error("minZoom must be between 0 and the current maxZoom, inclusive")},a.prototype.getMinZoom=function(){return this.transform.minZoom},a.prototype.setMaxZoom=function(t){if((t=null==t?22:t)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},a.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},a.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},a.prototype.getMaxZoom=function(){return this.transform.maxZoom},a.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},a.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},a.prototype.isMoving=function(){return this._moving||this.dragPan.isActive()||this.dragRotate.isActive()||this.scrollZoom.isActive()},a.prototype.isZooming=function(){return this._zooming||this.scrollZoom.isZooming()},a.prototype.isRotating=function(){return this._rotating||this.dragRotate.isActive()},a.prototype.on=function(t,e,r){var a=this;if(void 0===r)return n.prototype.on.call(this,t,e);var i=function(){var n;if("mouseenter"===t||"mouseover"===t){var i=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){var o=a.getLayer(e)?a.queryRenderedFeatures(n.point,{layers:[e]}):[];o.length?i||(i=!0,r.call(a,new sn(t,a,n.originalEvent,{features:o}))):i=!1},mouseout:function(){i=!1}}}}if("mouseleave"===t||"mouseout"===t){var o=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){(a.getLayer(e)?a.queryRenderedFeatures(n.point,{layers:[e]}):[]).length?o=!0:o&&(o=!1,r.call(a,new sn(t,a,n.originalEvent)))},mouseout:function(e){o&&(o=!1,r.call(a,new sn(t,a,e.originalEvent)))}}}}return{layer:e,listener:r,delegates:(n={},n[t]=function(t){var n=a.getLayer(e)?a.queryRenderedFeatures(t.point,{layers:[e]}):[];n.length&&(t.features=n,r.call(a,t),delete t.features)},n)}}();for(var o in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(i),i.delegates)this.on(o,i.delegates[o]);return this},a.prototype.off=function(t,e,r){if(void 0===r)return n.prototype.off.call(this,t,e);if(this._delegatedListeners&&this._delegatedListeners[t])for(var a=this._delegatedListeners[t],i=0;i<a.length;i++){var o=a[i];if(o.layer===e&&o.listener===r){for(var s in o.delegates)this.off(s,o.delegates[s]);return a.splice(i,1),this}}return this},a.prototype.queryRenderedFeatures=function(e,r){if(!this.style)return[];var n;if(void 0!==r||void 0===e||e instanceof t.Point||Array.isArray(e)||(r=e,e=void 0),r=r||{},(e=e||[[0,0],[this.transform.width,this.transform.height]])instanceof t.Point||"number"==typeof e[0])n=[t.Point.convert(e)];else{var a=t.Point.convert(e[0]),i=t.Point.convert(e[1]);n=[a,new t.Point(i.x,a.y),i,new t.Point(a.x,i.y),a]}return this.style.queryRenderedFeatures(n,r,this.transform)},a.prototype.querySourceFeatures=function(t,e){return this.style.querySourceFeatures(t,e)},a.prototype.setStyle=function(e,r){return!1!==(r=t.extend({},{localIdeographFontFamily:Sn.localIdeographFontFamily},r)).diff&&r.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&e?(this._diffStyle(e,r),this):(this._localIdeographFontFamily=r.localIdeographFontFamily,this._updateStyle(e,r))},a.prototype._updateStyle=function(t,e){return this.style&&(this.style.setEventedParent(null),this.style._remove()),t?(this.style=new ze(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t):this.style.loadJSON(t),this):(delete this.style,this)},a.prototype._diffStyle=function(e,r){var n=this;if("string"==typeof e){var a=this._requestManager.normalizeStyleURL(e),i=this._requestManager.transformRequest(a,t.ResourceType.Style);t.getJSON(i,(function(e,a){e?n.fire(new t.ErrorEvent(e)):a&&n._updateDiff(a,r)}))}else"object"==typeof e&&this._updateDiff(e,r)},a.prototype._updateDiff=function(e,r){try{this.style.setState(e)&&this._update(!0)}catch(n){t.warnOnce("Unable to perform style diff: "+(n.message||n.error||n)+". Rebuilding the style from scratch."),this._updateStyle(e,r)}},a.prototype.getStyle=function(){if(this.style)return this.style.serialize()},a.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():t.warnOnce("There is no style added to the map.")},a.prototype.addSource=function(t,e){return this.style.addSource(t,e),this._update(!0)},a.prototype.isSourceLoaded=function(e){var r=this.style&&this.style.sourceCaches[e];if(void 0!==r)return r.loaded();this.fire(new t.ErrorEvent(new Error("There is no source with ID '"+e+"'")))},a.prototype.areTilesLoaded=function(){var t=this.style&&this.style.sourceCaches;for(var e in t){var r=t[e]._tiles;for(var n in r){var a=r[n];if("loaded"!==a.state&&"errored"!==a.state)return!1}}return!0},a.prototype.addSourceType=function(t,e,r){return this.style.addSourceType(t,e,r)},a.prototype.removeSource=function(t){return this.style.removeSource(t),this._update(!0)},a.prototype.getSource=function(t){return this.style.getSource(t)},a.prototype.addImage=function(e,r,n){void 0===n&&(n={});var a=n.pixelRatio;void 0===a&&(a=1);var i=n.sdf;if(void 0===i&&(i=!1),r instanceof Ln){var o=t.browser.getImageData(r),s=o.width,l=o.height,u=o.data;this.style.addImage(e,{data:new t.RGBAImage({width:s,height:l},u),pixelRatio:a,sdf:i,version:0})}else{if(void 0===r.width||void 0===r.height)return this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));var c=r.width,h=r.height,d=r.data,f=r;this.style.addImage(e,{data:new t.RGBAImage({width:c,height:h},new Uint8Array(d)),pixelRatio:a,sdf:i,version:0,userImage:f}),f.onAdd&&f.onAdd(this,e)}},a.prototype.updateImage=function(e,r){var n=this.style.getImage(e);if(!n)return this.fire(new t.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var a=r instanceof Ln?t.browser.getImageData(r):r,i=a.width,o=a.height,s=a.data;if(void 0===i||void 0===o)return this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(i!==n.data.width||o!==n.data.height)return this.fire(new t.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image")));var l=!(r instanceof Ln);n.data.replace(s,l),this.style.updateImage(e,n)},a.prototype.hasImage=function(e){return e?!!this.style.getImage(e):(this.fire(new t.ErrorEvent(new Error("Missing required image id"))),!1)},a.prototype.removeImage=function(t){this.style.removeImage(t)},a.prototype.loadImage=function(e,r){t.getImage(this._requestManager.transformRequest(e,t.ResourceType.Image),r)},a.prototype.listImages=function(){return this.style.listImages()},a.prototype.addLayer=function(t,e){return this.style.addLayer(t,e),this._update(!0)},a.prototype.moveLayer=function(t,e){return this.style.moveLayer(t,e),this._update(!0)},a.prototype.removeLayer=function(t){return this.style.removeLayer(t),this._update(!0)},a.prototype.getLayer=function(t){return this.style.getLayer(t)},a.prototype.setFilter=function(t,e,r){return void 0===r&&(r={}),this.style.setFilter(t,e,r),this._update(!0)},a.prototype.setLayerZoomRange=function(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0)},a.prototype.getFilter=function(t){return this.style.getFilter(t)},a.prototype.setPaintProperty=function(t,e,r,n){return void 0===n&&(n={}),this.style.setPaintProperty(t,e,r,n),this._update(!0)},a.prototype.getPaintProperty=function(t,e){return this.style.getPaintProperty(t,e)},a.prototype.setLayoutProperty=function(t,e,r,n){return void 0===n&&(n={}),this.style.setLayoutProperty(t,e,r,n),this._update(!0)},a.prototype.getLayoutProperty=function(t,e){return this.style.getLayoutProperty(t,e)},a.prototype.setLight=function(t,e){return void 0===e&&(e={}),this.style.setLight(t,e),this._update(!0)},a.prototype.getLight=function(){return this.style.getLight()},a.prototype.setFeatureState=function(t,e){return this.style.setFeatureState(t,e),this._update()},a.prototype.removeFeatureState=function(t,e){return this.style.removeFeatureState(t,e),this._update()},a.prototype.getFeatureState=function(t){return this.style.getFeatureState(t)},a.prototype.getContainer=function(){return this._container},a.prototype.getCanvasContainer=function(){return this._canvasContainer},a.prototype.getCanvas=function(){return this._canvas},a.prototype._containerDimensions=function(){var t=0,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]},a.prototype._detectMissingCSS=function(){"rgb(250, 128, 114)"!==t.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&t.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")},a.prototype._setupContainer=function(){var t=this._container;t.classList.add("mapboxgl-map"),(this._missingCSSCanary=r.create("div","mapboxgl-canary",t)).style.visibility="hidden",this._detectMissingCSS();var e=this._canvasContainer=r.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=r.create("canvas","mapboxgl-canvas",e),this._canvas.style.position="absolute",this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map");var n=this._containerDimensions();this._resizeCanvas(n[0],n[1]);var a=this._controlContainer=r.create("div","mapboxgl-control-container",t),i=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((function(t){i[t]=r.create("div","mapboxgl-ctrl-"+t,a)}))},a.prototype._resizeCanvas=function(e,r){var n=t.window.devicePixelRatio||1;this._canvas.width=n*e,this._canvas.height=n*r,this._canvas.style.width=e+"px",this._canvas.style.height=r+"px"},a.prototype._setupPainter=function(){var r=t.extend({},e.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),n=this._canvas.getContext("webgl",r)||this._canvas.getContext("experimental-webgl",r);n?(this.painter=new Qr(n,this.transform),t.webpSupported.testSupport(n)):this.fire(new t.ErrorEvent(new Error("Failed to initialize WebGL")))},a.prototype._contextLost=function(e){e.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new t.Event("webglcontextlost",{originalEvent:e}))},a.prototype._contextRestored=function(e){this._setupPainter(),this.resize(),this._update(),this.fire(new t.Event("webglcontextrestored",{originalEvent:e}))},a.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},a.prototype._update=function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint(),this):this},a.prototype._requestRenderFrame=function(t){return this._update(),this._renderTaskQueue.add(t)},a.prototype._cancelRenderFrame=function(t){this._renderTaskQueue.remove(t)},a.prototype._render=function(){this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run();var e=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var r=this.transform.zoom,n=t.browser.now();this.style.zoomHistory.update(r,n);var a=new t.EvaluationParameters(r,{now:n,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),i=a.crossFadingFactor();1===i&&i===this._crossFadingFactor||(e=!0,this._crossFadingFactor=i),this.style.update(a)}return this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration}),this.fire(new t.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new t.Event("load"))),this.style&&(this.style.hasTransitions()||e)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this._sourcesDirty||this._repaint||this._styleDirty||this._placementDirty?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.Event("idle")),this},a.prototype.remove=function(){this._hash&&this._hash.remove();for(var e=0,r=this._controls;e<r.length;e+=1)r[e].onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.setStyle(null),void 0!==t.window&&(t.window.removeEventListener("resize",this._onWindowResize,!1),t.window.removeEventListener("online",this._onWindowOnline,!1));var n=this.painter.context.gl.getExtension("WEBGL_lose_context");n&&n.loseContext(),Cn(this._canvasContainer),Cn(this._controlContainer),Cn(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this.fire(new t.Event("remove"))},a.prototype.triggerRepaint=function(){var e=this;this.style&&!this._frame&&(this._frame=t.browser.frame((function(){e._frame=null,e._render()})))},a.prototype._onWindowOnline=function(){this._update()},a.prototype._onWindowResize=function(){this._trackResize&&this.resize()._update()},i.showTileBoundaries.get=function(){return!!this._showTileBoundaries},i.showTileBoundaries.set=function(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},i.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},i.showCollisionBoxes.set=function(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())},i.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},i.showOverdrawInspector.set=function(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},i.repaint.get=function(){return!!this._repaint},i.repaint.set=function(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())},i.vertices.get=function(){return!!this._vertices},i.vertices.set=function(t){this._vertices=t,this._update()},a.prototype._setCacheLimits=function(e,r){t.setCacheLimits(e,r)},Object.defineProperties(a.prototype,i),a}(wn);function Cn(t){t.parentNode&&t.parentNode.removeChild(t)}var Dn={showCompass:!0,showZoom:!0},Pn=function(e){var n=this;this.options=t.extend({},Dn,e),this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this.options.showZoom&&(t.bindAll(["_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-zoom-in","Zoom in",(function(){return n._map.zoomIn()})),this._zoomOutButton=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-zoom-out","Zoom out",(function(){return n._map.zoomOut()}))),this.options.showCompass&&(t.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-compass","Reset bearing to north",(function(){return n._map.resetNorth()})),this._compassArrow=r.create("span","mapboxgl-ctrl-compass-arrow",this._compass))};function On(e,r,n){if(e=new t.LngLat(e.lng,e.lat),r){var a=new t.LngLat(e.lng-360,e.lat),i=new t.LngLat(e.lng+360,e.lat),o=n.locationPoint(e).distSqr(r);n.locationPoint(a).distSqr(r)<o?e=a:n.locationPoint(i).distSqr(r)<o&&(e=i)}for(;Math.abs(e.lng-n.center.lng)>180;){var s=n.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=n.width&&s.y<=n.height)break;e.lng>n.center.lng?e.lng-=360:e.lng+=360}return e}Pn.prototype._updateZoomButtons=function(){var t=this._map.getZoom();this._zoomInButton.classList.toggle("mapboxgl-ctrl-icon-disabled",t===this._map.getMaxZoom()),this._zoomOutButton.classList.toggle("mapboxgl-ctrl-icon-disabled",t===this._map.getMinZoom())},Pn.prototype._rotateCompassArrow=function(){var t="rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t},Pn.prototype.onAdd=function(t){return this._map=t,this.options.showZoom&&(this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new fn(t,{button:"left",element:this._compass}),r.addEventListener(this._compass,"mousedown",this._handler.onMouseDown),this._handler.enable()),this._container},Pn.prototype.onRemove=function(){r.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this._map.off("rotate",this._rotateCompassArrow),r.removeEventListener(this._compass,"mousedown",this._handler.onMouseDown),this._handler.disable(),delete this._handler),delete this._map},Pn.prototype._createButton=function(t,e,n){var a=r.create("button",t,this._container);return a.type="button",a.title=e,a.setAttribute("aria-label",e),a.addEventListener("click",n),a};var zn={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function In(t,e,r){var n=t.classList;for(var a in zn)n.remove("mapboxgl-"+r+"-anchor-"+a);n.add("mapboxgl-"+r+"-anchor-"+e)}var Rn,Fn=function(e){function n(n,a){if(e.call(this),(n instanceof t.window.HTMLElement||a)&&(n=t.extend({element:n},a)),t.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick"],this),this._anchor=n&&n.anchor||"center",this._color=n&&n.color||"#3FB1CE",this._draggable=n&&n.draggable||!1,this._state="inactive",n&&n.element)this._element=n.element,this._offset=t.Point.convert(n&&n.offset||[0,0]);else{this._defaultMarker=!0,this._element=r.create("div");var i=r.createNS("http://www.w3.org/2000/svg","svg");i.setAttributeNS(null,"display","block"),i.setAttributeNS(null,"height","41px"),i.setAttributeNS(null,"width","27px"),i.setAttributeNS(null,"viewBox","0 0 27 41");var o=r.createNS("http://www.w3.org/2000/svg","g");o.setAttributeNS(null,"stroke","none"),o.setAttributeNS(null,"stroke-width","1"),o.setAttributeNS(null,"fill","none"),o.setAttributeNS(null,"fill-rule","evenodd");var s=r.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"fill-rule","nonzero");var l=r.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"transform","translate(3.0, 29.0)"),l.setAttributeNS(null,"fill","#000000");for(var u=0,c=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];u<c.length;u+=1){var h=c[u],d=r.createNS("http://www.w3.org/2000/svg","ellipse");d.setAttributeNS(null,"opacity","0.04"),d.setAttributeNS(null,"cx","10.5"),d.setAttributeNS(null,"cy","5.80029008"),d.setAttributeNS(null,"rx",h.rx),d.setAttributeNS(null,"ry",h.ry),l.appendChild(d)}var f=r.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"fill",this._color);var p=r.createNS("http://www.w3.org/2000/svg","path");p.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),f.appendChild(p);var m=r.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"opacity","0.25"),m.setAttributeNS(null,"fill","#000000");var g=r.createNS("http://www.w3.org/2000/svg","path");g.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),m.appendChild(g);var y=r.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"transform","translate(6.0, 7.0)"),y.setAttributeNS(null,"fill","#FFFFFF");var v=r.createNS("http://www.w3.org/2000/svg","g");v.setAttributeNS(null,"transform","translate(8.0, 8.0)");var _=r.createNS("http://www.w3.org/2000/svg","circle");_.setAttributeNS(null,"fill","#000000"),_.setAttributeNS(null,"opacity","0.25"),_.setAttributeNS(null,"cx","5.5"),_.setAttributeNS(null,"cy","5.5"),_.setAttributeNS(null,"r","5.4999962");var x=r.createNS("http://www.w3.org/2000/svg","circle");x.setAttributeNS(null,"fill","#FFFFFF"),x.setAttributeNS(null,"cx","5.5"),x.setAttributeNS(null,"cy","5.5"),x.setAttributeNS(null,"r","5.4999962"),v.appendChild(_),v.appendChild(x),s.appendChild(l),s.appendChild(f),s.appendChild(m),s.appendChild(y),s.appendChild(v),i.appendChild(s),this._element.appendChild(i),this._offset=t.Point.convert(n&&n.offset||[0,-14])}this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",(function(t){t.preventDefault()})),In(this._element,this._anchor,"marker"),this._popup=null}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.addTo=function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},n.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),delete this._map),r.remove(this._element),this._popup&&this._popup.remove(),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},n.prototype.getElement=function(){return this._element},n.prototype.setPopup=function(t){if(this._popup&&(this._popup.remove(),this._popup=null),t){if(!("offset"in t.options)){var e=Math.sqrt(Math.pow(13.5,2)/2);t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[e,-1*(24.6+e)],"bottom-right":[-e,-1*(24.6+e)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat)}return this},n.prototype._onMapClick=function(t){var e=t.originalEvent.target,r=this._element;this._popup&&(e===r||r.contains(e))&&this.togglePopup()},n.prototype.getPopup=function(){return this._popup},n.prototype.togglePopup=function(){var t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this},n.prototype._update=function(t){this._map&&(this._map.transform.renderWorldCopies&&(this._lngLat=On(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset),t&&"moveend"!==t.type||(this._pos=this._pos.round()),r.setTransform(this._element,zn[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px)"))},n.prototype.getOffset=function(){return this._offset},n.prototype.setOffset=function(e){return this._offset=t.Point.convert(e),this._update(),this},n.prototype._onMove=function(e){this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag"))},n.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new t.Event("dragend")),this._state="inactive"},n.prototype._addDragHandler=function(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},n.prototype.setDraggable=function(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},n.prototype.isDraggable=function(){return this._draggable},n}(t.Evented),Nn={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showUserLocation:!0},Yn=function(e){function n(r){e.call(this),this.options=t.extend({},Nn,r),t.bindAll(["_onSuccess","_onError","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.onAdd=function(e){var n;return this._map=e,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),n=this._setupUI,void 0!==Rn?n(Rn):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then((function(t){Rn="denied"!==t.state,n(Rn)})):(Rn=!!t.window.navigator.geolocation,n(Rn)),this._container},n.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),r.remove(this._container),this._map=void 0},n.prototype._onSuccess=function(e){if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()},n.prototype._updateCamera=function(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude),n=e.coords.accuracy,a=this._map.getBearing(),i=t.extend({bearing:a},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(n),i,{geolocateSource:!0})},n.prototype._updateMarker=function(t){t?this._userLocationDotMarker.setLngLat([t.coords.longitude,t.coords.latitude]).addTo(this._map):this._userLocationDotMarker.remove()},n.prototype._onError=function(e){if(this.options.trackUserLocation)if(1===e.code)this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),void 0!==this._geolocationWatchID&&this._clearWatch();else switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()},n.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},n.prototype._setupUI=function(e){var n=this;!1!==e?(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=r.create("button","mapboxgl-ctrl-icon mapboxgl-ctrl-geolocate",this._container),this._geolocateButton.type="button",this._geolocateButton.setAttribute("aria-label","Geolocate"),this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Fn(this._dotElement),this.options.trackUserLocation&&(this._watchState="OFF")),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(e){e.geolocateSource||"ACTIVE_LOCK"!==n._watchState||(n._watchState="BACKGROUND",n._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),n._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),n.fire(new t.Event("trackuserlocationend")))}))):t.warnOnce("Geolocation support is not available, the GeolocateControl will not be visible.")},n.prototype.trigger=function(){if(!this._setup)return t.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}"OFF"===this._watchState&&void 0!==this._geolocationWatchID?this._clearWatch():void 0===this._geolocationWatchID&&(this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,this.options.positionOptions))}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},n.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},n}(t.Evented),jn={maxWidth:100,unit:"metric"},Bn=function(e){this.options=t.extend({},jn,e),t.bindAll(["_onMove","setUnit"],this)};function Hn(t,e,r){var n,a,i,o,s,l,u=r&&r.maxWidth||100,c=t._container.clientHeight/2,h=(n=t.unproject([0,c]),a=t.unproject([u,c]),i=Math.PI/180,o=n.lat*i,s=a.lat*i,l=Math.sin(o)*Math.sin(s)+Math.cos(o)*Math.cos(s)*Math.cos((a.lng-n.lng)*i),6371e3*Math.acos(Math.min(l,1)));if(r&&"imperial"===r.unit){var d=3.2808*h;d>5280?Un(e,u,d/5280,"mi"):Un(e,u,d,"ft")}else r&&"nautical"===r.unit?Un(e,u,h/1852,"nm"):Un(e,u,h,"m")}function Un(t,e,r,n){var a,i,o,s=(a=r,(i=Math.pow(10,(""+Math.floor(a)).length-1))*(o=(o=a/i)>=10?10:o>=5?5:o>=3?3:o>=2?2:o>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(o))),l=s/r;"m"===n&&s>=1e3&&(s/=1e3,n="km"),t.style.width=e*l+"px",t.innerHTML=s+n}Bn.prototype.getDefaultPosition=function(){return"bottom-left"},Bn.prototype._onMove=function(){Hn(this._map,this._container,this.options)},Bn.prototype.onAdd=function(t){return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Bn.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Bn.prototype.setUnit=function(t){this.options.unit=t,Hn(this._map,this._container,this.options)};var Vn=function(e){this._fullscreen=!1,e&&e.container&&(e.container instanceof t.window.HTMLElement?this._container=e.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.window.document&&(this._fullscreenchange="MSFullscreenChange"),this._className="mapboxgl-ctrl"};Vn.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div",this._className+" mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Vn.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Vn.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Vn.prototype._setupUI=function(){(this._fullscreenButton=r.create("button",this._className+"-icon "+this._className+"-fullscreen",this._controlContainer)).type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Vn.prototype._updateTitle=function(){var t=this._isFullscreen()?"Exit fullscreen":"Enter fullscreen";this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},Vn.prototype._isFullscreen=function(){return this._fullscreen},Vn.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle(this._className+"-shrink"),this._fullscreenButton.classList.toggle(this._className+"-fullscreen"),this._updateTitle())},Vn.prototype._onClickFullscreen=function(){this._isFullscreen()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.mozCancelFullScreen?t.window.document.mozCancelFullScreen():t.window.document.msExitFullscreen?t.window.document.msExitFullscreen():t.window.document.webkitCancelFullScreen&&t.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var Wn={closeButton:!0,closeOnClick:!0,className:"",maxWidth:"240px"},Gn=function(e){function n(r){e.call(this),this.options=t.extend(Object.create(Wn),r),t.bindAll(["_update","_onClickClose","remove"],this)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.addTo=function(e){var r=this;return this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._map.on("remove",this.remove),this._update(),this._trackPointer?(this._map.on("mousemove",(function(t){r._update(t.point)})),this._map.on("mouseup",(function(t){r._update(t.point)})),this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},n.prototype.isOpen=function(){return!!this._map},n.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("click",this._onClickClose),this._map.off("remove",this.remove),this._map.off("mousemove"),delete this._map),this.fire(new t.Event("close")),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._map&&(this._map.on("move",this._update),this._map.off("mousemove"),this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this._trackPointer=!1,this._update(),this},n.prototype.trackPointer=function(){var t=this;return this._trackPointer=!0,this._pos=null,this._map&&(this._map.off("move",this._update),this._map.on("mousemove",(function(e){t._update(e.point)})),this._map.on("drag",(function(e){t._update(e.point)})),this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},n.prototype.getElement=function(){return this._container},n.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},n.prototype.setHTML=function(e){var r,n=t.window.document.createDocumentFragment(),a=t.window.document.createElement("body");for(a.innerHTML=e;r=a.firstChild;)n.appendChild(r);return this.setDOMContent(n)},n.prototype.getMaxWidth=function(){return this._container.style.maxWidth},n.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},n.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},n.prototype._createContent=function(){this._content&&r.remove(this._content),this._content=r.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClickClose))},n.prototype._update=function(e){var n=this,a=this._lngLat||this._trackPointer;if(this._map&&a&&this._content&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return n._container.classList.add(t)}))),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=On(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var i=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),o=this.options.anchor,s=function e(r){if(r){if("number"==typeof r){var n=Math.round(Math.sqrt(.5*Math.pow(r,2)));return{center:new t.Point(0,0),top:new t.Point(0,r),"top-left":new t.Point(n,n),"top-right":new t.Point(-n,n),bottom:new t.Point(0,-r),"bottom-left":new t.Point(n,-n),"bottom-right":new t.Point(-n,-n),left:new t.Point(r,0),right:new t.Point(-r,0)}}if(r instanceof t.Point||Array.isArray(r)){var a=t.Point.convert(r);return{center:a,top:a,"top-left":a,"top-right":a,bottom:a,"bottom-left":a,"bottom-right":a,left:a,right:a}}return{center:t.Point.convert(r.center||[0,0]),top:t.Point.convert(r.top||[0,0]),"top-left":t.Point.convert(r["top-left"]||[0,0]),"top-right":t.Point.convert(r["top-right"]||[0,0]),bottom:t.Point.convert(r.bottom||[0,0]),"bottom-left":t.Point.convert(r["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(r["bottom-right"]||[0,0]),left:t.Point.convert(r.left||[0,0]),right:t.Point.convert(r.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset);if(!o){var l,u=this._container.offsetWidth,c=this._container.offsetHeight;l=i.y+s.bottom.y<c?["top"]:i.y>this._map.transform.height-c?["bottom"]:[],i.x<u/2?l.push("left"):i.x>this._map.transform.width-u/2&&l.push("right"),o=0===l.length?"bottom":l.join("-")}var h=i.add(s[o]).round();r.setTransform(this._container,zn[o]+" translate("+h.x+"px,"+h.y+"px)"),In(this._container,o,"popup")}},n.prototype._onClickClose=function(){this.remove()},n}(t.Evented),qn={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,Map:En,NavigationControl:Pn,GeolocateControl:Yn,AttributionControl:Mn,ScaleControl:Bn,FullscreenControl:Vn,Popup:Gn,Marker:Fn,Style:ze,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e},get workerCount(){return Pt.workerCount},set workerCount(t){Pt.workerCount=t},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e},clearStorage:function(e){t.clearTileCache(e)},workerUrl:""};return qn})),r},"object"==typeof r&&void 0!==e?e.exports=a():(n=n||self).mapboxgl=a()},{}],427:[function(t,e,r){e.exports=function(t){for(var e=1<<t+1,r=new Array(e),n=0;n<e;++n)r[n]=i(t,n);return r};var n=t("convex-hull");function a(t,e,r){for(var n=new Array(t),a=0;a<t;++a)n[a]=0,a===e&&(n[a]+=.5),a===r&&(n[a]+=.5);return n}function i(t,e){if(0===e||e===(1<<t+1)-1)return[];for(var r=[],i=[],o=0;o<=t;++o)if(e&1<<o){r.push(a(t,o-1,o-1)),i.push(null);for(var s=0;s<=t;++s)~e&1<<s&&(r.push(a(t,o-1,s-1)),i.push([o,s]))}var l=n(r),u=[];t:for(o=0;o<l.length;++o){var c=l[o],h=[];for(s=0;s<c.length;++s){if(!i[c[s]])continue t;h.push(i[c[s]].slice())}u.push(h)}return u}},{"convex-hull":130}],428:[function(t,e,r){var n=t("./normalize"),a=t("gl-mat4/create"),i=t("gl-mat4/clone"),o=t("gl-mat4/determinant"),s=t("gl-mat4/invert"),l=t("gl-mat4/transpose"),u={length:t("gl-vec3/length"),normalize:t("gl-vec3/normalize"),dot:t("gl-vec3/dot"),cross:t("gl-vec3/cross")},c=a(),h=a(),d=[0,0,0,0],f=[[0,0,0],[0,0,0],[0,0,0]],p=[0,0,0];function m(t,e,r,n,a){t[0]=e[0]*n+r[0]*a,t[1]=e[1]*n+r[1]*a,t[2]=e[2]*n+r[2]*a}e.exports=function(t,e,r,a,g,y){if(e||(e=[0,0,0]),r||(r=[0,0,0]),a||(a=[0,0,0]),g||(g=[0,0,0,1]),y||(y=[0,0,0,1]),!n(c,t))return!1;if(i(h,c),h[3]=0,h[7]=0,h[11]=0,h[15]=1,Math.abs(o(h)<1e-8))return!1;var v,_,x,b,w,M,k,T=c[3],L=c[7],A=c[11],S=c[12],E=c[13],C=c[14],D=c[15];if(0!==T||0!==L||0!==A){if(d[0]=T,d[1]=L,d[2]=A,d[3]=D,!s(h,h))return!1;l(h,h),v=g,x=h,b=(_=d)[0],w=_[1],M=_[2],k=_[3],v[0]=x[0]*b+x[4]*w+x[8]*M+x[12]*k,v[1]=x[1]*b+x[5]*w+x[9]*M+x[13]*k,v[2]=x[2]*b+x[6]*w+x[10]*M+x[14]*k,v[3]=x[3]*b+x[7]*w+x[11]*M+x[15]*k}else g[0]=g[1]=g[2]=0,g[3]=1;if(e[0]=S,e[1]=E,e[2]=C,function(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]}(f,c),r[0]=u.length(f[0]),u.normalize(f[0],f[0]),a[0]=u.dot(f[0],f[1]),m(f[1],f[1],f[0],1,-a[0]),r[1]=u.length(f[1]),u.normalize(f[1],f[1]),a[0]/=r[1],a[1]=u.dot(f[0],f[2]),m(f[2],f[2],f[0],1,-a[1]),a[2]=u.dot(f[1],f[2]),m(f[2],f[2],f[1],1,-a[2]),r[2]=u.length(f[2]),u.normalize(f[2],f[2]),a[1]/=r[2],a[2]/=r[2],u.cross(p,f[1],f[2]),u.dot(f[0],p)<0)for(var P=0;P<3;P++)r[P]*=-1,f[P][0]*=-1,f[P][1]*=-1,f[P][2]*=-1;return y[0]=.5*Math.sqrt(Math.max(1+f[0][0]-f[1][1]-f[2][2],0)),y[1]=.5*Math.sqrt(Math.max(1-f[0][0]+f[1][1]-f[2][2],0)),y[2]=.5*Math.sqrt(Math.max(1-f[0][0]-f[1][1]+f[2][2],0)),y[3]=.5*Math.sqrt(Math.max(1+f[0][0]+f[1][1]+f[2][2],0)),f[2][1]>f[1][2]&&(y[0]=-y[0]),f[0][2]>f[2][0]&&(y[1]=-y[1]),f[1][0]>f[0][1]&&(y[2]=-y[2]),!0}},{"./normalize":429,"gl-mat4/clone":259,"gl-mat4/create":260,"gl-mat4/determinant":261,"gl-mat4/invert":265,"gl-mat4/transpose":276,"gl-vec3/cross":334,"gl-vec3/dot":339,"gl-vec3/length":349,"gl-vec3/normalize":356}],429:[function(t,e,r){e.exports=function(t,e){var r=e[15];if(0===r)return!1;for(var n=1/r,a=0;a<16;a++)t[a]=e[a]*n;return!0}},{}],430:[function(t,e,r){var n=t("gl-vec3/lerp"),a=t("mat4-recompose"),i=t("mat4-decompose"),o=t("gl-mat4/determinant"),s=t("quat-slerp"),l=h(),u=h(),c=h();function h(){return{translate:d(),scale:d(1),skew:d(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function d(t){return[t||0,t||0,t||0]}e.exports=function(t,e,r,h){if(0===o(e)||0===o(r))return!1;var d=i(e,l.translate,l.scale,l.skew,l.perspective,l.quaternion),f=i(r,u.translate,u.scale,u.skew,u.perspective,u.quaternion);return!(!d||!f||(n(c.translate,l.translate,u.translate,h),n(c.skew,l.skew,u.skew,h),n(c.scale,l.scale,u.scale,h),n(c.perspective,l.perspective,u.perspective,h),s(c.quaternion,l.quaternion,u.quaternion,h),a(t,c.translate,c.scale,c.skew,c.perspective,c.quaternion),0))}},{"gl-mat4/determinant":261,"gl-vec3/lerp":350,"mat4-decompose":428,"mat4-recompose":431,"quat-slerp":483}],431:[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")},a=(n.create(),n.create());e.exports=function(t,e,r,i,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(a),0!==i[2]&&(a[9]=i[2],n.multiply(t,t,a)),0!==i[1]&&(a[9]=0,a[8]=i[1],n.multiply(t,t,a)),0!==i[0]&&(a[8]=0,a[4]=i[0],n.multiply(t,t,a)),n.scale(t,t,r),t}},{"gl-mat4/create":260,"gl-mat4/fromRotationTranslation":263,"gl-mat4/identity":264,"gl-mat4/multiply":267,"gl-mat4/scale":274,"gl-mat4/translate":275}],432:[function(t,e,r){e.exports=Math.log2||function(t){return Math.log(t)*Math.LOG2E}},{}],433:[function(t,e,r){var n=t("binary-search-bounds"),a=t("mat4-interpolate"),i=t("gl-mat4/invert"),o=t("gl-mat4/rotateX"),s=t("gl-mat4/rotateY"),l=t("gl-mat4/rotateZ"),u=t("gl-mat4/lookAt"),c=t("gl-mat4/translate"),h=(t("gl-mat4/scale"),t("gl-vec3/normalize")),d=[0,0,0];function f(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]}e.exports=function(t){return new f((t=t||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var p=f.prototype;p.recalcMatrix=function(t){var e=this._time,r=n.le(e,t),o=this.computedMatrix;if(!(r<0)){var s=this._components;if(r===e.length-1)for(var l=16*r,u=0;u<16;++u)o[u]=s[l++];else{var c=e[r+1]-e[r],d=(l=16*r,this.prevMatrix),f=!0;for(u=0;u<16;++u)d[u]=s[l++];var p=this.nextMatrix;for(u=0;u<16;++u)p[u]=s[l++],f=f&&d[u]===p[u];if(c<1e-6||f)for(u=0;u<16;++u)o[u]=d[u];else a(o,d,p,(t-e[r])/c)}var m=this.computedUp;m[0]=o[1],m[1]=o[5],m[2]=o[9],h(m,m);var g=this.computedInverse;i(g,o);var y=this.computedEye,v=g[15];y[0]=g[12]/v,y[1]=g[13]/v,y[2]=g[14]/v;var _=this.computedCenter,x=Math.exp(this.computedRadius[0]);for(u=0;u<3;++u)_[u]=y[u]-o[2+4*u]*x}},p.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)}},p.flush=function(t){var e=n.gt(this._time,t)-2;e<0||(this._time.splice(0,e),this._components.splice(0,16*e))},p.lastT=function(){return this._time[this._time.length-1]},p.lookAt=function(t,e,r,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||d,n=n||this.computedUp,this.setMatrix(t,u(this.computedMatrix,e,r,n));for(var a=0,i=0;i<3;++i)a+=Math.pow(r[i]-e[i],2);a=Math.log(Math.sqrt(a)),this.computedRadius[0]=a},p.rotate=function(t,e,r,n){this.recalcMatrix(t);var a=this.computedInverse;e&&s(a,a,e),r&&o(a,a,r),n&&l(a,a,n),this.setMatrix(t,i(this.computedMatrix,a))};var m=[0,0,0];p.pan=function(t,e,r,n){m[0]=-(e||0),m[1]=-(r||0),m[2]=-(n||0),this.recalcMatrix(t);var a=this.computedInverse;c(a,a,m),this.setMatrix(t,i(a,a))},p.translate=function(t,e,r,n){m[0]=e||0,m[1]=r||0,m[2]=n||0,this.recalcMatrix(t);var a=this.computedMatrix;c(a,a,m),this.setMatrix(t,a)},p.setMatrix=function(t,e){if(!(t<this.lastT())){this._time.push(t);for(var r=0;r<16;++r)this._components.push(e[r])}},p.setDistance=function(t,e){this.computedRadius[0]=e},p.setDistanceLimits=function(t,e){var r=this._limits;r[0]=t,r[1]=e},p.getDistanceLimits=function(t){var e=this._limits;return t?(t[0]=e[0],t[1]=e[1],t):e}},{"binary-search-bounds":91,"gl-mat4/invert":265,"gl-mat4/lookAt":266,"gl-mat4/rotateX":271,"gl-mat4/rotateY":272,"gl-mat4/rotateZ":273,"gl-mat4/scale":274,"gl-mat4/translate":275,"gl-vec3/normalize":356,"mat4-interpolate":430}],434:[function(t,e,r){e.exports=function(t){var e=t.length;if(e<3){for(var r=new Array(e),a=0;a<e;++a)r[a]=a;return 2===e&&t[0][0]===t[1][0]&&t[0][1]===t[1][1]?[0]:r}var i=new Array(e);for(a=0;a<e;++a)i[a]=a;i.sort((function(e,r){return t[e][0]-t[r][0]||t[e][1]-t[r][1]}));var o=[i[0],i[1]],s=[i[0],i[1]];for(a=2;a<e;++a){for(var l=i[a],u=t[l],c=o.length;c>1&&n(t[o[c-2]],t[o[c-1]],u)<=0;)c-=1,o.pop();for(o.push(l),c=s.length;c>1&&n(t[s[c-2]],t[s[c-1]],u)>=0;)c-=1,s.pop();s.push(l)}r=new Array(s.length+o.length-2);for(var h=0,d=(a=0,o.length);a<d;++a)r[h++]=o[a];for(var f=s.length-2;f>0;--f)r[h++]=s[f];return r};var n=t("robust-orientation")[3]},{"robust-orientation":510}],435:[function(t,e,r){e.exports=function(t,e){e||(e=t,t=window);var r=0,a=0,i=0,o={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function l(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==o.alt,o.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==o.shift,o.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==o.control,o.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==o.meta,o.meta=!!t.metaKey),e}function u(t,s){var u=n.x(s),c=n.y(s);"buttons"in s&&(t=0|s.buttons),(t!==r||u!==a||c!==i||l(s))&&(r=0|t,a=u||0,i=c||0,e&&e(r,a,i,o))}function c(t){u(0,t)}function h(){(r||a||i||o.shift||o.alt||o.meta||o.control)&&(a=i=0,r=0,o.shift=o.alt=o.control=o.meta=!1,e&&e(0,0,0,o))}function d(t){l(t)&&e&&e(r,a,i,o)}function f(t){0===n.buttons(t)?u(0,t):u(r,t)}function p(t){u(r|n.buttons(t),t)}function m(t){u(r&~n.buttons(t),t)}function g(){s||(s=!0,t.addEventListener("mousemove",f),t.addEventListener("mousedown",p),t.addEventListener("mouseup",m),t.addEventListener("mouseleave",c),t.addEventListener("mouseenter",c),t.addEventListener("mouseout",c),t.addEventListener("mouseover",c),t.addEventListener("blur",h),t.addEventListener("keyup",d),t.addEventListener("keydown",d),t.addEventListener("keypress",d),t!==window&&(window.addEventListener("blur",h),window.addEventListener("keyup",d),window.addEventListener("keydown",d),window.addEventListener("keypress",d)))}g();var y={element:t};return Object.defineProperties(y,{enabled:{get:function(){return s},set:function(e){e?g():s&&(s=!1,t.removeEventListener("mousemove",f),t.removeEventListener("mousedown",p),t.removeEventListener("mouseup",m),t.removeEventListener("mouseleave",c),t.removeEventListener("mouseenter",c),t.removeEventListener("mouseout",c),t.removeEventListener("mouseover",c),t.removeEventListener("blur",h),t.removeEventListener("keyup",d),t.removeEventListener("keydown",d),t.removeEventListener("keypress",d),t!==window&&(window.removeEventListener("blur",h),window.removeEventListener("keyup",d),window.removeEventListener("keydown",d),window.removeEventListener("keypress",d)))},enumerable:!0},buttons:{get:function(){return r},enumerable:!0},x:{get:function(){return a},enumerable:!0},y:{get:function(){return i},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),y};var n=t("mouse-event")},{"mouse-event":437}],436:[function(t,e,r){var n={left:0,top:0};e.exports=function(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var a,i=t.clientX||0,o=t.clientY||0,s=(a=e)===window||a===document||a===document.body?n:a.getBoundingClientRect();return r[0]=i-s.left,r[1]=o-s.top,r}},{}],437:[function(t,e,r){function n(t){return t.target||t.srcElement||window}r.buttons=function(t){if("object"==typeof t){if("buttons"in t)return t.buttons;if("which"in t){if(2===(e=t.which))return 4;if(3===e)return 2;if(e>0)return 1<<e-1}else if("button"in t){var e;if(1===(e=t.button))return 4;if(2===e)return 2;if(e>=0)return 1<<e}}return 0},r.element=n,r.x=function(t){if("object"==typeof t){if("offsetX"in t)return t.offsetX;var e=n(t).getBoundingClientRect();return t.clientX-e.left}return 0},r.y=function(t){if("object"==typeof t){if("offsetY"in t)return t.offsetY;var e=n(t).getBoundingClientRect();return t.clientY-e.top}return 0}},{}],438:[function(t,e,r){var n=t("to-px");e.exports=function(t,e,r){"function"==typeof t&&(r=!!e,e=t,t=window);var a=n("ex",t),i=function(t){r&&t.preventDefault();var n=t.deltaX||0,i=t.deltaY||0,o=t.deltaZ||0,s=1;switch(t.deltaMode){case 1:s=a;break;case 2:s=window.innerHeight}if(i*=s,o*=s,(n*=s)||i||o)return e(n,i,o,t)};return t.addEventListener("wheel",i),i}},{"to-px":539}],439:[function(t,e,r){var n=t("typedarray-pool");function a(t){return"a"+t}function i(t){return"d"+t}function o(t,e){return"c"+t+"_"+e}function s(t){return"s"+t}function l(t,e){return"t"+t+"_"+e}function u(t){return"o"+t}function c(t){return"x"+t}function h(t){return"p"+t}function d(t,e){return"d"+t+"_"+e}function f(t){return"i"+t}function p(t,e){return"u"+t+"_"+e}function m(t){return"b"+t}function g(t){return"y"+t}function y(t){return"e"+t}function v(t){return"v"+t}e.exports=function(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 L=t.arrayArguments||1;L<1&&e("Must have at least one array argument");var A=t.scalarArguments||0;A<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 S=t.getters||[],E=new Array(L),C=0;C<L;++C)S.indexOf(C)>=0?E[C]=!0:E[C]=!1;return function(t,e,r,L,A,S){var E=S.length,C=A.length;if(C<2)throw new Error("ndarray-extract-contour: Dimension must be at least 2");for(var D="extractContour"+A.join("_"),P=[],O=[],z=[],I=0;I<E;++I)z.push(a(I));for(I=0;I<L;++I)z.push(c(I));for(I=0;I<C;++I)O.push(s(I)+"="+a(0)+".shape["+I+"]|0");for(I=0;I<E;++I){O.push(i(I)+"="+a(I)+".data",u(I)+"="+a(I)+".offset|0");for(var R=0;R<C;++R)O.push(l(I,R)+"="+a(I)+".stride["+R+"]|0")}for(I=0;I<E;++I)for(O.push(h(I)+"="+u(I)),O.push(o(I,0)),R=1;R<1<<C;++R){for(var F=[],N=0;N<C;++N)R&1<<N&&F.push("-"+l(I,N));O.push(d(I,R)+"=("+F.join("")+")|0"),O.push(o(I,R)+"=0")}for(I=0;I<E;++I)for(R=0;R<C;++R){var Y=[l(I,A[R])];R>0&&Y.push(l(I,A[R-1])+"*"+s(A[R-1])),O.push(p(I,A[R])+"=("+Y.join("-")+")|0")}for(I=0;I<C;++I)O.push(f(I)+"=0");O.push(b+"=0");var j=["2"];for(I=C-2;I>=0;--I)j.push(s(A[I]));for(O.push(w+"=("+j.join("*")+")|0",x+"=mallocUint32("+w+")",_+"=mallocUint32("+w+")",M+"=0"),O.push(m(0)+"=0"),R=1;R<1<<C;++R){var B=[],H=[];for(N=0;N<C;++N)R&1<<N&&(0===H.length?B.push("1"):B.unshift(H.join("*"))),H.push(s(A[N]));var U="";B[0].indexOf(s(A[C-2]))<0&&(U="-");var V=T(C,R,A);O.push(y(V)+"=(-"+B.join("-")+")|0",g(V)+"=("+U+B.join("-")+")|0",m(V)+"=0")}function W(t,e){P.push("for(",f(A[t]),"=",e,";",f(A[t]),"<",s(A[t]),";","++",f(A[t]),"){")}function G(t){for(var e=0;e<E;++e)P.push(h(e),"+=",p(e,A[t]),";");P.push("}")}function q(){for(var t=1;t<1<<C;++t)P.push(k,"=",y(t),";",y(t),"=",g(t),";",g(t),"=",k,";")}O.push(v(0)+"=0",k+"=0"),function t(e,r){if(e<0)!function(t){for(var e=0;e<E;++e)S[e]?P.push(o(e,0),"=",i(e),".get(",h(e),");"):P.push(o(e,0),"=",i(e),"[",h(e),"];");var r=[];for(e=0;e<E;++e)r.push(o(e,0));for(e=0;e<L;++e)r.push(c(e));P.push(m(0),"=",x,"[",M,"]=phase(",r.join(),");");for(var n=1;n<1<<C;++n)P.push(m(n),"=",x,"[",M,"+",y(n),"];");var a=[];for(n=1;n<1<<C;++n)a.push("("+m(0)+"!=="+m(n)+")");P.push("if(",a.join("||"),"){");var s=[];for(e=0;e<C;++e)s.push(f(e));for(e=0;e<E;++e)for(s.push(o(e,0)),n=1;n<1<<C;++n)S[e]?P.push(o(e,n),"=",i(e),".get(",h(e),"+",d(e,n),");"):P.push(o(e,n),"=",i(e),"[",h(e),"+",d(e,n),"];"),s.push(o(e,n));for(e=0;e<1<<C;++e)s.push(m(e));for(e=0;e<L;++e)s.push(c(e));P.push("vertex(",s.join(),");",v(0),"=",_,"[",M,"]=",b,"++;");var l=(1<<C)-1,u=m(l);for(n=0;n<C;++n)if(0==(t&~(1<<n))){for(var p=l^1<<n,g=m(p),w=[],k=p;k>0;k=k-1&p)w.push(_+"["+M+"+"+y(k)+"]");for(w.push(v(0)),k=0;k<E;++k)1&n?w.push(o(k,l),o(k,p)):w.push(o(k,p),o(k,l));for(1&n?w.push(u,g):w.push(g,u),k=0;k<L;++k)w.push(c(k));P.push("if(",u,"!==",g,"){","face(",w.join(),")}")}P.push("}",M,"+=1;")}(r);else{!function(t){for(var e=t-1;e>=0;--e)W(e,0);var r=[];for(e=0;e<E;++e)S[e]?r.push(i(e)+".get("+h(e)+")"):r.push(i(e)+"["+h(e)+"]");for(e=0;e<L;++e)r.push(c(e));for(P.push(x,"[",M,"++]=phase(",r.join(),");"),e=0;e<t;++e)G(e);for(var n=0;n<E;++n)P.push(h(n),"+=",p(n,A[t]),";")}(e),P.push("if(",s(A[e]),">0){",f(A[e]),"=1;"),t(e-1,r|1<<A[e]);for(var n=0;n<E;++n)P.push(h(n),"+=",p(n,A[e]),";");e===C-1&&(P.push(M,"=0;"),q()),W(e,2),t(e-1,r),e===C-1&&(P.push("if(",f(A[C-1]),"&1){",M,"=0;}"),q()),G(e),P.push("}")}}(C-1,0),P.push("freeUint32(",_,");freeUint32(",x,");");var Z=["'use strict';","function ",D,"(",z.join(),"){","var ",O.join(),";",P.join(""),"}","return ",D].join("");return new Function("vertex","face","phase","mallocUint32","freeUint32",Z)(t,e,r,n.mallocUint32,n.freeUint32)}(t.vertex,t.cell,t.phase,A,r,E)};var _="V",x="P",b="N",w="Q",M="X",k="T";function T(t,e,r){for(var n=0,a=0;a<t;++a)e&1<<a&&(n|=1<<r[a]);return n}},{"typedarray-pool":545}],440:[function(t,e,r){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":149}],441:[function(t,e,r){e.exports=function(t,e,r){if(Array.isArray(r)){if(r.length!==e.dimension)throw new Error("ndarray-gradient: invalid boundary conditions")}else r=n(e.dimension,"string"==typeof r?r:"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 a=0;a<e.dimension;++a)if(t.shape[a]!==e.shape[a])throw new Error("ndarray-gradient: shape mismatch");return 0===e.size?t:e.dimension<=0?(t.set(0),t):function(t){var e=t.join();if(y=o[e])return y;var r=t.length,n=["function gradient(dst,src){var s=src.shape.slice();"];function a(e){for(var a=r-e.length,i=[],o=[],s=[],l=0;l<r;++l)e.indexOf(l+1)>=0?s.push("0"):e.indexOf(-(l+1))>=0?s.push("s["+l+"]-1"):(s.push("-1"),i.push("1"),o.push("s["+l+"]-2"));var u=".lo("+i.join()+").hi("+o.join()+")";if(0===i.length&&(u=""),a>0){for(n.push("if(1"),l=0;l<r;++l)e.indexOf(l+1)>=0||e.indexOf(-(l+1))>=0||n.push("&&s[",l,"]>2");for(n.push("){grad",a,"(src.pick(",s.join(),")",u),l=0;l<r;++l)e.indexOf(l+1)>=0||e.indexOf(-(l+1))>=0||n.push(",dst.pick(",s.join(),",",l,")",u);n.push(");")}for(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 d=s.slice(),f=s.slice();e[l]<0?d[c]="s["+c+"]-2":f[c]="1",0===a?n.push("if(s[",c,"]>1){dst.set(",s.join(),",",c,",0.5*(src.get(",d.join(),")-src.get(",f.join(),")))}else{dst.set(",s.join(),",",c,",0)};"):n.push("if(s[",c,"]>1){diff(",h,",src.pick(",d.join(),")",u,",src.pick(",f.join(),")",u,");}else{zero(",h,");};");break;case"mirror":0===a?n.push("dst.set(",s.join(),",",c,",0);"):n.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===a?n.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)};"):n.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")}}a>0&&n.push("};")}for(var s=0;s<1<<r;++s){for(var h=[],d=0;d<r;++d)s&1<<d&&h.push(d+1);for(var f=0;f<1<<h.length;++f){var p=h.slice();for(d=0;d<h.length;++d)f&1<<d&&(p[d]=-p[d]);a(p)}}n.push("return dst;};return gradient");var m=["diff","zero"],g=[l,u];for(s=1;s<=r;++s)m.push("grad"+s),g.push(c(s));m.push(n.join(""));var y=Function.apply(void 0,m).apply(void 0,g);return i[e]=y,y}(r)(t,e)};var n=t("dup"),a=t("cwise-compiler"),i={},o={},s={body:"",args:[],thisVars:[],localVars:[]},l=a({args:["array","array","array"],pre:s,post:s,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"}),u=a({args:["array"],pre:s,post:s,body:{args:[{name:"out",lvalue:!0,rvalue:!1,count:1}],body:"out=0",thisVars:[],localVars:[]},funcName:"zero"});function c(t){if(t in i)return i[t];for(var e=[],r=0;r<t;++r)e.push("out",r,"s=0.5*(inp",r,"l-inp",r,"r);");var o=["array"],l=["junk"];for(r=0;r<t;++r){o.push("array"),l.push("out"+r+"s");var u=n(t);u[r]=-1,o.push({array:0,offset:u.slice()}),u[r]=1,o.push({array:0,offset:u.slice()}),l.push("inp"+r+"l","inp"+r+"r")}return i[t]=a({args:o,pre:s,post:s,body:{body:e.join(""),args:l.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})}},{"cwise-compiler":146,dup:170}],442:[function(t,e,r){var n=t("ndarray-warp"),a=t("gl-matrix-invert");e.exports=function(t,e,r){var i=e.dimension,o=a([],r);return n(t,e,(function(t,e){for(var r=0;r<i;++r){t[r]=o[(i+1)*i+r];for(var n=0;n<i;++n)t[r]+=o[(i+1)*n+r]*e[n]}var a=o[(i+1)*(i+1)-1];for(n=0;n<i;++n)a+=o[(i+1)*n+i]*e[n];var s=1/a;for(r=0;r<i;++r)t[r]*=s;return t})),t}},{"gl-matrix-invert":277,"ndarray-warp":449}],443:[function(t,e,r){function n(t,e){var r=Math.floor(e),n=e-r,a=0<=r&&r<t.shape[0],i=0<=r+1&&r+1<t.shape[0];return(1-n)*(a?+t.get(r):0)+n*(i?+t.get(r+1):0)}function a(t,e,r){var n=Math.floor(e),a=e-n,i=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=i&&u?t.get(n,s):0,d=i&&c?t.get(n,s+1):0;return(1-l)*((1-a)*h+a*(o&&u?t.get(n+1,s):0))+l*((1-a)*d+a*(o&&c?t.get(n+1,s+1):0))}function i(t,e,r,n){var a=Math.floor(e),i=e-a,o=0<=a&&a<t.shape[0],s=0<=a+1&&a+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],d=Math.floor(n),f=n-d,p=0<=d&&d<t.shape[2],m=0<=d+1&&d+1<t.shape[2],g=o&&c&&p?t.get(a,l,d):0,y=o&&h&&p?t.get(a,l+1,d):0,v=s&&c&&p?t.get(a+1,l,d):0,_=s&&h&&p?t.get(a+1,l+1,d):0,x=o&&c&&m?t.get(a,l,d+1):0,b=o&&h&&m?t.get(a,l+1,d+1):0;return(1-f)*((1-u)*((1-i)*g+i*v)+u*((1-i)*y+i*_))+f*((1-u)*((1-i)*x+i*(s&&c&&m?t.get(a+1,l,d+1):0))+u*((1-i)*b+i*(s&&h&&m?t.get(a+1,l+1,d+1):0)))}e.exports=function(t,e,r,o){switch(t.shape.length){case 0:return 0;case 1:return n(t,e);case 2:return a(t,e,r);case 3:return i(t,e,r,o);default:return function(t){var e,r,n=0|t.shape.length,a=new Array(n),i=new Array(n),o=new Array(n),s=new Array(n);for(e=0;e<n;++e)r=+arguments[e+1],a[e]=Math.floor(r),i[e]=r-a[e],o[e]=0<=a[e]&&a[e]<t.shape[e],s[e]=0<=a[e]+1&&a[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*=i[l],c+=t.stride[l]*(a[l]+1)}else{if(!o[l])continue t;u*=1-i[l],c+=t.stride[l]*a[l]}h+=u*t.data[c]}return h}.apply(void 0,arguments)}},e.exports.d1=n,e.exports.d2=a,e.exports.d3=i},{}],444:[function(t,e,r){var n=t("cwise-compiler"),a={body:"",args:[],thisVars:[],localVars:[]};function i(t){if(!t)return a;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 o(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(""))(function(t){return n({args:t.args,pre:i(t.pre),body:i(t.body),post:i(t.proc),funcName:t.funcName})}(t))}var s={add:"+",sub:"-",mul:"*",div:"/",mod:"%",band:"&",bor:"|",bxor:"^",lshift:"<<",rshift:">>",rrshift:">>>"};!function(){for(var t in s){var e=s[t];r[t]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a"+e+"=b"},rvalue:!0,funcName:t+"eq"}),r[t+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a"+e+"=s"},rvalue:!0,funcName:t+"seq"})}}();var l={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in l){var e=l[t];r[t]=o({args:["array","array"],body:{args:["a","b"],body:"a="+e+"b"},funcName:t}),r[t+"eq"]=o({args:["array"],body:{args:["a"],body:"a="+e+"a"},rvalue:!0,count:2,funcName:t+"eq"})}}();var u={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in u){var e=u[t];r[t]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a=a"+e+"b"},rvalue:!0,count:2,funcName:t+"eq"}),r[t+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+e+"s"},rvalue:!0,count:2,funcName:t+"seq"})}}();var c=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;t<c.length;++t){var e=c[t];r[e]=o({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"]=o({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 h=["max","min","atan2","pow"];!function(){for(var t=0;t<h.length;++t){var e=h[t];r[e]=o({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"]=o({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"]=o({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"]=o({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"]=o({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"]=o({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"]=o({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"]=o({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=n({args:["array"],pre:a,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=n({args:["array"],pre:a,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=n({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=n({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=n({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=n({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=n({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=n({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=n({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=n({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=n({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=n({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=o({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=o({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=o({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=n({args:["array","array"],pre:a,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":146}],445:[function(t,e,r){var n=t("ndarray"),a=t("./doConvert.js");e.exports=function(t,e){for(var r=[],i=t,o=1;Array.isArray(i);)r.push(i.length),o*=i.length,i=i[0];return 0===r.length?n():(e||(e=n(new Float64Array(o),r)),a(e,t),e)}},{"./doConvert.js":446,ndarray:450}],446:[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":146}],447:[function(t,e,r){var n=t("typedarray-pool"),a=32;function i(t){switch(t){case"uint8":return[n.mallocUint8,n.freeUint8];case"uint16":return[n.mallocUint16,n.freeUint16];case"uint32":return[n.mallocUint32,n.freeUint32];case"int8":return[n.mallocInt8,n.freeInt8];case"int16":return[n.mallocInt16,n.freeInt16];case"int32":return[n.mallocInt32,n.freeInt32];case"float32":return[n.mallocFloat,n.freeFloat];case"float64":return[n.mallocDouble,n.freeDouble];default:return null}}function o(t){for(var e=[],r=0;r<t;++r)e.push("s"+r);for(r=0;r<t;++r)e.push("n"+r);for(r=1;r<t;++r)e.push("d"+r);for(r=1;r<t;++r)e.push("e"+r);for(r=1;r<t;++r)e.push("f"+r);return e}e.exports=function(t,e){var r=["'use strict'"],n=["ndarraySortWrapper",t.join("d"),e].join("");r.push(["function ",n,"(",["array"].join(","),"){"].join(""));for(var s=["data=array.data,offset=array.offset|0,shape=array.shape,stride=array.stride"],l=0;l<t.length;++l)s.push(["s",l,"=stride[",l,"]|0,n",l,"=shape[",l,"]|0"].join(""));var u=new Array(t.length),c=[];for(l=0;l<t.length;++l)0!==(f=t[l])&&(0===c.length?u[f]="1":u[f]=c.join("*"),c.push("n"+f));var h=-1,d=-1;for(l=0;l<t.length;++l){var f,p=t[l];0!==p&&(h>0?s.push(["d",p,"=s",p,"-d",h,"*n",h].join("")):s.push(["d",p,"=s",p].join("")),h=p),0!=(f=t.length-1-l)&&(d>0?s.push(["e",f,"=s",f,"-e",d,"*n",d,",f",f,"=",u[f],"-f",d,"*n",d].join("")):s.push(["e",f,"=s",f,",f",f,"=",u[f]].join("")),d=f)}r.push("var "+s.join(","));var m=["0","n0-1","data","offset"].concat(o(t.length));r.push(["if(n0<=",a,"){","insertionSort(",m.join(","),")}else{","quickSort(",m.join(","),")}"].join("")),r.push("}return "+n);var g=new Function("insertionSort","quickSort",r.join("\n")),y=function(t,e){var r=["'use strict'"],n=["ndarrayInsertionSort",t.join("d"),e].join(""),a=["left","right","data","offset"].concat(o(t.length)),s=i(e),l=["i,j,cptr,ptr=left*s0+offset"];if(t.length>1){for(var u=[],c=1;c<t.length;++c)l.push("i"+c),u.push("n"+c);s?l.push("scratch=malloc("+u.join("*")+")"):l.push("scratch=new Array("+u.join("*")+")"),l.push("dptr","sptr","a","b")}else l.push("scratch");function h(t){return"generic"===e?["data.get(",t,")"].join(""):["data[",t,"]"].join("")}function d(t,r){return"generic"===e?["data.set(",t,",",r,")"].join(""):["data[",t,"]=",r].join("")}if(r.push(["function ",n,"(",a.join(","),"){var ",l.join(",")].join(""),"for(i=left+1;i<=right;++i){","j=i;ptr+=s0","cptr=ptr"),t.length>1){for(r.push("dptr=0;sptr=ptr"),c=t.length-1;c>=0;--c)0!==(f=t[c])&&r.push(["for(i",f,"=0;i",f,"<n",f,";++i",f,"){"].join(""));for(r.push("scratch[dptr++]=",h("sptr")),c=0;c<t.length;++c)0!==(f=t[c])&&r.push("sptr+=d"+f,"}");for(r.push("__g:while(j--\x3eleft){","dptr=0","sptr=cptr-s0"),c=1;c<t.length;++c)1===c&&r.push("__l:"),r.push(["for(i",c,"=0;i",c,"<n",c,";++i",c,"){"].join(""));for(r.push(["a=",h("sptr"),"\nb=scratch[dptr]\nif(a<b){break __g}\nif(a>b){break __l}"].join("")),c=t.length-1;c>=1;--c)r.push("sptr+=e"+c,"dptr+=f"+c,"}");for(r.push("dptr=cptr;sptr=cptr-s0"),c=t.length-1;c>=0;--c)0!==(f=t[c])&&r.push(["for(i",f,"=0;i",f,"<n",f,";++i",f,"){"].join(""));for(r.push(d("dptr",h("sptr"))),c=0;c<t.length;++c)0!==(f=t[c])&&r.push(["dptr+=d",f,";sptr+=d",f].join(""),"}");for(r.push("cptr-=s0\n}"),r.push("dptr=cptr;sptr=0"),c=t.length-1;c>=0;--c)0!==(f=t[c])&&r.push(["for(i",f,"=0;i",f,"<n",f,";++i",f,"){"].join(""));for(r.push(d("dptr","scratch[sptr++]")),c=0;c<t.length;++c){var f;0!==(f=t[c])&&r.push("dptr+=d"+f,"}")}}else r.push("scratch="+h("ptr"),"while((j--\x3eleft)&&("+h("cptr-s0")+">scratch)){",d("cptr",h("cptr-s0")),"cptr-=s0","}",d("cptr","scratch"));return r.push("}"),t.length>1&&s&&r.push("free(scratch)"),r.push("} return "+n),s?new Function("malloc","free",r.join("\n"))(s[0],s[1]):new Function(r.join("\n"))()}(t,e),v=function(t,e,r){var n=["'use strict'"],s=["ndarrayQuickSort",t.join("d"),e].join(""),l=["left","right","data","offset"].concat(o(t.length)),u=i(e),c=0;n.push(["function ",s,"(",l.join(","),"){"].join(""));var h=["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 d=[],f=1;f<t.length;++f)d.push("n"+f),h.push("i"+f);for(f=0;f<8;++f)h.push("b_ptr"+f);h.push("ptr3","ptr4","ptr5","ptr6","ptr7","pivot_ptr","ptr_shift","elementSize="+d.join("*")),u?h.push("pivot1=malloc(elementSize)","pivot2=malloc(elementSize)"):h.push("pivot1=new Array(elementSize),pivot2=new Array(elementSize)")}else h.push("pivot1","pivot2");function p(t){return["(offset+",t,"*s0)"].join("")}function m(t){return"generic"===e?["data.get(",t,")"].join(""):["data[",t,"]"].join("")}function g(t,r){return"generic"===e?["data.set(",t,",",r,")"].join(""):["data[",t,"]=",r].join("")}function y(e,r,a){if(1===e.length)n.push("ptr0="+p(e[0]));else for(var i=0;i<e.length;++i)n.push(["b_ptr",i,"=s0*",e[i]].join(""));for(r&&n.push("pivot_ptr=0"),n.push("ptr_shift=offset"),i=t.length-1;i>=0;--i)0!==(o=t[i])&&n.push(["for(i",o,"=0;i",o,"<n",o,";++i",o,"){"].join(""));if(e.length>1)for(i=0;i<e.length;++i)n.push(["ptr",i,"=b_ptr",i,"+ptr_shift"].join(""));for(n.push(a),r&&n.push("++pivot_ptr"),i=0;i<t.length;++i){var o;0!==(o=t[i])&&(e.length>1?n.push("ptr_shift+=d"+o):n.push("ptr0+=d"+o),n.push("}"))}}function v(e,r,a,i){if(1===r.length)n.push("ptr0="+p(r[0]));else{for(var o=0;o<r.length;++o)n.push(["b_ptr",o,"=s0*",r[o]].join(""));n.push("ptr_shift=offset")}for(a&&n.push("pivot_ptr=0"),e&&n.push(e+":"),o=1;o<t.length;++o)n.push(["for(i",o,"=0;i",o,"<n",o,";++i",o,"){"].join(""));if(r.length>1)for(o=0;o<r.length;++o)n.push(["ptr",o,"=b_ptr",o,"+ptr_shift"].join(""));for(n.push(i),o=t.length-1;o>=1;--o)a&&n.push("pivot_ptr+=f"+o),r.length>1?n.push("ptr_shift+=e"+o):n.push("ptr0+=e"+o),n.push("}")}function _(){t.length>1&&u&&n.push("free(pivot1)","free(pivot2)")}function x(e,r){var a="el"+e,i="el"+r;if(t.length>1){var o="__l"+ ++c;v(o,[a,i],!1,["comp=",m("ptr0"),"-",m("ptr1"),"\n","if(comp>0){tmp0=",a,";",a,"=",i,";",i,"=tmp0;break ",o,"}\n","if(comp<0){break ",o,"}"].join(""))}else n.push(["if(",m(p(a)),">",m(p(i)),"){tmp0=",a,";",a,"=",i,";",i,"=tmp0}"].join(""))}function b(e,r){t.length>1?y([e,r],!1,g("ptr0",m("ptr1"))):n.push(g(p(e),m(p(r))))}function w(e,r,a){if(t.length>1){var i="__l"+ ++c;v(i,[r],!0,[e,"=",m("ptr0"),"-pivot",a,"[pivot_ptr]\n","if(",e,"!==0){break ",i,"}"].join(""))}else n.push([e,"=",m(p(r)),"-pivot",a].join(""))}function M(e,r){t.length>1?y([e,r],!1,["tmp=",m("ptr0"),"\n",g("ptr0",m("ptr1")),"\n",g("ptr1","tmp")].join("")):n.push(["ptr0=",p(e),"\n","ptr1=",p(r),"\n","tmp=",m("ptr0"),"\n",g("ptr0",m("ptr1")),"\n",g("ptr1","tmp")].join(""))}function k(e,r,a){t.length>1?(y([e,r,a],!1,["tmp=",m("ptr0"),"\n",g("ptr0",m("ptr1")),"\n",g("ptr1",m("ptr2")),"\n",g("ptr2","tmp")].join("")),n.push("++"+r,"--"+a)):n.push(["ptr0=",p(e),"\n","ptr1=",p(r),"\n","ptr2=",p(a),"\n","++",r,"\n","--",a,"\n","tmp=",m("ptr0"),"\n",g("ptr0",m("ptr1")),"\n",g("ptr1",m("ptr2")),"\n",g("ptr2","tmp")].join(""))}function T(t,e){M(t,e),n.push("--"+e)}function L(e,r,a){t.length>1?y([e,r],!0,[g("ptr0",m("ptr1")),"\n",g("ptr1",["pivot",a,"[pivot_ptr]"].join(""))].join("")):n.push(g(p(e),m(p(r))),g(p(r),"pivot"+a))}function A(e,r){n.push(["if((",r,"-",e,")<=",a,"){\n","insertionSort(",e,",",r,",data,offset,",o(t.length).join(","),")\n","}else{\n",s,"(",e,",",r,",data,offset,",o(t.length).join(","),")\n","}"].join(""))}function S(e,r,a){t.length>1?(n.push(["__l",++c,":while(true){"].join("")),y([e],!0,["if(",m("ptr0"),"!==pivot",r,"[pivot_ptr]){break __l",c,"}"].join("")),n.push(a,"}")):n.push(["while(",m(p(e)),"===pivot",r,"){",a,"}"].join(""))}return n.push("var "+h.join(",")),x(1,2),x(4,5),x(1,3),x(2,3),x(1,4),x(3,4),x(2,5),x(2,3),x(4,5),t.length>1?y(["el1","el2","el3","el4","el5","index1","index3","index5"],!0,["pivot1[pivot_ptr]=",m("ptr1"),"\n","pivot2[pivot_ptr]=",m("ptr3"),"\n","pivots_are_equal=pivots_are_equal&&(pivot1[pivot_ptr]===pivot2[pivot_ptr])\n","x=",m("ptr0"),"\n","y=",m("ptr2"),"\n","z=",m("ptr4"),"\n",g("ptr5","x"),"\n",g("ptr6","y"),"\n",g("ptr7","z")].join("")):n.push(["pivot1=",m(p("el2")),"\n","pivot2=",m(p("el4")),"\n","pivots_are_equal=pivot1===pivot2\n","x=",m(p("el1")),"\n","y=",m(p("el3")),"\n","z=",m(p("el5")),"\n",g(p("index1"),"x"),"\n",g(p("index3"),"y"),"\n",g(p("index5"),"z")].join("")),b("index2","left"),b("index4","right"),n.push("if(pivots_are_equal){"),n.push("for(k=less;k<=great;++k){"),w("comp","k",1),n.push("if(comp===0){continue}"),n.push("if(comp<0){"),n.push("if(k!==less){"),M("k","less"),n.push("}"),n.push("++less"),n.push("}else{"),n.push("while(true){"),w("comp","great",1),n.push("if(comp>0){"),n.push("great--"),n.push("}else if(comp<0){"),k("k","less","great"),n.push("break"),n.push("}else{"),T("k","great"),n.push("break"),n.push("}"),n.push("}"),n.push("}"),n.push("}"),n.push("}else{"),n.push("for(k=less;k<=great;++k){"),w("comp_pivot1","k",1),n.push("if(comp_pivot1<0){"),n.push("if(k!==less){"),M("k","less"),n.push("}"),n.push("++less"),n.push("}else{"),w("comp_pivot2","k",2),n.push("if(comp_pivot2>0){"),n.push("while(true){"),w("comp","great",2),n.push("if(comp>0){"),n.push("if(--great<k){break}"),n.push("continue"),n.push("}else{"),w("comp","great",1),n.push("if(comp<0){"),k("k","less","great"),n.push("}else{"),T("k","great"),n.push("}"),n.push("break"),n.push("}"),n.push("}"),n.push("}"),n.push("}"),n.push("}"),n.push("}"),L("left","(less-1)",1),L("right","(great+1)",2),A("left","(less-2)"),A("(great+2)","right"),n.push("if(pivots_are_equal){"),_(),n.push("return"),n.push("}"),n.push("if(less<index1&&great>index5){"),S("less",1,"++less"),S("great",2,"--great"),n.push("for(k=less;k<=great;++k){"),w("comp_pivot1","k",1),n.push("if(comp_pivot1===0){"),n.push("if(k!==less){"),M("k","less"),n.push("}"),n.push("++less"),n.push("}else{"),w("comp_pivot2","k",2),n.push("if(comp_pivot2===0){"),n.push("while(true){"),w("comp","great",2),n.push("if(comp===0){"),n.push("if(--great<k){break}"),n.push("continue"),n.push("}else{"),w("comp","great",1),n.push("if(comp<0){"),k("k","less","great"),n.push("}else{"),T("k","great"),n.push("}"),n.push("break"),n.push("}"),n.push("}"),n.push("}"),n.push("}"),n.push("}"),n.push("}"),_(),A("less","great"),n.push("}return "+s),t.length>1&&u?new Function("insertionSort","malloc","free",n.join("\n"))(r,u[0],u[1]):new Function("insertionSort",n.join("\n"))(r)}(t,e,y);return g(y,v)}},{"typedarray-pool":545}],448:[function(t,e,r){var n=t("./lib/compile_sort.js"),a={};e.exports=function(t){var e=t.order,r=t.dtype,i=[e,r].join(":"),o=a[i];return o||(a[i]=o=n(e,r)),o(t),t}},{"./lib/compile_sort.js":447}],449:[function(t,e,r){var n=t("ndarray-linear-interpolate"),a=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=new Array(_inline_3_arg4_)}",args:[{name:"_inline_3_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_3_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_3_arg2_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_3_arg3_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_3_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_4_arg2_(this_warped,_inline_4_arg0_),_inline_4_arg1_=_inline_4_arg3_.apply(void 0,this_warped)}",args:[{name:"_inline_4_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_4_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_4_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_4_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_4_arg4_",lvalue:!1,rvalue:!1,count:0}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warpND",blockSize:64}),i=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_7_arg2_(this_warped,_inline_7_arg0_),_inline_7_arg1_=_inline_7_arg3_(_inline_7_arg4_,this_warped[0])}",args:[{name:"_inline_7_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_7_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_7_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_7_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_7_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_10_arg2_(this_warped,_inline_10_arg0_),_inline_10_arg1_=_inline_10_arg3_(_inline_10_arg4_,this_warped[0],this_warped[1])}",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:!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_13_arg2_(this_warped,_inline_13_arg0_),_inline_13_arg1_=_inline_13_arg3_(_inline_13_arg4_,this_warped[0],this_warped[1],this_warped[2])}",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:"warp3D",blockSize:64});e.exports=function(t,e,r){switch(e.shape.length){case 1:i(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:a(t,r,n.bind(void 0,e),e.shape.length)}return t}},{"cwise/lib/wrapper":149,"ndarray-linear-interpolate":443}],450:[function(t,e,r){var n=t("iota-array"),a=t("is-buffer"),i="undefined"!=typeof Float64Array;function o(t,e){return t[0]-e[0]}function s(){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(o);var n=new Array(r.length);for(t=0;t<n.length;++t)n[t]=r[t][1];return n}function l(t,e){var r=["View",e,"d",t].join("");e<0&&(r="View_Nil"+t);var a="generic"===t;if(-1===e){var i="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);}";return new Function(i)()}if(0===e)return i="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 "+(a?"this.data.get(this.offset)":"this.data[this.offset]")+"};proto.set=function "+r+"_set(v){return "+(a?"this.data.set(this.offset,v)":"this.data[this.offset]=v")+"};return function construct_"+r+"(a,b,c,d){return new "+r+"(a,d)}",new Function("TrivialArray",i)(u[t][0]);i=["'use strict'"];var o=n(e),l=o.map((function(t){return"i"+t})),c="this.offset+"+o.map((function(t){return"this.stride["+t+"]*i"+t})).join("+"),h=o.map((function(t){return"b"+t})).join(","),d=o.map((function(t){return"c"+t})).join(",");i.push("function "+r+"(a,"+h+","+d+",d){this.data=a","this.shape=["+h+"]","this.stride=["+d+"]","this.offset=d|0}","var proto="+r+".prototype","proto.dtype='"+t+"'","proto.dimension="+e),i.push("Object.defineProperty(proto,'size',{get:function "+r+"_size(){return "+o.map((function(t){return"this.shape["+t+"]"})).join("*"),"}})"),1===e?i.push("proto.order=[0]"):(i.push("Object.defineProperty(proto,'order',{get:"),e<4?(i.push("function "+r+"_order(){"),2===e?i.push("return (Math.abs(this.stride[0])>Math.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===e&&i.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];}}})")):i.push("ORDER})")),i.push("proto.set=function "+r+"_set("+l.join(",")+",v){"),a?i.push("return this.data.set("+c+",v)}"):i.push("return this.data["+c+"]=v}"),i.push("proto.get=function "+r+"_get("+l.join(",")+"){"),a?i.push("return this.data.get("+c+")}"):i.push("return this.data["+c+"]}"),i.push("proto.index=function "+r+"_index(",l.join(),"){return "+c+"}"),i.push("proto.hi=function "+r+"_hi("+l.join(",")+"){return new "+r+"(this.data,"+o.map((function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")})).join(",")+","+o.map((function(t){return"this.stride["+t+"]"})).join(",")+",this.offset)}");var f=o.map((function(t){return"a"+t+"=this.shape["+t+"]"})),p=o.map((function(t){return"c"+t+"=this.stride["+t+"]"}));i.push("proto.lo=function "+r+"_lo("+l.join(",")+"){var b=this.offset,d=0,"+f.join(",")+","+p.join(","));for(var m=0;m<e;++m)i.push("if(typeof i"+m+"==='number'&&i"+m+">=0){d=i"+m+"|0;b+=c"+m+"*d;a"+m+"-=d}");for(i.push("return new "+r+"(this.data,"+o.map((function(t){return"a"+t})).join(",")+","+o.map((function(t){return"c"+t})).join(",")+",b)}"),i.push("proto.step=function "+r+"_step("+l.join(",")+"){var "+o.map((function(t){return"a"+t+"=this.shape["+t+"]"})).join(",")+","+o.map((function(t){return"b"+t+"=this.stride["+t+"]"})).join(",")+",c=this.offset,d=0,ceil=Math.ceil"),m=0;m<e;++m)i.push("if(typeof i"+m+"==='number'){d=i"+m+"|0;if(d<0){c+=b"+m+"*(a"+m+"-1);a"+m+"=ceil(-a"+m+"/d)}else{a"+m+"=ceil(a"+m+"/d)}b"+m+"*=d}");i.push("return new "+r+"(this.data,"+o.map((function(t){return"a"+t})).join(",")+","+o.map((function(t){return"b"+t})).join(",")+",c)}");var g=new Array(e),y=new Array(e);for(m=0;m<e;++m)g[m]="a[i"+m+"]",y[m]="b[i"+m+"]";for(i.push("proto.transpose=function "+r+"_transpose("+l+"){"+l.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)}"),i.push("proto.pick=function "+r+"_pick("+l+"){var a=[],b=[],c=this.offset"),m=0;m<e;++m)i.push("if(typeof i"+m+"==='number'&&i"+m+">=0){c=(c+this.stride["+m+"]*i"+m+")|0}else{a.push(this.shape["+m+"]);b.push(this.stride["+m+"])}");return i.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),i.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+o.map((function(t){return"shape["+t+"]"})).join(",")+","+o.map((function(t){return"stride["+t+"]"})).join(",")+",offset)}"),new Function("CTOR_LIST","ORDER",i.join("\n"))(u[t],s)}var u={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};e.exports=function(t,e,r,n){if(void 0===t)return(0,u.array[0])([]);"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var o=e.length;if(void 0===r){r=new Array(o);for(var s=o-1,c=1;s>=0;--s)r[s]=c,c*=e[s]}if(void 0===n)for(n=0,s=0;s<o;++s)r[s]<0&&(n-=(e[s]-1)*r[s]);for(var h=function(t){if(a(t))return"buffer";if(i)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"}(t),d=u[h];d.length<=o+1;)d.push(l(h,d.length-1));return(0,d[o+1])(t,e,r,n)}},{"iota-array":416,"is-buffer":418}],451:[function(t,e,r){var n=t("double-bits"),a=Math.pow(2,-1074),i=-1>>>0;e.exports=function(t,e){if(isNaN(t)||isNaN(e))return NaN;if(t===e)return t;if(0===t)return e<0?-a:a;var r=n.hi(t),o=n.lo(t);return e>t==t>0?o===i?(r+=1,o=0):o+=1:0===o?(o=i,r-=1):o-=1,n.pack(o,r)}},{"double-bits":167}],452:[function(t,e,r){var n=Math.PI,a=u(120);function i(t,e,r,n){return["C",t,e,r,n,r,n]}function o(t,e,r,n,a,i){return["C",t/3+2/3*r,e/3+2/3*n,a/3+2/3*r,i/3+2/3*n,a,i]}function s(t,e,r,i,o,u,c,h,d,f){if(f)M=f[0],k=f[1],b=f[2],w=f[3];else{var p=l(t,e,-o);t=p.x,e=p.y;var m=(t-(h=(p=l(h,d,-o)).x))/2,g=(e-(d=p.y))/2,y=m*m/(r*r)+g*g/(i*i);y>1&&(r*=y=Math.sqrt(y),i*=y);var v=r*r,_=i*i,x=(u==c?-1:1)*Math.sqrt(Math.abs((v*_-v*g*g-_*m*m)/(v*g*g+_*m*m)));x==1/0&&(x=1);var b=x*r*g/i+(t+h)/2,w=x*-i*m/r+(e+d)/2,M=Math.asin(((e-w)/i).toFixed(9)),k=Math.asin(((d-w)/i).toFixed(9));(M=t<b?n-M:M)<0&&(M=2*n+M),(k=h<b?n-k:k)<0&&(k=2*n+k),c&&M>k&&(M-=2*n),!c&&k>M&&(k-=2*n)}if(Math.abs(k-M)>a){var T=k,L=h,A=d;k=M+a*(c&&k>M?1:-1);var S=s(h=b+r*Math.cos(k),d=w+i*Math.sin(k),r,i,o,0,c,L,A,[k,T,b,w])}var E=Math.tan((k-M)/4),C=4/3*r*E,D=4/3*i*E,P=[2*t-(t+C*Math.sin(M)),2*e-(e-D*Math.cos(M)),h+C*Math.sin(k),d-D*Math.cos(k),h,d];if(f)return P;S&&(P=P.concat(S));for(var O=0;O<P.length;){var z=l(P[O],P[O+1],o);P[O++]=z.x,P[O++]=z.y}return P}function l(t,e,r){return{x:t*Math.cos(r)-e*Math.sin(r),y:t*Math.sin(r)+e*Math.cos(r)}}function u(t){return t*(n/180)}e.exports=function(t){for(var e,r=[],n=0,a=0,l=0,c=0,h=null,d=null,f=0,p=0,m=0,g=t.length;m<g;m++){var y=t[m],v=y[0];switch(v){case"M":l=y[1],c=y[2];break;case"A":(y=s(f,p,y[1],y[2],u(y[3]),y[4],y[5],y[6],y[7])).unshift("C"),y.length>7&&(r.push(y.splice(0,7)),y.unshift("C"));break;case"S":var _=f,x=p;"C"!=e&&"S"!=e||(_+=_-n,x+=x-a),y=["C",_,x,y[1],y[2],y[3],y[4]];break;case"T":"Q"==e||"T"==e?(h=2*f-h,d=2*p-d):(h=f,d=p),y=o(f,p,h,d,y[1],y[2]);break;case"Q":h=y[1],d=y[2],y=o(f,p,y[1],y[2],y[3],y[4]);break;case"L":y=i(f,p,y[1],y[2]);break;case"H":y=i(f,p,y[1],p);break;case"V":y=i(f,p,f,y[1]);break;case"Z":y=i(f,p,l,c)}e=v,f=y[y.length-2],p=y[y.length-1],y.length>4?(n=y[y.length-4],a=y[y.length-3]):(n=f,a=p),r.push(y)}return r}},{}],453:[function(t,e,r){r.vertexNormals=function(t,e,r){for(var n=e.length,a=new Array(n),i=void 0===r?1e-6:r,o=0;o<n;++o)a[o]=[0,0,0];for(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 d=e[l],f=e[u],p=e[c],m=new Array(3),g=0,y=new Array(3),v=0,_=0;_<3;++_)m[_]=d[_]-f[_],g+=m[_]*m[_],y[_]=p[_]-f[_],v+=y[_]*y[_];if(g*v>i){var x=a[u],b=1/Math.sqrt(g*v);for(_=0;_<3;++_){var w=(_+1)%3,M=(_+2)%3;x[_]+=b*(y[w]*m[M]-y[M]*m[w])}}}for(o=0;o<n;++o){x=a[o];var k=0;for(_=0;_<3;++_)k+=x[_]*x[_];if(k>i)for(b=1/Math.sqrt(k),_=0;_<3;++_)x[_]*=b;else for(_=0;_<3;++_)x[_]=0}return a},r.faceNormals=function(t,e,r){for(var n=t.length,a=new Array(n),i=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]];var c=new Array(3),h=new Array(3);for(u=0;u<3;++u)c[u]=l[1][u]-l[0][u],h[u]=l[2][u]-l[0][u];var d=new Array(3),f=0;for(u=0;u<3;++u){var p=(u+1)%3,m=(u+2)%3;d[u]=c[p]*h[m]-c[m]*h[p],f+=d[u]*d[u]}for(f=f>i?1/Math.sqrt(f):0,u=0;u<3;++u)d[u]*=f;a[o]=d}return a}},{}],454:[function(t,e,r){var n=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,i=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,o,s=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),l=1;l<arguments.length;l++){for(var u in r=Object(arguments[l]))a.call(r,u)&&(s[u]=r[u]);if(n){o=n(r);for(var c=0;c<o.length;c++)i.call(r,o[c])&&(s[o[c]]=r[o[c]])}}return s}},{}],455:[function(t,e,r){e.exports=function(t,e,r,n,a,i,o,s,l,u){var c=e+i+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-i)/h,t[3]=.5*h}else{var d=Math.max(e,i,u);h=Math.sqrt(2*d-c+1),e>=d?(t[0]=.5*h,t[1]=.5*(a+r)/h,t[2]=.5*(s+n)/h,t[3]=.5*(o-l)/h):i>=d?(t[0]=.5*(r+a)/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-a)/h)}return t}},{}],456:[function(t,e,r){e.exports=function(t){var e=(t=t||{}).center||[0,0,0],r=t.rotation||[0,0,0,1],n=t.radius||1;e=[].slice.call(e,0,3),c(r=[].slice.call(r,0,4),r);var a=new h(r,e,Math.log(n));return a.setDistanceLimits(t.zoomMin,t.zoomMax),("eye"in t||"up"in t)&&a.lookAt(0,t.eye,t.center,t.up),a};var n=t("filtered-vector"),a=t("gl-mat4/lookAt"),i=t("gl-mat4/fromQuat"),o=t("gl-mat4/invert"),s=t("./lib/quatFromFrame");function l(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function u(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function c(t,e){var r=e[0],n=e[1],a=e[2],i=e[3],o=u(r,n,a,i);o>1e-6?(t[0]=r/o,t[1]=n/o,t[2]=a/o,t[3]=i/o):(t[0]=t[1]=t[2]=0,t[3]=1)}function h(t,e,r){this.radius=n([r]),this.center=n(e),this.rotation=n(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)}var d=h.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;c(e,e);var r=this.computedMatrix;i(r,e);var n=this.computedCenter,a=this.computedEye,o=this.computedUp,s=Math.exp(this.computedRadius[0]);a[0]=n[0]+s*r[2],a[1]=n[1]+s*r[6],a[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]*a[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,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var a=this.computedMatrix,i=a[1],o=a[5],s=a[9],u=l(i,o,s);i/=u,o/=u,s/=u;var c=a[0],h=a[4],d=a[8],f=c*i+h*o+d*s,p=l(c-=i*f,h-=o*f,d-=s*f);c/=p,h/=p,d/=p;var m=a[2],g=a[6],y=a[10],v=m*i+g*o+y*s,_=m*c+g*h+y*d,x=l(m-=v*i+_*c,g-=v*o+_*h,y-=v*s+_*d);m/=x,g/=x,y/=x;var b=c*e+i*r,w=h*e+o*r,M=d*e+s*r;this.center.move(t,b,w,M);var k=Math.exp(this.computedRadius[0]);k=Math.max(1e-4,k+n),this.radius.set(t,Math.log(k))},d.rotate=function(t,e,r,n){this.recalcMatrix(t),e=e||0,r=r||0;var a=this.computedMatrix,i=a[0],o=a[4],s=a[8],c=a[1],h=a[5],d=a[9],f=a[2],p=a[6],m=a[10],g=e*i+r*c,y=e*o+r*h,v=e*s+r*d,_=-(p*v-m*y),x=-(m*g-f*v),b=-(f*y-p*g),w=Math.sqrt(Math.max(0,1-Math.pow(_,2)-Math.pow(x,2)-Math.pow(b,2))),M=u(_,x,b,w);M>1e-6?(_/=M,x/=M,b/=M,w/=M):(_=x=b=0,w=1);var k=this.computedRotation,T=k[0],L=k[1],A=k[2],S=k[3],E=T*w+S*_+L*b-A*x,C=L*w+S*x+A*_-T*b,D=A*w+S*b+T*x-L*_,P=S*w-T*_-L*x-A*b;if(n){_=f,x=p,b=m;var O=Math.sin(n)/l(_,x,b);_*=O,x*=O,b*=O,P=P*(w=Math.cos(e))-(E=E*w+P*_+C*b-D*x)*_-(C=C*w+P*x+D*_-E*b)*x-(D=D*w+P*b+E*x-C*_)*b}var z=u(E,C,D,P);z>1e-6?(E/=z,C/=z,D/=z,P/=z):(E=C=D=0,P=1),this.rotation.set(t,E,C,D,P)},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;a(i,e,r,n);var o=this.computedRotation;s(o,i[0],i[1],i[2],i[4],i[5],i[6],i[8],i[9],i[10]),c(o,o),this.rotation.set(t,o[0],o[1],o[2],o[3]);for(var l=0,u=0;u<3;++u)l+=Math.pow(r[u]-e[u],2);this.radius.set(t,.5*Math.log(Math.max(l,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;s(r,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),c(r,r),this.rotation.set(t,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;o(n,e);var a=n[15];if(Math.abs(a)>1e-6){var i=n[12]/a,l=n[13]/a,u=n[14]/a;this.recalcMatrix(t);var h=Math.exp(this.computedRadius[0]);this.center.set(t,i-n[2]*h,l-n[6]*h,u-n[10]*h),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 a=t.distance;a&&a>0&&this.radius.set(e,Math.log(a)),this.setDistanceLimits(t.zoomMin,t.zoomMax)}},{"./lib/quatFromFrame":455,"filtered-vector":226,"gl-mat4/fromQuat":262,"gl-mat4/invert":265,"gl-mat4/lookAt":266}],457:[function(t,e,r){var n=t("repeat-string");e.exports=function(t,e,r){return n(r=void 0!==r?r+"":" ",e)+t}},{"repeat-string":503}],458:[function(t,e,r){function n(t,e){if("string"!=typeof t)return[t];var r=[t];"string"==typeof e||Array.isArray(e)?e={brackets:e}:e||(e={});var n=e.brackets?Array.isArray(e.brackets)?e.brackets:[e.brackets]:["{}","[]","()"],a=e.escape||"___",i=!!e.flat;n.forEach((function(t){var e=new RegExp(["\\",t[0],"[^\\",t[0],"\\",t[1],"]*\\",t[1]].join("")),n=[];function i(e,i,o){var s=r.push(e.slice(t[0].length,-t[1].length))-1;return n.push(s),a+s+a}r.forEach((function(t,n){for(var a,o=0;t!=a;)if(a=t,t=t.replace(e,i),o++>1e4)throw Error("References have circular dependency. Please, check them.");r[n]=t})),n=n.reverse(),r=r.map((function(e){return n.forEach((function(r){e=e.replace(new RegExp("(\\"+a+r+"\\"+a+")","g"),t[0]+"$1"+t[1])})),e}))}));var o=new RegExp("\\"+a+"([0-9]+)\\"+a);return i?r:function t(e,r,n){for(var a,i=[],s=0;a=o.exec(e);){if(s++>1e4)throw Error("Circular references in parenthesis");i.push(e.slice(0,a.index)),i.push(t(r[a[1]],r)),e=e.slice(a.index+a[0].length)}return i.push(e),i}(r[0],r)}function a(t,e){if(e&&e.flat){var r,n=e&&e.escape||"___",a=t[0];if(!a)return"";for(var i=new RegExp("\\"+n+"([0-9]+)\\"+n),o=0;a!=r;){if(o++>1e4)throw Error("Circular references in "+t);r=a,a=a.replace(i,s)}return a}return t.reduce((function t(e,r){return Array.isArray(r)&&(r=r.reduce(t,"")),e+r}),"");function s(e,r){if(null==t[r])throw Error("Reference "+r+"is undefined");return t[r]}}function i(t,e){return Array.isArray(t)?a(t,e):n(t,e)}i.parse=n,i.stringify=a,e.exports=i},{}],459:[function(t,e,r){var n=t("pick-by-alias");e.exports=function(t){var e;return arguments.length>1&&(t=arguments),"string"==typeof t?t=t.split(/\s/).map(parseFloat):"number"==typeof t&&(t=[t]),t.length&&"number"==typeof t[0]?e=1===t.length?{width:t[0],height:t[0],x:0,y:0}:2===t.length?{width:t[0],height:t[1],x:0,y:0}:{x:t[0],y:t[1],width:t[2]-t[0]||0,height:t[3]-t[1]||0}:t&&(e={x:(t=n(t,{left:"x l left Left",top:"y t top Top",width:"w width W Width",height:"h height W Width",bottom:"b bottom Bottom",right:"r right Right"})).left||0,y:t.top||0},null==t.width?t.right?e.width=t.right-e.x:e.width=0:e.width=t.width,null==t.height?t.bottom?e.height=t.bottom-e.y:e.height=0:e.height=t.height),e}},{"pick-by-alias":465}],460:[function(t,e,r){e.exports=function(t){var e=[];return t.replace(a,(function(t,r,a){var o=r.toLowerCase();for(a=function(t){var e=t.match(i);return e?e.map(Number):[]}(a),"m"==o&&a.length>2&&(e.push([r].concat(a.splice(0,2))),o="l",r="m"==r?"l":"L");;){if(a.length==n[o])return a.unshift(r),e.push(a);if(a.length<n[o])throw new Error("malformed path data");e.push([r].concat(a.splice(0,n[o])))}})),e};var n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},a=/([astvzqmhlc])([^astvzqmhlc]*)/gi,i=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi},{}],461:[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}},{}],462:[function(t,e,r){(function(t){(function(){var r,n,a,i,o,s;"undefined"!=typeof performance&&null!==performance&&performance.now?e.exports=function(){return performance.now()}:null!=t&&t.hrtime?(e.exports=function(){return(r()-o)/1e6},n=t.hrtime,i=(r=function(){var t;return 1e9*(t=n())[0]+t[1]})(),s=1e9*t.uptime(),o=i-s):Date.now?(e.exports=function(){return Date.now()-a},a=Date.now()):(e.exports=function(){return(new Date).getTime()-a},a=(new Date).getTime())}).call(this)}).call(this,t("_process"))},{_process:482}],463:[function(t,e,r){e.exports=function(t){var e=t.length;if(e<n){for(var r=1,i=0;i<e;++i)for(var o=0;o<i;++o)if(t[i]<t[o])r=-r;else if(t[i]===t[o])return 0;return r}var s=a.mallocUint8(e);for(i=0;i<e;++i)s[i]=0;for(r=1,i=0;i<e;++i)if(!s[i]){var l=1;for(s[i]=1,o=t[i];o!==i;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};var n=32,a=t("typedarray-pool")},{"typedarray-pool":545}],464:[function(t,e,r){var n=t("typedarray-pool"),a=t("invert-permutation");r.rank=function(t){var e=t.length;switch(e){case 0:case 1:return 0;case 2:return t[1]}var r,i,o,s=n.mallocUint32(e),l=n.mallocUint32(e),u=0;for(a(t,l),o=0;o<e;++o)s[o]=t[o];for(o=e-1;o>0;--o)i=l[o],r=s[o],s[o]=s[i],s[i]=r,l[o]=l[r],l[r]=i,u=(u+r)*o;return n.freeUint32(l),n.freeUint32(s),u},r.unrank=function(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]}var n,a,i,o=1;for((r=r||new Array(t))[0]=0,i=1;i<t;++i)r[i]=i,o=o*i|0;for(i=t-1;i>0;--i)e=e-(n=e/o|0)*o|0,o=o/i|0,a=0|r[i],r[i]=0|r[n],r[n]=0|a;return r}},{"invert-permutation":415,"typedarray-pool":545}],465:[function(t,e,r){e.exports=function(t,e,r){var n,i,o={};if("string"==typeof e&&(e=a(e)),Array.isArray(e)){var s={};for(i=0;i<e.length;i++)s[e[i]]=!0;e=s}for(n in e)e[n]=a(e[n]);var l={};for(n in e){var u=e[n];if(Array.isArray(u))for(i=0;i<u.length;i++){var c=u[i];if(r&&(l[c]=!0),c in t){if(o[n]=t[c],r)for(var h=i;h<u.length;h++)l[u[h]]=!0;break}}else n in t&&(e[n]&&(o[n]=t[n]),r&&(l[n]=!0))}if(r)for(n in t)l[n]||(o[n]=t[n]);return o};var n={};function a(t){return n[t]?n[t]:("string"==typeof t&&(t=n[t]=t.split(/\s*,\s*|\s+/)),t)}},{}],466:[function(t,e,r){e.exports=function(t,e){for(var r=0|e.length,a=t.length,i=[new Array(r),new Array(r)],o=0;o<r;++o)i[0][o]=[],i[1][o]=[];for(o=0;o<a;++o){var s=t[o];i[0][s[0]].push(s),i[1][s[1]].push(s)}var l=[];for(o=0;o<r;++o)i[0][o].length+i[1][o].length===0&&l.push([o]);function u(t,e){var r=i[e][t[e]];r.splice(r.indexOf(t),1)}function c(t,r,a){for(var o,s,l,c=0;c<2;++c)if(i[c][r].length>0){o=i[c][r][0],l=c;break}s=o[1^l];for(var h=0;h<2;++h)for(var d=i[h][r],f=0;f<d.length;++f){var p=d[f],m=p[1^h];n(e[t],e[r],e[s],e[m])>0&&(o=p,s=m,l=h)}return a||o&&u(o,l),s}function h(t,r){var a=i[r][t][0],o=[t];u(a,r);for(var s=a[1^r];;){for(;s!==t;)o.push(s),s=c(o[o.length-2],s,!1);if(i[0][t].length+i[1][t].length===0)break;var l=o[o.length-1],h=t,d=o[1],f=c(l,h,!0);if(n(e[l],e[h],e[d],e[f])<0)break;o.push(t),s=c(l,h)}return o}function d(t,e){return e[1]===e[e.length-1]}for(o=0;o<r;++o)for(var f=0;f<2;++f){for(var p=[];i[f][o].length>0;){i[0][o].length;var m=h(o,f);d(0,m)?p.push.apply(p,m):(p.length>0&&l.push(p),p=m)}p.length>0&&l.push(p)}return l};var n=t("compare-angle")},{"compare-angle":127}],467:[function(t,e,r){e.exports=function(t,e){for(var r=n(t,e.length),a=new Array(e.length),i=new Array(e.length),o=[],s=0;s<e.length;++s){var l=r[s].length;i[s]=l,a[s]=!0,l<=1&&o.push(s)}for(;o.length>0;){a[f=o.pop()]=!1;var u=r[f];for(s=0;s<u.length;++s){var c=u[s];0==--i[c]&&o.push(c)}}var h=new Array(e.length),d=[];for(s=0;s<e.length;++s)if(a[s]){var f=d.length;h[s]=f,d.push(e[s])}else h[s]=-1;var p=[];for(s=0;s<t.length;++s){var m=t[s];a[m[0]]&&a[m[1]]&&p.push([h[m[0]],h[m[1]]])}return[p,d]};var n=t("edges-to-adjacency-list")},{"edges-to-adjacency-list":171}],468:[function(t,e,r){e.exports=function(t,e){t=(F=u(t,e))[0];for(var r=(e=F[1]).length,h=(t.length,n(t,e.length)),d=0;d<r;++d)if(h[d].length%2==1)throw new Error("planar-graph-to-polyline: graph must be manifold");var f=a(t,e),p=(f=f.filter((function(t){for(var r=t.length,n=[0],a=0;a<r;++a){var i=e[t[a]],l=e[t[(a+1)%r]],u=o(-i[0],i[1]),c=o(-i[0],l[1]),h=o(l[0],i[1]),d=o(l[0],l[1]);n=s(n,s(s(u,c),s(h,d)))}return n[n.length-1]>0}))).length,m=new Array(p),g=new Array(p);for(d=0;d<p;++d){m[d]=d;var y=new Array(p),v=f[d].map((function(t){return e[t]})),_=i([v]),x=0;t:for(var b=0;b<p;++b)if(y[b]=0,d!==b){for(var w=(U=f[b]).length,M=0;M<w;++M){var k=_(e[U[M]]);if(0!==k){k<0&&(y[b]=1,x+=1);continue t}}y[b]=1,x+=1}g[d]=[x,d,y]}for(g.sort((function(t,e){return e[0]-t[0]})),d=0;d<p;++d){var T=(y=g[d])[1],L=y[2];for(b=0;b<p;++b)L[b]&&(m[b]=T)}var A=function(t){for(var e=new Array(t),r=0;r<t;++r)e[r]=[];return e}(p);for(d=0;d<p;++d)A[d].push(m[d]),A[m[d]].push(d);var S={},E=c(r,!1);for(d=0;d<p;++d)for(w=(U=f[d]).length,b=0;b<w;++b){var C=U[b],D=U[(b+1)%w],P=Math.min(C,D)+":"+Math.max(C,D);if(P in S){var O=S[P];A[O].push(d),A[d].push(O),E[C]=E[D]=!0}else S[P]=d}function z(t){for(var e=t.length,r=0;r<e;++r)if(!E[t[r]])return!1;return!0}var I=[],R=c(p,-1);for(d=0;d<p;++d)m[d]!==d||z(f[d])?R[d]=-1:(I.push(d),R[d]=0);for(var F=[];I.length>0;){var N=I.pop(),Y=A[N];l(Y,(function(t,e){return t-e}));var j,B=Y.length,H=R[N];for(0===H&&(j=[U=f[N]]),d=0;d<B;++d){var U,V=Y[d];R[V]>=0||(R[V]=1^H,I.push(V),0!==H)||z(U=f[V])||(U.reverse(),j.push(U))}0===H&&F.push(j)}return F};var n=t("edges-to-adjacency-list"),a=t("planar-dual"),i=t("point-in-big-polygon"),o=t("two-product"),s=t("robust-sum"),l=t("uniq"),u=t("./lib/trim-leaves");function c(t,e){for(var r=new Array(t),n=0;n<t;++n)r[n]=e;return r}},{"./lib/trim-leaves":467,"edges-to-adjacency-list":171,"planar-dual":466,"point-in-big-polygon":472,"robust-sum":515,"two-product":543,uniq:547}],469:[function(t,e,r){e.exports=t("./quad")},{"./quad":471}],470:[function(t,e,r){arguments[4][111][0].apply(r,arguments)},{dup:111}],471:[function(t,e,r){var n=t("binary-search-bounds"),a=t("clamp"),i=t("parse-rect"),o=t("array-bounds"),s=t("pick-by-alias"),l=t("defined"),u=t("flatten-vertex-data"),c=t("is-obj"),h=t("dtype"),d=t("math-log2");function f(t,e){for(var r=e[0],n=e[1],i=1/(e[2]-r),o=1/(e[3]-n),s=new Array(t.length),l=0,u=t.length/2;l<u;l++)s[2*l]=a((t[2*l]-r)*i,0,1),s[2*l+1]=a((t[2*l+1]-n)*o,0,1);return s}e.exports=function(t,e){e||(e={}),t=u(t,"float64"),e=s(e,{bounds:"range bounds dataBox databox",maxDepth:"depth maxDepth maxdepth level maxLevel maxlevel levels",dtype:"type dtype format out dst output destination"});var r=l(e.maxDepth,255),a=l(e.bounds,o(t,2));a[0]===a[2]&&a[2]++,a[1]===a[3]&&a[3]++;var p,m=f(t,a),g=t.length>>>1;e.dtype||(e.dtype="array"),"string"==typeof e.dtype?p=new(h(e.dtype))(g):e.dtype&&(p=e.dtype,Array.isArray(p)&&(p.length=g));for(var y=0;y<g;++y)p[y]=y;var v=[],_=[],x=[],b=[];!function t(e,n,a,i,o,s){if(!i.length)return null;var l=v[o]||(v[o]=[]),u=x[o]||(x[o]=[]),c=_[o]||(_[o]=[]),h=l.length;if(++o>r){for(var d=0;d<i.length;d++)l.push(i[d]),u.push(s),c.push(null,null,null,null);return h}if(l.push(i[0]),u.push(s),i.length<=1)return c.push(null,null,null,null),h;for(var f=.5*a,p=e+f,g=n+f,y=[],b=[],w=[],M=[],k=1,T=i.length;k<T;k++){var L=i[k],A=m[2*L],S=m[2*L+1];A<p?S<g?y.push(L):b.push(L):S<g?w.push(L):M.push(L)}return s<<=2,c.push(t(e,n,f,y,o,s),t(e,g,f,b,o,s+1),t(p,n,f,w,o,s+2),t(p,g,f,M,o,s+3)),h}(0,0,1,p,0,1);for(var w=0,M=0;M<v.length;M++){var k=v[M];if(p.set)p.set(k,w);else for(var T=0,L=k.length;T<L;T++)p[T+w]=k[T];var A=w+v[M].length;b[M]=[w,A],w=A}return p.range=function(){for(var e,r=[],o=arguments.length;o--;)r[o]=arguments[o];if(c(r[r.length-1])){var u=r.pop();r.length||null==u.x&&null==u.l&&null==u.left||(r=[u],e={}),e=s(u,{level:"level maxLevel",d:"d diam diameter r radius px pxSize pixel pixelSize maxD size minSize",lod:"lod details ranges offsets"})}else e={};r.length||(r=a);var h,p=i.apply(void 0,r),m=[Math.min(p.x,p.x+p.width),Math.min(p.y,p.y+p.height),Math.max(p.x,p.x+p.width),Math.max(p.y,p.y+p.height)],g=m[0],y=m[1],w=m[2],M=m[3],k=f([g,y,w,M],a),T=k[0],L=k[1],A=k[2],E=k[3],C=l(e.level,v.length);if(null!=e.d&&("number"==typeof e.d?h=[e.d,e.d]:e.d.length&&(h=e.d),C=Math.min(Math.max(Math.ceil(-d(Math.abs(h[0])/(a[2]-a[0]))),Math.ceil(-d(Math.abs(h[1])/(a[3]-a[1])))),C)),C=Math.min(C,v.length),e.lod)return function(t,e,r,a,i){for(var o=[],s=0;s<i;s++){var l=x[s],u=b[s][0],c=S(t,e,s),h=S(r,a,s),d=n.ge(l,c),f=n.gt(l,h,d,l.length-1);o[s]=[d+u,f+u]}return o}(T,L,A,E,C);var D=[];return function e(r,n,a,i,o,s){if(null!==o&&null!==s&&!(T>r+a||L>n+a||A<r||E<n||i>=C||o===s)){var l=v[i];void 0===s&&(s=l.length);for(var u=o;u<s;u++){var c=l[u],h=t[2*c],d=t[2*c+1];h>=g&&h<=w&&d>=y&&d<=M&&D.push(c)}var f=_[i],p=f[4*o+0],m=f[4*o+1],x=f[4*o+2],b=f[4*o+3],k=function(t,e){for(var r=null,n=0;null===r;)if(r=t[4*e+n],++n>t.length)return null;return r}(f,o+1),S=.5*a,P=i+1;e(r,n,S,P,p,m||x||b||k),e(r,n+S,S,P,m,x||b||k),e(r+S,n,S,P,x,b||k),e(r+S,n+S,S,P,b,k)}}(0,0,1,0,0,1),D},p;function S(t,e,r){for(var n=1,a=.5,i=.5,o=.5,s=0;s<r;s++)n<<=2,n+=t<a?e<i?0:1:e<i?2:3,o*=.5,a+=t<a?-o:o,i+=e<i?-o:o;return n}}},{"array-bounds":65,"binary-search-bounds":470,clamp:115,defined:164,dtype:169,"flatten-vertex-data":227,"is-obj":421,"math-log2":432,"parse-rect":459,"pick-by-alias":465}],472:[function(t,e,r){e.exports=function(t){for(var e=t.length,r=[],i=[],s=0;s<e;++s)for(var c=t[s],h=c.length,d=h-1,f=0;f<h;d=f++){var p=c[d],m=c[f];p[0]===m[0]?i.push([p,m]):r.push([p,m])}if(0===r.length)return 0===i.length?u:(g=l(i),function(t){return g(t[0],t[1])?0:1});var g,y=a(r),v=function(t,e){return function(r){var a=o.le(e,r[0]);if(a<0)return 1;var i=t[a];if(!i){if(!(a>0&&e[a]===r[0]))return 1;i=t[a-1]}for(var s=1;i;){var l=i.key,u=n(r,l[0],l[1]);if(l[0][0]<l[1][0])if(u<0)i=i.left;else{if(!(u>0))return 0;s=-1,i=i.right}else if(u>0)i=i.left;else{if(!(u<0))return 0;s=1,i=i.right}}return s}}(y.slabs,y.coordinates);return 0===i.length?v:function(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}(l(i),v)};var n=t("robust-orientation")[3],a=t("slab-decomposition"),i=t("interval-tree-1d"),o=t("binary-search-bounds");function s(){return!0}function l(t){for(var e={},r=0;r<t.length;++r){var n=t[r],a=n[0][0],o=n[0][1],l=n[1][1],u=[Math.min(o,l),Math.max(o,l)];a in e?e[a].push(u):e[a]=[u]}var c={},h=Object.keys(e);for(r=0;r<h.length;++r){var d=e[h[r]];c[h[r]]=i(d)}return function(t){return function(e,r){var n=t[e];return!!n&&!!n.queryPoint(r,s)}}(c)}function u(t){return 1}},{"binary-search-bounds":91,"interval-tree-1d":414,"robust-orientation":510,"slab-decomposition":526}],473:[function(t,e,r){var n,a=t("./lib/build-log"),i=t("./lib/epsilon"),o=t("./lib/intersecter"),s=t("./lib/segment-chainer"),l=t("./lib/segment-selector"),u=t("./lib/geojson"),c=!1,h=i();function d(t,e,r){var a=n.segments(t),i=n.segments(e),o=r(n.combine(a,i));return n.polygon(o)}n={buildLog:function(t){return!0===t?c=a():!1===t&&(c=!1),!1!==c&&c.list},epsilon:function(t){return h.epsilon(t)},segments:function(t){var e=o(!0,h,c);return t.regions.forEach(e.addRegion),{segments:e.calculate(t.inverted),inverted:t.inverted}},combine:function(t,e){return{combined:o(!1,h,c).calculate(t.segments,t.inverted,e.segments,e.inverted),inverted1:t.inverted,inverted2:e.inverted}},selectUnion:function(t){return{segments:l.union(t.combined,c),inverted:t.inverted1||t.inverted2}},selectIntersect:function(t){return{segments:l.intersect(t.combined,c),inverted:t.inverted1&&t.inverted2}},selectDifference:function(t){return{segments:l.difference(t.combined,c),inverted:t.inverted1&&!t.inverted2}},selectDifferenceRev:function(t){return{segments:l.differenceRev(t.combined,c),inverted:!t.inverted1&&t.inverted2}},selectXor:function(t){return{segments:l.xor(t.combined,c),inverted:t.inverted1!==t.inverted2}},polygon:function(t){return{regions:s(t.segments,h,c),inverted:t.inverted}},polygonFromGeoJSON:function(t){return u.toPolygon(n,t)},polygonToGeoJSON:function(t){return u.fromPolygon(n,h,t)},union:function(t,e){return d(t,e,n.selectUnion)},intersect:function(t,e){return d(t,e,n.selectIntersect)},difference:function(t,e){return d(t,e,n.selectDifference)},differenceRev:function(t,e){return d(t,e,n.selectDifferenceRev)},xor:function(t,e){return d(t,e,n.selectXor)}},"object"==typeof window&&(window.PolyBool=n),e.exports=n},{"./lib/build-log":474,"./lib/epsilon":475,"./lib/geojson":476,"./lib/intersecter":477,"./lib/segment-chainer":479,"./lib/segment-selector":480}],474:[function(t,e,r){e.exports=function(){var t,e=0,r=!1;function n(e,r){return t.list.push({type:e,data:r?JSON.parse(JSON.stringify(r)):void 0}),t}return t={list:[],segmentId:function(){return e++},checkIntersection:function(t,e){return n("check",{seg1:t,seg2:e})},segmentChop:function(t,e){return n("div_seg",{seg:t,pt:e}),n("chop",{seg:t,pt:e})},statusRemove:function(t){return n("pop_seg",{seg:t})},segmentUpdate:function(t){return n("seg_update",{seg:t})},segmentNew:function(t,e){return n("new_seg",{seg:t,primary:e})},segmentRemove:function(t){return n("rem_seg",{seg:t})},tempStatus:function(t,e,r){return n("temp_status",{seg:t,above:e,below:r})},rewind:function(t){return n("rewind",{seg:t})},status:function(t,e,r){return n("status",{seg:t,above:e,below:r})},vert:function(e){return e===r?t:(r=e,n("vert",{x:e}))},log:function(t){return"string"!=typeof t&&(t=JSON.stringify(t,!1," ")),n("log",{txt:t})},reset:function(){return n("reset")},selected:function(t){return n("selected",{segs:t})},chainStart:function(t){return n("chain_start",{seg:t})},chainRemoveHead:function(t,e){return n("chain_rem_head",{index:t,pt:e})},chainRemoveTail:function(t,e){return n("chain_rem_tail",{index:t,pt:e})},chainNew:function(t,e){return n("chain_new",{pt1:t,pt2:e})},chainMatch:function(t){return n("chain_match",{index:t})},chainClose:function(t){return n("chain_close",{index:t})},chainAddHead:function(t,e){return n("chain_add_head",{index:t,pt:e})},chainAddTail:function(t,e){return n("chain_add_tail",{index:t,pt:e})},chainConnect:function(t,e){return n("chain_con",{index1:t,index2:e})},chainReverse:function(t){return n("chain_rev",{index:t})},chainJoin:function(t,e){return n("chain_join",{index1:t,index2:e})},done:function(){return n("done")}}}},{}],475:[function(t,e,r){e.exports=function(t){"number"!=typeof t&&(t=1e-10);var e={epsilon:function(e){return"number"==typeof e&&(t=e),t},pointAboveOrOnLine:function(e,r,n){var a=r[0],i=r[1],o=n[0],s=n[1],l=e[0];return(o-a)*(e[1]-i)-(s-i)*(l-a)>=-t},pointBetween:function(e,r,n){var a=e[1]-r[1],i=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*i+a*s;return!(l<t||l-(i*i+s*s)>-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])<t},pointsSameY:function(e,r){return Math.abs(e[1]-r[1])<t},pointsSame:function(t,r){return e.pointsSameX(t,r)&&e.pointsSameY(t,r)},pointsCompare:function(t,r){return e.pointsSameX(t,r)?e.pointsSameY(t,r)?0:t[1]<r[1]?-1:1:t[0]<r[0]?-1:1},pointsCollinear:function(e,r,n){var a=e[0]-r[0],i=e[1]-r[1],o=r[0]-n[0],s=r[1]-n[1];return Math.abs(a*s-o*i)<t},linesIntersect:function(e,r,n,a){var i=r[0]-e[0],o=r[1]-e[1],s=a[0]-n[0],l=a[1]-n[1],u=i*l-o*s;if(Math.abs(u)<t)return!1;var c=e[0]-n[0],h=e[1]-n[1],d=(s*h-l*c)/u,f=(i*h-o*c)/u,p={alongA:0,alongB:0,pt:[e[0]+d*i,e[1]+d*o]};return p.alongA=d<=-t?-2:d<t?-1:d-1<=-t?0:d-1<t?1:2,p.alongB=f<=-t?-2:f<t?-1:f-1<=-t?0:f-1<t?1:2,p},pointInsideRegion:function(e,r){for(var n=e[0],a=e[1],i=r[r.length-1][0],o=r[r.length-1][1],s=!1,l=0;l<r.length;l++){var u=r[l][0],c=r[l][1];c-a>t!=o-a>t&&(i-u)*(a-c)/(o-c)+u-n>t&&(s=!s),i=u,o=c}return s}};return e}},{}],476:[function(t,e,r){var n={toPolygon:function(t,e){function r(e){if(e.length<=0)return t.segments({inverted:!1,regions:[]});function r(e){var r=e.slice(0,e.length-1);return t.segments({inverted:!1,regions:[r]})}for(var n=r(e[0]),a=1;a<e.length;a++)n=t.selectDifference(t.combine(n,r(e[a])));return n}if("Polygon"===e.type)return t.polygon(r(e.coordinates));if("MultiPolygon"===e.type){for(var n=t.segments({inverted:!1,regions:[]}),a=0;a<e.coordinates.length;a++)n=t.selectUnion(t.combine(n,r(e.coordinates[a])));return t.polygon(n)}throw new Error("PolyBool: Cannot convert GeoJSON object to PolyBool polygon")},fromPolygon:function(t,e,r){function n(t,r){return e.pointInsideRegion([.5*(t[0][0]+t[1][0]),.5*(t[0][1]+t[1][1])],r)}function a(t){return{region:t,children:[]}}r=t.polygon(t.segments(r));var i=a(null);function o(t,e){for(var r=0;r<t.children.length;r++)if(n(e,(s=t.children[r]).region))return void o(s,e);var i=a(e);for(r=0;r<t.children.length;r++){var s;n((s=t.children[r]).region,e)&&(i.children.push(s),t.children.splice(r,1),r--)}t.children.push(i)}for(var s=0;s<r.regions.length;s++){var l=r.regions[s];l.length<3||o(i,l)}function u(t,e){for(var r=0,n=t[t.length-1][0],a=t[t.length-1][1],i=[],o=0;o<t.length;o++){var s=t[o][0],l=t[o][1];i.push([s,l]),r+=l*n-s*a,n=s,a=l}return r<0!==e&&i.reverse(),i.push([i[0][0],i[0][1]]),i}var c=[];function h(t){var e=[u(t.region,!1)];c.push(e);for(var r=0;r<t.children.length;r++)e.push(d(t.children[r]))}function d(t){for(var e=0;e<t.children.length;e++)h(t.children[e]);return u(t.region,!0)}for(s=0;s<i.children.length;s++)h(i.children[s]);return c.length<=0?{type:"Polygon",coordinates:[]}:1==c.length?{type:"Polygon",coordinates:c[0]}:{type:"MultiPolygon",coordinates:c}}};e.exports=n},{}],477:[function(t,e,r){var n=t("./linked-list");e.exports=function(t,e,r){function a(t,e,n){return{id:r?r.segmentId():-1,start:t,end:e,myFill:{above:n.myFill.above,below:n.myFill.below},otherFill:null}}var i=n.create();function o(t,r){i.insertBefore(t,(function(n){return function(t,r,n,a,i,o){var s=e.pointsCompare(r,i);return 0!==s?s:e.pointsSame(n,o)?0:t!==a?t?1:-1:e.pointAboveOrOnLine(n,a?i:o,a?o:i)?1:-1}(t.isStart,t.pt,r,n.isStart,n.pt,n.other.pt)<0}))}function s(t,e){var r=function(t,e){var r=n.node({isStart:!0,pt:t.start,seg:t,primary:e,other:null,status:null});return o(r,t.end),r}(t,e);return function(t,e,r){var a=n.node({isStart:!1,pt:e.end,seg:e,primary:r,other:t,status:null});t.other=a,o(a,t.pt)}(r,t,e),r}function l(t,e){var n=a(e,t.seg.end,t.seg);return function(t,e){r&&r.segmentChop(t.seg,e),t.other.remove(),t.seg.end=e,t.other.pt=e,o(t.other,t.pt)}(t,e),s(n,t.primary)}function u(a,o){var s=n.create();function u(t){return s.findTransition((function(r){var n,a,i,o,s,l;return n=t,a=r.ev,i=n.seg.start,o=n.seg.end,s=a.seg.start,l=a.seg.end,(e.pointsCollinear(i,s,l)?e.pointsCollinear(o,s,l)||e.pointAboveOrOnLine(o,s,l)?1:-1:e.pointAboveOrOnLine(i,s,l)?1:-1)>0}))}function c(t,n){var a=t.seg,i=n.seg,o=a.start,s=a.end,u=i.start,c=i.end;r&&r.checkIntersection(a,i);var h=e.linesIntersect(o,s,u,c);if(!1===h){if(!e.pointsCollinear(o,s,u))return!1;if(e.pointsSame(o,c)||e.pointsSame(s,u))return!1;var d=e.pointsSame(o,u),f=e.pointsSame(s,c);if(d&&f)return n;var p=!d&&e.pointBetween(o,u,c),m=!f&&e.pointBetween(s,u,c);if(d)return m?l(n,s):l(t,c),n;p&&(f||(m?l(n,s):l(t,c)),l(n,o))}else 0===h.alongA&&(-1===h.alongB?l(t,u):0===h.alongB?l(t,h.pt):1===h.alongB&&l(t,c)),0===h.alongB&&(-1===h.alongA?l(n,o):0===h.alongA?l(n,h.pt):1===h.alongA&&l(n,s));return!1}for(var h=[];!i.isEmpty();){var d=i.getHead();if(r&&r.vert(d.pt[0]),d.isStart){r&&r.segmentNew(d.seg,d.primary);var f=u(d),p=f.before?f.before.ev:null,m=f.after?f.after.ev:null;function g(){if(p){var t=c(d,p);if(t)return t}return!!m&&c(d,m)}r&&r.tempStatus(d.seg,!!p&&p.seg,!!m&&m.seg);var y,v,_=g();if(_&&(t?(v=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below)&&(_.seg.myFill.above=!_.seg.myFill.above):_.seg.otherFill=d.seg.myFill,r&&r.segmentUpdate(_.seg),d.other.remove(),d.remove()),i.getHead()!==d){r&&r.rewind(d.seg);continue}t?(v=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below,d.seg.myFill.below=m?m.seg.myFill.above:a,d.seg.myFill.above=v?!d.seg.myFill.below:d.seg.myFill.below):null===d.seg.otherFill&&(y=m?d.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:d.primary?o:a,d.seg.otherFill={above:y,below:y}),r&&r.status(d.seg,!!p&&p.seg,!!m&&m.seg),d.other.status=f.insert(n.node({ev:d}))}else{var x=d.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(x.prev)&&s.exists(x.next)&&c(x.prev.ev,x.next.ev),r&&r.statusRemove(x.ev.seg),x.remove(),!d.primary){var b=d.seg.myFill;d.seg.myFill=d.seg.otherFill,d.seg.otherFill=b}h.push(d.seg)}i.getHead().remove()}return r&&r.done(),h}return t?{addRegion:function(t){for(var n,a,i,o=t[t.length-1],l=0;l<t.length;l++){n=o,o=t[l];var u=e.pointsCompare(n,o);0!==u&&s((a=u<0?n:o,i=u<0?o:n,{id:r?r.segmentId():-1,start:a,end:i,myFill:{above:null,below:null},otherFill:null}),!0)}},calculate:function(t){return u(t,!1)}}:{calculate:function(t,e,r,n){return t.forEach((function(t){s(a(t.start,t.end,t),!0)})),r.forEach((function(t){s(a(t.start,t.end,t),!1)})),u(e,n)}}}},{"./linked-list":478}],478:[function(t,e,r){e.exports={create:function(){var t={root:{root:!0,next:null},exists:function(e){return null!==e&&e!==t.root},isEmpty:function(){return null===t.root.next},getHead:function(){return t.root.next},insertBefore:function(e,r){for(var n=t.root,a=t.root.next;null!==a;){if(r(a))return e.prev=a.prev,e.next=a,a.prev.next=e,void(a.prev=e);n=a,a=a.next}n.next=e,e.prev=n,e.next=null},findTransition:function(e){for(var r=t.root,n=t.root.next;null!==n&&!e(n);)r=n,n=n.next;return{before:r===t.root?null:r,after:n,insert:function(t){return t.prev=r,t.next=n,r.next=t,null!==n&&(n.prev=t),t}}}};return t},node:function(t){return t.prev=null,t.next=null,t.remove=function(){t.prev.next=t.next,t.next&&(t.next.prev=t.prev),t.prev=null,t.next=null},t}}},{}],479:[function(t,e,r){e.exports=function(t,e,r){var n=[],a=[];return t.forEach((function(t){var i=t.start,o=t.end;if(e.pointsSame(i,o))console.warn("PolyBool: Warning: Zero-length segment detected; your epsilon is probably too small or too large");else{r&&r.chainStart(t);for(var s={index:0,matches_head:!1,matches_pt1:!1},l={index:0,matches_head:!1,matches_pt1:!1},u=s,c=0;c<n.length;c++){var h=(g=n[c])[0],d=(g[1],g[g.length-1]);if(g[g.length-2],e.pointsSame(h,i)){if(k(c,!0,!0))break}else if(e.pointsSame(h,o)){if(k(c,!0,!1))break}else if(e.pointsSame(d,i)){if(k(c,!1,!0))break}else if(e.pointsSame(d,o)&&k(c,!1,!1))break}if(u===s)return n.push([i,o]),void(r&&r.chainNew(i,o));if(u===l){r&&r.chainMatch(s.index);var f=s.index,p=s.matches_pt1?o:i,m=s.matches_head,g=n[f],y=m?g[0]:g[g.length-1],v=m?g[1]:g[g.length-2],_=m?g[g.length-1]:g[0],x=m?g[g.length-2]:g[1];return e.pointsCollinear(v,y,p)&&(m?(r&&r.chainRemoveHead(s.index,p),g.shift()):(r&&r.chainRemoveTail(s.index,p),g.pop()),y=v),e.pointsSame(_,p)?(n.splice(f,1),e.pointsCollinear(x,_,y)&&(m?(r&&r.chainRemoveTail(s.index,y),g.pop()):(r&&r.chainRemoveHead(s.index,y),g.shift())),r&&r.chainClose(s.index),void a.push(g)):void(m?(r&&r.chainAddHead(s.index,p),g.unshift(p)):(r&&r.chainAddTail(s.index,p),g.push(p)))}var b=s.index,w=l.index;r&&r.chainConnect(b,w);var M=n[b].length<n[w].length;s.matches_head?l.matches_head?M?(T(b),L(b,w)):(T(w),L(w,b)):L(w,b):l.matches_head?L(b,w):M?(T(b),L(w,b)):(T(w),L(b,w))}function k(t,e,r){return u.index=t,u.matches_head=e,u.matches_pt1=r,u===s?(u=l,!1):(u=null,!0)}function T(t){r&&r.chainReverse(t),n[t].reverse()}function L(t,a){var i=n[t],o=n[a],s=i[i.length-1],l=i[i.length-2],u=o[0],c=o[1];e.pointsCollinear(l,s,u)&&(r&&r.chainRemoveTail(t,s),i.pop(),s=l),e.pointsCollinear(s,u,c)&&(r&&r.chainRemoveHead(a,u),o.shift()),r&&r.chainJoin(t,a),n[t]=i.concat(o),n.splice(a,1)}})),a}},{}],480:[function(t,e,r){function n(t,e,r){var n=[];return t.forEach((function(t){var a=(t.myFill.above?8:0)+(t.myFill.below?4:0)+(t.otherFill&&t.otherFill.above?2:0)+(t.otherFill&&t.otherFill.below?1:0);0!==e[a]&&n.push({id:r?r.segmentId():-1,start:t.start,end:t.end,myFill:{above:1===e[a],below:2===e[a]},otherFill:null})})),r&&r.selected(n),n}var a={union:function(t,e){return n(t,[0,2,1,0,2,2,0,0,1,0,1,0,0,0,0,0],e)},intersect:function(t,e){return n(t,[0,0,0,0,0,2,0,2,0,0,1,1,0,2,1,0],e)},difference:function(t,e){return n(t,[0,0,0,0,2,0,2,0,1,1,0,0,0,1,2,0],e)},differenceRev:function(t,e){return n(t,[0,2,1,0,0,0,1,1,0,2,0,2,0,0,0,0],e)},xor:function(t,e){return n(t,[0,2,1,0,2,0,0,1,1,0,0,2,0,1,2,0],e)}};e.exports=a},{}],481:[function(t,e,r){var n=new Float64Array(4),a=new Float64Array(4),i=new Float64Array(4);e.exports=function(t,e,r,o,s){n.length<o.length&&(n=new Float64Array(o.length),a=new Float64Array(o.length),i=new Float64Array(o.length));for(var l=0;l<o.length;++l)n[l]=t[l]-o[l],a[l]=e[l]-t[l],i[l]=r[l]-t[l];var u=0,c=0,h=0,d=0,f=0,p=0;for(l=0;l<o.length;++l){var m=a[l],g=i[l],y=n[l];u+=m*m,c+=m*g,h+=g*g,d+=y*m,f+=y*g,p+=y*y}var v,_,x,b,w,M=Math.abs(u*h-c*c),k=c*f-h*d,T=c*d-u*f;if(k+T<=M)if(k<0)T<0&&d<0?(T=0,-d>=u?(k=1,v=u+2*d+p):v=d*(k=-d/u)+p):(k=0,f>=0?(T=0,v=p):-f>=h?(T=1,v=h+2*f+p):v=f*(T=-f/h)+p);else if(T<0)T=0,d>=0?(k=0,v=p):-d>=u?(k=1,v=u+2*d+p):v=d*(k=-d/u)+p;else{var L=1/M;v=(k*=L)*(u*k+c*(T*=L)+2*d)+T*(c*k+h*T+2*f)+p}else k<0?(x=h+f)>(_=c+d)?(b=x-_)>=(w=u-2*c+h)?(k=1,T=0,v=u+2*d+p):v=(k=b/w)*(u*k+c*(T=1-k)+2*d)+T*(c*k+h*T+2*f)+p:(k=0,x<=0?(T=1,v=h+2*f+p):f>=0?(T=0,v=p):v=f*(T=-f/h)+p):T<0?(x=u+d)>(_=c+f)?(b=x-_)>=(w=u-2*c+h)?(T=1,k=0,v=h+2*f+p):v=(k=1-(T=b/w))*(u*k+c*T+2*d)+T*(c*k+h*T+2*f)+p:(T=0,x<=0?(k=1,v=u+2*d+p):d>=0?(k=0,v=p):v=d*(k=-d/u)+p):(b=h+f-c-d)<=0?(k=0,T=1,v=h+2*f+p):b>=(w=u-2*c+h)?(k=1,T=0,v=u+2*d+p):v=(k=b/w)*(u*k+c*(T=1-k)+2*d)+T*(c*k+h*T+2*f)+p;var A=1-k-T;for(l=0;l<o.length;++l)s[l]=A*t[l]+k*e[l]+T*r[l];return v<0?0:v}},{}],482:[function(t,e,r){var n,a,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function l(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{a="function"==typeof clearTimeout?clearTimeout:s}catch(t){a=s}}();var u,c=[],h=!1,d=-1;function f(){h&&u&&(h=!1,u.length?c=u.concat(c):d=-1,c.length&&p())}function p(){if(!h){var t=l(f);h=!0;for(var e=c.length;e;){for(u=c,c=[];++d<e;)u&&u[d].run();d=-1,e=c.length}u=null,h=!1,function(t){if(a===clearTimeout)return clearTimeout(t);if((a===s||!a)&&clearTimeout)return a=clearTimeout,clearTimeout(t);try{a(t)}catch(e){try{return a.call(null,t)}catch(e){return a.call(this,t)}}}(t)}}function m(t,e){this.fun=t,this.array=e}function g(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];c.push(new m(t,e)),1!==c.length||h||l(p)},m.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],483:[function(t,e,r){e.exports=t("gl-quat/slerp")},{"gl-quat/slerp":293}],484:[function(t,e,n){(function(r){for(var n=t("performance-now"),a="undefined"==typeof window?r:window,i=["moz","webkit"],o="AnimationFrame",s=a["request"+o],l=a["cancel"+o]||a["cancelRequest"+o],u=0;!s&&u<i.length;u++)s=a[i[u]+"Request"+o],l=a[i[u]+"Cancel"+o]||a[i[u]+"CancelRequest"+o];if(!s||!l){var c=0,h=0,d=[];s=function(t){if(0===d.length){var e=n(),r=Math.max(0,1e3/60-(e-c));c=r+e,setTimeout((function(){var t=d.slice(0);d.length=0;for(var e=0;e<t.length;e++)if(!t[e].cancelled)try{t[e].callback(c)}catch(t){setTimeout((function(){throw t}),0)}}),Math.round(r))}return d.push({handle:++h,callback:t,cancelled:!1}),h},l=function(t){for(var e=0;e<d.length;e++)d[e].handle===t&&(d[e].cancelled=!0)}}e.exports=function(t){return s.call(a,t)},e.exports.cancel=function(){l.apply(a,arguments)},e.exports.polyfill=function(t){t||(t=a),t.requestAnimationFrame=s,t.cancelAnimationFrame=l}}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"performance-now":462}],485:[function(t,e,r){var n=t("big-rat/add");e.exports=function(t,e){for(var r=t.length,a=new Array(r),i=0;i<r;++i)a[i]=n(t[i],e[i]);return a}},{"big-rat/add":75}],486:[function(t,e,r){e.exports=function(t){for(var e=new Array(t.length),r=0;r<t.length;++r)e[r]=n(t[r]);return e};var n=t("big-rat")},{"big-rat":78}],487:[function(t,e,r){var n=t("big-rat"),a=t("big-rat/mul");e.exports=function(t,e){for(var r=n(e),i=t.length,o=new Array(i),s=0;s<i;++s)o[s]=a(t[s],r);return o}},{"big-rat":78,"big-rat/mul":87}],488:[function(t,e,r){var n=t("big-rat/sub");e.exports=function(t,e){for(var r=t.length,a=new Array(r),i=0;i<r;++i)a[i]=n(t[i],e[i]);return a}},{"big-rat/sub":89}],489:[function(t,e,r){var n=t("compare-cell"),a=t("compare-oriented-cell"),i=t("cell-orientation");e.exports=function(t){t.sort(a);for(var e=t.length,r=0,o=0;o<e;++o){var s=t[o],l=i(s);if(0!==l){if(r>0){var u=t[r-1];if(0===n(s,u)&&i(u)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}},{"cell-orientation":112,"compare-cell":128,"compare-oriented-cell":129}],490:[function(t,e,r){var n=t("array-bounds"),a=t("color-normalize"),i=t("update-diff"),o=t("pick-by-alias"),s=t("object-assign"),l=t("flatten-vertex-data"),u=t("to-float32"),c=u.float32,h=u.fract32;e.exports=function(t,e){if("function"==typeof t?(e||(e={}),e.regl=t):e=t,e.length&&(e.positions=e),!(t=e.regl).hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");var r,u,f,p,m,g,y=t._gl,v={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},_=[];return p=t.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),u=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),f=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),m=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),g=t.buffer({usage:"static",type:"float",data:d}),M(e),r=t({vert:"\n\t\tprecision highp float;\n\n\t\tattribute vec2 position, positionFract;\n\t\tattribute vec4 error;\n\t\tattribute vec4 color;\n\n\t\tattribute vec2 direction, lineOffset, capOffset;\n\n\t\tuniform vec4 viewport;\n\t\tuniform float lineWidth, capSize;\n\t\tuniform vec2 scale, scaleFract, translate, translateFract;\n\n\t\tvarying vec4 fragColor;\n\n\t\tvoid main() {\n\t\t\tfragColor = color / 255.;\n\n\t\t\tvec2 pixelOffset = lineWidth * lineOffset + (capSize + lineWidth) * capOffset;\n\n\t\t\tvec2 dxy = -step(.5, direction.xy) * error.xz + step(direction.xy, vec2(-.5)) * error.yw;\n\n\t\t\tvec2 position = position + dxy;\n\n\t\t\tvec2 pos = (position + translate) * scale\n\t\t\t\t+ (positionFract + translateFract) * scale\n\t\t\t\t+ (position + translate) * scaleFract\n\t\t\t\t+ (positionFract + translateFract) * scaleFract;\n\n\t\t\tpos += pixelOffset / viewport.zw;\n\n\t\t\tgl_Position = vec4(pos * 2. - 1., 0, 1);\n\t\t}\n\t\t",frag:"\n\t\tprecision highp float;\n\n\t\tvarying vec4 fragColor;\n\n\t\tuniform float opacity;\n\n\t\tvoid main() {\n\t\t\tgl_FragColor = fragColor;\n\t\t\tgl_FragColor.a *= opacity;\n\t\t}\n\t\t",uniforms:{range:t.prop("range"),lineWidth:t.prop("lineWidth"),capSize:t.prop("capSize"),opacity:t.prop("opacity"),scale:t.prop("scale"),translate:t.prop("translate"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),viewport:function(t,e){return[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]}},attributes:{color:{buffer:p,offset:function(t,e){return 4*e.offset},divisor:1},position:{buffer:u,offset:function(t,e){return 8*e.offset},divisor:1},positionFract:{buffer:f,offset:function(t,e){return 8*e.offset},divisor:1},error:{buffer:m,offset:function(t,e){return 16*e.offset},divisor:1},direction:{buffer:g,stride:24,offset:0},lineOffset:{buffer:g,stride:24,offset:8},capOffset:{buffer:g,stride:24,offset:16}},primitive:"triangles",blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:!1},scissor:{enable:!0,box:t.prop("viewport")},viewport:t.prop("viewport"),stencil:!1,instances:t.prop("count"),count:d.length}),s(x,{update:M,draw:b,destroy:k,regl:t,gl:y,canvas:y.canvas,groups:_}),x;function x(t){t?M(t):null===t&&k(),b()}function b(e){if("number"==typeof e)return w(e);e&&!Array.isArray(e)&&(e=[e]),t._refresh(),_.forEach((function(t,r){t&&(e&&(e[r]?t.draw=!0:t.draw=!1),t.draw?w(r):t.draw=!0)}))}function w(t){"number"==typeof t&&(t=_[t]),null!=t&&t&&t.count&&t.color&&t.opacity&&t.positions&&t.positions.length>1&&(t.scaleRatio=[t.scale[0]*t.viewport.width,t.scale[1]*t.viewport.height],r(t),t.after&&t.after(t))}function M(t){if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var e=0,r=0;if(x.groups=_=t.map((function(t,u){var c=_[u];return t?("function"==typeof t?t={after:t}:"number"==typeof t[0]&&(t={positions:t}),t=o(t,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),c||(_[u]=c={id:u,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},t=s({},v,t)),i(c,t,[{lineWidth:function(t){return.5*+t},capSize:function(t){return.5*+t},opacity:parseFloat,errors:function(t){return t=l(t),r+=t.length,t},positions:function(t,r){return t=l(t,"float64"),r.count=Math.floor(t.length/2),r.bounds=n(t,2),r.offset=e,e+=r.count,t}},{color:function(t,e){var r=e.count;if(t||(t="transparent"),!Array.isArray(t)||"number"==typeof t[0]){var n=t;t=Array(r);for(var i=0;i<r;i++)t[i]=n}if(t.length<r)throw Error("Not enough colors");for(var o=new Uint8Array(4*r),s=0;s<r;s++){var l=a(t[s],"uint8");o.set(l,4*s)}return o},range:function(t,e,r){var n=e.bounds;return t||(t=n),e.scale=[1/(t[2]-t[0]),1/(t[3]-t[1])],e.translate=[-t[0],-t[1]],e.scaleFract=h(e.scale),e.translateFract=h(e.translate),t},viewport:function(t){var e;return Array.isArray(t)?e={x:t[0],y:t[1],width:t[2]-t[0],height:t[3]-t[1]}:t?(e={x:t.x||t.left||0,y:t.y||t.top||0},t.right?e.width=t.right-e.x:e.width=t.w||t.width||0,t.bottom?e.height=t.bottom-e.y:e.height=t.h||t.height||0):e={x:0,y:0,width:y.drawingBufferWidth,height:y.drawingBufferHeight},e}}]),c):c})),e||r){var d=_.reduce((function(t,e,r){return t+(e?e.count:0)}),0),g=new Float64Array(2*d),b=new Uint8Array(4*d),w=new Float32Array(4*d);_.forEach((function(t,e){if(t){var r=t.positions,n=t.count,a=t.offset,i=t.color,o=t.errors;n&&(b.set(i,4*a),w.set(o,4*a),g.set(r,2*a))}})),u(c(g)),f(h(g)),p(b),m(w)}}}function k(){u.destroy(),f.destroy(),p.destroy(),m.destroy(),g.destroy()}};var d=[[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]]},{"array-bounds":65,"color-normalize":120,"flatten-vertex-data":227,"object-assign":454,"pick-by-alias":465,"to-float32":538,"update-diff":549}],491:[function(t,e,r){var n=t("color-normalize"),a=t("array-bounds"),i=t("object-assign"),o=t("glslify"),s=t("pick-by-alias"),l=t("flatten-vertex-data"),u=t("earcut"),c=t("array-normalize"),h=t("to-float32"),d=h.float32,f=h.fract32,p=t("es6-weak-map"),m=t("parse-rect");function g(t,e){if(!(this instanceof g))return new g(t,e);if("function"==typeof t?(e||(e={}),e.regl=t):e=t,e.length&&(e.positions=e),!(t=e.regl).hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");this.gl=t._gl,this.regl=t,this.passes=[],this.shaders=g.shaders.has(t)?g.shaders.get(t):g.shaders.set(t,g.createShaders(t)).get(t),this.update(e)}e.exports=g,g.dashMult=2,g.maxPatternLength=256,g.precisionThreshold=3e6,g.maxPoints=1e4,g.maxLines=2048,g.shaders=new p,g.createShaders=function(t){var e,r=t.buffer({usage:"static",type:"float",data:[0,1,0,0,1,1,1,0]}),n={primitive:"triangle strip",instances:t.prop("count"),count:4,offset:0,uniforms:{miterMode:function(t,e){return"round"===e.join?2:1},miterLimit:t.prop("miterLimit"),scale:t.prop("scale"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),thickness:t.prop("thickness"),dashPattern:t.prop("dashTexture"),opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),dashSize:t.prop("dashLength"),viewport:function(t,e){return[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]},depth:t.prop("depth")},blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:function(t,e){return!e.overlay}},stencil:{enable:!1},scissor:{enable:!0,box:t.prop("viewport")},viewport:t.prop("viewport")},a=t(i({vert:o(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 aCoord, bCoord, aCoordFract, bCoordFract;\nattribute vec4 color;\nattribute float lineEnd, lineTop;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float thickness, pixelRatio, id, depth;\nuniform vec4 viewport;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nvec2 project(vec2 position, vec2 positionFract, vec2 scale, vec2 scaleFract, vec2 translate, vec2 translateFract) {\n\t// the order is important\n\treturn position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n}\n\nvoid main() {\n\tfloat lineStart = 1. - lineEnd;\n\tfloat lineOffset = lineTop * 2. - 1.;\n\n\tvec2 diff = (bCoord + bCoordFract - aCoord - aCoordFract);\n\ttangent = normalize(diff * scale * viewport.zw);\n\tvec2 normal = vec2(-tangent.y, tangent.x);\n\n\tvec2 position = project(aCoord, aCoordFract, scale, scaleFract, translate, translateFract) * lineStart\n\t\t+ project(bCoord, bCoordFract, scale, scaleFract, translate, translateFract) * lineEnd\n\n\t\t+ thickness * normal * .5 * lineOffset / viewport.zw;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D dashPattern;\n\nuniform float dashSize, pixelRatio, thickness, opacity, id;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nvoid main() {\n\tfloat alpha = 1.;\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashSize) * .5 + .25;\n\tfloat dash = texture2D(dashPattern, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n"]),attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:16,divisor:1},aCoordFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:8,divisor:1},bCoordFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:16,divisor:1},color:{buffer:t.prop("colorBuffer"),stride:4,offset:0,divisor:1}}},n));try{e=t(i({cull:{enable:!0,face:"back"},vert:o(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 aCoord, bCoord, nextCoord, prevCoord;\nattribute vec4 aColor, bColor;\nattribute float lineEnd, lineTop;\n\nuniform vec2 scale, translate;\nuniform float thickness, pixelRatio, id, depth;\nuniform vec4 viewport;\nuniform float miterLimit, miterMode;\n\nvarying vec4 fragColor;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 tangent;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nconst float REVERSE_THRESHOLD = -.875;\nconst float MIN_DIFF = 1e-6;\n\n// TODO: possible optimizations: avoid overcalculating all for vertices and calc just one instead\n// TODO: precalculate dot products, normalize things beforehead etc.\n// TODO: refactor to rectangular algorithm\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nbool isNaN( float val ){\n return ( val < 0.0 || 0.0 < val || val == 0.0 ) ? false : true;\n}\n\nvoid main() {\n\tvec2 aCoord = aCoord, bCoord = bCoord, prevCoord = prevCoord, nextCoord = nextCoord;\n\n vec2 adjustedScale;\n adjustedScale.x = (abs(scale.x) < MIN_DIFF) ? MIN_DIFF : scale.x;\n adjustedScale.y = (abs(scale.y) < MIN_DIFF) ? MIN_DIFF : scale.y;\n\n vec2 scaleRatio = adjustedScale * viewport.zw;\n\tvec2 normalWidth = thickness / scaleRatio;\n\n\tfloat lineStart = 1. - lineEnd;\n\tfloat lineBot = 1. - lineTop;\n\n\tfragColor = (lineStart * aColor + lineEnd * bColor) / 255.;\n\n\tif (isNaN(aCoord.x) || isNaN(aCoord.y) || isNaN(bCoord.x) || isNaN(bCoord.y)) return;\n\n\tif (aCoord == prevCoord) prevCoord = aCoord + normalize(bCoord - aCoord);\n\tif (bCoord == nextCoord) nextCoord = bCoord - normalize(bCoord - aCoord);\n\n\tvec2 prevDiff = aCoord - prevCoord;\n\tvec2 currDiff = bCoord - aCoord;\n\tvec2 nextDiff = nextCoord - bCoord;\n\n\tvec2 prevTangent = normalize(prevDiff * scaleRatio);\n\tvec2 currTangent = normalize(currDiff * scaleRatio);\n\tvec2 nextTangent = normalize(nextDiff * scaleRatio);\n\n\tvec2 prevNormal = vec2(-prevTangent.y, prevTangent.x);\n\tvec2 currNormal = vec2(-currTangent.y, currTangent.x);\n\tvec2 nextNormal = vec2(-nextTangent.y, nextTangent.x);\n\n\tvec2 startJoinDirection = normalize(prevTangent - currTangent);\n\tvec2 endJoinDirection = normalize(currTangent - nextTangent);\n\n\t// collapsed/unidirectional segment cases\n\t// FIXME: there should be more elegant solution\n\tvec2 prevTanDiff = abs(prevTangent - currTangent);\n\tvec2 nextTanDiff = abs(nextTangent - currTangent);\n\tif (max(prevTanDiff.x, prevTanDiff.y) < MIN_DIFF) {\n\t\tstartJoinDirection = currNormal;\n\t}\n\tif (max(nextTanDiff.x, nextTanDiff.y) < MIN_DIFF) {\n\t\tendJoinDirection = currNormal;\n\t}\n\tif (aCoord == bCoord) {\n\t\tendJoinDirection = startJoinDirection;\n\t\tcurrNormal = prevNormal;\n\t\tcurrTangent = prevTangent;\n\t}\n\n\ttangent = currTangent;\n\n\t//calculate join shifts relative to normals\n\tfloat startJoinShift = dot(currNormal, startJoinDirection);\n\tfloat endJoinShift = dot(currNormal, endJoinDirection);\n\n\tfloat startMiterRatio = abs(1. / startJoinShift);\n\tfloat endMiterRatio = abs(1. / endJoinShift);\n\n\tvec2 startJoin = startJoinDirection * startMiterRatio;\n\tvec2 endJoin = endJoinDirection * endMiterRatio;\n\n\tvec2 startTopJoin, startBotJoin, endTopJoin, endBotJoin;\n\tstartTopJoin = sign(startJoinShift) * startJoin * .5;\n\tstartBotJoin = -startTopJoin;\n\n\tendTopJoin = sign(endJoinShift) * endJoin * .5;\n\tendBotJoin = -endTopJoin;\n\n\tvec2 aTopCoord = aCoord + normalWidth * startTopJoin;\n\tvec2 bTopCoord = bCoord + normalWidth * endTopJoin;\n\tvec2 aBotCoord = aCoord + normalWidth * startBotJoin;\n\tvec2 bBotCoord = bCoord + normalWidth * endBotJoin;\n\n\t//miter anti-clipping\n\tfloat baClipping = distToLine(bCoord, aCoord, aBotCoord) / dot(normalize(normalWidth * endBotJoin), normalize(normalWidth.yx * vec2(-startBotJoin.y, startBotJoin.x)));\n\tfloat abClipping = distToLine(aCoord, bCoord, bTopCoord) / dot(normalize(normalWidth * startBotJoin), normalize(normalWidth.yx * vec2(-endBotJoin.y, endBotJoin.x)));\n\n\t//prevent close to reverse direction switch\n\tbool prevReverse = dot(currTangent, prevTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, prevNormal)) * min(length(prevDiff), length(currDiff)) < length(normalWidth * currNormal);\n\tbool nextReverse = dot(currTangent, nextTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, nextNormal)) * min(length(nextDiff), length(currDiff)) < length(normalWidth * currNormal);\n\n\tif (prevReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * startJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / startMiterRatio, 1.);\n\t\taBotCoord = aCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\taTopCoord = aCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!nextReverse && baClipping > 0. && baClipping < length(normalWidth * endBotJoin)) {\n\t\t//handle miter clipping\n\t\tbTopCoord -= normalWidth * endTopJoin;\n\t\tbTopCoord += normalize(endTopJoin * normalWidth) * baClipping;\n\t}\n\n\tif (nextReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.);\n\t\tbBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\tbTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) {\n\t\t//handle miter clipping\n\t\taBotCoord -= normalWidth * startBotJoin;\n\t\taBotCoord += normalize(startBotJoin * normalWidth) * abClipping;\n\t}\n\n\tvec2 aTopPosition = (aTopCoord) * adjustedScale + translate;\n\tvec2 aBotPosition = (aBotCoord) * adjustedScale + translate;\n\n\tvec2 bTopPosition = (bTopCoord) * adjustedScale + translate;\n\tvec2 bBotPosition = (bBotCoord) * adjustedScale + translate;\n\n\t//position is normalized 0..1 coord on the screen\n\tvec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd;\n\n\tstartCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\tendCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tenableStartMiter = step(dot(currTangent, prevTangent), .5);\n\tenableEndMiter = step(dot(currTangent, nextTangent), .5);\n\n\t//bevel miter cutoffs\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n\n\t//round miter cutoffs\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D dashPattern;\nuniform float dashSize, pixelRatio, thickness, opacity, id, miterMode;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nvoid main() {\n\tfloat alpha = 1., distToStart, distToEnd;\n\tfloat cutoff = thickness * .5;\n\n\t//bevel miter\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToStart + 1., 0.), 1.);\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToEnd + 1., 0.), 1.);\n\t\t}\n\t}\n\n\t// round miter\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - startCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - endCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\t}\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashSize) * .5 + .25;\n\tfloat dash = texture2D(dashPattern, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n"]),attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aColor:{buffer:t.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:t.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},n))}catch(t){e=a}return{fill:t({primitive:"triangle",elements:function(t,e){return e.triangles},offset:0,vert:o(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\n\nuniform vec4 color;\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio, id;\nuniform vec4 viewport;\nuniform float opacity;\n\nvarying vec4 fragColor;\n\nconst float MAX_LINES = 256.;\n\nvoid main() {\n\tfloat depth = (MAX_LINES - 4. - id) / (MAX_LINES);\n\n\tvec2 position = position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n\tfragColor.a *= opacity;\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n\tgl_FragColor = fragColor;\n}\n"]),uniforms:{scale:t.prop("scale"),color:t.prop("fill"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),viewport:function(t,e){return[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]}},attributes:{position:{buffer:t.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:8}},blend:n.blend,depth:{enable:!1},scissor:n.scissor,stencil:n.stencil,viewport:n.viewport}),rect:a,miter:e}},g.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},g.prototype.render=function(){for(var t,e=[],r=arguments.length;r--;)e[r]=arguments[r];e.length&&(t=this).update.apply(t,e),this.draw()},g.prototype.draw=function(){for(var t=this,e=[],r=arguments.length;r--;)e[r]=arguments[r];return(e.length?e:this.passes).forEach((function(e,r){var n;if(e&&Array.isArray(e))return(n=t).draw.apply(n,e);"number"==typeof e&&(e=t.passes[e]),e&&e.count>1&&e.opacity&&(t.regl._refresh(),e.fill&&e.triangles&&e.triangles.length>2&&t.shaders.fill(e),e.thickness&&(e.scale[0]*e.viewport.width>g.precisionThreshold||e.scale[1]*e.viewport.height>g.precisionThreshold||"rect"===e.join||!e.join&&(e.thickness<=2||e.count>=g.maxPoints)?t.shaders.rect(e):t.shaders.miter(e)))})),this},g.prototype.update=function(t){var e=this;if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var r=this.regl,o=this.gl;if(t.forEach((function(t,h){var p=e.passes[h];if(void 0!==t)if(null!==t){if("number"==typeof t[0]&&(t={positions:t}),t=s(t,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow"}),p||(e.passes[h]=p={id:h,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:r.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:r.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},t=i({},g.defaults,t)),null!=t.thickness&&(p.thickness=parseFloat(t.thickness)),null!=t.opacity&&(p.opacity=parseFloat(t.opacity)),null!=t.miterLimit&&(p.miterLimit=parseFloat(t.miterLimit)),null!=t.overlay&&(p.overlay=!!t.overlay,h<g.maxLines&&(p.depth=2*(g.maxLines-1-h%g.maxLines)/g.maxLines-1)),null!=t.join&&(p.join=t.join),null!=t.hole&&(p.hole=t.hole),null!=t.fill&&(p.fill=t.fill?n(t.fill,"uint8"):null),null!=t.viewport&&(p.viewport=m(t.viewport)),p.viewport||(p.viewport=m([o.drawingBufferWidth,o.drawingBufferHeight])),null!=t.close&&(p.close=t.close),null===t.positions&&(t.positions=[]),t.positions){var y,v;if(t.positions.x&&t.positions.y){var _=t.positions.x,x=t.positions.y;v=p.count=Math.max(_.length,x.length),y=new Float64Array(2*v);for(var b=0;b<v;b++)y[2*b]=_[b],y[2*b+1]=x[b]}else y=l(t.positions,"float64"),v=p.count=Math.floor(y.length/2);var w=p.bounds=a(y,2);if(p.fill){for(var M=[],k={},T=0,L=0,A=0,S=p.count;L<S;L++){var E=y[2*L],C=y[2*L+1];isNaN(E)||isNaN(C)||null==E||null==C?(E=y[2*T],C=y[2*T+1],k[L]=T):T=L,M[A++]=E,M[A++]=C}for(var D=u(M,p.hole||[]),P=0,O=D.length;P<O;P++)null!=k[D[P]]&&(D[P]=k[D[P]]);p.triangles=D}var z=new Float64Array(y);c(z,2,w);var I=new Float64Array(2*v+6);p.close?y[0]===y[2*v-2]&&y[1]===y[2*v-1]?(I[0]=z[2*v-4],I[1]=z[2*v-3]):(I[0]=z[2*v-2],I[1]=z[2*v-1]):(I[0]=z[0],I[1]=z[1]),I.set(z,2),p.close?y[0]===y[2*v-2]&&y[1]===y[2*v-1]?(I[2*v+2]=z[2],I[2*v+3]=z[3],p.count-=1):(I[2*v+2]=z[0],I[2*v+3]=z[1],I[2*v+4]=z[2],I[2*v+5]=z[3]):(I[2*v+2]=z[2*v-2],I[2*v+3]=z[2*v-1],I[2*v+4]=z[2*v-2],I[2*v+5]=z[2*v-1]),p.positionBuffer(d(I)),p.positionFractBuffer(f(I))}if(t.range?p.range=t.range:p.range||(p.range=p.bounds),(t.range||t.positions)&&p.count){var R=p.bounds,F=R[2]-R[0],N=R[3]-R[1],Y=p.range[2]-p.range[0],j=p.range[3]-p.range[1];p.scale=[F/Y,N/j],p.translate=[-p.range[0]/Y+R[0]/Y||0,-p.range[1]/j+R[1]/j||0],p.scaleFract=f(p.scale),p.translateFract=f(p.translate)}if(t.dashes){var B,H=0;if(!t.dashes||t.dashes.length<2)H=1,B=new Uint8Array([255,255,255,255,255,255,255,255]);else{H=0;for(var U=0;U<t.dashes.length;++U)H+=t.dashes[U];B=new Uint8Array(H*g.dashMult);for(var V=0,W=255,G=0;G<2;G++)for(var q=0;q<t.dashes.length;++q){for(var Z=0,X=t.dashes[q]*g.dashMult*.5;Z<X;++Z)B[V++]=W;W^=255}}p.dashLength=H,p.dashTexture({channels:1,data:B,width:B.length,height:1,mag:"linear",min:"linear"},0,0)}if(t.color){var J=p.count,K=t.color;K||(K="transparent");var $=new Uint8Array(4*J+4);if(Array.isArray(K)&&"number"!=typeof K[0]){for(var Q=0;Q<J;Q++){var tt=n(K[Q],"uint8");$.set(tt,4*Q)}$.set(n(K[0],"uint8"),4*J)}else for(var et=n(K,"uint8"),rt=0;rt<J+1;rt++)$.set(et,4*rt);p.colorBuffer({usage:"dynamic",type:"uint8",data:$})}}else e.passes[h]=null})),t.length<this.passes.length){for(var h=t.length;h<this.passes.length;h++){var p=e.passes[h];p&&(p.colorBuffer.destroy(),p.positionBuffer.destroy(),p.dashTexture.destroy())}this.passes.length=t.length}for(var y=[],v=0;v<this.passes.length;v++)null!==e.passes[v]&&y.push(e.passes[v]);return this.passes=y,this}},g.prototype.destroy=function(){return this.passes.forEach((function(t){t.colorBuffer.destroy(),t.positionBuffer.destroy(),t.dashTexture.destroy()})),this.passes.length=0,this}},{"array-bounds":65,"array-normalize":66,"color-normalize":120,earcut:492,"es6-weak-map":493,"flatten-vertex-data":227,glslify:409,"object-assign":454,"parse-rect":459,"pick-by-alias":465,"to-float32":538}],492:[function(t,e,r){function n(t,e,r){r=r||2;var n,s,l,u,c,f,m,g=e&&e.length,y=g?e[0]*r:t.length,v=a(t,0,y,r,!0),_=[];if(!v||v.next===v.prev)return _;if(g&&(v=function(t,e,r,n){var o,s,l,u=[];for(o=0,s=e.length;o<s;o++)(l=a(t,e[o]*n,o<s-1?e[o+1]*n:t.length,n,!1))===l.next&&(l.steiner=!0),u.push(p(l));for(u.sort(h),o=0;o<u.length;o++)d(u[o],r),r=i(r,r.next);return r}(t,e,v,r)),t.length>80*r){n=l=t[0],s=u=t[1];for(var x=r;x<y;x+=r)(c=t[x])<n&&(n=c),(f=t[x+1])<s&&(s=f),c>l&&(l=c),f>u&&(u=f);m=0!==(m=Math.max(l-n,u-s))?1/m:0}return o(v,_,r,n,s,m),_}function a(t,e,r,n,a){var i,o;if(a===T(t,e,r,n)>0)for(i=e;i<r;i+=n)o=w(i,t[i],t[i+1],o);else for(i=r-n;i>=e;i-=n)o=w(i,t[i],t[i+1],o);return o&&v(o,o.next)&&(M(o),o=o.next),o}function i(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!v(n,n.next)&&0!==y(n.prev,n,n.next))n=n.next;else{if(M(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function o(t,e,r,n,a,h,d){if(t){!d&&h&&function(t,e,r,n){var a=t;do{null===a.z&&(a.z=f(a.x,a.y,e,r,n)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next}while(a!==t);a.prevZ.nextZ=null,a.prevZ=null,function(t){var e,r,n,a,i,o,s,l,u=1;do{for(r=t,t=null,i=null,o=0;r;){for(o++,n=r,s=0,e=0;e<u&&(s++,n=n.nextZ);e++);for(l=u;s>0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,l--),i?i.nextZ=a:t=a,a.prevZ=i,i=a;r=n}i.nextZ=null,u*=2}while(o>1)}(a)}(t,n,a,h);for(var p,m,g=t;t.prev!==t.next;)if(p=t.prev,m=t.next,h?l(t,n,a,h):s(t))e.push(p.i/r),e.push(t.i/r),e.push(m.i/r),M(t),t=m.next,g=m.next;else if((t=m)===g){d?1===d?o(t=u(t,e,r),e,r,n,a,h,2):2===d&&c(t,e,r,n,a,h):o(i(t),e,r,n,a,h,1);break}}}function s(t){var e=t.prev,r=t,n=t.next;if(y(e,r,n)>=0)return!1;for(var a=t.next.next;a!==t.prev;){if(m(e.x,e.y,r.x,r.y,n.x,n.y,a.x,a.y)&&y(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function l(t,e,r,n){var a=t.prev,i=t,o=t.next;if(y(a,i,o)>=0)return!1;for(var s=a.x<i.x?a.x<o.x?a.x:o.x:i.x<o.x?i.x:o.x,l=a.y<i.y?a.y<o.y?a.y:o.y:i.y<o.y?i.y:o.y,u=a.x>i.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,c=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,h=f(s,l,e,r,n),d=f(u,c,e,r,n),p=t.prevZ,g=t.nextZ;p&&p.z>=h&&g&&g.z<=d;){if(p!==t.prev&&p!==t.next&&m(a.x,a.y,i.x,i.y,o.x,o.y,p.x,p.y)&&y(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,g!==t.prev&&g!==t.next&&m(a.x,a.y,i.x,i.y,o.x,o.y,g.x,g.y)&&y(g.prev,g,g.next)>=0)return!1;g=g.nextZ}for(;p&&p.z>=h;){if(p!==t.prev&&p!==t.next&&m(a.x,a.y,i.x,i.y,o.x,o.y,p.x,p.y)&&y(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;g&&g.z<=d;){if(g!==t.prev&&g!==t.next&&m(a.x,a.y,i.x,i.y,o.x,o.y,g.x,g.y)&&y(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function u(t,e,r){var n=t;do{var a=n.prev,i=n.next.next;!v(a,i)&&_(a,n,n.next,i)&&x(a,i)&&x(i,a)&&(e.push(a.i/r),e.push(n.i/r),e.push(i.i/r),M(n),M(n.next),n=t=i),n=n.next}while(n!==t);return n}function c(t,e,r,n,a,s){var l=t;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&g(l,u)){var c=b(l,u);return l=i(l,l.next),c=i(c,c.next),o(l,e,r,n,a,s),void o(c,e,r,n,a,s)}u=u.next}l=l.next}while(l!==t)}function h(t,e){return t.x-e.x}function d(t,e){if(e=function(t,e){var r,n=e,a=t.x,i=t.y,o=-1/0;do{if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){var s=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=a&&s>o){if(o=s,s===a){if(i===n.y)return n;if(i===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(a===o)return r.prev;var l,u=r,c=r.x,h=r.y,d=1/0;for(n=r.next;n!==u;)a>=n.x&&n.x>=c&&a!==n.x&&m(i<h?a:o,i,c,h,i<h?o:a,i,n.x,n.y)&&((l=Math.abs(i-n.y)/(a-n.x))<d||l===d&&n.x>r.x)&&x(n,t)&&(r=n,d=l),n=n.next;return r}(t,e)){var r=b(e,t);i(r,r.next)}}function f(t,e,r,n,a){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*a)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*a)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function p(t){var e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==t);return r}function m(t,e,r,n,a,i,o,s){return(a-o)*(e-s)-(t-o)*(i-s)>=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(i-s)-(a-o)*(n-s)>=0}function g(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&_(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&x(t,e)&&x(e,t)&&function(t,e){var r=t,n=!1,a=(t.x+e.x)/2,i=(t.y+e.y)/2;do{r.y>i!=r.next.y>i&&r.next.y!==r.y&&a<(r.next.x-r.x)*(i-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)}function y(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function v(t,e){return t.x===e.x&&t.y===e.y}function _(t,e,r,n){return!!(v(t,e)&&v(r,n)||v(t,n)&&v(r,e))||y(t,e,r)>0!=y(t,e,n)>0&&y(r,n,t)>0!=y(r,n,e)>0}function x(t,e){return y(t.prev,t,t.next)<0?y(t,e,t.next)>=0&&y(t,t.prev,e)>=0:y(t,e,t.prev)<0||y(t,t.next,e)<0}function b(t,e){var r=new k(t.i,t.x,t.y),n=new k(e.i,e.x,e.y),a=t.next,i=e.prev;return t.next=e,e.prev=t,r.next=a,a.prev=r,n.next=r,r.prev=n,i.next=n,n.prev=i,n}function w(t,e,r,n){var a=new k(t,e,r);return n?(a.next=n.next,a.prev=n,n.next.prev=a,n.next=a):(a.prev=a,a.next=a),a}function M(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 k(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 T(t,e,r,n){for(var a=0,i=e,o=r-n;i<r;i+=n)a+=(t[o]-t[i])*(t[i+1]+t[o+1]),o=i;return a}e.exports=n,e.exports.default=n,n.deviation=function(t,e,r,n){var a=e&&e.length,i=a?e[0]*r:t.length,o=Math.abs(T(t,0,i,r));if(a)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(T(t,u,c,r))}var h=0;for(s=0;s<n.length;s+=3){var d=n[s]*r,f=n[s+1]*r,p=n[s+2]*r;h+=Math.abs((t[d]-t[p])*(t[f+1]-t[d+1])-(t[d]-t[f])*(t[p+1]-t[d+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,a=0;a<t.length;a++){for(var i=0;i<t[a].length;i++)for(var o=0;o<e;o++)r.vertices.push(t[a][i][o]);a>0&&(n+=t[a-1].length,r.holes.push(n))}return r}},{}],493:[function(t,e,r){arguments[4][318][0].apply(r,arguments)},{"./is-implemented":494,"./polyfill":496,dup:318}],494:[function(t,e,r){arguments[4][319][0].apply(r,arguments)},{dup:319}],495:[function(t,e,r){arguments[4][320][0].apply(r,arguments)},{dup:320}],496:[function(t,e,r){arguments[4][321][0].apply(r,arguments)},{"./is-native-implemented":495,d:151,dup:321,"es5-ext/object/is-value":194,"es5-ext/object/set-prototype-of":200,"es5-ext/object/valid-object":204,"es5-ext/object/valid-value":205,"es5-ext/string/random-uniq":210,"es6-iterator/for-of":212,"es6-iterator/get":213,"es6-symbol":219}],497:[function(t,e,r){function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,a=!1,i=void 0;try{for(var o,s=t[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!e||r.length!==e);n=!0);}catch(t){a=!0,i=t}finally{try{n||null==s.return||s.return()}finally{if(a)throw i}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function a(t){return function(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var i=t("color-normalize"),o=t("array-bounds"),s=t("color-id"),l=t("point-cluster"),u=t("object-assign"),c=t("glslify"),h=t("pick-by-alias"),d=t("update-diff"),f=t("flatten-vertex-data"),p=t("is-iexplorer"),m=t("to-float32"),g=t("parse-rect"),y=v;function v(t,e){var r=this;if(!(this instanceof v))return new v(t,e);"function"==typeof t?(e||(e={}),e.regl=t):(e=t,t=null),e&&e.length&&(e.positions=e);var n,a=(t=e.regl)._gl,i=[];this.tooManyColors=p,n=t.texture({data:new Uint8Array(1020),width:255,height:1,type:"uint8",format:"rgba",wrapS:"clamp",wrapT:"clamp",mag:"nearest",min:"nearest"}),u(this,{regl:t,gl:a,groups:[],markerCache:[null],markerTextures:[null],palette:i,paletteIds:{},paletteTexture:n,maxColors:255,maxSize:100,canvas:a.canvas}),this.update(e);var o={uniforms:{pixelRatio:t.context("pixelRatio"),palette:n,paletteSize:function(t,e){return[r.tooManyColors?0:255,n.height]},scale:t.prop("scale"),scaleFract:t.prop("scaleFract"),translate:t.prop("translate"),translateFract:t.prop("translateFract"),opacity:t.prop("opacity"),marker:t.prop("markerTexture")},attributes:{x:function(t,e){return e.xAttr||{buffer:e.positionBuffer,stride:8,offset:0}},y:function(t,e){return e.yAttr||{buffer:e.positionBuffer,stride:8,offset:4}},xFract:function(t,e){return e.xAttr?{constant:[0,0]}:{buffer:e.positionFractBuffer,stride:8,offset:0}},yFract:function(t,e){return e.yAttr?{constant:[0,0]}:{buffer:e.positionFractBuffer,stride:8,offset:4}},size:function(t,e){return e.size.length?{buffer:e.sizeBuffer,stride:2,offset:0}:{constant:[Math.round(255*e.size/r.maxSize)]}},borderSize:function(t,e){return e.borderSize.length?{buffer:e.sizeBuffer,stride:2,offset:1}:{constant:[Math.round(255*e.borderSize/r.maxSize)]}},colorId:function(t,e){return e.color.length?{buffer:e.colorBuffer,stride:r.tooManyColors?8:4,offset:0}:{constant:r.tooManyColors?i.slice(4*e.color,4*e.color+4):[e.color]}},borderColorId:function(t,e){return e.borderColor.length?{buffer:e.colorBuffer,stride:r.tooManyColors?8:4,offset:r.tooManyColors?4:2}:{constant:r.tooManyColors?i.slice(4*e.borderColor,4*e.borderColor+4):[e.borderColor]}},isActive:function(t,e){return!0===e.activation?{constant:[1]}:e.activation?e.activation:{constant:[0]}}},blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},scissor:{enable:!0,box:t.prop("viewport")},viewport:t.prop("viewport"),stencil:{enable:!1},depth:{enable:!1},elements:t.prop("elements"),count:t.prop("count"),offset:t.prop("offset"),primitive:"points"},s=u({},o);s.frag=c(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragWidth, fragBorderColorLevel, fragColorLevel;\n\nuniform sampler2D marker;\nuniform float pixelRatio, opacity;\n\nfloat smoothStep(float x, float y) {\n return 1.0 / (1.0 + exp(50.0*(x - y)));\n}\n\nvoid main() {\n float dist = texture2D(marker, gl_PointCoord).r, delta = fragWidth;\n\n // max-distance alpha\n if (dist < 0.003) discard;\n\n // null-border case\n if (fragBorderColorLevel == fragColorLevel || fragBorderColor.a == 0.) {\n float colorAmt = smoothstep(.5 - delta, .5 + delta, dist);\n gl_FragColor = vec4(fragColor.rgb, colorAmt * fragColor.a * opacity);\n }\n else {\n float borderColorAmt = smoothstep(fragBorderColorLevel - delta, fragBorderColorLevel + delta, dist);\n float colorAmt = smoothstep(fragColorLevel - delta, fragColorLevel + delta, dist);\n\n vec4 color = fragBorderColor;\n color.a *= borderColorAmt;\n color = mix(color, fragColor, colorAmt);\n color.a *= opacity;\n\n gl_FragColor = color;\n }\n\n}\n"]),s.vert=c(["precision highp float;\n#define GLSLIFY 1\n\nattribute float x, y, xFract, yFract;\nattribute float size, borderSize;\nattribute vec4 colorId, borderColorId;\nattribute float isActive;\n\nuniform vec2 scale, scaleFract, translate, translateFract, paletteSize;\nuniform float pixelRatio;\nuniform sampler2D palette;\n\nconst float maxSize = 100.;\nconst float borderLevel = .5;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragPointSize, fragBorderRadius, fragWidth, fragBorderColorLevel, fragColorLevel;\n\nbool isDirect = (paletteSize.x < 1.);\n\nvec4 getColor(vec4 id) {\n return isDirect ? id / 255. : texture2D(palette,\n vec2(\n (id.x + .5) / paletteSize.x,\n (id.y + .5) / paletteSize.y\n )\n );\n}\n\nvoid main() {\n if (isActive == 0.) return;\n\n vec2 position = vec2(x, y);\n vec2 positionFract = vec2(xFract, yFract);\n\n vec4 color = getColor(colorId);\n vec4 borderColor = getColor(borderColorId);\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = 2. * size * pixelRatio;\n fragPointSize = size * pixelRatio;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0, 1);\n\n fragColor = color;\n fragBorderColor = borderColor;\n fragWidth = 1. / gl_PointSize;\n\n fragBorderColorLevel = clamp(borderLevel - borderLevel * borderSize / size, 0., 1.);\n fragColorLevel = clamp(borderLevel + (1. - borderLevel) * borderSize / size, 0., 1.);\n}"]),this.drawMarker=t(s);var l=u({},o);l.frag=c(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor, fragBorderColor;\n\nuniform float opacity;\nvarying float fragBorderRadius, fragWidth;\n\nfloat smoothStep(float edge0, float edge1, float x) {\n\tfloat t;\n\tt = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\n\treturn t * t * (3.0 - 2.0 * t);\n}\n\nvoid main() {\n\tfloat radius, alpha = 1.0, delta = fragWidth;\n\n\tradius = length(2.0 * gl_PointCoord.xy - 1.0);\n\n\tif (radius > 1.0 + delta) {\n\t\tdiscard;\n\t}\n\n\talpha -= smoothstep(1.0 - delta, 1.0 + delta, radius);\n\n\tfloat borderRadius = fragBorderRadius;\n\tfloat ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius);\n\tvec4 color = mix(fragColor, fragBorderColor, ratio);\n\tcolor.a *= alpha * opacity;\n\tgl_FragColor = color;\n}\n"]),l.vert=c(["precision highp float;\n#define GLSLIFY 1\n\nattribute float x, y, xFract, yFract;\nattribute float size, borderSize;\nattribute vec4 colorId, borderColorId;\nattribute float isActive;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio;\nuniform sampler2D palette;\nuniform vec2 paletteSize;\n\nconst float maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nbool isDirect = (paletteSize.x < 1.);\n\nvec4 getColor(vec4 id) {\n return isDirect ? id / 255. : texture2D(palette,\n vec2(\n (id.x + .5) / paletteSize.x,\n (id.y + .5) / paletteSize.y\n )\n );\n}\n\nvoid main() {\n // ignore inactive points\n if (isActive == 0.) return;\n\n vec2 position = vec2(x, y);\n vec2 positionFract = vec2(xFract, yFract);\n\n vec4 color = getColor(colorId);\n vec4 borderColor = getColor(borderColorId);\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = (size + borderSize) * pixelRatio;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0, 1);\n\n fragBorderRadius = 1. - 2. * borderSize / (size + borderSize);\n fragColor = color;\n fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor;\n fragWidth = 1. / gl_PointSize;\n}\n"]),p&&(l.frag=l.frag.replace("smoothstep","smoothStep"),s.frag=s.frag.replace("smoothstep","smoothStep")),this.drawCircle=t(l)}v.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},v.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},v.prototype.draw=function(){for(var t=this,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var a=this.groups;if(1===r.length&&Array.isArray(r[0])&&(null===r[0][0]||Array.isArray(r[0][0]))&&(r=r[0]),this.regl._refresh(),r.length)for(var i=0;i<r.length;i++)this.drawItem(i,r[i]);else a.forEach((function(e,r){t.drawItem(r)}));return this},v.prototype.drawItem=function(t,e){var r=this.groups,n=r[t];if("number"==typeof e&&(t=e,n=r[e],e=null),n&&n.count&&n.opacity){n.activation[0]&&this.drawCircle(this.getMarkerDrawOptions(0,n,e));for(var i=[],o=1;o<n.activation.length;o++)n.activation[o]&&(!0===n.activation[o]||n.activation[o].data.length)&&i.push.apply(i,a(this.getMarkerDrawOptions(o,n,e)));i.length&&this.drawMarker(i)}},v.prototype.getMarkerDrawOptions=function(t,e,r){var a=e.range,i=e.tree,o=e.viewport,s=e.activation,l=e.selectionBuffer,c=e.count;if(this.regl,!i)return r?[u({},e,{markerTexture:this.markerTextures[t],activation:s[t],count:r.length,elements:r,offset:0})]:[u({},e,{markerTexture:this.markerTextures[t],activation:s[t],offset:0})];var h=[],d=i.range(a,{lod:!0,px:[(a[2]-a[0])/o.width,(a[3]-a[1])/o.height]});if(r){for(var f=s[t].data,p=new Uint8Array(c),m=0;m<r.length;m++){var g=r[m];p[g]=f?f[g]:1}l.subdata(p)}for(var y=d.length;y--;){var v=n(d[y],2),_=v[0],x=v[1];h.push(u({},e,{markerTexture:this.markerTextures[t],activation:r?l:s[t],offset:_,count:x-_}))}return h},v.prototype.update=function(){for(var t=this,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];if(r.length){1===r.length&&Array.isArray(r[0])&&(r=r[0]);var a=this.groups,i=this.gl,s=this.regl,c=this.maxSize,p=this.maxColors,y=this.palette;this.groups=a=r.map((function(e,r){var n=a[r];if(void 0===e)return n;null===e?e={positions:null}:"function"==typeof e?e={ondraw:e}:"number"==typeof e[0]&&(e={positions:e}),null===(e=h(e,{positions:"positions data points",snap:"snap cluster lod tree",size:"sizes size radius",borderSize:"borderSizes borderSize border-size bordersize borderWidth borderWidths border-width borderwidth stroke-width strokeWidth strokewidth outline",color:"colors color fill fill-color fillColor",borderColor:"borderColors borderColor stroke stroke-color strokeColor",marker:"markers marker shape",range:"range dataBox databox",viewport:"viewport viewPort viewBox viewbox",opacity:"opacity alpha transparency",bounds:"bound bounds boundaries limits",tooManyColors:"tooManyColors palette paletteMode optimizePalette enablePalette"})).positions&&(e.positions=[]),null!=e.tooManyColors&&(t.tooManyColors=e.tooManyColors),n||(a[r]=n={id:r,scale:null,translate:null,scaleFract:null,translateFract:null,activation:[],selectionBuffer:s.buffer({data:new Uint8Array(0),usage:"stream",type:"uint8"}),sizeBuffer:s.buffer({data:new Uint8Array(0),usage:"dynamic",type:"uint8"}),colorBuffer:s.buffer({data:new Uint8Array(0),usage:"dynamic",type:"uint8"}),positionBuffer:s.buffer({data:new Uint8Array(0),usage:"dynamic",type:"float"}),positionFractBuffer:s.buffer({data:new Uint8Array(0),usage:"dynamic",type:"float"})},e=u({},v.defaults,e)),!e.positions||"marker"in e||(e.marker=n.marker,delete n.marker),!e.marker||"positions"in e||(e.positions=n.positions,delete n.positions);var _=0,x=0;if(d(n,e,[{snap:!0,size:function(t,e){return null==t&&(t=v.defaults.size),_+=t&&t.length?1:0,t},borderSize:function(t,e){return null==t&&(t=v.defaults.borderSize),_+=t&&t.length?1:0,t},opacity:parseFloat,color:function(e,r){return null==e&&(e=v.defaults.color),e=t.updateColor(e),x++,e},borderColor:function(e,r){return null==e&&(e=v.defaults.borderColor),e=t.updateColor(e),x++,e},bounds:function(t,e,r){return"range"in r||(r.range=null),t},positions:function(t,e,r){var n=e.snap,a=e.positionBuffer,i=e.positionFractBuffer,u=e.selectionBuffer;if(t.x||t.y)return t.x.length?e.xAttr={buffer:s.buffer(t.x),offset:0,stride:4,count:t.x.length}:e.xAttr={buffer:t.x.buffer,offset:4*t.x.offset||0,stride:4*(t.x.stride||1),count:t.x.count},t.y.length?e.yAttr={buffer:s.buffer(t.y),offset:0,stride:4,count:t.y.length}:e.yAttr={buffer:t.y.buffer,offset:4*t.y.offset||0,stride:4*(t.y.stride||1),count:t.y.count},e.count=Math.max(e.xAttr.count,e.yAttr.count),t;t=f(t,"float64");var c=e.count=Math.floor(t.length/2),h=e.bounds=c?o(t,2):null;if(r.range||e.range||(delete e.range,r.range=h),r.marker||e.marker||(delete e.marker,r.marker=null),n&&(!0===n||c>n)?e.tree=l(t,{bounds:h}):n&&n.length&&(e.tree=n),e.tree){var d={primitive:"points",usage:"static",data:e.tree,type:"uint32"};e.elements?e.elements(d):e.elements=s.elements(d)}return a({data:m.float(t),usage:"dynamic"}),i({data:m.fract(t),usage:"dynamic"}),u({data:new Uint8Array(c),type:"uint8",usage:"stream"}),t}},{marker:function(e,r,n){var a=r.activation;if(a.forEach((function(t){return t&&t.destroy&&t.destroy()})),a.length=0,e&&"number"!=typeof e[0]){for(var i=[],o=0,l=Math.min(e.length,r.count);o<l;o++){var u=t.addMarker(e[o]);i[u]||(i[u]=new Uint8Array(r.count)),i[u][o]=1}for(var c=0;c<i.length;c++)if(i[c]){var h={data:i[c],type:"uint8",usage:"static"};a[c]?a[c](h):a[c]=s.buffer(h),a[c].data=i[c]}}else a[t.addMarker(e)]=!0;return e},range:function(t,e,r){var n=e.bounds;if(n)return t||(t=n),e.scale=[1/(t[2]-t[0]),1/(t[3]-t[1])],e.translate=[-t[0],-t[1]],e.scaleFract=m.fract(e.scale),e.translateFract=m.fract(e.translate),t},viewport:function(t){return g(t||[i.drawingBufferWidth,i.drawingBufferHeight])}}]),_){var b=n,w=b.count,M=b.size,k=b.borderSize,T=b.sizeBuffer,L=new Uint8Array(2*w);if(M.length||k.length)for(var A=0;A<w;A++)L[2*A]=Math.round(255*(null==M[A]?M:M[A])/c),L[2*A+1]=Math.round(255*(null==k[A]?k:k[A])/c);T({data:L,usage:"dynamic"})}if(x){var S,E=n,C=E.count,D=E.color,P=E.borderColor,O=E.colorBuffer;if(t.tooManyColors){if(D.length||P.length){S=new Uint8Array(8*C);for(var z=0;z<C;z++){var I=D[z];S[8*z]=y[4*I],S[8*z+1]=y[4*I+1],S[8*z+2]=y[4*I+2],S[8*z+3]=y[4*I+3];var R=P[z];S[8*z+4]=y[4*R],S[8*z+5]=y[4*R+1],S[8*z+6]=y[4*R+2],S[8*z+7]=y[4*R+3]}}}else if(D.length||P.length){S=new Uint8Array(4*C+2);for(var F=0;F<C;F++)null!=D[F]&&(S[4*F]=D[F]%p,S[4*F+1]=Math.floor(D[F]/p)),null!=P[F]&&(S[4*F+2]=P[F]%p,S[4*F+3]=Math.floor(P[F]/p))}O({data:S||new Uint8Array(0),type:"uint8",usage:"dynamic"})}return n}))}},v.prototype.addMarker=function(t){var e,r=this.markerTextures,n=this.regl,a=this.markerCache,i=null==t?0:a.indexOf(t);if(i>=0)return i;if(t instanceof Uint8Array||t instanceof Uint8ClampedArray)e=t;else{e=new Uint8Array(t.length);for(var o=0,s=t.length;o<s;o++)e[o]=255*t[o]}var l=Math.floor(Math.sqrt(e.length));return i=r.length,a.push(t),r.push(n.texture({channels:1,data:e,radius:l,mag:"linear",min:"linear"})),i},v.prototype.updateColor=function(t){var e=this.paletteIds,r=this.palette,n=this.maxColors;Array.isArray(t)||(t=[t]);var a=[];if("number"==typeof t[0]){var o=[];if(Array.isArray(t))for(var l=0;l<t.length;l+=4)o.push(t.slice(l,l+4));else for(var u=0;u<t.length;u+=4)o.push(t.subarray(u,u+4));t=o}for(var c=0;c<t.length;c++){var h=t[c];h=i(h,"uint8");var d=s(h,!1);if(null==e[d]){var f=r.length;e[d]=Math.floor(f/4),r[f]=h[0],r[f+1]=h[1],r[f+2]=h[2],r[f+3]=h[3]}a[c]=e[d]}return!this.tooManyColors&&r.length>4*n&&(this.tooManyColors=!0),this.updatePalette(r),1===a.length?a[0]:a},v.prototype.updatePalette=function(t){if(!this.tooManyColors){var e=this.maxColors,r=this.paletteTexture,n=Math.ceil(.25*t.length/e);if(n>1)for(var a=.25*(t=t.slice()).length%e;a<n*e;a++)t.push(0,0,0,0);r.height<n&&r.resize(e,n),r.subimage({width:Math.min(.25*t.length,e),height:n,data:t},0,0)}},v.prototype.destroy=function(){return this.groups.forEach((function(t){t.sizeBuffer.destroy(),t.positionBuffer.destroy(),t.positionFractBuffer.destroy(),t.colorBuffer.destroy(),t.activation.forEach((function(t){return t&&t.destroy&&t.destroy()})),t.selectionBuffer.destroy(),t.elements&&t.elements.destroy()})),this.groups.length=0,this.paletteTexture.destroy(),this.markerTextures.forEach((function(t){return t&&t.destroy&&t.destroy()})),this};var _=t("object-assign");e.exports=function(t,e){var r=new y(t,e),n=r.render.bind(r);return _(n,{render:n,update:r.update.bind(r),draw:r.draw.bind(r),destroy:r.destroy.bind(r),regl:r.regl,gl:r.gl,canvas:r.gl.canvas,groups:r.groups,markers:r.markerCache,palette:r.palette}),n}},{"array-bounds":65,"color-id":118,"color-normalize":120,"flatten-vertex-data":227,glslify:409,"is-iexplorer":419,"object-assign":454,"parse-rect":459,"pick-by-alias":465,"point-cluster":499,"to-float32":538,"update-diff":549}],498:[function(t,e,r){arguments[4][111][0].apply(r,arguments)},{dup:111}],499:[function(t,e,r){e.exports=t("./quad")},{"./quad":500}],500:[function(t,e,r){var n=t("binary-search-bounds"),a=t("clamp"),i=t("parse-rect"),o=t("array-bounds"),s=t("pick-by-alias"),l=t("defined"),u=t("flatten-vertex-data"),c=t("is-obj"),h=t("dtype"),d=t("math-log2");function f(t,e){for(var r=e[0],n=e[1],i=1/(e[2]-r),o=1/(e[3]-n),s=new Array(t.length),l=0,u=t.length/2;l<u;l++)s[2*l]=a((t[2*l]-r)*i,0,1),s[2*l+1]=a((t[2*l+1]-n)*o,0,1);return s}e.exports=function(t,e){e||(e={}),t=u(t,"float64"),e=s(e,{bounds:"range bounds dataBox databox",maxDepth:"depth maxDepth maxdepth level maxLevel maxlevel levels",dtype:"type dtype format out dst output destination"});var r=l(e.maxDepth,255),a=l(e.bounds,o(t,2));a[0]===a[2]&&a[2]++,a[1]===a[3]&&a[3]++;var p,m=f(t,a),g=t.length>>>1;e.dtype||(e.dtype="array"),"string"==typeof e.dtype?p=new(h(e.dtype))(g):e.dtype&&(p=e.dtype,Array.isArray(p)&&(p.length=g));for(var y=0;y<g;++y)p[y]=y;var v=[],_=[],x=[],b=[];!function t(e,n,a,i,o,s){if(!i.length)return null;var l=v[o]||(v[o]=[]),u=x[o]||(x[o]=[]),c=_[o]||(_[o]=[]),h=l.length;if(++o>r||s>1073741824){for(var d=0;d<i.length;d++)l.push(i[d]),u.push(s),c.push(null,null,null,null);return h}if(l.push(i[0]),u.push(s),i.length<=1)return c.push(null,null,null,null),h;for(var f=.5*a,p=e+f,g=n+f,y=[],b=[],w=[],M=[],k=1,T=i.length;k<T;k++){var L=i[k],A=m[2*L],S=m[2*L+1];A<p?S<g?y.push(L):b.push(L):S<g?w.push(L):M.push(L)}return s<<=2,c.push(t(e,n,f,y,o,s),t(e,g,f,b,o,s+1),t(p,n,f,w,o,s+2),t(p,g,f,M,o,s+3)),h}(0,0,1,p,0,1);for(var w=0,M=0;M<v.length;M++){var k=v[M];if(p.set)p.set(k,w);else for(var T=0,L=k.length;T<L;T++)p[T+w]=k[T];var A=w+v[M].length;b[M]=[w,A],w=A}return p.range=function(){for(var e,r=[],o=arguments.length;o--;)r[o]=arguments[o];if(c(r[r.length-1])){var u=r.pop();r.length||null==u.x&&null==u.l&&null==u.left||(r=[u],e={}),e=s(u,{level:"level maxLevel",d:"d diam diameter r radius px pxSize pixel pixelSize maxD size minSize",lod:"lod details ranges offsets"})}else e={};r.length||(r=a);var h,p=i.apply(void 0,r),m=[Math.min(p.x,p.x+p.width),Math.min(p.y,p.y+p.height),Math.max(p.x,p.x+p.width),Math.max(p.y,p.y+p.height)],g=m[0],y=m[1],w=m[2],M=m[3],k=f([g,y,w,M],a),T=k[0],L=k[1],A=k[2],E=k[3],C=l(e.level,v.length);if(null!=e.d&&("number"==typeof e.d?h=[e.d,e.d]:e.d.length&&(h=e.d),C=Math.min(Math.max(Math.ceil(-d(Math.abs(h[0])/(a[2]-a[0]))),Math.ceil(-d(Math.abs(h[1])/(a[3]-a[1])))),C)),C=Math.min(C,v.length),e.lod)return function(t,e,r,a,i){for(var o=[],s=0;s<i;s++){var l=x[s],u=b[s][0],c=S(t,e,s),h=S(r,a,s),d=n.ge(l,c),f=n.gt(l,h,d,l.length-1);o[s]=[d+u,f+u]}return o}(T,L,A,E,C);var D=[];return function e(r,n,a,i,o,s){if(null!==o&&null!==s&&!(T>r+a||L>n+a||A<r||E<n||i>=C||o===s)){var l=v[i];void 0===s&&(s=l.length);for(var u=o;u<s;u++){var c=l[u],h=t[2*c],d=t[2*c+1];h>=g&&h<=w&&d>=y&&d<=M&&D.push(c)}var f=_[i],p=f[4*o+0],m=f[4*o+1],x=f[4*o+2],b=f[4*o+3],k=function(t,e){for(var r=null,n=0;null===r;)if(r=t[4*e+n],++n>t.length)return null;return r}(f,o+1),S=.5*a,P=i+1;e(r,n,S,P,p,m||x||b||k),e(r,n+S,S,P,m,x||b||k),e(r+S,n,S,P,x,b||k),e(r+S,n+S,S,P,b,k)}}(0,0,1,0,0,1),D},p;function S(t,e,r){for(var n=1,a=.5,i=.5,o=.5,s=0;s<r;s++)n<<=2,n+=t<a?e<i?0:1:e<i?2:3,o*=.5,a+=t<a?-o:o,i+=e<i?-o:o;return n}}},{"array-bounds":65,"binary-search-bounds":498,clamp:115,defined:164,dtype:169,"flatten-vertex-data":227,"is-obj":421,"math-log2":432,"parse-rect":459,"pick-by-alias":465}],501:[function(t,e,r){var n=t("regl-scatter2d"),a=t("pick-by-alias"),i=t("array-bounds"),o=t("raf"),s=t("array-range"),l=t("parse-rect"),u=t("flatten-vertex-data");function c(t,e){if(!(this instanceof c))return new c(t,e);this.traces=[],this.passes={},this.regl=t,this.scatter=n(t),this.canvas=this.scatter.canvas}function h(t,e,r){return(null!=t.id?t.id:t)<<16|(255&e)<<8|255&r}function d(t,e,r){var n,a,i,o,s=t[e],l=t[r];return s.length>2?(s[0],s[2],n=s[1],a=s[3]):s.length?(n=s[0],a=s[1]):(s.x,n=s.y,s.x,s.width,a=s.y+s.height),l.length>2?(i=l[0],o=l[2],l[1],l[3]):l.length?(i=l[0],o=l[1]):(i=l.x,l.y,o=l.x+l.width,l.y,l.height),[i,n,o,a]}function f(t){if("number"==typeof t)return[t,t,t,t];if(2===t.length)return[t[0],t[1],t[0],t[1]];var e=l(t);return[e.x,e.y,e.x+e.width,e.y+e.height]}e.exports=c,c.prototype.render=function(){for(var t,e=this,r=[],n=arguments.length;n--;)r[n]=arguments[n];return r.length&&(t=this).update.apply(t,r),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?null==this.planned&&(this.planned=o((function(){e.draw(),e.dirty=!0,e.planned=null}))):(this.draw(),this.dirty=!0,o((function(){e.dirty=!1}))),this)},c.prototype.update=function(){for(var t,e=[],r=arguments.length;r--;)e[r]=arguments[r];if(e.length){for(var n=0;n<e.length;n++)this.updateItem(n,e[n]);this.traces=this.traces.filter(Boolean);for(var a=[],i=0,o=0;o<this.traces.length;o++){for(var s=this.traces[o],l=this.traces[o].passes,u=0;u<l.length;u++)a.push(this.passes[l[u]]);s.passOffset=i,i+=s.passes.length}return(t=this.scatter).update.apply(t,a),this}},c.prototype.updateItem=function(t,e){var r=this.regl;if(null===e)return this.traces[t]=null,this;if(!e)return this;var n,o=a(e,{data:"data items columns rows values dimensions samples x",snap:"snap cluster",size:"sizes size radius",color:"colors color fill fill-color fillColor",opacity:"opacity alpha transparency opaque",borderSize:"borderSizes borderSize border-size bordersize borderWidth borderWidths border-width borderwidth stroke-width strokeWidth strokewidth outline",borderColor:"borderColors borderColor bordercolor stroke stroke-color strokeColor",marker:"markers marker shape",range:"range ranges databox dataBox",viewport:"viewport viewBox viewbox",domain:"domain domains area areas",padding:"pad padding paddings pads margin margins",transpose:"transpose transposed",diagonal:"diagonal diag showDiagonal",upper:"upper up top upperhalf upperHalf showupperhalf showUpper showUpperHalf",lower:"lower low bottom lowerhalf lowerHalf showlowerhalf showLowerHalf showLower"}),s=this.traces[t]||(this.traces[t]={id:t,buffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),color:"black",marker:null,size:12,borderColor:"transparent",borderSize:1,viewport:l([r._gl.drawingBufferWidth,r._gl.drawingBufferHeight]),padding:[0,0,0,0],opacity:1,diagonal:!0,upper:!0,lower:!0});if(null!=o.color&&(s.color=o.color),null!=o.size&&(s.size=o.size),null!=o.marker&&(s.marker=o.marker),null!=o.borderColor&&(s.borderColor=o.borderColor),null!=o.borderSize&&(s.borderSize=o.borderSize),null!=o.opacity&&(s.opacity=o.opacity),o.viewport&&(s.viewport=l(o.viewport)),null!=o.diagonal&&(s.diagonal=o.diagonal),null!=o.upper&&(s.upper=o.upper),null!=o.lower&&(s.lower=o.lower),o.data){s.buffer(u(o.data)),s.columns=o.data.length,s.count=o.data[0].length,s.bounds=[];for(var c=0;c<s.columns;c++)s.bounds[c]=i(o.data[c],1)}o.range&&(s.range=o.range,n=s.range&&"number"!=typeof s.range[0]),o.domain&&(s.domain=o.domain);var p=!1;null!=o.padding&&(Array.isArray(o.padding)&&o.padding.length===s.columns&&"number"==typeof o.padding[o.padding.length-1]?(s.padding=o.padding.map(f),p=!0):s.padding=f(o.padding));var m=s.columns,g=s.count,y=s.viewport.width,v=s.viewport.height,_=s.viewport.x,x=s.viewport.y,b=y/m,w=v/m;s.passes=[];for(var M=0;M<m;M++)for(var k=0;k<m;k++)if((s.diagonal||k!==M)&&(s.upper||!(M>k))&&(s.lower||!(M<k))){var T=h(s.id,M,k),L=this.passes[T]||(this.passes[T]={});if(o.data&&(o.transpose?L.positions={x:{buffer:s.buffer,offset:k,count:g,stride:m},y:{buffer:s.buffer,offset:M,count:g,stride:m}}:L.positions={x:{buffer:s.buffer,offset:k*g,count:g},y:{buffer:s.buffer,offset:M*g,count:g}},L.bounds=d(s.bounds,M,k)),o.domain||o.viewport||o.data){var A=p?d(s.padding,M,k):s.padding;if(s.domain){var S=d(s.domain,M,k),E=S[0],C=S[1],D=S[2],P=S[3];L.viewport=[_+E*y+A[0],x+C*v+A[1],_+D*y-A[2],x+P*v-A[3]]}else L.viewport=[_+k*b+b*A[0],x+M*w+w*A[1],_+(k+1)*b-b*A[2],x+(M+1)*w-w*A[3]]}o.color&&(L.color=s.color),o.size&&(L.size=s.size),o.marker&&(L.marker=s.marker),o.borderSize&&(L.borderSize=s.borderSize),o.borderColor&&(L.borderColor=s.borderColor),o.opacity&&(L.opacity=s.opacity),o.range&&(L.range=n?d(s.range,M,k):s.range||L.bounds),s.passes.push(T)}return this},c.prototype.draw=function(){for(var t,e=[],r=arguments.length;r--;)e[r]=arguments[r];if(e.length){for(var n=[],a=0;a<e.length;a++)if("number"==typeof e[a]){var i=this.traces[e[a]],o=i.passes,l=i.passOffset;n.push.apply(n,s(l,l+o.length))}else if(e[a].length){var u=e[a],c=this.traces[a],h=c.passes,d=c.passOffset;h=h.map((function(t,e){n[d+e]=u}))}(t=this.scatter).draw.apply(t,n)}else this.scatter.draw();return this},c.prototype.destroy=function(){return this.traces.forEach((function(t){t.buffer&&t.buffer.destroy&&t.buffer.destroy()})),this.traces=null,this.passes=null,this.scatter.destroy(),this}},{"array-bounds":65,"array-range":67,"flatten-vertex-data":227,"parse-rect":459,"pick-by-alias":465,raf:484,"regl-scatter2d":497}],502:[function(t,e,r){var n;n=function(){function t(t,e){this.id=B++,this.type=t,this.data=e}function e(t){return"["+function t(e){if(0===e.length)return[];var r=e.charAt(0),n=e.charAt(e.length-1);if(1<e.length&&r===n&&('"'===r||"'"===r))return['"'+e.substr(1,e.length-2).replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'];if(r=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(e))return t(e.substr(0,r.index)).concat(t(r[1])).concat(t(e.substr(r.index+r[0].length)));if(1===(r=e.split(".")).length)return['"'+e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'];for(e=[],n=0;n<r.length;++n)e=e.concat(t(r[n]));return e}(t).join("][")+"]"}function r(t){return"string"==typeof t?t.split():t}function n(t){return"string"==typeof t?document.querySelector(t):t}function a(t){var e,a,i,o,s=t||{};t={};var l=[],u=[],c="undefined"==typeof window?1:window.devicePixelRatio,h=!1,d=function(t){},f=function(){};if("string"==typeof s?e=document.querySelector(s):"object"==typeof s&&("string"==typeof s.nodeName&&"function"==typeof s.appendChild&&"function"==typeof s.getBoundingClientRect?e=s:"function"==typeof s.drawArrays||"function"==typeof s.drawElements?i=(o=s).canvas:("gl"in s?o=s.gl:"canvas"in s?i=n(s.canvas):"container"in s&&(a=n(s.container)),"attributes"in s&&(t=s.attributes),"extensions"in s&&(l=r(s.extensions)),"optionalExtensions"in s&&(u=r(s.optionalExtensions)),"onDone"in s&&(d=s.onDone),"profile"in s&&(h=!!s.profile),"pixelRatio"in s&&(c=+s.pixelRatio))),e&&("canvas"===e.nodeName.toLowerCase()?i=e:a=e),!o){if(!i){if(!(e=function(t,e,r){function n(){var e=window.innerWidth,n=window.innerHeight;t!==document.body&&(e=(n=t.getBoundingClientRect()).right-n.left,n=n.bottom-n.top),a.width=r*e,a.height=r*n,j(a.style,{width:e+"px",height:n+"px"})}var a=document.createElement("canvas");return j(a.style,{border:0,margin:0,padding:0,top:0,left:0}),t.appendChild(a),t===document.body&&(a.style.position="absolute",j(t.style,{margin:0,padding:0})),window.addEventListener("resize",n,!1),n(),{canvas:a,onDestroy:function(){window.removeEventListener("resize",n),t.removeChild(a)}}}(a||document.body,0,c)))return null;i=e.canvas,f=e.onDestroy}o=function(t,e){function r(r){try{return t.getContext(r,e)}catch(t){return null}}return r("webgl")||r("experimental-webgl")||r("webgl-experimental")}(i,t)}return o?{gl:o,canvas:i,container:a,extensions:l,optionalExtensions:u,pixelRatio:c,profile:h,onDone:d,onDestroy:f}:(f(),d("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function i(t,e){for(var r=Array(t),n=0;n<t;++n)r[n]=e(n);return r}function o(t){var e,r;return e=(65535<t)<<4,e|=r=(255<(t>>>=e))<<3,(e|=r=(15<(t>>>=r))<<2)|(r=(3<(t>>>=r))<<1)|t>>>r>>1}function s(){function t(t){t:{for(var e=16;268435456>=e;e*=16)if(t<=e){t=e;break t}t=0}return 0<(e=r[o(t)>>2]).length?e.pop():new ArrayBuffer(t)}function e(t){r[o(t.byteLength)>>2].push(t)}var r=i(8,(function(){return[]}));return{alloc:t,free:e,allocType:function(e,r){var n=null;switch(e){case 5120:n=new Int8Array(t(r),0,r);break;case 5121:n=new Uint8Array(t(r),0,r);break;case 5122:n=new Int16Array(t(2*r),0,r);break;case 5123:n=new Uint16Array(t(2*r),0,r);break;case 5124:n=new Int32Array(t(4*r),0,r);break;case 5125:n=new Uint32Array(t(4*r),0,r);break;case 5126:n=new Float32Array(t(4*r),0,r);break;default:return null}return n.length!==r?n.subarray(0,r):n},freeType:function(t){e(t.buffer)}}}function l(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)||q(t.data))}function u(t,e,r,n,a,i){for(var o=0;o<e;++o)for(var s=t[o],l=0;l<r;++l)for(var u=s[l],c=0;c<n;++c)a[i++]=u[c]}function c(t){return 0|J[Object.prototype.toString.call(t)]}function h(t,e){for(var r=0;r<e.length;++r)t[r]=e[r]}function d(t,e,r,n,a,i,o){for(var s=0,l=0;l<r;++l)for(var u=0;u<n;++u)t[s++]=e[a*l+i*u+o]}function f(t,e,r,n){function a(e){this.id=u++,this.buffer=t.createBuffer(),this.type=e,this.usage=35044,this.byteLength=0,this.dimension=1,this.dtype=5121,this.persistentData=null,r.profile&&(this.stats={size:0})}function i(e,r,n){e.byteLength=r.byteLength,t.bufferData(e.type,r,n)}function o(t,e,r,n,a,o){if(t.usage=r,Array.isArray(e)){if(t.dtype=n||5126,0<e.length)if(Array.isArray(e[0])){a=tt(e);for(var s=n=1;s<a.length;++s)n*=a[s];t.dimension=n,i(t,e=Q(e,a,t.dtype),r),o?t.persistentData=e:W.freeType(e)}else"number"==typeof e[0]?(t.dimension=a,h(a=W.allocType(t.dtype,e.length),e),i(t,a,r),o?t.persistentData=a:W.freeType(a)):q(e[0])&&(t.dimension=e[0].length,t.dtype=n||c(e[0])||5126,i(t,e=Q(e,[e.length,e[0].length],t.dtype),r),o?t.persistentData=e:W.freeType(e))}else if(q(e))t.dtype=n||c(e),t.dimension=a,i(t,e,r),o&&(t.persistentData=new Uint8Array(new Uint8Array(e.buffer)));else if(l(e)){a=e.shape;var u=e.stride,f=(s=e.offset,0),p=0,m=0,g=0;1===a.length?(f=a[0],p=1,m=u[0],g=0):2===a.length&&(f=a[0],p=a[1],m=u[0],g=u[1]),t.dtype=n||c(e.data)||5126,t.dimension=p,d(a=W.allocType(t.dtype,f*p),e.data,f,p,m,g,s),i(t,a,r),o?t.persistentData=a:W.freeType(a)}}function s(r){e.bufferCount--;for(var a=0;a<n.state.length;++a){var i=n.state[a];i.buffer===r&&(t.disableVertexAttribArray(a),i.buffer=null)}t.deleteBuffer(r.buffer),r.buffer=null,delete f[r.id]}var u=0,f={};a.prototype.bind=function(){t.bindBuffer(this.type,this.buffer)},a.prototype.destroy=function(){s(this)};var p=[];return r.profile&&(e.getTotalBufferSize=function(){var t=0;return Object.keys(f).forEach((function(e){t+=f[e].stats.size})),t}),{create:function(n,i,u,p){function m(e){var n=35044,a=null,i=0,s=0,u=1;return Array.isArray(e)||q(e)||l(e)?a=e:"number"==typeof e?i=0|e:e&&("data"in e&&(a=e.data),"usage"in e&&(n=$[e.usage]),"type"in e&&(s=K[e.type]),"dimension"in e&&(u=0|e.dimension),"length"in e&&(i=0|e.length)),g.bind(),a?o(g,a,n,s,u,p):(i&&t.bufferData(g.type,i,n),g.dtype=s||5121,g.usage=n,g.dimension=u,g.byteLength=i),r.profile&&(g.stats.size=g.byteLength*et[g.dtype]),m}e.bufferCount++;var g=new a(i);return f[g.id]=g,u||m(n),m._reglType="buffer",m._buffer=g,m.subdata=function(e,r){var n,a=0|(r||0);if(g.bind(),q(e))t.bufferSubData(g.type,a,e);else if(Array.isArray(e)){if(0<e.length)if("number"==typeof e[0]){var i=W.allocType(g.dtype,e.length);h(i,e),t.bufferSubData(g.type,a,i),W.freeType(i)}else(Array.isArray(e[0])||q(e[0]))&&(n=tt(e),i=Q(e,n,g.dtype),t.bufferSubData(g.type,a,i),W.freeType(i))}else if(l(e)){n=e.shape;var o=e.stride,s=i=0,u=0,f=0;1===n.length?(i=n[0],s=1,u=o[0],f=0):2===n.length&&(i=n[0],s=n[1],u=o[0],f=o[1]),n=Array.isArray(e.data)?g.dtype:c(e.data),d(n=W.allocType(n,i*s),e.data,i,s,u,f,e.offset),t.bufferSubData(g.type,a,n),W.freeType(n)}return m},r.profile&&(m.stats=g.stats),m.destroy=function(){s(g)},m},createStream:function(t,e){var r=p.pop();return r||(r=new a(t)),r.bind(),o(r,e,35040,0,1,!1),r},destroyStream:function(t){p.push(t)},clear:function(){Z(f).forEach(s),p.forEach(s)},getBuffer:function(t){return t&&t._buffer instanceof a?t._buffer:null},restore:function(){Z(f).forEach((function(e){e.buffer=t.createBuffer(),t.bindBuffer(e.type,e.buffer),t.bufferData(e.type,e.persistentData||e.byteLength,e.usage)}))},_initBuffer:o}}function p(t,e,r,n){function a(t){this.id=u++,s[this.id]=this,this.buffer=t,this.primType=4,this.type=this.vertCount=0}function i(n,a,i,o,s,u,c){if(n.buffer.bind(),a){var h=c;c||q(a)&&(!l(a)||q(a.data))||(h=e.oes_element_index_uint?5125:5123),r._initBuffer(n.buffer,a,i,h,3)}else t.bufferData(34963,u,i),n.buffer.dtype=h||5121,n.buffer.usage=i,n.buffer.dimension=3,n.buffer.byteLength=u;if(h=c,!c){switch(n.buffer.dtype){case 5121:case 5120:h=5121;break;case 5123:case 5122:h=5123;break;case 5125:case 5124:h=5125}n.buffer.dtype=h}n.type=h,0>(a=s)&&(a=n.buffer.byteLength,5123===h?a>>=1:5125===h&&(a>>=2)),n.vertCount=a,a=o,0>o&&(a=4,1===(o=n.buffer.dimension)&&(a=0),2===o&&(a=1),3===o&&(a=4)),n.primType=a}function o(t){n.elementsCount--,delete s[t.id],t.buffer.destroy(),t.buffer=null}var s={},u=0,c={uint8:5121,uint16:5123};e.oes_element_index_uint&&(c.uint32=5125),a.prototype.bind=function(){this.buffer.bind()};var h=[];return{create:function(t,e){function s(t){if(t)if("number"==typeof t)u(t),h.primType=4,h.vertCount=0|t,h.type=5121;else{var e=null,r=35044,n=-1,a=-1,o=0,d=0;Array.isArray(t)||q(t)||l(t)?e=t:("data"in t&&(e=t.data),"usage"in t&&(r=$[t.usage]),"primitive"in t&&(n=rt[t.primitive]),"count"in t&&(a=0|t.count),"type"in t&&(d=c[t.type]),"length"in t?o=0|t.length:(o=a,5123===d||5122===d?o*=2:5125!==d&&5124!==d||(o*=4))),i(h,e,r,n,a,o,d)}else u(),h.primType=4,h.vertCount=0,h.type=5121;return s}var u=r.create(null,34963,!0),h=new a(u._buffer);return n.elementsCount++,s(t),s._reglType="elements",s._elements=h,s.subdata=function(t,e){return u.subdata(t,e),s},s.destroy=function(){o(h)},s},createStream:function(t){var e=h.pop();return e||(e=new a(r.create(null,34963,!0,!1)._buffer)),i(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){h.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof a?t._elements:null},clear:function(){Z(s).forEach(o)}}}function m(t){for(var e=W.allocType(5123,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(-1/0===t[r])e[r]=64512;else{nt[0]=t[r];var n=(i=at[0])>>>31<<15,a=(i<<1>>>24)-127,i=i>>13&1023;e[r]=-24>a?n:-14>a?n+(i+1024>>-14-a):15<a?n+31744:n+(a+15<<10)+i}return e}function g(t){return Array.isArray(t)||q(t)}function y(t){return"[object "+t+"]"}function v(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function _(t){return!(!Array.isArray(t)||0===t.length||!g(t[0]))}function x(t){return Object.prototype.toString.call(t)}function b(t){if(!t)return!1;var e=x(t);return 0<=ft.indexOf(e)||v(t)||_(t)||l(t)}function w(t,e){36193===t.type?(t.data=m(e),W.freeType(e)):t.data=e}function M(t,e,r,n,a,i){if(t=void 0!==mt[t]?mt[t]:st[t]*pt[e],i&&(t*=6),a){for(n=0;1<=r;)n+=t*r*r,r/=2;return n}return t*r*n}function k(t,e,r,n,a,i,o){function s(){this.format=this.internalformat=6408,this.type=5121,this.flipY=this.premultiplyAlpha=this.compressed=!1,this.unpackAlignment=1,this.colorSpace=37444,this.channels=this.height=this.width=0}function u(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 c(t,e){if("object"==typeof e&&e){"premultiplyAlpha"in e&&(t.premultiplyAlpha=e.premultiplyAlpha),"flipY"in e&&(t.flipY=e.flipY),"alignment"in e&&(t.unpackAlignment=e.alignment),"colorSpace"in e&&(t.colorSpace=U[e.colorSpace]),"type"in e&&(t.type=V[e.type]);var r=t.width,n=t.height,a=t.channels,i=!1;"shape"in e?(r=e.shape[0],n=e.shape[1],3===e.shape.length&&(a=e.shape[2],i=!0)):("radius"in e&&(r=n=e.radius),"width"in e&&(r=e.width),"height"in e&&(n=e.height),"channels"in e&&(a=e.channels,i=!0)),t.width=0|r,t.height=0|n,t.channels=0|a,r=!1,"format"in e&&(r=e.format,n=t.internalformat=G[r],t.format=ft[n],r in V&&!("type"in e)&&(t.type=V[r]),r in K&&(t.compressed=!0),r=!0),!i&&r?t.channels=st[t.format]:i&&!r&&t.channels!==ot[t.format]&&(t.format=t.internalformat=ot[t.channels])}}function h(e){t.pixelStorei(37440,e.flipY),t.pixelStorei(37441,e.premultiplyAlpha),t.pixelStorei(37443,e.colorSpace),t.pixelStorei(3317,e.unpackAlignment)}function d(){s.call(this),this.yOffset=this.xOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function f(t,e){var r=null;if(b(e)?r=e:e&&(c(t,e),"x"in e&&(t.xOffset=0|e.x),"y"in e&&(t.yOffset=0|e.y),b(e.data)&&(r=e.data)),e.copy){var n=a.viewportWidth,i=a.viewportHeight;t.width=t.width||n-t.xOffset,t.height=t.height||i-t.yOffset,t.needsCopy=!0}else if(r){if(q(r))t.channels=t.channels||4,t.data=r,"type"in e||5121!==t.type||(t.type=0|J[Object.prototype.toString.call(r)]);else if(v(r)){switch(t.channels=t.channels||4,i=(n=r).length,t.type){case 5121:case 5123:case 5125:case 5126:(i=W.allocType(t.type,i)).set(n),t.data=i;break;case 36193:t.data=m(n)}t.alignment=1,t.needsFree=!0}else if(l(r)){n=r.data,Array.isArray(n)||5121!==t.type||(t.type=0|J[Object.prototype.toString.call(n)]),i=r.shape;var o,s,u,h,d=r.stride;3===i.length?(u=i[2],h=d[2]):h=u=1,o=i[0],s=i[1],i=d[0],d=d[1],t.alignment=1,t.width=o,t.height=s,t.channels=u,t.format=t.internalformat=ot[u],t.needsFree=!0,o=h,r=r.offset,u=t.width,h=t.height,s=t.channels;for(var f=W.allocType(36193===t.type?5126:t.type,u*h*s),p=0,y=0;y<h;++y)for(var M=0;M<u;++M)for(var k=0;k<s;++k)f[p++]=n[i*M+d*y+o*k+r];w(t,f)}else if(x(r)===lt||x(r)===ut)x(r)===lt?t.element=r:t.element=r.canvas,t.width=t.element.width,t.height=t.element.height,t.channels=4;else if(x(r)===ct)t.element=r,t.width=r.width,t.height=r.height,t.channels=4;else if(x(r)===ht)t.element=r,t.width=r.naturalWidth,t.height=r.naturalHeight,t.channels=4;else if(x(r)===dt)t.element=r,t.width=r.videoWidth,t.height=r.videoHeight,t.channels=4;else if(_(r)){for(n=t.width||r[0].length,i=t.height||r.length,d=t.channels,d=g(r[0][0])?d||r[0][0].length:d||1,o=X.shape(r),u=1,h=0;h<o.length;++h)u*=o[h];u=W.allocType(36193===t.type?5126:t.type,u),X.flatten(r,o,"",u),w(t,u),t.alignment=1,t.width=n,t.height=i,t.channels=d,t.format=t.internalformat=ot[d],t.needsFree=!0}}else t.width=t.width||1,t.height=t.height||1,t.channels=t.channels||4}function p(e,r,a,i,o){var s=e.element,l=e.data,u=e.internalformat,c=e.format,d=e.type,f=e.width,p=e.height;h(e),s?t.texSubImage2D(r,o,a,i,c,d,s):e.compressed?t.compressedTexSubImage2D(r,o,a,i,u,f,p,l):e.needsCopy?(n(),t.copyTexSubImage2D(r,o,a,i,e.xOffset,e.yOffset,f,p)):t.texSubImage2D(r,o,a,i,f,p,c,d,l)}function y(){return pt.pop()||new d}function k(t){t.needsFree&&W.freeType(t.data),d.call(t),pt.push(t)}function T(){s.call(this),this.genMipmaps=!1,this.mipmapHint=4352,this.mipmask=0,this.images=Array(16)}function L(t,e,r){var n=t.images[0]=y();t.mipmask=1,n.width=t.width=e,n.height=t.height=r,n.channels=t.channels=4}function A(t,e){var r=null;if(b(e))u(r=t.images[0]=y(),t),f(r,e),t.mipmask=1;else if(c(t,e),Array.isArray(e.mipmap))for(var n=e.mipmap,a=0;a<n.length;++a)u(r=t.images[a]=y(),t),r.width>>=a,r.height>>=a,f(r,n[a]),t.mipmask|=1<<a;else u(r=t.images[0]=y(),t),f(r,e),t.mipmask=1;u(t,t.images[0])}function S(e,r){for(var a=e.images,i=0;i<a.length&&a[i];++i){var o=a[i],s=r,l=i,u=o.element,c=o.data,d=o.internalformat,f=o.format,p=o.type,m=o.width,g=o.height,y=o.channels;h(o),u?t.texImage2D(s,l,f,f,p,u):o.compressed?t.compressedTexImage2D(s,l,d,m,g,0,c):o.needsCopy?(n(),t.copyTexImage2D(s,l,f,o.xOffset,o.yOffset,m,g,0)):((o=!c)&&(c=W.zero.allocType(p,m*g*y)),t.texImage2D(s,l,f,m,g,0,f,p,c),o&&c&&W.zero.freeType(c))}}function E(){var t=mt.pop()||new T;s.call(t);for(var e=t.mipmask=0;16>e;++e)t.images[e]=null;return t}function C(t){for(var e=t.images,r=0;r<e.length;++r)e[r]&&k(e[r]),e[r]=null;mt.push(t)}function D(){this.magFilter=this.minFilter=9728,this.wrapT=this.wrapS=33071,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=4352}function P(t,e){"min"in e&&(t.minFilter=H[e.min],0<=it.indexOf(t.minFilter)&&!("faces"in e)&&(t.genMipmaps=!0)),"mag"in e&&(t.magFilter=B[e.mag]);var r=t.wrapS,n=t.wrapT;if("wrap"in e){var a=e.wrap;"string"==typeof a?r=n=Y[a]:Array.isArray(a)&&(r=Y[a[0]],n=Y[a[1]])}else"wrapS"in e&&(r=Y[e.wrapS]),"wrapT"in e&&(n=Y[e.wrapT]);if(t.wrapS=r,t.wrapT=n,"anisotropic"in e&&(t.anisotropic=e.anisotropic),"mipmap"in e){switch(r=!1,typeof e.mipmap){case"string":t.mipmapHint=N[e.mipmap],r=t.genMipmaps=!0;break;case"boolean":r=t.genMipmaps=e.mipmap;break;case"object":t.genMipmaps=!1,r=!0}!r||"min"in e||(t.minFilter=9984)}}function O(r,n){t.texParameteri(n,10241,r.minFilter),t.texParameteri(n,10240,r.magFilter),t.texParameteri(n,10242,r.wrapS),t.texParameteri(n,10243,r.wrapT),e.ext_texture_filter_anisotropic&&t.texParameteri(n,34046,r.anisotropic),r.genMipmaps&&(t.hint(33170,r.mipmapHint),t.generateMipmap(n))}function z(e){s.call(this),this.mipmask=0,this.internalformat=6408,this.id=gt++,this.refCount=1,this.target=e,this.texture=t.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new D,o.profile&&(this.stats={size:0})}function I(e){t.activeTexture(33984),t.bindTexture(e.target,e.texture)}function R(){var e=_t[0];e?t.bindTexture(e.target,e.texture):t.bindTexture(3553,null)}function F(e){var r=e.texture,n=e.unit,a=e.target;0<=n&&(t.activeTexture(33984+n),t.bindTexture(a,null),_t[n]=null),t.deleteTexture(r),e.texture=null,e.params=null,e.pixels=null,e.refCount=0,delete yt[e.id],i.textureCount--}var N={"don't care":4352,"dont care":4352,nice:4354,fast:4353},Y={repeat:10497,clamp:33071,mirror:33648},B={nearest:9728,linear:9729},H=j({mipmap:9987,"nearest mipmap nearest":9984,"linear mipmap nearest":9985,"nearest mipmap linear":9986,"linear mipmap linear":9987},B),U={none:0,browser:37444},V={uint8:5121,rgba4:32819,rgb565:33635,"rgb5 a1":32820},G={alpha:6406,luminance:6409,"luminance alpha":6410,rgb:6407,rgba:6408,rgba4:32854,"rgb5 a1":32855,rgb565:36194},K={};e.ext_srgb&&(G.srgb=35904,G.srgba=35906),e.oes_texture_float&&(V.float32=V.float=5126),e.oes_texture_half_float&&(V.float16=V["half float"]=36193),e.webgl_depth_texture&&(j(G,{depth:6402,"depth stencil":34041}),j(V,{uint16:5123,uint32:5125,"depth stencil":34042})),e.webgl_compressed_texture_s3tc&&j(K,{"rgb s3tc dxt1":33776,"rgba s3tc dxt1":33777,"rgba s3tc dxt3":33778,"rgba s3tc dxt5":33779}),e.webgl_compressed_texture_atc&&j(K,{"rgb atc":35986,"rgba atc explicit alpha":35987,"rgba atc interpolated alpha":34798}),e.webgl_compressed_texture_pvrtc&&j(K,{"rgb pvrtc 4bppv1":35840,"rgb pvrtc 2bppv1":35841,"rgba pvrtc 4bppv1":35842,"rgba pvrtc 2bppv1":35843}),e.webgl_compressed_texture_etc1&&(K["rgb etc1"]=36196);var $=Array.prototype.slice.call(t.getParameter(34467));Object.keys(K).forEach((function(t){var e=K[t];0<=$.indexOf(e)&&(G[t]=e)}));var Q=Object.keys(G);r.textureFormats=Q;var tt=[];Object.keys(G).forEach((function(t){tt[G[t]]=t}));var et=[];Object.keys(V).forEach((function(t){et[V[t]]=t}));var rt=[];Object.keys(B).forEach((function(t){rt[B[t]]=t}));var nt=[];Object.keys(H).forEach((function(t){nt[H[t]]=t}));var at=[];Object.keys(Y).forEach((function(t){at[Y[t]]=t}));var ft=Q.reduce((function(t,e){var r=G[e];return 6409===r||6406===r||6409===r||6410===r||6402===r||34041===r?t[r]=r:32855===r||0<=e.indexOf("rgba")?t[r]=6408:t[r]=6407,t}),{}),pt=[],mt=[],gt=0,yt={},vt=r.maxTextureUnits,_t=Array(vt).map((function(){return null}));return j(z.prototype,{bind:function(){this.bindCount+=1;var e=this.unit;if(0>e){for(var r=0;r<vt;++r){var n=_t[r];if(n){if(0<n.bindCount)continue;n.unit=-1}_t[r]=this,e=r;break}o.profile&&i.maxTextureUnits<e+1&&(i.maxTextureUnits=e+1),this.unit=e,t.activeTexture(33984+e),t.bindTexture(this.target,this.texture)}return e},unbind:function(){--this.bindCount},decRef:function(){0>=--this.refCount&&F(this)}}),o.profile&&(i.getTotalTextureSize=function(){var t=0;return Object.keys(yt).forEach((function(e){t+=yt[e].stats.size})),t}),{create2D:function(e,r){function n(t,e){var r=a.texInfo;D.call(r);var i=E();return"number"==typeof t?L(i,0|t,"number"==typeof e?0|e:0|t):t?(P(r,t),A(i,t)):L(i,1,1),r.genMipmaps&&(i.mipmask=(i.width<<1)-1),a.mipmask=i.mipmask,u(a,i),a.internalformat=i.internalformat,n.width=i.width,n.height=i.height,I(a),S(i,3553),O(r,3553),R(),C(i),o.profile&&(a.stats.size=M(a.internalformat,a.type,i.width,i.height,r.genMipmaps,!1)),n.format=tt[a.internalformat],n.type=et[a.type],n.mag=rt[r.magFilter],n.min=nt[r.minFilter],n.wrapS=at[r.wrapS],n.wrapT=at[r.wrapT],n}var a=new z(3553);return yt[a.id]=a,i.textureCount++,n(e,r),n.subimage=function(t,e,r,i){e|=0,r|=0,i|=0;var o=y();return u(o,a),o.width=0,o.height=0,f(o,t),o.width=o.width||(a.width>>i)-e,o.height=o.height||(a.height>>i)-r,I(a),p(o,3553,e,r,i),R(),k(o),n},n.resize=function(e,r){var i=0|e,s=0|r||i;if(i===a.width&&s===a.height)return n;n.width=a.width=i,n.height=a.height=s,I(a);for(var l,u=a.channels,c=a.type,h=0;a.mipmask>>h;++h){var d=i>>h,f=s>>h;if(!d||!f)break;l=W.zero.allocType(c,d*f*u),t.texImage2D(3553,h,a.format,d,f,0,a.format,a.type,l),l&&W.zero.freeType(l)}return R(),o.profile&&(a.stats.size=M(a.internalformat,a.type,i,s,!1,!1)),n},n._reglType="texture2d",n._texture=a,o.profile&&(n.stats=a.stats),n.destroy=function(){a.decRef()},n},createCube:function(e,r,n,a,s,l){function h(t,e,r,n,a,i){var s,l=d.texInfo;for(D.call(l),s=0;6>s;++s)m[s]=E();if("number"!=typeof t&&t){if("object"==typeof t)if(e)A(m[0],t),A(m[1],e),A(m[2],r),A(m[3],n),A(m[4],a),A(m[5],i);else if(P(l,t),c(d,t),"faces"in t)for(t=t.faces,s=0;6>s;++s)u(m[s],d),A(m[s],t[s]);else for(s=0;6>s;++s)A(m[s],t)}else for(t=0|t||1,s=0;6>s;++s)L(m[s],t,t);for(u(d,m[0]),d.mipmask=l.genMipmaps?(m[0].width<<1)-1:m[0].mipmask,d.internalformat=m[0].internalformat,h.width=m[0].width,h.height=m[0].height,I(d),s=0;6>s;++s)S(m[s],34069+s);for(O(l,34067),R(),o.profile&&(d.stats.size=M(d.internalformat,d.type,h.width,h.height,l.genMipmaps,!0)),h.format=tt[d.internalformat],h.type=et[d.type],h.mag=rt[l.magFilter],h.min=nt[l.minFilter],h.wrapS=at[l.wrapS],h.wrapT=at[l.wrapT],s=0;6>s;++s)C(m[s]);return h}var d=new z(34067);yt[d.id]=d,i.cubeCount++;var m=Array(6);return h(e,r,n,a,s,l),h.subimage=function(t,e,r,n,a){r|=0,n|=0,a|=0;var i=y();return u(i,d),i.width=0,i.height=0,f(i,e),i.width=i.width||(d.width>>a)-r,i.height=i.height||(d.height>>a)-n,I(d),p(i,34069+t,r,n,a),R(),k(i),h},h.resize=function(e){if((e|=0)!==d.width){h.width=d.width=e,h.height=d.height=e,I(d);for(var r=0;6>r;++r)for(var n=0;d.mipmask>>n;++n)t.texImage2D(34069+r,n,d.format,e>>n,e>>n,0,d.format,d.type,null);return R(),o.profile&&(d.stats.size=M(d.internalformat,d.type,h.width,h.height,!1,!0)),h}},h._reglType="textureCube",h._texture=d,o.profile&&(h.stats=d.stats),h.destroy=function(){d.decRef()},h},clear:function(){for(var e=0;e<vt;++e)t.activeTexture(33984+e),t.bindTexture(3553,null),_t[e]=null;Z(yt).forEach(F),i.cubeCount=0,i.textureCount=0},getTexture:function(t){return null},restore:function(){for(var e=0;e<vt;++e){var r=_t[e];r&&(r.bindCount=0,r.unit=-1,_t[e]=null)}Z(yt).forEach((function(e){e.texture=t.createTexture(),t.bindTexture(e.target,e.texture);for(var r=0;32>r;++r)if(0!=(e.mipmask&1<<r))if(3553===e.target)t.texImage2D(3553,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);else for(var n=0;6>n;++n)t.texImage2D(34069+n,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);O(e.texInfo,e.target)}))}}}function T(t,e,r,n,a,i){function o(t,e,r){this.target=t,this.texture=e,this.renderbuffer=r;var n=t=0;e?(t=e.width,n=e.height):r&&(t=r.width,n=r.height),this.width=t,this.height=n}function s(t){t&&(t.texture&&t.texture._texture.decRef(),t.renderbuffer&&t.renderbuffer._renderbuffer.decRef())}function l(t,e,r){t&&(t.texture?t.texture._texture.refCount+=1:t.renderbuffer._renderbuffer.refCount+=1)}function u(e,r){r&&(r.texture?t.framebufferTexture2D(36160,e,r.target,r.texture._texture.texture,0):t.framebufferRenderbuffer(36160,e,36161,r.renderbuffer._renderbuffer.renderbuffer))}function c(t){var e=3553,r=null,n=null,a=t;return"object"==typeof t&&(a=t.data,"target"in t&&(e=0|t.target)),"texture2d"===(t=a._reglType)||"textureCube"===t?r=a:"renderbuffer"===t&&(n=a,e=36161),new o(e,r,n)}function h(t,e,r,i,s){return r?((t=n.create2D({width:t,height:e,format:i,type:s}))._texture.refCount=0,new o(3553,t,null)):((t=a.create({width:t,height:e,format:i}))._renderbuffer.refCount=0,new o(36161,null,t))}function d(t){return t&&(t.texture||t.renderbuffer)}function f(t,e,r){t&&(t.texture?t.texture.resize(e,r):t.renderbuffer&&t.renderbuffer.resize(e,r),t.width=e,t.height=r)}function p(){this.id=M++,k[this.id]=this,this.framebuffer=t.createFramebuffer(),this.height=this.width=0,this.colorAttachments=[],this.depthStencilAttachment=this.stencilAttachment=this.depthAttachment=null}function m(t){t.colorAttachments.forEach(s),s(t.depthAttachment),s(t.stencilAttachment),s(t.depthStencilAttachment)}function g(e){t.deleteFramebuffer(e.framebuffer),e.framebuffer=null,i.framebufferCount--,delete k[e.id]}function y(e){var n;t.bindFramebuffer(36160,e.framebuffer);var a=e.colorAttachments;for(n=0;n<a.length;++n)u(36064+n,a[n]);for(n=a.length;n<r.maxColorAttachments;++n)t.framebufferTexture2D(36160,36064+n,3553,null,0);t.framebufferTexture2D(36160,33306,3553,null,0),t.framebufferTexture2D(36160,36096,3553,null,0),t.framebufferTexture2D(36160,36128,3553,null,0),u(36096,e.depthAttachment),u(36128,e.stencilAttachment),u(33306,e.depthStencilAttachment),t.checkFramebufferStatus(36160),t.isContextLost(),t.bindFramebuffer(36160,_.next?_.next.framebuffer:null),_.cur=_.next,t.getError()}function v(t,e){function r(t,e){var a,i=0,o=0,s=!0,u=!0;a=null;var f=!0,p="rgba",g="uint8",v=1,_=null,w=null,M=null,k=!1;"number"==typeof t?(i=0|t,o=0|e||i):t?("shape"in t?(i=(o=t.shape)[0],o=o[1]):("radius"in t&&(i=o=t.radius),"width"in t&&(i=t.width),"height"in t&&(o=t.height)),("color"in t||"colors"in t)&&(a=t.color||t.colors,Array.isArray(a)),a||("colorCount"in t&&(v=0|t.colorCount),"colorTexture"in t&&(f=!!t.colorTexture,p="rgba4"),"colorType"in t&&(g=t.colorType,!f)&&("half float"===g||"float16"===g?p="rgba16f":"float"!==g&&"float32"!==g||(p="rgba32f")),"colorFormat"in t&&(p=t.colorFormat,0<=x.indexOf(p)?f=!0:0<=b.indexOf(p)&&(f=!1))),("depthTexture"in t||"depthStencilTexture"in t)&&(k=!(!t.depthTexture&&!t.depthStencilTexture)),"depth"in t&&("boolean"==typeof t.depth?s=t.depth:(_=t.depth,u=!1)),"stencil"in t&&("boolean"==typeof t.stencil?u=t.stencil:(w=t.stencil,s=!1)),"depthStencil"in t&&("boolean"==typeof t.depthStencil?s=u=t.depthStencil:(M=t.depthStencil,u=s=!1))):i=o=1;var T=null,L=null,A=null,S=null;if(Array.isArray(a))T=a.map(c);else if(a)T=[c(a)];else for(T=Array(v),a=0;a<v;++a)T[a]=h(i,o,f,p,g);for(i=i||T[0].width,o=o||T[0].height,_?L=c(_):s&&!u&&(L=h(i,o,k,"depth","uint32")),w?A=c(w):u&&!s&&(A=h(i,o,!1,"stencil","uint8")),M?S=c(M):!_&&!w&&u&&s&&(S=h(i,o,k,"depth stencil","depth stencil")),s=null,a=0;a<T.length;++a)l(T[a]),T[a]&&T[a].texture&&(u=vt[T[a].texture._texture.format]*_t[T[a].texture._texture.type],null===s&&(s=u));return l(L),l(A),l(S),m(n),n.width=i,n.height=o,n.colorAttachments=T,n.depthAttachment=L,n.stencilAttachment=A,n.depthStencilAttachment=S,r.color=T.map(d),r.depth=d(L),r.stencil=d(A),r.depthStencil=d(S),r.width=n.width,r.height=n.height,y(n),r}var n=new p;return i.framebufferCount++,r(t,e),j(r,{resize:function(t,e){var a=Math.max(0|t,1),i=Math.max(0|e||a,1);if(a===n.width&&i===n.height)return r;for(var o=n.colorAttachments,s=0;s<o.length;++s)f(o[s],a,i);return f(n.depthAttachment,a,i),f(n.stencilAttachment,a,i),f(n.depthStencilAttachment,a,i),n.width=r.width=a,n.height=r.height=i,y(n),r},_reglType:"framebuffer",_framebuffer:n,destroy:function(){g(n),m(n)},use:function(t){_.setFBO({framebuffer:r},t)}})}var _={cur:null,next:null,dirty:!1,setFBO:null},x=["rgba"],b=["rgba4","rgb565","rgb5 a1"];e.ext_srgb&&b.push("srgba"),e.ext_color_buffer_half_float&&b.push("rgba16f","rgb16f"),e.webgl_color_buffer_float&&b.push("rgba32f");var w=["uint8"];e.oes_texture_half_float&&w.push("half float","float16"),e.oes_texture_float&&w.push("float","float32");var M=0,k={};return j(_,{getFramebuffer:function(t){return"function"==typeof t&&"framebuffer"===t._reglType&&(t=t._framebuffer)instanceof p?t:null},create:v,createCube:function(t){function e(t){var a,i={color:null},o=0,s=null;a="rgba";var l="uint8",u=1;if("number"==typeof t?o=0|t:t?("shape"in t?o=t.shape[0]:("radius"in t&&(o=0|t.radius),"width"in t?o=0|t.width:"height"in t&&(o=0|t.height)),("color"in t||"colors"in t)&&(s=t.color||t.colors,Array.isArray(s)),s||("colorCount"in t&&(u=0|t.colorCount),"colorType"in t&&(l=t.colorType),"colorFormat"in t&&(a=t.colorFormat)),"depth"in t&&(i.depth=t.depth),"stencil"in t&&(i.stencil=t.stencil),"depthStencil"in t&&(i.depthStencil=t.depthStencil)):o=1,s)if(Array.isArray(s))for(t=[],a=0;a<s.length;++a)t[a]=s[a];else t=[s];else for(t=Array(u),s={radius:o,format:a,type:l},a=0;a<u;++a)t[a]=n.createCube(s);for(i.color=Array(t.length),a=0;a<t.length;++a)u=t[a],o=o||u.width,i.color[a]={target:34069,data:t[a]};for(a=0;6>a;++a){for(u=0;u<t.length;++u)i.color[u].target=34069+a;0<a&&(i.depth=r[0].depth,i.stencil=r[0].stencil,i.depthStencil=r[0].depthStencil),r[a]?r[a](i):r[a]=v(i)}return j(e,{width:o,height:o,color:t})}var r=Array(6);return e(t),j(e,{faces:r,resize:function(t){var n=0|t;if(n===e.width)return e;var a=e.color;for(t=0;t<a.length;++t)a[t].resize(n);for(t=0;6>t;++t)r[t].resize(n);return e.width=e.height=n,e},_reglType:"framebufferCube",destroy:function(){r.forEach((function(t){t.destroy()}))}})},clear:function(){Z(k).forEach(g)},restore:function(){_.cur=null,_.next=null,_.dirty=!0,Z(k).forEach((function(e){e.framebuffer=t.createFramebuffer(),y(e)}))}})}function L(){this.w=this.z=this.y=this.x=this.state=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.divisor=this.stride=this.offset=0}function A(t,e,r,n){function a(t,e,r,n){this.name=t,this.id=e,this.location=r,this.info=n}function i(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,a){if(!(o=(a=35632===r?u:c)[n])){var i=e.str(n),o=t.createShader(r);t.shaderSource(o,i),t.compileShader(o),a[n]=o}return o}function s(t,e){this.id=f++,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;l=o(35632,r.fragId),u=o(35633,r.vertId);var c=r.program=t.createProgram();t.attachShader(c,l),t.attachShader(c,u),t.linkProgram(c);var h=t.getProgramParameter(c,35718);n.profile&&(r.stats.uniformsCount=h);var d=r.uniforms;for(l=0;l<h;++l)if(u=t.getActiveUniform(c,l))if(1<u.size)for(var f=0;f<u.size;++f){var p=u.name.replace("[0]","["+f+"]");i(d,new a(p,e.id(p),t.getUniformLocation(c,p),u))}else i(d,new a(u.name,e.id(u.name),t.getUniformLocation(c,u.name),u));for(h=t.getProgramParameter(c,35721),n.profile&&(r.stats.attributesCount=h),d=r.attributes,l=0;l<h;++l)(u=t.getActiveAttrib(c,l))&&i(d,new a(u.name,e.id(u.name),t.getAttribLocation(c,u.name),u))}var u={},c={},h={},d=[],f=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);Z(u).forEach(e),u={},Z(c).forEach(e),c={},d.forEach((function(e){t.deleteProgram(e.program)})),d.length=0,h={},r.shaderCount=0},program:function(t,e,n){var a=h[e];a||(a=h[e]={});var i=a[t];return i||(i=new s(e,t),r.shaderCount++,l(i),a[t]=i,d.push(i)),i},restore:function(){u={},c={};for(var t=0;t<d.length;++t)l(d[t])},shader:o,frag:-1,vert:-1}}function S(t,e,r,n,a,i,o){function s(a){var i;i=null===e.next?5121:e.next.colorAttachments[0].texture._texture.type;var o=0,s=0,l=n.framebufferWidth,u=n.framebufferHeight,c=null;return q(a)?c=a:a&&(o=0|a.x,s=0|a.y,l=0|(a.width||n.framebufferWidth-o),u=0|(a.height||n.framebufferHeight-s),c=a.data||null),r(),a=l*u*4,c||(5121===i?c=new Uint8Array(a):5126===i&&(c=c||new Float32Array(a))),t.pixelStorei(3333,4),t.readPixels(o,s,l,u,6408,i,c),c}return function(t){return t&&"framebuffer"in t?function(t){var r;return e.setFBO({framebuffer:t.framebuffer},(function(){r=s(t)})),r}(t):s(t)}}function E(t){return Array.prototype.slice.call(t)}function C(t){return E(t).join("")}function D(){function t(){var t=[],e=[];return j((function(){t.push.apply(t,E(arguments))}),{def:function(){var n="v"+r++;return e.push(n),0<arguments.length&&(t.push(n,"="),t.push.apply(t,E(arguments)),t.push(";")),n},toString:function(){return C([0<e.length?"var "+e+";":"",C(t)])}})}function e(){function e(t,e){n(t,e,"=",r.def(t,e),";")}var r=t(),n=t(),a=r.toString,i=n.toString;return j((function(){r.apply(r,E(arguments))}),{def:r.def,entry:r,exit:n,save:e,set:function(t,n,a){e(t,n),r(t,n,"=",a,";")},toString:function(){return a()+i()}})}var r=0,n=[],a=[],i=t(),o={};return{global:i,link:function(t){for(var e=0;e<a.length;++e)if(a[e]===t)return n[e];return e="g"+r++,n.push(e),a.push(t),e},block:t,proc:function(t,r){function n(){var t="a"+a.length;return a.push(t),t}var a=[];r=r||0;for(var i=0;i<r;++i)n();var s=(i=e()).toString;return o[t]=j(i,{arg:n,toString:function(){return C(["function(",a.join(),"){",s(),"}"])}})},scope:e,cond:function(){var t=C(arguments),r=e(),n=e(),a=r.toString,i=n.toString;return j(r,{then:function(){return r.apply(r,E(arguments)),this},else:function(){return n.apply(n,E(arguments)),this},toString:function(){var e=i();return e&&(e="else{"+e+"}"),C(["if(",t,"){",a(),"}",e])}})},compile:function(){var t=['"use strict";',i,"return {"];Object.keys(o).forEach((function(e){t.push('"',e,'":',o[e].toString(),",")})),t.push("}");var e=C(t).replace(/;/g,";\n").replace(/}/g,"}\n").replace(/{/g,"{\n");return Function.apply(null,n.concat(e)).apply(null,a)}}}function P(t){return Array.isArray(t)||q(t)||l(t)}function O(t){return t.sort((function(t,e){return"viewport"===t?-1:"viewport"===e?1:t<e?-1:1}))}function z(t,e,r,n){this.thisDep=t,this.contextDep=e,this.propDep=r,this.append=n}function I(t){return t&&!(t.thisDep||t.contextDep||t.propDep)}function R(t){return new z(!1,!1,!1,t)}function F(t,e){var r=t.type;return 0===r?new z(!0,1<=(r=t.data.length),2<=r,e):4===r?new z((r=t.data).thisDep,r.contextDep,r.propDep,e):new z(3===r,2===r,1===r,e)}function N(t,e,r,n,a,o,s,l,u,c,h,d,f,p,m){function y(t){return t.replace(".","_")}function v(t,e,r){var n=y(t);nt.push(t),et[n]=tt[n]=!!r,at[n]=e}function _(t,e,r){var n=y(t);nt.push(t),Array.isArray(r)?(tt[n]=r.slice(),et[n]=r.slice()):tt[n]=et[n]=r,it[n]=e}function x(){var t=D(),r=t.link,n=t.global;t.id=lt++,t.batchId="0";var a=r(ot),i=t.shared={props:"a0"};Object.keys(ot).forEach((function(t){i[t]=n.def(a,".",t)}));var o=t.next={},s=t.current={};Object.keys(it).forEach((function(t){Array.isArray(tt[t])&&(o[t]=n.def(i.next,".",t),s[t]=n.def(i.current,".",t))}));var l=t.constants={};Object.keys(st).forEach((function(t){l[t]=n.def(JSON.stringify(st[t]))})),t.invoke=function(e,n){switch(n.type){case 0:var a=["this",i.context,i.props,t.batchId];return e.def(r(n.data),".call(",a.slice(0,Math.max(n.data.length+1,4)),")");case 1:return e.def(i.props,n.data);case 2:return e.def(i.context,n.data);case 3:return e.def("this",n.data);case 4:return n.data.append(t,e),n.data.ref}},t.attribCache={};var u={};return t.scopeAttrib=function(t){if((t=e.id(t))in u)return u[t];var n=c.scope[t];return n||(n=c.scope[t]=new X),u[t]=r(n)},t}function b(t,e){var r=t.static,n=t.dynamic;if("framebuffer"in r){var a=r.framebuffer;return a?(a=l.getFramebuffer(a),R((function(t,e){var r=t.link(a),n=t.shared;return e.set(n.framebuffer,".next",r),n=n.context,e.set(n,".framebufferWidth",r+".width"),e.set(n,".framebufferHeight",r+".height"),r}))):R((function(t,e){var r=t.shared;return e.set(r.framebuffer,".next","null"),r=r.context,e.set(r,".framebufferWidth",r+".drawingBufferWidth"),e.set(r,".framebufferHeight",r+".drawingBufferHeight"),"null"}))}if("framebuffer"in n){var i=n.framebuffer;return F(i,(function(t,e){var r=t.invoke(e,i),n=t.shared,a=n.framebuffer;return r=e.def(a,".getFramebuffer(",r,")"),e.set(a,".next",r),n=n.context,e.set(n,".framebufferWidth",r+"?"+r+".width:"+n+".drawingBufferWidth"),e.set(n,".framebufferHeight",r+"?"+r+".height:"+n+".drawingBufferHeight"),r}))}return null}function w(t){function r(t){if(t in n){var r=e.id(n[t]);return(t=R((function(){return r}))).id=r,t}if(t in a){var i=a[t];return F(i,(function(t,e){var r=t.invoke(e,i);return e.def(t.shared.strings,".id(",r,")")}))}return null}var n=t.static,a=t.dynamic,i=r("frag"),o=r("vert"),s=null;return I(i)&&I(o)?(s=h.program(o.id,i.id),t=R((function(t,e){return t.link(s)}))):t=new z(i&&i.thisDep||o&&o.thisDep,i&&i.contextDep||o&&o.contextDep,i&&i.propDep||o&&o.propDep,(function(t,e){var r,n,a=t.shared.shader;return r=i?i.append(t,e):e.def(a,".","frag"),n=o?o.append(t,e):e.def(a,".","vert"),e.def(a+".program("+n+","+r+")")})),{frag:i,vert:o,progVar:t,program:s}}function M(t,e){function r(t,e){if(t in n){var r=0|n[t];return R((function(t,n){return e&&(t.OFFSET=r),r}))}if(t in a){var o=a[t];return F(o,(function(t,r){var n=t.invoke(r,o);return e&&(t.OFFSET=n),n}))}return e&&i?R((function(t,e){return t.OFFSET="0",0})):null}var n=t.static,a=t.dynamic,i=function(){if("elements"in n){var t=n.elements;P(t)?t=o.getElements(o.create(t,!0)):t&&(t=o.getElements(t));var e=R((function(e,r){if(t){var n=e.link(t);return e.ELEMENTS=n}return e.ELEMENTS=null}));return e.value=t,e}if("elements"in a){var r=a.elements;return F(r,(function(t,e){var n=(a=t.shared).isBufferArgs,a=a.elements,i=t.invoke(e,r),o=e.def("null");return n=e.def(n,"(",i,")"),i=t.cond(n).then(o,"=",a,".createStream(",i,");").else(o,"=",a,".getElements(",i,");"),e.entry(i),e.exit(t.cond(n).then(a,".destroyStream(",o,");")),t.ELEMENTS=o}))}return null}(),s=r("offset",!0);return{elements:i,primitive:function(){if("primitive"in n){var t=n.primitive;return R((function(e,r){return rt[t]}))}if("primitive"in a){var e=a.primitive;return F(e,(function(t,r){var n=t.constants.primTypes,a=t.invoke(r,e);return r.def(n,"[",a,"]")}))}return i?I(i)?i.value?R((function(t,e){return e.def(t.ELEMENTS,".primType")})):R((function(){return 4})):new z(i.thisDep,i.contextDep,i.propDep,(function(t,e){var r=t.ELEMENTS;return e.def(r,"?",r,".primType:",4)})):null}(),count:function(){if("count"in n){var t=0|n.count;return R((function(){return t}))}if("count"in a){var e=a.count;return F(e,(function(t,r){return t.invoke(r,e)}))}return i?I(i)?i?s?new z(s.thisDep,s.contextDep,s.propDep,(function(t,e){return e.def(t.ELEMENTS,".vertCount-",t.OFFSET)})):R((function(t,e){return e.def(t.ELEMENTS,".vertCount")})):R((function(){return-1})):new z(i.thisDep||s.thisDep,i.contextDep||s.contextDep,i.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")})):null}(),instances:r("instances",!1),offset:s}}function k(t,r){var n=t.static,i=t.dynamic,o={};return Object.keys(n).forEach((function(t){var r=n[t],i=e.id(t),s=new X;if(P(r))s.state=1,s.buffer=a.getBuffer(a.create(r,34962,!1,!0)),s.type=0;else if(u=a.getBuffer(r))s.state=1,s.buffer=u,s.type=0;else if("constant"in r){var l=r.constant;s.buffer="null",s.state=2,"number"==typeof l?s.x=l:xt.forEach((function(t,e){e<l.length&&(s[t]=l[e])}))}else{var u=P(r.buffer)?a.getBuffer(a.create(r.buffer,34962,!1,!0)):a.getBuffer(r.buffer),c=0|r.offset,h=0|r.stride,d=0|r.size,f=!!r.normalized,p=0;"type"in r&&(p=K[r.type]),r=0|r.divisor,s.buffer=u,s.state=1,s.size=d,s.normalized=f,s.type=p||u.dtype,s.offset=c,s.stride=h,s.divisor=r}o[t]=R((function(t,e){var r=t.attribCache;if(i in r)return r[i];var n={isStream:!1};return Object.keys(s).forEach((function(t){n[t]=s[t]})),s.buffer&&(n.buffer=t.link(s.buffer),n.type=n.type||n.buffer+".dtype"),r[i]=n}))})),Object.keys(i).forEach((function(t){var e=i[t];o[t]=F(e,(function(t,r){function n(t){r(l[t],"=",a,".",t,"|0;")}var a=t.invoke(r,e),i=t.shared,o=i.isBufferArgs,s=i.buffer,l={isStream:r.def(!1)},u=new X;u.state=1,Object.keys(u).forEach((function(t){l[t]=r.def(""+u[t])}));var c=l.buffer,h=l.type;return r("if(",o,"(",a,")){",l.isStream,"=true;",c,"=",s,".createStream(",34962,",",a,");",h,"=",c,".dtype;","}else{",c,"=",s,".getBuffer(",a,");","if(",c,"){",h,"=",c,".dtype;",'}else if("constant" in ',a,"){",l.state,"=",2,";","if(typeof "+a+'.constant === "number"){',l[xt[0]],"=",a,".constant;",xt.slice(1).map((function(t){return l[t]})).join("="),"=0;","}else{",xt.map((function(t,e){return l[t]+"="+a+".constant.length>"+e+"?"+a+".constant["+e+"]:0;"})).join(""),"}}else{","if(",o,"(",a,".buffer)){",c,"=",s,".createStream(",34962,",",a,".buffer);","}else{",c,"=",s,".getBuffer(",a,".buffer);","}",h,'="type" in ',a,"?",i.glTypes,"[",a,".type]:",c,".dtype;",l.normalized,"=!!",a,".normalized;"),n("size"),n("offset"),n("stride"),n("divisor"),r("}}"),r.exit("if(",l.isStream,"){",s,".destroyStream(",c,");","}"),l}))})),o}function T(t,e,r,n,a){var o=b(t),s=function(t,e,r){function n(t){if(t in a){var r=a[t];t=!0;var n,o,s=0|r.x,l=0|r.y;return"width"in r?n=0|r.width:t=!1,"height"in r?o=0|r.height:t=!1,new z(!t&&e&&e.thisDep,!t&&e&&e.contextDep,!t&&e&&e.propDep,(function(t,e){var a=t.shared.context,i=n;"width"in r||(i=e.def(a,".","framebufferWidth","-",s));var u=o;return"height"in r||(u=e.def(a,".","framebufferHeight","-",l)),[s,l,i,u]}))}if(t in i){var u=i[t];return t=F(u,(function(t,e){var r=t.invoke(e,u),n=t.shared.context,a=e.def(r,".x|0"),i=e.def(r,".y|0");return[a,i,e.def('"width" in ',r,"?",r,".width|0:","(",n,".","framebufferWidth","-",a,")"),r=e.def('"height" in ',r,"?",r,".height|0:","(",n,".","framebufferHeight","-",i,")")]})),e&&(t.thisDep=t.thisDep||e.thisDep,t.contextDep=t.contextDep||e.contextDep,t.propDep=t.propDep||e.propDep),t}return e?new z(e.thisDep,e.contextDep,e.propDep,(function(t,e){var r=t.shared.context;return[0,0,e.def(r,".","framebufferWidth"),e.def(r,".","framebufferHeight")]})):null}var a=t.static,i=t.dynamic;if(t=n("viewport")){var o=t;t=new z(t.thisDep,t.contextDep,t.propDep,(function(t,e){var r=o.append(t,e),n=t.shared.context;return e.set(n,".viewportWidth",r[2]),e.set(n,".viewportHeight",r[3]),r}))}return{viewport:t,scissor_box:n("scissor.box")}}(t,o),l=M(t),u=function(t,e){var r=t.static,n=t.dynamic,a={};return nt.forEach((function(t){function e(e,i){if(t in r){var s=e(r[t]);a[o]=R((function(){return s}))}else if(t in n){var l=n[t];a[o]=F(l,(function(t,e){return i(t,e,t.invoke(e,l))}))}}var o=y(t);switch(t){case"cull.enable":case"blend.enable":case"dither":case"stencil.enable":case"depth.enable":case"scissor.enable":case"polygonOffset.enable":case"sample.alpha":case"sample.enable":case"depth.mask":case"lineWidth":return e((function(t){return t}),(function(t,e,r){return r}));case"depth.func":return e((function(t){return Mt[t]}),(function(t,e,r){return e.def(t.constants.compareFuncs,"[",r,"]")}));case"depth.range":return e((function(t){return t}),(function(t,e,r){return[e.def("+",r,"[0]"),e=e.def("+",r,"[1]")]}));case"blend.func":return e((function(t){return[wt["srcRGB"in t?t.srcRGB:t.src],wt["dstRGB"in t?t.dstRGB:t.dst],wt["srcAlpha"in t?t.srcAlpha:t.src],wt["dstAlpha"in t?t.dstAlpha:t.dst]]}),(function(t,e,r){function n(t,n){return e.def('"',t,n,'" in ',r,"?",r,".",t,n,":",r,".",t)}t=t.constants.blendFuncs;var a=n("src","RGB"),i=n("dst","RGB"),o=(a=e.def(t,"[",a,"]"),e.def(t,"[",n("src","Alpha"),"]"));return[a,i=e.def(t,"[",i,"]"),o,t=e.def(t,"[",n("dst","Alpha"),"]")]}));case"blend.equation":return e((function(t){return"string"==typeof t?[J[t],J[t]]:"object"==typeof t?[J[t.rgb],J[t.alpha]]:void 0}),(function(t,e,r){var n=t.constants.blendEquations,a=e.def(),i=e.def();return(t=t.cond("typeof ",r,'==="string"')).then(a,"=",i,"=",n,"[",r,"];"),t.else(a,"=",n,"[",r,".rgb];",i,"=",n,"[",r,".alpha];"),e(t),[a,i]}));case"blend.color":return e((function(t){return i(4,(function(e){return+t[e]}))}),(function(t,e,r){return i(4,(function(t){return e.def("+",r,"[",t,"]")}))}));case"stencil.mask":return e((function(t){return 0|t}),(function(t,e,r){return e.def(r,"|0")}));case"stencil.func":return e((function(t){return[Mt[t.cmp||"keep"],t.ref||0,"mask"in t?t.mask:-1]}),(function(t,e,r){return[t=e.def('"cmp" in ',r,"?",t.constants.compareFuncs,"[",r,".cmp]",":",7680),e.def(r,".ref|0"),e=e.def('"mask" in ',r,"?",r,".mask|0:-1")]}));case"stencil.opFront":case"stencil.opBack":return e((function(e){return["stencil.opBack"===t?1029:1028,kt[e.fail||"keep"],kt[e.zfail||"keep"],kt[e.zpass||"keep"]]}),(function(e,r,n){function a(t){return r.def('"',t,'" in ',n,"?",i,"[",n,".",t,"]:",7680)}var i=e.constants.stencilOps;return["stencil.opBack"===t?1029:1028,a("fail"),a("zfail"),a("zpass")]}));case"polygonOffset.offset":return e((function(t){return[0|t.factor,0|t.units]}),(function(t,e,r){return[e.def(r,".factor|0"),e=e.def(r,".units|0")]}));case"cull.face":return e((function(t){var e=0;return"front"===t?e=1028:"back"===t&&(e=1029),e}),(function(t,e,r){return e.def(r,'==="front"?',1028,":",1029)}));case"frontFace":return e((function(t){return Tt[t]}),(function(t,e,r){return e.def(r+'==="cw"?2304:2305')}));case"colorMask":return e((function(t){return t.map((function(t){return!!t}))}),(function(t,e,r){return i(4,(function(t){return"!!"+r+"["+t+"]"}))}));case"sample.coverage":return e((function(t){return["value"in t?t.value:1,!!t.invert]}),(function(t,e,r){return[e.def('"value" in ',r,"?+",r,".value:1"),e=e.def("!!",r,".invert")]}))}})),a}(t),c=w(t),h=s.viewport;return h&&(u.viewport=h),(s=s[h=y("scissor.box")])&&(u[h]=s),(o={framebuffer:o,draw:l,shader:c,state:u,dirty:s=0<Object.keys(u).length}).profile=function(t){var e,r=t.static;if(t=t.dynamic,"profile"in r){var n=!!r.profile;(e=R((function(t,e){return n}))).enable=n}else if("profile"in t){var a=t.profile;e=F(a,(function(t,e){return t.invoke(e,a)}))}return e}(t),o.uniforms=function(t,e){var r=t.static,n=t.dynamic,a={};return Object.keys(r).forEach((function(t){var e,n=r[t];if("number"==typeof n||"boolean"==typeof n)e=R((function(){return n}));else if("function"==typeof n){var o=n._reglType;"texture2d"===o||"textureCube"===o?e=R((function(t){return t.link(n)})):"framebuffer"!==o&&"framebufferCube"!==o||(e=R((function(t){return t.link(n.color[0])})))}else g(n)&&(e=R((function(t){return t.global.def("[",i(n.length,(function(t){return n[t]})),"]")})));e.value=n,a[t]=e})),Object.keys(n).forEach((function(t){var e=n[t];a[t]=F(e,(function(t,r){return t.invoke(r,e)}))})),a}(r),o.attributes=k(e),o.context=function(t){var e=t.static,r=t.dynamic,n={};return Object.keys(e).forEach((function(t){var r=e[t];n[t]=R((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]=F(e,(function(t,r){return t.invoke(r,e)}))})),n}(n),o}function L(t,e,r){var n=t.shared.context,a=t.scope();Object.keys(r).forEach((function(i){e.save(n,"."+i),a(n,".",i,"=",r[i].append(t,e),";")})),e(a)}function A(t,e,r,n){var a,i=(s=t.shared).gl,o=s.framebuffer;Q&&(a=e.def(s.extensions,".webgl_draw_buffers"));var s=(l=t.constants).drawBuffer,l=l.backBuffer;t=r?r.append(t,e):e.def(o,".next"),n||e("if(",t,"!==",o,".cur){"),e("if(",t,"){",i,".bindFramebuffer(",36160,",",t,".framebuffer);"),Q&&e(a,".drawBuffersWEBGL(",s,"[",t,".colorAttachments.length]);"),e("}else{",i,".bindFramebuffer(",36160,",null);"),Q&&e(a,".drawBuffersWEBGL(",l,");"),e("}",o,".cur=",t,";"),n||e("}")}function S(t,e,r){var n=t.shared,a=n.gl,o=t.current,s=t.next,l=n.current,u=n.next,c=t.cond(l,".dirty");nt.forEach((function(e){var n,h;if(!((e=y(e))in r.state))if(e in s){n=s[e],h=o[e];var d=i(tt[e].length,(function(t){return c.def(n,"[",t,"]")}));c(t.cond(d.map((function(t,e){return t+"!=="+h+"["+e+"]"})).join("||")).then(a,".",it[e],"(",d,");",d.map((function(t,e){return h+"["+e+"]="+t})).join(";"),";"))}else n=c.def(u,".",e),d=t.cond(n,"!==",l,".",e),c(d),e in at?d(t.cond(n).then(a,".enable(",at[e],");").else(a,".disable(",at[e],");"),l,".",e,"=",n,";"):d(a,".",it[e],"(",n,");",l,".",e,"=",n,";")})),0===Object.keys(r.state).length&&c(l,".dirty=false;"),e(c)}function E(t,e,r,n){var a=t.shared,i=t.current,o=a.current,s=a.gl;O(Object.keys(r)).forEach((function(a){var l=r[a];if(!n||n(l)){var u=l.append(t,e);if(at[a]){var c=at[a];I(l)?e(s,u?".enable(":".disable(",c,");"):e(t.cond(u).then(s,".enable(",c,");").else(s,".disable(",c,");")),e(o,".",a,"=",u,";")}else if(g(u)){var h=i[a];e(s,".",it[a],"(",u,");",u.map((function(t,e){return h+"["+e+"]="+t})).join(";"),";")}else e(s,".",it[a],"(",u,");",o,".",a,"=",u,";")}}))}function C(t,e){$&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function N(t,e,r,n,a){function i(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function o(t){t(u=e.def(),"=",i(),";"),"string"==typeof a?t(d,".count+=",a,";"):t(d,".count++;"),p&&(n?t(c=e.def(),"=",m,".getNumPendingQueries();"):t(m,".beginQuery(",d,");"))}function s(t){t(d,".cpuTime+=",i(),"-",u,";"),p&&(n?t(m,".pushScopeStats(",c,",",m,".getNumPendingQueries(),",d,");"):t(m,".endQuery();"))}function l(t){var r=e.def(f,".profile");e(f,".profile=",t,";"),e.exit(f,".profile=",r,";")}var u,c,h=t.shared,d=t.stats,f=h.current,m=h.timer;if(r=r.profile){if(I(r))return void(r.enable?(o(e),s(e.exit),l("true")):l("false"));l(r=r.append(t,e))}else r=e.def(f,".profile");o(h=t.block()),e("if(",r,"){",h,"}"),s(t=t.block()),e.exit("if(",r,"){",t,"}")}function Y(t,e,r,n,a){function i(r,n,a){function i(){e("if(!",c,".buffer){",l,".enableVertexAttribArray(",u,");}");var r,i=a.type;r=a.size?e.def(a.size,"||",n):n,e("if(",c,".type!==",i,"||",c,".size!==",r,"||",f.map((function(t){return c+"."+t+"!=="+a[t]})).join("||"),"){",l,".bindBuffer(",34962,",",h,".buffer);",l,".vertexAttribPointer(",[u,r,i,a.normalized,a.stride,a.offset],");",c,".type=",i,";",c,".size=",r,";",f.map((function(t){return c+"."+t+"="+a[t]+";"})).join(""),"}"),$&&(i=a.divisor,e("if(",c,".divisor!==",i,"){",t.instancing,".vertexAttribDivisorANGLE(",[u,i],");",c,".divisor=",i,";}"))}function s(){e("if(",c,".buffer){",l,".disableVertexAttribArray(",u,");","}if(",xt.map((function(t,e){return c+"."+t+"!=="+d[e]})).join("||"),"){",l,".vertexAttrib4f(",u,",",d,");",xt.map((function(t,e){return c+"."+t+"="+d[e]+";"})).join(""),"}")}var l=o.gl,u=e.def(r,".location"),c=e.def(o.attributes,"[",u,"]");r=a.state;var h=a.buffer,d=[a.x,a.y,a.z,a.w],f=["buffer","normalized","offset","stride"];1===r?i():2===r?s():(e("if(",r,"===",1,"){"),i(),e("}else{"),s(),e("}"))}var o=t.shared;n.forEach((function(n){var o,s=n.name,l=r.attributes[s];if(l){if(!a(l))return;o=l.append(t,e)}else{if(!a(Lt))return;var u=t.scopeAttrib(s);o={},Object.keys(new X).forEach((function(t){o[t]=e.def(u,".",t)}))}i(t.link(n),function(t){switch(t){case 35664:case 35667:case 35671:return 2;case 35665:case 35668:case 35672:return 3;case 35666:case 35669:case 35673:return 4;default:return 1}}(n.info.type),o)}))}function j(t,r,n,a,o){for(var s,l=t.shared,u=l.gl,c=0;c<a.length;++c){var h,d=(m=a[c]).name,f=m.info.type,p=n.uniforms[d],m=t.link(m)+".location";if(p){if(!o(p))continue;if(I(p)){if(d=p.value,35678===f||35680===f)r(u,".uniform1i(",m,",",(f=t.link(d._texture||d.color[0]._texture))+".bind());"),r.exit(f,".unbind();");else if(35674===f||35675===f||35676===f)p=2,35675===f?p=3:35676===f&&(p=4),r(u,".uniformMatrix",p,"fv(",m,",false,",d=t.global.def("new Float32Array(["+Array.prototype.slice.call(d)+"])"),");");else{switch(f){case 5126:s="1f";break;case 35664:s="2f";break;case 35665:s="3f";break;case 35666:s="4f";break;case 35670:case 5124:s="1i";break;case 35671:case 35667:s="2i";break;case 35672:case 35668:s="3i";break;case 35673:case 35669:s="4i"}r(u,".uniform",s,"(",m,",",g(d)?Array.prototype.slice.call(d):d,");")}continue}h=p.append(t,r)}else{if(!o(Lt))continue;h=r.def(l.uniforms,"[",e.id(d),"]")}switch(35678===f?r("if(",h,"&&",h,'._reglType==="framebuffer"){',h,"=",h,".color[0];","}"):35680===f&&r("if(",h,"&&",h,'._reglType==="framebufferCube"){',h,"=",h,".color[0];","}"),d=1,f){case 35678:case 35680:f=r.def(h,"._texture"),r(u,".uniform1i(",m,",",f,".bind());"),r.exit(f,".unbind();");continue;case 5124:case 35670:s="1i";break;case 35667:case 35671:s="2i",d=2;break;case 35668:case 35672:s="3i",d=3;break;case 35669:case 35673:s="4i",d=4;break;case 5126:s="1f";break;case 35664:s="2f",d=2;break;case 35665:s="3f",d=3;break;case 35666:s="4f",d=4;break;case 35674:s="Matrix2fv";break;case 35675:s="Matrix3fv";break;case 35676:s="Matrix4fv"}if(r(u,".uniform",s,"(",m,","),"M"===s.charAt(0)){m=Math.pow(f-35674+2,2);var y=t.global.def("new Float32Array(",m,")");r("false,(Array.isArray(",h,")||",h," instanceof Float32Array)?",h,":(",i(m,(function(t){return y+"["+t+"]="+h+"["+t+"]"})),",",y,")")}else r(1<d?i(d,(function(t){return h+"["+t+"]"})):h);r(");")}}function B(t,e,r,n){function a(a){var i=d[a];return i?i.contextDep&&n.contextDynamic||i.propDep?i.append(t,r):i.append(t,e):e.def(h,".",a)}function i(){function t(){r(l,".drawElementsInstancedANGLE(",[p,g,y,m+"<<(("+y+"-5121)>>1)",s],");")}function e(){r(l,".drawArraysInstancedANGLE(",[p,m,g,s],");")}f?v?t():(r("if(",f,"){"),t(),r("}else{"),e(),r("}")):e()}function o(){function t(){r(c+".drawElements("+[p,g,y,m+"<<(("+y+"-5121)>>1)"]+");")}function e(){r(c+".drawArrays("+[p,m,g]+");")}f?v?t():(r("if(",f,"){"),t(),r("}else{"),e(),r("}")):e()}var s,l,u=t.shared,c=u.gl,h=u.draw,d=n.draw,f=function(){var a=d.elements,i=e;return a?((a.contextDep&&n.contextDynamic||a.propDep)&&(i=r),a=a.append(t,i)):a=i.def(h,".","elements"),a&&i("if("+a+")"+c+".bindBuffer(34963,"+a+".buffer.buffer);"),a}(),p=a("primitive"),m=a("offset"),g=function(){var a=d.count,i=e;return a?((a.contextDep&&n.contextDynamic||a.propDep)&&(i=r),a=a.append(t,i)):a=i.def(h,".","count"),a}();if("number"==typeof g){if(0===g)return}else r("if(",g,"){"),r.exit("}");$&&(s=a("instances"),l=t.instancing);var y=f+".type",v=d.elements&&I(d.elements);$&&("number"!=typeof s||0<=s)?"string"==typeof s?(r("if(",s,">0){"),i(),r("}else if(",s,"<0){"),o(),r("}")):i():o()}function U(t,e,r,n,a){return a=(e=x()).proc("body",a),$&&(e.instancing=a.def(e.shared.extensions,".angle_instanced_arrays")),t(e,a,r,n),e.compile().body}function V(t,e,r,n){C(t,e),Y(t,e,r,n.attributes,(function(){return!0})),j(t,e,r,n.uniforms,(function(){return!0})),B(t,e,e,r)}function W(t,e,r,n){function a(){return!0}t.batchId="a1",C(t,e),Y(t,e,r,n.attributes,a),j(t,e,r,n.uniforms,a),B(t,e,e,r)}function G(t,e,r,n){function a(t){return t.contextDep&&o||t.propDep}function i(t){return!a(t)}C(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();e(u.entry,"for(",s,"=0;",s,"<","a1",";++",s,"){",l,"=","a0","[",s,"];",c,"}",u.exit),r.needsContext&&L(t,c,r.context),r.needsFramebuffer&&A(t,c,r.framebuffer),E(t,c,r.state,a),r.profile&&a(r.profile)&&N(t,c,r,!1,!0),n?(Y(t,u,r,n.attributes,i),Y(t,c,r,n.attributes,a),j(t,u,r,n.uniforms,i),j(t,c,r,n.uniforms,a),B(t,u,c,r)):(e=t.global.def("{}"),n=r.shader.progVar.append(t,c),l=c.def(n,".id"),u=c.def(e,"[",l,"]"),c(t.shared.gl,".useProgram(",n,".program);","if(!",u,"){",u,"=",e,"[",l,"]=",t.link((function(e){return U(W,t,r,e,2)})),"(",n,");}",u,".call(this,a0[",s,"],",s,");"))}function q(t,r){function n(e){var n=r.shader[e];n&&a.set(i.shader,"."+e,n.append(t,a))}var a=t.proc("scope",3);t.batchId="a2";var i=t.shared,o=i.current;L(t,a,r.context),r.framebuffer&&r.framebuffer.append(t,a),O(Object.keys(r.state)).forEach((function(e){var n=r.state[e].append(t,a);g(n)?n.forEach((function(r,n){a.set(t.next[e],"["+n+"]",r)})):a.set(i.next,"."+e,n)})),N(t,a,r,!0,!0),["elements","offset","count","instances","primitive"].forEach((function(e){var n=r.draw[e];n&&a.set(i.draw,"."+e,""+n.append(t,a))})),Object.keys(r.uniforms).forEach((function(n){a.set(i.uniforms,"["+e.id(n)+"]",r.uniforms[n].append(t,a))})),Object.keys(r.attributes).forEach((function(e){var n=r.attributes[e].append(t,a),i=t.scopeAttrib(e);Object.keys(new X).forEach((function(t){a.set(i,"."+t,n[t])}))})),n("vert"),n("frag"),0<Object.keys(r.state).length&&(a(o,".dirty=true;"),a.exit(o,".dirty=true;")),a("a1(",t.shared.context,",a0,",t.batchId,");")}function Z(t,e,r){var n=e.static[r];if(n&&function(t){if("object"==typeof t&&!g(t)){for(var e=Object.keys(t),r=0;r<e.length;++r)if(H.isDynamic(t[e[r]]))return!0;return!1}}(n)){var a=t.global,i=Object.keys(n),o=!1,s=!1,l=!1,u=t.global.def("{}");i.forEach((function(e){var r=n[e];if(H.isDynamic(r))"function"==typeof r&&(r=n[e]=H.unbox(r)),e=F(r,null),o=o||e.thisDep,l=l||e.propDep,s=s||e.contextDep;else{switch(a(u,".",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 H.DynamicVariable(4,{thisDep:o,contextDep:s,propDep:l,ref:u,append:function(t,e){i.forEach((function(r){var a=n[r];H.isDynamic(a)&&(a=t.invoke(e,a),e(u,".",r,"=",a,";"))}))}}),delete e.static[r]}}var X=c.Record,J={add:32774,subtract:32778,"reverse subtract":32779};r.ext_blend_minmax&&(J.min=32775,J.max=32776);var $=r.angle_instanced_arrays,Q=r.webgl_draw_buffers,tt={dirty:!0,profile:m.profile},et={},nt=[],at={},it={};v("dither",3024),v("blend.enable",3042),_("blend.color","blendColor",[0,0,0,0]),_("blend.equation","blendEquationSeparate",[32774,32774]),_("blend.func","blendFuncSeparate",[1,0,1,0]),v("depth.enable",2929,!0),_("depth.func","depthFunc",513),_("depth.range","depthRange",[0,1]),_("depth.mask","depthMask",!0),_("colorMask","colorMask",[!0,!0,!0,!0]),v("cull.enable",2884),_("cull.face","cullFace",1029),_("frontFace","frontFace",2305),_("lineWidth","lineWidth",1),v("polygonOffset.enable",32823),_("polygonOffset.offset","polygonOffset",[0,0]),v("sample.alpha",32926),v("sample.enable",32928),_("sample.coverage","sampleCoverage",[1,!1]),v("stencil.enable",2960),_("stencil.mask","stencilMask",-1),_("stencil.func","stencilFunc",[519,0,-1]),_("stencil.opFront","stencilOpSeparate",[1028,7680,7680,7680]),_("stencil.opBack","stencilOpSeparate",[1029,7680,7680,7680]),v("scissor.enable",3089),_("scissor.box","scissor",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]),_("viewport","viewport",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]);var ot={gl:t,context:f,strings:e,next:et,current:tt,draw:d,elements:o,buffer:a,shader:h,attributes:c.state,uniforms:u,framebuffer:l,extensions:r,timer:p,isBufferArgs:P},st={primTypes:rt,compareFuncs:Mt,blendFuncs:wt,blendEquations:J,stencilOps:kt,glTypes:K,orientationType:Tt};Q&&(st.backBuffer=[1029],st.drawBuffer=i(n.maxDrawbuffers,(function(t){return 0===t?[0]:i(t,(function(t){return 36064+t}))})));var lt=0;return{next:et,current:tt,procs:function(){var t=x(),e=t.proc("poll"),r=t.proc("refresh"),a=t.block();e(a),r(a);var o,s=t.shared,l=s.gl,u=s.next,c=s.current;a(c,".dirty=false;"),A(t,e),A(t,r,null,!0),$&&(o=t.link($));for(var h=0;h<n.maxAttributes;++h){var d=r.def(s.attributes,"[",h,"]"),f=t.cond(d,".buffer");f.then(l,".enableVertexAttribArray(",h,");",l,".bindBuffer(",34962,",",d,".buffer.buffer);",l,".vertexAttribPointer(",h,",",d,".size,",d,".type,",d,".normalized,",d,".stride,",d,".offset);").else(l,".disableVertexAttribArray(",h,");",l,".vertexAttrib4f(",h,",",d,".x,",d,".y,",d,".z,",d,".w);",d,".buffer=null;"),r(f),$&&r(o,".vertexAttribDivisorANGLE(",h,",",d,".divisor);")}return Object.keys(at).forEach((function(n){var i=at[n],o=a.def(u,".",n),s=t.block();s("if(",o,"){",l,".enable(",i,")}else{",l,".disable(",i,")}",c,".",n,"=",o,";"),r(s),e("if(",o,"!==",c,".",n,"){",s,"}")})),Object.keys(it).forEach((function(n){var o,s,h=it[n],d=tt[n],f=t.block();f(l,".",h,"("),g(d)?(h=d.length,o=t.global.def(u,".",n),s=t.global.def(c,".",n),f(i(h,(function(t){return o+"["+t+"]"})),");",i(h,(function(t){return s+"["+t+"]="+o+"["+t+"];"})).join("")),e("if(",i(h,(function(t){return o+"["+t+"]!=="+s+"["+t+"]"})).join("||"),"){",f,"}")):(o=a.def(u,".",n),s=a.def(c,".",n),f(o,");",c,".",n,"=",o,";"),e("if(",o,"!==",s,"){",f,"}")),r(f)})),t.compile()}(),compile:function(t,e,r,n,a){var i=x();return i.stats=i.link(a),Object.keys(e.static).forEach((function(t){Z(i,e,t)})),bt.forEach((function(e){Z(i,t,e)})),r=T(t,e,r,n),function(t,e){var r=t.proc("draw",1);C(t,r),L(t,r,e.context),A(t,r,e.framebuffer),S(t,r,e),E(t,r,e.state),N(t,r,e,!1,!0);var n=e.shader.progVar.append(t,r);if(r(t.shared.gl,".useProgram(",n,".program);"),e.shader.program)V(t,r,e,e.shader.program);else{var a=t.global.def("{}"),i=r.def(n,".id"),o=r.def(a,"[",i,"]");r(t.cond(o).then(o,".call(this,a0);").else(o,"=",a,"[",i,"]=",t.link((function(r){return U(V,t,e,r,1)})),"(",n,");",o,".call(this,a0);"))}0<Object.keys(e.state).length&&r(t.shared.current,".dirty=true;")}(i,r),q(i,r),function(t,e){function r(t){return t.contextDep&&a||t.propDep}var n=t.proc("batch",2);t.batchId="0",C(t,n);var a=!1,i=!0;Object.keys(e.context).forEach((function(t){a=a||e.context[t].propDep})),a||(L(t,n,e.context),i=!1);var o=!1;if((s=e.framebuffer)?(s.propDep?a=o=!0:s.contextDep&&a&&(o=!0),o||A(t,n,s)):A(t,n,null),e.state.viewport&&e.state.viewport.propDep&&(a=!0),S(t,n,e),E(t,n,e.state,(function(t){return!r(t)})),e.profile&&r(e.profile)||N(t,n,e,!1,"a1"),e.contextDep=a,e.needsContext=i,e.needsFramebuffer=o,(i=e.shader.progVar).contextDep&&a||i.propDep)G(t,n,e,null);else if(i=i.append(t,n),n(t.shared.gl,".useProgram(",i,".program);"),e.shader.program)G(t,n,e,e.shader.program);else{var s=t.global.def("{}"),l=(o=n.def(i,".id"),n.def(s,"[",o,"]"));n(t.cond(l).then(l,".call(this,a0,a1);").else(l,"=",s,"[",o,"]=",t.link((function(r){return U(G,t,e,r,2)})),"(",i,");",l,".call(this,a0,a1);"))}0<Object.keys(e.state).length&&n(t.shared.current,".dirty=true;")}(i,r),i.compile()}}}function Y(t,e){for(var r=0;r<t.length;++r)if(t[r]===e)return r;return-1}var j=function(t,e){for(var r=Object.keys(e),n=0;n<r.length;++n)t[r[n]]=e[r[n]];return t},B=0,H={DynamicVariable:t,define:function(r,n){return new t(r,e(n+""))},isDynamic:function(e){return"function"==typeof e&&!e._reglType||e instanceof t},unbox:function(e,r){return"function"==typeof e?new t(0,e):e},accessor:e},U={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},V="undefined"!=typeof performance&&performance.now?function(){return performance.now()}:function(){return+new Date},W=s();W.zero=s();var G=function(t,e){var r=1;e.ext_texture_filter_anisotropic&&(r=t.getParameter(34047));var n=1,a=1;e.webgl_draw_buffers&&(n=t.getParameter(34852),a=t.getParameter(36063));var i=!!e.oes_texture_float;if(i){i=t.createTexture(),t.bindTexture(3553,i),t.texImage2D(3553,0,6408,1,1,0,6408,5126,null);var o=t.createFramebuffer();if(t.bindFramebuffer(36160,o),t.framebufferTexture2D(36160,36064,3553,i,0),t.bindTexture(3553,null),36053!==t.checkFramebufferStatus(36160))i=!1;else{t.viewport(0,0,1,1),t.clearColor(1,0,0,1),t.clear(16384);var s=W.allocType(5126,4);t.readPixels(0,0,1,1,6408,5126,s),t.getError()?i=!1:(t.deleteFramebuffer(o),t.deleteTexture(i),i=1===s[0]),W.freeType(s)}}return s=!0,"undefined"!=typeof navigator&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent))||(s=t.createTexture(),o=W.allocType(5121,36),t.activeTexture(33984),t.bindTexture(34067,s),t.texImage2D(34069,0,6408,3,3,0,6408,5121,o),W.freeType(o),t.bindTexture(34067,null),t.deleteTexture(s),s=!t.getError()),{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:a,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),readFloat:i,npotTextureCube:s}},q=function(t){return t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Float32Array||t instanceof Float64Array||t instanceof Uint8ClampedArray},Z=function(t){return Object.keys(t).map((function(e){return t[e]}))},X={shape:function(t){for(var e=[];t.length;t=t[0])e.push(t.length);return e},flatten:function(t,e,r,n){var a=1;if(e.length)for(var i=0;i<e.length;++i)a*=e[i];else a=0;switch(r=n||W.allocType(r,a),e.length){case 0:break;case 1:for(n=e[0],e=0;e<n;++e)r[e]=t[e];break;case 2:for(n=e[0],e=e[1],i=a=0;i<n;++i)for(var o=t[i],s=0;s<e;++s)r[a++]=o[s];break;case 3:u(t,e[0],e[1],e[2],r,0);break;default:!function t(e,r,n,a,i){for(var o=1,s=n+1;s<r.length;++s)o*=r[s];var l=r[n];if(4==r.length-n){var c=r[n+1],h=r[n+2];for(r=r[n+3],s=0;s<l;++s)u(e[s],c,h,r,a,i),i+=o}else for(s=0;s<l;++s)t(e[s],r,n+1,a,i),i+=o}(t,e,0,r,0)}return r}},J={"[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},K={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},$={dynamic:35048,stream:35040,static:35044},Q=X.flatten,tt=X.shape,et=[];et[5120]=1,et[5122]=2,et[5124]=4,et[5121]=1,et[5123]=2,et[5125]=4,et[5126]=4;var rt={points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},nt=new Float32Array(1),at=new Uint32Array(nt.buffer),it=[9984,9986,9985,9987],ot=[0,6409,6410,6407,6408],st={};st[6409]=st[6406]=st[6402]=1,st[34041]=st[6410]=2,st[6407]=st[35904]=3,st[6408]=st[35906]=4;var lt=y("HTMLCanvasElement"),ut=y("CanvasRenderingContext2D"),ct=y("ImageBitmap"),ht=y("HTMLImageElement"),dt=y("HTMLVideoElement"),ft=Object.keys(J).concat([lt,ut,ct,ht,dt]),pt=[];pt[5121]=1,pt[5126]=4,pt[36193]=2,pt[5123]=2,pt[5125]=4;var mt=[];mt[32854]=2,mt[32855]=2,mt[36194]=2,mt[34041]=4,mt[33776]=.5,mt[33777]=.5,mt[33778]=1,mt[33779]=1,mt[35986]=.5,mt[35987]=1,mt[34798]=1,mt[35840]=.5,mt[35841]=.25,mt[35842]=.5,mt[35843]=.25,mt[36196]=.5;var gt=[];gt[32854]=2,gt[32855]=2,gt[36194]=2,gt[33189]=2,gt[36168]=1,gt[34041]=4,gt[35907]=4,gt[34836]=16,gt[34842]=8,gt[34843]=6;var yt=function(t,e,r,n,a){function i(t){this.id=u++,this.refCount=1,this.renderbuffer=t,this.format=32854,this.height=this.width=0,a.profile&&(this.stats={size:0})}function o(e){var r=e.renderbuffer;t.bindRenderbuffer(36161,null),t.deleteRenderbuffer(r),e.renderbuffer=null,e.refCount=0,delete c[e.id],n.renderbufferCount--}var s={rgba4:32854,rgb565:36194,"rgb5 a1":32855,depth:33189,stencil:36168,"depth stencil":34041};e.ext_srgb&&(s.srgba=35907),e.ext_color_buffer_half_float&&(s.rgba16f=34842,s.rgb16f=34843),e.webgl_color_buffer_float&&(s.rgba32f=34836);var l=[];Object.keys(s).forEach((function(t){l[s[t]]=t}));var u=0,c={};return i.prototype.decRef=function(){0>=--this.refCount&&o(this)},a.profile&&(n.getTotalRenderbufferSize=function(){var t=0;return Object.keys(c).forEach((function(e){t+=c[e].stats.size})),t}),{create:function(e,r){function o(e,r){var n=0,i=0,c=32854;if("object"==typeof e&&e?("shape"in e?(n=0|(i=e.shape)[0],i=0|i[1]):("radius"in e&&(n=i=0|e.radius),"width"in e&&(n=0|e.width),"height"in e&&(i=0|e.height)),"format"in e&&(c=s[e.format])):"number"==typeof e?(n=0|e,i="number"==typeof r?0|r:n):e||(n=i=1),n!==u.width||i!==u.height||c!==u.format)return o.width=u.width=n,o.height=u.height=i,u.format=c,t.bindRenderbuffer(36161,u.renderbuffer),t.renderbufferStorage(36161,c,n,i),a.profile&&(u.stats.size=gt[u.format]*u.width*u.height),o.format=l[u.format],o}var u=new i(t.createRenderbuffer());return c[u.id]=u,n.renderbufferCount++,o(e,r),o.resize=function(e,r){var n=0|e,i=0|r||n;return n===u.width&&i===u.height||(o.width=u.width=n,o.height=u.height=i,t.bindRenderbuffer(36161,u.renderbuffer),t.renderbufferStorage(36161,u.format,n,i),a.profile&&(u.stats.size=gt[u.format]*u.width*u.height)),o},o._reglType="renderbuffer",o._renderbuffer=u,a.profile&&(o.stats=u.stats),o.destroy=function(){u.decRef()},o},clear:function(){Z(c).forEach(o)},restore:function(){Z(c).forEach((function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,e.renderbuffer),t.renderbufferStorage(36161,e.format,e.width,e.height)})),t.bindRenderbuffer(36161,null)}}},vt=[];vt[6408]=4,vt[6407]=3;var _t=[];_t[5121]=1,_t[5126]=4,_t[36193]=2;var xt=["x","y","z","w"],bt="blend.func blend.equation stencil.func stencil.opFront stencil.opBack sample.coverage viewport scissor.box polygonOffset.offset".split(" "),wt={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},Mt={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},kt={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Tt={cw:2304,ccw:2305},Lt=new z(!1,!1,!1,(function(){}));return function(t){function e(){if(0===X.length)w&&w.update(),Q=null;else{Q=U.next(e),h();for(var t=X.length-1;0<=t;--t){var r=X[t];r&&r(D,null,0)}g.flush(),w&&w.update()}}function r(){!Q&&0<X.length&&(Q=U.next(e))}function n(){Q&&(U.cancel(e),Q=null)}function i(t){t.preventDefault(),n(),J.forEach((function(t){t()}))}function o(t){g.getError(),v.restore(),I.restore(),O.restore(),R.restore(),F.restore(),B.restore(),w&&w.restore(),W.procs.refresh(),r(),K.forEach((function(t){t()}))}function s(t){function e(t){var e={},r={};return Object.keys(t).forEach((function(n){var a=t[n];H.isDynamic(a)?r[n]=H.unbox(a,n):e[n]=a})),{dynamic:r,static:e}}var r=e(t.context||{}),n=e(t.uniforms||{}),a=e(t.attributes||{}),i=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=j({},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));t={gpuTime:0,cpuTime:0,count:0};var o=(r=W.compile(i,a,n,r,t)).draw,s=r.batch,l=r.scope,u=[];return j((function(t,e){var r;if("function"==typeof t)return l.call(this,null,t,0);if("function"==typeof e)if("number"==typeof t)for(r=0;r<t;++r)l.call(this,null,e,r);else{if(!Array.isArray(t))return l.call(this,t,e,0);for(r=0;r<t.length;++r)l.call(this,t[r],e,r)}else if("number"==typeof t){if(0<t)return s.call(this,function(t){for(;u.length<t;)u.push(null);return u}(0|t),0|t)}else{if(!Array.isArray(t))return o.call(this,t);if(t.length)return s.call(this,t,t.length)}}),{stats:t})}function l(t,e){var r=0;W.procs.poll();var n=e.color;n&&(g.clearColor(+n[0]||0,+n[1]||0,+n[2]||0,+n[3]||0),r|=16384),"depth"in e&&(g.clearDepth(+e.depth),r|=256),"stencil"in e&&(g.clearStencil(0|e.stencil),r|=1024),g.clear(r)}function u(t){return X.push(t),r(),{cancel:function(){var e=Y(X,t);X[e]=function t(){var e=Y(X,t);X[e]=X[X.length-1],--X.length,0>=X.length&&n()}}}}function c(){var t=q.viewport,e=q.scissor_box;t[0]=t[1]=e[0]=e[1]=0,D.viewportWidth=D.framebufferWidth=D.drawingBufferWidth=t[2]=e[2]=g.drawingBufferWidth,D.viewportHeight=D.framebufferHeight=D.drawingBufferHeight=t[3]=e[3]=g.drawingBufferHeight}function h(){D.tick+=1,D.time=m(),c(),W.procs.poll()}function d(){c(),W.procs.refresh(),w&&w.update()}function m(){return(V()-M)/1e3}if(!(t=a(t)))return null;var g=t.gl,y=g.getContextAttributes();g.isContextLost();var v=function(t,e){function r(e){var r;e=e.toLowerCase();try{r=n[e]=t.getExtension(e)}catch(t){}return!!r}for(var n={},a=0;a<e.extensions.length;++a){var i=e.extensions[a];if(!r(i))return e.onDestroy(),e.onDone('"'+i+'" 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(n[t]&&!r(t))throw Error("(regl): error restoring extension "+t)}))}}}(g,t);if(!v)return null;var _=function(){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]}}}(),x={bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0},b=v.extensions,w=function(t,e){function r(){this.endQueryIndex=this.startQueryIndex=-1,this.sum=0,this.stats=null}function n(t,e,n){var a=o.pop()||new r;a.startQueryIndex=t,a.endQueryIndex=e,a.sum=0,a.stats=n,s.push(a)}if(!e.ext_disjoint_timer_query)return null;var a=[],i=[],o=[],s=[],l=[],u=[];return{beginQuery:function(t){var r=a.pop()||e.ext_disjoint_timer_query.createQueryEXT();e.ext_disjoint_timer_query.beginQueryEXT(35007,r),i.push(r),n(i.length-1,i.length,t)},endQuery:function(){e.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:n,update:function(){var t,r;if(0!==(t=i.length)){u.length=Math.max(u.length,t+1),l.length=Math.max(l.length,t+1),l[0]=0;var n=u[0]=0;for(r=t=0;r<i.length;++r){var c=i[r];e.ext_disjoint_timer_query.getQueryObjectEXT(c,34919)?(n+=e.ext_disjoint_timer_query.getQueryObjectEXT(c,34918),a.push(c)):i[t++]=c,l[r+1]=n,u[r+1]=t}for(i.length=t,r=t=0;r<s.length;++r){var h=(n=s[r]).startQueryIndex;c=n.endQueryIndex,n.sum+=l[c]-l[h],h=u[h],(c=u[c])===h?(n.stats.gpuTime+=n.sum/1e6,o.push(n)):(n.startQueryIndex=h,n.endQueryIndex=c,s[t++]=n)}s.length=t}},getNumPendingQueries:function(){return i.length},clear:function(){a.push.apply(a,i);for(var t=0;t<a.length;t++)e.ext_disjoint_timer_query.deleteQueryEXT(a[t]);i.length=0,a.length=0},restore:function(){i.length=0,a.length=0}}}(0,b),M=V(),E=g.drawingBufferWidth,C=g.drawingBufferHeight,D={tick:0,time:0,viewportWidth:E,viewportHeight:C,framebufferWidth:E,framebufferHeight:C,drawingBufferWidth:E,drawingBufferHeight:C,pixelRatio:t.pixelRatio},P=G(g,b),O=(E=function(t,e,r,n){for(t=r.maxAttributes,e=Array(t),r=0;r<t;++r)e[r]=new L;return{Record:L,scope:{},state:e}}(g,b,P),f(g,x,t,E)),z=p(g,b,O,x),I=A(g,_,x,t),R=k(g,b,P,(function(){W.procs.poll()}),D,x,t),F=yt(g,b,0,x,t),B=T(g,b,P,R,F,x),W=N(g,_,b,P,O,z,0,B,{},E,I,{elements:null,primitive:4,count:-1,offset:0,instances:-1},D,w,t),q=(_=S(g,B,W.procs.poll,D),W.next),Z=g.canvas,X=[],J=[],K=[],$=[t.onDestroy],Q=null;Z&&(Z.addEventListener("webglcontextlost",i,!1),Z.addEventListener("webglcontextrestored",o,!1));var tt=B.setFBO=s({framebuffer:H.define.call(null,1,"framebuffer")});return d(),y=j(s,{clear:function(t){if("framebuffer"in t)if(t.framebuffer&&"framebufferCube"===t.framebuffer_reglType)for(var e=0;6>e;++e)tt(j({framebuffer:t.framebuffer.faces[e]},t),l);else tt(t,l);else l(0,t)},prop:H.define.bind(null,1),context:H.define.bind(null,2),this:H.define.bind(null,3),draw:s({}),buffer:function(t){return O.create(t,34962,!1,!1)},elements:function(t){return z.create(t,!1)},texture:R.create2D,cube:R.createCube,renderbuffer:F.create,framebuffer:B.create,framebufferCube:B.createCube,attributes:y,frame:u,on:function(t,e){var r;switch(t){case"frame":return u(e);case"lost":r=J;break;case"restore":r=K;break;case"destroy":r=$}return r.push(e),{cancel:function(){for(var t=0;t<r.length;++t)if(r[t]===e){r[t]=r[r.length-1],r.pop();break}}}},limits:P,hasExtension:function(t){return 0<=P.extensions.indexOf(t.toLowerCase())},read:_,destroy:function(){X.length=0,n(),Z&&(Z.removeEventListener("webglcontextlost",i),Z.removeEventListener("webglcontextrestored",o)),I.clear(),B.clear(),F.clear(),R.clear(),z.clear(),O.clear(),w&&w.clear(),$.forEach((function(t){t()}))},_gl:g,_refresh:d,poll:function(){h(),w&&w.update()},now:m,stats:x}),t.onDone(null,y),y}},"object"==typeof r&&void 0!==e?e.exports=n():this.createREGL=n()},{}],503:[function(t,e,r){var n,a="";e.exports=function(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(n!==t||void 0===n)n=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=(a+=t).substr(0,r)}},{}],504:[function(t,e,n){(function(t){e.exports=t.performance&&t.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],505:[function(t,e,r){e.exports=function(t){for(var e=t.length,r=t[t.length-1],n=e,a=e-2;a>=0;--a){var i=r;(l=(s=t[a])-((r=i+s)-i))&&(t[--n]=r,r=l)}var o=0;for(a=n;a<e;++a){var s,l;(l=(s=r)-((r=(i=t[a])+s)-i))&&(t[o++]=l)}return t[o++]=r,t.length=o,t}},{}],506:[function(t,e,r){var n=t("two-product"),a=t("robust-sum"),i=t("robust-scale"),o=t("robust-compress");function s(t,e){for(var r=new Array(t.length-1),n=1;n<t.length;++n)for(var a=r[n-1]=new Array(t.length-1),i=0,o=0;i<t.length;++i)i!==e&&(a[o++]=t[n][i]);return r}function l(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(",l(s(t,r)),",",(n=r,1&n?"-":""),t[0][r],")"].join(""));return function t(e){if(1===e.length)return e[0];if(2===e.length)return["sum(",e[0],",",e[1],")"].join("");var r=e.length>>1;return["sum(",t(e.slice(0,r)),",",t(e.slice(r)),")"].join("")}(e);var n}function u(t){return new Function("sum","scale","prod","compress",["function robustDeterminant",t,"(m){return compress(",l(function(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}(t)),")};return robustDeterminant",t].join(""))(a,i,n,o)}var c=[function(){return[0]},function(t){return[t[0][0]]}];!function(){for(;c.length<6;)c.push(u(c.length));for(var t=[],r=["function robustDeterminant(m){switch(m.length){"],n=0;n<6;++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 a=Function.apply(void 0,t);for(e.exports=a.apply(void 0,c.concat([c,u])),n=0;n<c.length;++n)e.exports[n]=c[n]}()},{"robust-compress":505,"robust-scale":512,"robust-sum":515,"two-product":543}],507:[function(t,e,r){var n=t("two-product"),a=t("robust-sum");e.exports=function(t,e){for(var r=n(t[0],e[0]),i=1;i<t.length;++i)r=a(r,n(t[i],e[i]));return r}},{"robust-sum":515,"two-product":543}],508:[function(t,e,r){var n=t("two-product"),a=t("robust-sum"),i=t("robust-subtract"),o=t("robust-scale");function s(t,e){for(var r=new Array(t.length-1),n=1;n<t.length;++n)for(var a=r[n-1]=new Array(t.length-1),i=0,o=0;i<t.length;++i)i!==e&&(a[o++]=t[n][i]);return r}function l(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(",l(t.slice(0,e)),",",l(t.slice(e)),")"].join("")}function u(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 u(e,t)}function c(t){if(2===t.length)return[["diff(",u(t[0][0],t[1][1]),",",u(t[1][0],t[0][1]),")"].join("")];for(var e=[],r=0;r<t.length;++r)e.push(["scale(",l(c(s(t,r))),",",(n=r,!0&n?"-":""),t[0][r],")"].join(""));return e;var n}function h(t,e){for(var r=[],n=0;n<e-2;++n)r.push(["prod(m",t,"[",n,"],m",t,"[",n,"])"].join(""));return l(r)}function d(t){for(var e=[],r=[],u=function(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}(t),d=0;d<t;++d)u[0][d]="1",u[t-1][d]="w"+d;for(d=0;d<t;++d)0==(1&d)?e.push.apply(e,c(s(u,d))):r.push.apply(r,c(s(u,d)));var f=l(e),p=l(r),m="exactInSphere"+t,g=[];for(d=0;d<t;++d)g.push("m"+d);var y=["function ",m,"(",g.join(),"){"];for(d=0;d<t;++d){y.push("var w",d,"=",h(d,t),";");for(var v=0;v<t;++v)v!==d&&y.push("var w",d,"m",v,"=scale(w",d,",m",v,"[0]);")}return y.push("var p=",f,",n=",p,",d=diff(p,n);return d[d.length-1];}return ",m),new Function("sum","diff","prod","scale",y.join(""))(a,i,n,o)}var f=[function(){return 0},function(){return 0},function(){return 0}];!function(){for(;f.length<=6;)f.push(d(f.length));for(var t=[],r=["slow"],n=0;n<=6;++n)t.push("a"+n),r.push("o"+n);var a=["function testInSphere(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(n=2;n<=6;++n)a.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");a.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(a.join(""));var i=Function.apply(void 0,r);for(e.exports=i.apply(void 0,[function(t){var e=f[t.length];return e||(e=f[t.length]=d(t.length)),e.apply(void 0,t)}].concat(f)),n=0;n<=6;++n)e.exports[n]=f[n]}()},{"robust-scale":512,"robust-subtract":514,"robust-sum":515,"two-product":543}],509:[function(t,e,r){var n=t("robust-determinant");function a(t){for(var e="robustLinearSolve"+t+"d",r=["function ",e,"(A,b){return ["],a=0;a<t;++a){r.push("det([");for(var i=0;i<t;++i){i>0&&r.push(","),r.push("[");for(var o=0;o<t;++o)o>0&&r.push(","),o===a?r.push("+b[",i,"]"):r.push("+A[",i,"][",o,"]");r.push("]")}r.push("]),")}return r.push("det(A)]}return ",e),new Function("det",r.join(""))(t<6?n[t]:n)}var i=[function(){return[0]},function(t,e){return[[e[0]],[t[0][0]]]}];!function(){for(;i.length<6;)i.push(a(i.length));for(var t=[],r=["function dispatchLinearSolve(A,b){switch(A.length){"],n=0;n<6;++n)t.push("s"+n),r.push("case ",n,":return s",n,"(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 o=Function.apply(void 0,t);for(e.exports=o.apply(void 0,i.concat([i,a])),n=0;n<6;++n)e.exports[n]=i[n]}()},{"robust-determinant":506}],510:[function(t,e,r){var n=t("two-product"),a=t("robust-sum"),i=t("robust-scale"),o=t("robust-subtract");function s(t,e){for(var r=new Array(t.length-1),n=1;n<t.length;++n)for(var a=r[n-1]=new Array(t.length-1),i=0,o=0;i<t.length;++i)i!==e&&(a[o++]=t[n][i]);return r}function l(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(",l(t.slice(0,e)),",",l(t.slice(e)),")"].join("")}function u(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(",l(u(s(t,r))),",",(n=r,1&n?"-":""),t[0][r],")"].join(""));return e;var n}function c(t){for(var e=[],r=[],c=function(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}(t),h=[],d=0;d<t;++d)0==(1&d)?e.push.apply(e,u(s(c,d))):r.push.apply(r,u(s(c,d))),h.push("m"+d);var f=l(e),p=l(r),m="orientation"+t+"Exact",g=["function ",m,"(",h.join(),"){var p=",f,",n=",p,",d=sub(p,n);return d[d.length-1];};return ",m].join("");return new Function("sum","prod","scale","sub",g)(a,n,i,o)}var h=c(3),d=c(4),f=[function(){return 0},function(){return 0},function(t,e){return e[0]-t[0]},function(t,e,r){var n,a=(t[1]-r[1])*(e[0]-r[0]),i=(t[0]-r[0])*(e[1]-r[1]),o=a-i;if(a>0){if(i<=0)return o;n=a+i}else{if(!(a<0))return o;if(i>=0)return o;n=-(a+i)}var s=33306690738754716e-32*n;return o>=s||o<=-s?o:h(t,e,r)},function(t,e,r,n){var a=t[0]-n[0],i=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],p=i*u,m=o*l,g=o*s,y=a*u,v=a*l,_=i*s,x=c*(p-m)+h*(g-y)+f*(v-_),b=7771561172376103e-31*((Math.abs(p)+Math.abs(m))*Math.abs(c)+(Math.abs(g)+Math.abs(y))*Math.abs(h)+(Math.abs(v)+Math.abs(_))*Math.abs(f));return x>b||-x>b?x:d(t,e,r,n)}];!function(){for(;f.length<=5;)f.push(c(f.length));for(var t=[],r=["slow"],n=0;n<=5;++n)t.push("a"+n),r.push("o"+n);var a=["function getOrientation(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(n=2;n<=5;++n)a.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");a.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(a.join(""));var i=Function.apply(void 0,r);for(e.exports=i.apply(void 0,[function(t){var e=f[t.length];return e||(e=f[t.length]=c(t.length)),e.apply(void 0,t)}].concat(f)),n=0;n<=5;++n)e.exports[n]=f[n]}()},{"robust-scale":512,"robust-subtract":514,"robust-sum":515,"two-product":543}],511:[function(t,e,r){var n=t("robust-sum"),a=t("robust-scale");e.exports=function(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 i=0;i<t.length;++i)r=n(r,a(e,t[i]));else for(i=0;i<e.length;++i)r=n(r,a(t,e[i]));return r}},{"robust-scale":512,"robust-sum":515}],512:[function(t,e,r){var n=t("two-product"),a=t("two-sum");e.exports=function(t,e){var r=t.length;if(1===r){var i=n(t[0],e);return i[0]?i:[i[1]]}var o=new Array(2*r),s=[.1,.1],l=[.1,.1],u=0;n(t[0],e,s),s[0]&&(o[u++]=s[0]);for(var c=1;c<r;++c){n(t[c],e,l);var h=s[1];a(h,l[0],s),s[0]&&(o[u++]=s[0]);var d=l[1],f=s[1],p=d+f,m=f-(p-d);s[1]=p,m&&(o[u++]=m)}return s[1]&&(o[u++]=s[1]),0===u&&(o[u++]=0),o.length=u,o}},{"two-product":543,"two-sum":544}],513:[function(t,e,r){e.exports=function(t,e,r,a){var i=n(t,r,a),o=n(e,r,a);if(i>0&&o>0||i<0&&o<0)return!1;var s=n(r,t,e),l=n(a,t,e);return!(s>0&&l>0||s<0&&l<0)&&(0!==i||0!==o||0!==s||0!==l||function(t,e,r,n){for(var a=0;a<2;++a){var i=t[a],o=e[a],s=Math.min(i,o),l=Math.max(i,o),u=r[a],c=n[a],h=Math.min(u,c);if(Math.max(u,c)<s||l<h)return!1}return!0}(t,e,r,a))};var n=t("robust-orientation")[3]},{"robust-orientation":510}],514:[function(t,e,r){e.exports=function(t,e){var r=0|t.length,n=0|e.length;if(1===r&&1===n)return function(t,e){var r=t+e,n=r-t,a=t-(r-n)+(e-n);return a?[a,r]:[r]}(t[0],-e[0]);var a,i,o=new Array(r+n),s=0,l=0,u=0,c=Math.abs,h=t[l],d=c(h),f=-e[u],p=c(f);d<p?(i=h,(l+=1)<r&&(d=c(h=t[l]))):(i=f,(u+=1)<n&&(p=c(f=-e[u]))),l<r&&d<p||u>=n?(a=h,(l+=1)<r&&(d=c(h=t[l]))):(a=f,(u+=1)<n&&(p=c(f=-e[u])));for(var m,g,y=a+i,v=y-a,_=i-v,x=_,b=y;l<r&&u<n;)d<p?(a=h,(l+=1)<r&&(d=c(h=t[l]))):(a=f,(u+=1)<n&&(p=c(f=-e[u]))),(_=(i=x)-(v=(y=a+i)-a))&&(o[s++]=_),x=b-((m=b+y)-(g=m-b))+(y-g),b=m;for(;l<r;)(_=(i=x)-(v=(y=(a=h)+i)-a))&&(o[s++]=_),x=b-((m=b+y)-(g=m-b))+(y-g),b=m,(l+=1)<r&&(h=t[l]);for(;u<n;)(_=(i=x)-(v=(y=(a=f)+i)-a))&&(o[s++]=_),x=b-((m=b+y)-(g=m-b))+(y-g),b=m,(u+=1)<n&&(f=-e[u]);return x&&(o[s++]=x),b&&(o[s++]=b),s||(o[s++]=0),o.length=s,o}},{}],515:[function(t,e,r){e.exports=function(t,e){var r=0|t.length,n=0|e.length;if(1===r&&1===n)return function(t,e){var r=t+e,n=r-t,a=t-(r-n)+(e-n);return a?[a,r]:[r]}(t[0],e[0]);var a,i,o=new Array(r+n),s=0,l=0,u=0,c=Math.abs,h=t[l],d=c(h),f=e[u],p=c(f);d<p?(i=h,(l+=1)<r&&(d=c(h=t[l]))):(i=f,(u+=1)<n&&(p=c(f=e[u]))),l<r&&d<p||u>=n?(a=h,(l+=1)<r&&(d=c(h=t[l]))):(a=f,(u+=1)<n&&(p=c(f=e[u])));for(var m,g,y=a+i,v=y-a,_=i-v,x=_,b=y;l<r&&u<n;)d<p?(a=h,(l+=1)<r&&(d=c(h=t[l]))):(a=f,(u+=1)<n&&(p=c(f=e[u]))),(_=(i=x)-(v=(y=a+i)-a))&&(o[s++]=_),x=b-((m=b+y)-(g=m-b))+(y-g),b=m;for(;l<r;)(_=(i=x)-(v=(y=(a=h)+i)-a))&&(o[s++]=_),x=b-((m=b+y)-(g=m-b))+(y-g),b=m,(l+=1)<r&&(h=t[l]);for(;u<n;)(_=(i=x)-(v=(y=(a=f)+i)-a))&&(o[s++]=_),x=b-((m=b+y)-(g=m-b))+(y-g),b=m,(u+=1)<n&&(f=e[u]);return x&&(o[s++]=x),b&&(o[s++]=b),s||(o[s++]=0),o.length=s,o}},{}],516:[function(t,e,r){e.exports=function(t){return t<0?-1:t>0?1:0}},{}],517:[function(t,e,r){e.exports=function(t){return a(n(t))};var n=t("boundary-cells"),a=t("reduce-simplicial-complex")},{"boundary-cells":95,"reduce-simplicial-complex":489}],518:[function(t,e,r){e.exports=function(t,e,r,s){if(r=r||0,void 0===s&&(s=function(t){for(var e=t.length,r=0,n=0;n<e;++n)r=0|Math.max(r,t[n].length);return r-1}(t)),0===t.length||s<1)return{cells:[],vertexIds:[],vertexWeights:[]};var l=function(t,e){for(var r=t.length,n=a.mallocUint8(r),i=0;i<r;++i)n[i]=t[i]<e|0;return n}(e,+r),u=function(t,e){for(var r=t.length,o=e*(e+1)/2*r|0,s=a.mallocUint32(2*o),l=0,u=0;u<r;++u)for(var c=t[u],h=(e=c.length,0);h<e;++h)for(var d=0;d<h;++d){var f=c[d],p=c[h];s[l++]=0|Math.min(f,p),s[l++]=0|Math.max(f,p)}i(n(s,[l/2|0,2]));var m=2;for(u=2;u<l;u+=2)s[u-2]===s[u]&&s[u-1]===s[u+1]||(s[m++]=s[u],s[m++]=s[u+1]);return n(s,[m/2|0,2])}(t,s),c=function(t,e,r,i){for(var o=t.data,s=t.shape[0],l=a.mallocDouble(s),u=0,c=0;c<s;++c){var h=o[2*c],d=o[2*c+1];if(r[h]!==r[d]){var f=e[h],p=e[d];o[2*u]=h,o[2*u+1]=d,l[u++]=(p-i)/(p-f)}}return t.shape[0]=u,n(l,[u])}(u,e,l,+r),h=function(t,e){var r=a.mallocInt32(2*e),n=t.shape[0],i=t.data;r[0]=0;for(var o=0,s=0;s<n;++s){var l=i[2*s];if(l!==o){for(r[2*o+1]=s;++o<l;)r[2*o]=s,r[2*o+1]=s;r[2*o]=s}}for(r[2*o+1]=n;++o<e;)r[2*o]=r[2*o+1]=n;return r}(u,0|e.length),d=o(s)(t,u.data,h,l),f=function(t){for(var e=0|t.shape[0],r=t.data,n=new Array(e),a=0;a<e;++a)n[a]=[r[2*a],r[2*a+1]];return n}(u),p=[].slice.call(c.data,0,c.shape[0]);return a.free(l),a.free(u.data),a.free(c.data),a.free(h),{cells:d,vertexIds:f,vertexWeights:p}};var n=t("ndarray"),a=t("typedarray-pool"),i=t("ndarray-sort"),o=t("./lib/codegen")},{"./lib/codegen":519,ndarray:450,"ndarray-sort":448,"typedarray-pool":545}],519:[function(t,e,r){e.exports=function(t){var e=i[t];return e||(e=i[t]=function(t){var e=0,r=new Array(t+1);r[0]=[[]];for(var i=1;i<=t;++i)for(var o=r[i]=a(i),s=0;s<o.length;++s)e=Math.max(e,o[i].length);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;"];function u(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 a=r[n];n>0&&l.push(","),l.push("B(C,E,c[",a[0],"],c[",a[1],"])")}l.push("]")}l.push(");")}}for(i=t+1;i>1;--i){i<t+1&&l.push("else "),l.push("if(l===",i,"){");var c=[];for(s=0;s<i;++s)c.push("(S[c["+s+"]]<<"+s+")");for(l.push("var M=",c.join("+"),";if(M===0||M===",(1<<i)-1,"){continue}switch(M){"),o=r[i-1],s=0;s<o.length;++s)l.push("case ",s,":"),u(o[s]),l.push("break;");l.push("}}")}return l.push("}return R;};return getContour",t,"d"),new Function("pool",l.join(""))(n)}(t)),e};var n=t("typedarray-pool"),a=t("marching-simplex-table"),i={}},{"marching-simplex-table":427,"typedarray-pool":545}],520:[function(t,e,r){var n=t("bit-twiddle"),a=t("union-find");function i(t,e){var r=t.length,n=t.length-e.length,a=Math.min;if(n)return n;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return(s=t[0]+t[1]-e[0]-e[1])||a(t[0],t[1])-a(e[0],e[1]);case 3:var i=t[0]+t[1],o=e[0]+e[1];if(s=i+t[2]-(o+e[2]))return s;var s,l=a(t[0],t[1]),u=a(e[0],e[1]);return(s=a(l,t[2])-a(u,e[2]))||a(l+t[2],i)-a(u+e[2],o);default:var c=t.slice(0);c.sort();var h=e.slice(0);h.sort();for(var d=0;d<r;++d)if(n=c[d]-h[d])return n;return 0}}function o(t,e){return i(t[0],e[0])}function s(t,e){if(e){for(var r=t.length,n=new Array(r),a=0;a<r;++a)n[a]=[t[a],e[a]];for(n.sort(o),a=0;a<r;++a)t[a]=n[a][0],e[a]=n[a][1];return t}return t.sort(i),t}function l(t){if(0===t.length)return[];for(var e=1,r=t.length,n=1;n<r;++n){var a=t[n];if(i(a,t[n-1])){if(n===e){e++;continue}t[e++]=a}}return t.length=e,t}function u(t,e){for(var r=0,n=t.length-1,a=-1;r<=n;){var o=r+n>>1,s=i(t[o],e);s<=0?(0===s&&(a=o),r=o+1):s>0&&(n=o-1)}return a}function c(t,e){for(var r=new Array(t.length),a=0,o=r.length;a<o;++a)r[a]=[];for(var s=[],l=(a=0,e.length);a<l;++a)for(var c=e[a],h=c.length,d=1,f=1<<h;d<f;++d){s.length=n.popCount(d);for(var p=0,m=0;m<h;++m)d&1<<m&&(s[p++]=c[m]);var g=u(t,s);if(!(g<0))for(;r[g++].push(a),!(g>=t.length||0!==i(t[g],s)););}return r}function h(t,e){if(e<0)return[];for(var r=[],a=(1<<e+1)-1,i=0;i<t.length;++i)for(var o=t[i],l=a;l<1<<o.length;l=n.nextCombination(l)){for(var u=new Array(e+1),c=0,h=0;h<o.length;++h)l&1<<h&&(u[c++]=o[h]);r.push(u)}return s(r)}r.dimension=function(t){for(var e=0,r=Math.max,n=0,a=t.length;n<a;++n)e=r(e,t[n].length);return e-1},r.countVertices=function(t){for(var e=-1,r=Math.max,n=0,a=t.length;n<a;++n)for(var i=t[n],o=0,s=i.length;o<s;++o)e=r(e,i[o]);return e+1},r.cloneCells=function(t){for(var e=new Array(t.length),r=0,n=t.length;r<n;++r)e[r]=t[r].slice(0);return e},r.compareCells=i,r.normalize=s,r.unique=l,r.findCell=u,r.incidence=c,r.dual=function(t,e){if(!e)return c(l(h(t,0)),t);for(var r=new Array(e),n=0;n<e;++n)r[n]=[];n=0;for(var a=t.length;n<a;++n)for(var i=t[n],o=0,s=i.length;o<s;++o)r[i[o]].push(n);return r},r.explode=function(t){for(var e=[],r=0,n=t.length;r<n;++r)for(var a=t[r],i=0|a.length,o=1,l=1<<i;o<l;++o){for(var u=[],c=0;c<i;++c)o>>>c&1&&u.push(a[c]);e.push(u)}return s(e)},r.skeleton=h,r.boundary=function(t){for(var e=[],r=0,n=t.length;r<n;++r)for(var a=t[r],i=0,o=a.length;i<o;++i){for(var l=new Array(a.length-1),u=0,c=0;u<o;++u)u!==i&&(l[c++]=a[u]);e.push(l)}return s(e)},r.connectedComponents=function(t,e){return e?function(t,e){for(var r=new a(e),n=0;n<t.length;++n)for(var i=t[n],o=0;o<i.length;++o)for(var s=o+1;s<i.length;++s)r.link(i[o],i[s]);var l=[],u=r.ranks;for(n=0;n<u.length;++n)u[n]=-1;for(n=0;n<t.length;++n){var c=r.find(t[n][0]);u[c]<0?(u[c]=l.length,l.push([t[n].slice(0)])):l[u[c]].push(t[n].slice(0))}return l}(t,e):function(t){for(var e=l(s(h(t,0))),r=new a(e.length),n=0;n<t.length;++n)for(var i=t[n],o=0;o<i.length;++o)for(var c=u(e,[i[o]]),d=o+1;d<i.length;++d)r.link(c,u(e,[i[d]]));var f=[],p=r.ranks;for(n=0;n<p.length;++n)p[n]=-1;for(n=0;n<t.length;++n){var m=r.find(u(e,[t[n][0]]));p[m]<0?(p[m]=f.length,f.push([t[n].slice(0)])):f[p[m]].push(t[n].slice(0))}return f}(t)}},{"bit-twiddle":92,"union-find":546}],521:[function(t,e,r){arguments[4][92][0].apply(r,arguments)},{dup:92}],522:[function(t,e,r){arguments[4][520][0].apply(r,arguments)},{"bit-twiddle":521,dup:520,"union-find":523}],523:[function(t,e,r){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 a=this.ranks,i=this.roots,o=a[r],s=a[n];o<s?i[r]=n:s<o?i[n]=r:(i[n]=r,++a[r])}}},{}],524:[function(t,e,r){e.exports=function(t,e,r){for(var i=e.length,o=t.length,s=new Array(i),l=new Array(i),u=new Array(i),c=new Array(i),h=0;h<i;++h)s[h]=l[h]=-1,u[h]=1/0,c[h]=!1;for(h=0;h<o;++h){var d=t[h];if(2!==d.length)throw new Error("Input must be a graph");var f=d[1],p=d[0];-1!==l[p]?l[p]=-2:l[p]=f,-1!==s[f]?s[f]=-2:s[f]=p}function m(t){if(c[t])return 1/0;var r,a,i,o=s[t],u=l[t];return o<0||u<0?1/0:(r=e[t],a=e[o],i=e[u],Math.abs(n(r,a,i))/Math.sqrt(Math.pow(a[0]-i[0],2)+Math.pow(a[1]-i[1],2)))}function g(t,e){var r=k[t],n=k[e];k[t]=n,k[e]=r,T[r]=e,T[n]=t}function y(t){return u[k[t]]}function v(t){return 1&t?t-1>>1:(t>>1)-1}function _(t){for(var e=y(t);;){var r=e,n=2*t+1,a=2*(t+1),i=t;if(n<L){var o=y(n);o<r&&(i=n,r=o)}if(a<L&&y(a)<r&&(i=a),i===t)return t;g(t,i),t=i}}function x(t){for(var e=y(t);t>0;){var r=v(t);if(!(r>=0&&e<y(r)))return t;g(t,r),t=r}}function b(){if(L>0){var t=k[0];return g(0,L-1),L-=1,_(0),t}return-1}function w(t,e){var r=k[t];return u[r]===e?t:(u[r]=-1/0,x(t),b(),u[r]=e,x((L+=1)-1))}function M(t){if(!c[t]){c[t]=!0;var e=s[t],r=l[t];s[r]>=0&&(s[r]=e),l[e]>=0&&(l[e]=r),T[e]>=0&&w(T[e],m(e)),T[r]>=0&&w(T[r],m(r))}}var k=[],T=new Array(i);for(h=0;h<i;++h)(u[h]=m(h))<1/0?(T[h]=k.length,k.push(h)):T[h]=-1;var L=k.length;for(h=L>>1;h>=0;--h)_(h);for(;;){var A=b();if(A<0||u[A]>r)break;M(A)}var S=[];for(h=0;h<i;++h)c[h]||(T[h]=S.length,S.push(e[h].slice()));function E(t,e){if(t[e]<0)return e;var r=e,n=e;do{var a=t[n];if(!c[n]||a<0||a===n)break;if(a=t[n=a],!c[n]||a<0||a===n)break;n=a,r=t[r]}while(r!==n);for(var i=e;i!==n;i=t[i])t[i]=n;return n}S.length;var C=[];return t.forEach((function(t){var e=E(s,t[0]),r=E(l,t[1]);if(e>=0&&r>=0&&e!==r){var n=T[e],a=T[r];n!==a&&C.push([n,a])}})),a.unique(a.normalize(C)),{positions:S,edges:C}};var n=t("robust-orientation"),a=t("simplicial-complex")},{"robust-orientation":510,"simplicial-complex":522}],525:[function(t,e,r){e.exports=function(t,e){var r,i,o,s;if(e[0][0]<e[1][0])r=e[0],i=e[1];else{if(!(e[0][0]>e[1][0]))return a(e,t);r=e[1],i=e[0]}if(t[0][0]<t[1][0])o=t[0],s=t[1];else{if(!(t[0][0]>t[1][0]))return-a(t,e);o=t[1],s=t[0]}var l=n(r,i,s),u=n(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=n(s,o,i),u=n(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]};var n=t("robust-orientation");function a(t,e){var r,a,i,o;if(e[0][0]<e[1][0])r=e[0],a=e[1];else{if(!(e[0][0]>e[1][0])){var s=Math.min(t[0][1],t[1][1]),l=Math.max(t[0][1],t[1][1]),u=Math.min(e[0][1],e[1][1]),c=Math.max(e[0][1],e[1][1]);return l<u?l-u:s>c?s-c:l-c}r=e[1],a=e[0]}t[0][1]<t[1][1]?(i=t[0],o=t[1]):(i=t[1],o=t[0]);var h=n(a,r,i);return h||(h=n(a,r,o))||o-a}},{"robust-orientation":510}],526:[function(t,e,r){e.exports=function(t){for(var e=t.length,r=2*e,n=new Array(r),i=0;i<e;++i){var l=t[i],u=l[0][0]<l[1][0];n[2*i]=new h(l[0][0],l,u,i),n[2*i+1]=new h(l[1][0],l,!u,i)}n.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])}));var d=a(o),f=[],p=[],m=[];for(i=0;i<r;){for(var g=n[i].x,y=[];i<r;){var v=n[i];if(v.x!==g)break;i+=1,v.segment[0][0]===v.x&&v.segment[1][0]===v.x?v.create&&(v.segment[0][1]<v.segment[1][1]?(y.push(new c(v.segment[0][1],v.index,!0,!0)),y.push(new c(v.segment[1][1],v.index,!1,!1))):(y.push(new c(v.segment[1][1],v.index,!0,!1)),y.push(new c(v.segment[0][1],v.index,!1,!0)))):d=v.create?d.insert(v.segment,v.index):d.remove(v.segment)}f.push(d.root),p.push(g),m.push(y)}return new s(f,p,m)};var n=t("binary-search-bounds"),a=t("functional-red-black-tree"),i=t("robust-orientation"),o=t("./lib/order-segments");function s(t,e,r){this.slabs=t,this.coordinates=e,this.horizontal=r}function l(t,e){return t.y-e}function u(t,e){for(var r=null;t;){var n,a,o=t.key;o[0][0]<o[1][0]?(n=o[0],a=o[1]):(n=o[1],a=o[0]);var s=i(n,a,e);if(s<0)t=t.left;else if(s>0)if(e[0]!==o[1][0])r=t,t=t.right;else{if(l=u(t.right,e))return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l;if(l=u(t.right,e))return l;t=t.left}}return r}function c(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function h(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}s.prototype.castUp=function(t){var e=n.le(this.coordinates,t[0]);if(e<0)return-1;this.slabs[e];var r=u(this.slabs[e],t),a=-1;if(r&&(a=r.value),this.coordinates[e]===t[0]){var s=null;if(r&&(s=r.key),e>0){var c=u(this.slabs[e-1],t);c&&(s?o(c.key,s)>0&&(s=c.key,a=c.value):(a=c.value,s=c.key))}var h=this.horizontal[e];if(h.length>0){var d=n.ge(h,t[1],l);if(d<h.length){var f=h[d];if(t[1]===f.y){if(f.closed)return f.index;for(;d<h.length-1&&h[d+1].y===t[1];)if((f=h[d+=1]).closed)return f.index;if(f.y===t[1]&&!f.start){if((d+=1)>=h.length)return a;f=h[d]}}if(f.start)if(s){var p=i(s[0],s[1],[t[0],f.y]);s[0][0]>s[1][0]&&(p=-p),p>0&&(a=f.index)}else a=f.index;else f.y!==t[1]&&(a=f.index)}}}return a}},{"./lib/order-segments":525,"binary-search-bounds":91,"functional-red-black-tree":230,"robust-orientation":510}],527:[function(t,e,r){var n=t("robust-dot-product"),a=t("robust-sum");function i(t,e){var r=a(n(t,e),[e[e.length-1]]);return r[r.length-1]}function o(t,e,r,n){var a=-e/(n-e);a<0?a=0:a>1&&(a=1);for(var i=1-a,o=t.length,s=new Array(o),l=0;l<o;++l)s[l]=a*t[l]+i*r[l];return s}e.exports=function(t,e){for(var r=[],n=[],a=i(t[t.length-1],e),s=t[t.length-1],l=t[0],u=0;u<t.length;++u,s=l){var c=i(l=t[u],e);if(a<0&&c>0||a>0&&c<0){var h=o(s,c,l,a);r.push(h),n.push(h.slice())}c<0?n.push(l.slice()):c>0?r.push(l.slice()):(r.push(l.slice()),n.push(l.slice())),a=c}return{positive:r,negative:n}},e.exports.positive=function(t,e){for(var r=[],n=i(t[t.length-1],e),a=t[t.length-1],s=t[0],l=0;l<t.length;++l,a=s){var u=i(s=t[l],e);(n<0&&u>0||n>0&&u<0)&&r.push(o(a,u,s,n)),u>=0&&r.push(s.slice()),n=u}return r},e.exports.negative=function(t,e){for(var r=[],n=i(t[t.length-1],e),a=t[t.length-1],s=t[0],l=0;l<t.length;++l,a=s){var u=i(s=t[l],e);(n<0&&u>0||n>0&&u<0)&&r.push(o(a,u,s,n)),u<=0&&r.push(s.slice()),n=u}return r}},{"robust-dot-product":507,"robust-sum":515}],528:[function(t,e,r){!function(){var t={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function e(r){return function(r,n){var a,i,o,s,l,u,c,h,d,f=1,p=r.length,m="";for(i=0;i<p;i++)if("string"==typeof r[i])m+=r[i];else if("object"==typeof r[i]){if((s=r[i]).keys)for(a=n[f],o=0;o<s.keys.length;o++){if(null==a)throw new Error(e('[sprintf] Cannot access property "%s" of undefined value "%s"',s.keys[o],s.keys[o-1]));a=a[s.keys[o]]}else a=s.param_no?n[s.param_no]:n[f++];if(t.not_type.test(s.type)&&t.not_primitive.test(s.type)&&a instanceof Function&&(a=a()),t.numeric_arg.test(s.type)&&"number"!=typeof a&&isNaN(a))throw new TypeError(e("[sprintf] expecting number but found %T",a));switch(t.number.test(s.type)&&(h=a>=0),s.type){case"b":a=parseInt(a,10).toString(2);break;case"c":a=String.fromCharCode(parseInt(a,10));break;case"d":case"i":a=parseInt(a,10);break;case"j":a=JSON.stringify(a,null,s.width?parseInt(s.width):0);break;case"e":a=s.precision?parseFloat(a).toExponential(s.precision):parseFloat(a).toExponential();break;case"f":a=s.precision?parseFloat(a).toFixed(s.precision):parseFloat(a);break;case"g":a=s.precision?String(Number(a.toPrecision(s.precision))):parseFloat(a);break;case"o":a=(parseInt(a,10)>>>0).toString(8);break;case"s":a=String(a),a=s.precision?a.substring(0,s.precision):a;break;case"t":a=String(!!a),a=s.precision?a.substring(0,s.precision):a;break;case"T":a=Object.prototype.toString.call(a).slice(8,-1).toLowerCase(),a=s.precision?a.substring(0,s.precision):a;break;case"u":a=parseInt(a,10)>>>0;break;case"v":a=a.valueOf(),a=s.precision?a.substring(0,s.precision):a;break;case"x":a=(parseInt(a,10)>>>0).toString(16);break;case"X":a=(parseInt(a,10)>>>0).toString(16).toUpperCase()}t.json.test(s.type)?m+=a:(!t.number.test(s.type)||h&&!s.sign?d="":(d=h?"+":"-",a=a.toString().replace(t.sign,"")),u=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",c=s.width-(d+a).length,l=s.width&&c>0?u.repeat(c):"",m+=s.align?d+a+l:"0"===u?d+l+a:l+d+a)}return m}(function(e){if(a[e])return a[e];for(var r,n=e,i=[],o=0;n;){if(null!==(r=t.text.exec(n)))i.push(r[0]);else if(null!==(r=t.modulo.exec(n)))i.push("%");else{if(null===(r=t.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(r[2]){o|=1;var s=[],l=r[2],u=[];if(null===(u=t.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(u[1]);""!==(l=l.substring(u[0].length));)if(null!==(u=t.key_access.exec(l)))s.push(u[1]);else{if(null===(u=t.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(u[1])}r[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");i.push({placeholder:r[0],param_no:r[1],keys:r[2],sign:r[3],pad_char:r[4],align:r[5],width:r[6],precision:r[7],type:r[8]})}n=n.substring(r[0].length)}return a[e]=i}(r),arguments)}function n(t,r){return e.apply(null,[t].concat(r||[]))}var a=Object.create(null);void 0!==r&&(r.sprintf=e,r.vsprintf=n),"undefined"!=typeof window&&(window.sprintf=e,window.vsprintf=n)}()},{}],529:[function(t,e,r){var n=t("parenthesis");e.exports=function(t,e,r){if(null==t)throw Error("First argument should be a string");if(null==e)throw Error("Separator should be a string or a RegExp");r?("string"==typeof r||Array.isArray(r))&&(r={ignore:r}):r={},null==r.escape&&(r.escape=!0),null==r.ignore?r.ignore=["[]","()","{}","<>",'""',"''","``","“”","«»"]:("string"==typeof r.ignore&&(r.ignore=[r.ignore]),r.ignore=r.ignore.map((function(t){return 1===t.length&&(t+=t),t})));var a=n.parse(t,{flat:!0,brackets:r.ignore}),i=a[0].split(e);if(r.escape){for(var o=[],s=0;s<i.length;s++){var l=i[s],u=i[s+1];"\\"===l[l.length-1]&&"\\"!==l[l.length-2]?(o.push(l+e+u),s++):o.push(l)}i=o}for(s=0;s<i.length;s++)a[0]=i[s],i[s]=n.stringify(a,{flat:!0});return i}},{parenthesis:458}],530:[function(t,e,r){e.exports=function(t){for(var e=t.length,r=new Array(e),n=new Array(e),a=new Array(e),i=new Array(e),o=new Array(e),s=new Array(e),l=0;l<e;++l)r[l]=-1,n[l]=0,a[l]=!1,i[l]=0,o[l]=-1,s[l]=[];var u,c=0,h=[],d=[];function f(e){var l=[e],u=[e];for(r[e]=n[e]=c,a[e]=!0,c+=1;u.length>0;){e=u[u.length-1];var f=t[e];if(i[e]<f.length){for(var p=i[e];p<f.length;++p){var m=f[p];if(r[m]<0){r[m]=n[m]=c,a[m]=!0,c+=1,l.push(m),u.push(m);break}a[m]&&(n[e]=0|Math.min(n[e],n[m])),o[m]>=0&&s[e].push(o[m])}i[e]=p}else{if(n[e]===r[e]){var g=[],y=[],v=0;for(p=l.length-1;p>=0;--p){var _=l[p];if(a[_]=!1,g.push(_),y.push(s[_]),v+=s[_].length,o[_]=h.length,_===e){l.length=p;break}}h.push(g);var x=new Array(v);for(p=0;p<y.length;p++)for(var b=0;b<y[p].length;b++)x[--v]=y[p][b];d.push(x)}u.pop()}}}for(l=0;l<e;++l)r[l]<0&&f(l);for(l=0;l<d.length;l++){var p=d[l];if(0!==p.length){p.sort((function(t,e){return t-e})),u=[p[0]];for(var m=1;m<p.length;m++)p[m]!==p[m-1]&&u.push(p[m]);d[l]=u}}return{components:h,adjacencyList:d}}},{}],531:[function(t,e,r){e.exports=function(t,e){if(t.dimension<=0)return{positions:[],cells:[]};if(1===t.dimension)return function(t,e){for(var r=i(t,e),n=r.length,a=new Array(n),o=new Array(n),s=0;s<n;++s)a[s]=[r[s]],o[s]=[s];return{positions:a,cells:o}}(t,e);var r=t.order.join()+"-"+t.dtype,s=o[r];return e=+e||0,s||(s=o[r]=function(t,e){var r=t.length,i=["'use strict';"],o="surfaceNets"+t.join("_")+"d"+e;i.push("var contour=genContour({","order:[",t.join(),"],","scalarArguments: 3,","phase:function phaseFunc(p,a,b,c) { return (p > c)|0 },"),"generic"===e&&i.push("getters:[0],");for(var s=[],l=[],u=0;u<r;++u)s.push("d"+u),l.push("d"+u);for(u=0;u<1<<r;++u)s.push("v"+u),l.push("v"+u);for(u=0;u<1<<r;++u)s.push("p"+u),l.push("p"+u);s.push("a","b","c"),l.push("a","c"),i.push("vertex:function vertexFunc(",s.join(),"){");var c=[];for(u=0;u<1<<r;++u)c.push("(p"+u+"<<"+u+")");i.push("var m=(",c.join("+"),")|0;if(m===0||m===",(1<<(1<<r))-1,"){return}");var h=[],d=[];for(1<<(1<<r)<=128?(i.push("switch(m){"),d=i):i.push("switch(m>>>7){"),u=0;u<1<<(1<<r);++u){if(1<<(1<<r)>128&&u%128==0){h.length>0&&d.push("}}");var f="vExtra"+h.length;i.push("case ",u>>>7,":",f,"(m&0x7f,",l.join(),");break;"),d=["function ",f,"(m,",l.join(),"){switch(m){"],h.push(d)}d.push("case ",127&u,":");for(var p=new Array(r),m=new Array(r),g=new Array(r),y=new Array(r),v=0,_=0;_<r;++_)p[_]=[],m[_]=[],g[_]=0,y[_]=0;for(_=0;_<1<<r;++_)for(var x=0;x<r;++x){var b=_^1<<x;if(!(b>_)&&!(u&1<<b)!=!(u&1<<_)){var w=1;u&1<<b?m[x].push("v"+b+"-v"+_):(m[x].push("v"+_+"-v"+b),w=-w),w<0?(p[x].push("-v"+_+"-v"+b),g[x]+=2):(p[x].push("v"+_+"+v"+b),g[x]-=2),v+=1;for(var M=0;M<r;++M)M!==x&&(b&1<<M?y[M]+=1:y[M]-=1)}}var k=[];for(x=0;x<r;++x)if(0===p[x].length)k.push("d"+x+"-0.5");else{var T="";g[x]<0?T=g[x]+"*c":g[x]>0&&(T="+"+g[x]+"*c");var L=p[x].length/v*.5,A=.5+y[x]/v*.5;k.push("d"+x+"-"+A+"-"+L+"*("+p[x].join("+")+T+")/("+m[x].join("+")+")")}d.push("a.push([",k.join(),"]);","break;")}i.push("}},"),h.length>0&&d.push("}}");var S=[];for(u=0;u<1<<r-1;++u)S.push("v"+u);S.push("c0","c1","p0","p1","a","b","c"),i.push("cell:function cellFunc(",S.join(),"){");var E=a(r-1);for(i.push("if(p0){b.push(",E.map((function(t){return"["+t.map((function(t){return"v"+t}))+"]"})).join(),")}else{b.push(",E.map((function(t){var e=t.slice();return e.reverse(),"["+e.map((function(t){return"v"+t}))+"]"})).join(),")}}});function ",o,"(array,level){var verts=[],cells=[];contour(array,verts,cells,level);return {positions:verts,cells:cells};} return ",o,";"),u=0;u<h.length;++u)i.push(h[u].join(""));return new Function("genContour",i.join(""))(n)}(t.order,t.dtype)),s(t,e)};var n=t("ndarray-extract-contour"),a=t("triangulate-hypercube"),i=t("zero-crossings"),o={}},{"ndarray-extract-contour":439,"triangulate-hypercube":541,"zero-crossings":574}],532:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0});var n=2*Math.PI,a=function(t,e,r,n,a,i,o){var s=t.x,l=t.y;return{x:n*(s*=e)-a*(l*=r)+i,y:a*s+n*l+o}},i=function(t,e){var r=.551915024494*(e<0?-1:1),n=Math.cos(t),a=Math.sin(t),i=Math.cos(t+e),o=Math.sin(t+e);return[{x:n-a*r,y:a+n*r},{x:i+o*r,y:o-i*r},{x:i,y:o}]},o=function(t,e,r,n){var a=t*n-e*r<0?-1:1,i=(t*r+e*n)/(Math.sqrt(t*t+e*e)*Math.sqrt(t*t+e*e));return i>1&&(i=1),i<-1&&(i=-1),a*Math.acos(i)};r.default=function(t){var e=t.px,r=t.py,s=t.cx,l=t.cy,u=t.rx,c=t.ry,h=t.xAxisRotation,d=void 0===h?0:h,f=t.largeArcFlag,p=void 0===f?0:f,m=t.sweepFlag,g=void 0===m?0:m,y=[];if(0===u||0===c)return[];var v=Math.sin(d*n/360),_=Math.cos(d*n/360),x=_*(e-s)/2+v*(r-l)/2,b=-v*(e-s)/2+_*(r-l)/2;if(0===x&&0===b)return[];u=Math.abs(u),c=Math.abs(c);var w=Math.pow(x,2)/Math.pow(u,2)+Math.pow(b,2)/Math.pow(c,2);w>1&&(u*=Math.sqrt(w),c*=Math.sqrt(w));var M=function(t,e,r,a,i,s,l,u,c,h,d,f){var p=Math.pow(i,2),m=Math.pow(s,2),g=Math.pow(d,2),y=Math.pow(f,2),v=p*m-p*y-m*g;v<0&&(v=0),v/=p*y+m*g;var _=(v=Math.sqrt(v)*(l===u?-1:1))*i/s*f,x=v*-s/i*d,b=h*_-c*x+(t+r)/2,w=c*_+h*x+(e+a)/2,M=(d-_)/i,k=(f-x)/s,T=(-d-_)/i,L=(-f-x)/s,A=o(1,0,M,k),S=o(M,k,T,L);return 0===u&&S>0&&(S-=n),1===u&&S<0&&(S+=n),[b,w,A,S]}(e,r,s,l,u,c,p,g,v,_,x,b),k=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=[],n=!0,a=!1,i=void 0;try{for(var o,s=t[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!e||r.length!==e);n=!0);}catch(t){a=!0,i=t}finally{try{!n&&s.return&&s.return()}finally{if(a)throw i}}return r}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(M,4),T=k[0],L=k[1],A=k[2],S=k[3],E=Math.abs(S)/(n/4);Math.abs(1-E)<1e-7&&(E=1);var C=Math.max(Math.ceil(E),1);S/=C;for(var D=0;D<C;D++)y.push(i(A,S)),A+=S;return y.map((function(t){var e=a(t[0],u,c,_,v,T,L),r=e.x,n=e.y,i=a(t[1],u,c,_,v,T,L),o=i.x,s=i.y,l=a(t[2],u,c,_,v,T,L);return{x1:r,y1:n,x2:o,y2:s,x:l.x,y:l.y}}))},e.exports=r.default},{}],533:[function(t,e,r){var n=t("parse-svg-path"),a=t("abs-svg-path"),i=t("normalize-svg-path"),o=t("is-svg-path"),s=t("assert");e.exports=function(t){if(Array.isArray(t)&&1===t.length&&"string"==typeof t[0]&&(t=t[0]),"string"==typeof t&&(s(o(t),"String is not an SVG path."),t=n(t)),s(Array.isArray(t),"Argument should be a string or an array of path segments."),t=a(t),!(t=i(t)).length)return[0,0,0,0];for(var e=[1/0,1/0,-1/0,-1/0],r=0,l=t.length;r<l;r++)for(var u=t[r].slice(1),c=0;c<u.length;c+=2)u[c+0]<e[0]&&(e[0]=u[c+0]),u[c+1]<e[1]&&(e[1]=u[c+1]),u[c+0]>e[2]&&(e[2]=u[c+0]),u[c+1]>e[3]&&(e[3]=u[c+1]);return e}},{"abs-svg-path":60,assert:68,"is-svg-path":424,"normalize-svg-path":534,"parse-svg-path":460}],534:[function(t,e,r){e.exports=function(t){for(var e,r=[],o=0,s=0,l=0,u=0,c=null,h=null,d=0,f=0,p=0,m=t.length;p<m;p++){var g=t[p],y=g[0];switch(y){case"M":l=g[1],u=g[2];break;case"A":var v=n({px:d,py:f,cx:g[6],cy:g[7],rx:g[1],ry:g[2],xAxisRotation:g[3],largeArcFlag:g[4],sweepFlag:g[5]});if(!v.length)continue;for(var _,x=0;x<v.length;x++)g=["C",(_=v[x]).x1,_.y1,_.x2,_.y2,_.x,_.y],x<v.length-1&&r.push(g);break;case"S":var b=d,w=f;"C"!=e&&"S"!=e||(b+=b-o,w+=w-s),g=["C",b,w,g[1],g[2],g[3],g[4]];break;case"T":"Q"==e||"T"==e?(c=2*d-c,h=2*f-h):(c=d,h=f),g=i(d,f,c,h,g[1],g[2]);break;case"Q":c=g[1],h=g[2],g=i(d,f,g[1],g[2],g[3],g[4]);break;case"L":g=a(d,f,g[1],g[2]);break;case"H":g=a(d,f,g[1],f);break;case"V":g=a(d,f,d,g[1]);break;case"Z":g=a(d,f,l,u)}e=y,d=g[g.length-2],f=g[g.length-1],g.length>4?(o=g[g.length-4],s=g[g.length-3]):(o=d,s=f),r.push(g)}return r};var n=t("svg-arc-to-cubic-bezier");function a(t,e,r,n){return["C",t,e,r,n,r,n]}function i(t,e,r,n,a,i){return["C",t/3+2/3*r,e/3+2/3*n,a/3+2/3*r,i/3+2/3*n,a,i]}},{"svg-arc-to-cubic-bezier":532}],535:[function(t,e,r){var n,a=t("svg-path-bounds"),i=t("parse-svg-path"),o=t("draw-svg-path"),s=t("is-svg-path"),l=t("bitmap-sdf"),u=document.createElement("canvas"),c=u.getContext("2d");e.exports=function(t,e){if(!s(t))throw Error("Argument should be valid svg path string");var r,h;e||(e={}),e.shape?(r=e.shape[0],h=e.shape[1]):(r=u.width=e.w||e.width||200,h=u.height=e.h||e.height||200);var d=Math.min(r,h),f=e.stroke||0,p=e.viewbox||e.viewBox||a(t),m=[r/(p[2]-p[0]),h/(p[3]-p[1])],g=Math.min(m[0]||0,m[1]||0)/2;if(c.fillStyle="black",c.fillRect(0,0,r,h),c.fillStyle="white",f&&("number"!=typeof f&&(f=1),c.strokeStyle=f>0?"white":"black",c.lineWidth=Math.abs(f)),c.translate(.5*r,.5*h),c.scale(g,g),function(){if(null!=n)return n;var t=document.createElement("canvas").getContext("2d");if(t.canvas.width=t.canvas.height=1,!window.Path2D)return n=!1;var e=new Path2D("M0,0h1v1h-1v-1Z");t.fillStyle="black",t.fill(e);var r=t.getImageData(0,0,1,1);return n=r&&r.data&&255===r.data[3]}()){var y=new Path2D(t);c.fill(y),f&&c.stroke(y)}else{var v=i(t);o(c,v),c.fill(),f&&c.stroke()}return c.setTransform(1,0,0,1,0,0),l(c,{cutoff:null!=e.cutoff?e.cutoff:.5,radius:null!=e.radius?e.radius:.5*d})}},{"bitmap-sdf":93,"draw-svg-path":168,"is-svg-path":424,"parse-svg-path":460,"svg-path-bounds":533}],536:[function(t,e,r){(function(r){e.exports=function t(e,r,a){a=a||{};var o=i[e];o||(o=i[e]={" ":{data:new Float32Array(0),shape:.2}});var s=o[r];if(!s)if(r.length<=1||!/\d/.test(r))s=o[r]=function(t){for(var e=t.cells,r=t.positions,n=new Float32Array(6*e.length),a=0,i=0,o=0;o<e.length;++o)for(var s=e[o],l=0;l<3;++l){var u=r[s[l]];n[a++]=u[0],n[a++]=u[1]+1.4,i=Math.max(u[0],i)}return{data:n,shape:i}}(n(r,{triangles:!0,font:e,textAlign:a.textAlign||"left",textBaseline:"alphabetic",styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0}}));else{for(var l=r.split(/(\d|\s)/),u=new Array(l.length),c=0,h=0,d=0;d<l.length;++d)u[d]=t(e,l[d]),c+=u[d].data.length,h+=u[d].shape,d>0&&(h+=.02);var f=new Float32Array(c),p=0,m=-.5*h;for(d=0;d<u.length;++d){for(var g=u[d].data,y=0;y<g.length;y+=2)f[p++]=g[y]+m,f[p++]=g[y+1];m+=u[d].shape+.02}s=o[r]={data:f,shape:h}}return s};var n=t("vectorize-text"),a=window||r.global||{},i=a.__TEXT_CACHE||{};a.__TEXT_CACHE={}}).call(this,t("_process"))},{_process:482,"vectorize-text":550}],537:[function(t,e,r){!function(t){var r=/^\s+/,n=/\s+$/,a=0,i=t.round,o=t.min,s=t.max,l=t.random;function u(e,l){if(l=l||{},(e=e||"")instanceof u)return e;if(!(this instanceof u))return new u(e,l);var c=function(e){var a,i,l,u={r:0,g:0,b:0},c=1,h=null,d=null,f=null,p=!1,m=!1;return"string"==typeof e&&(e=function(t){t=t.replace(r,"").replace(n,"").toLowerCase();var e,a=!1;if(A[t])t=A[t],a=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};return(e=j.rgb.exec(t))?{r:e[1],g:e[2],b:e[3]}:(e=j.rgba.exec(t))?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=j.hsl.exec(t))?{h:e[1],s:e[2],l:e[3]}:(e=j.hsla.exec(t))?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=j.hsv.exec(t))?{h:e[1],s:e[2],v:e[3]}:(e=j.hsva.exec(t))?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=j.hex8.exec(t))?{r:P(e[1]),g:P(e[2]),b:P(e[3]),a:R(e[4]),format:a?"name":"hex8"}:(e=j.hex6.exec(t))?{r:P(e[1]),g:P(e[2]),b:P(e[3]),format:a?"name":"hex"}:(e=j.hex4.exec(t))?{r:P(e[1]+""+e[1]),g:P(e[2]+""+e[2]),b:P(e[3]+""+e[3]),a:R(e[4]+""+e[4]),format:a?"name":"hex8"}:!!(e=j.hex3.exec(t))&&{r:P(e[1]+""+e[1]),g:P(e[2]+""+e[2]),b:P(e[3]+""+e[3]),format:a?"name":"hex"}}(e)),"object"==typeof e&&(B(e.r)&&B(e.g)&&B(e.b)?(a=e.r,i=e.g,l=e.b,u={r:255*C(a,255),g:255*C(i,255),b:255*C(l,255)},p=!0,m="%"===String(e.r).substr(-1)?"prgb":"rgb"):B(e.h)&&B(e.s)&&B(e.v)?(h=z(e.s),d=z(e.v),u=function(e,r,n){e=6*C(e,360),r=C(r,100),n=C(n,100);var a=t.floor(e),i=e-a,o=n*(1-r),s=n*(1-i*r),l=n*(1-(1-i)*r),u=a%6;return{r:255*[n,s,o,o,l,n][u],g:255*[l,n,n,s,o,o][u],b:255*[o,o,l,n,n,s][u]}}(e.h,h,d),p=!0,m="hsv"):B(e.h)&&B(e.s)&&B(e.l)&&(h=z(e.s),f=z(e.l),u=function(t,e,r){var n,a,i;function o(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=C(t,360),e=C(e,100),r=C(r,100),0===e)n=a=i=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),a=o(l,s,t),i=o(l,s,t-1/3)}return{r:255*n,g:255*a,b:255*i}}(e.h,h,f),p=!0,m="hsl"),e.hasOwnProperty("a")&&(c=e.a)),c=E(c),{ok:p,format:e.format||m,r:o(255,s(u.r,0)),g:o(255,s(u.g,0)),b:o(255,s(u.b,0)),a:c}}(e);this._originalInput=e,this._r=c.r,this._g=c.g,this._b=c.b,this._a=c.a,this._roundA=i(100*this._a)/100,this._format=l.format||c.format,this._gradientType=l.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=c.ok,this._tc_id=a++}function c(t,e,r){t=C(t,255),e=C(e,255),r=C(r,255);var n,a,i=s(t,e,r),l=o(t,e,r),u=(i+l)/2;if(i==l)n=a=0;else{var c=i-l;switch(a=u>.5?c/(2-i-l):c/(i+l),i){case t:n=(e-r)/c+(e<r?6:0);break;case e:n=(r-t)/c+2;break;case r:n=(t-e)/c+4}n/=6}return{h:n,s:a,l:u}}function h(t,e,r){t=C(t,255),e=C(e,255),r=C(r,255);var n,a,i=s(t,e,r),l=o(t,e,r),u=i,c=i-l;if(a=0===i?0:c/i,i==l)n=0;else{switch(i){case t:n=(e-r)/c+(e<r?6:0);break;case e:n=(r-t)/c+2;break;case r:n=(t-e)/c+4}n/=6}return{h:n,s:a,v:u}}function d(t,e,r,n){var a=[O(i(t).toString(16)),O(i(e).toString(16)),O(i(r).toString(16))];return n&&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[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function f(t,e,r,n){return[O(I(n)),O(i(t).toString(16)),O(i(e).toString(16)),O(i(r).toString(16))].join("")}function p(t,e){e=0===e?0:e||10;var r=u(t).toHsl();return r.s-=e/100,r.s=D(r.s),u(r)}function m(t,e){e=0===e?0:e||10;var r=u(t).toHsl();return r.s+=e/100,r.s=D(r.s),u(r)}function g(t){return u(t).desaturate(100)}function y(t,e){e=0===e?0:e||10;var r=u(t).toHsl();return r.l+=e/100,r.l=D(r.l),u(r)}function v(t,e){e=0===e?0:e||10;var r=u(t).toRgb();return r.r=s(0,o(255,r.r-i(-e/100*255))),r.g=s(0,o(255,r.g-i(-e/100*255))),r.b=s(0,o(255,r.b-i(-e/100*255))),u(r)}function _(t,e){e=0===e?0:e||10;var r=u(t).toHsl();return r.l-=e/100,r.l=D(r.l),u(r)}function x(t,e){var r=u(t).toHsl(),n=(r.h+e)%360;return r.h=n<0?360+n:n,u(r)}function b(t){var e=u(t).toHsl();return e.h=(e.h+180)%360,u(e)}function w(t){var e=u(t).toHsl(),r=e.h;return[u(t),u({h:(r+120)%360,s:e.s,l:e.l}),u({h:(r+240)%360,s:e.s,l:e.l})]}function M(t){var e=u(t).toHsl(),r=e.h;return[u(t),u({h:(r+90)%360,s:e.s,l:e.l}),u({h:(r+180)%360,s:e.s,l:e.l}),u({h:(r+270)%360,s:e.s,l:e.l})]}function k(t){var e=u(t).toHsl(),r=e.h;return[u(t),u({h:(r+72)%360,s:e.s,l:e.l}),u({h:(r+216)%360,s:e.s,l:e.l})]}function T(t,e,r){e=e||6,r=r||30;var n=u(t).toHsl(),a=360/r,i=[u(t)];for(n.h=(n.h-(a*e>>1)+720)%360;--e;)n.h=(n.h+a)%360,i.push(u(n));return i}function L(t,e){e=e||6;for(var r=u(t).toHsv(),n=r.h,a=r.s,i=r.v,o=[],s=1/e;e--;)o.push(u({h:n,s:a,v:i})),i=(i+s)%1;return o}u.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var e,r,n,a=this.toRgb();return e=a.r/255,r=a.g/255,n=a.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=E(t),this._roundA=i(100*this._a)/100,this},toHsv:function(){var t=h(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=h(this._r,this._g,this._b),e=i(360*t.h),r=i(100*t.s),n=i(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=c(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=c(this._r,this._g,this._b),e=i(360*t.h),r=i(100*t.s),n=i(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return d(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,a){var o=[O(i(t).toString(16)),O(i(e).toString(16)),O(i(r).toString(16)),O(I(n))];return a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*C(this._r,255))+"%",g:i(100*C(this._g,255))+"%",b:i(100*C(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*C(this._r,255))+"%, "+i(100*C(this._g,255))+"%, "+i(100*C(this._b,255))+"%)":"rgba("+i(100*C(this._r,255))+"%, "+i(100*C(this._g,255))+"%, "+i(100*C(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[d(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+f(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var a=u(t);r="#"+f(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return u(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(y,arguments)},brighten:function(){return this._applyModification(v,arguments)},darken:function(){return this._applyModification(_,arguments)},desaturate:function(){return this._applyModification(p,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(g,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(T,arguments)},complement:function(){return this._applyCombination(b,arguments)},monochromatic:function(){return this._applyCombination(L,arguments)},splitcomplement:function(){return this._applyCombination(k,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(M,arguments)}},u.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:z(t[n]));t=r}return u(t,e)},u.equals=function(t,e){return!(!t||!e)&&u(t).toRgbString()==u(e).toRgbString()},u.random=function(){return u.fromRatio({r:l(),g:l(),b:l()})},u.mix=function(t,e,r){r=0===r?0:r||50;var n=u(t).toRgb(),a=u(e).toRgb(),i=r/100;return u({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},u.readability=function(e,r){var n=u(e),a=u(r);return(t.max(n.getLuminance(),a.getLuminance())+.05)/(t.min(n.getLuminance(),a.getLuminance())+.05)},u.isReadable=function(t,e,r){var n,a,i=u.readability(t,e);switch(a=!1,(n=function(t){var e,r;return"AA"!==(e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==e&&(e="AA"),"small"!==(r=(t.size||"small").toLowerCase())&&"large"!==r&&(r="small"),{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},u.mostReadable=function(t,e,r){var n,a,i,o,s=null,l=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var c=0;c<e.length;c++)(n=u.readability(t,e[c]))>l&&(l=n,s=u(e[c]));return u.isReadable(t,s,{level:i,size:o})||!a?s:(r.includeFallbackColors=!1,u.mostReadable(t,["#fff","#000"],r))};var A=u.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},S=u.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(A);function E(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function C(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function D(t){return o(1,s(0,t))}function P(t){return parseInt(t,16)}function O(t){return 1==t.length?"0"+t:""+t}function z(t){return t<=1&&(t=100*t+"%"),t}function I(e){return t.round(255*parseFloat(e)).toString(16)}function R(t){return P(t)/255}var F,N,Y,j=(N="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",Y="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+N),rgba:new RegExp("rgba"+Y),hsl:new RegExp("hsl"+N),hsla:new RegExp("hsla"+Y),hsv:new RegExp("hsv"+N),hsva:new RegExp("hsva"+Y),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function B(t){return!!j.CSS_UNIT.exec(t)}void 0!==e&&e.exports?e.exports=u:window.tinycolor=u}(Math)},{}],538:[function(t,e,r){e.exports=a,e.exports.float32=e.exports.float=a,e.exports.fract32=e.exports.fract=function(t){if(t.length){for(var e=a(t),r=0,n=e.length;r<n;r++)e[r]=t[r]-e[r];return e}return a(t-a(t))};var n=new Float32Array(1);function a(t){if(t.length){if(t instanceof Float32Array)return t;var e=new Float32Array(t);return e.set(t),e}return n[0]=t,n[0]}},{}],539:[function(t,e,r){var n=t("parse-unit");e.exports=i;function a(t,e){var r=n(getComputedStyle(t).getPropertyValue(e));return r[0]*i(r[1],t)}function i(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 function(t,e){var r=document.createElement("div");r.style["font-size"]="128"+t,e.appendChild(r);var n=a(r,"font-size")/128;return e.removeChild(r),n}(t,e);case"em":return a(e,"font-size");case"rem":return a(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 96;case"cm":return 96/2.54;case"mm":return 96/25.4;case"pt":return 96/72;case"pc":return 16}return 1}},{"parse-unit":461}],540:[function(t,e,r){(function(t){var e=function(t){return t},r=function(t){if(null==(r=t.transform))return e;var r,n,a,i=r.scale[0],o=r.scale[1],s=r.translate[0],l=r.translate[1];return function(t,e){return e||(n=a=0),t[0]=(n+=t[0])*i+s,t[1]=(a+=t[1])*o+l,t}},n=function(t){var e=t.bbox;function n(t){l[0]=t[0],l[1]=t[1],s(l),l[0]<u&&(u=l[0]),l[0]>h&&(h=l[0]),l[1]<c&&(c=l[1]),l[1]>d&&(d=l[1])}function a(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(a);break;case"Point":n(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(n)}}if(!e){var i,o,s=r(t),l=new Array(2),u=1/0,c=u,h=-u,d=-u;for(o in t.arcs.forEach((function(t){for(var e=-1,r=t.length;++e<r;)i=t[e],l[0]=i[0],l[1]=i[1],s(l,e),l[0]<u&&(u=l[0]),l[0]>h&&(h=l[0]),l[1]<c&&(c=l[1]),l[1]>d&&(d=l[1])})),t.objects)a(t.objects[o]);e=t.bbox=[u,c,h,d]}return e};function a(t,e){var r=e.id,n=e.bbox,a=null==e.properties?{}:e.properties,o=i(t,e);return null==r&&null==n?{type:"Feature",properties:a,geometry:o}:null==n?{type:"Feature",id:r,properties:a,geometry:o}:{type:"Feature",id:r,bbox:n,properties:a,geometry:o}}function i(t,e){var n=r(t),a=t.arcs;function i(t,e){e.length&&e.pop();for(var r=a[t<0?~t:t],i=0,o=r.length;i<o;++i)e.push(n(r[i].slice(),i));t<0&&function(t,e){for(var r,n=t.length,a=n-e;a<--n;)r=t[a],t[a++]=t[n],t[n]=r}(e,o)}function o(t){return n(t.slice())}function s(t){for(var e=[],r=0,n=t.length;r<n;++r)i(t[r],e);return e.length<2&&e.push(e[0].slice()),e}function l(t){for(var e=s(t);e.length<4;)e.push(e[0].slice());return e}function u(t){return t.map(l)}return function t(e){var r,n=e.type;switch(n){case"GeometryCollection":return{type:n,geometries:e.geometries.map(t)};case"Point":r=o(e.coordinates);break;case"MultiPoint":r=e.coordinates.map(o);break;case"LineString":r=s(e.arcs);break;case"MultiLineString":r=e.arcs.map(s);break;case"Polygon":r=u(e.arcs);break;case"MultiPolygon":r=e.arcs.map(u);break;default:return null}return{type:n,coordinates:r}}(e)}var o=function(t,e){var r={},n={},a={},i=[],o=-1;function s(t,e){for(var n in t){var a=t[n];delete e[a.start],delete a.start,delete a.end,a.forEach((function(t){r[t<0?~t:t]=1})),i.push(a)}}return e.forEach((function(r,n){var a,i=t.arcs[r<0?~r:r];i.length<3&&!i[1][0]&&!i[1][1]&&(a=e[++o],e[o]=r,e[n]=a)})),e.forEach((function(e){var r,i,o=function(e){var r,n=t.arcs[e<0?~e:e],a=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,a]:[a,r]}(e),s=o[0],l=o[1];if(r=a[s])if(delete a[r.end],r.push(e),r.end=l,i=n[l]){delete n[i.start];var u=i===r?r:r.concat(i);n[u.start=r.start]=a[u.end=i.end]=u}else n[r.start]=a[r.end]=r;else if(r=n[l])if(delete n[r.start],r.unshift(e),r.start=s,i=a[s]){delete a[i.end];var c=i===r?r:i.concat(r);n[c.start=i.start]=a[c.end=r.end]=c}else n[r.start]=a[r.end]=r;else n[(r=[e]).start=s]=a[r.end=l]=r})),s(a,n),s(n,a),e.forEach((function(t){r[t<0?~t:t]||i.push([t])})),i};function s(t,e,r){var n,a,i;if(arguments.length>1)n=function(t,e,r){var n,a=[],i=[];function o(t){var e=t<0?~t:t;(i[e]||(i[e]=[])).push({i:t,g:n})}function s(t){t.forEach(o)}function l(t){t.forEach(s)}return function t(e){switch(n=e,e.type){case"GeometryCollection":e.geometries.forEach(t);break;case"LineString":s(e.arcs);break;case"MultiLineString":case"Polygon":l(e.arcs);break;case"MultiPolygon":e.arcs.forEach(l)}}(e),i.forEach(null==r?function(t){a.push(t[0].i)}:function(t){r(t[0].g,t[t.length-1].g)&&a.push(t[0].i)}),a}(0,e,r);else for(a=0,n=new Array(i=t.arcs.length);a<i;++a)n[a]=a;return{type:"MultiLineString",arcs:o(t,n)}}function l(t,e){var r={},n=[],a=[];function s(t){t.forEach((function(e){e.forEach((function(e){(r[e=e<0?~e:e]||(r[e]=[])).push(t)}))})),n.push(t)}function l(e){return function(t){for(var e,r=-1,n=t.length,a=t[n-1],i=0;++r<n;)e=a,a=t[r],i+=e[0]*a[1]-e[1]*a[0];return Math.abs(i)}(i(t,{type:"Polygon",arcs:[e]}).coordinates[0])}return e.forEach((function t(e){switch(e.type){case"GeometryCollection":e.geometries.forEach(t);break;case"Polygon":s(e.arcs);break;case"MultiPolygon":e.arcs.forEach(s)}})),n.forEach((function(t){if(!t._){var e=[],n=[t];for(t._=1,a.push(e);t=n.pop();)e.push(t),t.forEach((function(t){t.forEach((function(t){r[t<0?~t:t].forEach((function(t){t._||(t._=1,n.push(t))}))}))}))}})),n.forEach((function(t){delete t._})),{type:"MultiPolygon",arcs:a.map((function(e){var n,a=[];if(e.forEach((function(t){t.forEach((function(t){t.forEach((function(t){r[t<0?~t:t].length<2&&a.push(t)}))}))})),(n=(a=o(t,a)).length)>1)for(var i,s,u=1,c=l(a[0]);u<n;++u)(i=l(a[u]))>c&&(s=a[0],a[0]=a[u],a[u]=s,c=i);return a}))}}var u=function(t,e){for(var r=0,n=t.length;r<n;){var a=r+n>>>1;t[a]<e?r=a+1:n=a}return r};t.bbox=n,t.feature=function(t,e){return"GeometryCollection"===e.type?{type:"FeatureCollection",features:e.geometries.map((function(e){return a(t,e)}))}:a(t,e)},t.mesh=function(t){return i(t,s.apply(this,arguments))},t.meshArcs=s,t.merge=function(t){return i(t,l.apply(this,arguments))},t.mergeArcs=l,t.neighbors=function(t){var e={},r=t.map((function(){return[]}));function n(t,r){t.forEach((function(t){t<0&&(t=~t);var n=e[t];n?n.push(r):e[t]=[r]}))}function a(t,e){t.forEach((function(t){n(t,e)}))}var i={LineString:n,MultiLineString:a,Polygon:a,MultiPolygon:function(t,e){t.forEach((function(t){a(t,e)}))}};for(var o in t.forEach((function t(e,r){"GeometryCollection"===e.type?e.geometries.forEach((function(e){t(e,r)})):e.type in i&&i[e.type](e.arcs,r)})),e)for(var s=e[o],l=s.length,c=0;c<l;++c)for(var h=c+1;h<l;++h){var d,f=s[c],p=s[h];(d=r[f])[o=u(d,p)]!==p&&d.splice(o,0,p),(d=r[p])[o=u(d,f)]!==f&&d.splice(o,0,f)}return r},t.quantize=function(t,e){if(!((e=Math.floor(e))>=2))throw new Error("n must be ≥2");if(t.transform)throw new Error("already quantized");var r,a=n(t),i=a[0],o=(a[2]-i)/(e-1)||1,s=a[1],l=(a[3]-s)/(e-1)||1;function u(t){t[0]=Math.round((t[0]-i)/o),t[1]=Math.round((t[1]-s)/l)}function c(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(c);break;case"Point":u(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(u)}}for(r in t.arcs.forEach((function(t){for(var e,r,n,a=1,u=1,c=t.length,h=t[0],d=h[0]=Math.round((h[0]-i)/o),f=h[1]=Math.round((h[1]-s)/l);a<c;++a)h=t[a],r=Math.round((h[0]-i)/o),n=Math.round((h[1]-s)/l),r===d&&n===f||((e=t[u++])[0]=r-d,d=r,e[1]=n-f,f=n);u<2&&((e=t[u++])[0]=0,e[1]=0),t.length=u})),t.objects)c(t.objects[r]);return t.transform={scale:[o,l],translate:[i,s]},t},t.transform=r,t.untransform=function(t){if(null==(r=t.transform))return e;var r,n,a,i=r.scale[0],o=r.scale[1],s=r.translate[0],l=r.translate[1];return function(t,e){e||(n=a=0);var r=Math.round((t[0]-s)/i),u=Math.round((t[1]-l)/o);return t[0]=r-n,n=r,t[1]=u-a,a=u,t}},Object.defineProperty(t,"__esModule",{value:!0})})("object"==typeof r&&void 0!==e?r:this.topojson=this.topojson||{})},{}],541:[function(t,e,r){e.exports=function(t){if(t<0)return[];if(0===t)return[[0]];for(var e=0|Math.round(i(t+1)),r=[],o=0;o<e;++o){for(var s=n.unrank(t,o),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};var n=t("permutation-rank"),a=t("permutation-parity"),i=t("gamma")},{gamma:231,"permutation-parity":463,"permutation-rank":464}],542:[function(t,e,r){e.exports=function(t){var e=(t=t||{}).center||[0,0,0],r=t.up||[0,1,0],n=t.right||h(r),a=t.radius||1,i=t.theta||0,c=t.phi||0;if(e=[].slice.call(e,0,3),r=[].slice.call(r,0,3),s(r,r),n=[].slice.call(n,0,3),s(n,n),"eye"in t){var f=t.eye,p=[f[0]-e[0],f[1]-e[1],f[2]-e[2]];o(n,p,r),u(n[0],n[1],n[2])<1e-6?n=h(r):s(n,n),a=u(p[0],p[1],p[2]);var m=l(r,p)/a,g=l(n,p)/a;c=Math.acos(m),i=Math.acos(g)}return a=Math.log(a),new d(t.zoomMin,t.zoomMax,e,r,n,a,i,c)};var n=t("filtered-vector"),a=t("gl-mat4/invert"),i=t("gl-mat4/rotate"),o=t("gl-vec3/cross"),s=t("gl-vec3/normalize"),l=t("gl-vec3/dot");function u(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function c(t){return Math.min(1,Math.max(-1,t))}function h(t){var e=Math.abs(t[0]),r=Math.abs(t[1]),n=Math.abs(t[2]),a=[0,0,0];e>Math.max(r,n)?a[2]=1:r>Math.max(e,n)?a[0]=1:a[1]=1;for(var i=0,o=0,l=0;l<3;++l)i+=t[l]*t[l],o+=a[l]*t[l];for(l=0;l<3;++l)a[l]-=o/i*t[l];return s(a,a),a}function d(t,e,r,a,i,o,s,l){this.center=n(r),this.up=n(a),this.right=n(i),this.radius=n([o]),this.angle=n([s,l]),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)}var f=d.prototype;f.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},f.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])]},f.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,n=0,a=0,i=0;i<3;++i)a+=e[i]*r[i],n+=e[i]*e[i];var l=Math.sqrt(n),c=0;for(i=0;i<3;++i)r[i]-=e[i]*a/n,c+=r[i]*r[i],e[i]/=l;var h=Math.sqrt(c);for(i=0;i<3;++i)r[i]/=h;var d=this.computedToward;o(d,e,r),s(d,d);var f=Math.exp(this.computedRadius[0]),p=this.computedAngle[0],m=this.computedAngle[1],g=Math.cos(p),y=Math.sin(p),v=Math.cos(m),_=Math.sin(m),x=this.computedCenter,b=g*v,w=y*v,M=_,k=-g*_,T=-y*_,L=v,A=this.computedEye,S=this.computedMatrix;for(i=0;i<3;++i){var E=b*r[i]+w*d[i]+M*e[i];S[4*i+1]=k*r[i]+T*d[i]+L*e[i],S[4*i+2]=E,S[4*i+3]=0}var C=S[1],D=S[5],P=S[9],O=S[2],z=S[6],I=S[10],R=D*I-P*z,F=P*O-C*I,N=C*z-D*O,Y=u(R,F,N);for(R/=Y,F/=Y,N/=Y,S[0]=R,S[4]=F,S[8]=N,i=0;i<3;++i)A[i]=x[i]+S[2+4*i]*f;for(i=0;i<3;++i){c=0;for(var j=0;j<3;++j)c+=S[i+4*j]*A[j];S[12+i]=-c}S[15]=1},f.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 p=[0,0,0];f.rotate=function(t,e,r,n){if(this.angle.move(t,e,r),n){this.recalcMatrix(t);var a=this.computedMatrix;p[0]=a[2],p[1]=a[6],p[2]=a[10];for(var o=this.computedUp,s=this.computedRight,l=this.computedToward,u=0;u<3;++u)a[4*u]=o[u],a[4*u+1]=s[u],a[4*u+2]=l[u];for(i(a,a,n,p),u=0;u<3;++u)o[u]=a[4*u],s[u]=a[4*u+1];this.up.set(t,o[0],o[1],o[2]),this.right.set(t,s[0],s[1],s[2])}},f.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var a=this.computedMatrix,i=(Math.exp(this.computedRadius[0]),a[1]),o=a[5],s=a[9],l=u(i,o,s);i/=l,o/=l,s/=l;var c=a[0],h=a[4],d=a[8],f=c*i+h*o+d*s,p=u(c-=i*f,h-=o*f,d-=s*f),m=(c/=p)*e+i*r,g=(h/=p)*e+o*r,y=(d/=p)*e+s*r;this.center.move(t,m,g,y);var v=Math.exp(this.computedRadius[0]);v=Math.max(1e-4,v+n),this.radius.set(t,Math.log(v))},f.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},f.setMatrix=function(t,e,r,n){var i=1;"number"==typeof r&&(i=0|r),(i<0||i>3)&&(i=1);var o=(i+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var s=e[i],l=e[i+4],h=e[i+8];if(n){var d=Math.abs(s),f=Math.abs(l),p=Math.abs(h),m=Math.max(d,f,p);d===m?(s=s<0?-1:1,l=h=0):p===m?(h=h<0?-1:1,s=l=0):(l=l<0?-1:1,s=h=0)}else{var g=u(s,l,h);s/=g,l/=g,h/=g}var y,v,_=e[o],x=e[o+4],b=e[o+8],w=_*s+x*l+b*h,M=u(_-=s*w,x-=l*w,b-=h*w),k=l*(b/=M)-h*(x/=M),T=h*(_/=M)-s*b,L=s*x-l*_,A=u(k,T,L);if(k/=A,T/=A,L/=A,this.center.jump(t,V,W,G),this.radius.idle(t),this.up.jump(t,s,l,h),this.right.jump(t,_,x,b),2===i){var S=e[1],E=e[5],C=e[9],D=S*_+E*x+C*b,P=S*k+E*T+C*L;y=R<0?-Math.PI/2:Math.PI/2,v=Math.atan2(P,D)}else{var O=e[2],z=e[6],I=e[10],R=O*s+z*l+I*h,F=O*_+z*x+I*b,N=O*k+z*T+I*L;y=Math.asin(c(R)),v=Math.atan2(N,F)}this.angle.jump(t,v,y),this.recalcMatrix(t);var Y=e[2],j=e[6],B=e[10],H=this.computedMatrix;a(H,e);var U=H[15],V=H[12]/U,W=H[13]/U,G=H[14]/U,q=Math.exp(this.computedRadius[0]);this.center.jump(t,V-Y*q,W-j*q,G-B*q)},f.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},f.idle=function(t){this.center.idle(t),this.up.idle(t),this.right.idle(t),this.radius.idle(t),this.angle.idle(t)},f.flush=function(t){this.center.flush(t),this.up.flush(t),this.right.flush(t),this.radius.flush(t),this.angle.flush(t)},f.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},f.lookAt=function(t,e,r,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter;var a=(n=n||this.computedUp)[0],i=n[1],o=n[2],s=u(a,i,o);if(!(s<1e-6)){a/=s,i/=s,o/=s;var l=e[0]-r[0],h=e[1]-r[1],d=e[2]-r[2],f=u(l,h,d);if(!(f<1e-6)){l/=f,h/=f,d/=f;var p=this.computedRight,m=p[0],g=p[1],y=p[2],v=a*m+i*g+o*y,_=u(m-=v*a,g-=v*i,y-=v*o);if(!(_<.01&&(_=u(m=i*d-o*h,g=o*l-a*d,y=a*h-i*l))<1e-6)){m/=_,g/=_,y/=_,this.up.set(t,a,i,o),this.right.set(t,m,g,y),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(f));var x=i*y-o*g,b=o*m-a*y,w=a*g-i*m,M=u(x,b,w),k=a*l+i*h+o*d,T=m*l+g*h+y*d,L=(x/=M)*l+(b/=M)*h+(w/=M)*d,A=Math.asin(c(k)),S=Math.atan2(L,T),E=this.angle._state,C=E[E.length-1],D=E[E.length-2];C%=2*Math.PI;var P=Math.abs(C+2*Math.PI-S),O=Math.abs(C-S),z=Math.abs(C-2*Math.PI-S);P<O&&(C+=2*Math.PI),z<O&&(C-=2*Math.PI),this.angle.jump(this.angle.lastT(),C,D),this.angle.set(t,S,A)}}}}},{"filtered-vector":226,"gl-mat4/invert":265,"gl-mat4/rotate":270,"gl-vec3/cross":334,"gl-vec3/dot":339,"gl-vec3/normalize":356}],543:[function(t,e,r){e.exports=function(t,e,r){var a=t*e,i=n*t,o=i-(i-t),s=t-o,l=n*e,u=l-(l-e),c=e-u,h=s*c-(a-o*u-s*u-o*c);return r?(r[0]=h,r[1]=a,r):[h,a]};var n=+(Math.pow(2,27)+1)},{}],544:[function(t,e,r){e.exports=function(t,e,r){var n=t+e,a=n-t,i=e-a,o=t-(n-a);return r?(r[0]=o+i,r[1]=n,r):[o+i,n]}},{}],545:[function(t,e,n){(function(e,r){var a=t("bit-twiddle"),i=t("dup");e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={UINT8:i([32,0]),UINT16:i([32,0]),UINT32:i([32,0]),INT8:i([32,0]),INT16:i([32,0]),INT32:i([32,0]),FLOAT:i([32,0]),DOUBLE:i([32,0]),DATA:i([32,0]),UINT8C:i([32,0]),BUFFER:i([32,0])});var o="undefined"!=typeof Uint8ClampedArray,s=e.__TYPEDARRAY_POOL;s.UINT8C||(s.UINT8C=i([32,0])),s.BUFFER||(s.BUFFER=i([32,0]));var l=s.DATA,u=s.BUFFER;function c(t){if(t){var e=t.length||t.byteLength,r=a.log2(e);l[r].push(t)}}function h(t){t=a.nextPow2(t);var e=a.log2(t),r=l[e];return r.length>0?r.pop():new ArrayBuffer(t)}function d(t){return new Uint8Array(h(t),0,t)}function f(t){return new Uint16Array(h(2*t),0,t)}function p(t){return new Uint32Array(h(4*t),0,t)}function m(t){return new Int8Array(h(t),0,t)}function g(t){return new Int16Array(h(2*t),0,t)}function y(t){return new Int32Array(h(4*t),0,t)}function v(t){return new Float32Array(h(4*t),0,t)}function _(t){return new Float64Array(h(8*t),0,t)}function x(t){return o?new Uint8ClampedArray(h(t),0,t):d(t)}function b(t){return new DataView(h(t),0,t)}function w(t){t=a.nextPow2(t);var e=a.log2(t),n=u[e];return n.length>0?n.pop():new r(t)}n.free=function(t){if(r.isBuffer(t))u[a.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,n=0|a.log2(e);l[n].push(t)}},n.freeUint8=n.freeUint16=n.freeUint32=n.freeInt8=n.freeInt16=n.freeInt32=n.freeFloat32=n.freeFloat=n.freeFloat64=n.freeDouble=n.freeUint8Clamped=n.freeDataView=function(t){c(t.buffer)},n.freeArrayBuffer=c,n.freeBuffer=function(t){u[a.log2(t.length)].push(t)},n.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return h(t);switch(e){case"uint8":return d(t);case"uint16":return f(t);case"uint32":return p(t);case"int8":return m(t);case"int16":return g(t);case"int32":return y(t);case"float":case"float32":return v(t);case"double":case"float64":return _(t);case"uint8_clamped":return x(t);case"buffer":return w(t);case"data":case"dataview":return b(t);default:return null}return null},n.mallocArrayBuffer=h,n.mallocUint8=d,n.mallocUint16=f,n.mallocUint32=p,n.mallocInt8=m,n.mallocInt16=g,n.mallocInt32=y,n.mallocFloat32=n.mallocFloat=v,n.mallocFloat64=n.mallocDouble=_,n.mallocUint8Clamped=x,n.mallocDataView=b,n.mallocBuffer=w,n.clearCache=function(){for(var t=0;t<32;++t)s.UINT8[t].length=0,s.UINT16[t].length=0,s.UINT32[t].length=0,s.INT8[t].length=0,s.INT16[t].length=0,s.INT32[t].length=0,s.FLOAT[t].length=0,s.DOUBLE[t].length=0,s.UINT8C[t].length=0,l[t].length=0,u[t].length=0}}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{"bit-twiddle":92,buffer:105,dup:170}],546:[function(t,e,r){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 a=n.prototype;Object.defineProperty(a,"length",{get:function(){return this.roots.length}}),a.makeSet=function(){var t=this.roots.length;return this.roots.push(t),this.ranks.push(0),t},a.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},a.link=function(t,e){var r=this.find(t),n=this.find(e);if(r!==n){var a=this.ranks,i=this.roots,o=a[r],s=a[n];o<s?i[r]=n:s<o?i[n]=r:(i[n]=r,++a[r])}}},{}],547:[function(t,e,r){e.exports=function(t,e,r){return 0===t.length?t:e?(r||t.sort(e),function(t,e){for(var r=1,n=t.length,a=t[0],i=t[0],o=1;o<n;++o)if(i=a,e(a=t[o],i)){if(o===r){r++;continue}t[r++]=a}return t.length=r,t}(t,e)):(r||t.sort(),function(t){for(var e=1,r=t.length,n=t[0],a=t[0],i=1;i<r;++i,a=n)if(a=n,(n=t[i])!==a){if(i===e){e++;continue}t[e++]=n}return t.length=e,t}(t))}},{}],548:[function(t,e,r){var n=/[\'\"]/;e.exports=function(t){return t?(n.test(t.charAt(0))&&(t=t.substr(1)),n.test(t.charAt(t.length-1))&&(t=t.substr(0,t.length-1)),t):""}},{}],549:[function(t,e,r){e.exports=function(t,e,r){Array.isArray(r)||(r=[].slice.call(arguments,2));for(var n=0,a=r.length;n<a;n++){var i=r[n];for(var o in i)if((void 0===e[o]||Array.isArray(e[o])||t[o]!==e[o])&&o in e){var s;if(!0===i[o])s=e[o];else{if(!1===i[o])continue;if("function"==typeof i[o]&&void 0===(s=i[o](e[o],t,e)))continue}t[o]=s}}return t}},{}],550:[function(t,e,r){e.exports=function(t,e){return"object"==typeof e&&null!==e||(e={}),n(t,e.canvas||a,e.context||i,e)};var n=t("./lib/vtext"),a=null,i=null;"undefined"!=typeof document&&((a=document.createElement("canvas")).width=8192,a.height=1024,i=a.getContext("2d"))},{"./lib/vtext":551}],551:[function(t,e,r){e.exports=function(t,e,r,n){var i=64,o=1.25,s={breaklines:!1,bolds:!1,italics:!1,subscripts:!1,superscripts:!1};return n&&(n.size&&n.size>0&&(i=n.size),n.lineSpacing&&n.lineSpacing>0&&(o=n.lineSpacing),n.styletags&&n.styletags.breaklines&&(s.breaklines=!!n.styletags.breaklines),n.styletags&&n.styletags.bolds&&(s.bolds=!!n.styletags.bolds),n.styletags&&n.styletags.italics&&(s.italics=!!n.styletags.italics),n.styletags&&n.styletags.subscripts&&(s.subscripts=!!n.styletags.subscripts),n.styletags&&n.styletags.superscripts&&(s.superscripts=!!n.styletags.superscripts)),r.font=[n.fontStyle,n.fontVariant,n.fontWeight,i+"px",n.font].filter((function(t){return t})).join(" "),r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr",w(function(t,e,r,n,i,o){r=r.replace(/\n/g,""),r=!0===o.breaklines?r.replace(/\<br\>/g,"\n"):r.replace(/\<br\>/g," ");var s="",l=[];for(M=0;M<r.length;++M)l[M]=s;!0===o.bolds&&(l=_(u,c,r,l)),!0===o.italics&&(l=_(h,d,r,l)),!0===o.superscripts&&(l=_(f,m,r,l)),!0===o.subscripts&&(l=_(g,v,r,l));var x=[],b="";for(M=0;M<r.length;++M)null!==l[M]&&(b+=r[M],x.push(l[M]));var w,M,k,T,L,A=b.split("\n"),S=A.length,E=Math.round(i*n),C=n,D=2*n,P=0,O=S*E+D;t.height<O&&(t.height=O),e.fillStyle="#000",e.fillRect(0,0,t.width,t.height),e.fillStyle="#fff";var z=0,I="";function R(){if(""!==I){var t=e.measureText(I).width;e.fillText(I,C+k,D+T),k+=t}}function F(){return Math.round(L)+"px "}function N(t,r){var n=""+e.font;if(!0===o.subscripts){var a=t.indexOf(y),i=r.indexOf(y),s=a>-1?parseInt(t[1+a]):0,l=i>-1?parseInt(r[1+i]):0;s!==l&&(n=n.replace(F(),"?px "),L*=Math.pow(.75,l-s),n=n.replace("?px ",F())),T+=.25*E*(l-s)}if(!0===o.superscripts){var u=t.indexOf(p),h=r.indexOf(p),f=u>-1?parseInt(t[1+u]):0,m=h>-1?parseInt(r[1+h]):0;f!==m&&(n=n.replace(F(),"?px "),L*=Math.pow(.75,m-f),n=n.replace("?px ",F())),T-=.25*E*(m-f)}if(!0===o.bolds){var g=t.indexOf(c)>-1,v=r.indexOf(c)>-1;!g&&v&&(n=_?n.replace("italic ","italic bold "):"bold "+n),g&&!v&&(n=n.replace("bold ",""))}if(!0===o.italics){var _=t.indexOf(d)>-1,x=r.indexOf(d)>-1;!_&&x&&(n="italic "+n),_&&!x&&(n=n.replace("italic ",""))}e.font=n}for(w=0;w<S;++w){var Y=A[w]+"\n";for(k=0,T=w*E,L=n,I="",M=0;M<Y.length;++M){var j=M+z<x.length?x[M+z]:x[x.length-1];s===j?I+=Y[M]:(R(),I=Y[M],void 0!==j&&(N(s,j),s=j))}R(),z+=Y.length;var B=0|Math.round(k+2*C);P<B&&(P=B)}var H=P,U=D+E*S;return a(e.getImageData(0,0,H,U).data,[U,H,4]).pick(-1,-1,0).transpose(1,0)}(e,r,t,i,o,s),n,i)},e.exports.processPixels=w;var n=t("surface-nets"),a=t("ndarray"),i=t("simplify-planar-graph"),o=t("clean-pslg"),s=t("cdt2d"),l=t("planar-graph-to-polyline"),u="b",c="b|",h="i",d="i|",f="sup",p="+",m="+1",g="sub",y="-",v="-1";function _(t,e,r,n){for(var a="<"+t+">",i="</"+t+">",o=a.length,s=i.length,l=e[0]===p||e[0]===y,u=0,c=-s;u>-1&&-1!==(u=r.indexOf(a,u))&&-1!==(c=r.indexOf(i,u+o))&&!(c<=u);){for(var h=u;h<c+s;++h)if(h<u+o||h>=c)n[h]=null,r=r.substr(0,h)+" "+r.substr(h+1);else if(null!==n[h]){var d=n[h].indexOf(e[0]);-1===d?n[h]+=e:l&&(n[h]=n[h].substr(0,d+1)+(1+parseInt(n[h][d+1]))+n[h].substr(d+2))}var f=u+o,m=r.substr(f,c-f).indexOf(a);u=-1!==m?m:c+s}return n}function x(t,e){var r=n(t,128);return e?i(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}function b(t,e,r,n){var a=x(t,n),i=function(t,e,r){for(var n=e.textAlign||"start",a=e.textBaseline||"alphabetic",i=[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)i[c]=0|Math.min(i[c],u[c]),o[c]=0|Math.max(o[c],u[c]);var h=0;switch(n){case"center":h=-.5*(i[0]+o[0]);break;case"right":case"end":h=-o[0];break;case"left":case"start":h=-i[0];break;default:throw new Error("vectorize-text: Unrecognized textAlign: '"+n+"'")}var d=0;switch(a){case"hanging":case"top":d=-i[1];break;case"middle":d=-.5*(i[1]+o[1]);break;case"alphabetic":case"ideographic":d=-3*r;break;case"bottom":d=-o[1];break;default:throw new Error("vectorize-text: Unrecoginized textBaseline: '"+a+"'")}var f=1/r;return"lineHeight"in e?f*=+e.lineHeight:"width"in e?f=e.width/(o[0]-i[0]):"height"in e&&(f=e.height/(o[1]-i[1])),t.map((function(t){return[f*(t[0]+h),f*(t[1]+d)]}))}(a.positions,e,r),u=a.edges,c="ccw"===e.orientation;if(o(i,u),e.polygons||e.polygon||e.polyline){for(var h=l(u,i),d=new Array(h.length),f=0;f<h.length;++f){for(var p=h[f],m=new Array(p.length),g=0;g<p.length;++g){for(var y=p[g],v=new Array(y.length),_=0;_<y.length;++_)v[_]=i[y[_]].slice();c&&v.reverse(),m[g]=v}d[f]=m}return d}return e.triangles||e.triangulate||e.triangle?{cells:s(i,u,{delaunay:!1,exterior:!1,interior:!0}),positions:i}:{edges:u,positions:i}}function w(t,e,r){try{return b(t,e,r,!0)}catch(t){}try{return b(t,e,r,!1)}catch(t){}return e.polygons||e.polyline||e.polygon?[]:e.triangles||e.triangulate||e.triangle?{cells:[],positions:[]}:{edges:[],positions:[]}}},{cdt2d:106,"clean-pslg":116,ndarray:450,"planar-graph-to-polyline":468,"simplify-planar-graph":524,"surface-nets":531}],552:[function(t,e,r){!function(){if("undefined"==typeof ses||!ses.ok||ses.ok()){"undefined"!=typeof ses&&(ses.weakMapPermitHostObjects=g);var t=!1;if("function"==typeof WeakMap){var r=WeakMap;if("undefined"!=typeof navigator&&/Firefox/.test(navigator.userAgent));else{var n=new r,a=Object.freeze({});if(n.set(a,1),1===n.get(a))return void(e.exports=WeakMap);t=!0}}Object.prototype.hasOwnProperty;var i=Object.getOwnPropertyNames,o=Object.defineProperty,s=Object.isExtensible,l="weakmap:",u=l+"ident:"+Math.random()+"___";if("undefined"!=typeof crypto&&"function"==typeof crypto.getRandomValues&&"function"==typeof ArrayBuffer&&"function"==typeof Uint8Array){var c=new ArrayBuffer(25),h=new Uint8Array(c);crypto.getRandomValues(h),u=l+"rand:"+Array.prototype.map.call(h,(function(t){return(t%36).toString(36)})).join("")+"___"}if(o(Object,"getOwnPropertyNames",{value:function(t){return i(t).filter(y)}}),"getPropertyNames"in Object){var d=Object.getPropertyNames;o(Object,"getPropertyNames",{value:function(t){return d(t).filter(y)}})}!function(){var t=Object.freeze;o(Object,"freeze",{value:function(e){return v(e),t(e)}});var e=Object.seal;o(Object,"seal",{value:function(t){return v(t),e(t)}});var r=Object.preventExtensions;o(Object,"preventExtensions",{value:function(t){return v(t),r(t)}})}();var f=!1,p=0,m=function(){this instanceof m||x();var t=[],e=[],r=p++;return Object.create(m.prototype,{get___:{value:_((function(n,a){var i,o=v(n);return o?r in o?o[r]:a:(i=t.indexOf(n))>=0?e[i]:a}))},has___:{value:_((function(e){var n=v(e);return n?r in n:t.indexOf(e)>=0}))},set___:{value:_((function(n,a){var i,o=v(n);return o?o[r]=a:(i=t.indexOf(n))>=0?e[i]=a:(i=t.length,e[i]=a,t[i]=n),this}))},delete___:{value:_((function(n){var a,i,o=v(n);return o?r in o&&delete o[r]:!((a=t.indexOf(n))<0||(i=t.length-1,t[a]=void 0,e[a]=e[i],t[a]=t[i],t.length=i,e.length=i,0))}))}})};m.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 r?function(){function n(){this instanceof m||x();var e,n=new r,a=void 0,i=!1;return e=t?function(t,e){return n.set(t,e),n.has(t)||(a||(a=new m),a.set(t,e)),this}:function(t,e){if(i)try{n.set(t,e)}catch(r){a||(a=new m),a.set___(t,e)}else n.set(t,e);return this},Object.create(m.prototype,{get___:{value:_((function(t,e){return a?n.has(t)?n.get(t):a.get___(t,e):n.get(t,e)}))},has___:{value:_((function(t){return n.has(t)||!!a&&a.has___(t)}))},set___:{value:_(e)},delete___:{value:_((function(t){var e=!!n.delete(t);return a&&a.delete___(t)||e}))},permitHostObjects___:{value:_((function(t){if(t!==g)throw new Error("bogus call to permitHostObjects___");i=!0}))}})}t&&"undefined"!=typeof Proxy&&(Proxy=void 0),n.prototype=m.prototype,e.exports=n,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),e.exports=m)}function g(t){t.permitHostObjects___&&t.permitHostObjects___(g)}function y(t){return!(t.substr(0,l.length)==l&&"___"===t.substr(t.length-3))}function v(t){if(t!==Object(t))throw new TypeError("Not an object: "+t);var e=t[u];if(e&&e.key===t)return e;if(s(t)){e={key:t};try{return o(t,u,{value:e,writable:!1,enumerable:!1,configurable:!1}),e}catch(t){return}}}function _(t){return t.prototype=null,Object.freeze(t)}function x(){f||"undefined"==typeof console||(f=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}}()},{}],553:[function(t,e,r){var n=t("./hidden-store.js");e.exports=function(){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:n(e,t)}}},{"./hidden-store.js":554}],554:[function(t,e,r){e.exports=function(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}},{}],555:[function(t,e,r){var n=t("./create-store.js");e.exports=function(){var t=n();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}}}},{"./create-store.js":553}],556:[function(t,e,r){var n=t("get-canvas-context");e.exports=function(t){return n("webgl",t)}},{"get-canvas-context":232}],557:[function(t,e,r){var n=t("../main"),a=t("object-assign"),i=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.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(l);return r?r[0]:""}var n=this._validateYear(t),a=t.month(),i=""+this.toChineseMonth(n,a);return e&&i.length<2&&(i="0"+i),this.isIntercalaryMonth(n,a)&&(i+="i"),i},monthNames:function(t){if("string"==typeof t){var e=t.match(u);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),a=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="闰"+a),a},monthNamesShort:function(t){if("string"==typeof t){var e=t.match(c);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),a=["一","二","三","四","五","六","七","八","九","十","十一","十二"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="闰"+a),a},parseMonth:function(t,e){t=this._validateYear(t);var r,n=parseInt(e);if(isNaN(n))"闰"===e[0]&&(r=!0,e=e.substring(1)),"月"===e[e.length-1]&&(e=e.substring(0,e.length-1)),n=1+["一","二","三","四","五","六","七","八","九","十","十一","十二"].indexOf(e);else{var a=e[e.length-1];r="i"===a||"I"===a}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 a=this.intercalaryMonth(t);if(r&&e!==a||e<1||e>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return a?!r&&e<=a?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);if(e<0||e>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e<r?e+1:e:e+1},intercalaryMonth:function(t){return t=this._validateYear(t),h[t-h[0]]>>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var a,o=this._validateYear(t,n.local.invalidyear),s=d[o-d[0]],l=s>>9&4095,u=s>>5&15,c=31&s;(a=i.newDate(l,u,c)).add(4-(a.dayOfWeek()||7),"d");var h=this.toJD(t,e,r)-a.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=h[t-h[0]];if(e>(r>>13?12:11))throw n.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 a=this._validate(t,s,r,n.local.invalidDate);t=this._validateYear(a.year()),e=a.month(),r=a.day();var o=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),l=function(t,e,r,n,a){var i,o,s;if("object"==typeof t)o=t,i=e||{};else{var l;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");"object"==typeof n?(l=!1,i=n):(l=!!n,i={}),o={year:t,month:e,day:r,isIntercalary:l}}s=o.day-1;var u,c=h[o.year-h[0]],f=c>>13;u=f&&(o.month>f||o.isIntercalary)?o.month:o.month-1;for(var p=0;p<u;p++)s+=c&1<<12-p?30:29;var m=d[o.year-d[0]],g=new Date(m>>9&4095,(m>>5&15)-1,(31&m)+s);return i.year=g.getFullYear(),i.month=1+g.getMonth(),i.day=g.getDate(),i}(t,s,r,o);return i.toJD(l.year,l.month,l.day)},fromJD:function(t){var e=i.fromJD(t),r=function(t,e,r,n){var a,i;if("object"==typeof t)a=t,i=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");a={year:t,month:e,day:r},i={}}var o=d[a.year-d[0]],s=a.year<<9|a.month<<5|a.day;i.year=s>=o?a.year:a.year-1,o=d[i.year-d[0]];var l,u=new Date(o>>9&4095,(o>>5&15)-1,31&o),c=new Date(a.year,a.month-1,a.day);l=Math.round((c-u)/864e5);var f,p=h[i.year-h[0]];for(f=0;f<13;f++){var m=p&1<<12-f?30:29;if(l<m)break;l-=m}var g=p>>13;return!g||f<g?(i.isIntercalary=!1,i.month=1+f):f===g?(i.isIntercalary=!0,i.month=f):(i.isIntercalary=!1,i.month=f),i.day=1+l,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(s),r=this._validateYear(+e[1]),n=+e[2],a=!!e[3],i=this.toMonthIndex(r,n,a),o=+e[4];return this.newDate(r,i,o)},add:function(t,e,r){var n=t.year(),a=t.month(),i=this.isIntercalaryMonth(n,a),s=this.toChineseMonth(n,a),l=Object.getPrototypeOf(o.prototype).add.call(this,t,e,r);if("y"===r){var u=l.year(),c=l.month(),h=this.isIntercalaryMonth(u,s),d=i&&h?this.toMonthIndex(u,s,!0):this.toMonthIndex(u,s,!1);d!==c&&l.month(d)}return l}});var s=/^\s*(-?\d\d\d\d|\d\d)[-\/](\d?\d)([iI]?)[-\/](\d?\d)/m,l=/^\d?\d[iI]?/m,u=/^\u95f0?\u5341?[\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]?\u6708/m,c=/^\u95f0?\u5341?[\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]?/m;n.calendars.chinese=o;var h=[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],d=[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":571,"object-assign":454}],558:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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,n.local.invalidYear);return(t=e.year()+(e.year()<0?1:0))%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.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,n.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 a=this._validate(t,e,r,n.local.invalidDate);return(t=a.year())<0&&t++,a.day()+30*(a.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,a=e-30*(n-1)+1;return this.newDate(r,n,a)}}),n.calendars.coptic=i},{"../main":571,"object-assign":454}],559:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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,n.local.invalidYear),!1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),13},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.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,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(t,e,r){return(this._validate(t,e,r,n.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 a=this._validate(t,e,r,n.local.invalidDate);return{century:o[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return t=a.year()+(a.year()<0?1:0),e=a.month(),(r=a.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"};n.calendars.discworld=i},{"../main":571,"object-assign":454}],560:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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,n.local.invalidYear);return(t=e.year()+(e.year()<0?1:0))%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.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,n.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 a=this._validate(t,e,r,n.local.invalidDate);return(t=a.year())<0&&t++,a.day()+30*(a.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,a=e-30*(n-1)+1;return this.newDate(r,n,a)}}),n.calendars.ethiopian=i},{"../main":571,"object-assign":454}],561:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}i.prototype=new n.baseCalendar,a(i.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,n.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return o(7*(t=t<0?t+1:t)+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.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,n.local.invalidYear).year(),this.toJD(-1===t?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,n.local.invalidMonth),12===e&&this.leapYear(t)||8===e&&5===o(this.daysInYear(t),10)?30:9===e&&3===o(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 a=this._validate(t,e,r,n.local.invalidDate);return{yearType:(this.leapYear(a)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(a)%10-3]}},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);t=a.year(),e=a.month(),r=a.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(s=1;s<e;s++)o+=this.daysInMonth(t,s)}else for(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 o(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(-1===e?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)}}),n.calendars.hebrew=i},{"../main":571,"object-assign":454}],562:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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īs","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,n.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,n.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 a=this._validate(t,e,r,n.local.invalidDate);return t=a.year(),e=a.month(),t=t<=0?t+1:t,(r=a.day())+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)}}),n.calendars.islamic=i},{"../main":571,"object-assign":454}],563:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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,n.local.invalidYear);return(t=e.year()<0?e.year()+1:e.year())%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,n.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 a=this._validate(t,e,r,n.local.invalidDate);return t=a.year(),e=a.month(),r=a.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)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),a=Math.floor((e-n)/30.6001),i=a-Math.floor(a<14?1:13),o=r-Math.floor(i>2?4716:4715),s=e-n-Math.floor(30.6001*a);return o<=0&&o--,this.newDate(o,i,s)}}),n.calendars.julian=i},{"../main":571,"object-assign":454}],564:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}function s(t,e){return o(t-1,e)+1}i.prototype=new n.baseCalendar,a(i.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,n.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,n.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(".")).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,n.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),!0},extraInfo:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate).toJD(),i=this._toHaab(a),o=this._toTzolkin(a);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(t){var e=o(8+(t-=this.jdEpoch)+340,365);return[Math.floor(e/20)+1,o(e,20)]},_toTzolkin:function(t){return[s(20+(t-=this.jdEpoch),20),s(t+4,13)]},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return a.day()+20*a.month()+360*a.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)}}),n.calendars.mayan=i},{"../main":571,"object-assign":454}],565:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar;var o=n.instance("gregorian");a(i.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,n.local.invalidYear||n.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,n.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 a=this._validate(t,e,r,n.local.invalidMonth);(t=a.year())<0&&t++;for(var i=a.day(),s=1;s<a.month();s++)i+=this.daysPerMonth[s-1];return i+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)}}),n.calendars.nanakshahi=i},{"../main":571,"object-assign":454}],566:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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,n.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,n.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 a=this._validate(t,e,r,n.local.invalidDate);t=a.year(),e=a.month(),r=a.day();var i=n.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+=i.daysInYear(u)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],i.newDate(u,1,1).add(o,"d").toJD()},fromJD:function(t){var e=n.instance().fromJD(t),r=e.year(),a=e.dayOfYear(),i=r+56;this._createMissingCalendarData(i);for(var o=9,s=this.NEPALI_CALENDAR_DATA[i][0],l=this.NEPALI_CALENDAR_DATA[i][o]-s+1;a>l;)++o>12&&(o=1,i++),l+=this.NEPALI_CALENDAR_DATA[i][o];var u=this.NEPALI_CALENDAR_DATA[i][o]-(l-a);return this.newDate(i,o,u)},_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],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]}}),n.calendars.nepali=i},{"../main":571,"object-assign":454}],567:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}i.prototype=new n.baseCalendar,a(i.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æharshambe","Panjshambe","Jom'e","Shambe"],dayNamesShort:["Yek","Do","Se","Chæ","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,n.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,n.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 a=this._validate(t,e,r,n.local.invalidDate);t=a.year(),e=a.month(),r=a.day();var i=t-(t>=0?474:473),s=474+o(i,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(i/2820)+this.jdEpoch-1},fromJD:function(t){var e=(t=Math.floor(t)+.5)-this.toJD(475,1,1),r=Math.floor(e/1029983),n=o(e,1029983),a=2820;if(1029982!==n){var i=Math.floor(n/366),s=o(n,366);a=Math.floor((2134*i+2816*s+2815)/1028522)+i+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)}}),n.calendars.persian=i,n.calendars.jalali=i},{"../main":571,"object-assign":454}],568:[function(t,e,r){var n=t("../main"),a=t("object-assign"),i=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.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,n.local.invalidYear);return t=this._t2gYear(e.year()),i.leapYear(t)},weekOfYear:function(t,e,r){var a=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return t=this._t2gYear(a.year()),i.weekOfYear(t,a.month(),a.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.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 a=this._validate(t,e,r,n.local.invalidDate);return t=this._t2gYear(a.year()),i.toJD(t,a.month(),a.day())},fromJD:function(t){var e=i.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)}}),n.calendars.taiwan=o},{"../main":571,"object-assign":454}],569:[function(t,e,r){var n=t("../main"),a=t("object-assign"),i=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.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,n.local.invalidYear);return t=this._t2gYear(e.year()),i.leapYear(t)},weekOfYear:function(t,e,r){var a=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return t=this._t2gYear(a.year()),i.weekOfYear(t,a.month(),a.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.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 a=this._validate(t,e,r,n.local.invalidDate);return t=this._t2gYear(a.year()),i.toJD(t,a.month(),a.day())},fromJD:function(t){var e=i.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)}}),n.calendars.thai=o},{"../main":571,"object-assign":454}],570:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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āthā","Yawm al-Arbaā","Yawm al-Khamīs","Yawm al-Juma","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,n.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,n.local.invalidMonth).toJD()-24e5+.5,a=0,i=0;i<o.length;i++){if(o[i]>r)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 a=this._validate(t,e,r,n.local.invalidDate),i=12*(a.year()-1)+a.month()-15292;return a.day()+o[i-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 a=r+15292,i=Math.floor((a-1)/12),s=i+1,l=a-12*i,u=e-o[r-1]+1;return this.newDate(s,l,u)},isValid:function(t,e,r){var a=n.baseCalendar.prototype.isValid.apply(this,arguments);return a&&(a=(t=null!=t.year?t.year:t)>=1276&&t<=1500),a},_validate:function(t,e,r,a){var i=n.baseCalendar.prototype._validate.apply(this,arguments);if(i.year<1276||i.year>1500)throw a.replace(/\{0\}/,this.local.name);return i}}),n.calendars.ummalqura=i;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":571,"object-assign":454}],571:[function(t,e,r){var n=t("object-assign");function a(){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 o(t,e){return"000000".substring(0,e-(t=""+t).length)+t}function s(){this.shortYearCutoff="+10"}function l(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}n(a.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,a){return(n=(null!=t&&t.year?t.calendar():"string"==typeof n?this.instance(n,a):n)||this.instance()).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="",a=0;r>0;){var i=r%10;n=(0===i?"":t[i]+e[a])+n,a++,r=Math.floor(r/10)}return 0===n.indexOf(t[1]+e[1])&&(n=n.substr(1)),n||t[0]}}}),n(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?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(s.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?"-":"")+o(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),a=t.calendar().fromJD(n);return this._validateLevel--,[a.year(),a.month(),a.day()]}try{var i=t.year()+("y"===r?e:0),o=t.monthOfYear()+("m"===r?e:0);a=t.day(),"y"===r?(t.month()!==this.fromMonthOfYear(i,o)&&(o=this.newDate(i,t.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(i)),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o)))):"m"===r&&(function(t){for(;o<t.minMonth;)i--,o+=t.monthsInYear(i);for(var e=t.monthsInYear(i);o>e-1+t.minMonth;)i++,o-=e,e=t.monthsInYear(i)}(this),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o))));var s=[i,this.fromMonthOfYear(i,o),a];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 a={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],i=r<0?-1:1;e=this._add(t,r*a[0]+i*a[1],a[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(),a="m"===r?e:t.month(),i="d"===r?e:t.day();return"y"!==r&&"m"!==r||(i=Math.min(i,this.daysInMonth(n,a))),t.date(n,a,i)},isValid:function(t,e,r){this._validateLevel++;var n=this.hasYearZero||0!==t;if(n){var a=this.newDate(t,e,this.minDay);n=e>=this.minMonth&&e-this.minMonth<this.monthsInYear(a)&&r>=this.minDay&&r-this.minDay<this.daysInMonth(a)}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(this._validateLevel++,1===this._validateLevel&&!this.isValid(t,e,r))throw n.replace(/\{0\}/,this.local.name);var a=this.newDate(t,e,r);return this._validateLevel--,a}catch(t){throw this._validateLevel--,t}}}),l.prototype=new s,n(l.prototype,{name:"Gregorian",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);return(t=e.year()+(e.year()<0?1:0))%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 a=Math.floor(t/100),i=2-a+Math.floor(a/4);return Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r+i-1524.5},fromJD:function(t){var e=Math.floor(t+.5),r=Math.floor((e-1867216.25)/36524.25),n=1524+(r=e+1+r-Math.floor(r/4)),a=Math.floor((n-122.1)/365.25),i=Math.floor(365.25*a),o=Math.floor((n-i)/30.6001),s=n-i-Math.floor(30.6001*o),l=o-(o>13.5?13:1),u=a-(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),a=new Date(n.year(),n.month()-1,n.day());return a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.setHours(a.getHours()>12?a.getHours()+2:0),a},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var u=e.exports=new a;u.cdate=i,u.baseCalendar=s,u.calendars.gregorian=l},{"object-assign":454}],572:[function(t,e,r){var n=t("object-assign"),a=t("./main");n(a.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"}),a.local=a.regionalOptions[""],n(a.cdate.prototype,{formatDate:function(t,e){return"string"!=typeof t&&(e=t,t=""),this._calendar.formatDate(t||"",this,e)}}),n(a.baseCalendar.prototype,{UNIX_EPOCH:a.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:a.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 a.local.invalidFormat||a.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat;for(var n,i,o,s=(r=r||{}).dayNamesShort||this.local.dayNamesShort,l=r.dayNames||this.local.dayNames,u=r.monthNumbers||this.local.monthNumbers,c=r.monthNamesShort||this.local.monthNamesShort,h=r.monthNames||this.local.monthNames,d=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;b+n<t.length&&t.charAt(b+n)===e;)n++;return b+=n-1,Math.floor(n/(r||1))>1}),f=function(t,e,r,n){var a=""+e;if(d(t,n))for(;a.length<r;)a="0"+a;return a},p=this,m=function(t){return"function"==typeof u?u.call(p,t,d("m")):v(f("m",t.month(),2))},g=function(t,e){return e?"function"==typeof h?h.call(p,t):h[t.month()-p.minMonth]:"function"==typeof c?c.call(p,t):c[t.month()-p.minMonth]},y=this.local.digits,v=function(t){return r.localNumbers&&y?y(t):t},_="",x=!1,b=0;b<t.length;b++)if(x)"'"!==t.charAt(b)||d("'")?_+=t.charAt(b):x=!1;else switch(t.charAt(b)){case"d":_+=v(f("d",e.day(),2));break;case"D":_+=("D",n=e.dayOfWeek(),i=s,o=l,d("D")?o[n]:i[n]);break;case"o":_+=f("o",e.dayOfYear(),3);break;case"w":_+=f("w",e.weekOfYear(),2);break;case"m":_+=m(e);break;case"M":_+=g(e,d("M"));break;case"y":_+=d("y",2)?e.year():(e.year()%100<10?"0":"")+e.year()%100;break;case"Y":d("Y",2),_+=e.formatYear();break;case"J":_+=e.toJD();break;case"@":_+=(e.toJD()-this.UNIX_EPOCH)*this.SECS_PER_DAY;break;case"!":_+=(e.toJD()-this.TICKS_EPOCH)*this.TICKS_PER_DAY;break;case"'":d("'")?_+="'":x=!0;break;default:_+=t.charAt(b)}return _},parseDate:function(t,e,r){if(null==e)throw a.local.invalidArguments||a.regionalOptions[""].invalidArguments;if(""===(e="object"==typeof e?e.toString():e+""))return null;t=t||this.local.dateFormat;var n=(r=r||{}).shortYearCutoff||this.shortYearCutoff;n="string"!=typeof n?n:this.today().year()%100+parseInt(n,10);for(var i=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,d=-1,f=-1,p=-1,m=-1,g=!1,y=!1,v=function(e,r){for(var n=1;L+n<t.length&&t.charAt(L+n)===e;)n++;return L+=n-1,Math.floor(n/(r||1))>1},_=function(t,r){var n=v(t,r),i=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(t)+1],o=new RegExp("^-?\\d{1,"+i+"}"),s=e.substring(T).match(o);if(!s)throw(a.local.missingNumberAt||a.regionalOptions[""].missingNumberAt).replace(/\{0\}/,T);return T+=s[0].length,parseInt(s[0],10)},x=this,b=function(){if("function"==typeof l){v("m");var t=l.call(x,e.substring(T));return T+=t.length,t}return _("m")},w=function(t,r,n,i){for(var o=v(t,i)?n:r,s=0;s<o.length;s++)if(e.substr(T,o[s].length).toLowerCase()===o[s].toLowerCase())return T+=o[s].length,s+x.minMonth;throw(a.local.unknownNameAt||a.regionalOptions[""].unknownNameAt).replace(/\{0\}/,T)},M=function(){if("function"==typeof c){var t=v("M")?c.call(x,e.substring(T)):u.call(x,e.substring(T));return T+=t.length,t}return w("M",u,c)},k=function(){if(e.charAt(T)!==t.charAt(L))throw(a.local.unexpectedLiteralAt||a.regionalOptions[""].unexpectedLiteralAt).replace(/\{0\}/,T);T++},T=0,L=0;L<t.length;L++)if(y)"'"!==t.charAt(L)||v("'")?k():y=!1;else switch(t.charAt(L)){case"d":p=_("d");break;case"D":w("D",i,o);break;case"o":m=_("o");break;case"w":_("w");break;case"m":f=b();break;case"M":f=M();break;case"y":var A=L;g=!v("y",2),L=A,d=_("y",2);break;case"Y":d=_("Y",2);break;case"J":h=_("J")+.5,"."===e.charAt(T)&&(T++,_("J"));break;case"@":h=_("@")/this.SECS_PER_DAY+this.UNIX_EPOCH;break;case"!":h=_("!")/this.TICKS_PER_DAY+this.TICKS_EPOCH;break;case"*":T=e.length;break;case"'":v("'")?k():y=!0;break;default:k()}if(T<e.length)throw a.local.unexpectedText||a.regionalOptions[""].unexpectedText;if(-1===d?d=this.today().year():d<100&&g&&(d+=-1===n?1900:this.today().year()-this.today().year()%100-(d<=n?0:100)),"string"==typeof f&&(f=s.call(this,d,f)),m>-1){f=1,p=m;for(var S=this.daysInMonth(d,f);p>S;S=this.daysInMonth(d,f))f++,p-=S}return h>-1?this.fromJD(h):this.newDate(d,f,p)},determineDate:function(t,e,r,n,a){r&&"object"!=typeof r&&(a=n,n=r,r=null),"string"!=typeof n&&(a=n,n="");var i=this;return e=e?e.newDate():null,null==t?e:"string"==typeof t?function(t){try{return i.parseDate(n,t,a)}catch(t){}for(var e=((t=t.toLowerCase()).match(/^c/)&&r?r.newDate():null)||i.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)||t===1/0||t===-1/0?e:i.today().add(t,"d"):i.newDate(t)}})},{"./main":571,"object-assign":454}],573:[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":146}],574:[function(t,e,r){e.exports=function(t,e){var r=[];return e=+e||0,n(t.hi(t.shape[0]-1),r,e),r};var n=t("./lib/zc-core")},{"./lib/zc-core":573}],575:[function(t,e,r){e.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],576:[function(t,e,r){var n=t("./arrow_paths"),a=t("../../plots/font_attributes"),i=t("../../plots/cartesian/constants"),o=t("../../plot_api/plot_template").templatedArray;e.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../plot_api/plot_template":757,"../../plots/cartesian/constants":773,"../../plots/font_attributes":793,"./arrow_paths":575}],577:[function(t,e,r){var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach((function(e){var r=a.getFromId(t,e.xref),n=a.getFromId(t,e.yref);e._extremes={},r&&s(e,r),n&&s(e,n)}))}function s(t,e){var r,n=e._id,i=n.charAt(0),o=t[i],s=t["a"+i],l=t[i+"ref"],u=t["a"+i+"ref"],c=t["_"+i+"padplus"],h=t["_"+i+"padminus"],d={x:1,y:-1}[i]*t[i+"shift"],f=3*t.arrowsize*t.arrowwidth||0,p=f+d,m=f-d,g=3*t.startarrowsize*t.arrowwidth||0,y=g+d,v=g-d;if(u===l){var _=a.findExtremes(e,[e.r2c(o)],{ppadplus:p,ppadminus:m}),x=a.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(c,y),ppadminus:Math.max(h,v)});r={min:[_.min[0],x.min[0]],max:[_.max[0],x.max[0]]}}else y=s?y+s:y,v=s?v-s:v,r=a.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(c,p,y),ppadminus:Math.max(h,m,v)});t._extremes[n]=r}e.exports=function(t){var e=t._fullLayout;if(n.filterVisible(e.annotations).length&&t._fullData.length)return n.syncOrAsync([i,o],t)}},{"../../lib":719,"../../plots/cartesian/axes":767,"./draw":582}],578:[function(t,e,r){var n=t("../../lib"),a=t("../../registry"),i=t("../../plot_api/plot_template").arrayEditor;function o(t,e){var r,n,a,i,o,l,u,c=t._fullLayout.annotations,h=[],d=[],f=[],p=(e||[]).length;for(r=0;r<c.length;r++)if(i=(a=c[r]).clicktoshow){for(n=0;n<p;n++)if(l=(o=e[n]).xaxis,u=o.yaxis,l._id===a.xref&&u._id===a.yref&&l.d2r(o.x)===s(a._xclick,l)&&u.d2r(o.y)===s(a._yclick,u)){(a.visible?"onout"===i?d:f:h).push(r);break}n===p&&a.visible&&"onout"===i&&d.push(r)}return{on:h,off:d,explicitOff:f}}function s(t,e){return"log"===e.type?e.l2r(t):e.d2r(t)}e.exports={hasClickToShow:function(t,e){var r=o(t,e);return r.on.length>0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),u=l.on,c=l.off.concat(l.explicitOff),h={},d=t._fullLayout.annotations;if(u.length||c.length){for(r=0;r<u.length;r++)(s=i(t.layout,"annotations",d[u[r]])).modifyItem("visible",!0),n.extendFlat(h,s.getUpdateObj());for(r=0;r<c.length;r++)(s=i(t.layout,"annotations",d[c[r]])).modifyItem("visible",!1),n.extendFlat(h,s.getUpdateObj());return a.call("update",t,{},h)}}}},{"../../lib":719,"../../plot_api/plot_template":757,"../../registry":847}],579:[function(t,e,r){var n=t("../../lib"),a=t("../color");e.exports=function(t,e,r,i){i("opacity");var o=i("bgcolor"),s=i("bordercolor"),l=a.opacity(s);i("borderpad");var u=i("borderwidth"),c=i("showarrow");if(i("text",c?" ":r._dfltTitle.annotation),i("textangle"),n.coerceFont(i,"font",r.font),i("width"),i("align"),i("height")&&i("valign"),c){var h,d,f=i("arrowside");-1!==f.indexOf("end")&&(h=i("arrowhead"),d=i("arrowsize")),-1!==f.indexOf("start")&&(i("startarrowhead",h),i("startarrowsize",d)),i("arrowcolor",l?e.bordercolor:a.defaultLine),i("arrowwidth",2*(l&&u||1)),i("standoff"),i("startstandoff")}var p=i("hovertext"),m=r.hoverlabel||{};if(p){var g=i("hoverlabel.bgcolor",m.bgcolor||(a.opacity(o)?a.rgb(o):a.defaultLine)),y=i("hoverlabel.bordercolor",m.bordercolor||a.contrast(g));n.coerceFont(i,"hoverlabel.font",{family:m.font.family,size:m.font.size,color:m.font.color||y})}i("captureevents",!!p)}},{"../../lib":719,"../color":593}],580:[function(t,e,r){var n=t("fast-isnumeric"),a=t("../../lib/to_log_range");e.exports=function(t,e,r,i){e=e||{};var o="log"===r&&"linear"===e.type,s="linear"===r&&"log"===e.type;if(o||s)for(var l,u,c=t._fullLayout.annotations,h=e._id.charAt(0),d=0;d<c.length;d++)l=c[d],u="annotations["+d+"].",l[h+"ref"]===e._id&&f(h),l["a"+h+"ref"]===e._id&&f("a"+h);function f(t){var r=l[t],s=null;s=o?a(r,e.range):Math.pow(10,r),n(s)||(s=null),i(u+t,s)}}},{"../../lib/to_log_range":745,"fast-isnumeric":225}],581:[function(t,e,r){var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../../plots/array_container_defaults"),o=t("./common_defaults"),s=t("./attributes");function l(t,e,r){function i(r,a){return n.coerce(t,e,s,r,a)}var l=i("visible"),u=i("clicktoshow");if(l||u){o(t,e,r,i);for(var c=e.showarrow,h=["x","y"],d=[-10,-30],f={_fullLayout:r},p=0;p<2;p++){var m=h[p],g=a.coerceRef(t,e,f,m,"","paper");if("paper"!==g&&a.getFromId(f,g)._annIndices.push(e._index),a.coercePosition(e,f,i,g,m,.5),c){var y="a"+m,v=a.coerceRef(t,e,f,y,"pixel");"pixel"!==v&&v!==g&&(v=e[y]="pixel");var _="pixel"===v?d[p]:.4;a.coercePosition(e,f,i,v,y,_)}i(m+"anchor"),i(m+"shift")}if(n.noneOrAll(t,e,["x","y"]),c&&n.noneOrAll(t,e,["ax","ay"]),u){var x=i("xclick"),b=i("yclick");e._xclick=void 0===x?e.x:a.cleanPosition(x,f,e.xref),e._yclick=void 0===b?e.y:a.cleanPosition(b,f,e.yref)}}}e.exports=function(t,e){i(t,e,{name:"annotations",handleItemDefaults:l})}},{"../../lib":719,"../../plots/array_container_defaults":763,"../../plots/cartesian/axes":767,"./attributes":576,"./common_defaults":579}],582:[function(t,e,r){var n=t("d3"),a=t("../../registry"),i=t("../../plots/plots"),o=t("../../lib"),s=t("../../plots/cartesian/axes"),l=t("../color"),u=t("../drawing"),c=t("../fx"),h=t("../../lib/svg_text_utils"),d=t("../../lib/setcursor"),f=t("../dragelement"),p=t("../../plot_api/plot_template").arrayEditor,m=t("./draw_arrow_head");function g(t,e){var r=t._fullLayout.annotations[e]||{},n=s.getFromId(t,r.xref),a=s.getFromId(t,r.yref);n&&n.setScale(),a&&a.setScale(),y(t,r,e,!1,n,a)}function y(t,e,r,i,s,g){var y,v,_=t._fullLayout,x=t._fullLayout._size,b=t._context.edits;i?(y="annotation-"+i,v=i+".annotations"):(y="annotation",v="annotations");var w=p(t.layout,v,e),M=w.modifyBase,k=w.modifyItem,T=w.getUpdateObj;_._infolayer.selectAll("."+y+'[data-index="'+r+'"]').remove();var L="clip"+_._uid+"_ann"+r;if(e._input&&!1!==e.visible){var A={x:{},y:{}},S=+e.textangle||0,E=_._infolayer.append("g").classed(y,!0).attr("data-index",String(r)).style("opacity",e.opacity),C=E.append("g").classed("annotation-text-g",!0),D=b[e.showarrow?"annotationTail":"annotationPosition"],P=e.captureevents||b.annotationText||D,O=C.append("g").style("pointer-events",P?"all":null).call(d,"pointer").on("click",(function(){t._dragging=!1,t.emit("plotly_clickannotation",U(n.event))}));e.hovertext&&O.on("mouseover",(function(){var r=e.hoverlabel,n=r.font,a=this.getBoundingClientRect(),i=t.getBoundingClientRect();c.loneHover({x0:a.left-i.left,x1:a.right-i.left,y:(a.top+a.bottom)/2-i.top,text:e.hovertext,color:r.bgcolor,borderColor:r.bordercolor,fontFamily:n.family,fontSize:n.size,fontColor:n.color},{container:_._hoverlayer.node(),outerContainer:_._paper.node(),gd:t})})).on("mouseout",(function(){c.loneUnhover(_._hoverlayer.node())}));var z=e.borderwidth,I=e.borderpad,R=z+I,F=O.append("rect").attr("class","bg").style("stroke-width",z+"px").call(l.stroke,e.bordercolor).call(l.fill,e.bgcolor),N=e.width||e.height,Y=_._topclips.selectAll("#"+L).data(N?[0]:[]);Y.enter().append("clipPath").classed("annclip",!0).attr("id",L).append("rect"),Y.exit().remove();var j=e.font,B=_._meta?o.templateString(e.text,_._meta):e.text,H=O.append("text").classed("annotation-text",!0).text(B);b.annotationText?H.call(h.makeEditable,{delegate:O,gd:t}).call(V).on("edit",(function(r){e.text=r,this.call(V),k("text",r),s&&s.autorange&&M(s._name+".autorange",!0),g&&g.autorange&&M(g._name+".autorange",!0),a.call("_guiRelayout",t,T())})):H.call(V)}else n.selectAll("#"+L).remove();function U(t){var n={index:r,annotation:e._input,fullAnnotation:e,event:t};return i&&(n.subplotId=i),n}function V(r){return r.call(u.font,j).attr({"text-anchor":{left:"start",right:"end"}[e.align]||"middle"}),h.convertToTspans(r,t,W),r}function W(){var r=H.selectAll("a");1===r.size()&&r.text()===H.text()&&O.insert("a",":first-child").attr({"xlink:xlink:href":r.attr("xlink:href"),"xlink:xlink:show":r.attr("xlink:show")}).style({cursor:"pointer"}).node().appendChild(F.node());var n=O.select(".annotation-text-math-group"),c=!n.empty(),p=u.bBox((c?n:H).node()),y=p.width,v=p.height,w=e.width||y,P=e.height||v,I=Math.round(w+2*R),j=Math.round(P+2*R);function B(t,e){return"auto"===e&&(e=t<1/3?"left":t>2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var V=!1,W=["x","y"],G=0;G<W.length;G++){var q,Z,X,J,K,$=W[G],Q=e[$+"ref"]||$,tt=e["a"+$+"ref"],et={x:s,y:g}[$],rt=(S+("x"===$?0:-90))*Math.PI/180,nt=I*Math.cos(rt),at=j*Math.sin(rt),it=Math.abs(nt)+Math.abs(at),ot=e[$+"anchor"],st=e[$+"shift"]*("x"===$?1:-1),lt=A[$];if(et){var ut=et.r2fraction(e[$]);(ut<0||ut>1)&&(tt===Q?((ut=et.r2fraction(e["a"+$]))<0||ut>1)&&(V=!0):V=!0),q=et._offset+et.r2p(e[$]),J=.5}else"x"===$?(X=e[$],q=x.l+x.w*X):(X=1-e[$],q=x.t+x.h*X),J=e.showarrow?.5:X;if(e.showarrow){lt.head=q;var ct=e["a"+$];K=nt*B(.5,e.xanchor)-at*B(.5,e.yanchor),tt===Q?(lt.tail=et._offset+et.r2p(ct),Z=K):(lt.tail=q+ct,Z=K+ct),lt.text=lt.tail+K;var ht=_["x"===$?"width":"height"];if("paper"===Q&&(lt.head=o.constrain(lt.head,1,ht-1)),"pixel"===tt){var dt=-Math.max(lt.tail-3,lt.text),ft=Math.min(lt.tail+3,lt.text)-ht;dt>0?(lt.tail+=dt,lt.text+=dt):ft>0&&(lt.tail-=ft,lt.text-=ft)}lt.tail+=st,lt.head+=st}else Z=K=it*B(J,ot),lt.text=q+K;lt.text+=st,K+=st,Z+=st,e["_"+$+"padplus"]=it/2+Z,e["_"+$+"padminus"]=it/2-Z,e["_"+$+"size"]=it,e["_"+$+"shift"]=K}if(t._dragging||!V){var pt=0,mt=0;if("left"!==e.align&&(pt=(w-y)*("center"===e.align?.5:1)),"top"!==e.valign&&(mt=(P-v)*("middle"===e.valign?.5:1)),c)n.select("svg").attr({x:R+pt-1,y:R+mt}).call(u.setClipUrl,N?L:null,t);else{var gt=R+mt-p.top,yt=R+pt-p.left;H.call(h.positionText,yt,gt).call(u.setClipUrl,N?L:null,t)}Y.select("rect").call(u.setRect,R,R,w,P),F.call(u.setRect,z/2,z/2,I-z,j-z),O.call(u.setTranslate,Math.round(A.x.text-I/2),Math.round(A.y.text-j/2)),C.attr({transform:"rotate("+S+","+A.x.text+","+A.y.text+")"});var vt,_t=function(r,n){E.selectAll(".annotation-arrow-g").remove();var c=A.x.head,h=A.y.head,d=A.x.tail+r,p=A.y.tail+n,y=A.x.text+r,v=A.y.text+n,_=o.rotationXYMatrix(S,y,v),w=o.apply2DTransform(_),L=o.apply2DTransform2(_),D=+F.attr("width"),P=+F.attr("height"),z=y-.5*D,I=z+D,R=v-.5*P,N=R+P,Y=[[z,R,z,N],[z,N,I,N],[I,N,I,R],[I,R,z,R]].map(L);if(!Y.reduce((function(t,e){return t^!!o.segmentsIntersect(c,h,c+1e6,h+1e6,e[0],e[1],e[2],e[3])}),!1)){Y.forEach((function(t){var e=o.segmentsIntersect(d,p,c,h,t[0],t[1],t[2],t[3]);e&&(d=e.x,p=e.y)}));var j=e.arrowwidth,B=e.arrowcolor,H=e.arrowside,U=E.append("g").style({opacity:l.opacity(B)}).classed("annotation-arrow-g",!0),V=U.append("path").attr("d","M"+d+","+p+"L"+c+","+h).style("stroke-width",j+"px").call(l.stroke,l.rgb(B));if(m(V,H,e),b.annotationPosition&&V.node().parentNode&&!i){var W=c,G=h;if(e.standoff){var q=Math.sqrt(Math.pow(c-d,2)+Math.pow(h-p,2));W+=e.standoff*(d-c)/q,G+=e.standoff*(p-h)/q}var Z,X,J=U.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-W)+","+(p-G),transform:"translate("+W+","+G+")"}).style("stroke-width",j+6+"px").call(l.stroke,"rgba(0,0,0,0)").call(l.fill,"rgba(0,0,0,0)");f.init({element:J.node(),gd:t,prepFn:function(){var t=u.getTranslate(O);Z=t.x,X=t.y,s&&s.autorange&&M(s._name+".autorange",!0),g&&g.autorange&&M(g._name+".autorange",!0)},moveFn:function(t,r){var n=w(Z,X),a=n[0]+t,i=n[1]+r;O.call(u.setTranslate,a,i),k("x",s?s.p2r(s.r2p(e.x)+t):e.x+t/x.w),k("y",g?g.p2r(g.r2p(e.y)+r):e.y-r/x.h),e.axref===e.xref&&k("ax",s.p2r(s.r2p(e.ax)+t)),e.ayref===e.yref&&k("ay",g.p2r(g.r2p(e.ay)+r)),U.attr("transform","translate("+t+","+r+")"),C.attr({transform:"rotate("+S+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",t,T());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};e.showarrow&&_t(0,0),D&&f.init({element:O.node(),gd:t,prepFn:function(){vt=C.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?k("ax",s.p2r(s.r2p(e.ax)+t)):k("ax",e.ax+t),e.ayref===e.yref?k("ay",g.p2r(g.r2p(e.ay)+r)):k("ay",e.ay+r),_t(t,r);else{if(i)return;var a,o;if(s)a=s.p2r(s.r2p(e.x)+t);else{var l=e._xsize/x.w,u=e.x+(e._xshift-e.xshift)/x.w-l/2;a=f.align(u+t/x.w,l,0,1,e.xanchor)}if(g)o=g.p2r(g.r2p(e.y)+r);else{var c=e._ysize/x.h,h=e.y-(e._yshift+e.yshift)/x.h-c/2;o=f.align(h-r/x.h,c,0,1,e.yanchor)}k("x",a),k("y",o),s&&g||(n=f.getCursor(s?.5:a,g?.5:o,e.xanchor,e.yanchor))}C.attr({transform:"translate("+t+","+r+")"+vt}),d(O,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",U(n))},doneFn:function(){d(O),a.call("_guiRelayout",t,T());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}else O.remove()}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r<e.annotations.length;r++)e.annotations[r].visible&&g(t,r);return i.previousPromises(t)},drawOne:g,drawRaw:y}},{"../../lib":719,"../../lib/setcursor":739,"../../lib/svg_text_utils":743,"../../plot_api/plot_template":757,"../../plots/cartesian/axes":767,"../../plots/plots":828,"../../registry":847,"../color":593,"../dragelement":611,"../drawing":614,"../fx":632,"./draw_arrow_head":583,d3:163}],583:[function(t,e,r){var n=t("d3"),a=t("../color"),i=t("./arrow_paths");e.exports=function(t,e,r){var o,s,l,u,c=t.node(),h=i[r.arrowhead||0],d=i[r.startarrowhead||0],f=(r.arrowwidth||1)*(r.arrowsize||1),p=(r.arrowwidth||1)*(r.startarrowsize||1),m=e.indexOf("start")>=0,g=e.indexOf("end")>=0,y=h.backoff*f+r.standoff,v=d.backoff*p+r.startstandoff;if("line"===c.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},s={x:+t.attr("x2"),y:+t.attr("y2")};var _=o.x-s.x,x=o.y-s.y;if(u=(l=Math.atan2(x,_))+Math.PI,y&&v&&y+v>Math.sqrt(_*_+x*x))return void D();if(y){if(y*y>_*_+x*x)return void D();var b=y*Math.cos(l),w=y*Math.sin(l);s.x+=b,s.y+=w,t.attr({x2:s.x,y2:s.y})}if(v){if(v*v>_*_+x*x)return void D();var M=v*Math.cos(l),k=v*Math.sin(l);o.x-=M,o.y-=k,t.attr({x1:o.x,y1:o.y})}}else if("path"===c.nodeName){var T=c.getTotalLength(),L="";if(T<y+v)return void D();var A=c.getPointAtLength(0),S=c.getPointAtLength(.1);l=Math.atan2(A.y-S.y,A.x-S.x),o=c.getPointAtLength(Math.min(v,T)),L="0px,"+v+"px,";var E=c.getPointAtLength(T),C=c.getPointAtLength(T-.1);u=Math.atan2(E.y-C.y,E.x-C.x),s=c.getPointAtLength(Math.max(0,T-y)),L+=T-(L?v+y:y)+"px,"+T+"px",t.style("stroke-dasharray",L)}function D(){t.style("stroke-dasharray","0px,100px")}function P(e,i,o,s){e.path&&(e.noRotate&&(o=0),n.select(c.parentNode).append("path").attr({class:t.attr("class"),d:e.path,transform:"translate("+i.x+","+i.y+")"+(o?"rotate("+180*o/Math.PI+")":"")+"scale("+s+")"}).style({fill:a.rgb(r.arrowcolor),"stroke-width":0}))}m&&P(d,o,l,p),g&&P(h,s,u,f)}},{"../color":593,"./arrow_paths":575,d3:163}],584:[function(t,e,r){var n=t("./draw"),a=t("./click");e.exports={moduleType:"component",name:"annotations",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),includeBasePlot:t("../../plots/cartesian/include_components")("annotations"),calcAutorange:t("./calc_autorange"),draw:n.draw,drawOne:n.drawOne,drawRaw:n.drawRaw,hasClickToShow:a.hasClickToShow,onClick:a.onClick,convertCoords:t("./convert_coords")}},{"../../plots/cartesian/include_components":777,"./attributes":576,"./calc_autorange":577,"./click":578,"./convert_coords":580,"./defaults":581,"./draw":582}],585:[function(t,e,r){var n=t("../annotations/attributes"),a=t("../../plot_api/edit_types").overrideAll,i=t("../../plot_api/plot_template").templatedArray;e.exports=a(i("annotation",{visible:n.visible,x:{valType:"any"},y:{valType:"any"},z:{valType:"any"},ax:{valType:"number"},ay:{valType:"number"},xanchor:n.xanchor,xshift:n.xshift,yanchor:n.yanchor,yshift:n.yshift,text:n.text,textangle:n.textangle,font:n.font,width:n.width,height:n.height,opacity:n.opacity,align:n.align,valign:n.valign,bgcolor:n.bgcolor,bordercolor:n.bordercolor,borderpad:n.borderpad,borderwidth:n.borderwidth,showarrow:n.showarrow,arrowcolor:n.arrowcolor,arrowhead:n.arrowhead,startarrowhead:n.startarrowhead,arrowside:n.arrowside,arrowsize:n.arrowsize,startarrowsize:n.startarrowsize,arrowwidth:n.arrowwidth,standoff:n.standoff,startstandoff:n.startstandoff,hovertext:n.hovertext,hoverlabel:n.hoverlabel,captureevents:n.captureevents}),"calc","from-root")},{"../../plot_api/edit_types":750,"../../plot_api/plot_template":757,"../annotations/attributes":576}],586:[function(t,e,r){var n=t("../../lib"),a=t("../../plots/cartesian/axes");function i(t,e){var r=e.fullSceneLayout.domain,i=e.fullLayout._size,o={pdata:null,type:"linear",autorange:!1,range:[-1/0,1/0]};t._xa={},n.extendFlat(t._xa,o),a.setConvert(t._xa),t._xa._offset=i.l+r.x[0]*i.w,t._xa.l2p=function(){return.5*(1+t._pdata[0]/t._pdata[3])*i.w*(r.x[1]-r.x[0])},t._ya={},n.extendFlat(t._ya,o),a.setConvert(t._ya),t._ya._offset=i.t+(1-r.y[1])*i.h,t._ya.l2p=function(){return.5*(1-t._pdata[1]/t._pdata[3])*i.h*(r.y[1]-r.y[0])}}e.exports=function(t){for(var e=t.fullSceneLayout.annotations,r=0;r<e.length;r++)i(e[r],t);t.fullLayout._infolayer.selectAll(".annotation-"+t.id).remove()}},{"../../lib":719,"../../plots/cartesian/axes":767}],587:[function(t,e,r){var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../../plots/array_container_defaults"),o=t("../annotations/common_defaults"),s=t("./attributes");function l(t,e,r,i){function l(r,a){return n.coerce(t,e,s,r,a)}function u(t){var n=t+"axis",i={_fullLayout:{}};return i._fullLayout[n]=r[n],a.coercePosition(e,i,l,t,t,.5)}l("visible")&&(o(t,e,i.fullLayout,l),u("x"),u("y"),u("z"),n.noneOrAll(t,e,["x","y","z"]),e.xref="x",e.yref="y",e.zref="z",l("xanchor"),l("yanchor"),l("xshift"),l("yshift"),e.showarrow&&(e.axref="pixel",e.ayref="pixel",l("ax",-10),l("ay",-30),n.noneOrAll(t,e,["ax","ay"])))}e.exports=function(t,e,r){i(t,e,{name:"annotations",handleItemDefaults:l,fullLayout:r.fullLayout})}},{"../../lib":719,"../../plots/array_container_defaults":763,"../../plots/cartesian/axes":767,"../annotations/common_defaults":579,"./attributes":585}],588:[function(t,e,r){var n=t("../annotations/draw").drawRaw,a=t("../../plots/gl3d/project"),i=["x","y","z"];e.exports=function(t){for(var e=t.fullSceneLayout,r=t.dataScale,o=e.annotations,s=0;s<o.length;s++){for(var l=o[s],u=!1,c=0;c<3;c++){var h=i[c],d=l[h],f=e[h+"axis"].r2fraction(d);if(f<0||f>1){u=!0;break}}u?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=a(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":816,"../annotations/draw":582}],589:[function(t,e,r){var n=t("../../registry"),a=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),includeBasePlot:function(t,e){var r=n.subplotsRegistry.gl3d;if(r)for(var i=r.attrRegex,o=Object.keys(t),s=0;s<o.length;s++){var l=o[s];i.test(l)&&(t[l].annotations||[]).length&&(a.pushUnique(e._basePlotModules,r),a.pushUnique(e._subplots.gl3d,l))}},convert:t("./convert"),draw:t("./draw")}},{"../../lib":719,"../../registry":847,"./attributes":585,"./convert":586,"./defaults":587,"./draw":588}],590:[function(t,e,r){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":557,"world-calendars/dist/calendars/coptic":558,"world-calendars/dist/calendars/discworld":559,"world-calendars/dist/calendars/ethiopian":560,"world-calendars/dist/calendars/hebrew":561,"world-calendars/dist/calendars/islamic":562,"world-calendars/dist/calendars/julian":563,"world-calendars/dist/calendars/mayan":564,"world-calendars/dist/calendars/nanakshahi":565,"world-calendars/dist/calendars/nepali":566,"world-calendars/dist/calendars/persian":567,"world-calendars/dist/calendars/taiwan":568,"world-calendars/dist/calendars/thai":569,"world-calendars/dist/calendars/ummalqura":570,"world-calendars/dist/main":571,"world-calendars/dist/plus":572}],591:[function(t,e,r){var n=t("./calendars"),a=t("../../lib"),i=t("../../constants/numerical"),o=i.EPOCHJD,s=i.ONEDAY,l={valType:"enumerated",values:Object.keys(n.calendars),editType:"calc",dflt:"gregorian"},u=function(t,e,r,n){var i={};return i[r]=l,a.coerce(t,e,i,r,n)},c="##",h={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:c,w:c,c:{0:"D M d %X yyyy","-":"D M d %X yyyy"},x:{0:"mm/dd/yyyy","-":"mm/dd/yyyy"}},d={};function f(t){return d[t]||(d[t]=n.instance(t))}function p(t){return a.extendFlat({},l,{description:t})}function m(t){return"Sets the calendar system to use with `"+t+"` date data."}var g={xcalendar:p(m("x"))},y=a.extendFlat({},g,{ycalendar:p(m("y"))}),v=a.extendFlat({},y,{zcalendar:p(m("z"))}),_=p(["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:y,bar:y,box:y,heatmap:y,contour:y,histogram:y,histogram2d:y,histogram2dcontour:y,scatter3d:v,surface:v,mesh3d:v,scattergl:y,ohlc:g,candlestick:g},layout:{calendar:p(["Sets the default calendar system to use for interpreting and","displaying dates throughout the plot."].join(" "))},subplots:{xaxis:{calendar:_},yaxis:{calendar:_},scene:{xaxis:{calendar:_},yaxis:{calendar:_},zaxis:{calendar:_}},polar:{radialaxis:{calendar:_}}},transforms:{filter:{valuecalendar:p(["Sets the calendar system to use for `value`, if it is a date."].join(" ")),targetcalendar:p(["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:l,handleDefaults:u,handleTraceDefaults:function(t,e,r,n){for(var a=0;a<r.length;a++)u(t,e,r[a]+"calendar",n.calendar)},CANONICAL_SUNDAY:{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"},CANONICAL_TICK:{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"},DFLTRANGE:{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"]},getCal:f,worldCalFmt:function(t,e,r){for(var n,a,i,l,u,d=Math.floor((e+.05)/s)+o,p=f(r).fromJD(d),m=0;-1!==(m=t.indexOf("%",m));)"0"===(n=t.charAt(m+1))||"-"===n||"_"===n?(i=3,a=t.charAt(m+2),"_"===n&&(n="-")):(a=n,n="0",i=2),(l=h[a])?(u=l===c?c:p.formatDate(l[n]),t=t.substr(0,m)+u+t.substr(m+i),m+=u.length):m+=i;return t}}},{"../../constants/numerical":695,"../../lib":719,"./calendars":590}],592:[function(t,e,r){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},{}],593:[function(t,e,r){var n=t("tinycolor2"),a=t("fast-isnumeric"),i=e.exports={},o=t("./attributes");i.defaults=o.defaults;var s=i.defaultLine=o.defaultLine;i.lightLine=o.lightLine;var l=i.background=o.background;function u(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+")"}i.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},i.rgb=function(t){return i.tinyRGB(n(t))},i.opacity=function(t){return t?n(t).getAlpha():0},i.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},i.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var a=n(e||l).toRgb(),i=1===a.a?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},o={r:i.r*(1-r.a)+r.r*r.a,g:i.g*(1-r.a)+r.g*r.a,b:i.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},i.contrast=function(t,e,r){var a=n(t);return 1!==a.getAlpha()&&(a=n(i.combine(t,l))),(a.isDark()?e?a.lighten(e):l:r?a.darken(r):s).toString()},i.stroke=function(t,e){var r=n(e);t.style({stroke:i.tinyRGB(r),"stroke-opacity":r.getAlpha()})},i.fill=function(t,e){var r=n(e);t.style({fill:i.tinyRGB(r),"fill-opacity":r.getAlpha()})},i.clean=function(t){if(t&&"object"==typeof t){var e,r,n,a,o=Object.keys(t);for(e=0;e<o.length;e++)if(a=t[n=o[e]],"color"===n.substr(n.length-5))if(Array.isArray(a))for(r=0;r<a.length;r++)a[r]=u(a[r]);else t[n]=u(a);else if("colorscale"===n.substr(n.length-10)&&Array.isArray(a))for(r=0;r<a.length;r++)Array.isArray(a[r])&&(a[r][1]=u(a[r][1]));else if(Array.isArray(a)){var s=a[0];if(!Array.isArray(s)&&s&&"object"==typeof s)for(r=0;r<a.length;r++)i.clean(a[r])}else a&&"object"==typeof a&&i.clean(a)}}},{"./attributes":592,"fast-isnumeric":225,tinycolor2:537}],594:[function(t,e,r){var n=t("../../plots/cartesian/layout_attributes"),a=t("../../plots/font_attributes"),i=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll;e.exports=o({thicknessmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels"},thickness:{valType:"number",min:0,dflt:30},lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",dflt:1.02,min:-2,max:3},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},xpad:{valType:"number",min:0,dflt:10},y:{valType:"number",dflt:.5,min:-2,max:3},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle"},ypad:{valType:"number",min:0,dflt:10},outlinecolor:n.linecolor,outlinewidth:n.linewidth,bordercolor:n.linecolor,borderwidth:{valType:"number",min:0,dflt:0},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},tickmode:n.tickmode,nticks:n.nticks,tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:i({},n.ticks,{dflt:""}),ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,showticklabels:n.showticklabels,tickfont:a({}),tickangle:n.tickangle,tickformat:n.tickformat,tickformatstops:n.tickformatstops,tickprefix:n.tickprefix,showtickprefix:n.showtickprefix,ticksuffix:n.ticksuffix,showticksuffix:n.showticksuffix,separatethousands:n.separatethousands,exponentformat:n.exponentformat,showexponent:n.showexponent,title:{text:{valType:"string"},font:a({}),side:{valType:"enumerated",values:["right","top","bottom"],dflt:"top"}},_deprecated:{title:{valType:"string"},titlefont:a({}),titleside:{valType:"enumerated",values:["right","top","bottom"],dflt:"top"}}},"colorbars","from-root")},{"../../lib/extend":710,"../../plot_api/edit_types":750,"../../plots/cartesian/layout_attributes":779,"../../plots/font_attributes":793}],595:[function(t,e,r){e.exports={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}}},{}],596:[function(t,e,r){var n=t("../../lib"),a=t("../../plot_api/plot_template"),i=t("../../plots/cartesian/tick_value_defaults"),o=t("../../plots/cartesian/tick_mark_defaults"),s=t("../../plots/cartesian/tick_label_defaults"),l=t("./attributes");e.exports=function(t,e,r){var u=a.newContainer(e,"colorbar"),c=t.colorbar||{};function h(t,e){return n.coerce(c,u,l,t,e)}var d=h("thicknessmode");h("thickness","fraction"===d?30/(r.width-r.margin.l-r.margin.r):30);var f=h("lenmode");h("len","fraction"===f?1:r.height-r.margin.t-r.margin.b),h("x"),h("xanchor"),h("xpad"),h("y"),h("yanchor"),h("ypad"),n.noneOrAll(c,u,["x","y"]),h("outlinecolor"),h("outlinewidth"),h("bordercolor"),h("borderwidth"),h("bgcolor"),i(c,u,h,"linear");var p={outerTicks:!1,font:r.font};s(c,u,h,"linear",p),o(c,u,h,"linear",p),h("title.text",r._dfltTitle.colorbar),n.coerceFont(h,"title.font",r.font),h("title.side")}},{"../../lib":719,"../../plot_api/plot_template":757,"../../plots/cartesian/tick_label_defaults":786,"../../plots/cartesian/tick_mark_defaults":787,"../../plots/cartesian/tick_value_defaults":788,"./attributes":594}],597:[function(t,e,r){var n=t("d3"),a=t("tinycolor2"),i=t("../../plots/plots"),o=t("../../registry"),s=t("../../plots/cartesian/axes"),l=t("../dragelement"),u=t("../../lib"),c=t("../../lib/extend").extendFlat,h=t("../../lib/setcursor"),d=t("../drawing"),f=t("../color"),p=t("../titles"),m=t("../../lib/svg_text_utils"),g=t("../colorscale/helpers").flipScale,y=t("../../plots/cartesian/axis_defaults"),v=t("../../plots/cartesian/position_defaults"),_=t("../../plots/cartesian/layout_attributes"),x=t("../../constants/alignment"),b=x.LINE_SPACING,w=x.FROM_TL,M=x.FROM_BR,k=t("./constants").cn;e.exports={draw:function(t){var e=t._fullLayout._infolayer.selectAll("g."+k.colorbar).data(function(t){var e,r,n,a,i=t._fullLayout,o=t.calcdata,s=[];function l(t){return c(t,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function u(){"function"==typeof a.calc?a.calc(t,n,e):(e._fillgradient=r.reversescale?g(r.colorscale):r.colorscale,e._zrange=[r[a.min],r[a.max]])}for(var h=0;h<o.length;h++){var d=o[h],f=(n=d[0].trace)._module.colorbar;if(!0===n.visible&&f)for(var p=Array.isArray(f),m=p?f:[f],y=0;y<m.length;y++){var v=(a=m[y]).container;(r=v?n[v]:n)&&r.showscale&&((e=l(r.colorbar))._id="cb"+n.uid+(p&&v?"-"+v:""),e._traceIndex=n.index,e._propPrefix=(v?v+".":"")+"colorbar.",e._meta=n._meta,u(),s.push(e))}}for(var _ in i._colorAxes)if((r=i[_]).showscale){var x=i._colorAxes[_];(e=l(r.colorbar))._id="cb"+_,e._propPrefix=_+".colorbar.",e._meta=i._meta,a={min:"cmin",max:"cmax"},"heatmap"!==x[0]&&(n=x[1],a.calc=n._module.colorbar.calc),u(),s.push(e)}return s}(t),(function(t){return t._id}));e.enter().append("g").attr("class",(function(t){return t._id})).classed(k.colorbar,!0),e.each((function(e){var r=n.select(this);u.ensureSingle(r,"rect",k.cbbg),u.ensureSingle(r,"g",k.cbfills),u.ensureSingle(r,"g",k.cblines),u.ensureSingle(r,"g",k.cbaxis,(function(t){t.classed(k.crisp,!0)})),u.ensureSingle(r,"g",k.cbtitleunshift,(function(t){t.append("g").classed(k.cbtitle,!0)})),u.ensureSingle(r,"rect",k.cboutline);var g=function(t,e,r){var o=r._fullLayout,l=o._size,h=e._fillcolor,g=e._line,x=e.title,T=x.side,L=e._zrange||n.extent(("function"==typeof h?h:g.color).domain()),A="function"==typeof g.color?g.color:function(){return g.color},S="function"==typeof h?h:function(){return h},E=e._levels,C=function(t,e,r){var n,a,i=e._levels,o=[],s=[],l=i.end+i.size/100,u=i.size,c=1.001*r[0]-.001*r[1],h=1.001*r[1]-.001*r[0];for(a=0;a<1e5&&(n=i.start+a*u,!(u>0?n>=l:n<=l));a++)n>c&&n<h&&o.push(n);if(e._fillgradient)s=[0];else if("function"==typeof e._fillcolor){var d=e._filllevels;if(d)for(l=d.end+d.size/100,u=d.size,a=0;a<1e5&&(n=d.start+a*u,!(u>0?n>=l:n<=l));a++)n>r[0]&&n<r[1]&&s.push(n);else(s=o.map((function(t){return t-i.size/2}))).push(s[s.length-1]+i.size)}else e._fillcolor&&"string"==typeof e._fillcolor&&(s=[0]);return i.size<0&&(o.reverse(),s.reverse()),{line:o,fill:s}}(0,e,L),D=C.fill,P=C.line,O=Math.round(e.thickness*("fraction"===e.thicknessmode?l.w:1)),z=O/l.w,I=Math.round(e.len*("fraction"===e.lenmode?l.h:1)),R=I/l.h,F=e.xpad/l.w,N=(e.borderwidth+e.outlinewidth)/2,Y=e.ypad/l.h,j=Math.round(e.x*l.w+e.xpad),B=e.x-z*({middle:.5,right:1}[e.xanchor]||0),H=e.y+R*(({top:-.5,bottom:.5}[e.yanchor]||0)-.5),U=Math.round(l.h*(1-H)),V=U-I;e._lenFrac=R,e._thickFrac=z,e._xLeftFrac=B,e._yBottomFrac=H;var W=function(t,e,r){var n=t._fullLayout,a={type:"linear",range:r,tickmode:e.tickmode,nticks:e.nticks,tick0:e.tick0,dtick:e.dtick,tickvals:e.tickvals,ticktext:e.ticktext,ticks:e.ticks,ticklen:e.ticklen,tickwidth:e.tickwidth,tickcolor:e.tickcolor,showticklabels:e.showticklabels,tickfont:e.tickfont,tickangle:e.tickangle,tickformat:e.tickformat,exponentformat:e.exponentformat,separatethousands:e.separatethousands,showexponent:e.showexponent,showtickprefix:e.showtickprefix,tickprefix:e.tickprefix,showticksuffix:e.showticksuffix,ticksuffix:e.ticksuffix,title:e.title,showline:!0,anchor:"free",side:"right",position:1},i={type:"linear",_id:"y"+e._id},o={letter:"y",font:n.font,noHover:!0,noTickson:!0,calendar:n.calendar};function s(t,e){return u.coerce(a,i,_,t,e)}return y(a,i,s,o,n),v(a,i,s,o),i}(r,e,L);if(W.position=e.x+F+z,-1!==["top","bottom"].indexOf(T)&&(W.title.side=T,W.titlex=e.x+F,W.titley=H+("top"===x.side?R-Y:Y)),g.color&&"auto"===e.tickmode){W.tickmode="linear",W.tick0=E.start;var G=E.size,q=u.constrain((U-V)/50,4,15)+1,Z=(L[1]-L[0])/((e.nticks||q)*G);if(Z>1){var X=Math.pow(10,Math.floor(Math.log(Z)/Math.LN10));G*=X*u.roundUp(Z/X,[2,5,10]),(Math.abs(E.start)/E.size+1e-6)%1<2e-6&&(W.tick0=0)}W.dtick=G}W.domain=[H+Y,H+R-Y],W.setScale(),t.attr("transform","translate("+Math.round(l.l)+","+Math.round(l.t)+")");var J,K=t.select("."+k.cbtitleunshift).attr("transform","translate(-"+Math.round(l.l)+",-"+Math.round(l.t)+")"),$=t.select("."+k.cbaxis),Q=0;function tt(n,a){var i={propContainer:W,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:o._dfltTitle.colorbar,containerGroup:t.select("."+k.cbtitle)},s="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+s+",."+s+"-math-group").remove(),p.draw(r,n,c(i,a||{}))}return u.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(T)){var t,r=l.l+(e.x+F)*l.w,n=W.title.font.size;t="top"===T?(1-(H+R-Y))*l.h+l.t+3+.75*n:(1-(H+Y))*l.h+l.t-3-.25*n,tt(W._id+"title",{attributes:{x:r,y:t,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(T)){var i=t.select("."+k.cbtitle),o=i.select("text"),c=[-e.outlinewidth/2,e.outlinewidth/2],h=i.select(".h"+W._id+"title-math-group").node(),f=15.6;if(o.node()&&(f=parseInt(o.node().style.fontSize,10)*b),h?(Q=d.bBox(h).height)>f&&(c[1]-=(Q-f)/2):o.node()&&!o.classed(k.jsPlaceholder)&&(Q=d.bBox(o.node()).height),Q){if(Q+=5,"top"===T)W.domain[1]-=Q/l.h,c[1]*=-1;else{W.domain[0]+=Q/l.h;var p=m.lineCount(o);c[1]+=(1-p)*f}i.attr("transform","translate("+c+")"),W.setScale()}}t.selectAll("."+k.cbfills+",."+k.cblines).attr("transform","translate(0,"+Math.round(l.h*(1-W.domain[1]))+")"),$.attr("transform","translate(0,"+Math.round(-l.t)+")");var y=t.select("."+k.cbfills).selectAll("rect."+k.cbfill).data(D);y.enter().append("rect").classed(k.cbfill,!0).style("stroke","none"),y.exit().remove();var v=L.map(W.c2p).map(Math.round).sort((function(t,e){return t-e}));y.each((function(t,i){var o=[0===i?L[0]:(D[i]+D[i-1])/2,i===D.length-1?L[1]:(D[i]+D[i+1])/2].map(W.c2p).map(Math.round);o[1]=u.constrain(o[1]+(o[1]>o[0])?1:-1,v[0],v[1]);var s=n.select(this).attr({x:j,width:Math.max(O,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(e._fillgradient)d.gradient(s,r,e._id,"vertical",e._fillgradient,"fill");else{var l=S(t).replace("e-","");s.attr("fill",a(l).toHexString())}}));var _=t.select("."+k.cblines).selectAll("path."+k.cbline).data(g.color&&g.width?P:[]);_.enter().append("path").classed(k.cbline,!0),_.exit().remove(),_.each((function(t){n.select(this).attr("d","M"+j+","+(Math.round(W.c2p(t))+g.width/2%1)+"h"+O).call(d.lineGroupStyle,g.width,A(t),g.dash)})),$.selectAll("g."+W._id+"tick,path").remove();var x=j+O+(e.outlinewidth||0)/2-("outside"===e.ticks?1:0),w=s.calcTicks(W),M=s.makeTransFn(W),E=s.getTickSigns(W)[2];return s.drawTicks(r,W,{vals:"inside"===W.ticks?s.clipEnds(W,w):w,layer:$,path:s.makeTickPath(W,x,E),transFn:M}),s.drawLabels(r,W,{vals:w,layer:$,transFn:M,labelFns:s.makeLabelFns(W,x)})},function(){if(-1===["top","bottom"].indexOf(T)){var t=W.title.font.size,e=W._offset+W._length/2,a=l.l+(W.position||0)*l.w+("right"===W.side?10+t*(W.showticklabels?1:.5):-10-t*(W.showticklabels?.5:0));tt("h"+W._id+"title",{avoid:{selection:n.select(r).selectAll("g."+W._id+"tick"),side:T,offsetLeft:l.l,offsetTop:0,maxShift:o.width},attributes:{x:a,y:e,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},i.previousPromises,function(){var n=O+e.outlinewidth/2+d.bBox($.node()).width;if((J=K.select("text")).node()&&!J.classed(k.jsPlaceholder)){var a,o=K.select(".h"+W._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(T)?d.bBox(o).width:d.bBox(K.node()).right-j-l.l,n=Math.max(n,a)}var s=2*e.xpad+n+e.borderwidth+e.outlinewidth/2,u=U-V;t.select("."+k.cbbg).attr({x:j-e.xpad-(e.borderwidth+e.outlinewidth)/2,y:V-N,width:Math.max(s,2),height:Math.max(u+2*N,2)}).call(f.fill,e.bgcolor).call(f.stroke,e.bordercolor).style("stroke-width",e.borderwidth),t.selectAll("."+k.cboutline).attr({x:j,y:V+e.ypad+("top"===T?Q:0),width:Math.max(O,2),height:Math.max(u-2*e.ypad-Q,2)}).call(f.stroke,e.outlinecolor).style({fill:"none","stroke-width":e.outlinewidth});var c=({center:.5,right:1}[e.xanchor]||0)*s;t.attr("transform","translate("+(l.l-c)+","+l.t+")");var h={},p=w[e.yanchor],m=M[e.yanchor];"pixels"===e.lenmode?(h.y=e.y,h.t=u*p,h.b=u*m):(h.t=h.b=0,h.yt=e.y+e.len*p,h.yb=e.y-e.len*m);var g=w[e.xanchor],y=M[e.xanchor];if("pixels"===e.thicknessmode)h.x=e.x,h.l=s*g,h.r=s*y;else{var v=s-O;h.l=v*g,h.r=v*y,h.xl=e.x-e.thickness*g,h.xr=e.x+e.thickness*y}i.autoMargin(r,e._id,h)}],r)}(r,e,t);g&&g.then&&(t._promises||[]).push(g),t._context.edits.colorbarPosition&&function(t,e,r){var n,a,i,s=r._fullLayout._size;l.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),h(t)},moveFn:function(r,o){t.attr("transform",n+" translate("+r+","+o+")"),a=l.align(e._xLeftFrac+r/s.w,e._thickFrac,0,1,e.xanchor),i=l.align(e._yBottomFrac-o/s.h,e._lenFrac,0,1,e.yanchor);var u=l.getCursor(a,i,e.xanchor,e.yanchor);h(t,u)},doneFn:function(){if(h(t),void 0!==a&&void 0!==i){var n={};n[e._propPrefix+"x"]=a,n[e._propPrefix+"y"]=i,void 0!==e._traceIndex?o.call("_guiRestyle",r,n,e._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,e,t)})),e.exit().each((function(e){i.autoMargin(t,e._id)})).remove(),e.order()}}},{"../../constants/alignment":688,"../../lib":719,"../../lib/extend":710,"../../lib/setcursor":739,"../../lib/svg_text_utils":743,"../../plots/cartesian/axes":767,"../../plots/cartesian/axis_defaults":769,"../../plots/cartesian/layout_attributes":779,"../../plots/cartesian/position_defaults":782,"../../plots/plots":828,"../../registry":847,"../color":593,"../colorscale/helpers":604,"../dragelement":611,"../drawing":614,"../titles":681,"./constants":595,d3:163,tinycolor2:537}],598:[function(t,e,r){var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":719}],599:[function(t,e,r){e.exports={moduleType:"component",name:"colorbar",attributes:t("./attributes"),supplyDefaults:t("./defaults"),draw:t("./draw").draw,hasColorbar:t("./has_colorbar")}},{"./attributes":594,"./defaults":596,"./draw":597,"./has_colorbar":598}],600:[function(t,e,r){var n=t("../colorbar/attributes"),a=t("../../lib/regex").counter,i=t("./scales.js").scales;function o(t){return"`"+t+"`"}Object.keys(i),e.exports=function(t,e){t=t||"";var r,s=(e=e||{}).cLetter||"c",l=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),u="showScaleDflt"in e?e.showScaleDflt:"z"===s,c="string"==typeof e.colorscaleDflt?i[e.colorscaleDflt]:null,h=e.editTypeOverride||"",d=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.colorAttr):o(d+(r={z:"z",c:"color"}[s]));var f=s+"auto",p=s+"min",m=s+"max",g=s+"mid",y=(o(d+f),o(d+p),o(d+m),{});y[p]=y[m]=void 0;var v={};v[f]=!1;var _={};return"color"===r&&(_.color={valType:"color",arrayOk:!0,editType:h||"style"},e.anim&&(_.color.anim=!0)),_[f]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:y},_[p]={valType:"number",dflt:null,editType:h||"plot",impliedEdits:v},_[m]={valType:"number",dflt:null,editType:h||"plot",impliedEdits:v},_[g]={valType:"number",dflt:null,editType:"calc",impliedEdits:y},_.colorscale={valType:"colorscale",editType:"calc",dflt:c,impliedEdits:{autocolorscale:!1}},_.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},_.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(_.showscale={valType:"boolean",dflt:u,editType:"calc"},_.colorbar=n),e.noColorAxis||(_.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),_}},{"../../lib/regex":735,"../colorbar/attributes":594,"./scales.js":608}],601:[function(t,e,r){var n=t("fast-isnumeric"),a=t("../../lib"),i=t("./helpers").extractOpts;e.exports=function(t,e,r){var o,s=t._fullLayout,l=r.vals,u=r.containerStr,c=u?a.nestedProperty(e,u).get():e,h=i(c),d=!1!==h.auto,f=h.min,p=h.max,m=h.mid,g=function(){return a.aggNums(Math.min,null,l)},y=function(){return a.aggNums(Math.max,null,l)};void 0===f?f=g():d&&(f=c._colorAx&&n(f)?Math.min(f,g()):g()),void 0===p?p=y():d&&(p=c._colorAx&&n(p)?Math.max(p,y()):y()),d&&void 0!==m&&(p-m>m-f?f=m-(p-m):p-m<m-f&&(p=m+(m-f))),f===p&&(f-=.5,p+=.5),h._sync("min",f),h._sync("max",p),h.autocolorscale&&(o=f*p<0?s.colorscale.diverging:f>=0?s.colorscale.sequential:s.colorscale.sequentialminus,h._sync("colorscale",o))}},{"../../lib":719,"./helpers":604,"fast-isnumeric":225}],602:[function(t,e,r){var n=t("../../lib"),a=t("./helpers").hasColorscale,i=t("./helpers").extractOpts;e.exports=function(t,e){function r(t,e){var r=t["_"+e];void 0!==r&&(t[e]=r)}function o(t,a){var o=a.container?n.nestedProperty(t,a.container).get():t;if(o)if(o.coloraxis)o._colorAx=e[o.coloraxis];else{var s=i(o),l=s.auto;(l||void 0===s.min)&&r(o,a.min),(l||void 0===s.max)&&r(o,a.max),s.autocolorscale&&r(o,"colorscale")}}for(var s=0;s<t.length;s++){var l=t[s],u=l._module.colorbar;if(u)if(Array.isArray(u))for(var c=0;c<u.length;c++)o(l,u[c]);else o(l,u);a(l,"marker.line")&&o(l,{container:"marker.line",min:"cmin",max:"cmax"})}for(var h in e._colorAxes)o(e[h],{min:"cmin",max:"cmax"})}},{"../../lib":719,"./helpers":604}],603:[function(t,e,r){var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../colorbar/has_colorbar"),o=t("../colorbar/defaults"),s=t("./scales").isValid,l=t("../../registry").traceIs;function u(t,e){var r=e.slice(0,e.length-1);return e?a.nestedProperty(t,r).get()||{}:t}e.exports=function t(e,r,c,h,d){var f=d.prefix,p=d.cLetter,m="_module"in r,g=u(e,f),y=u(r,f),v=u(r._template||{},f)||{},_=function(){return delete e.coloraxis,delete r.coloraxis,t(e,r,c,h,d)};if(m){var x=c._colorAxes||{},b=h(f+"coloraxis");if(b){var w=l(r,"contour")&&a.nestedProperty(r,"contours.coloring").get()||"heatmap",M=x[b];return void(M?(M[2].push(_),M[0]!==w&&(M[0]=!1,a.warn(["Ignoring coloraxis:",b,"setting","as it is linked to incompatible colorscales."].join(" ")))):x[b]=[w,r,[_]])}}var k=g[p+"min"],T=g[p+"max"],L=n(k)&&n(T)&&k<T;h(f+p+"auto",!L)?h(f+p+"mid"):(h(f+p+"min"),h(f+p+"max"));var A,S,E=g.colorscale,C=v.colorscale;void 0!==E&&(A=!s(E)),void 0!==C&&(A=!s(C)),h(f+"autocolorscale",A),h(f+"colorscale"),h(f+"reversescale"),"marker.line."!==f&&(f&&m&&(S=i(g)),h(f+"showscale",S)&&o(g,y,c))}},{"../../lib":719,"../../registry":847,"../colorbar/defaults":596,"../colorbar/has_colorbar":598,"./scales":608,"fast-isnumeric":225}],604:[function(t,e,r){var n=t("d3"),a=t("tinycolor2"),i=t("fast-isnumeric"),o=t("../../lib"),s=t("../color"),l=t("./scales").isValid,u=["showscale","autocolorscale","colorscale","reversescale","colorbar"],c=["min","max","mid","auto"];function h(t){var e,r,n,a=t._colorAx,i=a||t,o={};for(r=0;r<u.length;r++)o[n=u[r]]=i[n];if(a)for(e="c",r=0;r<c.length;r++)o[n=c[r]]=i["c"+n];else{var s;for(r=0;r<c.length;r++)((s="c"+(n=c[r]))in i||(s="z"+n)in i)&&(o[n]=i[s]);e=s.charAt(0)}return o._sync=function(t,r){var n=-1!==c.indexOf(t)?e+t:t;i[n]=i["_"+n]=r},o}function d(t){for(var e=h(t),r=e.min,n=e.max,a=e.reversescale?f(e.colorscale):e.colorscale,i=a.length,o=new Array(i),s=new Array(i),l=0;l<i;l++){var u=a[l];o[l]=r+u[0]*(n-r),s[l]=u[1]}return{domain:o,range:s}}function f(t){for(var e=t.length,r=new Array(e),n=e-1,a=0;n>=0;n--,a++){var i=t[n];r[a]=[1-i[0],i[1]]}return r}function p(t,e){e=e||{};for(var r=t.domain,o=t.range,l=o.length,u=new Array(l),c=0;c<l;c++){var h=a(o[c]).toRgb();u[c]=[h.r,h.g,h.b,h.a]}var d,f=n.scale.linear().domain(r).range(u).clamp(!0),p=e.noNumericCheck,g=e.returnArray;return(d=p&&g?f:p?function(t){return m(f(t))}:g?function(t){return i(t)?f(t):a(t).isValid()?t:s.defaultLine}:function(t){return i(t)?m(f(t)):a(t).isValid()?t:s.defaultLine}).domain=f.domain,d.range=function(){return o},d}function m(t){var e={r:t[0],g:t[1],b:t[2],a:t[3]};return a(e).toRgbString()}e.exports={hasColorscale:function(t,e){var r=e?o.nestedProperty(t,e).get()||{}:t,n=r.color,a=!1;if(o.isArrayOrTypedArray(n))for(var s=0;s<n.length;s++)if(i(n[s])){a=!0;break}return o.isPlainObject(r)&&(a||!0===r.showscale||i(r.cmin)&&i(r.cmax)||l(r.colorscale)||o.isPlainObject(r.colorbar))},extractOpts:h,extractScale:d,flipScale:f,makeColorScaleFunc:p,makeColorScaleFuncFromTrace:function(t,e){return p(d(t),e)}}},{"../../lib":719,"../color":593,"./scales":608,d3:163,"fast-isnumeric":225,tinycolor2:537}],605:[function(t,e,r){var n=t("./scales"),a=t("./helpers");e.exports={moduleType:"component",name:"colorscale",attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyLayoutDefaults:t("./layout_defaults"),handleDefaults:t("./defaults"),crossTraceDefaults:t("./cross_trace_defaults"),calc:t("./calc"),scales:n.scales,defaultScale:n.defaultScale,getScale:n.get,isValidScale:n.isValid,hasColorscale:a.hasColorscale,extractOpts:a.extractOpts,extractScale:a.extractScale,flipScale:a.flipScale,makeColorScaleFunc:a.makeColorScaleFunc,makeColorScaleFuncFromTrace:a.makeColorScaleFuncFromTrace}},{"./attributes":600,"./calc":601,"./cross_trace_defaults":602,"./defaults":603,"./helpers":604,"./layout_attributes":606,"./layout_defaults":607,"./scales":608}],606:[function(t,e,r){var n=t("../../lib/extend").extendFlat,a=t("./attributes"),i=t("./scales").scales;e.exports={editType:"calc",colorscale:{editType:"calc",sequential:{valType:"colorscale",dflt:i.Reds,editType:"calc"},sequentialminus:{valType:"colorscale",dflt:i.Blues,editType:"calc"},diverging:{valType:"colorscale",dflt:i.RdBu,editType:"calc"}},coloraxis:n({_isSubplotObj:!0,editType:"calc"},a("",{colorAttr:"corresponding trace color array(s)",noColorAxis:!0,showScaleDflt:!0}))}},{"../../lib/extend":710,"./attributes":600,"./scales":608}],607:[function(t,e,r){var n=t("../../lib"),a=t("../../plot_api/plot_template"),i=t("./layout_attributes"),o=t("./defaults");e.exports=function(t,e){function r(r,a){return n.coerce(t,e,i,r,a)}r("colorscale.sequential"),r("colorscale.sequentialminus"),r("colorscale.diverging");var s,l,u=e._colorAxes;function c(t,e){return n.coerce(s,l,i.coloraxis,t,e)}for(var h in u){var d=u[h];if(d[0])s=t[h]||{},(l=a.newContainer(e,h,"coloraxis"))._name=h,o(s,l,e,c,{prefix:"",cLetter:"c"});else{for(var f=0;f<d[2].length;f++)d[2][f]();delete e._colorAxes[h]}}}},{"../../lib":719,"../../plot_api/plot_template":757,"./defaults":603,"./layout_attributes":606}],608:[function(t,e,r){var n=t("tinycolor2"),a={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]],Cividis:[[0,"rgb(0,32,76)"],[.058824,"rgb(0,42,102)"],[.117647,"rgb(0,52,110)"],[.176471,"rgb(39,63,108)"],[.235294,"rgb(60,74,107)"],[.294118,"rgb(76,85,107)"],[.352941,"rgb(91,95,109)"],[.411765,"rgb(104,106,112)"],[.470588,"rgb(117,117,117)"],[.529412,"rgb(131,129,120)"],[.588235,"rgb(146,140,120)"],[.647059,"rgb(161,152,118)"],[.705882,"rgb(176,165,114)"],[.764706,"rgb(192,177,109)"],[.823529,"rgb(209,191,102)"],[.882353,"rgb(225,204,92)"],[.941176,"rgb(243,219,79)"],[1,"rgb(255,233,69)"]]},i=a.RdBu;function o(t){var e=0;if(!Array.isArray(t)||t.length<2)return!1;if(!t[0]||!t[t.length-1])return!1;if(0!=+t[0][0]||1!=+t[t.length-1][0])return!1;for(var r=0;r<t.length;r++){var a=t[r];if(2!==a.length||+a[0]<e||!n(a[1]).isValid())return!1;e=+a[0]}return!0}e.exports={scales:a,defaultScale:i,get:function(t,e){if(e||(e=i),!t)return e;function r(){try{t=a[t]||JSON.parse(t)}catch(r){t=e}}return"string"==typeof t&&(r(),"string"==typeof t&&r()),o(t)?t:e},isValid:function(t){return void 0!==a[t]||o(t)}}},{tinycolor2:537}],609:[function(t,e,r){e.exports=function(t,e,r,n,a){var i=(t-r)/(n-r),o=i+e/(n-r),s=(i+o)/2;return"left"===a||"bottom"===a?i:"center"===a||"middle"===a?s:"right"===a||"top"===a?o:i<2/3-s?i:o>4/3-s?o:s}},{}],610:[function(t,e,r){var n=t("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,i){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*e),0,2),a[e][t]}},{"../../lib":719}],611:[function(t,e,r){var n=t("mouse-event-offset"),a=t("has-hover"),i=t("has-passive-events"),o=t("../../lib").removeElement,s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var u=t("./unhover");function c(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function h(t){return n(t.changedTouches?t.changedTouches[0]:t,document.body)}l.unhover=u.wrapped,l.unhoverRaw=u.raw,l.init=function(t){var e,r,n,u,d,f,p,m,g=t.gd,y=1,v=g._context.doubleClickDelay,_=t.element;g._mouseDownTime||(g._mouseDownTime=0),_.style.pointerEvents="all",_.onmousedown=b,i?(_._ontouchstart&&_.removeEventListener("touchstart",_._ontouchstart),_._ontouchstart=b,_.addEventListener("touchstart",b,{passive:!1})):_.ontouchstart=b;var x=t.clampFn||function(t,e,r){return Math.abs(t)<r&&(t=0),Math.abs(e)<r&&(e=0),[t,e]};function b(i){g._dragged=!1,g._dragging=!0;var o=h(i);e=o[0],r=o[1],p=i.target,f=i,m=2===i.buttons||i.ctrlKey,void 0===i.clientX&&void 0===i.clientY&&(i.clientX=e,i.clientY=r),(n=(new Date).getTime())-g._mouseDownTime<v?y+=1:(y=1,g._mouseDownTime=n),t.prepFn&&t.prepFn(i,e,r),a&&!m?(d=c()).style.cursor=window.getComputedStyle(_).cursor:a||(d=document,u=window.getComputedStyle(document.documentElement).cursor,document.documentElement.style.cursor=window.getComputedStyle(_).cursor),document.addEventListener("mouseup",M),document.addEventListener("touchend",M),!1!==t.dragmode&&(i.preventDefault(),document.addEventListener("mousemove",w),document.addEventListener("touchmove",w))}function w(n){n.preventDefault();var a=h(n),i=t.minDrag||s.MINDRAG,o=x(a[0]-e,a[1]-r,i),u=o[0],c=o[1];(u||c)&&(g._dragged=!0,l.unhover(g)),g._dragged&&t.moveFn&&!m&&(g._dragdata={element:_,dx:u,dy:c},t.moveFn(u,c))}function M(e){if(delete g._dragdata,!1!==t.dragmode&&(e.preventDefault(),document.removeEventListener("mousemove",w),document.removeEventListener("touchmove",w)),document.removeEventListener("mouseup",M),document.removeEventListener("touchend",M),a?o(d):u&&(d.documentElement.style.cursor=u,u=null),g._dragging){if(g._dragging=!1,(new Date).getTime()-g._mouseDownTime>v&&(y=Math.max(y-1,1)),g._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(y,f),!m){var r;try{r=new MouseEvent("click",e)}catch(t){var n=h(e);(r=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,n[0],n[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}p.dispatchEvent(r)}g._dragging=!1,g._dragged=!1}else g._dragged=!1}},l.coverSlip=c},{"../../lib":719,"../../plots/cartesian/constants":773,"./align":609,"./cursor":610,"./unhover":612,"has-hover":410,"has-passive-events":411,"mouse-event-offset":436}],612:[function(t,e,r){var n=t("../../lib/events"),a=t("../../lib/throttle"),i=t("../../lib/dom").getGraphDiv,o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){(t=i(t))._fullLayout&&a.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,a=t._hoverdata;e||(e={}),e.target&&!1===n.triggerHandler(t,"plotly_beforehover",e)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&a&&t.emit("plotly_unhover",{event:e,points:a}))}},{"../../lib/dom":708,"../../lib/events":709,"../../lib/throttle":744,"../fx/constants":626}],613:[function(t,e,r){r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],614:[function(t,e,r){var n=t("d3"),a=t("fast-isnumeric"),i=t("tinycolor2"),o=t("../../registry"),s=t("../color"),l=t("../colorscale"),u=t("../../lib"),c=t("../../lib/svg_text_utils"),h=t("../../constants/xmlns_namespaces"),d=t("../../constants/alignment").LINE_SPACING,f=t("../../constants/interactions").DESELECTDIM,p=t("../../traces/scatter/subtypes"),m=t("../../traces/scatter/make_bubble_size_func"),g=e.exports={};g.font=function(t,e,r,n){u.isPlainObject(e)&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(s.fill,n)},g.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},g.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},g.setRect=function(t,e,r,n,a){t.call(g.setPosition,e,r).call(g.setSize,n,a)},g.translatePoint=function(t,e,r,n){var i=r.c2p(t.x),o=n.c2p(t.y);return!!(a(i)&&a(o)&&e.node())&&("text"===e.node().nodeName?e.attr("x",i).attr("y",o):e.attr("transform","translate("+i+","+o+")"),!0)},g.translatePoints=function(t,e,r){t.each((function(t){var a=n.select(this);g.translatePoint(t,a,e,r)}))},g.hideOutsideRangePoint=function(t,e,r,n,a,i){e.attr("display",r.isPtWithinRange(t,a)&&n.isPtWithinRange(t,i)?null:"none")},g.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,a=e.yaxis;t.each((function(e){var i=e[0].trace,s=i.xcalendar,l=i.ycalendar,u=o.traceIs(i,"bar-like")?".bartext":".point,.textpoint";t.selectAll(u).each((function(t){g.hideOutsideRangePoint(t,n.select(this),r,a,s,l)}))}))}},g.crispRound=function(t,e,r){return e&&a(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},g.singleLineStyle=function(t,e,r,n,a){e.style("fill","none");var i=(((t||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,l=a||i.dash||"";s.stroke(e,n||i.color),g.dashLine(e,l,o)},g.lineGroupStyle=function(t,e,r,a){t.style("fill","none").each((function(t){var i=(((t||[])[0]||{}).trace||{}).line||{},o=e||i.width||0,l=a||i.dash||"";n.select(this).call(s.stroke,r||i.color).call(g.dashLine,l,o)}))},g.dashLine=function(t,e,r){r=+r||0,e=g.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},g.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=r+"px,"+r+"px":"dash"===t?t=3*r+"px,"+3*r+"px":"longdash"===t?t=5*r+"px,"+5*r+"px":"dashdot"===t?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===t&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t},g.singleFillStyle=function(t){var e=(((n.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(s.fill,e)},g.fillGroupStyle=function(t){t.style("stroke-width",0).each((function(t){var e=n.select(this);t[0].trace&&e.call(s.fill,t[0].trace.fillcolor)}))};var y=t("./symbol_defs");g.symbolNames=[],g.symbolFuncs=[],g.symbolNeedLines={},g.symbolNoDot={},g.symbolNoFill={},g.symbolList=[],Object.keys(y).forEach((function(t){var e=y[t];g.symbolList=g.symbolList.concat([e.n,t,e.n+100,t+"-open"]),g.symbolNames[e.n]=t,g.symbolFuncs[e.n]=e.f,e.needLine&&(g.symbolNeedLines[e.n]=!0),e.noDot?g.symbolNoDot[e.n]=!0:g.symbolList=g.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"]),e.noFill&&(g.symbolNoFill[e.n]=!0)}));var v=g.symbolNames.length;function _(t,e){var r=t%100;return g.symbolFuncs[r](e)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}g.symbolNumber=function(t){if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),(t=g.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=v||t>=400?0:Math.floor(Math.max(t,0))};var x={x1:1,x2:0,y1:0,y2:0},b={x1:0,x2:0,y1:1,y2:0},w=n.format("~.1f"),M={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:x},horizontalreversed:{node:"linearGradient",attrs:x,reversed:!0},vertical:{node:"linearGradient",attrs:b},verticalreversed:{node:"linearGradient",attrs:b,reversed:!0}};g.gradient=function(t,e,r,a,o,l){for(var c=o.length,h=M[a],d=new Array(c),f=0;f<c;f++)h.reversed?d[c-1-f]=[w(100*(1-o[f][0])),o[f][1]]:d[f]=[w(100*o[f][0]),o[f][1]];var p="g"+e._fullLayout._uid+"-"+r,m=e._fullLayout._defs.select(".gradients").selectAll("#"+p).data([a+d.join(";")],u.identity);m.exit().remove(),m.enter().append(h.node).each((function(){var t=n.select(this);h.attrs&&t.attr(h.attrs),t.attr("id",p);var e=t.selectAll("stop").data(d);e.exit().remove(),e.enter().append("stop"),e.each((function(t){var e=i(t[1]);n.select(this).attr({offset:t[0]+"%","stop-color":s.tinyRGB(e),"stop-opacity":e.getAlpha()})}))})),t.style(l,P(p,e)).style(l+"-opacity",null)},g.initGradients=function(t){u.ensureSingle(t._fullLayout._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove()},g.pointStyle=function(t,e,r){if(t.size()){var a=g.makePointStyleFns(e);t.each((function(t){g.singlePointStyle(t,n.select(this),e,a,r)}))}},g.singlePointStyle=function(t,e,r,n,a){var i=r.marker,o=i.line;if(e.style("opacity",n.selectedOpacityFn?n.selectedOpacityFn(t):void 0===t.mo?i.opacity:t.mo),n.ms2mrc){var l;l="various"===t.ms||"various"===i.size?3:n.ms2mrc(t.ms),t.mrc=l,n.selectedSizeFn&&(l=t.mrc=n.selectedSizeFn(t));var c=g.symbolNumber(t.mx||i.symbol)||0;t.om=c%200>=100,e.attr("d",_(c,l))}var h,d,f,p=!1;if(t.so)f=o.outlierwidth,d=o.outliercolor,h=i.outliercolor;else{var m=(o||{}).width;f=(t.mlw+1||m+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,d="mlc"in t?t.mlcc=n.lineScale(t.mlc):u.isArrayOrTypedArray(o.color)?s.defaultLine:o.color,u.isArrayOrTypedArray(i.color)&&(h=s.defaultLine,p=!0),h="mc"in t?t.mcc=n.markerScale(t.mc):i.color||"rgba(0,0,0,0)",n.selectedColorFn&&(h=n.selectedColorFn(t))}if(t.om)e.call(s.stroke,h).style({"stroke-width":(f||1)+"px",fill:"none"});else{e.style("stroke-width",f+"px");var y=i.gradient,v=t.mgt;if(v?p=!0:v=y&&y.type,Array.isArray(v)&&(v=v[0],M[v]||(v=0)),v&&"none"!==v){var x=t.mgc;x?p=!0:x=y.color;var b=r.uid;p&&(b+="-"+t.i),g.gradient(e,a,b,v,[[0,x],[1,h]],"fill")}else s.fill(e,h);f&&s.stroke(e,d)}},g.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=g.tryColorscale(r,""),e.lineScale=g.tryColorscale(r,"line"),o.traceIs(t,"symbols")&&(e.ms2mrc=p.isBubble(t)?m(t):function(){return(r.size||6)/2}),t.selectedpoints&&u.extendFlat(e,g.makeSelectedPointStyleFns(t)),e},g.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.marker||{},i=r.marker||{},s=n.marker||{},l=a.opacity,c=i.opacity,h=s.opacity,d=void 0!==c,p=void 0!==h;(u.isArrayOrTypedArray(l)||d||p)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?a.opacity:t.mo;return t.selected?d?c:e:p?h:f*e});var m=a.color,g=i.color,y=s.color;(g||y)&&(e.selectedColorFn=function(t){var e=t.mcc||m;return t.selected?g||e:y||e});var v=a.size,_=i.size,x=s.size,b=void 0!==_,w=void 0!==x;return o.traceIs(t,"symbols")&&(b||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||v/2;return t.selected?b?_/2:e:w?x/2:e}),e},g.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.textfont||{},i=r.textfont||{},o=n.textfont||{},l=a.color,u=i.color,c=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||l;return t.selected?u||e:c||(u?e:s.addOpacity(e,f))},e},g.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=g.makeSelectedPointStyleFns(e),a=e.marker||{},i=[];r.selectedOpacityFn&&i.push((function(t,e){t.style("opacity",r.selectedOpacityFn(e))})),r.selectedColorFn&&i.push((function(t,e){s.fill(t,r.selectedColorFn(e))})),r.selectedSizeFn&&i.push((function(t,e){var n=e.mx||a.symbol||0,i=r.selectedSizeFn(e);t.attr("d",_(g.symbolNumber(n),i)),e.mrc2=i})),i.length&&t.each((function(t){for(var e=n.select(this),r=0;r<i.length;r++)i[r](e,t)}))}},g.tryColorscale=function(t,e){var r=e?u.nestedProperty(t,e).get():t;if(r){var n=r.color;if((r.colorscale||r._colorAx)&&u.isArrayOrTypedArray(n))return l.makeColorScaleFuncFromTrace(r)}return u.identity};var k={start:1,end:-1,middle:0,bottom:1,top:-1};function T(t,e,r,a){var i=n.select(t.node().parentNode),o=-1!==e.indexOf("top")?"top":-1!==e.indexOf("bottom")?"bottom":"middle",s=-1!==e.indexOf("left")?"end":-1!==e.indexOf("right")?"start":"middle",l=a?a/.8+1:0,u=(c.lineCount(t)-1)*d+1,h=k[s]*l,f=.75*r+k[o]*l+(k[o]-1)*u*r/2;t.attr("text-anchor",s),i.attr("transform","translate("+h+","+f+")")}function L(t,e){var r=t.ts||e.textfont.size;return a(r)&&r>0?r:0}g.textPointStyle=function(t,e,r){if(t.size()){var a;if(e.selectedpoints){var i=g.makeSelectedTextStyleFns(e);a=i.selectedTextColorFn}t.each((function(t){var i=n.select(this),o=u.extractOption(t,e,"tx","text");if(o||0===o){var s=t.tp||e.textposition,l=L(t,e),h=a?a(t):t.tc||e.textfont.color;i.call(g.font,t.tf||e.textfont.family,l,h).text(o).call(c.convertToTspans,r).call(T,s,l,t.mrc)}else i.remove()}))}},g.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=g.makeSelectedTextStyleFns(e);t.each((function(t){var a=n.select(this),i=r.selectedTextColorFn(t),o=t.tp||e.textposition,l=L(t,e);s.fill(a,i),T(a,o,l,t.mrc2||t.mrc)}))}};function A(t,e,r,a){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,.25),c=Math.pow(s*s+l*l,.25),h=(c*c*i-u*u*s)*a,d=(c*c*o-u*u*l)*a,f=3*c*(u+c),p=3*u*(u+c);return[[n.round(e[0]+(f&&h/f),2),n.round(e[1]+(f&&d/f),2)],[n.round(e[0]-(p&&h/p),2),n.round(e[1]-(p&&d/p),2)]]}g.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(A(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]},g.smoothclosed=function(t,e){if(t.length<3)return"M"+t.join("L")+"Z";var r,n="M"+t[0],a=t.length-1,i=[A(t[a],t[0],t[1],e)];for(r=1;r<a;r++)i.push(A(t[r-1],t[r],t[r+1],e));for(i.push(A(t[a-1],t[a],t[0],e)),r=1;r<=a;r++)n+="C"+i[r-1][1]+" "+i[r][0]+" "+t[r];return n+"C"+i[a][1]+" "+i[0][0]+" "+t[0]+"Z"};var S={hv:function(t,e){return"H"+n.round(e[0],2)+"V"+n.round(e[1],2)},vh:function(t,e){return"V"+n.round(e[1],2)+"H"+n.round(e[0],2)},hvh:function(t,e){return"H"+n.round((t[0]+e[0])/2,2)+"V"+n.round(e[1],2)+"H"+n.round(e[0],2)},vhv:function(t,e){return"V"+n.round((t[1]+e[1])/2,2)+"H"+n.round(e[0],2)+"V"+n.round(e[1],2)}},E=function(t,e){return"L"+n.round(e[0],2)+","+n.round(e[1],2)};g.steps=function(t){var e=S[t]||E;return function(t){for(var r="M"+n.round(t[0][0],2)+","+n.round(t[0][1],2),a=1;a<t.length;a++)r+=e(t[a-1],t[a]);return r}},g.makeTester=function(){var t=u.ensureSingleById(n.select("body"),"svg","js-plotly-tester",(function(t){t.attr(h.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})})),e=u.ensureSingle(t,"path","js-reference-point",(function(t){t.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})}));g.tester=t,g.testref=e},g.savedBBoxes={};var C=0;function D(t){var e=t.getAttribute("data-unformatted");if(null!==e)return e+t.getAttribute("data-math")+t.getAttribute("text-anchor")+t.getAttribute("style")}function P(t,e){if(!t)return null;var r=e._context;return"url('"+(r._exportedPlot?"":r._baseUrl||"")+"#"+t+"')"}g.bBox=function(t,e,r){var a,i,o;if(r||(r=D(t)),r){if(a=g.savedBBoxes[r])return u.extendFlat({},a)}else if(1===t.childNodes.length){var s=t.childNodes[0];if(r=D(s)){var l=+s.getAttribute("x")||0,h=+s.getAttribute("y")||0,d=s.getAttribute("transform");if(!d){var f=g.bBox(s,!1,r);return l&&(f.left+=l,f.right+=l),h&&(f.top+=h,f.bottom+=h),f}if(r+="~"+l+"~"+h+"~"+d,a=g.savedBBoxes[r])return u.extendFlat({},a)}}e?i=t:(o=g.tester.node(),i=t.cloneNode(!0),o.appendChild(i)),n.select(i).attr("transform",null).call(c.positionText,0,0);var p=i.getBoundingClientRect(),m=g.testref.node().getBoundingClientRect();e||o.removeChild(i);var y={height:p.height,width:p.width,left:p.left-m.left,top:p.top-m.top,right:p.right-m.left,bottom:p.bottom-m.top};return C>=1e4&&(g.savedBBoxes={},C=0),r&&(g.savedBBoxes[r]=y),C++,u.extendFlat({},y)},g.setClipUrl=function(t,e,r){t.attr("clip-path",P(e,r))},g.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||0,y:+e[1]||0}},g.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",i=t[n]("transform")||"";return e=e||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=" translate("+e+", "+r+")").trim(),t[a]("transform",i),i},g.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||1,y:+e[1]||1}},g.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",i=t[n]("transform")||"";return e=e||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+=" scale("+e+", "+r+")").trim(),t[a]("transform",i),i};var O=/\s*sc.*/;g.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?"":" scale("+e+","+r+")";t.each((function(){var t=(this.getAttribute("transform")||"").replace(O,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var z=/translate\([^)]*\)\s*$/;g.setTextPointsScale=function(t,e,r){t&&t.each((function(){var t,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),s=parseFloat(i.attr("y")||0),l=(a.attr("transform")||"").match(z);t=1===e&&1===r?[]:["translate("+o+","+s+")","scale("+e+","+r+")","translate("+-o+","+-s+")"],l&&t.push(l),a.attr("transform",t.join(" "))}}))}},{"../../constants/alignment":688,"../../constants/interactions":694,"../../constants/xmlns_namespaces":696,"../../lib":719,"../../lib/svg_text_utils":743,"../../registry":847,"../../traces/scatter/make_bubble_size_func":1128,"../../traces/scatter/subtypes":1135,"../color":593,"../colorscale":605,"./symbol_defs":615,d3:163,"fast-isnumeric":225,tinycolor2:537}],615:[function(t,e,r){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,a="l"+e+",-"+e,i="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+a+i+a+i+o+i+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),a=n.round(-t,2),i=n.round(-.309*t,2);return"M"+e+","+i+"L"+r+","+n.round(.809*t,2)+"H-"+r+"L-"+e+","+i+"L0,"+a+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+e+"L-"+a+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+e+",0L"+r+",-"+a+"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),a=n.round(.951*e,2),i=n.round(.363*e,2),o=n.round(.588*e,2),s=n.round(-e,2),l=n.round(-.309*e,2),u=n.round(.118*e,2),c=n.round(.809*e,2);return"M"+r+","+l+"H"+a+"L"+i+","+u+"L"+o+","+c+"L0,"+n.round(.382*e,2)+"L-"+o+","+c+"L-"+i+","+u+"L-"+a+","+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),a=n.round(.76*t,2);return"M-"+a+",0l-"+r+",-"+e+"h"+a+"l"+r+",-"+e+"l"+r+","+e+"h"+a+"l-"+r+","+e+"l"+r+","+e+"h-"+a+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+a+"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),a=n.round(1.6*t,2),i=n.round(4*t,2),o="A "+i+","+i+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+a+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),a=n.round(1.6*t,2),i=n.round(4*t,2),o="A "+i+","+i+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+a+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),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+a+"-"+e+","+e+a+e+","+e+a+e+",-"+e+a+"-"+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),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+a+"0,"+e+a+e+",0"+a+"0,-"+e+a+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=n.round(.7*t,2),r=n.round(1.4*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},"diamond-wide":{n:24,f:function(t){var e=n.round(1.4*t,2),r=n.round(.7*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},hourglass:{n:25,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"L"+e+",-"+e+"H-"+e+"Z"},noDot:!0},bowtie:{n:26,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"V-"+e+"L-"+e+","+e+"V-"+e+"Z"},noDot:!0},"circle-cross":{n:27,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(t){var e=n.round(t,2),r=n.round(t/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM0,-"+e+"V"+e+"M-"+e+",0H"+e},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(t){var e=n.round(1.3*t,2),r=n.round(.65*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(t){var e=n.round(1.2*t,2),r=n.round(.85*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(t){var e=n.round(t/2,2),r=n.round(t,2);return"M"+e+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+e+"H-"+r+"m0,-"+r+"H"+r},needLine:!0,noFill:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+","+a+"L0,0M"+e+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+",-"+a+"L0,0M"+e+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M"+a+","+e+"L0,0M"+a+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+a+","+e+"L0,0M-"+a+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(t){var e=n.round(1.4*t,2);return"M"+e+",0H-"+e},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(t){var e=n.round(t,2);return"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e},needLine:!0,noDot:!0,noFill:!0}}},{d3:163}],616:[function(t,e,r){e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],617:[function(t,e,r){var n=t("fast-isnumeric"),a=t("../../registry"),i=t("../../plots/cartesian/axes"),o=t("../../lib"),s=t("./compute_error");function l(t,e,r,a){var l=e["error_"+a]||{},u=[];if(l.visible&&-1!==["linear","log"].indexOf(r.type)){for(var c=s(l),h=0;h<t.length;h++){var d=t[h],f=d.i;if(void 0===f)f=h;else if(null===f)continue;var p=d[a];if(n(r.c2l(p))){var m=c(p,f);if(n(m[0])&&n(m[1])){var g=d[a+"s"]=p-m[0],y=d[a+"h"]=p+m[1];u.push(g,y)}}}var v=r._id,_=e._extremes[v],x=i.findExtremes(r,u,o.extendFlat({tozero:_.opts.tozero},{padded:!0}));_.min=_.min.concat(x.min),_.max=_.max.concat(x.max)}}e.exports=function(t){for(var e=t.calcdata,r=0;r<e.length;r++){var n=e[r],o=n[0].trace;if(!0===o.visible&&a.traceIs(o,"errorBarsOK")){var s=i.getFromId(t,o.xaxis),u=i.getFromId(t,o.yaxis);l(n,o,s,"x"),l(n,o,u,"y")}}}},{"../../lib":719,"../../plots/cartesian/axes":767,"../../registry":847,"./compute_error":618,"fast-isnumeric":225}],618:[function(t,e,r){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 a=t.array||[];if(r)return function(t,e){var r=+a[e];return[r,r]};var i=t.arrayminus||[];return function(t,e){var r=+a[e],n=+i[e];return isNaN(r)&&isNaN(n)?[NaN,NaN]:[n||0,r||0]}}var o=n(e,t.value),s=n(e,t.valueminus);return r||void 0===t.valueminus?function(t){var e=o(t);return[e,e]}:function(t){return[s(t),o(t)]}}},{}],619:[function(t,e,r){var n=t("fast-isnumeric"),a=t("../../registry"),i=t("../../lib"),o=t("../../plot_api/plot_template"),s=t("./attributes");e.exports=function(t,e,r,l){var u="error_"+l.axis,c=o.newContainer(e,u),h=t[u]||{};function d(t,e){return i.coerce(h,c,s,t,e)}if(!1!==d("visible",void 0!==h.array||void 0!==h.value||"sqrt"===h.type)){var f=d("type","array"in h?"data":"percent"),p=!0;"sqrt"!==f&&(p=d("symmetric",!(("data"===f?"arrayminus":"valueminus")in h))),"data"===f?(d("array"),d("traceref"),p||(d("arrayminus"),d("tracerefminus"))):"percent"!==f&&"constant"!==f||(d("value"),p||d("valueminus"));var m="copy_"+l.inherit+"style";l.inherit&&(e["error_"+l.inherit]||{}).visible&&d(m,!(h.color||n(h.thickness)||n(h.width))),l.inherit&&c[m]||(d("color",r),d("thickness"),d("width",a.traceIs(e,"gl3d")?0:4))}}},{"../../lib":719,"../../plot_api/plot_template":757,"../../registry":847,"./attributes":616,"fast-isnumeric":225}],620:[function(t,e,r){var n=t("../../lib"),a=t("../../plot_api/edit_types").overrideAll,i=t("./attributes"),o={error_x:n.extendFlat({},i),error_y:n.extendFlat({},i)};delete o.error_x.copy_zstyle,delete o.error_y.copy_zstyle,delete o.error_y.copy_ystyle;var s={error_x:n.extendFlat({},i),error_y:n.extendFlat({},i),error_z:n.extendFlat({},i)};delete s.error_x.copy_ystyle,delete s.error_y.copy_ystyle,delete s.error_z.copy_ystyle,delete s.error_z.copy_zstyle,e.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:o,bar:o,histogram:o,scatter3d:a(s,"calc","nested"),scattergl:a(o,"calc","nested")}},supplyDefaults:t("./defaults"),calc:t("./calc"),makeComputeError:t("./compute_error"),plot:t("./plot"),style:t("./style"),hoverInfo:function(t,e,r){(e.error_y||{}).visible&&(r.yerr=t.yh-t.y,e.error_y.symmetric||(r.yerrneg=t.y-t.ys)),(e.error_x||{}).visible&&(r.xerr=t.xh-t.x,e.error_x.symmetric||(r.xerrneg=t.x-t.xs))}}},{"../../lib":719,"../../plot_api/edit_types":750,"./attributes":616,"./calc":617,"./compute_error":618,"./defaults":619,"./plot":621,"./style":622}],621:[function(t,e,r){var n=t("d3"),a=t("fast-isnumeric"),i=t("../drawing"),o=t("../../traces/scatter/subtypes");e.exports=function(t,e,r,s){var l=r.xaxis,u=r.yaxis,c=s&&s.duration>0;e.each((function(e){var h,d=e[0].trace,f=d.error_x||{},p=d.error_y||{};d.ids&&(h=function(t){return t.id});var m=o.hasMarkers(d)&&d.marker.maxdisplayed>0;p.visible||f.visible||(e=[]);var g=n.select(this).selectAll("g.errorbar").data(e,h);if(g.exit().remove(),e.length){f.visible||g.selectAll("path.xerror").remove(),p.visible||g.selectAll("path.yerror").remove(),g.style("opacity",1);var y=g.enter().append("g").classed("errorbar",!0);c&&y.style("opacity",0).transition().duration(s.duration).style("opacity",1),i.setClipUrl(g,r.layerClipId,t),g.each((function(t){var e=n.select(this),r=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};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}(t,l,u);if(!m||t.vis){var i,o=e.select("path.yerror");if(p.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var h=p.width;i="M"+(r.x-h)+","+r.yh+"h"+2*h+"m-"+h+",0V"+r.ys,r.noYS||(i+="m-"+h+",0h"+2*h),o.size()?c&&(o=o.transition().duration(s.duration).ease(s.easing)):o=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0),o.attr("d",i)}else o.remove();var d=e.select("path.xerror");if(f.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var g=(f.copy_ystyle?p:f).width;i="M"+r.xh+","+(r.y-g)+"v"+2*g+"m0,-"+g+"H"+r.xs,r.noXS||(i+="m0,-"+g+"v"+2*g),d.size()?c&&(d=d.transition().duration(s.duration).ease(s.easing)):d=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0),d.attr("d",i)}else d.remove()}}))}}))}},{"../../traces/scatter/subtypes":1135,"../drawing":614,d3:163,"fast-isnumeric":225}],622:[function(t,e,r){var n=t("d3"),a=t("../color");e.exports=function(t){t.each((function(t){var e=t[0].trace,r=e.error_y||{},i=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":593,d3:163}],623:[function(t,e,r){var n=t("../../plots/font_attributes"),a=t("./layout_attributes").hoverlabel,i=t("../../lib/extend").extendFlat;e.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":710,"../../plots/font_attributes":793,"./layout_attributes":633}],624:[function(t,e,r){var n=t("../../lib"),a=t("../../registry");function i(t,e,r,a){a=a||n.identity,Array.isArray(t)&&(e[0][r]=a(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s<e.length;s++){var l=e[s],u=l[0].trace;if(!a.traceIs(u,"pie-like")){var c=a.traceIs(u,"2dMap")?i:n.fillArray;c(u.hoverinfo,l,"hi",o(u)),u.hovertemplate&&c(u.hovertemplate,l,"ht"),u.hoverlabel&&(c(u.hoverlabel.bgcolor,l,"hbg"),c(u.hoverlabel.bordercolor,l,"hbc"),c(u.hoverlabel.font.size,l,"hts"),c(u.hoverlabel.font.color,l,"htc"),c(u.hoverlabel.font.family,l,"htf"),c(u.hoverlabel.namelength,l,"hnl"),c(u.hoverlabel.align,l,"hta"))}}}},{"../../lib":719,"../../registry":847}],625:[function(t,e,r){var n=t("../../registry"),a=t("./hover").hover;e.exports=function(t,e,r){var i=n.getComponentMethod("annotations","onClick")(t,t._hoverdata);function o(){t.emit("plotly_click",{points:t._hoverdata,event:e})}void 0!==r&&a(t,e,r,!0),t._hoverdata&&e&&e.target&&(i&&i.then?i.then(o):o(),e.stopImmediatePropagation&&e.stopImmediatePropagation())}},{"../../registry":847,"./hover":629}],626:[function(t,e,r){e.exports={YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,HOVERID:"-hover"}},{}],627:[function(t,e,r){var n=t("../../lib"),a=t("./attributes"),i=t("./hoverlabel_defaults");e.exports=function(t,e,r,o){var s=n.extendFlat({},o.hoverlabel);e.hovertemplate&&(s.namelength=-1),i(t,e,(function(r,i){return n.coerce(t,e,a,r,i)}),s)}},{"../../lib":719,"./attributes":623,"./hoverlabel_defaults":630}],628:[function(t,e,r){var n=t("../../lib");r.getSubplot=function(t){return t.subplot||t.xaxis+t.yaxis||t.geo},r.isTraceInSubplots=function(t,e){if("splom"===t.type){for(var n=t.xaxes||[],a=t.yaxes||[],i=0;i<n.length;i++)for(var o=0;o<a.length;o++)if(-1!==e.indexOf(n[i]+a[o]))return!0;return!1}return-1!==e.indexOf(r.getSubplot(t))},r.flat=function(t,e){for(var r=new Array(t.length),n=0;n<t.length;n++)r[n]=e;return r},r.p2c=function(t,e){for(var r=new Array(t.length),n=0;n<t.length;n++)r[n]=t[n].p2c(e);return r},r.getDistanceFunction=function(t,e,n,a){return"closest"===t?a||r.quadrature(e,n):"x"===t?e:n},r.getClosest=function(t,e,r){if(!1!==r.index)r.index>=0&&r.index<t.length?r.distance=0:r.index=!1;else for(var n=0;n<t.length;n++){var a=e(t[n]);a<=r.distance&&(r.index=n,r.distance=a)}return r},r.inbox=function(t,e,r){return t*e<0||0===t?r:1/0},r.quadrature=function(t,e){return function(r){var n=t(r),a=e(r);return Math.sqrt(n*n+a*a)}},r.makeEventData=function(t,e,n){var a="index"in t?t.index:t.pointNumber,i={data:e._input,fullData:e,curveNumber:e.index,pointNumber:a};if(e._indexToPoints){var o=e._indexToPoints[a];1===o.length?i.pointIndex=o[0]:i.pointIndices=o}else i.pointIndex=a;return e._module.eventData?i=e._module.eventData(i,t,e,n,a):("xVal"in t?i.x=t.xVal:"x"in t&&(i.x=t.x),"yVal"in t?i.y=t.yVal:"y"in t&&(i.y=t.y),t.xa&&(i.xaxis=t.xa),t.ya&&(i.yaxis=t.ya),void 0!==t.zLabelVal&&(i.z=t.zLabelVal)),r.appendArrayPointValue(i,e,a),i},r.appendArrayPointValue=function(t,e,r){var a=e._arrayAttrs;if(a)for(var s=0;s<a.length;s++){var l=a[s],u=i(l);if(void 0===t[u]){var c=o(n.nestedProperty(e,l).get(),r);void 0!==c&&(t[u]=c)}}},r.appendArrayMultiPointValues=function(t,e,r){var a=e._arrayAttrs;if(a)for(var s=0;s<a.length;s++){var l=a[s],u=i(l);if(void 0===t[u]){for(var c=n.nestedProperty(e,l).get(),h=new Array(r.length),d=0;d<r.length;d++)h[d]=o(c,r[d]);t[u]=h}}};var a={ids:"id",locations:"location",labels:"label",values:"value","marker.colors":"color",parents:"parent"};function i(t){return a[t]||t}function o(t,e){return Array.isArray(e)?Array.isArray(t)&&Array.isArray(t[e[0]])?t[e[0]][e[1]]:void 0:t[e]}},{"../../lib":719}],629:[function(t,e,r){var n=t("d3"),a=t("fast-isnumeric"),i=t("tinycolor2"),o=t("../../lib"),s=t("../../lib/events"),l=t("../../lib/svg_text_utils"),u=t("../../lib/override_cursor"),c=t("../drawing"),h=t("../color"),d=t("../dragelement"),f=t("../../plots/cartesian/axes"),p=t("../../registry"),m=t("./helpers"),g=t("./constants"),y=g.YANGLE,v=Math.PI*y/180,_=1/Math.sin(v),x=Math.cos(v),b=Math.sin(v),w=g.HOVERARROWSIZE,M=g.HOVERTEXTPAD;r.hover=function(t,e,r,i){t=o.getGraphDiv(t),o.throttle(t._fullLayout._uid+g.HOVERID,g.HOVERMINTIME,(function(){!function(t,e,r,i){r||(r="xy");var l=Array.isArray(r)?r:[r],c=t._fullLayout,g=c._plots||[],y=g[r],v=c._has("cartesian");if(y){var x=y.overlays.map((function(t){return t.id}));l=l.concat(x)}for(var b=l.length,w=new Array(b),M=new Array(b),k=!1,C=0;C<b;C++){var D=l[C],P=g[D];if(P)k=!0,w[C]=f.getFromId(t,P.xaxis._id),M[C]=f.getFromId(t,P.yaxis._id);else{var O=c[D]._subplot;w[C]=O.xaxis,M[C]=O.yaxis}}var z=e.hovermode||c.hovermode;if(z&&!k&&(z="closest"),-1===["x","y","closest"].indexOf(z)||!t.calcdata||t.querySelector(".zoombox")||t._dragging)return d.unhoverRaw(t,e);var I,R,F,N,Y,j,B,H,U,V,W,G,q,Z=-1===c.hoverdistance?1/0:c.hoverdistance,X=-1===c.spikedistance?1/0:c.spikedistance,J=[],K=[],$={hLinePoint:null,vLinePoint:null},Q=!1;if(Array.isArray(e))for(z="array",F=0;F<e.length;F++)(Y=t.calcdata[e[F].curveNumber||0])&&(j=Y[0].trace,"skip"!==Y[0].trace.hoverinfo&&(K.push(Y),"h"===j.orientation&&(Q=!0)));else{for(N=0;N<t.calcdata.length;N++)"skip"!==(j=(Y=t.calcdata[N])[0].trace).hoverinfo&&m.isTraceInSubplots(j,l)&&(K.push(Y),"h"===j.orientation&&(Q=!0));var tt,et;if(e.target){if(!1===s.triggerHandler(t,"plotly_beforehover",e))return;var rt=e.target.getBoundingClientRect();if(tt=e.clientX-rt.left,et=e.clientY-rt.top,tt<0||tt>w[0]._length||et<0||et>M[0]._length)return d.unhoverRaw(t,e)}else tt="xpx"in e?e.xpx:w[0]._length/2,et="ypx"in e?e.ypx:M[0]._length/2;if(e.pointerX=tt+w[0]._offset,e.pointerY=et+M[0]._offset,I="xval"in e?m.flat(l,e.xval):m.p2c(w,tt),R="yval"in e?m.flat(l,e.yval):m.p2c(M,et),!a(I[0])||!a(R[0]))return o.warn("Fx.hover failed",e,t),d.unhoverRaw(t,e)}var nt=1/0;for(N=0;N<K.length;N++)if((Y=K[N])&&Y[0]&&Y[0].trace&&!0===(j=Y[0].trace).visible&&0!==j._length&&-1===["carpet","contourcarpet"].indexOf(j._module.name)){if("splom"===j.type?B=l[H=0]:(B=m.getSubplot(j),H=l.indexOf(B)),U=z,G={cd:Y,trace:j,xa:w[H],ya:M[H],maxHoverDistance:Z,maxSpikeDistance:X,index:!1,distance:Math.min(nt,Z),spikeDistance:1/0,xSpike:void 0,ySpike:void 0,color:h.defaultLine,name:j.name,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},c[B]&&(G.subplot=c[B]._subplot),c._splomScenes&&c._splomScenes[j.uid]&&(G.scene=c._splomScenes[j.uid]),q=J.length,"array"===U){var at=e[N];"pointNumber"in at?(G.index=at.pointNumber,U="closest"):(U="","xval"in at&&(V=at.xval,U="x"),"yval"in at&&(W=at.yval,U=U?"closest":"y"))}else V=I[H],W=R[H];if(0!==Z)if(j._module&&j._module.hoverPoints){var it=j._module.hoverPoints(G,V,W,U,c._hoverlayer);if(it)for(var ot,st=0;st<it.length;st++)ot=it[st],a(ot.x0)&&a(ot.y0)&&J.push(A(ot,z))}else o.log("Unrecognized trace type in hover:",j);if("closest"===z&&J.length>q&&(J.splice(0,q),nt=J[0].distance),v&&0!==X&&0===J.length){G.distance=X,G.index=!1;var lt=j._module.hoverPoints(G,V,W,"closest",c._hoverlayer);if(lt&&(lt=lt.filter((function(t){return t.spikeDistance<=X}))),lt&&lt.length){var ut,ct=lt.filter((function(t){return t.xa.showspikes}));if(ct.length){var ht=ct[0];a(ht.x0)&&a(ht.y0)&&(ut=mt(ht),(!$.vLinePoint||$.vLinePoint.spikeDistance>ut.spikeDistance)&&($.vLinePoint=ut))}var dt=lt.filter((function(t){return t.ya.showspikes}));if(dt.length){var ft=dt[0];a(ft.x0)&&a(ft.y0)&&(ut=mt(ft),(!$.hLinePoint||$.hLinePoint.spikeDistance>ut.spikeDistance)&&($.hLinePoint=ut))}}}}function pt(t,e){for(var r,n=null,a=1/0,i=0;i<t.length;i++)(r=t[i].spikeDistance)<a&&r<=e&&(n=t[i],a=r);return n}function mt(t){return t?{xa:t.xa,ya:t.ya,x:void 0!==t.xSpike?t.xSpike:(t.x0+t.x1)/2,y:void 0!==t.ySpike?t.ySpike:(t.y0+t.y1)/2,distance:t.distance,spikeDistance:t.spikeDistance,curveNumber:t.trace.index,color:t.color,pointNumber:t.index}:null}var gt={fullLayout:c,container:c._hoverlayer,outerContainer:c._paperdiv,event:e},yt=t._spikepoints,vt={vLinePoint:$.vLinePoint,hLinePoint:$.hLinePoint};if(t._spikepoints=vt,v&&0!==X&&0!==J.length){var _t=J.filter((function(t){return t.ya.showspikes})),xt=pt(_t,X);$.hLinePoint=mt(xt);var bt=J.filter((function(t){return t.xa.showspikes})),wt=pt(bt,X);$.vLinePoint=mt(wt)}if(0===J.length){var Mt=d.unhoverRaw(t,e);return!v||null===$.hLinePoint&&null===$.vLinePoint||E(yt)&&S($,gt),Mt}v&&E(yt)&&S($,gt),J.sort((function(t,e){return t.distance-e.distance}));var kt=t._hoverdata,Tt=[];for(F=0;F<J.length;F++){var Lt=J[F],At=m.makeEventData(Lt,Lt.trace,Lt.cd);if(!1!==Lt.hovertemplate){var St=!1;Lt.cd[Lt.index]&&Lt.cd[Lt.index].ht&&(St=Lt.cd[Lt.index].ht),Lt.hovertemplate=St||Lt.trace.hovertemplate||!1}Lt.eventData=[At],Tt.push(At)}t._hoverdata=Tt;var Et="y"===z&&(K.length>1||J.length>1)||"closest"===z&&Q&&J.length>1,Ct=T(J,{hovermode:z,rotateLabels:Et,bgColor:h.combine(c.plot_bgcolor||h.background,c.paper_bgcolor),container:c._hoverlayer,outerContainer:c._paperdiv,commonLabelOpts:c.hoverlabel,hoverdistance:c.hoverdistance},t);if(function(t,e,r){var n,a,i,o,s,l,u,c=0,h=1,d=t.size(),f=new Array(d),p=0;function m(t){var e=t[0],r=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,i=r.pos+r.dp+r.size-e.pmax,a>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=i;n=!1}if(n){var u=0;for(o=0;o<t.length;o++)(l=t[o]).pos+l.dp+l.size>e.pmax&&u++;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,u--);for(o=0;o<t.length&&!(u<=0);o++)if((l=t[o]).pos<e.pmin+1)for(l.del=!0,u--,i=2*l.size,s=t.length-1;s>=0;s--)t[s].dp-=i;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,u--)}}}for(t.each((function(t){var n=t[e],a="x"===n._id.charAt(0),i=n.range;0===p&&i&&i[0]>i[1]!==a&&(h=-1),f[p++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(a?_:1)/2,pmin:0,pmax:a?r.width:r.height}]})),f.sort((function(t,e){return t[0].posref-e[0].posref||h*(e[0].traceIndex-t[0].traceIndex)}));!n&&c<=d;){for(c++,n=!0,o=0;o<f.length-1;){var g=f[o],y=f[o+1],v=g[g.length-1],x=y[0];if((a=v.pos+v.dp+v.size-x.pos-x.dp+x.size)>.01&&v.pmin===x.pmin&&v.pmax===x.pmax){for(s=y.length-1;s>=0;s--)y[s].dp+=a;for(g.push.apply(g,y),f.splice(o+1,1),u=0,s=g.length-1;s>=0;s--)u+=g[s].dp;for(i=u/g.length,s=g.length-1;s>=0;s--)g[s].dp-=i;n=!1}else o++}f.forEach(m)}for(o=f.length-1;o>=0;o--){var b=f[o];for(s=b.length-1;s>=0;s--){var w=b[s],M=w.datum;M.offset=w.dp,M.del=w.del}}}(Ct,Et?"xa":"ya",c),L(Ct,Et),e.target&&e.target.tagName){var Dt=p.getComponentMethod("annotations","hasClickToShow")(t,Tt);u(n.select(e.target),Dt?"pointer":"")}e.target&&!i&&function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=t._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(t,0,kt)&&(kt&&t.emit("plotly_unhover",{event:e,points:kt}),t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:w,yaxes:M,xvals:I,yvals:R}))}(t,e,r,i)}))},r.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var a=t.map((function(t){return{color:t.color||h.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,eventData:t.eventData||!1,hovertemplateLabels:t.hovertemplateLabels||!1}})),i=n.select(e.container),o=e.outerContainer?n.select(e.outerContainer):i,s={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||h.background,container:i,outerContainer:o},l=T(a,s,e.gd),u=0,c=0;return l.sort((function(t,e){return t.y0-e.y0})).each((function(t,r){var n=t.y0-t.by/2;t.offset=n-5<u?u-n+5:0,u=n+t.by+t.offset,r===e.anchorIndex&&(c=t.offset)})).each((function(t){t.offset-=c})),L(l,s.rotateLabels),r?l:l.node()};var k=/<extra>([\s\S]*)<\/extra>/;function T(t,e,r){var a=r._fullLayout,i=e.hovermode,s=e.rotateLabels,u=e.bgColor,d=e.container,f=e.outerContainer,p=e.commonLabelOpts||{},m=e.fontFamily||g.HOVERFONT,v=e.fontSize||g.HOVERFONTSIZE,_=t[0],x=_.xa,b=_.ya,T="y"===i?"yLabel":"xLabel",L=_[T],A=(String(L)||"").split(" ")[0],S=f.node().getBoundingClientRect(),E=S.top,D=S.width,P=S.height,O=void 0!==L&&_.distance<=e.hoverdistance&&("x"===i||"y"===i);if(O){var z,I,R=!0;for(z=0;z<t.length;z++)if(R&&void 0===t[z].zLabel&&(R=!1),I=t[z].hoverinfo||t[z].trace.hoverinfo){var F=Array.isArray(I)?I:I.split("+");if(-1===F.indexOf("all")&&-1===F.indexOf(i)){O=!1;break}}R&&(O=!1)}var N=d.selectAll("g.axistext").data(O?[0]:[]);N.enter().append("g").classed("axistext",!0),N.exit().remove(),N.each((function(){var e=n.select(this),a=o.ensureSingle(e,"path","",(function(t){t.style({"stroke-width":"1px"})})),s=o.ensureSingle(e,"text","",(function(t){t.attr("data-notex",1)})),u=p.bgcolor||h.defaultLine,d=p.bordercolor||h.contrast(u),f=h.contrast(u);a.style({fill:u,stroke:d}),s.text(L).call(c.font,p.font.family||m,p.font.size||v,p.font.color||f).call(l.positionText,0,0).call(l.convertToTspans,r),e.attr("transform","");var g=s.node().getBoundingClientRect();if("x"===i){s.attr("text-anchor","middle").call(l.positionText,0,"top"===x.side?E-g.bottom-w-M:E-g.top+w+M);var y="top"===x.side?"-":"";a.attr("d","M0,0L"+w+","+y+w+"H"+(M+g.width/2)+"v"+y+(2*M+g.height)+"H-"+(M+g.width/2)+"V"+y+w+"H-"+w+"Z"),e.attr("transform","translate("+(x._offset+(_.x0+_.x1)/2)+","+(b._offset+("top"===x.side?0:b._length))+")")}else{s.attr("text-anchor","right"===b.side?"start":"end").call(l.positionText,("right"===b.side?1:-1)*(M+w),E-g.top-g.height/2);var k="right"===b.side?"":"-";a.attr("d","M0,0L"+k+w+","+w+"V"+(M+g.height/2)+"h"+k+(2*M+g.width)+"V-"+(M+g.height/2)+"H"+k+w+"V-"+w+"Z"),e.attr("transform","translate("+(x._offset+("right"===b.side?x._length:0))+","+(b._offset+(_.y0+_.y1)/2)+")")}t=t.filter((function(t){return void 0!==t.zLabelVal||(t[T]||"").split(" ")[0]===A}))}));var Y=d.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 Y.enter().append("g").classed("hovertext",!0).each((function(){var t=n.select(this);t.append("rect").call(h.fill,h.addOpacity(u,.8)),t.append("text").classed("name",!0),t.append("path").style("stroke-width","1px"),t.append("text").classed("nums",!0).call(c.font,m,v)})),Y.exit().remove(),Y.each((function(t){var e=n.select(this).attr("transform",""),d="",f="",p=t.bgcolor||t.color,g=h.combine(h.opacity(p)?p:h.defaultLine,u),_=h.combine(h.opacity(t.color)?t.color:h.defaultLine,u),x=t.borderColor||h.contrast(g);void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),d=C(t.name,t.nameLength)),void 0!==t.zLabel?(void 0!==t.xLabel&&(f+="x: "+t.xLabel+"<br>"),void 0!==t.yLabel&&(f+="y: "+t.yLabel+"<br>"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(f+=(f?"z: ":"")+t.zLabel)):O&&t[i+"Label"]===L?f=t[("x"===i?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(f=t.yLabel):f=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(f+=(f?"<br>":"")+t.text),void 0!==t.extraText&&(f+=(f?"<br>":"")+t.extraText),""!==f||t.hovertemplate||(""===d&&e.remove(),f=d);var b=a._d3locale,T=t.hovertemplate||!1,A=t.hovertemplateLabels||t,S=t.eventData[0]||{};T&&(f=(f=o.hovertemplateString(T,A,b,S,t.trace._meta)).replace(k,(function(e,r){return d=C(r,t.nameLength),""})));var z=e.select("text.nums").call(c.font,t.fontFamily||m,t.fontSize||v,t.fontColor||x).text(f).attr("data-notex",1).call(l.positionText,0,0).call(l.convertToTspans,r),I=e.select("text.name"),R=0,F=0;if(d&&d!==f){I.call(c.font,t.fontFamily||m,t.fontSize||v,_).text(d).attr("data-notex",1).call(l.positionText,0,0).call(l.convertToTspans,r);var N=I.node().getBoundingClientRect();R=N.width+2*M,F=N.height+2*M}else I.remove(),e.select("rect").remove();e.select("path").style({fill:g,stroke:x});var Y,j,B=z.node().getBoundingClientRect(),H=t.xa._offset+(t.x0+t.x1)/2,U=t.ya._offset+(t.y0+t.y1)/2,V=Math.abs(t.x1-t.x0),W=Math.abs(t.y1-t.y0),G=B.width+w+M+R;if(t.ty0=E-B.top,t.bx=B.width+2*M,t.by=Math.max(B.height+2*M,F),t.anchor="start",t.txwidth=B.width,t.tx2width=R,t.offset=0,s)t.pos=H,Y=U+W/2+G<=P,j=U-W/2-G>=0,"top"!==t.idealAlign&&Y||!j?Y?(U+=W/2,t.anchor="start"):t.anchor="middle":(U-=W/2,t.anchor="end");else if(t.pos=U,Y=H+V/2+G<=D,j=H-V/2-G>=0,"left"!==t.idealAlign&&Y||!j)if(Y)H+=V/2,t.anchor="start";else{t.anchor="middle";var q=G/2,Z=H+q-D,X=H-q;Z>0&&(H-=Z),X<0&&(H+=-X)}else H-=V/2,t.anchor="end";z.attr("text-anchor",t.anchor),R&&I.attr("text-anchor",t.anchor),e.attr("transform","translate("+H+","+U+")"+(s?"rotate("+y+")":""))})),Y}function L(t,e){t.each((function(t){var r=n.select(this);if(t.del)return r.remove();var a=r.select("text.nums"),i=t.anchor,o="end"===i?-1:1,s={start:1,end:-1,middle:0}[i],u=s*(w+M),h=u+s*(t.txwidth+M),d=0,f=t.offset;"middle"===i&&(u-=t.tx2width/2,h+=t.txwidth/2+M),e&&(f*=-b,d=t.offset*x),r.select("path").attr("d","middle"===i?"M-"+(t.bx/2+t.tx2width/2)+","+(f-t.by/2)+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(o*w+d)+","+(w+f)+"v"+(t.by/2-w)+"h"+o*t.bx+"v-"+t.by+"H"+(o*w+d)+"V"+(f-w)+"Z");var p=u+d,m=f+t.ty0-t.by/2+M,g=t.textAlign||"auto";"auto"!==g&&("left"===g&&"start"!==i?(a.attr("text-anchor","start"),p="middle"===i?-t.bx/2-t.tx2width/2+M:-t.bx-M):"right"===g&&"end"!==i&&(a.attr("text-anchor","end"),p="middle"===i?t.bx/2-t.tx2width/2-M:t.bx+M)),a.call(l.positionText,p,m),t.tx2width&&(r.select("text.name").call(l.positionText,h+s*M+d,f+t.ty0-t.by/2+M),r.select("rect").call(c.setRect,h+(s-1)*t.tx2width/2+d,f-t.by/2-1,t.tx2width,t.by+2))}))}function A(t,e){var r=t.index,n=t.trace||{},i=t.cd[0],s=t.cd[r]||{};function l(t){return t||a(t)&&0===t}var u=Array.isArray(r)?function(t,e){var a=o.castOption(i,r,t);return l(a)?a:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(s,n,t,e)};function c(e,r,n){var a=u(r,n);l(a)&&(t[e]=a)}if(c("hoverinfo","hi","hoverinfo"),c("bgcolor","hbg","hoverlabel.bgcolor"),c("borderColor","hbc","hoverlabel.bordercolor"),c("fontFamily","htf","hoverlabel.font.family"),c("fontSize","hts","hoverlabel.font.size"),c("fontColor","htc","hoverlabel.font.color"),c("nameLength","hnl","hoverlabel.namelength"),c("textAlign","hta","hoverlabel.align"),t.posref="y"===e||"closest"===e&&"h"===n.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=o.constrain(t.x0,0,t.xa._length),t.x1=o.constrain(t.x1,0,t.xa._length),t.y0=o.constrain(t.y0,0,t.ya._length),t.y1=o.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:f.hoverLabelText(t.xa,t.xLabelVal),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:f.hoverLabelText(t.ya,t.yLabelVal),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var h=f.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+h+" / -"+f.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" ± "+h,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var d=f.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+d+" / -"+f.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" ± "+d,"y"===e&&(t.distance+=1)}var p=t.hoverinfo||t.trace.hoverinfo;return p&&"all"!==p&&(-1===(p=Array.isArray(p)?p:p.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===p.indexOf("y")&&(t.yLabel=void 0),-1===p.indexOf("z")&&(t.zLabel=void 0),-1===p.indexOf("text")&&(t.text=void 0),-1===p.indexOf("name")&&(t.name=void 0)),t}function S(t,e){var r,n,a=e.container,o=e.fullLayout,s=e.event,l=!!t.hLinePoint,u=!!t.vLinePoint;if(a.selectAll(".spikeline").remove(),u||l){var d=h.combine(o.plot_bgcolor,o.paper_bgcolor);if(l){var f,p,m=t.hLinePoint;r=m&&m.xa,"cursor"===(n=m&&m.ya).spikesnap?(f=s.pointerX,p=s.pointerY):(f=r._offset+m.x,p=n._offset+m.y);var g,y,v=i.readability(m.color,d)<1.5?h.contrast(d):m.color,_=n.spikemode,x=n.spikethickness,b=n.spikecolor||v,w=n._boundingBox,M=(w.left+w.right)/2<f?w.right:w.left;-1===_.indexOf("toaxis")&&-1===_.indexOf("across")||(-1!==_.indexOf("toaxis")&&(g=M,y=f),-1!==_.indexOf("across")&&(g=n._counterSpan[0],y=n._counterSpan[1]),a.insert("line",":first-child").attr({x1:g,x2:y,y1:p,y2:p,"stroke-width":x,stroke:b,"stroke-dasharray":c.dashStyle(n.spikedash,x)}).classed("spikeline",!0).classed("crisp",!0),a.insert("line",":first-child").attr({x1:g,x2:y,y1:p,y2:p,"stroke-width":x+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)),-1!==_.indexOf("marker")&&a.insert("circle",":first-child").attr({cx:M+("right"!==n.side?x:-x),cy:p,r:x,fill:b}).classed("spikeline",!0)}if(u){var k,T,L=t.vLinePoint;r=L&&L.xa,n=L&&L.ya,"cursor"===r.spikesnap?(k=s.pointerX,T=s.pointerY):(k=r._offset+L.x,T=n._offset+L.y);var A,S,E=i.readability(L.color,d)<1.5?h.contrast(d):L.color,C=r.spikemode,D=r.spikethickness,P=r.spikecolor||E,O=r._boundingBox,z=(O.top+O.bottom)/2<T?O.bottom:O.top;-1===C.indexOf("toaxis")&&-1===C.indexOf("across")||(-1!==C.indexOf("toaxis")&&(A=z,S=T),-1!==C.indexOf("across")&&(A=r._counterSpan[0],S=r._counterSpan[1]),a.insert("line",":first-child").attr({x1:k,x2:k,y1:A,y2:S,"stroke-width":D,stroke:P,"stroke-dasharray":c.dashStyle(r.spikedash,D)}).classed("spikeline",!0).classed("crisp",!0),a.insert("line",":first-child").attr({x1:k,x2:k,y1:A,y2:S,"stroke-width":D+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)),-1!==C.indexOf("marker")&&a.insert("circle",":first-child").attr({cx:k,cy:z-("top"!==r.side?D:-D),r:D,fill:P}).classed("spikeline",!0)}}}function E(t,e){return!e||e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint}function C(t,e){return l.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}},{"../../lib":719,"../../lib/events":709,"../../lib/override_cursor":730,"../../lib/svg_text_utils":743,"../../plots/cartesian/axes":767,"../../registry":847,"../color":593,"../dragelement":611,"../drawing":614,"./constants":626,"./helpers":628,d3:163,"fast-isnumeric":225,tinycolor2:537}],630:[function(t,e,r){var n=t("../../lib");e.exports=function(t,e,r,a){r("hoverlabel.bgcolor",(a=a||{}).bgcolor),r("hoverlabel.bordercolor",a.bordercolor),r("hoverlabel.namelength",a.namelength),n.coerceFont(r,"hoverlabel.font",a.font),r("hoverlabel.align",a.align)}},{"../../lib":719}],631:[function(t,e,r){t("../../constants/docs").FORMAT_LINK,e.exports=function(t,e){t=t||{},(e=e||{}).description&&e.description;var r=e.keys||[];if(r.length>0){for(var n=[],a=0;a<r.length;a++)n[a]="`"+r[a]+"`";1===r.length?n[0]:(n.slice(0,-1).join(", "),n.slice(-1))}var i={valType:"string",dflt:"",editType:t.editType||"none"};return!1!==t.arrayOk&&(i.arrayOk=!0),i}},{"../../constants/docs":690}],632:[function(t,e,r){var n=t("d3"),a=t("../../lib"),i=t("../dragelement"),o=t("./helpers"),s=t("./layout_attributes"),l=t("./hover");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:s},attributes:t("./attributes"),layoutAttributes:s,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(t,e,r){return a.castOption(t,e,"hoverlabel."+r)},castHoverinfo:function(t,e,r){return a.castOption(t,r,"hoverinfo",(function(r){return a.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)}))},hover:l.hover,unhover:i.unhover,loneHover:l.loneHover,loneUnhover:function(t){var e=a.isD3Selection(t)?t:n.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:t("./click")}},{"../../lib":719,"../dragelement":611,"./attributes":623,"./calc":624,"./click":625,"./constants":626,"./defaults":627,"./helpers":628,"./hover":629,"./layout_attributes":633,"./layout_defaults":634,"./layout_global_defaults":635,d3:163}],633:[function(t,e,r){var n=t("./constants"),a=t("../../plots/font_attributes")({editType:"none"});a.family.dflt=n.HOVERFONT,a.size.dflt=n.HOVERFONTSIZE,e.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1],editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:20,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}},{"../../plots/font_attributes":793,"./constants":626}],634:[function(t,e,r){var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r){function i(r,i){return n.coerce(t,e,a,r,i)}var o,s=i("clickmode");"select"===i("dragmode")&&i("selectdirection"),e._has("cartesian")?s.indexOf("select")>-1?o="closest":(e._isHoriz=function(t,e){for(var r=e._scatterStackOpts||{},n=0;n<t.length;n++){var a=t[n],i=(r[a.xaxis+a.yaxis]||{})[a.stackgroup]||{};if("h"!==a.orientation&&"h"!==i.orientation)return!1}return!0}(r,e),o=e._isHoriz?"y":"x"):o="closest",i("hovermode",o)&&(i("hoverdistance"),i("spikedistance"));var l=e._has("mapbox"),u=e._has("geo"),c=e._basePlotModules.length;"zoom"===e.dragmode&&((l||u)&&1===c||l&&u&&2===c)&&(e.dragmode="pan")}},{"../../lib":719,"./layout_attributes":633}],635:[function(t,e,r){var n=t("../../lib"),a=t("./hoverlabel_defaults"),i=t("./layout_attributes");e.exports=function(t,e){a(t,e,(function(r,a){return n.coerce(t,e,i,r,a)}))}},{"../../lib":719,"./hoverlabel_defaults":630,"./layout_attributes":633}],636:[function(t,e,r){var n=t("../../lib"),a=t("../../lib/regex").counter,i=t("../../plots/domain").attributes,o=t("../../plots/cartesian/constants").idRegex,s=t("../../plot_api/plot_template"),l={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[a("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:i({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function u(t,e,r){var n=e[r+"axes"],a=Object.keys((t._splomAxes||{})[r]||{});return Array.isArray(n)?n:a.length?a:void 0}function c(t,e,r,n,a,i){var o=e(t+"gap",r),s=e("domain."+t);e(t+"side",n);for(var l=new Array(a),u=s[0],c=(s[1]-u)/(a-o),h=c*(1-o),d=0;d<a;d++){var f=u+c*d;l[i?a-1-d:d]=[f,f+h]}return l}function h(t,e,r,n,a){var i,o=new Array(r);function s(t,r){-1!==e.indexOf(r)&&void 0===n[r]?(o[t]=r,n[r]=t):o[t]=""}if(Array.isArray(t))for(i=0;i<r;i++)s(i,t[i]);else for(s(0,a),i=1;i<r;i++)s(i,a+(i+1));return o}e.exports={moduleType:"component",name:"grid",schema:{layout:{grid:l}},layoutAttributes:l,sizeDefaults:function(t,e){var r=t.grid||{},a=u(e,r,"x"),i=u(e,r,"y");if(t.grid||a||i){var o,h,d=Array.isArray(r.subplots)&&Array.isArray(r.subplots[0]),f=Array.isArray(a),p=Array.isArray(i),m=f&&a!==r.xaxes&&p&&i!==r.yaxes;d?(o=r.subplots.length,h=r.subplots[0].length):(p&&(o=i.length),f&&(h=a.length));var g=s.newContainer(e,"grid"),y=k("rows",o),v=k("columns",h);if(y*v>1){d||f||p||"independent"===k("pattern")&&(d=!0),g._hasSubplotGrid=d;var _,x,b="top to bottom"===k("roworder"),w=d?.2:.1,M=d?.3:.1;m&&e._splomGridDflt&&(_=e._splomGridDflt.xside,x=e._splomGridDflt.yside),g._domains={x:c("x",k,w,_,v),y:c("y",k,M,x,y,b)}}else delete e.grid}function k(t,e){return n.coerce(r,g,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,a,i,o,s,l,c,d=t.grid||{},f=e._subplots,p=r._hasSubplotGrid,m=r.rows,g=r.columns,y="independent"===r.pattern,v=r._axisMap={};if(p){var _=d.subplots||[];l=r.subplots=new Array(m);var x=1;for(n=0;n<m;n++){var b=l[n]=new Array(g),w=_[n]||[];for(a=0;a<g;a++)if(y?(s=1===x?"xy":"x"+x+"y"+x,x++):s=w[a],b[a]="",-1!==f.cartesian.indexOf(s)){if(c=s.indexOf("y"),i=s.slice(0,c),o=s.slice(c),void 0!==v[i]&&v[i]!==a||void 0!==v[o]&&v[o]!==n)continue;b[a]=s,v[i]=a,v[o]=n}}}else{var M=u(e,d,"x"),k=u(e,d,"y");r.xaxes=h(M,f.xaxis,g,v,"x"),r.yaxes=h(k,f.yaxis,m,v,"y")}var T=r._anchors={},L="top to bottom"===r.roworder;for(var A in v){var S,E,C,D=A.charAt(0),P=r[D+"side"];if(P.length<8)T[A]="free";else if("x"===D){if("t"===P.charAt(0)===L?(S=0,E=1,C=m):(S=m-1,E=-1,C=-1),p){var O=v[A];for(n=S;n!==C;n+=E)if((s=l[n][O])&&(c=s.indexOf("y"),s.slice(0,c)===A)){T[A]=s.slice(c);break}}else for(n=S;n!==C;n+=E)if(o=r.yaxes[n],-1!==f.cartesian.indexOf(A+o)){T[A]=o;break}}else if("l"===P.charAt(0)?(S=0,E=1,C=g):(S=g-1,E=-1,C=-1),p){var z=v[A];for(n=S;n!==C;n+=E)if((s=l[z][n])&&(c=s.indexOf("y"),s.slice(c)===A)){T[A]=s.slice(0,c);break}}else for(n=S;n!==C;n+=E)if(i=r.xaxes[n],-1!==f.cartesian.indexOf(i+A)){T[A]=i;break}}}}}},{"../../lib":719,"../../lib/regex":735,"../../plot_api/plot_template":757,"../../plots/cartesian/constants":773,"../../plots/domain":792}],637:[function(t,e,r){var n=t("../../plots/cartesian/constants"),a=t("../../plot_api/plot_template").templatedArray;e.exports=a("image",{visible:{valType:"boolean",dflt:!0,editType:"arraydraw"},source:{valType:"string",editType:"arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},sizex:{valType:"number",dflt:0,editType:"arraydraw"},sizey:{valType:"number",dflt:0,editType:"arraydraw"},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},x:{valType:"any",dflt:0,editType:"arraydraw"},y:{valType:"any",dflt:0,editType:"arraydraw"},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",editType:"arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top",editType:"arraydraw"},xref:{valType:"enumerated",values:["paper",n.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",n.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"})},{"../../plot_api/plot_template":757,"../../plots/cartesian/constants":773}],638:[function(t,e,r){var n=t("fast-isnumeric"),a=t("../../lib/to_log_range");e.exports=function(t,e,r,i){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),d=0;d<c.length;d++)if(u="images["+d+"].",(l=c[d])[h+"ref"]===e._id){var f=l[h],p=l["size"+h],m=null,g=null;if(o){m=a(f,e.range);var y=p/Math.pow(10,m)/2;g=2*Math.log(y+Math.sqrt(1+y*y))/Math.LN10}else g=(m=Math.pow(10,f))*(Math.pow(10,p/2)-Math.pow(10,-p/2));n(m)?n(g)||(g=null):(m=null,g=null),i(u+h,m),i(u+"size"+h,g)}}},{"../../lib/to_log_range":745,"fast-isnumeric":225}],639:[function(t,e,r){var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../../plots/array_container_defaults"),o=t("./attributes");function s(t,e,r){function i(r,a){return n.coerce(t,e,o,r,a)}var s=i("source");if(!i("visible",!!s))return e;i("layer"),i("xanchor"),i("yanchor"),i("sizex"),i("sizey"),i("sizing"),i("opacity");for(var l={_fullLayout:r},u=["x","y"],c=0;c<2;c++){var h=u[c],d=a.coerceRef(t,e,l,h,"paper");"paper"!==d&&a.getFromId(l,d)._imgIndices.push(e._index),a.coercePosition(e,l,i,d,h,0)}return e}e.exports=function(t,e){i(t,e,{name:"images",handleItemDefaults:s})}},{"../../lib":719,"../../plots/array_container_defaults":763,"../../plots/cartesian/axes":767,"./attributes":637}],640:[function(t,e,r){var n=t("d3"),a=t("../drawing"),i=t("../../plots/cartesian/axes"),o=t("../../constants/xmlns_namespaces");e.exports=function(t){var e,r,s=t._fullLayout,l=[],u={},c=[];for(r=0;r<s.images.length;r++){var h=s.images[r];if(h.visible)if("below"===h.layer&&"paper"!==h.xref&&"paper"!==h.yref){e=h.xref+h.yref;var d=s._plots[e];if(!d){c.push(h);continue}d.mainplot&&(e=d.mainplot.id),u[e]||(u[e]=[]),u[e].push(h)}else"above"===h.layer?l.push(h):c.push(h)}var f={left:{sizing:"xMin",offset:0},center:{sizing:"xMid",offset:-.5},right:{sizing:"xMax",offset:-1}},p={top:{sizing:"YMin",offset:0},middle:{sizing:"YMid",offset:-.5},bottom:{sizing:"YMax",offset:-1}};function m(e){var r=n.select(this);if(!this.img||this.img.src!==e.source){r.attr("xmlns",o.svg);var a=new Promise(function(t){var n=new Image;function a(){r.remove(),t()}this.img=n,n.setAttribute("crossOrigin","anonymous"),n.onerror=a,n.onload=function(){var e=document.createElement("canvas");e.width=this.width,e.height=this.height,e.getContext("2d").drawImage(this,0,0);var n=e.toDataURL("image/png");r.attr("xlink:href",n),t()},r.on("error",a),n.src=e.source}.bind(this));t._promises.push(a)}}function g(e){var r=n.select(this),o=i.getFromId(t,e.xref),l=i.getFromId(t,e.yref),u=s._size,c=o?Math.abs(o.l2p(e.sizex)-o.l2p(0)):e.sizex*u.w,h=l?Math.abs(l.l2p(e.sizey)-l.l2p(0)):e.sizey*u.h,d=c*f[e.xanchor].offset,m=h*p[e.yanchor].offset,g=f[e.xanchor].sizing+p[e.yanchor].sizing,y=(o?o.r2p(e.x)+o._offset:e.x*u.w+u.l)+d,v=(l?l.r2p(e.y)+l._offset:u.h-e.y*u.h+u.t)+m;switch(e.sizing){case"fill":g+=" slice";break;case"stretch":g="none"}r.attr({x:y,y:v,width:c,height:h,preserveAspectRatio:g,opacity:e.opacity});var _=(o?o._id:"")+(l?l._id:"");a.setClipUrl(r,_?"clip"+s._uid+_:null,t)}var y=s._imageLowerLayer.selectAll("image").data(c),v=s._imageUpperLayer.selectAll("image").data(l);y.enter().append("image"),v.enter().append("image"),y.exit().remove(),v.exit().remove(),y.each((function(t){m.bind(this)(t),g.bind(this)(t)})),v.each((function(t){m.bind(this)(t),g.bind(this)(t)}));var _=Object.keys(s._plots);for(r=0;r<_.length;r++){e=_[r];var x=s._plots[e];if(x.imagelayer){var b=x.imagelayer.selectAll("image").data(u[e]||[]);b.enter().append("image"),b.exit().remove(),b.each((function(t){m.bind(this)(t),g.bind(this)(t)}))}}}},{"../../constants/xmlns_namespaces":696,"../../plots/cartesian/axes":767,"../drawing":614,d3:163}],641:[function(t,e,r){e.exports={moduleType:"component",name:"images",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),includeBasePlot:t("../../plots/cartesian/include_components")("images"),draw:t("./draw"),convertCoords:t("./convert_coords")}},{"../../plots/cartesian/include_components":777,"./attributes":637,"./convert_coords":638,"./defaults":639,"./draw":640}],642:[function(t,e,r){var n=t("../../plots/font_attributes"),a=t("../color/attributes");e.exports={bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:a.defaultLine,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:n({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},itemsizing:{valType:"enumerated",values:["trace","constant"],dflt:"trace",editType:"legend"},itemclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggle",editType:"legend"},itemdoubleclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggleothers",editType:"legend"},x:{valType:"number",min:-2,max:3,dflt:1.02,editType:"legend"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",min:-2,max:3,dflt:1,editType:"legend"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"legend"},uirevision:{valType:"any",editType:"none"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"legend"},editType:"legend"}},{"../../plots/font_attributes":793,"../color/attributes":592}],643:[function(t,e,r){e.exports={scrollBarWidth:6,scrollBarMinHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4,textOffsetX:40}},{}],644:[function(t,e,r){var n=t("../../registry"),a=t("../../lib"),i=t("../../plot_api/plot_template"),o=t("./attributes"),s=t("../../plots/layout_attributes"),l=t("./helpers");e.exports=function(t,e,r){for(var u,c,h,d,f=t.legend||{},p=0,m=!1,g="normal",y=0;y<r.length;y++){var v=r[y];v.visible&&((v.showlegend||v._dfltShowLegend)&&(p++,v.showlegend&&(m=!0,(n.traceIs(v,"pie-like")||!0===v._input.showlegend)&&p++)),(n.traceIs(v,"bar")&&"stack"===e.barmode||-1!==["tonextx","tonexty"].indexOf(v.fill))&&(g=l.isGrouped({traceorder:g})?"grouped+reversed":"reversed"),void 0!==v.legendgroup&&""!==v.legendgroup&&(g=l.isReversed({traceorder:g})?"reversed+grouped":"grouped"))}var _=a.coerce(t,e,s,"showlegend",m&&p>1);if(!1!==_||f.uirevision){var x=i.newContainer(e,"legend");if(w("uirevision",e.uirevision),!1!==_){if(w("bgcolor",e.paper_bgcolor),w("bordercolor"),w("borderwidth"),a.coerceFont(w,"font",e.font),w("orientation"),"h"===x.orientation){var b=t.xaxis;n.getComponentMethod("rangeslider","isVisible")(b)?(u=0,h="left",c=1.1,d="bottom"):(u=0,h="left",c=-.1,d="top")}w("traceorder",g),l.isGrouped(e.legend)&&w("tracegroupgap"),w("itemsizing"),w("itemclick"),w("itemdoubleclick"),w("x",u),w("xanchor",h),w("y",c),w("yanchor",d),w("valign"),a.noneOrAll(f,x,["x","y"])}}function w(t,e){return a.coerce(f,x,o,t,e)}}},{"../../lib":719,"../../plot_api/plot_template":757,"../../plots/layout_attributes":819,"../../registry":847,"./attributes":642,"./helpers":648}],645:[function(t,e,r){var n=t("d3"),a=t("../../lib"),i=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib/events"),l=t("../dragelement"),u=t("../drawing"),c=t("../color"),h=t("../../lib/svg_text_utils"),d=t("./handle_click"),f=t("./constants"),p=t("../../constants/alignment"),m=p.LINE_SPACING,g=p.FROM_TL,y=p.FROM_BR,v=t("./get_legend_data"),_=t("./style"),x=t("./helpers");function b(t,e,r,n,a){var i=r.data()[0][0].trace,l={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};i._group&&(l.group=i._group),o.traceIs(i,"pie-like")&&(l.label=r.datum()[0].label),!1!==s.triggerHandler(t,"plotly_legendclick",l)&&(1===n?e._clickTimeout=setTimeout((function(){d(r,t,n)}),t._context.doubleClickDelay):2===n&&(e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",l)&&d(r,t,n)))}function w(t,e,r){var n=t.data()[0][0],i=e._fullLayout,s=n.trace,l=o.traceIs(s,"pie-like"),c=s.index,d=e._context.edits.legendText&&!l,p=l?n.label:s.name;s._meta&&(p=a.templateString(p,s._meta));var g=a.ensureSingle(t,"text","legendtext");function y(r){h.convertToTspans(r,e,(function(){!function(t,e){var r=t.data()[0][0];if(r.trace.showlegend){var n,a,i=t.select("g[class*=math-group]"),o=i.node(),s=e._fullLayout.legend.font.size*m;if(o){var l=u.bBox(o);n=l.height,a=l.width,u.setTranslate(i,0,n/4)}else{var c=t.select(".legendtext"),d=h.lineCount(c),p=c.node();n=s*d,a=p?u.bBox(p).width:0;var g=s*(.3+(1-d)/2);h.positionText(c,f.textOffsetX,g)}r.lineHeight=s,r.height=Math.max(n,16)+3,r.width=a}else t.remove()}(t,e)}))}g.attr("text-anchor","start").classed("user-select-none",!0).call(u.font,i.legend.font).text(d?M(p,r):p),h.positionText(g,f.textOffsetX,0),d?g.call(h.makeEditable,{gd:e,text:p}).call(y).on("edit",(function(t){this.text(M(t,r)).call(y);var i=n.trace._fullInput||{},s={};if(o.hasTransform(i,"groupby")){var l=o.getTransformIndices(i,"groupby"),u=l[l.length-1],h=a.keyedContainer(i,"transforms["+u+"].styles","target","value.name");h.set(n.trace._group,t),s=h.constructUpdate()}else s.name=t;return o.call("_guiRestyle",e,s,c)})):y(g)}function M(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function k(t,e){var r,i=e._context.doubleClickDelay,o=1,s=a.ensureSingle(t,"rect","legendtoggle",(function(t){t.style("cursor","pointer").attr("pointer-events","all").call(c.fill,"rgba(0,0,0,0)")}));s.on("mousedown",(function(){(r=(new Date).getTime())-e._legendMouseDownTime<i?o+=1:(o=1,e._legendMouseDownTime=r)})),s.on("mouseup",(function(){if(!e._dragged&&!e._editing){var r=e._fullLayout.legend;(new Date).getTime()-e._legendMouseDownTime>i&&(o=Math.max(o-1,1)),b(e,r,t,o,n.event)}}))}function T(t,e,r){var i=t._fullLayout,o=i.legend,s=o.borderwidth,l=x.isGrouped(o),c=0;if(o._width=0,o._height=0,x.isVertical(o))l&&e.each((function(t,e){u.setTranslate(this,0,e*o.tracegroupgap)})),r.each((function(t){var e=t[0],r=e.height,n=e.width;u.setTranslate(this,s,5+s+o._height+r/2),o._height+=r,o._width=Math.max(o._width,n)})),o._width+=45+2*s,o._height+=10+2*s,l&&(o._height+=(o._lgroupsLength-1)*o.tracegroupgap),c=40;else if(l){var h,d=0,f=0,p=e.data(),m=0;for(h=0;h<p.length;h++){var g=p[h],y=g.map((function(t){return t[0].width})),v=a.aggNums(Math.max,null,y),_=g.reduce((function(t,e){return t+e[0].height}),0);f=Math.max(f,v),d=Math.max(d,_),m=Math.max(m,g.length)}f+=5,f+=40;var b=[o._width],w=[],M=0;for(h=0;h<p.length;h++){i._size.w<s+o._width+5+f?(b[b.length-1]=b[0],o._width=f,M++):o._width+=f+s;var k=M*d;k+=M>0?o.tracegroupgap:0,w.push(k),b.push(o._width)}e.each((function(t,e){u.setTranslate(this,b[e],w[e])})),e.each((function(){var t=n.select(this).selectAll("g.traces"),e=0;t.each((function(t){var r=t[0].height;u.setTranslate(this,0,5+s+e+r/2),e+=r}))}));var T=w[w.length-1]+d;o._height=10+2*s+T;var L=Math.max.apply(null,b);o._width=L+f+40,o._width+=2*s}else{var A=0,S=0,E=0,C=0,D=0;r.each((function(t){E=Math.max(40+t[0].width,E),D+=40+t[0].width+5}));var P=i._size.w>s+D-5;r.each((function(t){var e=t[0],r=P?40+t[0].width:E;s+C+5+r>i._size.w&&(C=0,A+=S,o._height+=S,S=0),u.setTranslate(this,s+C,5+s+e.height/2+A),o._width+=5+r,C+=5+r,S=Math.max(e.height,S)})),P?o._height=S:o._height+=S,o._width+=2*s,o._height+=10+2*s}o._width=Math.ceil(o._width),o._height=Math.ceil(o._height);var O=t._context.edits.legendText||t._context.edits.legendPosition;r.each((function(t){var e=t[0],r=n.select(this).select(".legendtoggle");u.setRect(r,0,-e.height/2,(O?0:o._width)+c,e.height)}))}function L(t){var e=t._fullLayout.legend,r="left";a.isRightAnchor(e)?r="right":a.isCenterAnchor(e)&&(r="center");var n="top";a.isBottomAnchor(e)?n="bottom":a.isMiddleAnchor(e)&&(n="middle"),i.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*g[r],r:e._width*y[r],b:e._height*y[n],t:e._height*g[n]})}e.exports=function(t){var e=t._fullLayout,r="legend"+e._uid;if(e._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var s=e.legend,h=e.showlegend&&v(t.calcdata,s),d=e.hiddenlabels||[];if(!e.showlegend||!h.length)return e._infolayer.selectAll(".legend").remove(),e._topdefs.select("#"+r).remove(),void i.autoMargin(t,"legend");for(var p=0,m=0;m<h.length;m++)for(var x=0;x<h[m].length;x++){var M=h[m][x][0],A=M.trace,S=o.traceIs(A,"pie-like")?M.label:A.name;p=Math.max(p,S&&S.length||0)}var E=!1,C=a.ensureSingle(e._infolayer,"g","legend",(function(t){t.attr("pointer-events","all"),E=!0})),D=a.ensureSingleById(e._topdefs,"clipPath",r,(function(t){t.append("rect")})),P=a.ensureSingle(C,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));P.call(c.stroke,s.bordercolor).call(c.fill,s.bgcolor).style("stroke-width",s.borderwidth+"px");var O=a.ensureSingle(C,"g","scrollbox"),z=a.ensureSingle(C,"rect","scrollbar",(function(t){t.attr({rx:20,ry:3,width:0,height:0}).call(c.fill,"#808BA4")})),I=O.selectAll("g.groups").data(h);I.enter().append("g").attr("class","groups"),I.exit().remove();var R=I.selectAll("g.traces").data(a.identity);R.enter().append("g").attr("class","traces"),R.exit().remove(),R.style("opacity",(function(t){var e=t[0].trace;return o.traceIs(e,"pie-like")?-1!==d.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){n.select(this).call(w,t,p)})).call(_,t).each((function(){n.select(this).call(k,t)})),a.syncOrAsync([i.previousPromises,function(){E&&(T(t,I,R),L(t));var c=e.width,h=e.height;T(t,I,R),s._height>h?function(t){var e=t._fullLayout.legend,r="left";a.isRightAnchor(e)?r="right":a.isCenterAnchor(e)&&(r="center"),i.autoMargin(t,"legend",{x:e.x,y:.5,l:e._width*g[r],r:e._width*y[r],b:0,t:0})}(t):L(t);var d=e._size,p=d.l+d.w*s.x,m=d.t+d.h*(1-s.y);a.isRightAnchor(s)?p-=s._width:a.isCenterAnchor(s)&&(p-=s._width/2),a.isBottomAnchor(s)?m-=s._height:a.isMiddleAnchor(s)&&(m-=s._height/2);var v=s._width,_=d.w;v>_?(p=d.l,v=_):(p+v>c&&(p=c-v),p<0&&(p=0),v=Math.min(c-p,s._width));var x,w,M,k,A=s._height,S=d.h;if(A>S?(m=d.t,A=S):(m+A>h&&(m=h-A),m<0&&(m=0),A=Math.min(h-m,s._height)),u.setTranslate(C,p,m),z.on(".drag",null),C.on("wheel",null),s._height<=A||t._context.staticPlot)P.attr({width:v-s.borderwidth,height:A-s.borderwidth,x:s.borderwidth/2,y:s.borderwidth/2}),u.setTranslate(O,0,0),D.select("rect").attr({width:v-2*s.borderwidth,height:A-2*s.borderwidth,x:s.borderwidth,y:s.borderwidth}),u.setClipUrl(O,r,t),u.setRect(z,0,0,0,0),delete s._scrollY;else{var F,N,Y=Math.max(f.scrollBarMinHeight,A*A/s._height),j=A-Y-2*f.scrollBarMargin,B=s._height-A,H=j/B,U=Math.min(s._scrollY||0,B);P.attr({width:v-2*s.borderwidth+f.scrollBarWidth+f.scrollBarMargin,height:A-s.borderwidth,x:s.borderwidth/2,y:s.borderwidth/2}),D.select("rect").attr({width:v-2*s.borderwidth+f.scrollBarWidth+f.scrollBarMargin,height:A-2*s.borderwidth,x:s.borderwidth,y:s.borderwidth+U}),u.setClipUrl(O,r,t),W(U,Y,H),C.on("wheel",(function(){W(U=a.constrain(s._scrollY+n.event.deltaY/j*B,0,B),Y,H),0!==U&&U!==B&&n.event.preventDefault()}));var V=n.behavior.drag().on("dragstart",(function(){F=n.event.sourceEvent.clientY,N=U})).on("drag",(function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||W(U=a.constrain((t.clientY-F)/H+N,0,B),Y,H)}));z.call(V)}function W(e,r,n){s._scrollY=t._fullLayout.legend._scrollY=e,u.setTranslate(O,0,-e),u.setRect(z,v,f.scrollBarMargin+e*n,f.scrollBarWidth,r),D.select("rect").attr({y:s.borderwidth+e})}t._context.edits.legendPosition&&(C.classed("cursor-move",!0),l.init({element:C.node(),gd:t,prepFn:function(){var t=u.getTranslate(C);M=t.x,k=t.y},moveFn:function(t,e){var r=M+t,n=k+e;u.setTranslate(C,r,n),x=l.align(r,0,d.l,d.l+d.w,s.xanchor),w=l.align(n,0,d.t+d.h,d.t,s.yanchor)},doneFn:function(){void 0!==x&&void 0!==w&&o.call("_guiRelayout",t,{"legend.x":x,"legend.y":w})},clickFn:function(r,n){var a=e._infolayer.selectAll("g.traces").filter((function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom}));a.size()>0&&b(t,C,a,r,n)}}))}],t)}}},{"../../constants/alignment":688,"../../lib":719,"../../lib/events":709,"../../lib/svg_text_utils":743,"../../plots/plots":828,"../../registry":847,"../color":593,"../dragelement":611,"../drawing":614,"./constants":643,"./get_legend_data":646,"./handle_click":647,"./helpers":648,"./style":650,d3:163}],646:[function(t,e,r){var n=t("../../registry"),a=t("./helpers");e.exports=function(t,e){var r,i,o={},s=[],l=!1,u={},c=0;function h(t,r){if(""!==t&&a.isGrouped(e))-1===s.indexOf(t)?(s.push(t),l=!0,o[t]=[[r]]):o[t].push([r]);else{var n="~~i"+c;s.push(n),o[n]=[[r]],c++}}for(r=0;r<t.length;r++){var d=t[r],f=d[0],p=f.trace,m=p.legendgroup;if(p.visible&&p.showlegend)if(n.traceIs(p,"pie-like"))for(u[m]||(u[m]={}),i=0;i<d.length;i++){var g=d[i].label;u[m][g]||(h(m,{label:g,color:d[i].color,i:d[i].i,trace:p,pts:d[i].pts}),u[m][g]=!0)}else h(m,f)}if(!s.length)return[];var y,v,_=s.length;if(l&&a.isGrouped(e))for(v=new Array(_),r=0;r<_;r++)y=o[s[r]],v[r]=a.isReversed(e)?y.reverse():y;else{for(v=[new Array(_)],r=0;r<_;r++)y=o[s[r]][0],v[0][a.isReversed(e)?_-r-1:r]=y;_=1}return e._lgroupsLength=_,v}},{"../../registry":847,"./helpers":648}],647:[function(t,e,r){var n=t("../../lib"),a=t("../../registry"),i=!0;e.exports=function(t,e,r){var o=e._fullLayout;if(!e._dragged&&!e._editing){var s,l=o.legend.itemclick,u=o.legend.itemdoubleclick;if(1===r&&"toggle"===l&&"toggleothers"===u&&i&&e.data&&e._context.showTips?(n.notifier(n._(e,"Double-click on legend to isolate one trace"),"long"),i=!1):i=!1,1===r?s=l:2===r&&(s=u),s){var c,h,d,f,p,m=o.hiddenlabels?o.hiddenlabels.slice():[],g=t.data()[0][0],y=e._fullData,v=g.trace,_=v.legendgroup,x={},b=[],w=[],M=[];if(a.traceIs(v,"pie-like")){var k=g.label,T=m.indexOf(k);"toggle"===s?-1===T?m.push(k):m.splice(T,1):"toggleothers"===s&&(m=[],e.calcdata[0].forEach((function(t){k!==t.label&&m.push(t.label)})),e._fullLayout.hiddenlabels&&e._fullLayout.hiddenlabels.length===m.length&&-1===T&&(m=[])),a.call("_guiRelayout",e,"hiddenlabels",m)}else{var L,A=_&&_.length,S=[];if(A)for(c=0;c<y.length;c++)(L=y[c]).visible&&L.legendgroup===_&&S.push(c);if("toggle"===s){var E;switch(v.visible){case!0:E="legendonly";break;case!1:E=!1;break;case"legendonly":E=!0}if(A)for(c=0;c<y.length;c++)!1!==y[c].visible&&y[c].legendgroup===_&&R(y[c],E);else R(v,E)}else if("toggleothers"===s){var C,D,P=!0;for(c=0;c<y.length;c++)if(y[c]!==v&&!(C=A&&y[c].legendgroup===_)&&!0===y[c].visible&&!a.traceIs(y[c],"notLegendIsolatable")){P=!1;break}for(c=0;c<y.length;c++)if(!1!==y[c].visible&&!a.traceIs(y[c],"notLegendIsolatable"))switch(v.visible){case"legendonly":R(y[c],!0);break;case!0:D=!!P||"legendonly",C=y[c]===v||A&&y[c].legendgroup===_,R(y[c],!!C||D)}}for(c=0;c<w.length;c++)if(d=w[c]){var O=d.constructUpdate(),z=Object.keys(O);for(h=0;h<z.length;h++)f=z[h],(x[f]=x[f]||[])[M[c]]=O[f]}for(p=Object.keys(x),c=0;c<p.length;c++)for(f=p[c],h=0;h<b.length;h++)x[f].hasOwnProperty(h)||(x[f][h]=void 0);a.call("_guiRestyle",e,x,b)}}}function I(t,e,r){var n=b.indexOf(t),a=x[e];return a||(a=x[e]=[]),-1===b.indexOf(t)&&(b.push(t),n=b.length-1),a[n]=r,n}function R(t,e){var r=t._fullInput;if(a.hasTransform(r,"groupby")){var i=w[r.index];if(!i){var o=a.getTransformIndices(r,"groupby"),s=o[o.length-1];i=n.keyedContainer(r,"transforms["+s+"].styles","target","value.visible"),w[r.index]=i}var l=i.get(t._group);void 0===l&&(l=!0),!1!==l&&i.set(t._group,e),M[r.index]=I(r.index,"visible",!1!==r.visible)}else{var u=!1!==r.visible&&e;I(r.index,"visible",u)}}}},{"../../lib":719,"../../registry":847}],648:[function(t,e,r){r.isGrouped=function(t){return-1!==(t.traceorder||"").indexOf("grouped")},r.isVertical=function(t){return"h"!==t.orientation},r.isReversed=function(t){return-1!==(t.traceorder||"").indexOf("reversed")}},{}],649:[function(t,e,r){e.exports={moduleType:"component",name:"legend",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw"),style:t("./style")}},{"./attributes":642,"./defaults":644,"./draw":645,"./style":650}],650:[function(t,e,r){var n=t("d3"),a=t("../../registry"),i=t("../../lib"),o=t("../drawing"),s=t("../color"),l=t("../../traces/scatter/subtypes"),u=t("../../traces/pie/style_one"),c=t("../../traces/pie/helpers").castOption;e.exports=function(t,e){var r=e._fullLayout.legend,h="constant"===r.itemsizing;function d(t,e,r,n){var a;if(t+1)a=t;else{if(!(e&&e.width>0))return 0;a=e.width}return h?n:Math.min(a,r)}function f(t,e,r){var i=t[0].trace,o=i.marker||{},l=o.line||{},u=r?i.type===r&&i.visible:a.traceIs(i,"bar"),c=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(u?[t]:[]);c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),c.exit().remove(),c.each((function(t){var e=n.select(this),r=t[0],a=d(r.mlw,o.line,5,2);e.style("stroke-width",a+"px").call(s.fill,r.mc||o.color),a&&s.stroke(e,r.mlc||l.color)}))}function p(t,e,r){var o=t[0],s=o.trace,l=r?s.type===r&&s.visible:a.traceIs(s,r),h=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(l?[t]:[]);if(h.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),h.exit().remove(),h.size()){var f=(s.marker||{}).line,p=d(c(f.width,o.pts),f,5,2),m=i.minExtend(s,{marker:{line:{width:p}}});m.marker.line.color=f.color;var g=i.minExtend(o,{trace:m});u(h,g,m)}}t.each((function(t){var e=n.select(this),a=i.ensureSingle(e,"g","layers");a.style("opacity",t[0].trace.opacity);var o=r.valign,s=t[0].lineHeight,l=t[0].height;if("middle"!==o&&s&&l){var u={top:1,bottom:-1}[o]*(.5*(s-l+3));a.attr("transform","translate(0,"+u+")")}else a.attr("transform",null);a.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var c=a.selectAll("g.legendsymbols").data([t]);c.enter().append("g").classed("legendsymbols",!0),c.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)})).each((function(t){var e=t[0].trace,r=[];"waterfall"===e.type&&e.visible&&(r=t[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var a=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(r);a.enter().append("path").classed("legendwaterfall",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),a.exit().remove(),a.each((function(t){var r=n.select(this),a=e[t[0]].marker,i=d(void 0,a.line,5,2);r.attr("d",t[1]).style("stroke-width",i+"px").call(s.fill,a.color),i&&r.call(s.stroke,a.line.color)}))})).each((function(t){f(t,this,"funnel")})).each((function(t){f(t,this)})).each((function(t){var r=t[0].trace,l=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(a.traceIs(r,"box-violin")&&r.visible?[t]:[]);l.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),l.exit().remove(),l.each((function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==s.opacity(r.fillcolor)||0!==s.opacity((r.line||{}).color)){var a=d(void 0,r.line,5,2);t.style("stroke-width",a+"px").call(s.fill,r.fillcolor),a&&s.stroke(t,r.line.color)}else{var u=i.minExtend(r,{marker:{size:h?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});l.call(o.pointStyle,u,e)}}))})).each((function(t){p(t,this,"funnelarea")})).each((function(t){p(t,this,"pie")})).each((function(t){var r,a,s=t[0],u=s.trace,c=u.visible&&u.fill&&"none"!==u.fill,h=l.hasLines(u),f=u.contours,p=!1,m=!1;if(f){var g=f.coloring;"lines"===g?p=!0:h="none"===g||"heatmap"===g||f.showlines,"constraint"===f.type?c="="!==f._operation:"fill"!==g&&"heatmap"!==g||(m=!0)}var y=l.hasMarkers(u)||l.hasText(u)||!c&&!m?"M5,0":h||p?"M5,-2":"M5,-3",v=n.select(this),_=v.select(".legendfill").selectAll("path").data(c||m?[t]:[]);if(_.enter().append("path").classed("js-fill",!0),_.exit().remove(),_.attr("d",y+"h30v6h-30z").call(c?o.fillGroupStyle:function(t){if(t.size()){var r="legendfill-"+u.uid;o.gradient(t,e,r,"horizontalreversed",u.colorscale,"fill")}}),h||p){var x=d(void 0,u.line,10,5);a=i.minExtend(u,{line:{width:x}}),r=[i.minExtend(s,{trace:a})]}var b=v.select(".legendlines").selectAll("path").data(h||p?[r]:[]);b.enter().append("path").classed("js-line",!0),b.exit().remove(),b.attr("d",y+(p?"l30,0.0001":"h30")).call(h?o.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+u.uid;o.lineGroupStyle(t),o.gradient(t,e,r,"horizontalreversed",u.colorscale,"stroke")}})})).each((function(t){var r,a,s=t[0],u=s.trace,c=l.hasMarkers(u),d=l.hasText(u),f=l.hasLines(u);function p(t,e,r,n){var a=i.nestedProperty(u,t).get(),o=i.isArrayOrTypedArray(a)&&e?e(a):a;if(h&&o&&void 0!==n&&(o=n),r){if(o<r[0])return r[0];if(o>r[1])return r[1]}return o}function m(t){return t[0]}if(c||d||f){var g={},y={};if(c){g.mc=p("marker.color",m),g.mx=p("marker.symbol",m),g.mo=p("marker.opacity",i.mean,[.2,1]),g.mlc=p("marker.line.color",m),g.mlw=p("marker.line.width",i.mean,[0,5],2),y.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var v=p("marker.size",i.mean,[2,16],12);g.ms=v,y.marker.size=v}f&&(y.line={width:p("line.width",m,[0,10],5)}),d&&(g.tx="Aa",g.tp=p("textposition",m),g.ts=10,g.tc=p("textfont.color",m),g.tf=p("textfont.family",m)),r=[i.minExtend(s,g)],(a=i.minExtend(u,y)).selectedpoints=null}var _=n.select(this).select("g.legendpoints"),x=_.selectAll("path.scatterpts").data(c?r:[]);x.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform","translate(20,0)"),x.exit().remove(),x.call(o.pointStyle,a,e),c&&(r[0].mrc=3);var b=_.selectAll("g.pointtext").data(d?r:[]);b.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),b.exit().remove(),b.selectAll("text").call(o.textPointStyle,a,e)})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data("candlestick"===e.type&&e.visible?[t,t]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],o=d(void 0,i.line,5,2);a.style("stroke-width",o+"px").call(s.fill,i.fillcolor),o&&s.stroke(a,i.line.color)}))})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data("ohlc"===e.type&&e.visible?[t,t]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],l=d(void 0,i.line,5,2);a.style("fill","none").call(o.dashLine,i.line.dash,l),l&&s.stroke(a,i.line.color)}))}))}},{"../../lib":719,"../../registry":847,"../../traces/pie/helpers":1091,"../../traces/pie/style_one":1097,"../../traces/scatter/subtypes":1135,"../color":593,"../drawing":614,d3:163}],651:[function(t,e,r){var n=t("../../registry"),a=t("../../plots/plots"),i=t("../../plots/cartesian/axis_ids"),o=t("../../lib"),s=t("../../fonts/ploticon"),l=o._,u=e.exports={};function c(t,e){var r,a,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,u=t._fullLayout,c={},h=i.list(t,null,!0),d="on";if("zoom"===s){var f,p="in"===l?.5:2,m=(1+p)/2,g=(1-p)/2;for(a=0;a<h.length;a++)if(!(r=h[a]).fixedrange)if(f=r._name,"auto"===l)c[f+".autorange"]=!0;else if("reset"===l){if(void 0===r._rangeInitial)c[f+".autorange"]=!0;else{var y=r._rangeInitial.slice();c[f+".range[0]"]=y[0],c[f+".range[1]"]=y[1]}void 0!==r._showSpikeInitial&&(c[f+".showspikes"]=r._showSpikeInitial,"on"!==d||r._showSpikeInitial||(d="off"))}else{var v=[r.r2l(r.range[0]),r.r2l(r.range[1])],_=[m*v[0]+g*v[1],m*v[1]+g*v[0]];c[f+".range[0]"]=r.l2r(_[0]),c[f+".range[1]"]=r.l2r(_[1])}u._cartesianSpikesEnabled=d}else{if("hovermode"!==s||"x"!==l&&"y"!==l){if("hovermode"===s&&"closest"===l){for(a=0;a<h.length;a++)r=h[a],"on"!==d||r.showspikes||(d="off");u._cartesianSpikesEnabled=d}}else l=u._isHoriz?"y":"x",o.setAttribute("data-val",l);c[s]=l}n.call("_guiRelayout",t,c)}function h(t,e){for(var r=e.currentTarget,a=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,o=t._fullLayout._subplots.gl3d,s={},l=a.split("."),u=0;u<o.length;u++)s[o[u]+"."+l[1]]=i;var c="pan"===i?i:"zoom";s.dragmode=c,n.call("_guiRelayout",t,s)}function d(t,e){for(var r=e.currentTarget.getAttribute("data-attr"),a=t._fullLayout,i=a._subplots.gl3d,o={},s=0;s<i.length;s++){var l=i[s],u=l+".camera",c=a[l]._scene;"resetLastSave"===r?(o[u+".up"]=c.viewInitial.up,o[u+".eye"]=c.viewInitial.eye,o[u+".center"]=c.viewInitial.center):"resetDefault"===r&&(o[u+".up"]=null,o[u+".eye"]=null,o[u+".center"]=null)}n.call("_guiRelayout",t,o)}function f(t,e){var r=e.currentTarget,n=r._previousVal,a=t._fullLayout,i=a._subplots.gl3d,o=["xaxis","yaxis","zaxis"],s={},l={};if(n)l=n,r._previousVal=null;else{for(var u=0;u<i.length;u++){var c=i[u],h=a[c],d=c+".hovermode";s[d]=h.hovermode,l[d]=!1;for(var f=0;f<3;f++){var p=o[f],m=c+"."+p+".showspikes";l[m]=!1,s[m]=h[p].showspikes}}r._previousVal=s}return l}function p(t,e){for(var r=e.currentTarget,a=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,o=t._fullLayout,s=o._subplots.geo,l=0;l<s.length;l++){var u=s[l],c=o[u];if("zoom"===a){var h=c.projection.scale,d="in"===i?2*h:.5*h;n.call("_guiRelayout",t,u+".projection.scale",d)}else"reset"===a&&y(t,"geo")}}function m(t){var e=t._fullLayout;return!e.hovermode&&(e._has("cartesian")?e._isHoriz?"y":"x":"closest")}function g(t){var e=m(t);n.call("_guiRelayout",t,"hovermode",e)}function y(t,e){for(var r=t._fullLayout,a=r._subplots[e],i={},o=0;o<a.length;o++)for(var s=a[o],l=r[s]._subplot.viewInitial,u=Object.keys(l),c=0;c<u.length;c++){var h=u[c];i[s+"."+h]=l[h]}n.call("_guiRelayout",t,i)}u.toImage={name:"toImage",title:function(t){var e=(t._context.toImageButtonOptions||{}).format||"png";return l(t,"png"===e?"Download plot as a png":"Download plot")},icon:s.camera,click:function(t){var e=t._context.toImageButtonOptions,r={format:e.format||"png"};o.notifier(l(t,"Taking snapshot - this may take a few seconds"),"long"),"svg"!==r.format&&o.isIE()&&(o.notifier(l(t,"IE only supports svg. Changing format to svg."),"long"),r.format="svg"),["filename","width","height","scale"].forEach((function(t){t in e&&(r[t]=e[t])})),n.call("downloadImage",t,r).then((function(e){o.notifier(l(t,"Snapshot succeeded")+" - "+e,"long")})).catch((function(){o.notifier(l(t,"Sorry, there was a problem downloading your snapshot!"),"long")}))}},u.sendDataToCloud={name:"sendDataToCloud",title:function(t){return l(t,"Edit in Chart Studio")},icon:s.disk,click:function(t){a.sendDataToCloud(t)}},u.editInChartStudio={name:"editInChartStudio",title:function(t){return l(t,"Edit in Chart Studio")},icon:s.pencil,click:function(t){a.sendDataToCloud(t)}},u.zoom2d={name:"zoom2d",title:function(t){return l(t,"Zoom")},attr:"dragmode",val:"zoom",icon:s.zoombox,click:c},u.pan2d={name:"pan2d",title:function(t){return l(t,"Pan")},attr:"dragmode",val:"pan",icon:s.pan,click:c},u.select2d={name:"select2d",title:function(t){return l(t,"Box Select")},attr:"dragmode",val:"select",icon:s.selectbox,click:c},u.lasso2d={name:"lasso2d",title:function(t){return l(t,"Lasso Select")},attr:"dragmode",val:"lasso",icon:s.lasso,click:c},u.zoomIn2d={name:"zoomIn2d",title:function(t){return l(t,"Zoom in")},attr:"zoom",val:"in",icon:s.zoom_plus,click:c},u.zoomOut2d={name:"zoomOut2d",title:function(t){return l(t,"Zoom out")},attr:"zoom",val:"out",icon:s.zoom_minus,click:c},u.autoScale2d={name:"autoScale2d",title:function(t){return l(t,"Autoscale")},attr:"zoom",val:"auto",icon:s.autoscale,click:c},u.resetScale2d={name:"resetScale2d",title:function(t){return l(t,"Reset axes")},attr:"zoom",val:"reset",icon:s.home,click:c},u.hoverClosestCartesian={name:"hoverClosestCartesian",title:function(t){return l(t,"Show closest data on hover")},attr:"hovermode",val:"closest",icon:s.tooltip_basic,gravity:"ne",click:c},u.hoverCompareCartesian={name:"hoverCompareCartesian",title:function(t){return l(t,"Compare data on hover")},attr:"hovermode",val:function(t){return t._fullLayout._isHoriz?"y":"x"},icon:s.tooltip_compare,gravity:"ne",click:c},u.zoom3d={name:"zoom3d",title:function(t){return l(t,"Zoom")},attr:"scene.dragmode",val:"zoom",icon:s.zoombox,click:h},u.pan3d={name:"pan3d",title:function(t){return l(t,"Pan")},attr:"scene.dragmode",val:"pan",icon:s.pan,click:h},u.orbitRotation={name:"orbitRotation",title:function(t){return l(t,"Orbital rotation")},attr:"scene.dragmode",val:"orbit",icon:s["3d_rotate"],click:h},u.tableRotation={name:"tableRotation",title:function(t){return l(t,"Turntable rotation")},attr:"scene.dragmode",val:"turntable",icon:s["z-axis"],click:h},u.resetCameraDefault3d={name:"resetCameraDefault3d",title:function(t){return l(t,"Reset camera to default")},attr:"resetDefault",icon:s.home,click:d},u.resetCameraLastSave3d={name:"resetCameraLastSave3d",title:function(t){return l(t,"Reset camera to last save")},attr:"resetLastSave",icon:s.movie,click:d},u.hoverClosest3d={name:"hoverClosest3d",title:function(t){return l(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:s.tooltip_basic,gravity:"ne",click:function(t,e){var r=f(t,e);n.call("_guiRelayout",t,r)}},u.zoomInGeo={name:"zoomInGeo",title:function(t){return l(t,"Zoom in")},attr:"zoom",val:"in",icon:s.zoom_plus,click:p},u.zoomOutGeo={name:"zoomOutGeo",title:function(t){return l(t,"Zoom out")},attr:"zoom",val:"out",icon:s.zoom_minus,click:p},u.resetGeo={name:"resetGeo",title:function(t){return l(t,"Reset")},attr:"reset",val:null,icon:s.autoscale,click:p},u.hoverClosestGeo={name:"hoverClosestGeo",title:function(t){return l(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:s.tooltip_basic,gravity:"ne",click:g},u.hoverClosestGl2d={name:"hoverClosestGl2d",title:function(t){return l(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:s.tooltip_basic,gravity:"ne",click:g},u.hoverClosestPie={name:"hoverClosestPie",title:function(t){return l(t,"Toggle show closest data on hover")},attr:"hovermode",val:"closest",icon:s.tooltip_basic,gravity:"ne",click:g},u.resetViewSankey={name:"resetSankeyGroup",title:function(t){return l(t,"Reset view")},icon:s.home,click:function(t){for(var e={"node.groups":[],"node.x":[],"node.y":[]},r=0;r<t._fullData.length;r++){var a=t._fullData[r]._viewInitial;e["node.groups"].push(a.node.groups.slice()),e["node.x"].push(a.node.x.slice()),e["node.y"].push(a.node.y.slice())}n.call("restyle",t,e)}},u.toggleHover={name:"toggleHover",title:function(t){return l(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:s.tooltip_basic,gravity:"ne",click:function(t,e){var r=f(t,e);r.hovermode=m(t),n.call("_guiRelayout",t,r)}},u.resetViews={name:"resetViews",title:function(t){return l(t,"Reset views")},icon:s.home,click:function(t,e){var r=e.currentTarget;r.setAttribute("data-attr","zoom"),r.setAttribute("data-val","reset"),c(t,e),r.setAttribute("data-attr","resetLastSave"),d(t,e),y(t,"geo"),y(t,"mapbox")}},u.toggleSpikelines={name:"toggleSpikelines",title:function(t){return l(t,"Toggle Spike Lines")},icon:s.spikeline,attr:"_cartesianSpikesEnabled",val:"on",click:function(t){var e=t._fullLayout;e._cartesianSpikesEnabled="on"===e._cartesianSpikesEnabled?"off":"on";var r=function(t){for(var e,r=t._fullLayout,n=i.list(t,null,!0),a={},o=0;o<n.length;o++)a[(e=n[o])._name+".showspikes"]="on"===r._cartesianSpikesEnabled||e._showSpikeInitial;return a}(t);n.call("_guiRelayout",t,r)}},u.resetViewMapbox={name:"resetViewMapbox",title:function(t){return l(t,"Reset view")},attr:"reset",icon:s.home,click:function(t){y(t,"mapbox")}}},{"../../fonts/ploticon":699,"../../lib":719,"../../plots/cartesian/axis_ids":770,"../../plots/plots":828,"../../registry":847}],652:[function(t,e,r){r.manage=t("./manage")},{"./manage":653}],653:[function(t,e,r){var n=t("../../plots/cartesian/axis_ids"),a=t("../../traces/scatter/subtypes"),i=t("../../registry"),o=t("./modebar"),s=t("./buttons");e.exports=function(t){var e=t._fullLayout,r=t._context,l=e._modeBar;if(r.displayModeBar||r.watermark){if(!Array.isArray(r.modeBarButtonsToRemove))throw new Error(["*modeBarButtonsToRemove* configuration options","must be an array."].join(" "));if(!Array.isArray(r.modeBarButtonsToAdd))throw new Error(["*modeBarButtonsToAdd* configuration options","must be an array."].join(" "));var u,c=r.modeBarButtons;u=Array.isArray(c)&&c.length?function(t){for(var e=0;e<t.length;e++)for(var r=t[e],n=0;n<r.length;n++){var a=r[n];if("string"==typeof a){if(void 0===s[a])throw new Error(["*modeBarButtons* configuration options","invalid button name"].join(" "));t[e][n]=s[a]}}return t}(c):!r.displayModeBar&&r.watermark?[]:function(t){var e=t._fullLayout,r=t._fullData,o=t._context,l=o.modeBarButtonsToRemove,u=o.modeBarButtonsToAdd,c=e._has("cartesian"),h=e._has("gl3d"),d=e._has("geo"),f=e._has("pie"),p=e._has("funnelarea"),m=e._has("gl2d"),g=e._has("ternary"),y=e._has("mapbox"),v=e._has("polar"),_=e._has("sankey"),x=function(t){for(var e=n.list({_fullLayout:t},null,!0),r=0;r<e.length;r++)if(!e[r].fixedrange)return!1;return!0}(e),b=[];function w(t){if(t.length){for(var e=[],r=0;r<t.length;r++){var n=t[r];-1===l.indexOf(n)&&e.push(s[n])}b.push(e)}}var M=["toImage"];o.showEditInChartStudio?M.push("editInChartStudio"):o.showSendToCloud&&M.push("sendDataToCloud"),w(M);var k=[],T=[],L=[],A=[];return(c||m||f||p||g)+d+h+y+v>1?(T=["toggleHover"],L=["resetViews"]):d?(k=["zoomInGeo","zoomOutGeo"],T=["hoverClosestGeo"],L=["resetGeo"]):h?(T=["hoverClosest3d"],L=["resetCameraDefault3d","resetCameraLastSave3d"]):y?(T=["toggleHover"],L=["resetViewMapbox"]):m?T=["hoverClosestGl2d"]:f?T=["hoverClosestPie"]:_?(T=["hoverClosestCartesian","hoverCompareCartesian"],L=["resetViewSankey"]):T=["toggleHover"],c&&(T=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]),function(t){for(var e=0;e<t.length;e++)if(!i.traceIs(t[e],"noHover"))return!1;return!0}(r)&&(T=[]),!c&&!m||x||(k=["zoomIn2d","zoomOut2d","autoScale2d"],"resetViews"!==L[0]&&(L=["resetScale2d"])),h?A=["zoom3d","pan3d","orbitRotation","tableRotation"]:(c||m)&&!x||g?A=["zoom2d","pan2d"]:y||d?A=["pan2d"]:v&&(A=["zoom2d"]),function(t){for(var e=!1,r=0;r<t.length&&!e;r++){var n=t[r];n._module&&n._module.selectPoints&&(i.traceIs(n,"scatter-like")?(a.hasMarkers(n)||a.hasText(n))&&(e=!0):i.traceIs(n,"box-violin")&&"all"!==n.boxpoints&&"all"!==n.points||(e=!0))}return e}(r)&&A.push("select2d","lasso2d"),w(A),w(k.concat(L)),w(T),function(t,e){if(e.length)if(Array.isArray(e[0]))for(var r=0;r<e.length;r++)t.push(e[r]);else t.push(e);return t}(b,u)}(t),l?l.update(t,u):e._modeBar=o(t,u)}else l&&(l.destroy(),delete e._modeBar)}},{"../../plots/cartesian/axis_ids":770,"../../registry":847,"../../traces/scatter/subtypes":1135,"./buttons":651,"./modebar":654}],654:[function(t,e,r){var n=t("d3"),a=t("fast-isnumeric"),i=t("../../lib"),o=t("../../fonts/ploticon"),s=new DOMParser;function l(t){this.container=t.container,this.element=document.createElement("div"),this.update(t.graphInfo,t.buttons),this.container.appendChild(this.element)}var u=l.prototype;u.update=function(t,e){this.graphInfo=t;var r=this.graphInfo._context,n=this.graphInfo._fullLayout,a="modebar-"+n._uid;this.element.setAttribute("id",a),this._uid=a,this.element.className="modebar","hover"===r.displayModeBar&&(this.element.className+=" modebar--hover ease-bg"),"v"===n.modebar.orientation&&(this.element.className+=" vertical",e=e.reverse());var o=n.modebar,s="hover"===r.displayModeBar?".js-plotly-plot .plotly:hover ":"";i.deleteRelatedStyleRule(a),i.addRelatedStyleRule(a,s+"#"+a+" .modebar-group","background-color: "+o.bgcolor),i.addRelatedStyleRule(a,"#"+a+" .modebar-btn .icon path","fill: "+o.color),i.addRelatedStyleRule(a,"#"+a+" .modebar-btn:hover .icon path","fill: "+o.activecolor),i.addRelatedStyleRule(a,"#"+a+" .modebar-btn.active .icon path","fill: "+o.activecolor);var l=!this.hasButtons(e),u=this.hasLogo!==r.displaylogo,c=this.locale!==r.locale;if(this.locale=r.locale,(l||u||c)&&(this.removeAllButtons(),this.updateButtons(e),r.watermark||r.displaylogo)){var h=this.getLogo();r.watermark&&(h.className=h.className+" watermark"),"v"===n.modebar.orientation?this.element.insertBefore(h,this.element.childNodes[0]):this.element.appendChild(h),this.hasLogo=!0}this.updateActiveButton()},u.updateButtons=function(t){var e=this;this.buttons=t,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach((function(t){var r=e.createGroup();t.forEach((function(t){var n=t.name;if(!n)throw new Error("must provide button 'name' in button config");if(-1!==e.buttonsNames.indexOf(n))throw new Error("button name '"+n+"' is taken");e.buttonsNames.push(n);var a=e.createButton(t);e.buttonElements.push(a),r.appendChild(a)})),e.element.appendChild(r)}))},u.createGroup=function(){var t=document.createElement("div");return t.className="modebar-group",t},u.createButton=function(t){var e=this,r=document.createElement("a");r.setAttribute("rel","tooltip"),r.className="modebar-btn";var a=t.title;void 0===a?a=t.name:"function"==typeof a&&(a=a(this.graphInfo)),(a||0===a)&&r.setAttribute("data-title",a),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");r.addEventListener("click",(function(r){t.click(e.graphInfo,r),e.updateActiveButton(r.currentTarget)})),r.setAttribute("data-toggle",t.toggle||!1),t.toggle&&n.select(r).classed("active",!0);var s=t.icon;return"function"==typeof s?r.appendChild(s()):r.appendChild(this.createIcon(s||o.question)),r.setAttribute("data-gravity",t.gravity||"n"),r},u.createIcon=function(t){var e,r=a(t.height)?Number(t.height):t.ascent-t.descent,n="http://www.w3.org/2000/svg";if(t.path){(e=document.createElementNS(n,"svg")).setAttribute("viewBox",[0,0,t.width,r].join(" ")),e.setAttribute("class","icon");var i=document.createElementNS(n,"path");i.setAttribute("d",t.path),t.transform?i.setAttribute("transform",t.transform):void 0!==t.ascent&&i.setAttribute("transform","matrix(1 0 0 -1 0 "+t.ascent+")"),e.appendChild(i)}return t.svg&&(e=s.parseFromString(t.svg,"application/xml").childNodes[0]),e.setAttribute("height","1em"),e.setAttribute("width","1em"),e},u.updateActiveButton=function(t){var e=this.graphInfo._fullLayout,r=void 0!==t?t.getAttribute("data-attr"):null;this.buttonElements.forEach((function(t){var a=t.getAttribute("data-val")||!0,o=t.getAttribute("data-attr"),s="true"===t.getAttribute("data-toggle"),l=n.select(t);if(s)o===r&&l.classed("active",!l.classed("active"));else{var u=null===o?o:i.nestedProperty(e,o).get();l.classed("active",u===a)}}))},u.hasButtons=function(t){var e=this.buttons;if(!e)return!1;if(t.length!==e.length)return!1;for(var r=0;r<t.length;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;n<t[r].length;n++)if(t[r][n].name!==e[r][n].name)return!1}return!0},u.getLogo=function(){var t=this.createGroup(),e=document.createElement("a");return e.href="https://plot.ly/",e.target="_blank",e.setAttribute("data-title",i._(this.graphInfo,"Produced with Plotly")),e.className="modebar-btn plotlyjsicon modebar-btn--logo",e.appendChild(this.createIcon(o.newplotlylogo)),t.appendChild(e),t},u.removeAllButtons=function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.hasLogo=!1},u.destroy=function(){i.removeElement(this.container.querySelector(".modebar")),i.deleteRelatedStyleRule(this._uid)},e.exports=function(t,e){var r=t._fullLayout,a=new l({graphInfo:t,container:r._modebardiv.node(),buttons:e});return r._privateplot&&n.select(a.element).append("span").classed("badge-private float--left",!0).text("PRIVATE"),a}},{"../../fonts/ploticon":699,"../../lib":719,d3:163,"fast-isnumeric":225}],655:[function(t,e,r){var n=t("../../plots/font_attributes"),a=t("../color/attributes"),i=(0,t("../../plot_api/plot_template").templatedArray)("button",{visible:{valType:"boolean",dflt:!0,editType:"plot"},step:{valType:"enumerated",values:["month","year","day","hour","minute","second","all"],dflt:"month",editType:"plot"},stepmode:{valType:"enumerated",values:["backward","todate"],dflt:"backward",editType:"plot"},count:{valType:"number",min:0,dflt:1,editType:"plot"},label:{valType:"string",editType:"plot"},editType:"plot"});e.exports={visible:{valType:"boolean",editType:"plot"},buttons:i,x:{valType:"number",min:-2,max:3,editType:"plot"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"plot"},y:{valType:"number",min:-2,max:3,editType:"plot"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"bottom",editType:"plot"},font:n({editType:"plot"}),bgcolor:{valType:"color",dflt:a.lightLine,editType:"plot"},activecolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:a.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"}},{"../../plot_api/plot_template":757,"../../plots/font_attributes":793,"../color/attributes":592}],656:[function(t,e,r){e.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}},{}],657:[function(t,e,r){var n=t("../../lib"),a=t("../color"),i=t("../../plot_api/plot_template"),o=t("../../plots/array_container_defaults"),s=t("./attributes"),l=t("./constants");function u(t,e,r,a){var i=a.calendar;function o(r,a){return n.coerce(t,e,s.buttons,r,a)}if(o("visible")){var l=o("step");"all"!==l&&(!i||"gregorian"===i||"month"!==l&&"year"!==l?o("stepmode"):e.stepmode="backward",o("count")),o("label")}}e.exports=function(t,e,r,c,h){var d=t.rangeselector||{},f=i.newContainer(e,"rangeselector");function p(t,e){return n.coerce(d,f,s,t,e)}if(p("visible",o(d,f,{name:"buttons",handleItemDefaults:u,calendar:h}).length>0)){var m=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),a=0,i=0;i<n.length;i++){var o=e[n[i]].domain;o&&(a=Math.max(o[1],a))}return[t.domain[0],a+l.yPad]}(e,r,c);p("x",m[0]),p("y",m[1]),n.noneOrAll(t,e,["x","y"]),p("xanchor"),p("yanchor"),n.coerceFont(p,"font",r.font);var g=p("bgcolor");p("activecolor",a.contrast(g,l.lightAmount,l.darkAmount)),p("bordercolor"),p("borderwidth")}}},{"../../lib":719,"../../plot_api/plot_template":757,"../../plots/array_container_defaults":763,"../color":593,"./attributes":655,"./constants":656}],658:[function(t,e,r){var n=t("d3"),a=t("../../registry"),i=t("../../plots/plots"),o=t("../color"),s=t("../drawing"),l=t("../../lib"),u=t("../../lib/svg_text_utils"),c=t("../../plots/cartesian/axis_ids"),h=t("../../constants/alignment"),d=h.LINE_SPACING,f=h.FROM_TL,p=h.FROM_BR,m=t("./constants"),g=t("./get_update_object");function y(t){return t._id}function v(t,e,r){var n=l.ensureSingle(t,"rect","selector-rect",(function(t){t.attr("shape-rendering","crispEdges")}));n.attr({rx:m.rx,ry:m.ry}),n.call(o.stroke,e.bordercolor).call(o.fill,function(t,e){return e._isActive||e._isHovered?t.activecolor:t.bgcolor}(e,r)).style("stroke-width",e.borderwidth+"px")}function _(t,e,r,n){l.ensureSingle(t,"text","selector-text",(function(t){t.classed("user-select-none",!0).attr("text-anchor","middle")})).call(s.font,e.font).text(function(t,e){return t.label?e?l.templateString(t.label,e):t.label:"all"===t.step?"all":t.count+t.step.charAt(0)}(r,n._fullLayout._meta)).call((function(t){u.convertToTspans(t,n)}))}e.exports=function(t){var e=t._fullLayout._infolayer.selectAll(".rangeselector").data(function(t){for(var e=c.list(t,"x",!0),r=[],n=0;n<e.length;n++){var a=e[n];a.rangeselector&&a.rangeselector.visible&&r.push(a)}return r}(t),y);e.enter().append("g").classed("rangeselector",!0),e.exit().remove(),e.style({cursor:"pointer","pointer-events":"all"}),e.each((function(e){var r=n.select(this),o=e,c=o.rangeselector,h=r.selectAll("g.button").data(l.filterVisible(c.buttons));h.enter().append("g").classed("button",!0),h.exit().remove(),h.each((function(e){var r=n.select(this),i=g(o,e);e._isActive=function(t,e,r){if("all"===e.step)return!0===t.autorange;var n=Object.keys(r);return t.range[0]===r[n[0]]&&t.range[1]===r[n[1]]}(o,e,i),r.call(v,c,e),r.call(_,c,e,t),r.on("click",(function(){t._dragged||a.call("_guiRelayout",t,i)})),r.on("mouseover",(function(){e._isHovered=!0,r.call(v,c,e)})),r.on("mouseout",(function(){e._isHovered=!1,r.call(v,c,e)}))})),function(t,e,r,a,o){var c=0,h=0,g=r.borderwidth;e.each((function(){var t=n.select(this).select(".selector-text"),e=r.font.size*d,a=Math.max(e*u.lineCount(t),16)+3;h=Math.max(h,a)})),e.each((function(){var t=n.select(this),e=t.select(".selector-rect"),a=t.select(".selector-text"),i=a.node()&&s.bBox(a.node()).width,o=r.font.size*d,l=u.lineCount(a),f=Math.max(i+10,m.minButtonWidth);t.attr("transform","translate("+(g+c)+","+g+")"),e.attr({x:0,y:0,width:f,height:h}),u.positionText(a,f/2,h/2-(l-1)*o/2+3),c+=f+5}));var y=t._fullLayout._size,v=y.l+y.w*r.x,_=y.t+y.h*(1-r.y),x="left";l.isRightAnchor(r)&&(v-=c,x="right"),l.isCenterAnchor(r)&&(v-=c/2,x="center");var b="top";l.isBottomAnchor(r)&&(_-=h,b="bottom"),l.isMiddleAnchor(r)&&(_-=h/2,b="middle"),c=Math.ceil(c),h=Math.ceil(h),v=Math.round(v),_=Math.round(_),i.autoMargin(t,a+"-range-selector",{x:r.x,y:r.y,l:c*f[x],r:c*p[x],b:h*p[b],t:h*f[b]}),o.attr("transform","translate("+v+","+_+")")}(t,h,c,o._name,r)}))}},{"../../constants/alignment":688,"../../lib":719,"../../lib/svg_text_utils":743,"../../plots/cartesian/axis_ids":770,"../../plots/plots":828,"../../registry":847,"../color":593,"../drawing":614,"./constants":656,"./get_update_object":659,d3:163}],659:[function(t,e,r){var n=t("d3");e.exports=function(t,e){var r=t._name,a={};if("all"===e.step)a[r+".autorange"]=!0;else{var i=function(t,e){var r,a=t.range,i=new Date(t.r2l(a[1])),o=e.step,s=e.count;switch(e.stepmode){case"backward":r=t.l2r(+n.time[o].utc.offset(i,-s));break;case"todate":var l=n.time[o].utc.offset(i,-s);r=t.l2r(+n.time[o].utc.ceil(l))}return[r,a[1]]}(t,e);a[r+".range[0]"]=i[0],a[r+".range[1]"]=i[1]}return a}},{d3:163}],660:[function(t,e,r){e.exports={moduleType:"component",name:"rangeselector",schema:{subplots:{xaxis:{rangeselector:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":655,"./defaults":657,"./draw":658}],661:[function(t,e,r){var n=t("../color/attributes");e.exports={bgcolor:{valType:"color",dflt:n.background,editType:"plot"},bordercolor:{valType:"color",dflt:n.defaultLine,editType:"plot"},borderwidth:{valType:"integer",dflt:0,min:0,editType:"plot"},autorange:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},range:{valType:"info_array",items:[{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}}],editType:"calc",impliedEdits:{autorange:!1}},thickness:{valType:"number",dflt:.15,min:0,max:1,editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"}},{"../color/attributes":592}],662:[function(t,e,r){var n=t("../../plots/cartesian/axis_ids").list,a=t("../../plots/cartesian/autorange").getAutoRange,i=t("./constants");e.exports=function(t){for(var e=n(t,"x",!0),r=0;r<e.length;r++){var o=e[r],s=o[i.name];s&&s.visible&&s.autorange&&(s._input.autorange=!0,s._input.range=s.range=a(t,o))}}},{"../../plots/cartesian/autorange":766,"../../plots/cartesian/axis_ids":770,"./constants":663}],663:[function(t,e,r){e.exports={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskMinOppAxisClassName:"rangeslider-mask-min-opp-axis",maskMaxOppAxisClassName:"rangeslider-mask-max-opp-axis",maskColor:"rgba(0,0,0,0.4)",maskOppAxisColor:"rgba(0,0,0,0.2)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}},{}],664:[function(t,e,r){var n=t("../../lib"),a=t("../../plot_api/plot_template"),i=t("../../plots/cartesian/axis_ids"),o=t("./attributes"),s=t("./oppaxis_attributes");e.exports=function(t,e,r){var l=t[r],u=e[r];if(l.rangeslider||e._requestRangeslider[u._id]){n.isPlainObject(l.rangeslider)||(l.rangeslider={});var c,h,d=l.rangeslider,f=a.newContainer(u,"rangeslider");if(b("visible")){b("bgcolor",e.plot_bgcolor),b("bordercolor"),b("borderwidth"),b("thickness"),b("autorange",!u.isValidRange(d.range)),b("range");var p=e._subplots;if(p)for(var m=p.cartesian.filter((function(t){return t.substr(0,t.indexOf("y"))===i.name2id(r)})).map((function(t){return t.substr(t.indexOf("y"),t.length)})),g=n.simpleMap(m,i.id2name),y=0;y<g.length;y++){var v=g[y];c=d[v]||{},h=a.newContainer(f,v,"yaxis");var _,x=e[v];c.range&&x.isValidRange(c.range)&&(_="fixed"),"match"!==w("rangemode",_)&&w("range",x.range.slice())}f._input=d}}function b(t,e){return n.coerce(d,f,o,t,e)}function w(t,e){return n.coerce(c,h,s,t,e)}}},{"../../lib":719,"../../plot_api/plot_template":757,"../../plots/cartesian/axis_ids":770,"./attributes":661,"./oppaxis_attributes":668}],665:[function(t,e,r){var n=t("d3"),a=t("../../registry"),i=t("../../plots/plots"),o=t("../../lib"),s=t("../drawing"),l=t("../color"),u=t("../titles"),c=t("../../plots/cartesian"),h=t("../../plots/cartesian/axis_ids"),d=t("../dragelement"),f=t("../../lib/setcursor"),p=t("./constants");function m(t,e,r,n){var a=o.ensureSingle(t,"rect",p.bgClassName,(function(t){t.attr({x:0,y:0,"shape-rendering":"crispEdges"})})),i=n.borderwidth%2==0?n.borderwidth:n.borderwidth-1,l=-n._offsetShift,u=s.crispRound(e,n.borderwidth);a.attr({width:n._width+i,height:n._height+i,transform:"translate("+l+","+l+")",fill:n.bgcolor,stroke:n.bordercolor,"stroke-width":u})}function g(t,e,r,n){var a=e._fullLayout;o.ensureSingleById(a._topdefs,"clipPath",n._clipId,(function(t){t.append("rect").attr({x:0,y:0})})).select("rect").attr({width:n._width,height:n._height})}function y(t,e,r,a){var l,u=e.calcdata,d=t.selectAll("g."+p.rangePlotClassName).data(r._subplotsWith,o.identity);d.enter().append("g").attr("class",(function(t){return p.rangePlotClassName+" "+t})).call(s.setClipUrl,a._clipId,e),d.order(),d.exit().remove(),d.each((function(t,o){var s=n.select(this),d=0===o,f=h.getFromId(e,t,"y"),p=f._name,m=a[p],g={data:[],layout:{xaxis:{type:r.type,domain:[0,1],range:a.range.slice(),calendar:r.calendar},width:a._width,height:a._height,margin:{t:0,b:0,l:0,r:0}},_context:e._context};g.layout[p]={type:f.type,domain:[0,1],range:"match"!==m.rangemode?m.range.slice():f.range.slice(),calendar:f.calendar},i.supplyDefaults(g);var y=g._fullLayout.xaxis,v=g._fullLayout[p];y.clearCalc(),y.setScale(),v.clearCalc(),v.setScale();var _={id:t,plotgroup:s,xaxis:y,yaxis:v,isRangePlot:!0};d?l=_:(_.mainplot="xy",_.mainplotinfo=l),c.rangePlot(e,_,function(t,e){for(var r=[],n=0;n<t.length;n++){var a=t[n],i=a[0].trace;i.xaxis+i.yaxis===e&&r.push(a)}return r}(u,t))}))}function v(t,e,r,n,a){o.ensureSingle(t,"rect",p.maskMinClassName,(function(t){t.attr({x:0,y:0,"shape-rendering":"crispEdges"})})).attr("height",n._height).call(l.fill,p.maskColor),o.ensureSingle(t,"rect",p.maskMaxClassName,(function(t){t.attr({y:0,"shape-rendering":"crispEdges"})})).attr("height",n._height).call(l.fill,p.maskColor),"match"!==a.rangemode&&(o.ensureSingle(t,"rect",p.maskMinOppAxisClassName,(function(t){t.attr({y:0,"shape-rendering":"crispEdges"})})).attr("width",n._width).call(l.fill,p.maskOppAxisColor),o.ensureSingle(t,"rect",p.maskMaxOppAxisClassName,(function(t){t.attr({y:0,"shape-rendering":"crispEdges"})})).attr("width",n._width).style("border-top",p.maskOppBorder).call(l.fill,p.maskOppAxisColor))}function _(t,e,r,n){e._context.staticPlot||o.ensureSingle(t,"rect",p.slideBoxClassName,(function(t){t.attr({y:0,cursor:p.slideBoxCursor,"shape-rendering":"crispEdges"})})).attr({height:n._height,fill:p.slideBoxFill})}function x(t,e,r,n){var a=o.ensureSingle(t,"g",p.grabberMinClassName),i=o.ensureSingle(t,"g",p.grabberMaxClassName),s={x:0,width:p.handleWidth,rx:p.handleRadius,fill:l.background,stroke:l.defaultLine,"stroke-width":p.handleStrokeWidth,"shape-rendering":"crispEdges"},u={y:Math.round(n._height/4),height:Math.round(n._height/2)};if(o.ensureSingle(a,"rect",p.handleMinClassName,(function(t){t.attr(s)})).attr(u),o.ensureSingle(i,"rect",p.handleMaxClassName,(function(t){t.attr(s)})).attr(u),!e._context.staticPlot){var c={width:p.grabAreaWidth,x:0,y:0,fill:p.grabAreaFill,cursor:p.grabAreaCursor};o.ensureSingle(a,"rect",p.grabAreaMinClassName,(function(t){t.attr(c)})).attr("height",n._height),o.ensureSingle(i,"rect",p.grabAreaMaxClassName,(function(t){t.attr(c)})).attr("height",n._height)}}e.exports=function(t){for(var e=t._fullLayout,r=e._rangeSliderData,i=0;i<r.length;i++){var s=r[i][p.name];s._clipId=s._id+"-"+e._uid}var l=e._infolayer.selectAll("g."+p.containerClassName).data(r,(function(t){return t._name}));l.exit().each((function(t){var r=t[p.name];e._topdefs.select("#"+r._clipId).remove()})).remove(),0!==r.length&&(l.enter().append("g").classed(p.containerClassName,!0).attr("pointer-events","all"),l.each((function(r){var i=n.select(this),s=r[p.name],l=e[h.id2name(r.anchor)],c=s[h.id2name(r.anchor)];if(s.range){var b,w=o.simpleMap(s.range,r.r2l),M=o.simpleMap(r.range,r.r2l);b=M[0]<M[1]?[Math.min(w[0],M[0]),Math.max(w[1],M[1])]:[Math.max(w[0],M[0]),Math.min(w[1],M[1])],s.range=s._input.range=o.simpleMap(b,r.l2r)}r.cleanRange("rangeslider.range");var k=e.margin,T=e._size,L=r.domain,A=s._tickHeight,S=s._oppBottom;s._width=T.w*(L[1]-L[0]);var E=Math.round(k.l+T.w*L[0]),C=Math.round(T.t+T.h*(1-S)+A+s._offsetShift+p.extraPad);i.attr("transform","translate("+E+","+C+")");var D=r.r2l(s.range[0]),P=r.r2l(s.range[1]),O=P-D;if(s.p2d=function(t){return t/s._width*O+D},s.d2p=function(t){return(t-D)/O*s._width},s._rl=[D,P],"match"!==c.rangemode){var z=l.r2l(c.range[0]),I=l.r2l(c.range[1])-z;s.d2pOppAxis=function(t){return(t-z)/I*s._height}}i.call(m,t,r,s).call(g,t,r,s).call(y,t,r,s).call(v,t,r,s,c).call(_,t,r,s).call(x,t,r,s),function(t,e,r,i){var s=t.select("rect."+p.slideBoxClassName).node(),l=t.select("rect."+p.grabAreaMinClassName).node(),u=t.select("rect."+p.grabAreaMaxClassName).node();t.on("mousedown",(function(){var c=n.event,h=c.target,p=c.clientX,m=p-t.node().getBoundingClientRect().left,g=i.d2p(r._rl[0]),y=i.d2p(r._rl[1]),v=d.coverSlip();function _(t){var c,d,_,x=+t.clientX-p;switch(h){case s:_="ew-resize",c=g+x,d=y+x;break;case l:_="col-resize",c=g+x,d=y;break;case u:_="col-resize",c=g,d=y+x;break;default:_="ew-resize",c=m,d=m+x}if(d<c){var b=d;d=c,c=b}i._pixelMin=c,i._pixelMax=d,f(n.select(v),_),function(t,e,r,n){function i(t){return r.l2r(o.constrain(t,n._rl[0],n._rl[1]))}var s=i(n.p2d(n._pixelMin)),l=i(n.p2d(n._pixelMax));window.requestAnimationFrame((function(){a.call("_guiRelayout",e,r._name+".range",[s,l])}))}(0,e,r,i)}v.addEventListener("mousemove",_),v.addEventListener("mouseup",(function t(){v.removeEventListener("mousemove",_),v.removeEventListener("mouseup",t),o.removeElement(v)}))}))}(i,t,r,s),function(t,e,r,n,a,i){var s=p.handleWidth/2;function l(t){return o.constrain(t,0,n._width)}function u(t){return o.constrain(t,0,n._height)}function c(t){return o.constrain(t,-s,n._width+s)}var h=l(n.d2p(r._rl[0])),d=l(n.d2p(r._rl[1]));if(t.select("rect."+p.slideBoxClassName).attr("x",h).attr("width",d-h),t.select("rect."+p.maskMinClassName).attr("width",h),t.select("rect."+p.maskMaxClassName).attr("x",d).attr("width",n._width-d),"match"!==i.rangemode){var f=n._height-u(n.d2pOppAxis(a._rl[1])),m=n._height-u(n.d2pOppAxis(a._rl[0]));t.select("rect."+p.maskMinOppAxisClassName).attr("x",h).attr("height",f).attr("width",d-h),t.select("rect."+p.maskMaxOppAxisClassName).attr("x",h).attr("y",m).attr("height",n._height-m).attr("width",d-h),t.select("rect."+p.slideBoxClassName).attr("y",f).attr("height",m-f)}var g=Math.round(c(h-s))-.5,y=Math.round(c(d-s))+.5;t.select("g."+p.grabberMinClassName).attr("transform","translate("+g+",0.5)"),t.select("g."+p.grabberMaxClassName).attr("transform","translate("+y+",0.5)")}(i,0,r,s,l,c),"bottom"===r.side&&u.draw(t,r._id+"title",{propContainer:r,propName:r._name+".title",placeholder:e._dfltTitle.x,attributes:{x:r._offset+r._length/2,y:C+s._height+s._offsetShift+10+1.5*r.title.font.size,"text-anchor":"middle"}})})))}},{"../../lib":719,"../../lib/setcursor":739,"../../plots/cartesian":778,"../../plots/cartesian/axis_ids":770,"../../plots/plots":828,"../../registry":847,"../color":593,"../dragelement":611,"../drawing":614,"../titles":681,"./constants":663,d3:163}],666:[function(t,e,r){var n=t("../../plots/cartesian/axis_ids"),a=t("./constants"),i=a.name;function o(t){var e=t&&t[i];return e&&e.visible}r.isVisible=o,r.makeData=function(t){var e=n.list({_fullLayout:t},"x",!0),r=t.margin,a=[];if(!t._has("gl2d"))for(var s=0;s<e.length;s++){var l=e[s];if(o(l)){a.push(l);var u=l[i];u._id=i+l._id,u._height=(t.height-r.b-r.t)*u.thickness,u._offsetShift=Math.floor(u.borderwidth/2)}}t._rangeSliderData=a},r.autoMarginOpts=function(t,e){for(var r=e[i],o=1/0,s=e._counterAxes,l=0;l<s.length;l++){var u=s[l],c=n.getFromId(t,u);o=Math.min(o,c.domain[0])}r._oppBottom=o;var h="bottom"===e.side&&e._boundingBox.height||0;return r._tickHeight=h,{x:0,y:o,l:0,r:0,t:0,b:r._height+t._fullLayout.margin.b+h,pad:a.extraPad+2*r._offsetShift}}},{"../../plots/cartesian/axis_ids":770,"./constants":663}],667:[function(t,e,r){var n=t("../../lib"),a=t("./attributes"),i=t("./oppaxis_attributes"),o=t("./helpers");e.exports={moduleType:"component",name:"rangeslider",schema:{subplots:{xaxis:{rangeslider:n.extendFlat({},a,{yaxis:i})}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),calcAutorange:t("./calc_autorange"),draw:t("./draw"),isVisible:o.isVisible,makeData:o.makeData,autoMarginOpts:o.autoMarginOpts}},{"../../lib":719,"./attributes":661,"./calc_autorange":662,"./defaults":664,"./draw":665,"./helpers":666,"./oppaxis_attributes":668}],668:[function(t,e,r){e.exports={_isSubplotObj:!0,rangemode:{valType:"enumerated",values:["auto","fixed","match"],dflt:"match",editType:"calc"},range:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},editType:"calc"}},{}],669:[function(t,e,r){var n=t("../annotations/attributes"),a=t("../../traces/scatter/attributes").line,i=t("../drawing/attributes").dash,o=t("../../lib/extend").extendFlat,s=t("../../plot_api/plot_template").templatedArray;e.exports=s("shape",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},xref:o({},n.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},yref:o({},n.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:o({},a.color,{editType:"arraydraw"}),width:o({},a.width,{editType:"calc+arraydraw"}),dash:o({},i,{editType:"arraydraw"}),editType:"calc+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},editType:"arraydraw"})},{"../../lib/extend":710,"../../plot_api/plot_template":757,"../../traces/scatter/attributes":1112,"../annotations/attributes":576,"../drawing/attributes":613}],670:[function(t,e,r){var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("./constants"),o=t("./helpers");function s(t){return u(t.line.width,t.xsizemode,t.x0,t.x1,t.path,!1)}function l(t){return u(t.line.width,t.ysizemode,t.y0,t.y1,t.path,!0)}function u(t,e,r,a,s,l){var u=t/2,c=l;if("pixel"===e){var h=s?o.extractPathCoords(s,l?i.paramIsY:i.paramIsX):[r,a],d=n.aggNums(Math.max,null,h),f=n.aggNums(Math.min,null,h),p=f<0?Math.abs(f)+u:u,m=d>0?d+u:u;return{ppad:u,ppadplus:c?p:m,ppadminus:c?m:p}}return{ppad:u}}function c(t,e,r,n,a){var s="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,u,c,h,d=1/0,f=-1/0,p=n.match(i.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;l<p.length;l++)void 0!==(u=a[p[l].charAt(0)].drawn)&&(!(c=p[l].substr(1).match(i.paramRE))||c.length<u||((h=s(c[u]))<d&&(d=h),h>f&&(f=h)));return f>=d?[d,f]:void 0}}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var o=0;o<r.length;o++){var u,h,d=r[o];if(d._extremes={},"paper"!==d.xref){var f="pixel"===d.xsizemode?d.xanchor:d.x0,p="pixel"===d.xsizemode?d.xanchor:d.x1;(h=c(u=a.getFromId(t,d.xref),f,p,d.path,i.paramIsX))&&(d._extremes[u._id]=a.findExtremes(u,h,s(d)))}if("paper"!==d.yref){var m="pixel"===d.ysizemode?d.yanchor:d.y0,g="pixel"===d.ysizemode?d.yanchor:d.y1;(h=c(u=a.getFromId(t,d.yref),m,g,d.path,i.paramIsY))&&(d._extremes[u._id]=a.findExtremes(u,h,l(d)))}}}},{"../../lib":719,"../../plots/cartesian/axes":767,"./constants":671,"./helpers":674}],671:[function(t,e,r){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}}},{}],672:[function(t,e,r){var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../../plots/array_container_defaults"),o=t("./attributes"),s=t("./helpers");function l(t,e,r){function i(r,a){return n.coerce(t,e,o,r,a)}if(i("visible")){i("layer"),i("opacity"),i("fillcolor"),i("line.color"),i("line.width"),i("line.dash");for(var l=i("type",t.path?"path":"rect"),u=i("xsizemode"),c=i("ysizemode"),h=["x","y"],d=0;d<2;d++){var f,p,m,g=h[d],y=g+"anchor",v="x"===g?u:c,_={_fullLayout:r},x=a.coerceRef(t,e,_,g,"","paper");if("paper"!==x?((f=a.getFromId(_,x))._shapeIndices.push(e._index),m=s.rangeToShapePosition(f),p=s.shapePositionToRange(f)):p=m=n.identity,"path"!==l){var b=g+"0",w=g+"1",M=t[b],k=t[w];t[b]=p(t[b],!0),t[w]=p(t[w],!0),"pixel"===v?(i(b,0),i(w,10)):(a.coercePosition(e,_,i,x,b,.25),a.coercePosition(e,_,i,x,w,.75)),e[b]=m(e[b]),e[w]=m(e[w]),t[b]=M,t[w]=k}if("pixel"===v){var T=t[y];t[y]=p(t[y],!0),a.coercePosition(e,_,i,x,y,.25),e[y]=m(e[y]),t[y]=T}}"path"===l?i("path"):n.noneOrAll(t,e,["x0","x1","y0","y1"])}}e.exports=function(t,e){i(t,e,{name:"shapes",handleItemDefaults:l})}},{"../../lib":719,"../../plots/array_container_defaults":763,"../../plots/cartesian/axes":767,"./attributes":669,"./helpers":674}],673:[function(t,e,r){var n=t("../../registry"),a=t("../../lib"),i=t("../../plots/cartesian/axes"),o=t("../color"),s=t("../drawing"),l=t("../../plot_api/plot_template").arrayEditor,u=t("../dragelement"),c=t("../../lib/setcursor"),h=t("./constants"),d=t("./helpers");function f(t,e){t._fullLayout._paperdiv.selectAll('.shapelayer [data-index="'+e+'"]').remove();var r=t._fullLayout.shapes[e]||{};if(r._input&&!1!==r.visible)if("below"!==r.layer)y(t._fullLayout._shapeUpperLayer);else if("paper"===r.xref||"paper"===r.yref)y(t._fullLayout._shapeLowerLayer);else{var f=t._fullLayout._plots[r.xref+r.yref];y(f?(f.mainplotinfo||f).shapelayer:t._fullLayout._shapeLowerLayer)}function y(f){var y={"data-index":e,"fill-rule":"evenodd",d:m(t,r)},v=r.line.width?r.line.color:"rgba(0,0,0,0)",_=f.append("path").attr(y).style("opacity",r.opacity).call(o.stroke,v).call(o.fill,r.fillcolor).call(s.dashLine,r.line.dash,r.line.width);p(_,t,r),t._context.edits.shapePosition&&function(t,e,r,o,f){var y,v,_,x,b,w,M,k,T,L,A,S,E,C,D,P,O="pixel"===r.xsizemode,z="pixel"===r.ysizemode,I="line"===r.type,R="path"===r.type,F=l(t.layout,"shapes",r),N=F.modifyItem,Y=i.getFromId(t,r.xref),j=i.getFromId(t,r.yref),B=d.getDataToPixel(t,Y),H=d.getDataToPixel(t,j,!0),U=d.getPixelToData(t,Y),V=d.getPixelToData(t,j,!0),W=I?function(){var t=Math.max(r.line.width,10),n=f.append("g").attr("data-index",o);n.append("path").attr("d",e.attr("d")).style({cursor:"move","stroke-width":t,"stroke-opacity":"0"});var a={"fill-opacity":"0"},i=t/2>10?t/2:10;return n.append("circle").attr({"data-line-point":"start-point",cx:O?B(r.xanchor)+r.x0:B(r.x0),cy:z?H(r.yanchor)-r.y0:H(r.y0),r:i}).style(a).classed("cursor-grab",!0),n.append("circle").attr({"data-line-point":"end-point",cx:O?B(r.xanchor)+r.x1:B(r.x1),cy:z?H(r.yanchor)-r.y1:H(r.y1),r:i}).style(a).classed("cursor-grab",!0),n}():e,G={element:W.node(),gd:t,prepFn:function(n){O&&(b=B(r.xanchor)),z&&(w=H(r.yanchor)),"path"===r.type?D=r.path:(y=O?r.x0:B(r.x0),v=z?r.y0:H(r.y0),_=O?r.x1:B(r.x1),x=z?r.y1:H(r.y1)),y<_?(T=y,E="x0",L=_,C="x1"):(T=_,E="x1",L=y,C="x0"),!z&&v<x||z&&v>x?(M=v,A="y0",k=x,S="y1"):(M=x,A="y1",k=v,S="y0"),q(n),J(f,r),function(t,e,r){var n=e.xref,a=e.yref,o=i.getFromId(r,n),l=i.getFromId(r,a),u="";"paper"===n||o.autorange||(u+=n),"paper"===a||l.autorange||(u+=a),s.setClipUrl(t,u?"clip"+r._fullLayout._uid+u:null,r)}(e,r,t),G.moveFn="move"===P?Z:X},doneFn:function(){c(e),K(f),p(e,t,r),n.call("_guiRelayout",t,F.getUpdateObj())},clickFn:function(){K(f)}};function q(t){if(I)P="path"===t.target.tagName?"move":"start-point"===t.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var r=G.element.getBoundingClientRect(),n=r.right-r.left,a=r.bottom-r.top,i=t.clientX-r.left,o=t.clientY-r.top,s=!R&&n>10&&a>10&&!t.shiftKey?u.getCursor(i/n,1-o/a):"move";c(e,s),P=s.split("-")[0]}}function Z(n,a){if("path"===r.type){var i=function(t){return t},o=i,s=i;O?N("xanchor",r.xanchor=U(b+n)):(o=function(t){return U(B(t)+n)},Y&&"date"===Y.type&&(o=d.encodeDate(o))),z?N("yanchor",r.yanchor=V(w+a)):(s=function(t){return V(H(t)+a)},j&&"date"===j.type&&(s=d.encodeDate(s))),N("path",r.path=g(D,o,s))}else O?N("xanchor",r.xanchor=U(b+n)):(N("x0",r.x0=U(y+n)),N("x1",r.x1=U(_+n))),z?N("yanchor",r.yanchor=V(w+a)):(N("y0",r.y0=V(v+a)),N("y1",r.y1=V(x+a)));e.attr("d",m(t,r)),J(f,r)}function X(n,a){if(R){var i=function(t){return t},o=i,s=i;O?N("xanchor",r.xanchor=U(b+n)):(o=function(t){return U(B(t)+n)},Y&&"date"===Y.type&&(o=d.encodeDate(o))),z?N("yanchor",r.yanchor=V(w+a)):(s=function(t){return V(H(t)+a)},j&&"date"===j.type&&(s=d.encodeDate(s))),N("path",r.path=g(D,o,s))}else if(I){if("resize-over-start-point"===P){var l=y+n,u=z?v-a:v+a;N("x0",r.x0=O?l:U(l)),N("y0",r.y0=z?u:V(u))}else if("resize-over-end-point"===P){var c=_+n,h=z?x-a:x+a;N("x1",r.x1=O?c:U(c)),N("y1",r.y1=z?h:V(h))}}else{var p=~P.indexOf("n")?M+a:M,F=~P.indexOf("s")?k+a:k,W=~P.indexOf("w")?T+n:T,G=~P.indexOf("e")?L+n:L;~P.indexOf("n")&&z&&(p=M-a),~P.indexOf("s")&&z&&(F=k-a),(!z&&F-p>10||z&&p-F>10)&&(N(A,r[A]=z?p:V(p)),N(S,r[S]=z?F:V(F))),G-W>10&&(N(E,r[E]=O?W:U(W)),N(C,r[C]=O?G:U(G)))}e.attr("d",m(t,r)),J(f,r)}function J(t,e){(O||z)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=B(O?e.xanchor:a.midRange(r?[e.x0,e.x1]:d.extractPathCoords(e.path,h.paramIsX))),o=H(z?e.yanchor:a.midRange(r?[e.y0,e.y1]:d.extractPathCoords(e.path,h.paramIsY)));if(i=d.roundPositionForSharpStrokeRendering(i,1),o=d.roundPositionForSharpStrokeRendering(o,1),O&&z){var s="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(O){var l="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var u="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",u)}}()}function K(t){t.selectAll(".visual-cue").remove()}u.init(G),W.node().onmousemove=q}(t,_,r,e,f)}}function p(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"");s.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function m(t,e){var r,n,o,s,l,u,c,f,p=e.type,m=i.getFromId(t,e.xref),g=i.getFromId(t,e.yref),y=t._fullLayout._size;if(m?(r=d.shapePositionToRange(m),n=function(t){return m._offset+m.r2p(r(t,!0))}):n=function(t){return y.l+y.w*t},g?(o=d.shapePositionToRange(g),s=function(t){return g._offset+g.r2p(o(t,!0))}):s=function(t){return y.t+y.h*(1-t)},"path"===p)return m&&"date"===m.type&&(n=d.decodeDate(n)),g&&"date"===g.type&&(s=d.decodeDate(s)),function(t,e,r){var n=t.path,i=t.xsizemode,o=t.ysizemode,s=t.xanchor,l=t.yanchor;return n.replace(h.segmentRE,(function(t){var n=0,u=t.charAt(0),c=h.paramIsX[u],d=h.paramIsY[u],f=h.numParams[u],p=t.substr(1).replace(h.paramRE,(function(t){return c[n]?t="pixel"===i?e(s)+Number(t):e(t):d[n]&&(t="pixel"===o?r(l)-Number(t):r(t)),++n>f&&(t="X"),t}));return n>f&&(p=p.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+t)),u+p}))}(e,n,s);if("pixel"===e.xsizemode){var v=n(e.xanchor);l=v+e.x0,u=v+e.x1}else l=n(e.x0),u=n(e.x1);if("pixel"===e.ysizemode){var _=s(e.yanchor);c=_-e.y0,f=_-e.y1}else c=s(e.y0),f=s(e.y1);if("line"===p)return"M"+l+","+c+"L"+u+","+f;if("rect"===p)return"M"+l+","+c+"H"+u+"V"+f+"H"+l+"Z";var x=(l+u)/2,b=(c+f)/2,w=Math.abs(x-l),M=Math.abs(b-c),k="A"+w+","+M,T=x+w+","+b;return"M"+T+k+" 0 1,1 "+x+","+(b-M)+k+" 0 0,1 "+T+"Z"}function g(t,e,r){return t.replace(h.segmentRE,(function(t){var n=0,a=t.charAt(0),i=h.paramIsX[a],o=h.paramIsY[a],s=h.numParams[a];return a+t.substr(1).replace(h.paramRE,(function(t){return n>=s||(i[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}e.exports={draw:function(t){var e=t._fullLayout;for(var r in e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._plots){var n=e._plots[r].shapelayer;n&&n.selectAll("path").remove()}for(var a=0;a<e.shapes.length;a++)e.shapes[a].visible&&f(t,a)},drawOne:f}},{"../../lib":719,"../../lib/setcursor":739,"../../plot_api/plot_template":757,"../../plots/cartesian/axes":767,"../../registry":847,"../color":593,"../dragelement":611,"../drawing":614,"./constants":671,"./helpers":674}],674:[function(t,e,r){var n=t("./constants"),a=t("../../lib");r.rangeToShapePosition=function(t){return"log"===t.type?t.r2d:function(t){return t}},r.shapePositionToRange=function(t){return"log"===t.type?t.d2r:function(t){return t}},r.decodeDate=function(t){return function(e){return e.replace&&(e=e.replace("_"," ")),t(e)}},r.encodeDate=function(t){return function(e){return t(e).replace(" ","_")}},r.extractPathCoords=function(t,e){var r=[];return t.match(n.segmentRE).forEach((function(t){var i=e[t.charAt(0)].drawn;if(void 0!==i){var o=t.substr(1).match(n.paramRE);!o||o.length<i||r.push(a.cleanNumber(o[i]))}})),r},r.getDataToPixel=function(t,e,n){var a,i=t._fullLayout._size;if(e){var o=r.shapePositionToRange(e);a=function(t){return e._offset+e.r2p(o(t,!0))},"date"===e.type&&(a=r.decodeDate(a))}else a=n?function(t){return i.t+i.h*(1-t)}:function(t){return i.l+i.w*t};return a},r.getPixelToData=function(t,e,n){var a,i=t._fullLayout._size;if(e){var o=r.rangeToShapePosition(e);a=function(t){return o(e.p2r(t-e._offset))}}else a=n?function(t){return 1-(t-i.t)/i.h}:function(t){return(t-i.l)/i.w};return a},r.roundPositionForSharpStrokeRendering=function(t,e){var r=1===Math.round(e%2),n=Math.round(t);return r?n+.5:n}},{"../../lib":719,"./constants":671}],675:[function(t,e,r){var n=t("./draw");e.exports={moduleType:"component",name:"shapes",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),includeBasePlot:t("../../plots/cartesian/include_components")("shapes"),calcAutorange:t("./calc_autorange"),draw:n.draw,drawOne:n.drawOne}},{"../../plots/cartesian/include_components":777,"./attributes":669,"./calc_autorange":670,"./defaults":672,"./draw":673}],676:[function(t,e,r){var n=t("../../plots/font_attributes"),a=t("../../plots/pad_attributes"),i=t("../../lib/extend").extendDeepAll,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/animation_attributes"),l=t("../../plot_api/plot_template").templatedArray,u=t("./constants"),c=l("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:c,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:i(a({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:s.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:n({})},font:n({}),activebgcolor:{valType:"color",dflt:u.gripBgActiveColor},bgcolor:{valType:"color",dflt:u.railBgColor},bordercolor:{valType:"color",dflt:u.railBorderColor},borderwidth:{valType:"number",min:0,dflt:u.railBorderWidth},ticklen:{valType:"number",min:0,dflt:u.tickLength},tickcolor:{valType:"color",dflt:u.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:u.minorTickLength}}),"arraydraw","from-root")},{"../../lib/extend":710,"../../plot_api/edit_types":750,"../../plot_api/plot_template":757,"../../plots/animation_attributes":762,"../../plots/font_attributes":793,"../../plots/pad_attributes":827,"./constants":677}],677:[function(t,e,r){e.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},{}],678:[function(t,e,r){var n=t("../../lib"),a=t("../../plots/array_container_defaults"),i=t("./attributes"),o=t("./constants").name,s=i.steps;function l(t,e,r){function o(r,a){return n.coerce(t,e,i,r,a)}for(var s=a(t,e,{name:"steps",handleItemDefaults:u}),l=0,c=0;c<s.length;c++)s[c].visible&&l++;if(l<2?e.visible=!1:o("visible")){e._stepCount=l;var h=e._visibleSteps=n.filterVisible(s);(s[o("active")]||{}).visible||(e.active=h[0]._index),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("len"),o("lenmode"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("currentvalue.visible")&&(o("currentvalue.xanchor"),o("currentvalue.prefix"),o("currentvalue.suffix"),o("currentvalue.offset"),n.coerceFont(o,"currentvalue.font",e.font)),o("transition.duration"),o("transition.easing"),o("bgcolor"),o("activebgcolor"),o("bordercolor"),o("borderwidth"),o("ticklen"),o("tickwidth"),o("tickcolor"),o("minorticklen")}}function u(t,e){function r(r,a){return n.coerce(t,e,s,r,a)}if("skip"===t.method||Array.isArray(t.args)?r("visible"):e.visible=!1){r("method"),r("args");var a=r("label","step-"+e._index);r("value",a),r("execute")}}e.exports=function(t,e){a(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":719,"../../plots/array_container_defaults":763,"./attributes":676,"./constants":677}],679:[function(t,e,r){var n=t("d3"),a=t("../../plots/plots"),i=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../../plot_api/plot_template").arrayEditor,c=t("./constants"),h=t("../../constants/alignment"),d=h.LINE_SPACING,f=h.FROM_TL,p=h.FROM_BR;function m(t){return c.autoMarginIdRoot+t._index}function g(t){return t._index}function y(t,e){var r=o.tester.selectAll("g."+c.labelGroupClass).data(e._visibleSteps);r.enter().append("g").classed(c.labelGroupClass,!0);var i=0,u=0;r.each((function(t){var r=x(n.select(this),{step:t},e).node();if(r){var a=o.bBox(r);u=Math.max(u,a.height),i=Math.max(i,a.width)}})),r.remove();var h=e._dims={};h.inputAreaWidth=Math.max(c.railWidth,c.gripHeight);var d=t._fullLayout._size;h.lx=d.l+d.w*e.x,h.ly=d.t+d.h*(1-e.y),"fraction"===e.lenmode?h.outerLength=Math.round(d.w*e.len):h.outerLength=e.len,h.inputAreaStart=0,h.inputAreaLength=Math.round(h.outerLength-e.pad.l-e.pad.r);var g=(h.inputAreaLength-2*c.stepInset)/(e._stepCount-1),y=i+c.labelPadding;if(h.labelStride=Math.max(1,Math.ceil(y/g)),h.labelHeight=u,h.currentValueMaxWidth=0,h.currentValueHeight=0,h.currentValueTotalHeight=0,h.currentValueMaxLines=1,e.currentvalue.visible){var _=o.tester.append("g");r.each((function(t){var r=v(_,e,t.label),n=r.node()&&o.bBox(r.node())||{width:0,height:0},a=l.lineCount(r);h.currentValueMaxWidth=Math.max(h.currentValueMaxWidth,Math.ceil(n.width)),h.currentValueHeight=Math.max(h.currentValueHeight,Math.ceil(n.height)),h.currentValueMaxLines=Math.max(h.currentValueMaxLines,a)})),h.currentValueTotalHeight=h.currentValueHeight+e.currentvalue.offset,_.remove()}h.height=h.currentValueTotalHeight+c.tickOffset+e.ticklen+c.labelOffset+h.labelHeight+e.pad.t+e.pad.b;var b="left";s.isRightAnchor(e)&&(h.lx-=h.outerLength,b="right"),s.isCenterAnchor(e)&&(h.lx-=h.outerLength/2,b="center");var w="top";s.isBottomAnchor(e)&&(h.ly-=h.height,w="bottom"),s.isMiddleAnchor(e)&&(h.ly-=h.height/2,w="middle"),h.outerLength=Math.ceil(h.outerLength),h.height=Math.ceil(h.height),h.lx=Math.round(h.lx),h.ly=Math.round(h.ly);var M={y:e.y,b:h.height*p[w],t:h.height*f[w]};"fraction"===e.lenmode?(M.l=0,M.xl=e.x-e.len*f[b],M.r=0,M.xr=e.x+e.len*p[b]):(M.x=e.x,M.l=h.outerLength*f[b],M.r=h.outerLength*p[b]),a.autoMargin(t,m(e),M)}function v(t,e,r){if(e.currentvalue.visible){var n,a,i=e._dims;switch(e.currentvalue.xanchor){case"right":n=i.inputAreaLength-c.currentValueInset-i.currentValueMaxWidth,a="left";break;case"center":n=.5*i.inputAreaLength,a="middle";break;default:n=c.currentValueInset,a="left"}var u=s.ensureSingle(t,"text",c.labelClass,(function(t){t.classed("user-select-none",!0).attr({"text-anchor":a,"data-notex":1})})),h=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof r)h+=r;else{var f=e.steps[e.active].label,p=e._gd._fullLayout._meta;p&&(f=s.templateString(f,p)),h+=f}e.currentvalue.suffix&&(h+=e.currentvalue.suffix),u.call(o.font,e.currentvalue.font).text(h).call(l.convertToTspans,e._gd);var m=l.lineCount(u),g=(i.currentValueMaxLines+1-m)*e.currentvalue.font.size*d;return l.positionText(u,n,g),u}}function _(t,e,r){s.ensureSingle(t,"rect",c.gripRectClass,(function(n){n.call(k,e,t,r).style("pointer-events","all")})).attr({width:c.gripWidth,height:c.gripHeight,rx:c.gripRadius,ry:c.gripRadius}).call(i.stroke,r.bordercolor).call(i.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function x(t,e,r){var n=s.ensureSingle(t,"text",c.labelClass,(function(t){t.classed("user-select-none",!0).attr({"text-anchor":"middle","data-notex":1})})),a=e.step.label,i=r._gd._fullLayout._meta;return i&&(a=s.templateString(a,i)),n.call(o.font,r.font).text(a).call(l.convertToTspans,r._gd),n}function b(t,e){var r=s.ensureSingle(t,"g",c.labelsClass),a=e._dims,i=r.selectAll("g."+c.labelGroupClass).data(a.labelSteps);i.enter().append("g").classed(c.labelGroupClass,!0),i.exit().remove(),i.each((function(t){var r=n.select(this);r.call(x,t,e),o.setTranslate(r,A(e,t.fraction),c.tickOffset+e.ticklen+e.font.size*d+c.labelOffset+a.currentValueTotalHeight)}))}function w(t,e,r,n,a){var i=Math.round(n*(r._stepCount-1)),o=r._visibleSteps[i]._index;o!==r.active&&M(t,e,r,o,!0,a)}function M(t,e,r,n,i,o){var s=r.active;r.active=n,u(t.layout,c.name,r).applyUpdate("active",n);var l=r.steps[r.active];e.call(L,r,o),e.call(v,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:i,previousActive:s}),l&&l.method&&i&&(e._nextMethod?(e._nextMethod.step=l,e._nextMethod.doCallback=i,e._nextMethod.doTransition=o):(e._nextMethod={step:l,doCallback:i,doTransition:o},e._nextMethodRaf=window.requestAnimationFrame((function(){var r=e._nextMethod.step;r.method&&(r.execute&&a.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)}))))}function k(t,e,r){var a=r.node(),o=n.select(e);function s(){return r.data()[0]}t.on("mousedown",(function(){var t=s();e.emit("plotly_sliderstart",{slider:t});var l=r.select("."+c.gripRectClass);n.event.stopPropagation(),n.event.preventDefault(),l.call(i.fill,t.activebgcolor);var u=S(t,n.mouse(a)[0]);w(e,r,t,u,!0),t._dragging=!0,o.on("mousemove",(function(){var t=s(),i=S(t,n.mouse(a)[0]);w(e,r,t,i,!1)})),o.on("mouseup",(function(){var t=s();t._dragging=!1,l.call(i.fill,t.bgcolor),o.on("mouseup",null),o.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})}))}))}function T(t,e){var r=t.selectAll("rect."+c.tickRectClass).data(e._visibleSteps),a=e._dims;r.enter().append("rect").classed(c.tickRectClass,!0),r.exit().remove(),r.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),r.each((function(t,r){var s=r%a.labelStride==0,l=n.select(this);l.attr({height:s?e.ticklen:e.minorticklen}).call(i.fill,e.tickcolor),o.setTranslate(l,A(e,r/(e._stepCount-1))-.5*e.tickwidth,(s?c.tickOffset:c.minorTickOffset)+a.currentValueTotalHeight)}))}function L(t,e,r){for(var n=t.select("rect."+c.gripRectClass),a=0,i=0;i<e._stepCount;i++)if(e._visibleSteps[i]._index===e.active){a=i;break}var o=A(e,a/(e._stepCount-1));if(!e._invokingCommand){var s=n;r&&e.transition.duration>0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform","translate("+(o-.5*c.gripWidth)+","+e._dims.currentValueTotalHeight+")")}}function A(t,e){var r=t._dims;return r.inputAreaStart+c.stepInset+(r.inputAreaLength-2*c.stepInset)*Math.min(1,Math.max(0,e))}function S(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-c.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*c.stepInset-2*r.inputAreaStart)))}function E(t,e,r){var n=r._dims,a=s.ensureSingle(t,"rect",c.railTouchRectClass,(function(n){n.call(k,e,t,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,c.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function C(t,e){var r=e._dims,n=r.inputAreaLength-2*c.railInset,a=s.ensureSingle(t,"rect",c.railRectClass);a.attr({width:n,height:c.railWidth,rx:c.railRadius,ry:c.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,e.bordercolor).call(i.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(a,c.railInset,.5*(r.inputAreaWidth-c.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[c.name],n=[],a=0;a<r.length;a++){var i=r[a];i.visible&&(i._gd=e,n.push(i))}return n}(e,t),i=e._infolayer.selectAll("g."+c.containerClassName).data(r.length>0?[0]:[]);function s(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),a.autoMargin(t,m(e))}if(i.enter().append("g").classed(c.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+c.groupClassName).each(s)})).remove(),0!==r.length){var l=i.selectAll("g."+c.groupClassName).data(r,g);l.enter().append("g").classed(c.groupClassName,!0),l.exit().each(s).remove();for(var u=0;u<r.length;u++){var h=r[u];y(t,h)}l.each((function(e){var r=n.select(this);!function(t){var e=t._dims;e.labelSteps=[];for(var r=t._stepCount,n=0;n<r;n+=e.labelStride)e.labelSteps.push({fraction:n/(r-1),step:t._visibleSteps[n]})}(e),a.manageCommandObserver(t,e,e._visibleSteps,(function(e){var n=r.data()[0];n.active!==e.index&&(n._dragging||M(t,r,n,e.index,!1,!0))})),function(t,e,r){(r.steps[r.active]||{}).visible||(r.active=r._visibleSteps[0]._index),e.call(v,r).call(C,r).call(b,r).call(T,r).call(E,t,r).call(_,t,r);var n=r._dims;o.setTranslate(e,n.lx+r.pad.l,n.ly+r.pad.t),e.call(L,r,!1),e.call(v,r)}(t,n.select(this),e)}))}}},{"../../constants/alignment":688,"../../lib":719,"../../lib/svg_text_utils":743,"../../plot_api/plot_template":757,"../../plots/plots":828,"../color":593,"../drawing":614,"./constants":677,d3:163}],680:[function(t,e,r){var n=t("./constants");e.exports={moduleType:"component",name:n.name,layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":676,"./constants":677,"./defaults":678,"./draw":679}],681:[function(t,e,r){var n=t("d3"),a=t("fast-isnumeric"),i=t("../../plots/plots"),o=t("../../registry"),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){var f,p=r.propContainer,m=r.propName,g=r.placeholder,y=r.traceIndex,v=r.avoid||{},_=r.attributes,x=r.transform,b=r.containerGroup,w=t._fullLayout,M=1,k=!1,T=p.title,L=(T&&T.text?T.text:"").trim(),A=T&&T.font?T.font:{},S=A.family,E=A.size,C=A.color;"title.text"===m?f="titleText":-1!==m.indexOf("axis")?f="axisTitleText":m.indexOf(!0)&&(f="colorbarTitleText");var D=t._context.edits[f];""===L?M=0:L.replace(d," % ")===g.replace(d," % ")&&(M=.2,k=!0,D||(L="")),r._meta?L=s.templateString(L,r._meta):w._meta&&(L=s.templateString(L,w._meta));var P=L||D;b||(b=s.ensureSingle(w._infolayer,"g","g-"+e));var O=b.selectAll("text").data(P?[0]:[]);if(O.enter().append("text"),O.text(L).attr("class",e),O.exit().remove(),!P)return b;function z(t){s.syncOrAsync([I,R],t)}function I(e){var r;return x?(r="",x.rotate&&(r+="rotate("+[x.rotate,_.x,_.y]+")"),x.offset&&(r+="translate(0, "+x.offset+")")):r=null,e.attr("transform",r),e.style({"font-family":S,"font-size":n.round(E,2)+"px",fill:u.rgb(C),opacity:M*u.opacity(C),"font-weight":i.fontWeight}).attr(_).call(c.convertToTspans,t),i.previousPromises(t)}function R(t){var e=n.select(t.node().parentNode);if(v&&v.selection&&v.side&&L){e.attr("transform",null);var r=0,i={left:"right",right:"left",top:"bottom",bottom:"top"}[v.side],o=-1!==["left","top"].indexOf(v.side)?-1:1,u=a(v.pad)?v.pad:2,c=l.bBox(e.node()),h={left:0,top:0,right:w.width,bottom:w.height},d=v.maxShift||(h[v.side]-c[v.side])*("left"===v.side||"top"===v.side?-1:1);if(d<0)r=d;else{var f=v.offsetLeft||0,p=v.offsetTop||0;c.left-=f,c.right-=f,c.top-=p,c.bottom-=p,v.selection.each((function(){var t=l.bBox(this);s.bBoxIntersect(c,t,u)&&(r=Math.max(r,o*(t[v.side]-c[i])+u))})),r=Math.min(d,r)}if(r>0||d<0){var m={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[v.side];e.attr("transform","translate("+m+")")}}}return O.call(z),D&&(L?O.on(".opacity",null):(M=0,k=!0,O.text(g).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)}))),O.call(c.makeEditable,{gd:t}).on("edit",(function(e){void 0!==y?o.call("_guiRestyle",t,m,e,y):o.call("_guiRelayout",t,m,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(z)})).on("input",(function(t){this.text(t||" ").call(c.positionText,_.x,_.y)}))),O.classed("js-placeholder",k),b}};var d=/ [XY][0-9]* /},{"../../constants/interactions":694,"../../lib":719,"../../lib/svg_text_utils":743,"../../plots/plots":828,"../../registry":847,"../color":593,"../drawing":614,d3:163,"fast-isnumeric":225}],682:[function(t,e,r){var n=t("../../plots/font_attributes"),a=t("../color/attributes"),i=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l=t("../../plot_api/plot_template").templatedArray,u=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:u,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:i(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":710,"../../plot_api/edit_types":750,"../../plot_api/plot_template":757,"../../plots/font_attributes":793,"../../plots/pad_attributes":827,"../color/attributes":592}],683:[function(t,e,r){e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"◄",right:"►",up:"▲",down:"▼"}}},{}],684:[function(t,e,r){var n=t("../../lib"),a=t("../../plots/array_container_defaults"),i=t("./attributes"),o=t("./constants").name,s=i.buttons;function l(t,e,r){function o(r,a){return n.coerce(t,e,i,r,a)}o("visible",a(t,e,{name:"buttons",handleItemDefaults:u}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function u(t,e){function r(r,a){return n.coerce(t,e,s,r,a)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("label"),r("execute"))}e.exports=function(t,e){a(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":719,"../../plots/array_container_defaults":763,"./attributes":682,"./constants":683}],685:[function(t,e,r){var n=t("d3"),a=t("../../plots/plots"),i=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../../plot_api/plot_template").arrayEditor,c=t("../../constants/alignment").LINE_SPACING,h=t("./constants"),d=t("./scrollbox");function f(t){return t._index}function p(t,e){return+t.attr(h.menuIndexAttrName)===e._index}function m(t,e,r,n,a,i,o,s){e.active=o,u(t.layout,h.name,e).applyUpdate("active",o),"buttons"===e.type?y(t,n,null,null,e):"dropdown"===e.type&&(a.attr(h.menuIndexAttrName,"-1"),g(t,n,a,i,e),s||y(t,n,a,i,e))}function g(t,e,r,n,a){var i=s.ensureSingle(e,"g",h.headerClassName,(function(t){t.style("pointer-events","all")})),l=a._dims,u=a.active,c=a.buttons[u]||h.blankHeaderOpts,d={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},f={width:l.headerWidth,height:l.headerHeight};i.call(v,a,c,t).call(L,a,d,f),s.ensureSingle(e,"text",h.headerArrowClassName,(function(t){t.classed("user-select-none",!0).attr("text-anchor","end").call(o.font,a.font).text(h.arrowSymbol[a.direction])})).attr({x:l.headerWidth-h.arrowOffsetX+a.pad.l,y:l.headerHeight/2+h.textOffsetY+a.pad.t}),i.on("click",(function(){r.call(A,String(p(r,a)?-1:a._index)),y(t,e,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(M,a)})),o.setTranslate(e,l.lx,l.ly)}function y(t,e,r,i,o){r||(r=e).attr("pointer-events","all");var l=function(t){return-1==+t.attr(h.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,u="dropdown"===o.type?h.dropdownButtonClassName:h.buttonClassName,c=r.selectAll("g."+u).data(s.filterVisible(l)),d=c.enter().append("g").classed(u,!0),f=c.exit();"dropdown"===o.type?(d.attr("opacity","0").transition().attr("opacity","1"),f.transition().attr("opacity","0").remove()):f.remove();var p=0,g=0,y=o._dims,_=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(_?g=y.headerHeight+h.gapButtonHeader:p=y.headerWidth+h.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(g=-h.gapButtonHeader+h.gapButton-y.openHeight),"dropdown"===o.type&&"left"===o.direction&&(p=-h.gapButtonHeader+h.gapButton-y.openWidth);var x={x:y.lx+p+o.pad.l,y:y.ly+g+o.pad.t,yPad:h.gapButton,xPad:h.gapButton,index:0},k={l:x.x+o.borderwidth,t:x.y+o.borderwidth};c.each((function(s,l){var u=n.select(this);u.call(v,o,s,t).call(L,o,x),u.on("click",(function(){n.event.defaultPrevented||(m(t,o,0,e,r,i,l),s.execute&&a.executeAPICommand(t,s.method,s.args),t.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))})),u.on("mouseover",(function(){u.call(w)})),u.on("mouseout",(function(){u.call(M,o),c.call(b,o)}))})),c.call(b,o),_?(k.w=Math.max(y.openWidth,y.headerWidth),k.h=x.y-k.t):(k.w=x.x-k.l,k.h=Math.max(y.openHeight,y.headerHeight)),k.direction=o.direction,i&&(c.size()?function(t,e,r,n,a,i){var o,s,l,u=a.direction,c="up"===u||"down"===u,d=a._dims,f=a.active;if(c)for(s=0,l=0;l<f;l++)s+=d.heights[l]+h.gapButton;else for(o=0,l=0;l<f;l++)o+=d.widths[l]+h.gapButton;n.enable(i,o,s),n.hbar&&n.hbar.attr("opacity","0").transition().attr("opacity","1"),n.vbar&&n.vbar.attr("opacity","0").transition().attr("opacity","1")}(0,0,0,i,o,k):function(t){var e=!!t.hbar,r=!!t.vbar;e&&t.hbar.transition().attr("opacity","0").each("end",(function(){e=!1,r||t.disable()})),r&&t.vbar.transition().attr("opacity","0").each("end",(function(){r=!1,e||t.disable()}))}(i))}function v(t,e,r,n){t.call(_,e).call(x,e,r,n)}function _(t,e){s.ensureSingle(t,"rect",h.itemRectClassName,(function(t){t.attr({rx:h.rx,ry:h.ry,"shape-rendering":"crispEdges"})})).call(i.stroke,e.bordercolor).call(i.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px")}function x(t,e,r,n){var a=s.ensureSingle(t,"text",h.itemTextClassName,(function(t){t.classed("user-select-none",!0).attr({"text-anchor":"start","data-notex":1})})),i=r.label,u=n._fullLayout._meta;u&&(i=s.templateString(i,u)),a.call(o.font,e.font).text(i).call(l.convertToTspans,n)}function b(t,e){var r=e.active;t.each((function(t,a){var o=n.select(this);a===r&&e.showactive&&o.select("rect."+h.itemRectClassName).call(i.fill,h.activeColor)}))}function w(t){t.select("rect."+h.itemRectClassName).call(i.fill,h.hoverColor)}function M(t,e){t.select("rect."+h.itemRectClassName).call(i.fill,e.bgcolor)}function k(t,e){var r=e._dims={width1:0,height1:0,heights:[],widths:[],totalWidth:0,totalHeight:0,openWidth:0,openHeight:0,lx:0,ly:0},i=o.tester.selectAll("g."+h.dropdownButtonClassName).data(s.filterVisible(e.buttons));i.enter().append("g").classed(h.dropdownButtonClassName,!0);var u=-1!==["up","down"].indexOf(e.direction);i.each((function(a,i){var s=n.select(this);s.call(v,e,a,t);var d=s.select("."+h.itemTextClassName),f=d.node()&&o.bBox(d.node()).width,p=Math.max(f+h.textPadX,h.minWidth),m=e.font.size*c,g=l.lineCount(d),y=Math.max(m*g,h.minHeight)+h.textOffsetY;y=Math.ceil(y),p=Math.ceil(p),r.widths[i]=p,r.heights[i]=y,r.height1=Math.max(r.height1,y),r.width1=Math.max(r.width1,p),u?(r.totalWidth=Math.max(r.totalWidth,p),r.openWidth=r.totalWidth,r.totalHeight+=y+h.gapButton,r.openHeight+=y+h.gapButton):(r.totalWidth+=p+h.gapButton,r.openWidth+=p+h.gapButton,r.totalHeight=Math.max(r.totalHeight,y),r.openHeight=r.totalHeight)})),u?r.totalHeight-=h.gapButton:r.totalWidth-=h.gapButton,r.headerWidth=r.width1+h.arrowPadX,r.headerHeight=r.height1,"dropdown"===e.type&&(u?(r.width1+=h.arrowPadX,r.totalHeight=r.height1):r.totalWidth=r.width1,r.totalWidth+=h.arrowPadX),i.remove();var d=r.totalWidth+e.pad.l+e.pad.r,f=r.totalHeight+e.pad.t+e.pad.b,p=t._fullLayout._size;r.lx=p.l+p.w*e.x,r.ly=p.t+p.h*(1-e.y);var m="left";s.isRightAnchor(e)&&(r.lx-=d,m="right"),s.isCenterAnchor(e)&&(r.lx-=d/2,m="center");var g="top";s.isBottomAnchor(e)&&(r.ly-=f,g="bottom"),s.isMiddleAnchor(e)&&(r.ly-=f/2,g="middle"),r.totalWidth=Math.ceil(r.totalWidth),r.totalHeight=Math.ceil(r.totalHeight),r.lx=Math.round(r.lx),r.ly=Math.round(r.ly),a.autoMargin(t,T(e),{x:e.x,y:e.y,l:d*({right:1,center:.5}[m]||0),r:d*({left:1,center:.5}[m]||0),b:f*({top:1,middle:.5}[g]||0),t:f*({bottom:1,middle:.5}[g]||0)})}function T(t){return h.autoMarginIdRoot+t._index}function L(t,e,r,n){n=n||{};var a=t.select("."+h.itemRectClassName),i=t.select("."+h.itemTextClassName),s=e.borderwidth,u=r.index,d=e._dims;o.setTranslate(t,s+r.x,s+r.y);var f=-1!==["up","down"].indexOf(e.direction),p=n.height||(f?d.heights[u]:d.height1);a.attr({x:0,y:0,width:n.width||(f?d.width1:d.widths[u]),height:p});var m=e.font.size*c,g=(l.lineCount(i)-1)*m/2;l.positionText(i,h.textOffsetX,p/2-g+h.textOffsetY),f?r.y+=d.heights[u]+r.yPad:r.x+=d.widths[u]+r.xPad,r.index++}function A(t,e){t.attr(h.menuIndexAttrName,e||"-1").selectAll("g."+h.dropdownButtonClassName).remove()}e.exports=function(t){var e=t._fullLayout,r=s.filterVisible(e[h.name]);function i(e){a.autoMargin(t,T(e))}var o=e._menulayer.selectAll("g."+h.containerClassName).data(r.length>0?[0]:[]);if(o.enter().append("g").classed(h.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+h.headerGroupClassName).each(i)})).remove(),0!==r.length){var l=o.selectAll("g."+h.headerGroupClassName).data(r,f);l.enter().append("g").classed(h.headerGroupClassName,!0);for(var u=s.ensureSingle(o,"g",h.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),c=0;c<r.length;c++){var v=r[c];k(t,v)}var _="updatemenus"+e._uid,x=new d(t,u,_);l.enter().size()&&(u.node().parentNode.appendChild(u.node()),u.call(A)),l.exit().each((function(t){u.call(A),i(t)})).remove(),l.each((function(e){var r=n.select(this),i="dropdown"===e.type?u:null;a.manageCommandObserver(t,e,e.buttons,(function(n){m(t,e,e.buttons[n.index],r,i,x,n.index,!0)})),"dropdown"===e.type?(g(t,r,u,x,e),p(u,e)&&y(t,r,u,x,e)):y(t,r,null,null,e)}))}}},{"../../constants/alignment":688,"../../lib":719,"../../lib/svg_text_utils":743,"../../plot_api/plot_template":757,"../../plots/plots":828,"../color":593,"../drawing":614,"./constants":683,"./scrollbox":687,d3:163}],686:[function(t,e,r){arguments[4][680][0].apply(r,arguments)},{"./attributes":682,"./constants":683,"./defaults":684,"./draw":685,dup:680}],687:[function(t,e,r){e.exports=s;var n=t("d3"),a=t("../color"),i=t("../drawing"),o=t("../../lib");function s(t,e,r){this.gd=t,this.container=e,this.id=r,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}s.barWidth=2,s.barLength=20,s.barRadius=2,s.barPad=1,s.barColor="#808BA4",s.prototype.enable=function(t,e,r){var o=this.gd._fullLayout,l=o.width,u=o.height;this.position=t;var c,h,d,f,p=this.position.l,m=this.position.w,g=this.position.t,y=this.position.h,v=this.position.direction,_="down"===v,x="left"===v,b="up"===v,w=m,M=y;_||x||"right"===v||b||(this.position.direction="down",_=!0),_||b?(h=(c=p)+w,_?(d=g,M=(f=Math.min(d+M,u))-d):M=(f=g+M)-(d=Math.max(f-M,0))):(f=(d=g)+M,x?w=(h=p+w)-(c=Math.max(h-w,0)):(c=p,w=(h=Math.min(c+w,l))-c)),this._box={l:c,t:d,w,h:M};var k=m>w,T=s.barLength+2*s.barPad,L=s.barWidth+2*s.barPad,A=p,S=g+y;S+L>u&&(S=u-L);var E=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);E.exit().on(".drag",null).remove(),E.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,s.barColor),k?(this.hbar=E.attr({rx:s.barRadius,ry:s.barRadius,x:A,y:S,width:T,height:L}),this._hbarXMin=A+T/2,this._hbarTranslateMax=w-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var C=y>M,D=s.barWidth+2*s.barPad,P=s.barLength+2*s.barPad,O=p+m,z=g;O+D>l&&(O=l-D);var I=this.container.selectAll("rect.scrollbar-vertical").data(C?[0]:[]);I.exit().on(".drag",null).remove(),I.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,s.barColor),C?(this.vbar=I.attr({rx:s.barRadius,ry:s.barRadius,x:O,y:z,width:D,height:P}),this._vbarYMin=z+P/2,this._vbarTranslateMax=M-P):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=c-.5,N=C?h+D+.5:h+.5,Y=d-.5,j=k?f+L+.5:f+.5,B=o._topdefs.selectAll("#"+R).data(k||C?[0]:[]);if(B.exit().remove(),B.enter().append("clipPath").attr("id",R).append("rect"),k||C?(this._clipRect=B.select("rect").attr({x:Math.floor(F),y:Math.floor(Y),width:Math.ceil(N)-Math.floor(F),height:Math.ceil(j)-Math.floor(Y)}),this.container.call(i.setClipUrl,R,this.gd),this.bg.attr({x:p,y:g,width:m,height:y})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),k||C){var H=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(H);var U=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(U),C&&this.vbar.on(".drag",null).call(U)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,a=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=e+this._vbarYMin,s=i+this._vbarTranslateMax;e=(o.constrain(n.event.y,i,s)-i)/(s-i)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(i.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 a=t/r;this.hbar.call(i.setTranslate,t+a*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(i.setTranslate,t,e+s*this._vbarTranslateMax)}}},{"../../lib":719,"../color":593,"../drawing":614,d3:163}],688:[function(t,e,r){e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],689:[function(t,e,r){e.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"▲"},DECREASING:{COLOR:"#FF4136",SYMBOL:"▼"}}},{}],690:[function(t,e,r){e.exports={FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format",DATE_FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format"}},{}],691:[function(t,e,r){e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],692:[function(t,e,r){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]}},{}],693:[function(t,e,r){e.exports={circle:"●","circle-open":"○",square:"■","square-open":"□",diamond:"◆","diamond-open":"◇",cross:"+",x:"❌"}},{}],694:[function(t,e,r){e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],695:[function(t,e,r){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:.999999,LOG_CLIP:10,MINUS_SIGN:""}},{}],696:[function(t,e,r){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}},{}],697:[function(t,e,r){r.version="1.49.1",t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config")();for(var n=t("./registry"),a=r.register=n.register,i=t("./plot_api"),o=Object.keys(i),s=0;s<o.length;s++){var l=o[s];"_"!==l.charAt(0)&&(r[l]=i[l]),a({moduleType:"apiMethod",name:l,fn:i[l]})}a(t("./traces/scatter")),a([t("./components/fx"),t("./components/legend"),t("./components/annotations"),t("./components/annotations3d"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector"),t("./components/grid"),t("./components/errorbars"),t("./components/colorscale"),t("./components/colorbar")]),a([t("./locale-en"),t("./locale-en-us")]),r.Icons=t("./fonts/ploticon"),r.Plots=t("./plots/plots"),r.Fx=t("./components/fx"),r.Snapshot=t("./snapshot"),r.PlotSchema=t("./plot_api/plot_schema"),r.Queue=t("./lib/queue"),r.d3=t("d3")},{"../build/plotcss":1,"./components/annotations":584,"./components/annotations3d":589,"./components/colorbar":599,"./components/colorscale":605,"./components/errorbars":620,"./components/fx":632,"./components/grid":636,"./components/images":641,"./components/legend":649,"./components/rangeselector":660,"./components/rangeslider":667,"./components/shapes":675,"./components/sliders":680,"./components/updatemenus":686,"./fonts/mathjax_config":698,"./fonts/ploticon":699,"./lib/queue":734,"./locale-en":748,"./locale-en-us":747,"./plot_api":752,"./plot_api/plot_schema":756,"./plots/plots":828,"./registry":847,"./snapshot":852,"./traces/scatter":1123,d3:163,"es6-promise":218}],698:[function(t,e,r){e.exports=function(){"undefined"!=typeof MathJax&&"local"!==(window.PlotlyConfig||{}).MathJaxConfig&&(MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured())}},{}],699:[function(t,e,r){e.exports={undo:{width:857.1,height:1e3,path:"m857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z",transform:"matrix(1 0 0 -1 0 850)"},home:{width:928.6,height:1e3,path:"m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z",transform:"matrix(1 0 0 -1 0 850)"},"camera-retro":{width:1e3,height:1e3,path:"m518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z",transform:"matrix(1 0 0 -1 0 850)"},zoombox:{width:1e3,height:1e3,path:"m1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z",transform:"matrix(1 0 0 -1 0 850)"},pan:{width:1e3,height:1e3,path:"m1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z",transform:"matrix(1 0 0 -1 0 850)"},zoom_plus:{width:875,height:1e3,path:"m1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},zoom_minus:{width:875,height:1e3,path:"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},autoscale:{width:1e3,height:1e3,path:"m250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_basic:{width:1500,height:1e3,path:"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_compare:{width:1125,height:1e3,path:"m187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z",transform:"matrix(1 0 0 -1 0 850)"},plotlylogo:{width:1542,height:1e3,path:"m0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z",transform:"matrix(1 0 0 -1 0 850)"},"z-axis":{width:1e3,height:1e3,path:"m833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z",transform:"matrix(1 0 0 -1 0 850)"},"3d_rotate":{width:1e3,height:1e3,path:"m922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z",transform:"matrix(1 0 0 -1 0 850)"},camera:{width:1e3,height:1e3,path:"m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z",transform:"matrix(1 0 0 -1 0 850)"},movie:{width:1e3,height:1e3,path:"m938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z",transform:"matrix(1 0 0 -1 0 850)"},question:{width:857.1,height:1e3,path:"m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z",transform:"matrix(1 0 0 -1 0 850)"},disk:{width:857.1,height:1e3,path:"m214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z",transform:"matrix(1 0 0 -1 0 850)"},lasso:{width:1031,height:1e3,path:"m1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z",transform:"matrix(1 0 0 -1 0 850)"},selectbox:{width:1e3,height:1e3,path:"m0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z",transform:"matrix(1 0 0 -1 0 850)"},spikeline:{width:1e3,height:1e3,path:"M512 409c0-57-46-104-103-104-57 0-104 47-104 104 0 57 47 103 104 103 57 0 103-46 103-103z m-327-39l92 0 0 92-92 0z m-185 0l92 0 0 92-92 0z m370-186l92 0 0 93-92 0z m0-184l92 0 0 92-92 0z",transform:"matrix(1.5 0 0 -1.5 0 850)"},pencil:{width:1792,height:1792,path:"M491 1536l91-91-235-235-91 91v107h128v128h107zm523-928q0-22-22-22-10 0-17 7l-542 542q-7 7-7 17 0 22 22 22 10 0 17-7l542-542q7-7 7-17zm-54-192l416 416-832 832h-416v-416zm683 96q0 53-37 90l-166 166-416-416 166-165q36-38 90-38 53 0 91 38l235 234q37 39 37 91z",transform:"matrix(1 0 0 1 0 1)"},newplotlylogo:{name:"newplotlylogo",svg:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 132 132'><defs><style>.cls-1 {fill: #119dff;} .cls-2 {fill: #25fefd;} .cls-3 {fill: #fff;}</style></defs><title>plotly-logomark</title><g id='symbol'><rect class='cls-1' width='132' height='132' rx='6' ry='6'/><circle class='cls-2' cx='78' cy='54' r='6'/><circle class='cls-2' cx='102' cy='30' r='6'/><circle class='cls-2' cx='78' cy='30' r='6'/><circle class='cls-2' cx='54' cy='30' r='6'/><circle class='cls-2' cx='30' cy='30' r='6'/><circle class='cls-2' cx='30' cy='54' r='6'/><path class='cls-3' d='M30,72a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V78A6,6,0,0,0,30,72Z'/><path class='cls-3' d='M78,72a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V78A6,6,0,0,0,78,72Z'/><path class='cls-3' d='M54,48a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V54A6,6,0,0,0,54,48Z'/><path class='cls-3' d='M102,48a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V54A6,6,0,0,0,102,48Z'/></g></svg>"}}},{}],700:[function(t,e,r){r.isLeftAnchor=function(t){return"left"===t.xanchor||"auto"===t.xanchor&&t.x<=1/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},r.isTopAnchor=function(t){return"top"===t.yanchor||"auto"===t.yanchor&&t.y>=2/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3}},{}],701:[function(t,e,r){var n=t("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function u(t,e){return i(e-t,s)}function c(t,e){if(l(e))return!0;var r,n;e[0]<e[1]?(r=e[0],n=e[1]):(r=e[1],n=e[0]),(r=a(r,s))>(n=a(n,s))&&(n+=s);var i=a(t,s),o=i+s;return i>=r&&i<=n||o>=r&&o<=n}function h(t,e,r,n,a,i,u){a=a||0,i=i||0;var c,h,d,f,p,m=l([r,n]);function g(t,e){return[t*Math.cos(e)+a,i-t*Math.sin(e)]}m?(c=0,h=o,d=s):r<n?(c=r,d=n):(c=n,d=r),t<e?(f=t,p=e):(f=e,p=t);var y,v=Math.abs(d-c)<=o?0:1;function _(t,e,r){return"A"+[t,t]+" "+[0,v,r]+" "+g(t,e)}return m?y=null===f?"M"+g(p,c)+_(p,h,0)+_(p,d,0)+"Z":"M"+g(f,c)+_(f,h,0)+_(f,d,0)+"ZM"+g(p,c)+_(p,h,1)+_(p,d,1)+"Z":null===f?(y="M"+g(p,c)+_(p,d,0),u&&(y+="L0,0Z")):y="M"+g(f,c)+"L"+g(p,c)+_(p,d,0)+"L"+g(f,d)+_(f,c,1)+"Z",y}e.exports={deg2rad:function(t){return t/180*o},rad2deg:function(t){return t/o*180},angleDelta:u,angleDist:function(t,e){return Math.abs(u(t,e))},isFullCircle:l,isAngleInsideSector:c,isPtInsideSector:function(t,e,r,n){return!!c(e,n)&&(r[0]<r[1]?(a=r[0],i=r[1]):(a=r[1],i=r[0]),t>=a&&t<=i);var a,i},pathArc:function(t,e,r,n,a){return h(null,t,e,r,n,a,0)},pathSector:function(t,e,r,n,a){return h(null,t,e,r,n,a,1)},pathAnnulus:function(t,e,r,n,a,i){return h(t,e,r,n,a,i,1)}}},{"./mod":726}],702:[function(t,e,r){var n=Array.isArray,a="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}},i="undefined"==typeof DataView?function(){}:DataView;function o(t){return a.isView(t)&&!(t instanceof i)}function s(t){return n(t)||o(t)}function l(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,a=0;a<t.length;a++)n=e(n,t[a].length);return n}return t.length}return 0}r.isTypedArray=o,r.isArrayOrTypedArray=s,r.isArray1D=function(t){return!s(t[0])},r.ensureArray=function(t,e){return n(t)||(t=[]),t.length=e,t},r.concat=function(){var t,e,r,a,i,o,s,l,u=[],c=!0,h=0;for(r=0;r<arguments.length;r++)(o=(a=arguments[r]).length)&&(e?u.push(a):(e=a,i=o),n(a)?t=!1:(c=!1,h?t!==a.constructor&&(t=!1):t=a.constructor),h+=o);if(!h)return[];if(!u.length)return e;if(c)return e.concat.apply(e,u);if(t){for((s=new t(h)).set(e),r=0;r<u.length;r++)a=u[r],s.set(a,i),i+=a.length;return s}for(s=new Array(h),l=0;l<e.length;l++)s[l]=e[l];for(r=0;r<u.length;r++){for(a=u[r],l=0;l<a.length;l++)s[i+l]=a[l];i+=l}return s},r.maxRowLength=function(t){return l(t,Math.max,0)},r.minRowLength=function(t){return l(t,Math.min,1/0)}},{}],703:[function(t,e,r){var n=t("fast-isnumeric"),a=t("../constants/numerical").BADNUM,i=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(i,"")),n(t)?Number(t):a}},{"../constants/numerical":695,"fast-isnumeric":225}],704:[function(t,e,r){e.exports=function(t){var e=t._fullLayout;e._glcanvas&&e._glcanvas.size()&&e._glcanvas.each((function(t){t.regl&&t.regl.clear({color:!0,depth:!0})}))}},{}],705:[function(t,e,r){e.exports=function(t){t._responsiveChartHandler&&(window.removeEventListener("resize",t._responsiveChartHandler),delete t._responsiveChartHandler)}},{}],706:[function(t,e,r){var n=t("fast-isnumeric"),a=t("tinycolor2"),i=t("../plots/attributes"),o=t("../components/colorscale/scales"),s=t("../constants/interactions").DESELECTDIM,l=t("./nested_property"),u=t("./regex").counter,c=t("./mod").modHalf,h=t("./array").isArrayOrTypedArray;function d(t,e){var n=r.valObjectMeta[e.valType];if(e.arrayOk&&h(t))return!0;if(n.validateFunction)return n.validateFunction(t,e);var a={},i=a,o={set:function(t){i=t}};return n.coerceFunction(t,o,a,e),i!==a}r.valObjectMeta={data_array:{coerceFunction:function(t,e,r){h(t)?e.set(t):void 0!==r&&e.set(r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),-1===n.values.indexOf(t)?e.set(r):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var r=e.values,n=0;n<r.length;n++){var a=String(r[n]);if("/"===a.charAt(0)&&"/"===a.charAt(a.length-1)){if(new RegExp(a.substr(1,a.length-2)).test(t))return!0}else if(t===r[n])return!0}return!1}},boolean:{coerceFunction:function(t,e,r){!0===t||!1===t?e.set(t):e.set(r)}},number:{coerceFunction:function(t,e,r,a){!n(t)||void 0!==a.min&&t<a.min||void 0!==a.max&&t>a.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,a){t%1||!n(t)||void 0!==a.min&&t<a.min||void 0!==a.max&&t>a.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var a="number"==typeof t;!0!==n.strict&&a?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){a(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every((function(t){return a(t).isValid()}))?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o.get(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(c(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var a=n.regex||u(r);"string"==typeof t&&a.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!u(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var a=t.split("+"),i=0;i<a.length;){var o=a[i];-1===n.flags.indexOf(o)||a.indexOf(o)<i?a.splice(i,1):i++}a.length?e.set(a.join("+")):e.set(r)}else e.set(t);else e.set(r)}},any:{coerceFunction:function(t,e,r){void 0===t?e.set(r):e.set(t)}},info_array:{coerceFunction:function(t,e,n,a){function i(t,e,n){var a,i={set:function(t){a=t}};return void 0===n&&(n=e.dflt),r.valObjectMeta[e.valType].coerceFunction(t,i,n,e),a}var o=2===a.dimensions||"1-2"===a.dimensions&&Array.isArray(t)&&Array.isArray(t[0]);if(Array.isArray(t)){var s,l,u,c,h,d,f=a.items,p=[],m=Array.isArray(f),g=m&&o&&Array.isArray(f[0]),y=o&&m&&!g,v=m&&!y?f.length:t.length;if(n=Array.isArray(n)?n:[],o)for(s=0;s<v;s++)for(p[s]=[],u=Array.isArray(t[s])?t[s]:[],h=y?f.length:m?f[s].length:u.length,l=0;l<h;l++)c=y?f[l]:m?f[s][l]:f,void 0!==(d=i(u[l],c,(n[s]||[])[l]))&&(p[s][l]=d);else for(s=0;s<v;s++)void 0!==(d=i(t[s],m?f[s]:f,n[s]))&&(p[s]=d);e.set(p)}else e.set(n)},validateFunction:function(t,e){if(!Array.isArray(t))return!1;var r=e.items,n=Array.isArray(r),a=2===e.dimensions;if(!e.freeLength&&t.length!==r.length)return!1;for(var i=0;i<t.length;i++)if(a){if(!Array.isArray(t[i])||!e.freeLength&&t[i].length!==r[i].length)return!1;for(var o=0;o<t[i].length;o++)if(!d(t[i][o],n?r[i][o]:r))return!1}else if(!d(t[i],n?r[i]:r))return!1;return!0}}},r.coerce=function(t,e,n,a,i){var o=l(n,a).get(),s=l(t,a),u=l(e,a),c=s.get(),f=e._template;if(void 0===c&&f&&(c=l(f,a).get(),f=0),void 0===i&&(i=o.dflt),o.arrayOk&&h(c))return u.set(c),c;var p=r.valObjectMeta[o.valType].coerceFunction;p(c,u,i,o);var m=u.get();return f&&m===i&&!d(c,o)&&(p(c=l(f,a).get(),u,i,o),m=u.get()),m},r.coerce2=function(t,e,n,a,i){var o=l(t,a),s=r.coerce(t,e,n,a,i);return null!=o.get()&&s},r.coerceFont=function(t,e,r){var n={};return r=r||{},n.family=t(e+".family",r.family),n.size=t(e+".size",r.size),n.color=t(e+".color",r.color),n},r.coerceHoverinfo=function(t,e,n){var a,o=e._module.attributes,s=o.hoverinfo?o:i,l=s.hoverinfo;if(1===n._dataLength){var u="all"===l.dflt?l.flags.slice():l.dflt.split("+");u.splice(u.indexOf("name"),1),a=u.join("+")}return r.coerce(t,e,s,"hoverinfo",a)},r.coerceSelectionMarkerOpacity=function(t,e){if(t.marker){var r,n,a=t.marker.opacity;void 0!==a&&(h(a)||t.selected||t.unselected||(r=a,n=s*a),e("selected.marker.opacity",r),e("unselected.marker.opacity",n))}},r.validate=d},{"../components/colorscale/scales":608,"../constants/interactions":694,"../plots/attributes":764,"./array":702,"./mod":726,"./nested_property":727,"./regex":735,"fast-isnumeric":225,tinycolor2:537}],707:[function(t,e,r){var n,a,i=t("d3"),o=t("fast-isnumeric"),s=t("./loggers"),l=t("./mod").mod,u=t("../constants/numerical"),c=u.BADNUM,h=u.ONEDAY,d=u.ONEHOUR,f=u.ONEMIN,p=u.ONESEC,m=u.EPOCHJD,g=t("../registry"),y=i.time.format.utc,v=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,_=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,x=(new Date).getFullYear()-70;function b(t){return t&&g.componentsRegistry.calendars&&"string"==typeof t&&"gregorian"!==t}function w(t,e){return String(t+Math.pow(10,e)).substr(1)}r.dateTick0=function(t,e){return b(t)?e?g.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:g.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"},r.dfltRange=function(t){return b(t)?g.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},r.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime},r.dateTime2ms=function(t,e){if(r.isJSDate(t)){var i=t.getTimezoneOffset()*f,o=(t.getUTCMinutes()-t.getMinutes())*f+(t.getUTCSeconds()-t.getSeconds())*p+(t.getUTCMilliseconds()-t.getMilliseconds());if(o){var s=3*f;i=i-s/2+l(o-i+s/2,s)}return(t=Number(t)-i)>=n&&t<=a?t:c}if("string"!=typeof t&&"number"!=typeof t)return c;t=String(t);var u=b(e),y=t.charAt(0);!u||"G"!==y&&"g"!==y||(t=t.substr(1),e="");var w=u&&"chinese"===e.substr(0,7),M=t.match(w?_:v);if(!M)return c;var k=M[1],T=M[3]||"1",L=Number(M[5]||1),A=Number(M[7]||0),S=Number(M[9]||0),E=Number(M[11]||0);if(u){if(2===k.length)return c;var C;k=Number(k);try{var D=g.getComponentMethod("calendars","getCal")(e);if(w){var P="i"===T.charAt(T.length-1);T=parseInt(T,10),C=D.newDate(k,D.toMonthIndex(k,T,P),L)}else C=D.newDate(k,Number(T),L)}catch(t){return c}return C?(C.toJD()-m)*h+A*d+S*f+E*p:c}k=2===k.length?(Number(k)+2e3-x)%100+x:Number(k),T-=1;var O=new Date(Date.UTC(2e3,T,L,A,S));return O.setUTCFullYear(k),O.getUTCMonth()!==T||O.getUTCDate()!==L?c:O.getTime()+E*p},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==c};var M=90*h,k=3*d,T=5*f;function L(t,e,r,n,a){if((e||r||n||a)&&(t+=" "+w(e,2)+":"+w(r,2),(n||a)&&(t+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;t+="."+w(a,i)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=a))return c;e||(e=0);var i,o,s,u,v,_,x=Math.floor(10*l(t+.05,1)),w=Math.round(t-x/10);if(b(r)){var A=Math.floor(w/h)+m,S=Math.floor(l(t,h));try{i=g.getComponentMethod("calendars","getCal")(r).fromJD(A).formatDate("yyyy-mm-dd")}catch(t){i=y("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=e<M?Math.floor(S/d):0,s=e<M?Math.floor(S%d/f):0,u=e<k?Math.floor(S%f/p):0,v=e<T?S%p*10+x:0}else _=new Date(w),i=y("%Y-%m-%d")(_),o=e<M?_.getUTCHours():0,s=e<M?_.getUTCMinutes():0,u=e<k?_.getUTCSeconds():0,v=e<T?10*_.getUTCMilliseconds()+x:0;return L(i,o,s,u,v)},r.ms2DateTimeLocal=function(t){if(!(t>=n+h&&t<=a-h))return c;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return L(i.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,n){if(t===c)return e;if(r.isJSDate(t)||"number"==typeof t&&isFinite(t)){if(b(n))return s.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return s.error("unrecognized date",t),e;return t};var A=/%\d?f/g;function S(t,e,r,n){t=t.replace(A,(function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(e+.05));if(b(n))try{t=g.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(a)}var E=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,a,i){if(a=b(a)&&a,!e)if("y"===r)e=i.year;else if("m"===r)e=i.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,h),n=w(Math.floor(r/d),2)+":"+w(l(Math.floor(r/f),60),2);if("M"!==e){o(e)||(e=0);var a=(100+Math.min(l(t/p,60),E[e])).toFixed(e).substr(1);e>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(t,r)+"\n"+S(i.dayMonthYear,t,n,a);e=i.dayMonth+"\n"+i.year}return S(e,t,n,a)};var C=3*h;r.incrementMonth=function(t,e,r){r=b(r)&&r;var n=l(t,h);if(t=Math.round(t-n),r)try{var a=Math.round(t/h)+m,i=g.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return e%12?i.add(o,e,"m"):i.add(o,e/12,"y"),(o.toJD()-m)*h+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var u=new Date(t+C);return u.setUTCMonth(u.getUTCMonth()+e)+n-C},r.findExactDates=function(t,e){for(var r,n,a=0,i=0,s=0,l=0,u=b(e)&&g.getComponentMethod("calendars","getCal")(e),c=0;c<t.length;c++)if(n=t[c],o(n)){if(!(n%h))if(u)try{1===(r=u.fromJD(n/h+m)).day()?1===r.month()?a++:i++:s++}catch(t){}else 1===(r=new Date(n)).getUTCDate()?0===r.getUTCMonth()?a++:i++:s++}else l++;s+=i+=a;var d=t.length-l;return{exactYears:a/d,exactMonths:i/d,exactDays:s/d}}},{"../constants/numerical":695,"../registry":847,"./loggers":723,"./mod":726,d3:163,"fast-isnumeric":225}],708:[function(t,e,r){var n=t("d3"),a=t("./loggers");function i(t){var e=t&&t.parentNode;e&&e.removeChild(t)}function o(t,e,r){var n="plotly.js-style-"+t,i=document.getElementById(n);i||((i=document.createElement("style")).setAttribute("id",n),i.appendChild(document.createTextNode("")),document.head.appendChild(i));var o=i.sheet;o.insertRule?o.insertRule(e+"{"+r+"}",0):o.addRule?o.addRule(e,r,0):a.warn("addStyleRule failed")}e.exports={getGraphDiv:function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null==t)throw new Error("DOM element provided is null or undefined");return t},isPlotDiv:function(t){var e=n.select(t);return e.node()instanceof HTMLElement&&e.size()&&e.classed("js-plotly-plot")},removeElement:i,addStyleRule:function(t,e){o("global",t,e)},addRelatedStyleRule:o,deleteRelatedStyleRule:function(t){var e="plotly.js-style-"+t,r=document.getElementById(e);r&&i(r)}}},{"./loggers":723,d3:163}],709:[function(t,e,r){var n=t("events").EventEmitter,a={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,a){"undefined"!=typeof jQuery&&jQuery(t).trigger(n,a),e.emit(n,a),r.emit(n,a)},t},triggerHandler:function(t,e,r){var n,a;"undefined"!=typeof jQuery&&(n=jQuery(t).triggerHandler(e,r));var i=t._ev;if(!i)return n;var o,s=i._events[e];if(!s)return n;function l(t){return t.listener?(i.removeListener(e,t.listener),t.fired?void 0:(t.fired=!0,t.listener.apply(i,[r]))):t.apply(i,[r])}for(s=Array.isArray(s)?s:[s],o=0;o<s.length-1;o++)l(s[o]);return a=l(s[o]),void 0!==n?n:a},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=a},{events:104}],710:[function(t,e,r){var n=t("./is_plain_object.js"),a=Array.isArray;function i(t,e,r,o){var s,l,u,c,h,d,f=t[0],p=t.length;if(2===p&&a(f)&&a(t[1])&&0===f.length){if(function(t,e){var r,n;for(r=0;r<t.length;r++){if(null!==(n=t[r])&&"object"==typeof n)return!1;void 0!==n&&(e[r]=n)}return!0}(t[1],f))return f;f.splice(0,f.length)}for(var m=1;m<p;m++)for(l in s=t[m])u=f[l],c=s[l],o&&a(c)?f[l]=c:e&&c&&(n(c)||(h=a(c)))?(h?(h=!1,d=u&&a(u)?u:[]):d=u&&n(u)?u:{},f[l]=i([d,c],e,r,o)):(void 0!==c||r)&&(f[l]=c);return f}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":720}],711:[function(t,e,r){e.exports=function(t){for(var e={},r=[],n=0,a=0;a<t.length;a++){var i=t[a];1!==e[i]&&(e[i]=1,r[n++]=i)}return r}},{}],712:[function(t,e,r){function n(t){return!0===t.visible}function a(t){var e=t[0].trace;return!0===e.visible&&0!==e._length}e.exports=function(t){for(var e,r=(e=t,Array.isArray(e)&&Array.isArray(e[0])&&e[0][0]&&e[0][0].trace?a:n),i=[],o=0;o<t.length;o++){var s=t[o];r(s)&&i.push(s)}return i}},{}],713:[function(t,e,r){var n=t("country-regex"),a=t("../lib"),i=Object.keys(n),o={"ISO-3":a.identity,"USA-states":a.identity,"country names":function(t){for(var e=0;e<i.length;e++){var r=i[e];if(new RegExp(n[r]).test(t.trim().toLowerCase()))return r}return a.log("Unrecognized country name: "+t+"."),!1}};e.exports={locationToFeature:function(t,e,r){if(!e||"string"!=typeof e)return!1;var n,i,s,l=o[t](e);if(l){if("USA-states"===t)for(n=[],s=0;s<r.length;s++)(i=r[s]).properties&&i.properties.gu&&"USA"===i.properties.gu&&n.push(i);else n=r;for(s=0;s<n.length;s++)if((i=n[s]).id===l)return i;a.log(["Location with id",l,"does not have a matching topojson feature at this resolution."].join(" "))}return!1}}},{"../lib":719,"country-regex":134}],714:[function(t,e,r){var n=t("../constants/numerical").BADNUM;r.calcTraceToLineCoords=function(t){for(var e=t[0].trace.connectgaps,r=[],a=[],i=0;i<t.length;i++){var o=t[i].lonlat;o[0]!==n?a.push(o):!e&&a.length>0&&(r.push(a),a=[])}return a.length>0&&r.push(a),r},r.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},r.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),r=0;r<t.length;r++)e[r]=[t[r]];return{type:"MultiPolygon",coordinates:e}},r.makeBlank=function(){return{type:"Point",coordinates:[]}}},{"../constants/numerical":695}],715:[function(t,e,r){var n,a,i,o=t("./mod").mod;function s(t,e,r,n,a,i,o,s){var l=r-t,u=a-t,c=o-a,h=n-e,d=i-e,f=s-i,p=l*f-c*h;if(0===p)return null;var m=(u*f-c*d)/p,g=(u*h-l*d)/p;return g<0||g>1||m<0||m>1?null:{x:t+l*m,y:e+h*m}}function l(t,e,r,n,a){var i=n*t+a*e;if(i<0)return n*n+a*a;if(i>r){var o=n-t,s=a-e;return o*o+s*s}var l=n*e-a*t;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(t,e,r,n,a,i,o,u){if(s(t,e,r,n,a,i,o,u))return 0;var c=r-t,h=n-e,d=o-a,f=u-i,p=c*c+h*h,m=d*d+f*f,g=Math.min(l(c,h,p,a-t,i-e),l(c,h,p,o-t,u-e),l(d,f,m,t-a,e-i),l(d,f,m,r-a,n-i));return Math.sqrt(g)},r.getTextLocation=function(t,e,r,s){if(t===a&&s===i||(n={},a=t,i=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),u=t.getPointAtLength(o(r+s/2,e)),c=Math.atan((u.y-l.y)/(u.x-l.x)),h=t.getPointAtLength(o(r,e)),d={x:(4*h.x+l.x+u.x)/6,y:(4*h.y+l.y+u.y)/6,theta:c};return n[r]=d,d},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(t,e,r){var n,a,i=e.left,o=e.right,s=e.top,l=e.bottom,u=0,c=t.getTotalLength(),h=c;function d(e){var r=t.getPointAtLength(e);0===e?n=r:e===c&&(a=r);var u=r.x<i?i-r.x:r.x>o?r.x-o:0,h=r.y<s?s-r.y:r.y>l?r.y-l:0;return Math.sqrt(u*u+h*h)}for(var f=d(u);f;){if((u+=f+r)>h)return;f=d(u)}for(f=d(h);f;){if(u>(h-=f+r))return;f=d(h)}return{min:u,max:h,len:h-u,total:c,isClosed:0===u&&h===c&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var a,i,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,u=n.iterationLimit||30,c=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,h=0,d=0,f=s;h<u;){if(a=(d+f)/2,o=(i=t.getPointAtLength(a))[r]-e,Math.abs(o)<l)return i;c*o>0?f=a:d=a,h++}return i}},{"./mod":726}],716:[function(t,e,r){var n=t("fast-isnumeric"),a=t("tinycolor2"),i=t("color-normalize"),o=t("../components/colorscale"),s=t("../components/color/attributes").defaultLine,l=t("./array").isArrayOrTypedArray,u=i(s);function c(t,e){var r=t;return r[3]*=e,r}function h(t){if(n(t))return u;var e=i(t);return e.length?e:u}function d(t){return n(t)?t:1}e.exports={formatColor:function(t,e,r){var n,a,s,f,p,m=t.color,g=l(m),y=l(e),v=o.extractOpts(t),_=[];if(n=void 0!==v.colorscale?o.makeColorScaleFuncFromTrace(t):h,a=g?function(t,e){return void 0===t[e]?u:i(n(t[e]))}:h,s=y?function(t,e){return void 0===t[e]?1:d(t[e])}:d,g||y)for(var x=0;x<r;x++)f=a(m,x),p=s(e,x),_[x]=c(f,p);else _=c(i(m),e);return _},parseColorScale:function(t,e){void 0===e&&(e=1);var r=o.extractOpts(t);return(r.reversescale?o.flipScale(r.colorscale):r.colorscale).map((function(t){var r=t[0],n=a(t[1]).toRgb();return{index:r,rgb:[n.r,n.g,n.b,e]}}))}}},{"../components/color/attributes":592,"../components/colorscale":605,"./array":702,"color-normalize":120,"fast-isnumeric":225,tinycolor2:537}],717:[function(t,e,r){var n=t("./identity");function a(t){return[t]}e.exports={keyFun:function(t){return t.key},repeat:a,descend:n,wrap:a,unwrap:function(t){return t[0]}}},{"./identity":718}],718:[function(t,e,r){e.exports=function(t){return t}},{}],719:[function(t,e,r){var n=t("d3"),a=t("fast-isnumeric"),i=t("../constants/numerical"),o=i.FP_SAFE,s=i.BADNUM,l=e.exports={};l.nestedProperty=t("./nested_property"),l.keyedContainer=t("./keyed_container"),l.relativeAttr=t("./relative_attr"),l.isPlainObject=t("./is_plain_object"),l.toLogRange=t("./to_log_range"),l.relinkPrivateKeys=t("./relink_private");var u=t("./array");l.isTypedArray=u.isTypedArray,l.isArrayOrTypedArray=u.isArrayOrTypedArray,l.isArray1D=u.isArray1D,l.ensureArray=u.ensureArray,l.concat=u.concat,l.maxRowLength=u.maxRowLength,l.minRowLength=u.minRowLength;var c=t("./mod");l.mod=c.mod,l.modHalf=c.modHalf;var h=t("./coerce");l.valObjectMeta=h.valObjectMeta,l.coerce=h.coerce,l.coerce2=h.coerce2,l.coerceFont=h.coerceFont,l.coerceHoverinfo=h.coerceHoverinfo,l.coerceSelectionMarkerOpacity=h.coerceSelectionMarkerOpacity,l.validate=h.validate;var d=t("./dates");l.dateTime2ms=d.dateTime2ms,l.isDateTime=d.isDateTime,l.ms2DateTime=d.ms2DateTime,l.ms2DateTimeLocal=d.ms2DateTimeLocal,l.cleanDate=d.cleanDate,l.isJSDate=d.isJSDate,l.formatDate=d.formatDate,l.incrementMonth=d.incrementMonth,l.dateTick0=d.dateTick0,l.dfltRange=d.dfltRange,l.findExactDates=d.findExactDates,l.MIN_MS=d.MIN_MS,l.MAX_MS=d.MAX_MS;var f=t("./search");l.findBin=f.findBin,l.sorterAsc=f.sorterAsc,l.sorterDes=f.sorterDes,l.distinctVals=f.distinctVals,l.roundUp=f.roundUp,l.sort=f.sort,l.findIndexOfMin=f.findIndexOfMin;var p=t("./stats");l.aggNums=p.aggNums,l.len=p.len,l.mean=p.mean,l.median=p.median,l.midRange=p.midRange,l.variance=p.variance,l.stdev=p.stdev,l.interp=p.interp;var m=t("./matrix");l.init2dArray=m.init2dArray,l.transposeRagged=m.transposeRagged,l.dot=m.dot,l.translationMatrix=m.translationMatrix,l.rotationMatrix=m.rotationMatrix,l.rotationXYMatrix=m.rotationXYMatrix,l.apply2DTransform=m.apply2DTransform,l.apply2DTransform2=m.apply2DTransform2;var g=t("./angles");l.deg2rad=g.deg2rad,l.rad2deg=g.rad2deg,l.angleDelta=g.angleDelta,l.angleDist=g.angleDist,l.isFullCircle=g.isFullCircle,l.isAngleInsideSector=g.isAngleInsideSector,l.isPtInsideSector=g.isPtInsideSector,l.pathArc=g.pathArc,l.pathSector=g.pathSector,l.pathAnnulus=g.pathAnnulus;var y=t("./anchor_utils");l.isLeftAnchor=y.isLeftAnchor,l.isCenterAnchor=y.isCenterAnchor,l.isRightAnchor=y.isRightAnchor,l.isTopAnchor=y.isTopAnchor,l.isMiddleAnchor=y.isMiddleAnchor,l.isBottomAnchor=y.isBottomAnchor;var v=t("./geometry2d");l.segmentsIntersect=v.segmentsIntersect,l.segmentDistance=v.segmentDistance,l.getTextLocation=v.getTextLocation,l.clearLocationCache=v.clearLocationCache,l.getVisibleSegment=v.getVisibleSegment,l.findPointOnPath=v.findPointOnPath;var _=t("./extend");l.extendFlat=_.extendFlat,l.extendDeep=_.extendDeep,l.extendDeepAll=_.extendDeepAll,l.extendDeepNoArrays=_.extendDeepNoArrays;var x=t("./loggers");l.log=x.log,l.warn=x.warn,l.error=x.error;var b=t("./regex");l.counterRegex=b.counter;var w=t("./throttle");l.throttle=w.throttle,l.throttleDone=w.done,l.clearThrottle=w.clear;var M=t("./dom");function k(t){var e={};for(var r in t)for(var n=t[r],a=0;a<n.length;a++)e[n[a]]=+r;return e}l.getGraphDiv=M.getGraphDiv,l.isPlotDiv=M.isPlotDiv,l.removeElement=M.removeElement,l.addStyleRule=M.addStyleRule,l.addRelatedStyleRule=M.addRelatedStyleRule,l.deleteRelatedStyleRule=M.deleteRelatedStyleRule,l.clearResponsive=t("./clear_responsive"),l.makeTraceGroups=t("./make_trace_groups"),l._=t("./localize"),l.notifier=t("./notifier"),l.filterUnique=t("./filter_unique"),l.filterVisible=t("./filter_visible"),l.pushUnique=t("./push_unique"),l.cleanNumber=t("./clean_number"),l.ensureNumber=function(t){return a(t)?(t=Number(t))<-o||t>o?s:a(t)?Number(t):s:s},l.isIndex=function(t,e){return!(void 0!==e&&t>=e)&&a(t)&&t>=0&&t%1==0},l.noop=t("./noop"),l.identity=t("./identity"),l.repeat=function(t,e){for(var r=new Array(e),n=0;n<e;n++)r[n]=t;return r},l.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var a=0;a<e.length;a++){var i=e[a],o=l.nestedProperty(t,i.replace("?",r)),s=l.nestedProperty(t,i.replace("?",n)),u=o.get();o.set(s.get()),s.set(u)}},l.raiseToTop=function(t){t.parentNode.appendChild(t)},l.cancelTransition=function(t){return t.transition().duration(0)},l.constrain=function(t,e,r){return e>r?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},l.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},l.simpleMap=function(t,e,r,n){for(var a=t.length,i=new Array(a),o=0;o<a;o++)i[o]=e(t[o],r,n);return i},l.randstr=function t(e,r,n,a){if(n||(n=16),void 0===r&&(r=24),r<=0)return"0";var i,o,s=Math.log(Math.pow(2,r))/Math.log(n),u="";for(i=2;s===1/0;i*=2)s=Math.log(Math.pow(2,r/i))/Math.log(n)*i;var c=s-Math.floor(s);for(i=0;i<Math.floor(s);i++)u=Math.floor(Math.random()*n).toString(n)+u;c&&(o=Math.pow(n,c),u=Math.floor(Math.random()*o).toString(n)+u);var h=parseInt(u,n);return e&&e[u]||h!==1/0&&h>=Math.pow(2,r)?a>10?(l.warn("randstr failed uniqueness"),u):t(e,r,n,(a||0)+1):u},l.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},l.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,a,i,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(i=0,n=0;n<l;n++)(a=r+n+1-e)<-o?a-=s*Math.round(a/s):a>=s&&(a-=s*Math.floor(a/s)),a<0?a=-1-a:a>=o&&(a=s-1-a),i+=t[a]*u[n];c[r]=i}return c},l.syncOrAsync=function(t,e,r){var n;function a(){return l.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(a).then(void 0,l.promiseError);return r&&r(e)},l.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},l.noneOrAll=function(t,e,r){if(t){var n,a=!1,i=!0;for(n=0;n<r.length;n++)null!=t[r[n]]?a=!0:i=!1;if(a&&!i)for(n=0;n<r.length;n++)t[r[n]]=e[r[n]]}},l.mergeArray=function(t,e,r,n){var a="function"==typeof n;if(l.isArrayOrTypedArray(t))for(var i=Math.min(t.length,e.length),o=0;o<i;o++){var s=t[o];e[o][r]=a?n(s):s}},l.mergeArrayCastPositive=function(t,e,r){return l.mergeArray(t,e,r,(function(t){var e=+t;return isFinite(e)&&e>0?e:0}))},l.fillArray=function(t,e,r,n){if(n=n||l.identity,l.isArrayOrTypedArray(t))for(var a=0;a<e.length;a++)e[a][r]=n(t[a])},l.castOption=function(t,e,r,n){n=n||l.identity;var a=l.nestedProperty(t,r).get();return l.isArrayOrTypedArray(a)?Array.isArray(e)&&l.isArrayOrTypedArray(a[e[0]])?n(a[e[0]][e[1]]):n(a[e]):a},l.extractOption=function(t,e,r,n){if(r in t)return t[r];var a=l.nestedProperty(e,n).get();return Array.isArray(a)?void 0:a},l.tagSelected=function(t,e,r){var n,a,i=e.selectedpoints,o=e._indexToPoints;o&&(n=k(o));for(var s=0;s<i.length;s++){var u=i[s];if(l.isIndex(u)){var c=n?n[u]:u,h=r?r[c]:c;void 0!==(a=h)&&a<t.length&&(t[h].selected=1)}}},l.selIndices2selPoints=function(t){var e=t.selectedpoints,r=t._indexToPoints;if(r){for(var n=k(r),a=[],i=0;i<e.length;i++){var o=e[i];if(l.isIndex(o)){var s=n[o];l.isIndex(s)&&a.push(s)}}return a}return e},l.getTargetArray=function(t,e){var r=e.target;if("string"==typeof r&&r){var n=l.nestedProperty(t,r).get();return!!Array.isArray(n)&&n}return!!Array.isArray(r)&&r},l.minExtend=function(t,e){var r={};"object"!=typeof e&&(e={});var n,a,i,o=Object.keys(t);for(n=0;n<o.length;n++)i=t[a=o[n]],"_"!==a.charAt(0)&&"function"!=typeof i&&("module"===a?r[a]=i:Array.isArray(i)?r[a]="colorscale"===a?i.slice():i.slice(0,3):r[a]=i&&"object"==typeof i?l.minExtend(t[a],e[a]):i);for(o=Object.keys(e),n=0;n<o.length;n++)"object"==typeof(i=e[a=o[n]])&&a in r&&"object"==typeof r[a]||(r[a]=i);return r},l.titleCase=function(t){return t.charAt(0).toUpperCase()+t.substr(1)},l.containsAny=function(t,e){for(var r=0;r<e.length;r++)if(-1!==t.indexOf(e[r]))return!0;return!1},l.isIE=function(){return void 0!==window.navigator.msSaveBlob};var T=/MSIE [1-9]\./;l.isIE9orBelow=function(){return l.isIE()&&T.test(window.navigator.userAgent)};var L=/Version\/[\d\.]+.*Safari/;l.isSafari=function(){return L.test(window.navigator.userAgent)},l.isD3Selection=function(t){return t&&"function"==typeof t.classed},l.ensureSingle=function(t,e,r,n){var a=t.select(e+(r?"."+r:""));if(a.size())return a;var i=t.append(e);return r&&i.classed(r,!0),n&&i.call(n),i},l.ensureSingleById=function(t,e,r,n){var a=t.select(e+"#"+r);if(a.size())return a;var i=t.append(e).attr("id",r);return n&&i.call(n),i},l.objectFromPath=function(t,e){for(var r,n=t.split("."),a=r={},i=0;i<n.length;i++){var o=n[i],s=null,l=n[i].match(/(.*)\[([0-9]+)\]/);l?(o=l[1],s=l[2],r=r[o]=[],i===n.length-1?r[s]=e:r[s]={},r=r[s]):(i===n.length-1?r[o]=e:r[o]={},r=r[o])}return a};var A=/^([^\[\.]+)\.(.+)?/,S=/^([^\.]+)\[([0-9]+)\](\.)?(.+)?/;l.expandObjectPaths=function(t){var e,r,n,a,i,o,s;if("object"==typeof t&&!Array.isArray(t))for(r in t)t.hasOwnProperty(r)&&((e=r.match(A))?(a=t[r],n=e[1],delete t[r],t[n]=l.extendDeepNoArrays(t[n]||{},l.objectFromPath(r,l.expandObjectPaths(a))[n])):(e=r.match(S))?(a=t[r],n=e[1],i=parseInt(e[2]),delete t[r],t[n]=t[n]||[],"."===e[3]?(s=e[4],o=t[n][i]=t[n][i]||{},l.extendDeepNoArrays(o,l.objectFromPath(s,l.expandObjectPaths(a)))):t[n][i]=l.expandObjectPaths(a)):t[r]=l.expandObjectPaths(t[r]));return t},l.numSeparate=function(t,e,r){if(r||(r=!1),"string"!=typeof e||0===e.length)throw new Error("Separator string required for formatting!");"number"==typeof t&&(t=String(t));var n=/(\d+)(\d{3})/,a=e.charAt(0),i=e.charAt(1),o=t.split("."),s=o[0],l=o.length>1?a+o[1]:"";if(i&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+i+"$2");return s+l},l.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)(:[^}]*)?}/g;var E=/^\w*$/;l.templateString=function(t,e){var r={};return t.replace(l.TEMPLATE_STRING_REGEX,(function(t,n){return E.test(n)?e[n]||"":(r[n]=r[n]||l.nestedProperty(e,n).get,r[n]()||"")}))};var C=/^:/,D=0;l.hovertemplateString=function(t,e,r){var a=arguments,i={};return t.replace(l.TEMPLATE_STRING_REGEX,(function(t,o,s){var u,c,h;for(h=3;h<a.length;h++){if((u=a[h]).hasOwnProperty(o)){c=u[o];break}if(E.test(o)||(c=i[o]||l.nestedProperty(u,o).get())&&(i[o]=c),void 0!==c)break}return void 0===c&&(D<10&&(l.warn("Variable '"+o+"' in hovertemplate could not be found!"),c=t),10===D&&l.warn("Too many hovertemplate warnings - additional warnings will be suppressed"),D++),s?c=(r?r.numberFormat:n.format)(s.replace(C,""))(c):e.hasOwnProperty(o+"Label")&&(c=e[o+"Label"]),c}))},l.subplotSort=function(t,e){for(var r=Math.min(t.length,e.length)+1,n=0,a=0,i=0;i<r;i++){var o=t.charCodeAt(i)||0,s=e.charCodeAt(i)||0,l=o>=48&&o<=57,u=s>=48&&s<=57;if(l&&(n=10*n+o-48),u&&(a=10*a+s-48),!l||!u){if(n!==a)return n-a;if(o!==s)return o-s}}return a-n};var P=2e9;l.seedPseudoRandom=function(){P=2e9},l.pseudoRandom=function(){var t=P;return P=(69069*P+1)%4294967296,Math.abs(P-t)<429496729?l.pseudoRandom():P/4294967296},l.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},a=l.extractOption(t,e,"htx","hovertext");if(l.isValidTextValue(a))return n(a);var i=l.extractOption(t,e,"tx","text");return l.isValidTextValue(i)?n(i):void 0},l.isValidTextValue=function(t){return t||0===t},l.formatPercent=function(t,e){e=e||0;for(var r=(Math.round(100*t*Math.pow(10,e))*Math.pow(.1,e)).toFixed(e)+"%",n=0;n<e;n++)-1!==r.indexOf(".")&&(r=(r=r.replace("0%","%")).replace(".%","%"));return r},l.isHidden=function(t){var e=window.getComputedStyle(t).display;return!e||"none"===e}},{"../constants/numerical":695,"./anchor_utils":700,"./angles":701,"./array":702,"./clean_number":703,"./clear_responsive":705,"./coerce":706,"./dates":707,"./dom":708,"./extend":710,"./filter_unique":711,"./filter_visible":712,"./geometry2d":715,"./identity":718,"./is_plain_object":720,"./keyed_container":721,"./localize":722,"./loggers":723,"./make_trace_groups":724,"./matrix":725,"./mod":726,"./nested_property":727,"./noop":728,"./notifier":729,"./push_unique":733,"./regex":735,"./relative_attr":736,"./relink_private":737,"./search":738,"./stats":741,"./throttle":744,"./to_log_range":745,d3:163,"fast-isnumeric":225}],720:[function(t,e,r){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}},{}],721:[function(t,e,r){var n=t("./nested_property"),a=/^\w*$/;e.exports=function(t,e,r,i){var o,s,l;r=r||"name",i=i||"value";var u={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||"";var c={};if(s)for(o=0;o<s.length;o++)c[s[o][r]]=o;var h=a.test(i),d={set:function(t,e){var a=null===e?4:0;if(!s){if(!l||4===a)return;s=[],l.set(s)}var o=c[t];if(void 0===o){if(4===a)return;a|=3,o=s.length,c[t]=o}else e!==(h?s[o][i]:n(s[o],i).get())&&(a|=2);var f=s[o]=s[o]||{};return f[r]=t,h?f[i]=e:n(f,i).set(e),null!==e&&(a&=-5),u[o]=u[o]|a,d},get:function(t){if(s){var e=c[t];return void 0===e?void 0:h?s[e][i]:n(s[e],i).get()}},rename:function(t,e){var n=c[t];return void 0===n||(u[n]=1|u[n],c[e]=n,delete c[t],s[n][r]=e),d},remove:function(t){var e=c[t];if(void 0===e)return d;var a=s[e];if(Object.keys(a).length>2)return u[e]=2|u[e],d.set(t,null);if(h){for(o=e;o<s.length;o++)u[o]=3|u[o];for(o=e;o<s.length;o++)c[s[o][r]]--;s.splice(e,1),delete c[t]}else n(a,i).set(null),u[e]=6|u[e];return d},constructUpdate:function(){for(var t,a,o={},l=Object.keys(u),c=0;c<l.length;c++)a=l[c],t=e+"["+a+"]",s[a]?(1&u[a]&&(o[t+"."+r]=s[a][r]),2&u[a]&&(o[t+"."+i]=h?4&u[a]?null:s[a][i]:4&u[a]?null:n(s[a],i).get())):o[t]=null;return o}};return d}},{"./nested_property":727}],722:[function(t,e,r){var n=t("../registry");e.exports=function(t,e){for(var r=t._context.locale,a=0;a<2;a++){for(var i=t._context.locales,o=0;o<2;o++){var s=(i[r]||{}).dictionary;if(s){var l=s[e];if(l)return l}i=n.localeRegistry}var u=r.split("-")[0];if(u===r)break;r=u}return e}},{"../registry":847}],723:[function(t,e,r){var n=t("../plot_api/plot_config").dfltConfig,a=e.exports={};function i(t,e){if(t&&t.apply)try{return void t.apply(console,e)}catch(t){}for(var r=0;r<e.length;r++)try{t(e[r])}catch(t){console.log(e[r])}}a.log=function(){if(n.logging>1){for(var t=["LOG:"],e=0;e<arguments.length;e++)t.push(arguments[e]);i(console.trace||console.log,t)}},a.warn=function(){if(n.logging>0){for(var t=["WARN:"],e=0;e<arguments.length;e++)t.push(arguments[e]);i(console.trace||console.log,t)}},a.error=function(){if(n.logging>0){for(var t=["ERROR:"],e=0;e<arguments.length;e++)t.push(arguments[e]);i(console.error,t)}}},{"../plot_api/plot_config":755}],724:[function(t,e,r){var n=t("d3");e.exports=function(t,e,r){var a=t.selectAll("g."+r.replace(/\s/g,".")).data(e,(function(t){return t[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=t.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(t){t[0][i]=n.select(this)})),a}},{d3:163}],725:[function(t,e,r){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,a=t.length;for(e=0;e<a;e++)n=Math.max(n,t[e].length);var i=new Array(n);for(e=0;e<n;e++)for(i[e]=new Array(a),r=0;r<a;r++)i[e][r]=t[r][e];return i},r.dot=function(t,e){if(!t.length||!e.length||t.length!==e.length)return null;var n,a,i=t.length;if(t[0].length)for(n=new Array(i),a=0;a<i;a++)n[a]=r.dot(t[a],e);else if(e[0].length){var o=r.transposeRagged(e);for(n=new Array(o.length),a=0;a<o.length;a++)n[a]=r.dot(t,o[a])}else for(n=0,a=0;a<i;a++)n+=t[a]*e[a];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)))}}},{}],726:[function(t,e,r){e.exports={mod:function(t,e){var r=t%e;return r<0?r+e:r},modHalf:function(t,e){return Math.abs(t)>e/2?t-Math.round(t/e)*e:t}}},{}],727:[function(t,e,r){var n=t("fast-isnumeric"),a=t("./array").isArrayOrTypedArray;e.exports=function(t,e){if(n(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,i,o,l=0,u=e.split(".");l<u.length;){if(r=String(u[l]).match(/^([^\[\]]*)((\[\-?[0-9]*\])+)$/)){if(r[1])u[l]=r[1];else{if(0!==l)throw"bad property string";u.splice(0,1)}for(i=r[2].substr(1,r[2].length-2).split("]["),o=0;o<i.length;o++)l++,u.splice(l,0,Number(i[o]))}l++}return"object"!=typeof t?function(t,e,r){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:r,obj:t}}(t,e,u):{set:s(t,u,e),get:function t(e,r){return function(){var n,i,o,s,l,u=e;for(s=0;s<r.length-1;s++){if(-1===(n=r[s])){for(i=!0,o=[],l=0;l<u.length;l++)o[l]=t(u[l],r.slice(s+1))(),o[l]!==o[0]&&(i=!1);return i?o[0]:o}if("number"==typeof n&&!a(u))return;if("object"!=typeof(u=u[n])||null===u)return}if("object"==typeof u&&null!==u&&null!==(o=u[r[s]]))return o}}(t,u),astr:e,parts:u,obj:t}};var i=/(^|\.)args\[/;function o(t,e){return void 0===t||null===t&&!e.match(i)}function s(t,e,r){return function(n){var i,s,h=t,d="",f=[[t,d]],p=o(n,r);for(s=0;s<e.length-1;s++){if("number"==typeof(i=e[s])&&!a(h))throw"array index but container is not an array";if(-1===i){if(p=!u(h,e.slice(s+1),n,r))break;return}if(!c(h,i,e[s+1],p))break;if("object"!=typeof(h=h[i])||null===h)throw"container is not an object";d=l(d,i),f.push([h,d])}if(p){if(s===e.length-1&&(delete h[e[s]],Array.isArray(h)&&+e[s]==h.length-1))for(;h.length&&void 0===h[h.length-1];)h.pop()}else h[e[s]]=n}}function l(t,e){var r=e;return n(e)?r="["+e+"]":t&&(r="."+e),t+r}function u(t,e,r,n){var i,l=a(r),u=!0,h=r,d=n.replace("-1",0),f=!l&&o(r,d),p=e[0];for(i=0;i<t.length;i++)d=n.replace("-1",i),l&&(f=o(h=r[i%r.length],d)),f&&(u=!1),c(t,i,p,f)&&s(t[i],e,n.replace("-1",i))(h);return u}function c(t,e,r,n){if(void 0===t[e]){if(n)return!1;t[e]="number"==typeof r?[]:{}}return!0}},{"./array":702,"fast-isnumeric":225}],728:[function(t,e,r){e.exports=function(){}},{}],729:[function(t,e,r){var n=t("d3"),a=t("fast-isnumeric"),i=[];e.exports=function(t,e){if(-1===i.indexOf(t)){i.push(t);var r=1e3;a(e)?r=e:"long"===e&&(r=3e3);var o=n.select("body").selectAll(".plotly-notifier").data([0]);o.enter().append("div").classed("plotly-notifier",!0),o.selectAll(".notifier-note").data(i).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(s)}));for(var a=e.append("p"),i=t.split(/<br\s*\/?>/g),o=0;o<i.length;o++)o&&a.append("br"),a.append("span").text(i[o]);e.transition().duration(700).style("opacity",1).transition().delay(r).call(s)}))}function s(t){t.duration(700).style("opacity",0).each("end",(function(t){var e=i.indexOf(t);-1!==e&&i.splice(e,1),n.select(this).remove()}))}}},{d3:163,"fast-isnumeric":225}],730:[function(t,e,r){var n=t("./setcursor"),a="data-savedcursor";e.exports=function(t,e){var r=t.attr(a);if(e){if(!r){for(var i=(t.attr("class")||"").split(" "),o=0;o<i.length;o++){var s=i[o];0===s.indexOf("cursor-")&&t.attr(a,s.substr(7)).classed(s,!1)}t.attr(a)||t.attr(a,"!!")}n(t,e)}else r&&(t.attr(a,null),"!!"===r?n(t):n(t,r))}},{"./setcursor":739}],731:[function(t,e,r){var n=t("./matrix").dot,a=t("../constants/numerical").BADNUM,i=e.exports={};i.tester=function(t){var e,r=t.slice(),n=r[0][0],i=n,o=r[0][1],s=o;for(r.push(r[0]),e=1;e<r.length;e++)n=Math.min(n,r[e][0]),i=Math.max(i,r[e][0]),o=Math.min(o,r[e][1]),s=Math.max(s,r[e][1]);var l,u=!1;5===r.length&&(r[0][0]===r[1][0]?r[2][0]===r[3][0]&&r[0][1]===r[3][1]&&r[1][1]===r[2][1]&&(u=!0,l=function(t){return t[0]===r[0][0]}):r[0][1]===r[1][1]&&r[2][1]===r[3][1]&&r[0][0]===r[3][0]&&r[1][0]===r[2][0]&&(u=!0,l=function(t){return t[1]===r[0][1]}));var c=!0,h=r[0];for(e=1;e<r.length;e++)if(h[0]!==r[e][0]||h[1]!==r[e][1]){c=!1;break}return{xmin:n,xmax:i,ymin:o,ymax:s,pts:r,contains:u?function(t,e){var r=t[0],u=t[1];return!(r===a||r<n||r>i||u===a||u<o||u>s||e&&l(t))}:function(t,e){var l=t[0],u=t[1];if(l===a||l<n||l>i||u===a||u<o||u>s)return!1;var c,h,d,f,p,m=r.length,g=r[0][0],y=r[0][1],v=0;for(c=1;c<m;c++)if(h=g,d=y,g=r[c][0],y=r[c][1],!(l<(f=Math.min(h,g))||l>Math.max(h,g)||u>Math.max(d,y)))if(u<Math.min(d,y))l!==f&&v++;else{if(u===(p=g===h?u:d+(l-h)*(y-d)/(g-h)))return 1!==c||!e;u<=p&&l!==f&&v++}return v%2==1},isRect:u,degenerate:c}},i.isSegmentBent=function(t,e,r,a){var i,o,s,l=t[e],u=[t[r][0]-l[0],t[r][1]-l[1]],c=n(u,u),h=Math.sqrt(c),d=[-u[1]/h,u[0]/h];for(i=e+1;i<r;i++)if(o=[t[i][0]-l[0],t[i][1]-l[1]],(s=n(o,u))<0||s>c||Math.abs(n(o,d))>a)return!0;return!1},i.filter=function(t,e){var r=[t[0]],n=0,a=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(a+1);for(var u=l+1;u<t.length;u++)(u===t.length-1||i.isSegmentBent(t,l,u+1,e))&&(r.push(t[u]),r.length<s-2&&(n=u,a=r.length-1),l=u)}return t.length>1&&o(t.pop()),{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":695,"./matrix":725}],732:[function(t,e,n){(function(r){var n=t("./show_no_webgl_msg"),a=t("regl");e.exports=function(t,e){var i=t._fullLayout,o=!0;return i._glcanvas.each((function(n){if(!n.regl&&(!n.pick||i._has("parcoords"))){try{n.regl=a({canvas:this,attributes:{antialias:!n.pick,preserveDrawingBuffer:!0},pixelRatio:t._context.plotGlPixelRatio||r.devicePixelRatio,extensions:e||[]})}catch(t){o=!1}o&&this.addEventListener("webglcontextlost",(function(e){t&&t.emit&&t.emit("plotly_webglcontextlost",{event:e,layer:n.key})}),!1)}})),o||n({container:i._glcontainer.node()}),o}}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./show_no_webgl_msg":740,regl:502}],733:[function(t,e,r){e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;n<t.length;n++)if(t[n]instanceof RegExp&&t[n].toString()===r)return t;t.push(e)}else!e&&0!==e||-1!==t.indexOf(e)||t.push(e);return t}},{}],734:[function(t,e,r){var n=t("../lib"),a=t("../plot_api/plot_config").dfltConfig,i={add:function(t,e,r,n,i){var o,s;t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},s=t.undoQueue.index,t.autoplay?t.undoQueue.inSequence||(t.autoplay=!1):(!t.undoQueue.sequence||t.undoQueue.beginSequence?(o={undo:{calls:[],args:[]},redo:{calls:[],args:[]}},t.undoQueue.queue.splice(s,t.undoQueue.queue.length-s,o),t.undoQueue.index+=1):o=t.undoQueue.queue[s-1],t.undoQueue.beginSequence=!1,o&&(o.undo.calls.unshift(e),o.undo.args.unshift(r),o.redo.calls.push(n),o.redo.args.push(i)),t.undoQueue.queue.length>a.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;if(t.framework&&t.framework.isPolar)t.framework.undo();else if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r<e.undo.calls.length;r++)i.plotDo(t,e.undo.calls[r],e.undo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1}},redo:function(t){var e,r;if(t.framework&&t.framework.isPolar)t.framework.redo();else if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index>=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r<e.redo.calls.length;r++)i.plotDo(t,e.redo.calls[r],e.redo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1,t.undoQueue.index++}},plotDo:function(t,e,r){t.autoplay=!0,r=function(t,e){for(var r,a=[],i=0;i<e.length;i++)r=e[i],a[i]=r===t?r:"object"==typeof r?Array.isArray(r)?n.extendDeep([],r):n.extendDeepAll({},r):r;return a}(t,r),e.apply(null,r)}};e.exports=i},{"../lib":719,"../plot_api/plot_config":755}],735:[function(t,e,r){r.counter=function(t,e,r,n){var a=(e||"")+(r?"":"$"),i=!1===n?"":"^";return"xy"===t?new RegExp(i+"x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?"+a):new RegExp(i+t+"([2-9]|[1-9][0-9]+)?"+a)}},{}],736:[function(t,e,r){var n=/^(.*)(\.[^\.\[\]]+|\[\d\])$/,a=/^[^\.\[\]]+$/;e.exports=function(t,e){for(;e;){var r=t.match(n);if(r)t=r[1];else{if(!t.match(a))throw new Error("bad relativeAttr call:"+[t,e]);t=""}if("^"!==e.charAt(0))break;e=e.slice(1)}return t&&"["!==e.charAt(0)?t+"."+e:t+e}},{}],737:[function(t,e,r){var n=t("./array").isArrayOrTypedArray,a=t("./is_plain_object");e.exports=function t(e,r){for(var i in r){var o=r[i],s=e[i];if(s!==o)if("_"===i.charAt(0)||"function"==typeof o){if(i in e)continue;e[i]=o}else if(n(o)&&n(s)&&a(o[0])){if("customdata"===i||"ids"===i)continue;for(var l=Math.min(o.length,s.length),u=0;u<l;u++)s[u]!==o[u]&&a(o[u])&&a(s[u])&&t(s[u],o[u])}else a(o)&&a(s)&&(t(s,o),Object.keys(s).length||delete e[i])}}},{"./array":702,"./is_plain_object":720}],738:[function(t,e,r){var n=t("fast-isnumeric"),a=t("./loggers"),i=t("./identity");function o(t,e){return t<e}function s(t,e){return t<=e}function l(t,e){return t>e}function u(t,e){return t>=e}r.findBin=function(t,e,r){if(n(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var i,c,h=0,d=e.length,f=0,p=d>1?(e[d-1]-e[0])/(d-1):1;for(c=p>=0?r?o:s:r?u:l,t+=1e-9*p*(r?-1:1)*(p>=0?1:-1);h<d&&f++<100;)c(e[i=Math.floor((h+d)/2)],t)?h=i+1:d=i;return f>90&&a.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,a=e[n]-e[0]||1,i=a/(n||1)/1e4,o=[e[0]],s=0;s<n;s++)e[s+1]>e[s]+i&&(a=Math.min(a,e[s+1]-e[s]),o.push(e[s+1]));return{vals:o,minDiff:a}},r.roundUp=function(t,e,r){for(var n,a=0,i=e.length-1,o=0,s=r?0:1,l=r?1:0,u=r?Math.ceil:Math.floor;a<i&&o++<100;)e[n=u((a+i)/2)]<=t?a=n+s:i=n-l;return e[a]},r.sort=function(t,e){for(var r=0,n=0,a=1;a<t.length;a++){var i=e(t[a],t[a-1]);if(i<0?r=1:i>0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},r.findIndexOfMin=function(t,e){e=e||i;for(var r,n=1/0,a=0;a<t.length;a++){var o=e(t[a]);o<n&&(n=o,r=a)}return r}},{"./identity":718,"./loggers":723,"fast-isnumeric":225}],739:[function(t,e,r){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)}},{}],740:[function(t,e,r){var n=t("../components/color"),a=function(){};e.exports=function(t){for(var e in t)"function"==typeof t[e]&&(t[e]=a);t.destroy=function(){t.container.parentNode.removeChild(t.container)};var r=document.createElement("div");r.className="no-webgl",r.style.cursor="pointer",r.style.fontSize="24px",r.style.color=n.defaults[0],r.style.position="absolute",r.style.left=r.style.top="0px",r.style.width=r.style.height="100%",r.style["background-color"]=n.lightLine,r.style["z-index"]=30;var i=document.createElement("p");return i.textContent="WebGL is not supported by your browser - visit https://get.webgl.org for more info",i.style.position="relative",i.style.top="50%",i.style.left="50%",i.style.height="30%",i.style.width="50%",i.style.margin="-15% 0 0 -25%",r.appendChild(i),t.container.appendChild(r),t.container.style.background="#FFFFFF",t.container.onclick=function(){window.open("https://get.webgl.org")},!1}},{"../components/color":593}],741:[function(t,e,r){var n=t("fast-isnumeric"),a=t("./array").isArrayOrTypedArray;r.aggNums=function(t,e,i,o){var s,l;if((!o||o>i.length)&&(o=i.length),n(e)||(e=!1),a(i[0])){for(l=new Array(o),s=0;s<o;s++)l[s]=r.aggNums(t,e,i[s]);i=l}for(s=0;s<o;s++)n(e)?n(i[s])&&(e=t(+e,+i[s])):e=i[s];return e},r.len=function(t){return r.aggNums((function(t){return t+1}),0,t)},r.mean=function(t,e){return e||(e=r.len(t)),r.aggNums((function(t,e){return t+e}),0,t)/e},r.midRange=function(t){if(void 0!==t&&0!==t.length)return(r.aggNums(Math.max,null,t)+r.aggNums(Math.min,null,t))/2},r.variance=function(t,e,a){return e||(e=r.len(t)),n(a)||(a=r.mean(t,e)),r.aggNums((function(t,e){return t+Math.pow(e-a,2)}),0,t)/e},r.stdev=function(t,e,n){return Math.sqrt(r.variance(t,e,n))},r.median=function(t){var e=t.slice().sort();return r.interp(e,.5)},r.interp=function(t,e){if(!n(e))throw"n should be a finite number";if((e=e*t.length-.5)<0)return t[0];if(e>t.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":702,"fast-isnumeric":225}],742:[function(t,e,r){var n=t("color-normalize");e.exports=function(t){return t?n(t):[0,0,0,1]}},{"color-normalize":120}],743:[function(t,e,r){var n=t("d3"),a=t("../lib"),i=t("../constants/xmlns_namespaces"),o=t("../constants/alignment").LINE_SPACING;function s(t,e){return t.node().getBoundingClientRect()[e]}var l=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,L){var A=t.text(),E=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&A.match(l),C=n.select(t.node().parentNode);if(!C.empty()){var D=t.attr("class")?t.attr("class").split(" ")[0]:"text";return D+="-math",C.selectAll("svg."+D).remove(),C.selectAll("g."+D+"-group").remove(),t.style("display",null).attr({"data-unformatted":A,"data-math":"N"}),E?(e&&e._promises||[]).push(new Promise((function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10),i={fontSize:r};!function(t,e,r){var i,o,s,l;MathJax.Hub.Queue((function(){return o=a.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+a.randstr({},64);return l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(t.replace(u,"\\lt ").replace(c,"\\gt ")),MathJax.Hub.Typeset(l.node())}),(function(){var e=n.select("body").select("#MathJax_SVG_glyphs");if(l.select(".MathJax_SVG").empty()||!l.select("svg").node())a.log("There was an error in the tex syntax.",t),r();else{var o=l.select("svg").node().getBoundingClientRect();r(l.select(".MathJax_SVG"),e,o)}if(l.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)}))}(E[2],i,(function(n,a,i){C.selectAll("svg."+D).remove(),C.selectAll("g."+D+"-group").remove();var o=n&&n.select("svg");if(!o||!o.node())return P(),void e();var l=C.append("g").classed(D+"-group",!0).attr({"pointer-events":"none","data-unformatted":A,"data-math":"Y"});l.node().appendChild(o.node()),a&&a.node()&&o.node().insertBefore(a.node().cloneNode(!0),o.node().firstChild),o.attr({class:D,height:i.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=t.node().style.fill||"black",c=o.select("g");c.attr({fill:u,stroke:u});var h=s(c,"width"),d=s(c,"height"),f=+t.attr("x")-h*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],p=-(r||s(t,"height"))/4;"y"===D[0]?(l.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+") translate("+[-h/2,p-d/2]+")"}),o.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===D[0]?o.attr({x:t.attr("x"),y:p-d/2}):"a"===D[0]&&0!==D.indexOf("atitle")?o.attr({x:0,y:p}):o.attr({x:f,y:+t.attr("y")+p-d/2}),L&&L.call(t,l),e(l)}))}))):P(),t}function P(){C.empty()||(D=t.attr("class")+"-math",C.select("svg."+D).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(g," ");var r,s=!1,l=[],u=-1;function c(){u++;var e=document.createElementNS(i.svg,"tspan");n.select(e).attr({class:"line",dy:u*o+"em"}),t.appendChild(e),r=e;var a=l;if(l=[{node:e}],a.length>1)for(var s=1;s<a.length;s++)L(a[s])}function L(t){var e,a=t.type,o={};if("a"===a){e="a";var s=t.target,u=t.href,c=t.popup;u&&(o={"xlink:xlink:show":"_blank"===s||"_"!==s.charAt(0)?"new":"replace",target:s,"xlink:xlink:href":u},c&&(o.onclick='window.open(this.href.baseVal,this.target.baseVal,"'+c+'");return false;'))}else e="tspan";t.style&&(o.style=t.style);var h=document.createElementNS(i.svg,e);if("sup"===a||"sub"===a){A(r,p),r.appendChild(h);var m=document.createElementNS(i.svg,"tspan");A(m,p),n.select(m).attr("dy",f[a]),o.dy=d[a],r.appendChild(h),r.appendChild(m)}else r.appendChild(h);n.select(h).attr(o),r=t.node=h,l.push(t)}function A(t,e){t.appendChild(document.createTextNode(e))}function E(t){if(1!==l.length){var n=l.pop();t!==n.type&&a.log("Start tag <"+n.type+"> doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else a.log("Ignoring unexpected end tag </"+t+">.",e)}_.test(e)?c():(r=t,l=[{node:t}]);for(var C=e.split(y),D=0;D<C.length;D++){var P=C[D],O=P.match(v),z=O&&O[2].toLowerCase(),I=h[z];if("br"===z)c();else if(void 0===I)A(r,S(P));else if(O[1])E(z);else{var R=O[4],F={type:z},N=k(R,x);if(N?(N=N.replace(T,"$1 fill:"),I&&(N+=";"+I)):I&&(N=I),N&&(F.style=N),"a"===z){s=!0;var Y=k(R,b);if(Y){var j=document.createElement("a");j.href=Y,-1!==m.indexOf(j.protocol)&&(F.href=encodeURI(decodeURI(Y)),F.target=k(R,w)||"_blank",F.popup=k(R,M))}}L(F)}}return s}(t.node(),A)&&t.style("pointer-events","all"),r.positionText(t),L&&L.call(t)}};var u=/(<|&lt;|&#60;)/g,c=/(>|&gt;|&#62;)/g,h={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},d={sub:"0.3em",sup:"-0.6em"},f={sub:"-0.21em",sup:"0.42em"},p="",m=["http:","https:","mailto:","",void 0,":"],g=/(\r\n?|\n)/g,y=/(<[^<>]*>)/,v=/<(\/?)([^ >]*)(\s+(.*))?>/i,_=/<br(\s+.*)?>/i,x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,b=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,M=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function k(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&S(n)}var T=/(^|;)\s*color:/;r.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],a="...".length,i=t.split(y),o=[],s="",l=0,u=0;u<i.length;u++){var c=i[u],h=c.match(v),d=h&&h[2].toLowerCase();if(d)-1!==n.indexOf(d)&&(o.push(c),s=d);else{var f=c.length;if(l+f<r)o.push(c),l+=f;else if(l<r){var p=r-l;s&&("br"!==s||p<=a||f<=a)&&o.pop(),r>a?o.push(c.substr(0,p-a)+"..."):o.push(c.substr(0,p));break}s=""}}return o.join("")};var L={mu:"μ",amp:"&",lt:"<",gt:">",nbsp:" ",times:"×",plusmn:"±",deg:"°"},A=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function S(t){return t.replace(A,(function(t,e){return("#"===e.charAt(0)?function(t){if(!(t>1114111)){var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}}("x"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):L[e])||t}))}function E(t,e,r){var n,a,i,o=r.horizontalAlign,s=r.verticalAlign||"top",l=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return a="bottom"===s?function(){return l.bottom-n.height}:"middle"===s?function(){return l.top+(l.height-n.height)/2}:function(){return l.top},i="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:a()-u.top+"px",left:i()-u.left+"px","z-index":1e3}),this}}r.convertEntities=S,r.lineCount=function(t){return t.selectAll("tspan.line").size()||1},r.positionText=function(t,e,r){return t.each((function(){var t=n.select(this);function a(e,r){return void 0===r?null===(r=t.attr(e))&&(t.attr(e,0),r=0):t.attr(e,r),r}var i=a("x",e),o=a("y",r);"text"===this.nodeName&&t.selectAll("tspan.line").attr({x:i,y:o})}))},r.makeEditable=function(t,e){var r=e.gd,a=e.delegate,i=n.dispatch("edit","input","cancel"),o=a||t;if(t.style({"pointer-events":a?"none":"all"}),1!==t.size())throw new Error("boo");function s(){!function(){var a=n.select(r).select(".svg-container"),o=a.append("div"),s=t.node().style,u=parseFloat(s.fontSize||12),c=e.text;void 0===c&&(c=t.attr("data-unformatted")),o.classed("plugin-editable editable",!0).style({position:"absolute","font-family":s.fontFamily||"Arial","font-size":u,color:e.fill||s.fill||"black",opacity:1,"background-color":e.background||"transparent",outline:"#ffffff33 1px solid",margin:[-u/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(c).call(E(t,a,e)).on("blur",(function(){r._editing=!1,t.text(this.textContent).style({opacity:1});var e,a=n.select(this).attr("class");(e=a?"."+a.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(t.node().parentNode).select(e).style({opacity:0});var o=this.textContent;n.select(this).transition().duration(0).remove(),n.select(document).on("mouseup",null),i.edit.call(t,o)})).on("focus",(function(){var t=this;r._editing=!0,n.select(document).on("mouseup",(function(){if(n.event.target===t)return!1;document.activeElement===o.node()&&o.node().blur()}))})).on("keyup",(function(){27===n.event.which?(r._editing=!1,t.style({opacity:1}),n.select(this).style({opacity:0}).on("blur",(function(){return!1})).transition().remove(),i.cancel.call(t,this.textContent)):(i.input.call(t,this.textContent),n.select(this).call(E(t,a,e)))})).on("keydown",(function(){13===n.event.which&&this.blur()})).call(l)}(),t.style({opacity:0});var a,s=o.attr("class");(a=s?"."+s.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(t.node().parentNode).select(a).style({opacity:0})}function l(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}return e.immediate?s():o.on("click",s),n.rebind(t,i,"on")}},{"../constants/alignment":688,"../constants/xmlns_namespaces":696,"../lib":719,d3:163}],744:[function(t,e,r){var n={};function a(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}r.throttle=function(t,e,r){var i=n[t],o=Date.now();if(!i){for(var s in n)n[s].ts<o-6e4&&delete n[s];i=n[t]={ts:0,timer:null}}function l(){r(),i.ts=Date.now(),i.onDone&&(i.onDone(),i.onDone=null)}a(i),o>i.ts+e?l():i.timer=setTimeout((function(){l(),i.timer=null}),e)},r.done=function(t){var e=n[t];return e&&e.timer?new Promise((function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}})):Promise.resolve()},r.clear=function(t){if(t)a(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],745:[function(t,e,r){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":225}],746:[function(t,e,r){var n=e.exports={},a=t("../plots/geo/constants").locationmodeToLayer,i=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=a[t.locationmode],n=e.objects[r];return i(e,n).features}},{"../plots/geo/constants":795,"topojson-client":540}],747:[function(t,e,r){e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],748:[function(t,e,r){e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],749:[function(t,e,r){var n=t("../registry");e.exports=function(t){for(var e,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s<i.length;s++)if((r=t.match(i[s]))&&0===r.index){e=r[0];break}if(e||(e=a[a.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":847}],750:[function(t,e,r){var n=t("../lib"),a=n.extendFlat,i=n.isPlainObject,o={valType:"flaglist",extras:["none"],flags:["calc","clearAxisTypes","plot","style","markerSize","colorbars"]},s={valType:"flaglist",extras:["none"],flags:["calc","plot","legend","ticks","axrange","layoutstyle","modebar","camera","arraydraw","colorbars"]},l=o.flags.slice().concat(["fullReplot"]),u=s.flags.slice().concat("layoutReplot");function c(t){for(var e={},r=0;r<t.length;r++)e[t[r]]=!1;return e}function h(t,e,r){var n=a({},t);for(var o in n){var s=n[o];i(s)&&(n[o]=d(s,e,0,o))}return"from-root"===r&&(n.editType=e),n}function d(t,e,r,n){if(t.valType){var i=a({},t);if(i.editType=e,Array.isArray(t.items)){i.items=new Array(t.items.length);for(var o=0;o<t.items.length;o++)i.items[o]=d(t.items[o],e)}return i}return h(t,e,"_"===n.charAt(0)?"nested":"from-root")}e.exports={traces:o,layout:s,traceFlags:function(){return c(l)},layoutFlags:function(){return c(u)},update:function(t,e){var r=e.editType;if(r&&"none"!==r)for(var n=r.split("+"),a=0;a<n.length;a++)t[n[a]]=!0},overrideAll:h}},{"../lib":719}],751:[function(t,e,r){var n=t("fast-isnumeric"),a=t("gl-mat4/fromQuat"),i=t("../registry"),o=t("../lib"),s=t("../plots/plots"),l=t("../plots/cartesian/axis_ids"),u=t("../components/color"),c=l.cleanId,h=l.getFromTrace,d=i.traceIs;function f(t,e){var r=t[e],n=e.charAt(0);r&&"paper"!==r&&(t[e]=c(r,n))}function p(t){function e(e,r){var n=t[e],a=t.title&&t.title[r];n&&!a&&(t.title||(t.title={}),t.title[r]=t[e],delete t[e])}t&&("string"!=typeof t.title&&"number"!=typeof t.title||(t.title={text:t.title}),e("titlefont","font"),e("titleposition","position"),e("titleside","side"),e("titleoffset","offset"))}function m(t){if(!o.isPlainObject(t))return!1;var e=t.name;return delete t.name,delete t.showlegend,("string"==typeof e||"number"==typeof e)&&String(e)}function g(t,e,r,n){if(r&&!n)return t;if(n&&!r)return e;if(!t.trim())return e;if(!e.trim())return t;var a,i=Math.min(t.length,e.length);for(a=0;a<i&&t.charAt(a)===e.charAt(a);a++);return t.substr(0,a).trim()}function y(t){var e="middle",r="center";return"string"==typeof t&&(-1!==t.indexOf("top")?e="top":-1!==t.indexOf("bottom")&&(e="bottom"),-1!==t.indexOf("left")?r="left":-1!==t.indexOf("right")&&(r="right")),e+" "+r}function v(t,e){return e in t&&"object"==typeof t[e]&&0===Object.keys(t[e]).length}r.clearPromiseQueue=function(t){Array.isArray(t._promises)&&t._promises.length>0&&o.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var i=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,h=(s.subplotsRegistry.ternary||{}).attrRegex,d=(s.subplotsRegistry.gl3d||{}).attrRegex,m=Object.keys(t);for(e=0;e<m.length;e++){var g=m[e];if(i&&i.test(g)){var y=t[g];y.anchor&&"free"!==y.anchor&&(y.anchor=c(y.anchor)),y.overlaying&&(y.overlaying=c(y.overlaying)),y.type||(y.isdate?y.type="date":y.islog?y.type="log":!1===y.isdate&&!1===y.islog&&(y.type="linear")),"withzero"!==y.autorange&&"tozero"!==y.autorange||(y.autorange=!0,y.rangemode="tozero"),delete y.islog,delete y.isdate,delete y.categories,v(y,"domain")&&delete y.domain,void 0!==y.autotick&&(void 0===y.tickmode&&(y.tickmode=y.autotick?"auto":"linear"),delete y.autotick),p(y)}else if(l&&l.test(g))p(t[g].radialaxis);else if(h&&h.test(g)){var _=t[g];p(_.aaxis),p(_.baxis),p(_.caxis)}else if(d&&d.test(g)){var x=t[g],b=x.cameraposition;if(Array.isArray(b)&&4===b[0].length){var w=b[0],M=b[1],k=b[2],T=a([],w),L=[];for(n=0;n<3;++n)L[n]=M[n]+k*T[2+4*n];x.camera={eye:{x:L[0],y:L[1],z:L[2]},center:{x:M[0],y:M[1],z:M[2]},up:{x:0,y:0,z:1}},delete x.cameraposition}p(x.xaxis),p(x.yaxis),p(x.zaxis)}}var A=Array.isArray(t.annotations)?t.annotations.length:0;for(e=0;e<A;e++){var S=t.annotations[e];o.isPlainObject(S)&&(S.ref&&("paper"===S.ref?(S.xref="paper",S.yref="paper"):"data"===S.ref&&(S.xref="x",S.yref="y"),delete S.ref),f(S,"xref"),f(S,"yref"))}var E=Array.isArray(t.shapes)?t.shapes.length:0;for(e=0;e<E;e++){var C=t.shapes[e];o.isPlainObject(C)&&(f(C,"xref"),f(C,"yref"))}var D=t.legend;return D&&(D.x>3?(D.x=1.02,D.xanchor="left"):D.x<-2&&(D.x=-.02,D.xanchor="right"),D.y>3?(D.y=1.02,D.yanchor="bottom"):D.y<-2&&(D.y=-.02,D.yanchor="top")),p(t),"rotate"===t.dragmode&&(t.dragmode="orbit"),u.clean(t),t.template&&t.template.layout&&r.cleanLayout(t.template.layout),t},r.cleanData=function(t){for(var e=0;e<t.length;e++){var n,a=t[e];if("histogramy"===a.type&&"xbins"in a&&!("ybins"in a)&&(a.ybins=a.xbins,delete a.xbins),a.error_y&&"opacity"in a.error_y){var l=u.defaults,h=a.error_y.color||(d(a,"bar")?u.defaultLine:l[e%l.length]);a.error_y.color=u.addOpacity(u.rgb(h),u.opacity(h)*a.error_y.opacity),delete a.error_y.opacity}if("bardir"in a&&("h"!==a.bardir||!d(a,"bar")&&"histogram"!==a.type.substr(0,9)||(a.orientation="h",r.swapXYData(a)),delete a.bardir),"histogramy"===a.type&&r.swapXYData(a),"histogramx"!==a.type&&"histogramy"!==a.type||(a.type="histogram"),"scl"in a&&!("colorscale"in a)&&(a.colorscale=a.scl,delete a.scl),"reversescl"in a&&!("reversescale"in a)&&(a.reversescale=a.reversescl,delete a.reversescl),a.xaxis&&(a.xaxis=c(a.xaxis,"x")),a.yaxis&&(a.yaxis=c(a.yaxis,"y")),d(a,"gl3d")&&a.scene&&(a.scene=s.subplotsRegistry.gl3d.cleanId(a.scene)),!d(a,"pie-like")&&!d(a,"bar-like"))if(Array.isArray(a.textposition))for(n=0;n<a.textposition.length;n++)a.textposition[n]=y(a.textposition[n]);else a.textposition&&(a.textposition=y(a.textposition));var f=i.getModule(a);if(f&&f.colorbar){var _=f.colorbar.container,x=_?a[_]:a;x&&x.colorscale&&("YIGnBu"===x.colorscale&&(x.colorscale="YlGnBu"),"YIOrRd"===x.colorscale&&(x.colorscale="YlOrRd"))}if("surface"===a.type&&o.isPlainObject(a.contours)){var b=["x","y","z"];for(n=0;n<b.length;n++){var w=a.contours[b[n]];o.isPlainObject(w)&&(w.highlightColor&&(w.highlightcolor=w.highlightColor,delete w.highlightColor),w.highlightWidth&&(w.highlightwidth=w.highlightWidth,delete w.highlightWidth))}}if("candlestick"===a.type||"ohlc"===a.type){var M=!1!==(a.increasing||{}).showlegend,k=!1!==(a.decreasing||{}).showlegend,T=m(a.increasing),L=m(a.decreasing);if(!1!==T&&!1!==L){var A=g(T,L,M,k);A&&(a.name=A)}else!T&&!L||a.name||(a.name=T||L)}if(Array.isArray(a.transforms)){var S=a.transforms;for(n=0;n<S.length;n++){var E=S[n];if(o.isPlainObject(E))switch(E.type){case"filter":E.filtersrc&&(E.target=E.filtersrc,delete E.filtersrc),E.calendar&&(E.valuecalendar||(E.valuecalendar=E.calendar),delete E.calendar);break;case"groupby":if(E.styles=E.styles||E.style,E.styles&&!Array.isArray(E.styles)){var C=E.styles,D=Object.keys(C);E.styles=[];for(var P=0;P<D.length;P++)E.styles.push({target:D[P],value:C[D[P]]})}}}}v(a,"line")&&delete a.line,"marker"in a&&(v(a.marker,"line")&&delete a.marker.line,v(a,"marker")&&delete a.marker),u.clean(a),a.autobinx&&(delete a.autobinx,delete a.xbins),a.autobiny&&(delete a.autobiny,delete a.ybins),p(a),a.colorbar&&p(a.colorbar),a.marker&&a.marker.colorbar&&p(a.marker.colorbar),a.line&&a.line.colorbar&&p(a.line.colorbar),a.aaxis&&p(a.aaxis),a.baxis&&p(a.baxis)}},r.swapXYData=function(t){var e;if(o.swapAttrs(t,["?","?0","d?","?bins","nbins?","autobin?","?src","error_?"]),Array.isArray(t.z)&&Array.isArray(t.z[0])&&(t.transpose?delete t.transpose:t.transpose=!0),t.error_x&&t.error_y){var r=t.error_y,n="copy_ystyle"in r?r.copy_ystyle:!(r.color||r.thickness||r.width);o.swapAttrs(t,["error_?.copy_ystyle"]),n&&o.swapAttrs(t,["error_?.color","error_?.thickness","error_?.width"])}if("string"==typeof t.hoverinfo){var a=t.hoverinfo.split("+");for(e=0;e<a.length;e++)"x"===a[e]?a[e]="y":"y"===a[e]&&(a[e]="x");t.hoverinfo=a.join("+")}},r.coerceTraceIndices=function(t,e){if(n(e))return[e];if(!Array.isArray(e)||!e.length)return t.data.map((function(t,e){return e}));if(Array.isArray(e)){for(var r=[],a=0;a<e.length;a++)o.isIndex(e[a],t.data.length)?r.push(e[a]):o.warn("trace index (",e[a],") is not a number or is out of bounds");return r}return e},r.manageArrayContainers=function(t,e,r){var a=t.obj,i=t.parts,s=i.length,l=i[s-1],u=n(l);if(u&&null===e){var c=i.slice(0,s-1).join(".");o.nestedProperty(a,c).get().splice(l,1)}else u&&void 0===t.get()?(void 0===t.get()&&(r[t.astr]=null),t.set(e)):t.set(e)};var _=/(\.[^\[\]\.]+|\[[^\[\]\.]+\])$/;function x(t){var e=t.search(_);if(e>0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=x(e);r;){if(r in t)return!0;r=x(r)}return!1};var b=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n<e.length;n++)for(var a=t._fullData[n],i=0;i<3;i++){var s=h(t,a,b[i]);if(s&&"log"!==s.type){var l=s._name,u=s._id.substr(1);if("scene"===u.substr(0,5)){if(void 0!==r[u])continue;l=u+"."+l}var c=l+".type";void 0===r[l]&&void 0===r[c]&&o.nestedProperty(t.layout,c).set(null)}}}},{"../components/color":593,"../lib":719,"../plots/cartesian/axis_ids":770,"../plots/plots":828,"../registry":847,"fast-isnumeric":225,"gl-mat4/fromQuat":262}],752:[function(t,e,r){var n=t("./plot_api");r.plot=n.plot,r.newPlot=n.newPlot,r.restyle=n.restyle,r.relayout=n.relayout,r.redraw=n.redraw,r.update=n.update,r._guiRestyle=n._guiRestyle,r._guiRelayout=n._guiRelayout,r._guiUpdate=n._guiUpdate,r._storeDirectGUIEdit=n._storeDirectGUIEdit,r.react=n.react,r.extendTraces=n.extendTraces,r.prependTraces=n.prependTraces,r.addTraces=n.addTraces,r.deleteTraces=n.deleteTraces,r.moveTraces=n.moveTraces,r.purge=n.purge,r.addFrames=n.addFrames,r.deleteFrames=n.deleteFrames,r.animate=n.animate,r.setPlotConfig=n.setPlotConfig,r.toImage=t("./to_image"),r.validate=t("./validate"),r.downloadImage=t("../snapshot/download");var a=t("./template_api");r.makeTemplate=a.makeTemplate,r.validateTemplate=a.validateTemplate},{"../snapshot/download":849,"./plot_api":754,"./template_api":759,"./to_image":760,"./validate":761}],753:[function(t,e,r){var n=t("../lib/is_plain_object"),a=t("../lib/noop"),i=t("../lib/loggers"),o=t("../lib/search").sorterAsc,s=t("../registry");r.containerArrayMatch=t("./container_array_match");var l=r.isAddVal=function(t){return"add"===t||n(t)},u=r.isRemoveVal=function(t){return null===t||"remove"===t};r.applyContainerArrayChanges=function(t,e,r,n,c){var h=e.astr,d=s.getComponentMethod(h,"supplyLayoutDefaults"),f=s.getComponentMethod(h,"draw"),p=s.getComponentMethod(h,"drawOne"),m=n.replot||n.recalc||d===a||f===a,g=t.layout,y=t._fullLayout;if(r[""]){Object.keys(r).length>1&&i.warn("Full array edits are incompatible with other edits",h);var v=r[""][""];if(u(v))e.set(null);else{if(!Array.isArray(v))return i.warn("Unrecognized full array edit value",h,v),!0;e.set(v)}return!m&&(d(g,y),f(t),!0)}var _,x,b,w,M,k,T,L,A=Object.keys(r).map(Number).sort(o),S=e.get(),E=S||[],C=c(y,h).get(),D=[],P=-1,O=E.length;for(_=0;_<A.length;_++)if(w=r[b=A[_]],M=Object.keys(w),k=w[""],T=l(k),b<0||b>E.length-(T?0:1))i.warn("index out of range",h,b);else if(void 0!==k)M.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",h,b),u(k)?D.push(b):T?("add"===k&&(k={}),E.splice(b,0,k),C&&C.splice(b,0,{})):i.warn("Unrecognized full object edit value",h,b,k),-1===P&&(P=b);else for(x=0;x<M.length;x++)L=h+"["+b+"].",c(E[b],M[x],L).set(w[M[x]]);for(_=D.length-1;_>=0;_--)E.splice(D[_],1),C&&C.splice(D[_],1);if(E.length?S||e.set(E):e.set(null),m)return!1;if(d(g,y),p!==a){var z;if(-1===P)z=A;else{for(O=Math.max(E.length,O),z=[],_=0;_<A.length&&!((b=A[_])>=P);_++)z.push(b);for(_=P;_<O;_++)z.push(_)}for(_=0;_<z.length;_++)p(t,z[_])}else f(t);return!0}},{"../lib/is_plain_object":720,"../lib/loggers":723,"../lib/noop":728,"../lib/search":738,"../registry":847,"./container_array_match":749}],754:[function(t,e,r){var n=t("d3"),a=t("fast-isnumeric"),i=t("has-hover"),o=t("../lib"),s=o.nestedProperty,l=t("../lib/events"),u=t("../lib/queue"),c=t("../registry"),h=t("./plot_schema"),d=t("../plots/plots"),f=t("../plots/polar/legacy"),p=t("../plots/cartesian/axes"),m=t("../components/drawing"),g=t("../components/color"),y=t("../plots/cartesian/graph_interact").initInteractions,v=t("../constants/xmlns_namespaces"),_=t("../lib/svg_text_utils"),x=t("../plots/cartesian/select").clearSelect,b=t("./plot_config").dfltConfig,w=t("./manage_arrays"),M=t("./helpers"),k=t("./subroutines"),T=t("./edit_types"),L=t("../plots/cartesian/constants").AX_NAME_PATTERN,A=0;function S(t){var e=t._fullLayout;e._redrawFromAutoMarginCount?e._redrawFromAutoMarginCount--:t.emit("plotly_afterplot")}function E(t,e){try{t._fullLayout._paper.style("background",e)}catch(t){o.error(t)}}function C(t,e){E(t,g.combine(e,"white"))}function D(t,e){if(!t._context){t._context=o.extendDeep({},b);var r=n.select("base");t._context._baseUrl=r.size()&&r.attr("href")?window.location.href.split("#")[0]:""}var a,s,l,u=t._context;if(e){for(s=Object.keys(e),a=0;a<s.length;a++)"editable"!==(l=s[a])&&"edits"!==l&&l in u&&("setBackground"===l&&"opaque"===e[l]?u[l]=C:u[l]=e[l]);e.plot3dPixelRatio&&!u.plotGlPixelRatio&&(u.plotGlPixelRatio=u.plot3dPixelRatio);var c=e.editable;if(void 0!==c)for(u.editable=c,s=Object.keys(u.edits),a=0;a<s.length;a++)u.edits[s[a]]=c;if(e.edits)for(s=Object.keys(e.edits),a=0;a<s.length;a++)(l=s[a])in u.edits&&(u.edits[l]=e.edits[l]);u._exportedPlot=e._exportedPlot}u.staticPlot&&(u.editable=!1,u.edits={},u.autosizable=!1,u.scrollZoom=!1,u.doubleClick=!1,u.showTips=!1,u.showLink=!1,u.displayModeBar=!1),"hover"!==u.displayModeBar||i||(u.displayModeBar=!0),"transparent"!==u.setBackground&&"function"==typeof u.setBackground||(u.setBackground=E),u._hasZeroHeight=u._hasZeroHeight||0===t.clientHeight,u._hasZeroWidth=u._hasZeroWidth||0===t.clientWidth;var h=u.scrollZoom,d=u._scrollZoom={};if(!0===h)d.cartesian=1,d.gl3d=1,d.geo=1,d.mapbox=1;else if("string"==typeof h){var f=h.split("+");for(a=0;a<f.length;a++)d[f[a]]=1}else!1!==h&&(d.gl3d=1,d.geo=1,d.mapbox=1)}function P(t,e){var r,n,a=e+1,i=[];for(r=0;r<t.length;r++)(n=t[r])<0?i.push(a+n):i.push(n);return i}function O(t,e,r){var n,a;for(n=0;n<e.length;n++){if((a=e[n])!==parseInt(a,10))throw new Error("all values in "+r+" must be integers");if(a>=t.data.length||a<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(a,n+1)>-1||a>=0&&e.indexOf(-t.data.length+a)>-1||a<0&&e.indexOf(t.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function z(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]),O(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&O(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function I(t,e,r,n,i){!function(t,e,r,n){var a=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var i in O(t,r,"indices"),e){if(!Array.isArray(e[i])||e[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==e[i].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,r,n);for(var l=function(t,e,r,n){var i,l,u,c,h,d=o.isPlainObject(n),f=[];for(var p in Array.isArray(r)||(r=[r]),r=P(r,t.data.length-1),e)for(var m=0;m<r.length;m++){if(i=t.data[r[m]],l=(u=s(i,p)).get(),c=e[p][m],!o.isArrayOrTypedArray(c))throw new Error("attribute: "+p+" index: "+m+" must be an array");if(!o.isArrayOrTypedArray(l))throw new Error("cannot extend missing or non-array attribute: "+p);if(l.constructor!==c.constructor)throw new Error("cannot extend array with an array of a different type: "+p);h=d?n[p][m]:n,a(h)||(h=-1),f.push({prop:u,target:l,insert:c,maxp:Math.floor(h)})}return f}(t,e,r,n),u={},c={},h=0;h<l.length;h++){var d=l[h].prop,f=l[h].maxp,p=i(l[h].target,l[h].insert,f);d.set(p[0]),Array.isArray(u[d.astr])||(u[d.astr]=[]),u[d.astr].push(p[1]),Array.isArray(c[d.astr])||(c[d.astr]=[]),c[d.astr].push(l[h].target.length)}return{update:u,maxPoints:c}}function R(t,e){var r=new t.constructor(t.length+e.length);return r.set(t),r.set(e,t.length),r}function F(t,e,n,a){t=o.getGraphDiv(t),M.clearPromiseQueue(t);var i={};if("string"==typeof e)i[e]=n;else{if(!o.isPlainObject(e))return o.warn("Restyle fail.",e,n,a),Promise.reject();i=o.extendFlat({},e),void 0===a&&(a=n)}Object.keys(i).length&&(t.changed=!0);var s=M.coerceTraceIndices(t,a),l=B(t,i,s),c=l.flags;c.calc&&(t.calcdata=void 0),c.clearAxisTypes&&M.clearAxisTypes(t,s,{});var h=[];c.fullReplot?h.push(r.plot):(h.push(d.previousPromises),d.supplyDefaults(t),c.markerSize&&(d.doCalcdata(t),W(h)),c.style&&h.push(k.doTraceStyle),c.colorbars&&h.push(k.doColorBars),h.push(S)),h.push(d.rehover,d.redrag),u.add(t,F,[t,l.undoit,l.traces],F,[t,l.redoit,l.traces]);var f=o.syncOrAsync(h,t);return f&&f.then||(f=Promise.resolve()),f.then((function(){return t.emit("plotly_restyle",l.eventData),t}))}function N(t){return void 0===t?null:t}function Y(t,e){return e?function(e,r,n){var a=s(e,r),i=a.set;return a.set=function(e){j((n||"")+r,a.get(),e,t),i(e)},a}:s}function j(t,e,r,n){if(Array.isArray(e)||Array.isArray(r))for(var a=Array.isArray(e)?e:[],i=Array.isArray(r)?r:[],s=Math.max(a.length,i.length),l=0;l<s;l++)j(t+"["+l+"]",a[l],i[l],n);else if(o.isPlainObject(e)||o.isPlainObject(r)){var u=o.isPlainObject(e)?e:{},c=o.isPlainObject(r)?r:{},h=o.extendFlat({},u,c);for(var d in h)j(t+"."+d,u[d],c[d],n)}else void 0===n[t]&&(n[t]=N(e))}function B(t,e,r){var n,a=t._fullLayout,i=t._fullData,l=t.data,u=a._guiEditing,f=Y(a._preGUI,u),m=o.extendDeepAll({},e);H(e);var g,y=T.traceFlags(),v={},_={};function x(){return r.map((function(){}))}function b(t){var e=p.id2name(t);-1===g.indexOf(e)&&g.push(e)}function w(t){return"LAYOUT"+t+".autorange"}function k(t){return"LAYOUT"+t+".range"}function L(t){for(var e=t;e<i.length;e++)if(i[e]._input===l[t])return i[e]}function A(n,i,o){if(Array.isArray(n))n.forEach((function(t){A(t,i,o)}));else if(!(n in e)&&!M.hasParent(e,n)){var s;if("LAYOUT"===n.substr(0,6))s=f(t.layout,n.replace("LAYOUT",""));else{var c=r[o];s=Y(a._tracePreGUI[L(c)._fullInput.uid],u)(l[c],n)}n in _||(_[n]=x()),void 0===_[n][o]&&(_[n][o]=N(s.get())),void 0!==i&&s.set(i)}}function S(t){return function(e){return i[e][t]}}function E(t){return function(e,n){return!1===e?i[r[n]][t]:null}}for(var C in e){if(M.hasParent(e,C))throw new Error("cannot set "+C+" and a parent attribute simultaneously");var D,P,O,z,I,R,F=e[C];if("autobinx"!==C&&"autobiny"!==C||(C=C.charAt(C.length-1)+"bins",F=Array.isArray(F)?F.map(E(C)):!1===F?r.map(S(C)):null),v[C]=F,"LAYOUT"!==C.substr(0,6)){for(_[C]=x(),n=0;n<r.length;n++)if(D=l[r[n]],P=L(r[n]),z=(O=Y(a._tracePreGUI[P._fullInput.uid],u)(D,C)).get(),void 0!==(I=Array.isArray(F)?F[n%F.length]:F)){var j=O.parts[O.parts.length-1],B=C.substr(0,C.length-j.length-1),U=B?B+".":"",V=B?s(P,B).get():P;if((R=h.getTraceValObject(P,O.parts))&&R.impliedEdits&&null!==I)for(var W in R.impliedEdits)A(o.relativeAttr(C,W),R.impliedEdits[W],n);else if("thicknessmode"!==j&&"lenmode"!==j||z===I||"fraction"!==I&&"pixels"!==I||!V){if("type"===C&&("pie"===I!=("pie"===z)||"funnelarea"===I!=("funnelarea"===z))){var G="x",q="y";"bar"!==I&&"bar"!==z||"h"!==D.orientation||(G="y",q="x"),o.swapAttrs(D,["?","?src"],"labels",G),o.swapAttrs(D,["d?","?0"],"label",G),o.swapAttrs(D,["?","?src"],"values",q),"pie"===z||"funnelarea"===z?(s(D,"marker.color").set(s(D,"marker.colors").get()),a._pielayer.selectAll("g.trace").remove()):c.traceIs(D,"cartesian")&&s(D,"marker.colors").set(s(D,"marker.color").get())}}else{var Z=a._size,X=V.orient,J="top"===X||"bottom"===X;if("thicknessmode"===j){var K=J?Z.h:Z.w;A(U+"thickness",V.thickness*("fraction"===I?1/K:K),n)}else{var $=J?Z.w:Z.h;A(U+"len",V.len*("fraction"===I?1/$:$),n)}}if(_[C][n]=N(z),-1!==["swapxy","swapxyaxes","orientation","orientationaxes"].indexOf(C)){if("orientation"===C){O.set(I);var Q=D.x&&!D.y?"h":"v";if((O.get()||Q)===P.orientation)continue}else"orientationaxes"===C&&(D.orientation={v:"h",h:"v"}[P.orientation]);M.swapXYData(D),y.calc=y.clearAxisTypes=!0}else-1!==d.dataArrayContainers.indexOf(O.parts[0])?(M.manageArrayContainers(O,I,_),y.calc=!0):(R?R.arrayOk&&!c.traceIs(P,"regl")&&(o.isArrayOrTypedArray(I)||o.isArrayOrTypedArray(z))?y.calc=!0:T.update(y,R):y.calc=!0,O.set(I))}if(-1!==["swapxyaxes","orientationaxes"].indexOf(C)&&p.swap(t,r),"orientationaxes"===C){var tt=s(t.layout,"hovermode");"x"===tt.get()?tt.set("y"):"y"===tt.get()&&tt.set("x")}if(-1!==["orientation","type"].indexOf(C)){for(g=[],n=0;n<r.length;n++){var et=l[r[n]];c.traceIs(et,"cartesian")&&(b(et.xaxis||"x"),b(et.yaxis||"y"))}A(g.map(w),!0,0),A(g.map(k),[0,1],0)}}else O=f(t.layout,C.replace("LAYOUT","")),_[C]=[N(O.get())],O.set(Array.isArray(F)?F[0]:F),y.calc=!0}return(y.calc||y.plot)&&(y.fullReplot=!0),{flags:y,undoit:_,redoit:v,traces:r,eventData:o.extendDeepNoArrays([],[m,r])}}function H(t){var e,r,n,a=o.counterRegex("axis",".title",!1,!1),i=/colorbar\.title$/,s=Object.keys(t);for(e=0;e<s.length;e++)r=s[e],n=t[r],"title"!==r&&!a.test(r)&&!i.test(r)||"string"!=typeof n&&"number"!=typeof n?r.indexOf("titlefont")>-1?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(e,r){t[r]=t[e],delete t[e]}}function U(t,e,r){if(t=o.getGraphDiv(t),M.clearPromiseQueue(t),t.framework&&t.framework.isPolar)return Promise.resolve(t);var n={};if("string"==typeof e)n[e]=r;else{if(!o.isPlainObject(e))return o.warn("Relayout fail.",e,r),Promise.reject();n=o.extendFlat({},e)}Object.keys(n).length&&(t.changed=!0);var a=X(t,n),i=a.flags;i.calc&&(t.calcdata=void 0);var s=[d.previousPromises];i.layoutReplot?s.push(k.layoutReplot):Object.keys(n).length&&(V(t,i,a)||d.supplyDefaults(t),i.legend&&s.push(k.doLegend),i.layoutstyle&&s.push(k.layoutStyles),i.axrange&&W(s,a.rangesAltered),i.ticks&&s.push(k.doTicksRelayout),i.modebar&&s.push(k.doModeBar),i.camera&&s.push(k.doCamera),i.colorbars&&s.push(k.doColorBars),s.push(S)),s.push(d.rehover,d.redrag),u.add(t,U,[t,a.undoit],U,[t,a.redoit]);var l=o.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then((function(){return t.emit("plotly_relayout",a.eventData),t}))}function V(t,e,r){var n=t._fullLayout;if(!e.axrange)return!1;for(var a in e)if("axrange"!==a&&e[a])return!1;for(var i in r.rangesAltered){var o=p.id2name(i),s=t.layout[o],l=n[o];if(l.autorange=s.autorange,l.range=s.range.slice(),l.cleanRange(),l._matchGroup)for(var u in l._matchGroup)if(u!==i){var c=n[p.id2name(u)];c.autorange=l.autorange,c.range=l.range.slice(),c._input.range=l.range.slice()}}return!0}function W(t,e){var r=e?function(t){var r=[],n=!0;for(var a in e){var i=p.getFromId(t,a);if(r.push(a),i._matchGroup)for(var o in i._matchGroup)e[o]||r.push(o);i.automargin&&(n=!1)}return p.draw(t,r,{skipTitle:n})}:function(t){return p.draw(t,"redraw")};t.push(x,k.doAutoRangeAndConstraints,r,k.drawData,k.finalDraw)}var G=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,q=/^[xyz]axis[0-9]*\.autorange$/,Z=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function X(t,e){var r,n,a,i=t.layout,l=t._fullLayout,u=l._guiEditing,d=Y(l._preGUI,u),f=Object.keys(e),m=p.list(t),g=o.extendDeepAll({},e),y={};for(H(e),f=Object.keys(e),n=0;n<f.length;n++)if(0===f[n].indexOf("allaxes")){for(a=0;a<m.length;a++){var v=m[a]._id.substr(1),_=-1!==v.indexOf("scene")?v+".":"",x=f[n].replace("allaxes",_+m[a]._name);e[x]||(e[x]=e[f[n]])}delete e[f[n]]}var b=T.layoutFlags(),k={},A={};function S(t,r){if(Array.isArray(t))t.forEach((function(t){S(t,r)}));else if(!(t in e)&&!M.hasParent(e,t)){var n=d(i,t);t in A||(A[t]=N(n.get())),void 0!==r&&n.set(r)}}var E,C={};function D(t){var e=p.name2id(t.split(".")[0]);return C[e]=1,e}for(var P in e){if(M.hasParent(e,P))throw new Error("cannot set "+P+" and a parent attribute simultaneously");for(var O=d(i,P),z=e[P],I=O.parts.length-1;I>0&&"string"!=typeof O.parts[I];)I--;var R=O.parts[I],F=O.parts[I-1]+"."+R,j=O.parts.slice(0,I).join("."),B=s(t.layout,j).get(),U=s(l,j).get(),V=O.get();if(void 0!==z){k[P]=z,A[P]="reverse"===R?z:N(V);var W=h.getLayoutValObject(l,O.parts);if(W&&W.impliedEdits&&null!==z)for(var X in W.impliedEdits)S(o.relativeAttr(P,X),W.impliedEdits[X]);if(-1!==["width","height"].indexOf(P))if(z){S("autosize",null);var K="height"===P?"width":"height";S(K,l[K])}else l[P]=t._initialAutoSize[P];else if("autosize"===P)S("width",z?null:l.width),S("height",z?null:l.height);else if(F.match(G))D(F),s(l,j+"._inputRange").set(null);else if(F.match(q)){D(F),s(l,j+"._inputRange").set(null);var $=s(l,j).get();$._inputDomain&&($._input.domain=$._inputDomain.slice())}else F.match(Z)&&s(l,j+"._inputDomain").set(null);if("type"===R){var Q=B,tt="linear"===U.type&&"log"===z,et="log"===U.type&&"linear"===z;if(tt||et){if(Q&&Q.range)if(U.autorange)tt&&(Q.range=Q.range[1]>Q.range[0]?[1,2]:[2,1]);else{var rt=Q.range[0],nt=Q.range[1];tt?(rt<=0&&nt<=0&&S(j+".autorange",!0),rt<=0?rt=nt/1e6:nt<=0&&(nt=rt/1e6),S(j+".range[0]",Math.log(rt)/Math.LN10),S(j+".range[1]",Math.log(nt)/Math.LN10)):(S(j+".range[0]",Math.pow(10,rt)),S(j+".range[1]",Math.pow(10,nt)))}else S(j+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[O.parts[0]]&&"radialaxis"===O.parts[1]&&delete l[O.parts[0]]._subplot.viewInitial["radialaxis.range"],c.getComponentMethod("annotations","convertCoords")(t,U,z,S),c.getComponentMethod("images","convertCoords")(t,U,z,S)}else S(j+".autorange",!0),S(j+".range",null);s(l,j+"._inputRange").set(null)}else if(R.match(L)){var at=s(l,P).get(),it=(z||{}).type;it&&"-"!==it||(it="linear"),c.getComponentMethod("annotations","convertCoords")(t,at,it,S),c.getComponentMethod("images","convertCoords")(t,at,it,S)}var ot=w.containerArrayMatch(P);if(ot){r=ot.array,n=ot.index;var st=ot.property,lt=W||{editType:"calc"};""!==n&&""===st&&(w.isAddVal(z)?A[P]=null:w.isRemoveVal(z)?A[P]=(s(i,r).get()||[])[n]:o.warn("unrecognized full object value",e)),T.update(b,lt),y[r]||(y[r]={});var ut=y[r][n];ut||(ut=y[r][n]={}),ut[st]=z,delete e[P]}else"reverse"===R?(B.range?B.range.reverse():(S(j+".autorange",!0),B.range=[1,0]),U.autorange?b.calc=!0:b.plot=!0):(l._has("scatter-like")&&l._has("regl")&&"dragmode"===P&&("lasso"===z||"select"===z)&&"lasso"!==V&&"select"!==V||l._has("gl2d")?b.plot=!0:W?T.update(b,W):b.calc=!0,O.set(z))}}for(r in y)w.applyContainerArrayChanges(t,d(i,r),y[r],b,d)||(b.plot=!0);var ct=l._axisConstraintGroups||[];for(E in C)for(n=0;n<ct.length;n++){var ht=ct[n];if(ht[E])for(var dt in b.calc=!0,ht)C[dt]||(p.getFromId(t,dt)._constraintShrinkable=!0)}return(J(t)||e.height||e.width)&&(b.plot=!0),(b.plot||b.calc)&&(b.layoutReplot=!0),{flags:b,rangesAltered:C,undoit:A,redoit:k,eventData:g}}function J(t){var e=t._fullLayout,r=e.width,n=e.height;return t.layout.autosize&&d.plotAutoSize(t,t.layout,e),e.width!==r||e.height!==n}function K(t,e,n,a){if(t=o.getGraphDiv(t),M.clearPromiseQueue(t),t.framework&&t.framework.isPolar)return Promise.resolve(t);o.isPlainObject(e)||(e={}),o.isPlainObject(n)||(n={}),Object.keys(e).length&&(t.changed=!0),Object.keys(n).length&&(t.changed=!0);var i=M.coerceTraceIndices(t,a),s=B(t,o.extendFlat({},e),i),l=s.flags,c=X(t,o.extendFlat({},n)),h=c.flags;(l.calc||h.calc)&&(t.calcdata=void 0),l.clearAxisTypes&&M.clearAxisTypes(t,i,n);var f=[];h.layoutReplot?f.push(k.layoutReplot):l.fullReplot?f.push(r.plot):(f.push(d.previousPromises),V(t,h,c)||d.supplyDefaults(t),l.style&&f.push(k.doTraceStyle),(l.colorbars||h.colorbars)&&f.push(k.doColorBars),h.legend&&f.push(k.doLegend),h.layoutstyle&&f.push(k.layoutStyles),h.axrange&&W(f,c.rangesAltered),h.ticks&&f.push(k.doTicksRelayout),h.modebar&&f.push(k.doModeBar),h.camera&&f.push(k.doCamera),f.push(S)),f.push(d.rehover,d.redrag),u.add(t,K,[t,s.undoit,c.undoit,s.traces],K,[t,s.redoit,c.redoit,s.traces]);var p=o.syncOrAsync(f,t);return p&&p.then||(p=Promise.resolve(t)),p.then((function(){return t.emit("plotly_update",{data:s.eventData,layout:c.eventData}),t}))}function $(t){return function(e){e._fullLayout._guiEditing=!0;var r=t.apply(null,arguments);return e._fullLayout._guiEditing=!1,r}}var Q=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],tt=[{pattern:/^selectedpoints$/,attr:"selectionrevision"},{pattern:/(^|value\.)visible$/,attr:"legend.uirevision"},{pattern:/^dimensions\[\d+\]\.constraintrange/},{pattern:/^node\.(x|y|groups)/},{pattern:/^level$/},{pattern:/(^|value\.)name$/},{pattern:/colorbar\.title\.text$/},{pattern:/colorbar\.(x|y)$/,attr:"editrevision"}];function et(t,e){for(var r=0;r<e.length;r++){var n=e[r],a=t.match(n.pattern);if(a)return{head:a[1],attr:n.attr}}}function rt(t,e){var r=s(e,t).get();if(void 0!==r)return r;var n=t.split(".");for(n.pop();n.length>1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function nt(t,e){for(var r=0;r<e.length;r++)if(e[r]._fullInput.uid===t)return r;return-1}function at(t,e,r){for(var n=0;n<e.length;n++)if(e[n].uid===t)return n;return!e[r]||e[r].uid?-1:r}function it(t,e){var r=o.isPlainObject(t),n=Array.isArray(t);return r||n?(r&&o.isPlainObject(e)||n&&Array.isArray(e))&&JSON.stringify(t)===JSON.stringify(e):t===e}function ot(t,e,r,n){var a,i,l,u=n.getValObject,c=n.flags,h=n.immutable,d=n.inArray,f=n.arrayIndex;function p(){var t=a.editType;d&&-1!==t.indexOf("arraydraw")?o.pushUnique(c.arrays[d],f):(T.update(c,a),"none"!==t&&c.nChanges++,n.transition&&a.anim&&c.nChangesAnim++,(G.test(l)||q.test(l))&&(c.rangesAltered[r[0]]=1),Z.test(l)&&s(e,"_inputDomain").set(null),"datarevision"===i&&(c.newDataRevision=1))}function m(t){return"data_array"===t.valType||t.arrayOk}for(i in t){if(c.calc&&!n.transition)return;var g=t[i],y=e[i],v=r.concat(i);if(l=v.join("."),"_"!==i.charAt(0)&&"function"!=typeof g&&g!==y){if(("tick0"===i||"dtick"===i)&&"geo"!==r[0]){var _=e.tickmode;if("auto"===_||"array"===_||!_)continue}if(("range"!==i||!e.autorange)&&("zmin"!==i&&"zmax"!==i||"contourcarpet"!==e.type)&&(a=u(v))&&(!a._compareAsJSON||JSON.stringify(g)!==JSON.stringify(y))){var x,b=a.valType,w=m(a),M=Array.isArray(g),k=Array.isArray(y);if(M&&k){var L="_input_"+i,A=t[L],S=e[L];if(Array.isArray(A)&&A===S)continue}if(void 0===y)w&&M?c.calc=!0:p();else if(a._isLinkedToArray){var E=[],C=!1;d||(c.arrays[i]=E);var D=Math.min(g.length,y.length),P=Math.max(g.length,y.length);if(D!==P){if("arraydraw"!==a.editType){p();continue}C=!0}for(x=0;x<D;x++)ot(g[x],y[x],v.concat(x),o.extendFlat({inArray:i,arrayIndex:x},n));if(C)for(x=D;x<P;x++)E.push(x)}else!b&&o.isPlainObject(g)?ot(g,y,v,n):w?M&&k?(h&&(c.calc=!0),(h||n.newDataRevision)&&p()):M!==k?c.calc=!0:p():M&&k&&g.length===y.length&&String(g)===String(y)||p()}}}for(i in e)if(!(i in t)&&"_"!==i.charAt(0)&&"function"!=typeof e[i]){if(m(a=u(r.concat(i)))&&Array.isArray(e[i]))return void(c.calc=!0);p()}}function st(t){var e=n.select(t),r=t._fullLayout;if(r._container=e.selectAll(".plot-container").data([0]),r._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0),r._paperdiv=r._container.selectAll(".svg-container").data([0]),r._paperdiv.enter().append("div").classed("svg-container",!0).style("position","relative"),r._glcontainer=r._paperdiv.selectAll(".gl-container").data([{}]),r._glcontainer.enter().append("div").classed("gl-container",!0),r._paperdiv.selectAll(".main-svg").remove(),r._paperdiv.select(".modebar-container").remove(),r._paper=r._paperdiv.insert("svg",":first-child").classed("main-svg",!0),r._toppaper=r._paperdiv.append("svg").classed("main-svg",!0),r._modebardiv=r._paperdiv.append("div"),r._hoverpaper=r._paperdiv.append("svg").classed("main-svg",!0),!r._uid){var a={};n.selectAll("defs").each((function(){this.id&&(a[this.id.split("-")[1]]=1)})),r._uid=o.randstr(a)}r._paperdiv.selectAll(".main-svg").attr(v.svgAttrs),r._defs=r._paper.append("defs").attr("id","defs-"+r._uid),r._clips=r._defs.append("g").classed("clips",!0),r._topdefs=r._toppaper.append("defs").attr("id","topdefs-"+r._uid),r._topclips=r._topdefs.append("g").classed("clips",!0),r._bgLayer=r._paper.append("g").classed("bglayer",!0),r._draggers=r._paper.append("g").classed("draglayer",!0);var 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._polarlayer=r._paper.append("g").classed("polarlayer",!0),r._ternarylayer=r._paper.append("g").classed("ternarylayer",!0),r._geolayer=r._paper.append("g").classed("geolayer",!0),r._funnelarealayer=r._paper.append("g").classed("funnelarealayer",!0),r._pielayer=r._paper.append("g").classed("pielayer",!0),r._sunburstlayer=r._paper.append("g").classed("sunburstlayer",!0),r._indicatorlayer=r._toppaper.append("g").classed("indicatorlayer",!0),r._glimages=r._paper.append("g").classed("glimages",!0);var s=r._toppaper.append("g").classed("layer-above",!0);r._imageUpperLayer=s.append("g").classed("imagelayer",!0),r._shapeUpperLayer=s.append("g").classed("shapelayer",!0),r._infolayer=r._toppaper.append("g").classed("infolayer",!0),r._menulayer=r._toppaper.append("g").classed("menulayer",!0),r._zoomlayer=r._toppaper.append("g").classed("zoomlayer",!0),r._hoverlayer=r._hoverpaper.append("g").classed("hoverlayer",!0),r._modebardiv.classed("modebar-container",!0).style("position","absolute").style("top","0px").style("right","0px"),t.emit("plotly_framework")}r.animate=function(t,e,r){if(t=o.getGraphDiv(t),!o.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before animating it. For more details, see https://plot.ly/javascript/animations/");var n=t._transitionData;n._frameQueue||(n._frameQueue=[]);var a=(r=d.supplyAnimationDefaults(r)).transition,i=r.frame;function s(t){return Array.isArray(a)?t>=a.length?a[0]:a[t]:a}function l(t){return Array.isArray(i)?t>=i.length?i[0]:i[t]:i}function u(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,c){function h(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&function(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,d.transition(t,e.frame.data,e.frame.layout,M.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then((function(){e.onComplete&&e.onComplete()})),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}()};e()}var f,p,m=0;function g(t){return Array.isArray(a)?m>=a.length?t.transitionOpts=a[m]:t.transitionOpts=a[0]:t.transitionOpts=a,m++,t}var y=[],v=null==e,_=Array.isArray(e);if(v||_||!o.isPlainObject(e)){if(v||-1!==["string","number"].indexOf(typeof e))for(f=0;f<n._frames.length;f++)(p=n._frames[f])&&(v||String(p.group)===String(e))&&y.push({type:"byname",name:String(p.name),data:g({name:p.name})});else if(_)for(f=0;f<e.length;f++){var x=e[f];-1!==["number","string"].indexOf(typeof x)?(x=String(x),y.push({type:"byname",name:x,data:g({name:x})})):o.isPlainObject(x)&&y.push({type:"object",data:g(o.extendFlat({},x))})}}else y.push({type:"object",data:g(o.extendFlat({},e))});for(f=0;f<y.length;f++)if("byname"===(p=y[f]).type&&!n._frameHash[p.data.name])return o.warn('animate failure: frame not found: "'+p.data.name+'"'),void c();-1!==["next","immediate"].indexOf(r.mode)&&function(){if(0!==n._frameQueue.length){for(;n._frameQueue.length;){var e=n._frameQueue.pop();e.onInterrupt&&e.onInterrupt()}t.emit("plotly_animationinterrupted",[])}}(),"reverse"===r.direction&&y.reverse();var b=t._fullLayout._currentFrame;if(b&&r.fromcurrent){var w=-1;for(f=0;f<y.length;f++)if("byname"===(p=y[f]).type&&p.name===b){w=f;break}if(w>0&&w<y.length-1){var k=[];for(f=0;f<y.length;f++)p=y[f],("byname"!==y[f].type||f>w)&&k.push(p);y=k}}y.length>0?function(e){if(0!==e.length){for(var a=0;a<e.length;a++){var o;o="byname"===e[a].type?d.computeFrame(t,e[a].name):e[a].data;var f=l(a),p=s(a);p.duration=Math.min(p.duration,f.duration);var m={frame:o,name:e[a].name,frameOpts:f,transitionOpts:p};a===e.length-1&&(m.onComplete=u(i,2),m.onInterrupt=c),n._frameQueue.push(m)}"immediate"===r.mode&&(n._lastFrameAt=-1/0),n._animationRaf||h()}}(y):(t.emit("plotly_animated"),i())}))},r.addFrames=function(t,e,r){if(t=o.getGraphDiv(t),null==e)return Promise.resolve();if(!o.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plot.ly/javascript/animations/");var n,a,i,s,l=t._transitionData._frames,c=t._transitionData._frameHash;if(!Array.isArray(e))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+e);var h=l.length+2*e.length,f=[],p={};for(n=e.length-1;n>=0;n--)if(o.isPlainObject(e[n])){var m=e[n].name,g=(c[m]||p[m]||{}).name,y=e[n].name,v=c[g]||p[g];g&&y&&"number"==typeof y&&v&&A<5&&(A++,o.warn('addFrames: overwriting frame "'+(c[g]||p[g]).name+'" with a frame whose name of type "number" also equates to "'+g+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===A&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),p[m]={name:m},f.push({frame:d.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:h+n})}f.sort((function(t,e){return t.index>e.index?-1:t.index<e.index?1:0}));var _=[],x=[],b=l.length;for(n=f.length-1;n>=0;n--){if("number"==typeof(a=f[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;c[a.name="frame "+t._transitionData._counter++];);if(c[a.name]){for(i=0;i<l.length&&(l[i]||{}).name!==a.name;i++);_.push({type:"replace",index:i,value:a}),x.unshift({type:"replace",index:i,value:l[i]})}else s=Math.max(0,Math.min(f[n].index,b)),_.push({type:"insert",index:s,value:a}),x.unshift({type:"delete",index:s}),b++}var w=d.modifyFrames,M=d.modifyFrames,k=[t,x],T=[t,_];return u&&u.add(t,w,k,M,T),d.modifyFrames(t,_)},r.deleteFrames=function(t,e){if(t=o.getGraphDiv(t),!o.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t);var r,n,a=t._transitionData._frames,i=[],s=[];if(!e)for(e=[],r=0;r<a.length;r++)e.push(r);for((e=e.slice()).sort(),r=e.length-1;r>=0;r--)n=e[r],i.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:a[n]});var l=d.modifyFrames,c=d.modifyFrames,h=[t,s],f=[t,i];return u&&u.add(t,l,h,c,f),d.modifyFrames(t,i)},r.addTraces=function t(e,n,a){e=o.getGraphDiv(e);var i,s,l=[],c=r.deleteTraces,h=t,d=[e,l],f=[e,n];for(function(t,e,r){var n,a;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(a=e[n])||Array.isArray(a)||null===a)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")}(e,n,a),Array.isArray(n)||(n=[n]),n=n.map((function(t){return o.extendFlat({},t)})),M.cleanData(n),i=0;i<n.length;i++)e.data.push(n[i]);for(i=0;i<n.length;i++)l.push(-n.length+i);if(void 0===a)return s=r.redraw(e),u.add(e,c,d,h,f),s;Array.isArray(a)||(a=[a]);try{z(e,l,a)}catch(t){throw e.data.splice(e.data.length-n.length,n.length),t}return u.startSequence(e),u.add(e,c,d,h,f),s=r.moveTraces(e,l,a),u.stopSequence(e),s},r.deleteTraces=function t(e,n){e=o.getGraphDiv(e);var a,i,s=[],l=r.addTraces,c=t,h=[e,s,n],d=[e,n];if(void 0===n)throw new Error("indices must be an integer or array of integers.");for(Array.isArray(n)||(n=[n]),O(e,n,"indices"),(n=P(n,e.data.length-1)).sort(o.sorterDes),a=0;a<n.length;a+=1)i=e.data.splice(n[a],1)[0],s.push(i);var f=r.redraw(e);return u.add(e,l,h,c,d),f},r.extendTraces=function t(e,n,a,i){var s=I(e=o.getGraphDiv(e),n,a,i,(function(t,e,r){var n,a;if(o.isTypedArray(t))if(r<0){var i=new t.constructor(0),s=R(t,e);r<0?(n=s,a=i):(n=i,a=s)}else if(n=new t.constructor(r),a=new t.constructor(t.length+e.length-r),r===e.length)n.set(e),a.set(t);else if(r<e.length){var l=e.length-r;n.set(e.subarray(l)),a.set(t),a.set(e.subarray(0,l),t.length)}else{var u=r-e.length,c=t.length-u;n.set(t.subarray(c)),n.set(e,u),a.set(t.subarray(0,c))}else n=t.concat(e),a=r>=0&&r<n.length?n.splice(0,n.length-r):[];return[n,a]})),l=r.redraw(e),c=[e,s.update,a,s.maxPoints];return u.add(e,r.prependTraces,c,t,arguments),l},r.moveTraces=function t(e,n,a){var i,s=[],l=[],c=t,h=t,d=[e=o.getGraphDiv(e),a,n],f=[e,n,a];if(z(e,n,a),n=Array.isArray(n)?n:[n],void 0===a)for(a=[],i=0;i<n.length;i++)a.push(-n.length+i);for(a=Array.isArray(a)?a:[a],n=P(n,e.data.length-1),a=P(a,e.data.length-1),i=0;i<e.data.length;i++)-1===n.indexOf(i)&&s.push(e.data[i]);for(i=0;i<n.length;i++)l.push({newIndex:a[i],trace:e.data[n[i]]});for(l.sort((function(t,e){return t.newIndex-e.newIndex})),i=0;i<l.length;i+=1)s.splice(l[i].newIndex,0,l[i].trace);e.data=s;var p=r.redraw(e);return u.add(e,c,d,h,f),p},r.prependTraces=function t(e,n,a,i){var s=I(e=o.getGraphDiv(e),n,a,i,(function(t,e,r){var n,a;if(o.isTypedArray(t))if(r<=0){var i=new t.constructor(0),s=R(e,t);r<0?(n=s,a=i):(n=i,a=s)}else if(n=new t.constructor(r),a=new t.constructor(t.length+e.length-r),r===e.length)n.set(e),a.set(t);else if(r<e.length){var l=e.length-r;n.set(e.subarray(0,l)),a.set(e.subarray(l)),a.set(t,l)}else{var u=r-e.length;n.set(e),n.set(t.subarray(0,u),e.length),a.set(t.subarray(u))}else n=e.concat(t),a=r>=0&&r<n.length?n.splice(r,n.length):[];return[n,a]})),l=r.redraw(e),c=[e,s.update,a,s.maxPoints];return u.add(e,r.extendTraces,c,t,arguments),l},r.newPlot=function(t,e,n,a){return t=o.getGraphDiv(t),d.cleanPlot([],{},t._fullData||[],t._fullLayout||{}),d.purge(t),r.plot(t,e,n,a)},r.plot=function(t,e,a,i){var s;if(t=o.getGraphDiv(t),l.init(t),o.isPlainObject(e)){var u=e;e=u.data,a=u.layout,i=u.config,s=u.frames}if(!1===l.triggerHandler(t,"plotly_beforeplot",[e,a,i]))return Promise.reject();e||a||o.isPlotDiv(t)||o.warn("Calling Plotly.plot as if redrawing but this container doesn't yet have a plot.",t),D(t,i),a||(a={}),n.select(t).classed("js-plotly-plot",!0),m.makeTester(),Array.isArray(t._promises)||(t._promises=[]);var h=0===(t.data||[]).length&&Array.isArray(e);Array.isArray(e)&&(M.cleanData(e),h?t.data=e:t.data.push.apply(t.data,e),t.empty=!1),t.layout&&!h||(t.layout=M.cleanLayout(a)),d.supplyDefaults(t);var g=t._fullLayout,v=g._has("cartesian");if(!g._has("polar")&&e&&e[0]&&e[0].r)return o.log("Legacy polar charts are deprecated!"),function(t,e,r){var a=n.select(t).selectAll(".plot-container").data([0]);a.enter().insert("div",":first-child").classed("plot-container plotly",!0);var i=a.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),f.manager.fillLayout(t),i.style({width:t._fullLayout.width+"px",height:t._fullLayout.height+"px"}),t.framework=f.manager.framework(t),t.framework({data:t.data,layout:t.layout},i.node()),t.framework.setUndoPoint();var s=t.framework.svg(),l=1,u=t._fullLayout.title?t._fullLayout.title.text:"";""!==u&&u||(l=0);var c=function(){this.call(_.convertToTspans,t)},h=s.select(".title-group text").call(c);if(t._context.edits.titleText){var p=o._(t,"Click to enter Plot title");u&&u!==p||(l=.2,h.attr({"data-unformatted":p}).text(p).style({opacity:l}).on("mouseover.opacity",(function(){n.select(this).transition().duration(100).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(1e3).style("opacity",0)})));var m=function(){this.call(_.makeEditable,{gd:t}).on("edit",(function(e){t.framework({layout:{title:{text:e}}}),this.text(e).call(c),this.call(m)})).on("cancel",(function(){var t=this.attr("data-unformatted");this.text(t).call(c)}))};h.call(m)}return t._context.setBackground(t,t._fullLayout.paper_bgcolor),d.addLinks(t),Promise.resolve()}(t,e,a);g._replotting=!0,h&&st(t),t.framework!==st&&(t.framework=st,st(t)),m.initGradients(t),h&&p.saveShowSpikeInitial(t);var x=!t.calcdata||t.calcdata.length!==(t._fullData||[]).length;x&&d.doCalcdata(t);for(var b=0;b<t.calcdata.length;b++)t.calcdata[b][0].trace=t._fullData[b];t._context.responsive?t._responsiveChartHandler||(t._responsiveChartHandler=function(){o.isHidden(t)||d.resize(t)},window.addEventListener("resize",t._responsiveChartHandler)):o.clearResponsive(t);var w=o.extendFlat({},g._size),T=0;function L(){return d.clearAutoMarginIds(t),k.drawMarginPushers(t),p.allowAutoMargin(t),d.doAutoMargin(t),d.previousPromises(t)}function A(){t._transitioning||(k.doAutoRangeAndConstraints(t),h&&p.saveRangeInitial(t),c.getComponentMethod("rangeslider","calcAutorange")(t))}var E=[d.previousPromises,function(){if(s)return r.addFrames(t,s)},function e(){for(var r=g._basePlotModules,n=0;n<r.length;n++)r[n].drawFramework&&r[n].drawFramework(t);if(!g._glcanvas&&g._has("gl")&&(g._glcanvas=g._glcontainer.selectAll(".gl-canvas").data([{key:"contextLayer",context:!0,pick:!1},{key:"focusLayer",context:!1,pick:!1},{key:"pickLayer",context:!1,pick:!0}],(function(t){return t.key})),g._glcanvas.enter().append("canvas").attr("class",(function(t){return"gl-canvas gl-canvas-"+t.key.replace("Layer","")})).style({position:"absolute",top:0,left:0,overflow:"visible","pointer-events":"none"})),g._glcanvas){g._glcanvas.attr("width",g.width).attr("height",g.height);var a=g._glcanvas.data()[0].regl;if(a&&(Math.floor(g.width)!==a._gl.drawingBufferWidth||Math.floor(g.height)!==a._gl.drawingBufferHeight)){var i="WebGL context buffer and canvas dimensions do not match due to browser/WebGL bug.";if(!T)return o.log(i+" Clearing graph and plotting again."),d.cleanPlot([],{},t._fullData,g),d.supplyDefaults(t),g=t._fullLayout,d.doCalcdata(t),T++,e();o.error(i)}}return"h"===g.modebar.orientation?g._modebardiv.style("height",null).style("width","100%"):g._modebardiv.style("width",null).style("height",g.height+"px"),d.previousPromises(t)},L,function(){if(d.didMarginChange(w,g._size))return o.syncOrAsync([L,k.layoutStyles],t)}];v&&E.push((function(){if(x)return o.syncOrAsync([c.getComponentMethod("shapes","calcAutorange"),c.getComponentMethod("annotations","calcAutorange"),A],t);A()})),E.push(k.layoutStyles),v&&E.push((function(){return p.draw(t,h?"":"redraw")})),E.push(k.drawData,k.finalDraw,y,d.addLinks,d.rehover,d.redrag,d.doAutoMargin,d.previousPromises);var C=o.syncOrAsync(E,t);return C&&C.then||(C=Promise.resolve()),C.then((function(){return S(t),t}))},r.purge=function(t){var e=(t=o.getGraphDiv(t))._fullLayout||{},r=t._fullData||[];return d.cleanPlot([],{},r,e),d.purge(t),l.purge(t),e._container&&e._container.remove(),delete t._context,t},r.react=function(t,e,n,a){var i,l,u=(t=o.getGraphDiv(t))._fullData,f=t._fullLayout;if(o.isPlotDiv(t)&&u&&f){if(o.isPlainObject(e)){var p=e;e=p.data,n=p.layout,a=p.config,i=p.frames}var m=!1;if(a){var g=o.extendDeep({},t._context);t._context=void 0,D(t,a),m=function t(e,r){var n;for(n in e)if("_"!==n.charAt(0)){var a=e[n],i=r[n];if(a!==i)if(o.isPlainObject(a)&&o.isPlainObject(i)){if(t(a,i))return!0}else{if(!Array.isArray(a)||!Array.isArray(i))return!0;if(a.length!==i.length)return!0;for(var s=0;s<a.length;s++)if(a[s]!==i[s]){if(!o.isPlainObject(a[s])||!o.isPlainObject(i[s]))return!0;if(t(a[s],i[s]))return!0}}}}(g,t._context)}t.data=e||[],M.cleanData(t.data),t.layout=n||{},M.cleanLayout(t.layout),function(t,e,r,n){var a,i,l,u,c,h,d,f,p=n._preGUI,m=[],g={};for(a in p){if(c=et(a,Q)){if(i=c.attr||c.head+".uirevision",(u=(l=s(n,i).get())&&rt(i,e))&&u===l&&(null===(h=p[a])&&(h=void 0),it(f=(d=s(e,a)).get(),h))){void 0===f&&"autorange"===a.substr(a.length-9)&&m.push(a.substr(0,a.length-10)),d.set(N(s(n,a).get()));continue}}else o.warn("unrecognized GUI edit: "+a);delete p[a],"range["===a.substr(a.length-8,6)&&(g[a.substr(0,a.length-9)]=1)}for(var y=0;y<m.length;y++){var v=m[y];if(g[v]){var _=s(e,v).get();_&&delete _.autorange}}var x=n._tracePreGUI;for(var b in x){var w,M=x[b],k=null;for(a in M){if(!k){var T=nt(b,r);if(T<0){delete x[b];break}var L=at(b,t,(w=r[T]._fullInput).index);if(L<0){delete x[b];break}k=t[L]}if(c=et(a,tt)){if(c.attr?u=(l=s(n,c.attr).get())&&rt(c.attr,e):(l=w.uirevision,void 0===(u=k.uirevision)&&(u=e.uirevision)),u&&u===l&&(null===(h=M[a])&&(h=void 0),it(f=(d=s(k,a)).get(),h))){d.set(N(s(w,a).get()));continue}}else o.warn("unrecognized GUI edit: "+a+" in trace uid "+b);delete M[a]}}}(t.data,t.layout,u,f),d.supplyDefaults(t,{skipUpdateCalc:!0});var y=t._fullData,v=t._fullLayout,_=void 0===v.datarevision,x=v.transition,b=function(t,e,r,n,a){var i=T.layoutFlags();return i.arrays={},i.rangesAltered={},i.nChanges=0,i.nChangesAnim=0,ot(e,r,[],{getValObject:function(t){return h.getLayoutValObject(r,t)},flags:i,immutable:n,transition:a,gd:t}),(i.plot||i.calc)&&(i.layoutReplot=!0),a&&i.nChanges&&i.nChangesAnim&&(i.anim=i.nChanges===i.nChangesAnim?"all":"some"),i}(t,f,v,_,x),w=b.newDataRevision,L=function(t,e,r,n,a,i){var o=e.length===r.length;if(!a&&!o)return{fullReplot:!0,calc:!0};var s,l,u=T.traceFlags();u.arrays={},u.nChanges=0,u.nChangesAnim=0;var c={getValObject:function(t){var e=h.getTraceValObject(l,t);return!l._module.animatable&&e.anim&&(e.anim=!1),e},flags:u,immutable:n,transition:a,newDataRevision:i,gd:t},f={};for(s=0;s<e.length;s++)if(r[s]){if(l=r[s]._fullInput,d.hasMakesDataTransform(l)&&(l=r[s]),f[l.uid])continue;f[l.uid]=1,ot(e[s]._fullInput,l,[],c)}return(u.calc||u.plot)&&(u.fullReplot=!0),a&&u.nChanges&&u.nChangesAnim&&(u.anim=u.nChanges===u.nChangesAnim&&o?"all":"some"),u}(t,u,y,_,x,w);J(t)&&(b.layoutReplot=!0),L.calc||b.calc?t.calcdata=void 0:d.supplyDefaultsUpdateCalc(t.calcdata,y);var A=[];if(i&&(t._transitionData={},d.createTransitionData(t),A.push((function(){return r.addFrames(t,i)}))),v.transition&&!m&&(L.anim||b.anim))d.doCalcdata(t),k.doAutoRangeAndConstraints(t),A.push((function(){return d.transitionFromReact(t,L,b,f)}));else if(L.fullReplot||b.layoutReplot||m)t._fullLayout._skipDefaults=!0,A.push(r.plot);else{for(var E in b.arrays){var C=b.arrays[E];if(C.length){var P=c.getComponentMethod(E,"drawOne");if(P!==o.noop)for(var O=0;O<C.length;O++)P(t,C[O]);else{var z=c.getComponentMethod(E,"draw");if(z===o.noop)throw new Error("cannot draw components: "+E);z(t)}}}A.push(d.previousPromises),L.style&&A.push(k.doTraceStyle),(L.colorbars||b.colorbars)&&A.push(k.doColorBars),b.legend&&A.push(k.doLegend),b.layoutstyle&&A.push(k.layoutStyles),b.axrange&&W(A),b.ticks&&A.push(k.doTicksRelayout),b.modebar&&A.push(k.doModeBar),b.camera&&A.push(k.doCamera),A.push(S)}A.push(d.rehover,d.redrag),(l=o.syncOrAsync(A,t))&&l.then||(l=Promise.resolve(t))}else l=r.newPlot(t,e,n,a);return l.then((function(){return t.emit("plotly_react",{data:e,layout:n}),t}))},r.redraw=function(t){if(t=o.getGraphDiv(t),!o.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t);return M.cleanData(t.data),M.cleanLayout(t.layout),t.calcdata=void 0,r.plot(t).then((function(){return t.emit("plotly_redraw"),t}))},r.relayout=U,r.restyle=F,r.setPlotConfig=function(t){return o.extendFlat(b,t)},r.update=K,r._guiRelayout=$(U),r._guiRestyle=$(F),r._guiUpdate=$(K),r._storeDirectGUIEdit=function(t,e,r){for(var n in r)j(n,s(t,n).get(),r[n],e)}},{"../components/color":593,"../components/drawing":614,"../constants/xmlns_namespaces":696,"../lib":719,"../lib/events":709,"../lib/queue":734,"../lib/svg_text_utils":743,"../plots/cartesian/axes":767,"../plots/cartesian/constants":773,"../plots/cartesian/graph_interact":776,"../plots/cartesian/select":784,"../plots/plots":828,"../plots/polar/legacy":836,"../registry":847,"./edit_types":750,"./helpers":751,"./manage_arrays":753,"./plot_config":755,"./plot_schema":756,"./subroutines":758,d3:163,"fast-isnumeric":225,"has-hover":410}],755:[function(t,e,r){var n={staticPlot:{valType:"boolean",dflt:!1},plotlyServerURL:{valType:"string",dflt:"https://plot.ly"},editable:{valType:"boolean",dflt:!1},edits:{annotationPosition:{valType:"boolean",dflt:!1},annotationTail:{valType:"boolean",dflt:!1},annotationText:{valType:"boolean",dflt:!1},axisTitleText:{valType:"boolean",dflt:!1},colorbarPosition:{valType:"boolean",dflt:!1},colorbarTitleText:{valType:"boolean",dflt:!1},legendPosition:{valType:"boolean",dflt:!1},legendText:{valType:"boolean",dflt:!1},shapePosition:{valType:"boolean",dflt:!1},titleText:{valType:"boolean",dflt:!1}},autosizable:{valType:"boolean",dflt:!1},responsive:{valType:"boolean",dflt:!1},fillFrame:{valType:"boolean",dflt:!1},frameMargins:{valType:"number",dflt:0,min:0,max:.5},scrollZoom:{valType:"flaglist",flags:["cartesian","gl3d","geo","mapbox"],extras:[!0,!1],dflt:"gl3d+geo+mapbox"},doubleClick:{valType:"enumerated",values:[!1,"reset","autosize","reset+autosize"],dflt:"reset+autosize"},doubleClickDelay:{valType:"number",dflt:300,min:0},showAxisDragHandles:{valType:"boolean",dflt:!0},showAxisRangeEntryBoxes:{valType:"boolean",dflt:!0},showTips:{valType:"boolean",dflt:!0},showLink:{valType:"boolean",dflt:!1},linkText:{valType:"string",dflt:"Edit chart",noBlank:!0},sendData:{valType:"boolean",dflt:!0},showSources:{valType:"any",dflt:!1},displayModeBar:{valType:"enumerated",values:["hover",!0,!1],dflt:"hover"},showSendToCloud:{valType:"boolean",dflt:!1},showEditInChartStudio:{valType:"boolean",dflt:!1},modeBarButtonsToRemove:{valType:"any",dflt:[]},modeBarButtonsToAdd:{valType:"any",dflt:[]},modeBarButtons:{valType:"any",dflt:!1},toImageButtonOptions:{valType:"any",dflt:{}},displaylogo:{valType:"boolean",dflt:!0},watermark:{valType:"boolean",dflt:!1},plotGlPixelRatio:{valType:"number",dflt:2,min:1,max:4},setBackground:{valType:"any",dflt:"transparent"},topojsonURL:{valType:"string",noBlank:!0,dflt:"https://cdn.plot.ly/"},mapboxAccessToken:{valType:"string",dflt:null},logging:{valType:"boolean",dflt:1},queueLength:{valType:"integer",min:0,dflt:0},globalTransforms:{valType:"any",dflt:[]},locale:{valType:"string",dflt:"en-US"},locales:{valType:"any",dflt:{}}},a={};!function t(e,r){for(var n in e){var a=e[n];a.valType?r[n]=a.dflt:(r[n]||(r[n]={}),t(a,r[n]))}}(n,a),e.exports={configAttributes:n,dfltConfig:a}},{}],756:[function(t,e,r){var n=t("../registry"),a=t("../lib"),i=t("../plots/attributes"),o=t("../plots/layout_attributes"),s=t("../plots/frame_attributes"),l=t("../plots/animation_attributes"),u=t("./plot_config").configAttributes,c=t("../plots/polar/legacy/area_attributes"),h=t("../plots/polar/legacy/axis_attributes"),d=t("./edit_types"),f=a.extendFlat,p=a.extendDeepAll,m=a.isPlainObject,g=a.isArrayOrTypedArray,y=a.nestedProperty,v=a.valObjectMeta,_="_isSubplotObj",x="_isLinkedToArray",b=[_,x,"_arrayAttrRegexps","_deprecated"];function w(t,e,r){if(!t)return!1;if(t._isLinkedToArray)if(M(e[r]))r++;else if(r<e.length)return!1;for(;r<e.length;r++){var n=t[e[r]];if(!m(n))break;if(t=n,r===e.length-1)break;if(t._isLinkedToArray){if(!M(e[++r]))return!1}else if("info_array"===t.valType){var a=e[++r];if(!M(a))return!1;var i=t.items;if(Array.isArray(i)){if(a>=i.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!M(o))return!1;t=i[a][o]}else t=i[a]}else t=i}}return t}function M(t){return t===Math.round(t)&&t>=0}function k(t){return function(t){r.crawl(t,(function(t,e,n){r.isValObject(t)?"data_array"===t.valType?(t.role="data",n[e+"src"]={valType:"string",editType:"none"}):!0===t.arrayOk&&(n[e+"src"]={valType:"string",editType:"none"}):m(t)&&(t.role="object")}))}(t),function(t){r.crawl(t,(function(t,e,r){if(t){var n=t[x];n&&(delete t[x],r[e]={items:{}},r[e].items[n]=t,r[e].role="object")}}))}(t),function(t){!function t(e){for(var r in e)if(m(e[r]))t(e[r]);else if(Array.isArray(e[r]))for(var n=0;n<e[r].length;n++)t(e[r][n]);else e[r]instanceof RegExp&&(e[r]=e[r].toString())}(t)}(t),t}function T(t,e,r){var n=y(t,r),a=p({},e.layoutAttributes);a[_]=!0,n.set(a)}function L(t,e,r){var n=y(t,r);n.set(p(n.get()||{},e))}r.IS_SUBPLOT_OBJ=_,r.IS_LINKED_TO_ARRAY=x,r.DEPRECATED="_deprecated",r.UNDERSCORE_ATTRS=b,r.get=function(){var t={};n.allTypes.concat("area").forEach((function(e){t[e]=function(t){var e,a;"area"===t?(e={attributes:c},a={}):a=(e=n.modules[t]._module).basePlotModule;var o={type:null},s=p({},i),l=p({},e.attributes);r.crawl(l,(function(t,e,r,n,a){y(s,a).set(void 0),void 0===t&&y(l,a).set(void 0)})),p(o,s),n.traceIs(t,"noOpacity")&&delete o.opacity,n.traceIs(t,"showLegend")||(delete o.showlegend,delete o.legendgroup),n.traceIs(t,"noHover")&&(delete o.hoverinfo,delete o.hoverlabel),e.selectPoints||delete o.selectedpoints,p(o,l),a.attributes&&p(o,a.attributes),o.type=t;var u={meta:e.meta||{},categories:e.categories||{},animatable:Boolean(e.animatable),type:t,attributes:k(o)};if(e.layoutAttributes){var h={};p(h,e.layoutAttributes),u.layoutAttributes=k(h)}return e.animatable||r.crawl(u,(function(t){r.isValObject(t)&&"anim"in t&&delete t.anim})),u}(e)}));var e,a={};return Object.keys(n.transformsRegistry).forEach((function(t){a[t]=function(t){var e=n.transformsRegistry[t],r=p({},e.attributes);return Object.keys(n.componentsRegistry).forEach((function(e){var a=n.componentsRegistry[e];a.schema&&a.schema.transforms&&a.schema.transforms[t]&&Object.keys(a.schema.transforms[t]).forEach((function(e){L(r,a.schema.transforms[t][e],e)}))})),{attributes:k(r)}}(t)})),{defs:{valObjects:v,metaKeys:b.concat(["description","role","editType","impliedEdits"]),editType:{traces:d.traces,layout:d.layout},impliedEdits:{}},traces:t,layout:function(){var t,e,r={};for(t in p(r,o),n.subplotsRegistry)if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var a=0;a<e.attr.length;a++)T(r,e,e.attr[a]);else T(r,e,"subplot"===e.attr?e.name:e.attr);for(t in r=function(t){return f(t,{radialaxis:h.radialaxis,angularaxis:h.angularaxis}),f(t,h.layout),t}(r),n.componentsRegistry){var i=(e=n.componentsRegistry[t]).schema;if(i&&(i.subplots||i.layout)){var s=i.subplots;if(s&&s.xaxis&&!s.yaxis)for(var l in s.xaxis)delete r.yaxis[l]}else"colorscale"===e.name?p(r,e.layoutAttributes):e.layoutAttributes&&L(r,e.layoutAttributes,e.name)}return{layoutAttributes:k(r)}}(),transforms:a,frames:(e={frames:p({},s)},k(e),e.frames),animation:k(l),config:k(u)}},r.crawl=function(t,e,n,a){var i=n||0;a=a||"",Object.keys(t).forEach((function(n){var o=t[n];if(-1===b.indexOf(n)){var s=(a?a+".":"")+n;e(o,n,t,i,s),r.isValObject(o)||m(o)&&"impliedEdits"!==n&&r.crawl(o,e,i+1,s)}}))},r.isValObject=function(t){return t&&void 0!==t.valType},r.findArrayAttributes=function(t){var e,n,a=[],o=[],s=[];function l(t,r,i,l){o=o.slice(0,l).concat([r]),s=s.slice(0,l).concat([t&&t._isLinkedToArray]),t&&("data_array"===t.valType||!0===t.arrayOk)&&("colorbar"!==o[l-1]||"ticktext"!==r&&"tickvals"!==r)&&function t(e,r,i){var l=e[o[r]],u=i+o[r];if(r===o.length-1)g(l)&&a.push(n+u);else if(s[r]){if(Array.isArray(l))for(var c=0;c<l.length;c++)m(l[c])&&t(l[c],r+1,u+"["+c+"].")}else m(l)&&t(l,r+1,u+".")}(e,0,"")}e=t,n="",r.crawl(i,l),t._module&&t._module.attributes&&r.crawl(t._module.attributes,l);var u=t.transforms;if(u)for(var c=0;c<u.length;c++){var h=u[c],d=h._module;d&&(n="transforms["+c+"].",e=h,r.crawl(d.attributes,l))}return a},r.getTraceValObject=function(t,e){var r,a,o=e[0],s=1;if("transforms"===o){if(1===e.length)return i.transforms;var l=t.transforms;if(!Array.isArray(l)||!l.length)return!1;var u=e[1];if(!M(u)||u>=l.length)return!1;a=(r=(n.transformsRegistry[l[u].type]||{}).attributes)&&r[e[2]],s=3}else if("area"===t.type)a=c[o];else{var h=t._module;if(h||(h=(n.modules[t.type||i.type.dflt]||{})._module),!h)return!1;if(!(a=(r=h.attributes)&&r[o])){var d=h.basePlotModule;d&&d.attributes&&(a=d.attributes[o])}a||(a=i[o])}return w(a,e,s)},r.getLayoutValObject=function(t,e){return w(function(t,e){var r,a,i,s,l=t._basePlotModules;if(l){var u;for(r=0;r<l.length;r++){if((i=l[r]).attrRegex&&i.attrRegex.test(e)){if(i.layoutAttrOverrides)return i.layoutAttrOverrides;!u&&i.layoutAttributes&&(u=i.layoutAttributes)}var c=i.baseLayoutAttrOverrides;if(c&&e in c)return c[e]}if(u)return u}var d=t._modules;if(d)for(r=0;r<d.length;r++)if((s=d[r].layoutAttributes)&&e in s)return s[e];for(a in n.componentsRegistry){if("colorscale"===(i=n.componentsRegistry[a]).name&&0===e.indexOf("coloraxis"))return i.layoutAttributes[e];if(!i.schema&&e===i.name)return i.layoutAttributes}return e in o?o[e]:"radialaxis"===e||"angularaxis"===e?h[e]:h.layout[e]||!1}(t,e[0]),e,1)}},{"../lib":719,"../plots/animation_attributes":762,"../plots/attributes":764,"../plots/frame_attributes":794,"../plots/layout_attributes":819,"../plots/polar/legacy/area_attributes":834,"../plots/polar/legacy/axis_attributes":835,"../registry":847,"./edit_types":750,"./plot_config":755}],757:[function(t,e,r){var n=t("../lib"),a=t("../plots/attributes"),i="templateitemname",o={name:{valType:"string",editType:"none"}};function s(t){return t&&"string"==typeof t}function l(t){var e=t.length-1;return"s"!==t.charAt(e)&&n.warn("bad argument to arrayDefaultKey: "+t),t.substr(0,t.length-1)+"defaults"}o[i]={valType:"string",editType:"calc"},r.templatedArray=function(t,e){return e._isLinkedToArray=t,e.name=o.name,e[i]=o[i],e},r.traceTemplater=function(t){var e,r,i={};for(e in t)r=t[e],Array.isArray(r)&&r.length&&(i[e]=0);return{newTrace:function(o){var s={type:e=n.coerce(o,{},a,"type"),_template:null};if(e in i){r=t[e];var l=i[e]%r.length;i[e]++,s._template=r[l]}return s}}},r.newContainer=function(t,e,r){var a=t._template,i=a&&(a[e]||r&&a[r]);return n.isPlainObject(i)||(i=null),t[e]={_template:i}},r.arrayTemplater=function(t,e,r){var n=t._template,a=n&&n[l(e)],o=n&&n[e];Array.isArray(o)&&o.length||(o=[]);var u={};return{newItem:function(t){var e={name:t.name,_input:t},n=e[i]=t[i];if(!s(n))return e._template=a,e;for(var l=0;l<o.length;l++){var c=o[l];if(c.name===n)return u[n]=1,e._template=c,e}return e[r]=t[r]||!1,e._template=!1,e},defaultItems:function(){for(var t=[],e=0;e<o.length;e++){var r=o[e],n=r.name;if(s(n)&&!u[n]){var a={_template:r,name:n,_input:{_templateitemname:n}};a[i]=r[i],t.push(a),u[n]=1}}return t}}},r.arrayDefaultKey=l,r.arrayEditor=function(t,e,r){var a=(n.nestedProperty(t,e).get()||[]).length,o=r._index,s=o>=a&&(r._input||{})._templateitemname;s&&(o=a);var l,u=e+"["+o+"]";function c(){l={},s&&(l[u]={},l[u][i]=s)}function h(t,e){s?n.nestedProperty(l[u],t).set(e):l[u+"."+t]=e}function d(){var t=l;return c(),t}return c(),{modifyBase:function(t,e){l[t]=e},modifyItem:h,getUpdateObj:d,applyUpdate:function(e,r){e&&h(e,r);var a=d();for(var i in a)n.nestedProperty(t,i).set(a[i])}}}},{"../lib":719,"../plots/attributes":764}],758:[function(t,e,r){var n=t("d3"),a=t("../registry"),i=t("../plots/plots"),o=t("../lib"),s=t("../lib/clear_gl_canvases"),l=t("../components/color"),u=t("../components/drawing"),c=t("../components/titles"),h=t("../components/modebar"),d=t("../plots/cartesian/axes"),f=t("../constants/alignment"),p=t("../plots/cartesian/constraints"),m=p.enforce,g=p.clean,y=t("../plots/cartesian/autorange").doAutoRange,v="start";function _(t,e,r){for(var n=0;n<r.length;n++){var a=r[n][0],i=r[n][1];if(!(a[0]>=t[1]||a[1]<=t[0])&&i[0]<e[1]&&i[1]>e[0])return!0}return!1}function x(t){var e,a,i,s,c,p,m=t._fullLayout,g=m._size,y=g.p,v=d.list(t,"",!0);if(m._paperdiv.style({width:t._context.responsive&&m.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":m.width+"px",height:t._context.responsive&&m.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":m.height+"px"}).selectAll(".main-svg").call(u.setSize,m.width,m.height),t._context.setBackground(t,m.paper_bgcolor),r.drawMainTitle(t),h.manage(t),!m._has("cartesian"))return t._promises.length&&Promise.all(t._promises);function x(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-y-n:e._offset+e._length+y+n:g.t+g.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+y+n:e._offset-y-n:g.l+g.w*(t.position||0)+n%1}for(e=0;e<v.length;e++){var w=(s=v[e])._anchorAxis;s._linepositions={},s._lw=u.crispRound(t,s.linewidth,1),s._mainLinePosition=x(s,w,s.side),s._mainMirrorPosition=s.mirror&&w?x(s,w,f.OPPOSITE_SIDE[s.side]):null}var k=[],T=[],L=[],A=1===l.opacity(m.paper_bgcolor)&&1===l.opacity(m.plot_bgcolor)&&m.paper_bgcolor===m.plot_bgcolor;for(a in m._plots)if((i=m._plots[a]).mainplot)i.bg&&i.bg.remove(),i.bg=void 0;else{var S=i.xaxis.domain,E=i.yaxis.domain,C=i.plotgroup;if(_(S,E,L)){var D=C.node(),P=i.bg=o.ensureSingle(C,"rect","bg");D.insertBefore(P.node(),D.childNodes[0]),T.push(a)}else C.select("rect.bg").remove(),L.push([S,E]),A||(k.push(a),T.push(a))}var O,z,I,R,F,N,Y,j,B,H,U,V,W,G=m._bgLayer.selectAll(".bg").data(k);for(G.enter().append("rect").classed("bg",!0),G.exit().remove(),G.each((function(t){m._plots[t].bg=n.select(this)})),e=0;e<T.length;e++)i=m._plots[T[e]],c=i.xaxis,p=i.yaxis,i.bg&&i.bg.call(u.setRect,c._offset-y,p._offset-y,c._length+2*y,p._length+2*y).call(l.fill,m.plot_bgcolor).style("stroke-width",0);if(!m._hasOnlyLargeSploms)for(a in m._plots){i=m._plots[a],c=i.xaxis,p=i.yaxis;var q,Z,X=i.clipId="clip"+m._uid+a+"plot",J=o.ensureSingleById(m._clips,"clipPath",X,(function(t){t.classed("plotclip",!0).append("rect")}));i.clipRect=J.select("rect").attr({width:c._length,height:p._length}),u.setTranslate(i.plot,c._offset,p._offset),i._hasClipOnAxisFalse?(q=null,Z=X):(q=X,Z=null),u.setClipUrl(i.plot,q,t),i.layerClipId=Z}function K(t){return"M"+O+","+t+"H"+z}function $(t){return"M"+c._offset+","+t+"h"+c._length}function Q(t){return"M"+t+","+j+"V"+Y}function tt(t){return"M"+t+","+p._offset+"v"+p._length}function et(t,e,r){if(!t.showline||a!==t._mainSubplot)return"";if(!t._anchorAxis)return r(t._mainLinePosition);var n=e(t._mainLinePosition);return t.mirror&&(n+=e(t._mainMirrorPosition)),n}for(a in m._plots){i=m._plots[a],c=i.xaxis,p=i.yaxis;var rt="M0,0";b(c,a)&&(F=M(c,"left",p,v),O=c._offset-(F?y+F:0),N=M(c,"right",p,v),z=c._offset+c._length+(N?y+N:0),I=x(c,p,"bottom"),R=x(c,p,"top"),!(W=!c._anchorAxis||a!==c._mainSubplot)||"allticks"!==c.mirror&&"all"!==c.mirror||(c._linepositions[a]=[I,R]),rt=et(c,K,$),W&&c.showline&&("all"===c.mirror||"allticks"===c.mirror)&&(rt+=K(I)+K(R)),i.xlines.style("stroke-width",c._lw+"px").call(l.stroke,c.showline?c.linecolor:"rgba(0,0,0,0)")),i.xlines.attr("d",rt);var nt="M0,0";b(p,a)&&(U=M(p,"bottom",c,v),Y=p._offset+p._length+(U?y:0),V=M(p,"top",c,v),j=p._offset-(V?y:0),B=x(p,c,"left"),H=x(p,c,"right"),!(W=!p._anchorAxis||a!==p._mainSubplot)||"allticks"!==p.mirror&&"all"!==p.mirror||(p._linepositions[a]=[B,H]),nt=et(p,Q,tt),W&&p.showline&&("all"===p.mirror||"allticks"===p.mirror)&&(nt+=Q(B)+Q(H)),i.ylines.style("stroke-width",p._lw+"px").call(l.stroke,p.showline?p.linecolor:"rgba(0,0,0,0)")),i.ylines.attr("d",nt)}return d.makeClipPaths(t),t._promises.length&&Promise.all(t._promises)}function b(t,e){return(t.ticks||t.showline)&&(e===t._mainSubplot||"all"===t.mirror||"allticks"===t.mirror)}function w(t,e,r){if(!r.showline||!r._lw)return!1;if("all"===r.mirror||"allticks"===r.mirror)return!0;var n=r._anchorAxis;if(!n)return!1;var a=f.FROM_BL[e];return r.side===e?n.domain[a]===t.domain[a]:r.mirror&&n.domain[1-a]===t.domain[1-a]}function M(t,e,r,n){if(w(t,e,r))return r._lw;for(var a=0;a<n.length;a++){var i=n[a];if(i._mainAxis===r._mainAxis&&w(t,e,i))return i._lw}return 0}r.layoutStyles=function(t){return o.syncOrAsync([i.doAutoMargin,x],t)},r.drawMainTitle=function(t){var e=t._fullLayout,r=function(t){var e=t.title,r="middle";return o.isRightAnchor(e)?r="end":o.isLeftAnchor(e)&&(r=v),r}(e),n=function(t){var e=t.title,r="0em";return o.isTopAnchor(e)?r=f.CAP_SHIFT+"em":o.isMiddleAnchor(e)&&(r=f.MID_SHIFT+"em"),r}(e);c.draw(t,"gtitle",{propContainer:e,propName:"title.text",placeholder:e._dfltTitle.plot,attributes:{x:function(t,e){var r=t.title,n=t._size,a=0;return e===v?a=r.pad.l:"end"===e&&(a=-r.pad.r),"paper"===r.xref?n.l+n.w*r.x+a:t.width*r.x+a}(e,r),y:function(t,e){var r=t.title,n=t._size,a=0;return"0em"!==e&&e?e===f.CAP_SHIFT+"em"&&(a=r.pad.t):a=-r.pad.b,"auto"===r.y?n.t/2:"paper"===r.yref?n.t+n.h-n.h*r.y+a:t.height-t.height*r.y+a}(e,n),"text-anchor":r,dy:n}})},r.doTraceStyle=function(t){var e,n=t.calcdata,o=[];for(e=0;e<n.length;e++){var l=n[e],u=l[0]||{},c=u.trace||{},h=c._module||{},d=h.arraysToCalcdata;d&&d(l,c);var f=h.editStyle;f&&o.push({fn:f,cd0:u})}if(o.length){for(e=0;e<o.length;e++){var p=o[e];p.fn(t,p.cd0)}s(t),r.redrawReglTraces(t)}return i.style(t),a.getComponentMethod("legend","draw")(t),i.previousPromises(t)},r.doColorBars=function(t){return a.getComponentMethod("colorbar","draw")(t),i.previousPromises(t)},r.layoutReplot=function(t){var e=t.layout;return t.layout=void 0,a.call("plot",t,"",e)},r.doLegend=function(t){return a.getComponentMethod("legend","draw")(t),i.previousPromises(t)},r.doTicksRelayout=function(t){return d.draw(t,"redraw"),t._fullLayout._hasOnlyLargeSploms&&(a.subplotsRegistry.splom.updateGrid(t),s(t),r.redrawReglTraces(t)),r.drawMainTitle(t),i.previousPromises(t)},r.doModeBar=function(t){var e=t._fullLayout;h.manage(t);for(var r=0;r<e._basePlotModules.length;r++){var n=e._basePlotModules[r].updateFx;n&&n(t)}return i.previousPromises(t)},r.doCamera=function(t){for(var e=t._fullLayout,r=e._subplots.gl3d,n=0;n<r.length;n++){var a=e[r[n]],i=a._scene,o=a.camera;i.setCamera(o)}},r.drawData=function(t){var e=t._fullLayout;s(t);for(var n=e._basePlotModules,o=0;o<n.length;o++)n[o].plot(t);return r.redrawReglTraces(t),i.style(t),a.getComponentMethod("shapes","draw")(t),a.getComponentMethod("annotations","draw")(t),e._replotting=!1,i.previousPromises(t)},r.redrawReglTraces=function(t){var e=t._fullLayout;if(e._has("regl")){var r,n,a=t._fullData,i=[],s=[];for(e._hasOnlyLargeSploms&&e._splomGrid.draw(),r=0;r<a.length;r++){var l=a[r];!0===l.visible&&0!==l._length&&("splom"===l.type?e._splomScenes[l.uid].draw():"scattergl"===l.type?o.pushUnique(i,l.xaxis+l.yaxis):"scatterpolargl"===l.type&&o.pushUnique(s,l.subplot))}for(r=0;r<i.length;r++)(n=e._plots[i[r]])._scene&&n._scene.draw();for(r=0;r<s.length;r++)(n=e[s[r]]._subplot)._scene&&n._scene.draw()}},r.doAutoRangeAndConstraints=function(t){for(var e,r,n=t._fullLayout,a=d.list(t,"",!0),i=n._axisMatchGroups||[],s=0;s<a.length;s++)e=a[s],g(t,e),y(t,e);m(t);t:for(var l=0;l<i.length;l++){var u,c=i[l],h=null;for(u in c){if(!1===(e=d.getFromId(t,u)).autorange)continue t;r=o.simpleMap(e.range,e.r2l),h?h[0]<h[1]?(h[0]=Math.min(h[0],r[0]),h[1]=Math.max(h[1],r[1])):(h[0]=Math.max(h[0],r[0]),h[1]=Math.min(h[1],r[1])):h=r}for(u in c)(e=d.getFromId(t,u)).range=o.simpleMap(h,e.l2r),e._input.range=e.range.slice(),e.setScale()}},r.finalDraw=function(t){a.getComponentMethod("shapes","draw")(t),a.getComponentMethod("images","draw")(t),a.getComponentMethod("annotations","draw")(t),a.getComponentMethod("rangeslider","draw")(t),a.getComponentMethod("rangeselector","draw")(t)},r.drawMarginPushers=function(t){a.getComponentMethod("legend","draw")(t),a.getComponentMethod("rangeselector","draw")(t),a.getComponentMethod("sliders","draw")(t),a.getComponentMethod("updatemenus","draw")(t),a.getComponentMethod("colorbar","draw")(t)}},{"../components/color":593,"../components/drawing":614,"../components/modebar":652,"../components/titles":681,"../constants/alignment":688,"../lib":719,"../lib/clear_gl_canvases":704,"../plots/cartesian/autorange":766,"../plots/cartesian/axes":767,"../plots/cartesian/constraints":774,"../plots/plots":828,"../registry":847,d3:163}],759:[function(t,e,r){var n=t("../lib"),a=n.isPlainObject,i=t("./plot_schema"),o=t("../plots/plots"),s=t("../plots/attributes"),l=t("./plot_template"),u=t("./plot_config").dfltConfig;function c(t,e){t=n.extendDeep({},t);var r,i,o=Object.keys(t).sort();function s(e,r,n){if(a(r)&&a(e))c(e,r);else if(Array.isArray(r)&&Array.isArray(e)){var o=l.arrayTemplater({_template:t},n);for(i=0;i<r.length;i++){var s=r[i],u=o.newItem(s)._template;u&&c(u,s)}var h=o.defaultItems();for(i=0;i<h.length;i++)r.push(h[i]._template);for(i=0;i<r.length;i++)delete r[i].templateitemname}}for(r=0;r<o.length;r++){var u=o[r],d=t[u];if(u in e?s(d,e[u],u):e[u]=d,h(u)===u)for(var f in e){var p=h(f);f===p||p!==u||f in t||s(d,e[f],u)}}}function h(t){return t.replace(/[0-9]+$/,"")}function d(t,e,r,i,o){var s=o&&r(o);for(var u in t){var c=t[u],p=f(t,u,i),m=f(t,u,o),g=r(m);if(!g){var y=h(u);y!==u&&(g=r(m=f(t,y,o)))}if(!(s&&s===g||!g||g._noTemplating||"data_array"===g.valType||g.arrayOk&&Array.isArray(c)))if(!g.valType&&a(c))d(c,e,r,p,m);else if(g._isLinkedToArray&&Array.isArray(c))for(var v=!1,_=0,x={},b=0;b<c.length;b++){var w=c[b];if(a(w)){var M=w.name;if(M)x[M]||(d(w,e,r,f(c,_,p),f(c,_,m)),_++,x[M]=1);else if(!v){var k=f(t,l.arrayDefaultKey(u),i),T=f(c,_,p);d(w,e,r,T,f(c,_,m));var L=n.nestedProperty(e,T);n.nestedProperty(e,k).set(L.get()),L.set(null),v=!0}}}else n.nestedProperty(e,p).set(c)}}function f(t,e,r){return r?Array.isArray(t)?r+"["+e+"]":r+"."+e:e}function p(t){for(var e=0;e<t.length;e++)if(a(t[e]))return!0}function m(t){var e;switch(t.code){case"data":e="The template has no key data.";break;case"layout":e="The template has no key layout.";break;case"missing":e=t.path?"There are no templates for item "+t.path+" with name "+t.templateitemname:"There are no templates for trace "+t.index+", of type "+t.traceType+".";break;case"unused":e=t.path?"The template item at "+t.path+" was not used in constructing the plot.":t.dataCount?"Some of the templates of type "+t.traceType+" were not used. The template has "+t.templateCount+" traces, the data only has "+t.dataCount+" of this type.":"The template has "+t.templateCount+" traces of type "+t.traceType+" but there are none in the data.";break;case"reused":e="Some of the templates of type "+t.traceType+" were used more than once. The template has "+t.templateCount+" traces, the data has "+t.dataCount+" of this type."}return t.msg=e,t}r.makeTemplate=function(t){t=n.isPlainObject(t)?t:n.getGraphDiv(t),t=n.extendDeep({_context:u},{data:t.data,layout:t.layout}),o.supplyDefaults(t);var e=t.data||[],r=t.layout||{};r._basePlotModules=t._fullLayout._basePlotModules,r._modules=t._fullLayout._modules;var l={data:{},layout:{}};e.forEach((function(t){var e={};d(t,e,function(t,e){return i.getTraceValObject(t,n.nestedProperty({},e).parts)}.bind(null,t));var r=n.coerce(t,{},s,"type"),a=l.data[r];a||(a=l.data[r]=[]),a.push(e)})),d(r,l.layout,function(t,e){return i.getLayoutValObject(t,n.nestedProperty({},e).parts)}.bind(null,r)),delete l.layout.template;var h=r.template;if(a(h)){var f,p,m,g,y,v,_=h.layout;a(_)&&c(_,l.layout);var x=h.data;if(a(x)){for(p in l.data)if(m=x[p],Array.isArray(m)){for(v=(y=l.data[p]).length,g=m.length,f=0;f<v;f++)c(m[f%g],y[f]);for(f=v;f<g;f++)y.push(n.extendDeep({},m[f]))}for(p in x)p in l.data||(l.data[p]=n.extendDeep([],x[p]))}}return l},r.validateTemplate=function(t,e){var r=n.extendDeep({},{_context:u,data:t.data,layout:t.layout}),i=r.layout||{};a(e)||(e=i.template||{});var s=e.layout,l=e.data,c=[];r.layout=i,r.layout.template=e,o.supplyDefaults(r);var d=r._fullLayout,g=r._fullData,y={};if(a(s)?(function t(e,r){for(var n in e)if("_"!==n.charAt(0)&&a(e[n])){var i,o=h(n),s=[];for(i=0;i<r.length;i++)s.push(f(e,n,r[i])),o!==n&&s.push(f(e,o,r[i]));for(i=0;i<s.length;i++)y[s[i]]=1;t(e[n],s)}}(d,["layout"]),function t(e,r){for(var n in e)if(-1===n.indexOf("defaults")&&a(e[n])){var i=f(e,n,r);y[i]?t(e[n],i):c.push({code:"unused",path:i})}}(s,"layout")):c.push({code:"layout"}),a(l)){for(var v,_={},x=0;x<g.length;x++){var b=g[x];_[v=b.type]=(_[v]||0)+1,b._fullInput._template||c.push({code:"missing",index:b._fullInput.index,traceType:v})}for(v in l){var w=l[v].length,M=_[v]||0;w>M?c.push({code:"unused",traceType:v,templateCount:w,dataCount:M}):M>w&&c.push({code:"reused",traceType:v,templateCount:w,dataCount:M})}}else c.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var i=e[n],o=f(e,n,r);a(i)?(Array.isArray(e)&&!1===i._template&&i.templateitemname&&c.push({code:"missing",path:o,templateitemname:i.templateitemname}),t(i,o)):Array.isArray(i)&&p(i)&&t(i,o)}}({data:g,layout:d},""),c.length)return c.map(m)}},{"../lib":719,"../plots/attributes":764,"../plots/plots":828,"./plot_config":755,"./plot_schema":756,"./plot_template":757}],760:[function(t,e,r){var n=t("fast-isnumeric"),a=t("./plot_api"),i=t("../lib"),o=t("../snapshot/helpers"),s=t("../snapshot/tosvg"),l=t("../snapshot/svgtoimg"),u={format:{valType:"enumerated",values:["png","jpeg","webp","svg"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};e.exports=function(t,e){var r,c,h,d;function f(t){return!(t in e)||i.validate(e[t],u[t])}if(e=e||{},i.isPlainObject(t)?(r=t.data||[],c=t.layout||{},h=t.config||{},d={}):(t=i.getGraphDiv(t),r=i.extendDeep([],t.data),c=i.extendDeep({},t.layout),h=t._context,d=t._fullLayout||{}),!f("width")&&null!==e.width||!f("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!f("format"))throw new Error("Image format is not jpeg, png, svg or webp.");var p={};function m(t,r){return i.coerce(e,p,u,t,r)}var g=m("format"),y=m("width"),v=m("height"),_=m("scale"),x=m("setBackground"),b=m("imageDataOnly"),w=document.createElement("div");w.style.position="absolute",w.style.left="-5000px",document.body.appendChild(w);var M=i.extendFlat({},c);y?M.width=y:null===e.width&&n(d.width)&&(M.width=d.width),v?M.height=v:null===e.height&&n(d.height)&&(M.height=d.height);var k=i.extendFlat({},h,{_exportedPlot:!0,staticPlot:!0,setBackground:x}),T=o.getRedrawFunc(w);function L(){return new Promise((function(t){setTimeout(t,o.getDelay(w._fullLayout))}))}function A(){return new Promise((function(t,e){var r=s(w,g,_),n=w._fullLayout.width,u=w._fullLayout.height;if(a.purge(w),document.body.removeChild(w),"svg"===g)return t(b?r:o.encodeSVG(r));var c=document.createElement("canvas");c.id=i.randstr(),l({format:g,width:n,height:u,scale:_,canvas:c,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){a.plot(w,r,M,k).then(T).then(L).then(A).then((function(e){t(function(t){return b?t.replace(o.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}},{"../lib":719,"../snapshot/helpers":851,"../snapshot/svgtoimg":853,"../snapshot/tosvg":855,"./plot_api":754,"fast-isnumeric":225}],761:[function(t,e,r){var n=t("../lib"),a=t("../plots/plots"),i=t("./plot_schema"),o=t("./plot_config").dfltConfig,s=n.isPlainObject,l=Array.isArray,u=n.isArrayOrTypedArray;function c(t,e,r,a,i,o){o=o||[];for(var h=Object.keys(t),d=0;d<h.length;d++){var g=h[d];if("transforms"!==g){var y=o.slice();y.push(g);var v=t[g],_=e[g],x=m(r,g),b="info_array"===(x||{}).valType,w="colorscale"===(x||{}).valType,M=(x||{}).items;if(p(r,g))if(s(v)&&s(_))c(v,_,x,a,i,y);else if(b&&l(v)){v.length>_.length&&a.push(f("unused",i,y.concat(_.length)));var k,T,L,A,S,E=_.length,C=Array.isArray(M);if(C&&(E=Math.min(E,M.length)),2===x.dimensions)for(T=0;T<E;T++)if(l(v[T])){v[T].length>_[T].length&&a.push(f("unused",i,y.concat(T,_[T].length)));var D=_[T].length;for(k=0;k<(C?Math.min(D,M[T].length):D);k++)L=C?M[T][k]:M,A=v[T][k],S=_[T][k],n.validate(A,L)?S!==A&&S!==+A&&a.push(f("dynamic",i,y.concat(T,k),A,S)):a.push(f("value",i,y.concat(T,k),A))}else a.push(f("array",i,y.concat(T),v[T]));else for(T=0;T<E;T++)L=C?M[T]:M,A=v[T],S=_[T],n.validate(A,L)?S!==A&&S!==+A&&a.push(f("dynamic",i,y.concat(T),A,S)):a.push(f("value",i,y.concat(T),A))}else if(x.items&&!b&&l(v)){var P,O,z=M[Object.keys(M)[0]],I=[];for(P=0;P<_.length;P++){var R=_[P]._index||P;if((O=y.slice()).push(R),s(v[R])&&s(_[P])){I.push(R);var F=v[R],N=_[P];s(F)&&!1!==F.visible&&!1===N.visible?a.push(f("invisible",i,O)):c(F,N,z,a,i,O)}}for(P=0;P<v.length;P++)(O=y.slice()).push(P),s(v[P])?-1===I.indexOf(P)&&a.push(f("unused",i,O)):a.push(f("object",i,O,v[P]))}else!s(v)&&s(_)?a.push(f("object",i,y,v)):u(v)||!u(_)||b||w?g in e?n.validate(v,x)?"enumerated"===x.valType&&(x.coerceNumber&&v!==+_||v!==_)&&a.push(f("dynamic",i,y,v,_)):a.push(f("value",i,y,v)):a.push(f("unused",i,y,v)):a.push(f("array",i,y,v));else a.push(f("schema",i,y))}}return a}e.exports=function(t,e){var r,u,h=i.get(),d=[],p={_context:n.extendFlat({},o)};l(t)?(p.data=n.extendDeep([],t),r=t):(p.data=[],r=[],d.push(f("array","data"))),s(e)?(p.layout=n.extendDeep({},e),u=e):(p.layout={},u={},arguments.length>1&&d.push(f("object","layout"))),a.supplyDefaults(p);for(var m=p._fullData,g=r.length,y=0;y<g;y++){var v=r[y],_=["data",y];if(s(v)){var x=m[y],b=x.type,w=h.traces[b].attributes;w.type={valType:"enumerated",values:[b]},!1===x.visible&&!1!==v.visible&&d.push(f("invisible",_)),c(v,x,w,d,_);var M=v.transforms,k=x.transforms;if(M){l(M)||d.push(f("array",_,["transforms"])),_.push("transforms");for(var T=0;T<M.length;T++){var L=["transforms",T],A=M[T].type;if(s(M[T])){var S=h.transforms[A]?h.transforms[A].attributes:{};S.type={valType:"enumerated",values:Object.keys(h.transforms)},c(M[T],k[T],S,d,_,L)}else d.push(f("object",_,L))}}}else d.push(f("object",_))}return c(u,p._fullLayout,function(t,e){for(var r=t.layout.layoutAttributes,a=0;a<e.length;a++){var i=e[a],o=t.traces[i.type],s=o.layoutAttributes;s&&(i.subplot?n.extendFlat(r[o.attributes.subplot.dflt],s):n.extendFlat(r,s))}return r}(h,m),d,"layout"),0===d.length?void 0:d};var h={object:function(t,e){return("layout"===t&&""===e?"The layout argument":"data"===t[0]&&""===e?"Trace "+t[1]+" in the data argument":d(t)+"key "+e)+" must be linked to an object container"},array:function(t,e){return("data"===t?"The data argument":d(t)+"key "+e)+" must be linked to an array container"},schema:function(t,e){return d(t)+"key "+e+" is not part of the schema"},unused:function(t,e,r){var n=s(r)?"container":"key";return d(t)+n+" "+e+" did not get coerced"},dynamic:function(t,e,r,n){return[d(t)+"key",e,"(set to '"+r+"')","got reset to","'"+n+"'","during defaults."].join(" ")},invisible:function(t,e){return(e?d(t)+"item "+e:"Trace "+t[1])+" got defaulted to be not visible"},value:function(t,e,r){return[d(t)+"key "+e,"is set to an invalid value ("+r+")"].join(" ")}};function d(t){return l(t)?"In data trace "+t[1]+", ":"In "+t+", "}function f(t,e,r,a,i){var o,s;r=r||"",l(e)?(o=e[0],s=e[1]):(o=e,s=null);var u=function(t){if(!l(t))return String(t);for(var e="",r=0;r<t.length;r++){var n=t[r];"number"==typeof n?e=e.substr(0,e.length-1)+"["+n+"]":e+=n,r<t.length-1&&(e+=".")}return e}(r),c=h[t](e,u,a,i);return n.log(c),{code:t,container:o,trace:s,path:r,astr:u,msg:c}}function p(t,e){var r=y(e),n=r.keyMinusId,a=r.id;return!!(n in t&&t[n]._isSubplotObj&&a)||e in t}function m(t,e){return e in t?t[e]:t[y(e).keyMinusId]}var g=n.counterRegex("([a-z]+)");function y(t){var e=t.match(g);return{keyMinusId:e&&e[1],id:e&&e[2]}}},{"../lib":719,"../plots/plots":828,"./plot_config":755,"./plot_schema":756}],762:[function(t,e,r){e.exports={mode:{valType:"enumerated",dflt:"afterall",values:["immediate","next","afterall"]},direction:{valType:"enumerated",values:["forward","reverse"],dflt:"forward"},fromcurrent:{valType:"boolean",dflt:!1},frame:{duration:{valType:"number",min:0,dflt:500},redraw:{valType:"boolean",dflt:!0}},transition:{duration:{valType:"number",min:0,dflt:500,editType:"none"},easing:{valType:"enumerated",dflt:"cubic-in-out",values:["linear","quad","cubic","sin","exp","circle","elastic","back","bounce","linear-in","quad-in","cubic-in","sin-in","exp-in","circle-in","elastic-in","back-in","bounce-in","linear-out","quad-out","cubic-out","sin-out","exp-out","circle-out","elastic-out","back-out","bounce-out","linear-in-out","quad-in-out","cubic-in-out","sin-in-out","exp-in-out","circle-in-out","elastic-in-out","back-in-out","bounce-in-out"],editType:"none"},ordering:{valType:"enumerated",values:["layout first","traces first"],dflt:"layout first",editType:"none"}}}},{}],763:[function(t,e,r){var n=t("../lib"),a=t("../plot_api/plot_template");e.exports=function(t,e,r){var i,o,s=r.name,l=r.inclusionAttr||"visible",u=e[s],c=n.isArrayOrTypedArray(t[s])?t[s]:[],h=e[s]=[],d=a.arrayTemplater(e,s,l);for(i=0;i<c.length;i++){var f=c[i];n.isPlainObject(f)?o=d.newItem(f):(o=d.newItem({}))[l]=!1,o._index=i,!1!==o[l]&&r.handleItemDefaults(f,o,e,r),h.push(o)}var p=d.defaultItems();for(i=0;i<p.length;i++)(o=p[i])._index=h.length,r.handleItemDefaults({},o,e,r,{}),h.push(o);if(n.isArrayOrTypedArray(u)){var m=Math.min(u.length,h.length);for(i=0;i<m;i++)n.relinkPrivateKeys(h[i],u[i])}return h}},{"../lib":719,"../plot_api/plot_template":757}],764:[function(t,e,r){var n=t("../components/fx/attributes");e.exports={type:{valType:"enumerated",values:[],dflt:"scatter",editType:"calc+clearAxisTypes",_noTemplating:!0},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0,editType:"calc"},showlegend:{valType:"boolean",dflt:!0,editType:"style"},legendgroup:{valType:"string",dflt:"",editType:"style"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"style"},name:{valType:"string",editType:"style"},uid:{valType:"string",editType:"plot",anim:!0},ids:{valType:"data_array",editType:"calc",anim:!0},customdata:{valType:"data_array",editType:"calc"},meta:{valType:"any",arrayOk:!0,editType:"plot"},selectedpoints:{valType:"any",editType:"calc"},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none","skip"],arrayOk:!0,dflt:"all",editType:"none"},hoverlabel:n.hoverlabel,stream:{token:{valType:"string",noBlank:!0,strict:!0,editType:"calc"},maxpoints:{valType:"number",min:0,max:1e4,dflt:500,editType:"calc"},editType:"calc"},transforms:{_isLinkedToArray:"transform",editType:"calc"},uirevision:{valType:"any",editType:"none"}}},{"../components/fx/attributes":623}],765:[function(t,e,r){e.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],766:[function(t,e,r){var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../constants/numerical").FP_SAFE,o=t("../../registry");function s(t,e){var r,n,i=[],o=l(e),s=u(t,e),c=s.min,h=s.max;if(0===c.length||0===h.length)return a.simpleMap(e.range,e.r2l);var d=c[0].val,f=h[0].val;for(r=1;r<c.length&&d===f;r++)d=Math.min(d,c[r].val);for(r=1;r<h.length&&d===f;r++)f=Math.max(f,h[r].val);var p=!1;if(e.range){var m=a.simpleMap(e.range,e.r2l);p=m[1]<m[0]}"reversed"===e.autorange&&(p=!0,e.autorange=!0);var g,y,v,_,x,b,w=e.rangemode,M="tozero"===w,k="nonnegative"===w,T=e._length,L=T/10,A=0;for(r=0;r<c.length;r++)for(g=c[r],n=0;n<h.length;n++)(b=(y=h[n]).val-g.val)>0&&((x=T-o(g)-o(y))>L?b/x>A&&(v=g,_=y,A=b/x):b/T>A&&(v={val:g.val,pad:0},_={val:y.val,pad:0},A=b/T));if(d===f){var S=d-1,E=d+1;if(M)if(0===d)i=[0,1];else{var C=(d>0?h:c).reduce((function(t,e){return Math.max(t,o(e))}),0),D=d/(1-Math.min(.5,C/T));i=d>0?[0,D]:[D,0]}else i=k?[Math.max(0,S),Math.max(1,E)]:[S,E]}else M?(v.val>=0&&(v={val:0,pad:0}),_.val<=0&&(_={val:0,pad:0})):k&&(v.val-A*o(v)<0&&(v={val:0,pad:0}),_.val<=0&&(_={val:1,pad:0})),A=(_.val-v.val)/(T-o(v)-o(_)),i=[v.val-A*o(v),_.val+A*o(_)];return p&&i.reverse(),a.simpleMap(i,e.l2r||Number)}function l(t){var e=t._length/20;return"domain"===t.constrain&&t._inputDomain&&(e*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0])),function(t){return t.pad+(t.extrapad?e:0)}}function u(t,e){var r,n,a,i=e._id,o=t._fullData,s=t._fullLayout,l=[],u=[];function d(t,e){for(r=0;r<e.length;r++){var o=t[e[r]],s=(o._extremes||{})[i];if(!0===o.visible&&s){for(n=0;n<s.min.length;n++)a=s.min[n],c(l,a.val,a.pad,{extrapad:a.extrapad});for(n=0;n<s.max.length;n++)a=s.max[n],h(u,a.val,a.pad,{extrapad:a.extrapad})}}}return d(o,e._traceIndices),d(s.annotations||[],e._annIndices||[]),d(s.shapes||[],e._shapeIndices||[]),{min:l,max:u}}function c(t,e,r,n){d(t,e,r,n,p)}function h(t,e,r,n){d(t,e,r,n,m)}function d(t,e,r,n,a){for(var i=n.tozero,o=n.extrapad,s=!0,l=0;l<t.length&&s;l++){var u=t[l];if(a(u.val,e)&&u.pad>=r&&(u.extrapad||!o)){s=!1;break}a(e,u.val)&&u.pad<=r&&(o||!u.extrapad)&&(t.splice(l,1),l--)}if(s){var c=i&&0===e;t.push({val:e,pad:c?0:r,extrapad:!c&&o})}}function f(t){return n(t)&&Math.abs(t)<i}function p(t,e){return t<=e}function m(t,e){return t>=e}e.exports={getAutoRange:s,makePadFn:l,doAutoRange:function(t,e){if(e.setScale(),e.autorange){e.range=s(t,e),e._r=e.range.slice(),e._rl=a.simpleMap(e._r,e.r2l);var r=e._input,n={};n[e._attr+".range"]=e.range,n[e._attr+".autorange"]=e.autorange,o.call("_storeDirectGUIEdit",t.layout,t._fullLayout._preGUI,n),r.range=e.range.slice(),r.autorange=e.autorange}var i=e._anchorAxis;if(i&&i.rangeslider){var l=i.rangeslider[e._name];l&&"auto"===l.rangemode&&(l.range=s(t,e)),i._input.rangeslider[e._name]=a.extendFlat({},l)}},findExtremes:function(t,e,r){r||(r={}),t._m||t.setScale();var a,o,s,l,u,d,p,m,g,y=[],v=[],_=e.length,x=r.padded||!1,b=r.tozero&&("linear"===t.type||"-"===t.type),w="log"===t.type,M=!1;function k(t){if(Array.isArray(t))return M=!0,function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}var T=k((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),L=k((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),A=k(r.vpadplus||r.vpad),S=k(r.vpadminus||r.vpad);if(!M){if(m=1/0,g=-1/0,w)for(a=0;a<_;a++)(o=e[a])<m&&o>0&&(m=o),o>g&&o<i&&(g=o);else for(a=0;a<_;a++)(o=e[a])<m&&o>-i&&(m=o),o>g&&o<i&&(g=o);e=[m,g],_=2}var E={tozero:b,extrapad:x};function C(r){s=e[r],n(s)&&(d=T(r),p=L(r),m=s-S(r),g=s+A(r),w&&m<g/10&&(m=g/10),l=t.c2l(m),u=t.c2l(g),b&&(l=Math.min(0,l),u=Math.max(0,u)),f(l)&&c(y,l,p,E),f(u)&&h(v,u,d,E))}var D=Math.min(6,_);for(a=0;a<D;a++)C(a);for(a=_-1;a>=D;a--)C(a);return{min:y,max:v,opts:r}},concatExtremes:u}},{"../../constants/numerical":695,"../../lib":719,"../../registry":847,"fast-isnumeric":225}],767:[function(t,e,r){var n=t("d3"),a=t("fast-isnumeric"),i=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../../components/titles"),c=t("../../components/color"),h=t("../../components/drawing"),d=t("./layout_attributes"),f=t("./clean_ticks"),p=t("../../constants/numerical"),m=p.ONEAVGYEAR,g=p.ONEAVGMONTH,y=p.ONEDAY,v=p.ONEHOUR,_=p.ONEMIN,x=p.ONESEC,b=p.MINUS_SIGN,w=p.BADNUM,M=t("../../constants/alignment").MID_SHIFT,k=t("../../constants/alignment").LINE_SPACING,T=e.exports={};T.setConvert=t("./set_convert");var L=t("./axis_autotype"),A=t("./axis_ids");T.id2name=A.id2name,T.name2id=A.name2id,T.cleanId=A.cleanId,T.list=A.list,T.listIds=A.listIds,T.getFromId=A.getFromId,T.getFromTrace=A.getFromTrace;var S=t("./autorange");T.getAutoRange=S.getAutoRange,T.findExtremes=S.findExtremes,T.coerceRef=function(t,e,r,n,a,i){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],u=n+"ref",c={};return a||(a=l[0]||i),i||(i=a),c[u]={valType:"enumerated",values:l.concat(i?[i]:[]),dflt:a},s.coerce(t,e,c,u)},T.coercePosition=function(t,e,r,n,a,i){var o,l;if("paper"===n||"pixel"===n)o=s.ensureNumber,l=r(a,i);else{var u=T.getFromId(e,n);l=r(a,i=u.fraction2r(i)),o=u.cleanPos}t[a]=o(l)},T.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:T.getFromId(e,r).cleanPos)(t)},T.redrawComponents=function(t,e){e=e||T.listIds(t);var r=t._fullLayout;function n(n,a,i,s){for(var l=o.getComponentMethod(n,a),u={},c=0;c<e.length;c++)for(var h=r[T.id2name(e[c])][i],d=0;d<h.length;d++){var f=h[d];if(!u[f]&&(l(t,f),u[f]=1,s))return}}n("annotations","drawOne","_annIndices"),n("shapes","drawOne","_shapeIndices"),n("images","draw","_imgIndices",!0)};var E=T.getDataConversions=function(t,e,r,n){var a,i="x"===r||"y"===r||"z"===r?r:n;if(Array.isArray(i)){if(a={type:L(n),_categories:[]},T.setConvert(a),"category"===a.type)for(var o=0;o<n.length;o++)a.d2c(n[o])}else a=T.getFromTrace(t,e,i);return a?{d2c:a.d2c,c2d:a.c2d}:"ids"===i?{d2c:D,c2d:D}:{d2c:C,c2d:C}};function C(t){return+t}function D(t){return String(t)}T.getDataToCoordFunc=function(t,e,r,n){return E(t,e,r,n).d2c},T.counterLetter=function(t){var e=t.charAt(0);return"x"===e?"y":"y"===e?"x":void 0},T.minDtick=function(t,e,r,n){-1===["log","category","multicategory"].indexOf(t.type)&&n?void 0===t._minDtick?(t._minDtick=e,t._forceTick0=r):t._minDtick&&((t._minDtick/e+1e-6)%1<2e-6&&((r-t._forceTick0)/e%1+1.000001)%1<2e-6?(t._minDtick=e,t._forceTick0=r):((e/t._minDtick+1e-6)%1>2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},T.saveRangeInitial=function(t,e){for(var r=T.list(t,"",!0),n=!1,a=0;a<r.length;a++){var i=r[a],o=void 0===i._rangeInitial,s=o||!(i.range[0]===i._rangeInitial[0]&&i.range[1]===i._rangeInitial[1]);(o&&!1===i.autorange||e&&s)&&(i._rangeInitial=i.range.slice(),n=!0)}return n},T.saveShowSpikeInitial=function(t,e){for(var r=T.list(t,"",!0),n=!1,a="on",i=0;i<r.length;i++){var o=r[i],s=void 0===o._showSpikeInitial,l=s||!(o.showspikes===o._showspikes);(s||e&&l)&&(o._showSpikeInitial=o.showspikes,n=!0),"on"!==a||o.showspikes||(a="off")}return t._fullLayout._cartesianSpikesEnabled=a,n},T.autoBin=function(t,e,r,n,i,o){var l,u=s.aggNums(Math.min,null,t),c=s.aggNums(Math.max,null,t);if("category"===e.type||"multicategory"===e.type)return{start:u-.5,end:c+.5,size:Math.max(1,Math.round(o)||1),_dataSpan:c-u};if(i||(i=e.calendar),l="log"===e.type?{type:"linear",range:[u,c]}:{type:e.type,range:s.simpleMap([u,c],e.c2r,0,i),calendar:i},T.setConvert(l),o=o&&f.dtick(o,l.type))l.dtick=o,l.tick0=f.tick0(void 0,l.type,i);else{var h;if(r)h=(c-u)/r;else{var d=s.distinctVals(t),p=Math.pow(10,Math.floor(Math.log(d.minDiff)/Math.LN10)),m=p*s.roundUp(d.minDiff/p,[.9,1.9,4.9,9.9],!0);h=Math.max(m,2*s.stdev(t)/Math.pow(t.length,n?.25:.4)),a(h)||(h=1)}T.autoTicks(l,h)}var g,v=l.dtick,_=T.tickIncrement(T.tickFirst(l),v,"reverse",i);if("number"==typeof v)g=(_=function(t,e,r,n,i){var o=0,s=0,l=0,u=0;function c(e){return(1+100*(e-t)/r.dtick)%100<2}for(var h=0;h<e.length;h++)e[h]%1==0?l++:a(e[h])||u++,c(e[h])&&o++,c(e[h]+r.dtick/2)&&s++;var d=e.length-u;if(l===d&&"date"!==r.type)r.dtick<1?t=n-.5*r.dtick:(t-=.5)+r.dtick<n&&(t+=r.dtick);else if(s<.1*d&&(o>.3*d||c(n)||c(i))){var f=r.dtick/2;t+=t+f<n?f:-f}return t}(_,t,l,u,c))+(1+Math.floor((c-_)/v))*v;else for("M"===l.dtick.charAt(0)&&(_=function(t,e,r,n,a){var i=s.findExactDates(e,a);if(i.exactDays>.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?t=T.tickIncrement(t,"M6","reverse")+1.5*y:i.exactMonths>.8?t=T.tickIncrement(t,"M1","reverse")+15.5*y:t-=y/2;var l=T.tickIncrement(t,r);if(l<=n)return l}return t}(_,t,v,u,i)),g=_;g<=c;)g=T.tickIncrement(g,v,!1,i);return{start:e.c2r(_,0,i),end:e.c2r(g,0,i),size:v,_dataSpan:c-u}},T.prepTicks=function(t){var e=s.simpleMap(t.range,t.r2l);if("auto"===t.tickmode||!t.dtick){var r,n=t.nticks;n||("category"===t.type||"multicategory"===t.type?(r=t.tickfont?1.2*(t.tickfont.size||12):15,n=t._length/r):(r="y"===t._id.charAt(0)?40:80,n=s.constrain(t._length/r,4,9)+1),"radialaxis"===t._name&&(n*=2)),"array"===t.tickmode&&(n*=100),T.autoTicks(t,Math.abs(e[1]-e[0])/n),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),"date"===t.type&&t.dtick<.1&&(t.dtick=.1),j(t)},T.calcTicks=function(t){T.prepTicks(t);var e=s.simpleMap(t.range,t.r2l);if("array"===t.tickmode)return function(t){var e=t.tickvals,r=t.ticktext,n=new Array(e.length),a=s.simpleMap(t.range,t.r2l),i=1.0001*a[0]-1e-4*a[1],o=1.0001*a[1]-1e-4*a[0],l=Math.min(i,o),u=Math.max(i,o),c=0;Array.isArray(r)||(r=[]);var h="category"===t.type?t.d2l_noadd:t.d2l;"log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1));for(var d=0;d<e.length;d++){var f=h(e[d]);f>l&&f<u&&(void 0===r[d]?n[c]=T.tickText(t,f):n[c]=B(t,f,String(r[d])),c++)}return c<e.length&&n.splice(c,e.length-c),n}(t);t._tmin=T.tickFirst(t);var r=1.0001*e[0]-1e-4*e[1],n=1.0001*e[1]-1e-4*e[0],i=e[1]<e[0];if(t._tmin<r!==i)return[];var o=[];"category"!==t.type&&"multicategory"!==t.type||(n=i?Math.max(-.5,n):Math.min(t._categories.length-.5,n));for(var l="log"===t.type&&!(a(t.dtick)||"L"===t.dtick.charAt(0)),u=null,c=Math.max(1e3,t._length||0),h=t._tmin;(i?h>=n:h<=n)&&!(o.length>c||h===u);h=T.tickIncrement(h,t.dtick,i,t.calendar)){u=h;var d=!1;l&&h!==(0|h)&&(d=!0),o.push({minor:d,value:h})}rt(t)&&360===Math.abs(e[1]-e[0])&&o.pop(),t._tmax=(o[o.length-1]||{}).value,t._prevDateHead="",t._inCalcTicks=!0;for(var f=new Array(o.length),p=0;p<o.length;p++)f[p]=T.tickText(t,o[p].value,!1,o[p].minor);return t._inCalcTicks=!1,f};var P=[2,5,10],O=[1,2,3,6,12],z=[1,2,5,10,15,30],I=[1,2,3,7,14],R=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],F=[-.301,0,.301,.699,1],N=[15,30,45,90,180];function Y(t,e,r){return e*s.roundUp(t/e,r)}function j(t){var e=t.dtick;if(t._tickexponent=0,a(e)||"string"==typeof e||(e=1),"category"!==t.type&&"multicategory"!==t.type||(t._tickround=null),"date"===t.type){var r=t.r2l(t.tick0),n=t.l2r(r).replace(/(^-|i)/g,""),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>=y&&i<=10||e>=15*y)t._tickround="d";else if(e>=_&&i<=16||e>=v)t._tickround="M";else if(e>=x&&i<=19||e>=_)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(i,o)-20,t._tickround<0&&(t._tickround=4)}}else if(a(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);a(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),u=Math.floor(Math.log(l)/Math.LN10+.01);Math.abs(u)>3&&(U(t.exponentformat)&&!V(u)?t._tickexponent=3*Math.round((u-1)/3):t._tickexponent=u)}else t._tickround=null}function B(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}}T.autoTicks=function(t,e){var r;function n(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar);var i=2*e;i>m?(e/=m,r=n(10),t.dtick="M"+12*Y(e,r,P)):i>g?(e/=g,t.dtick="M"+Y(e,1,O)):i>y?(t.dtick=Y(e,y,I),t.tick0=s.dateTick0(t.calendar,!0)):i>v?t.dtick=Y(e,v,O):i>_?t.dtick=Y(e,_,z):i>x?t.dtick=Y(e,x,z):(r=n(10),t.dtick=Y(e,r,P))}else if("log"===t.type){t.tick0=0;var o=s.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(o[1]-o[0])<1){var l=1.5*Math.abs((o[1]-o[0])/e);e=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/l,r=n(10),t.dtick="L"+Y(e,r,P)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):rt(t)?(t.tick0=0,r=1,t.dtick=Y(e,r,N)):(t.tick0=0,r=n(10),t.dtick=Y(e,r,P));if(0===t.dtick&&(t.dtick=1),!a(t.dtick)&&"string"!=typeof t.dtick){var u=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(u)}},T.tickIncrement=function(t,e,r,i){var o=r?-1:1;if(a(e))return t+o*e;var l=e.charAt(0),u=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,u,i);if("L"===l)return Math.log(Math.pow(10,t)+u)/Math.LN10;if("D"===l){var c="D2"===e?F:R,h=t+.01*o,d=s.roundUp(s.mod(h,1),c,r);return Math.floor(h)+Math.log(n.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(e)},T.tickFirst=function(t){var e=t.r2l||Number,r=s.simpleMap(t.range,e),i=r[1]<r[0],o=i?Math.floor:Math.ceil,l=1.0001*r[0]-1e-4*r[1],u=t.dtick,c=e(t.tick0);if(a(u)){var h=o((l-c)/u)*u+c;return"category"!==t.type&&"multicategory"!==t.type||(h=s.constrain(h,0,t._categories.length-1)),h}var d=u.charAt(0),f=Number(u.substr(1));if("M"===d){for(var p,m,g,y=0,v=c;y<10;){if(((p=T.tickIncrement(v,u,i,t.calendar))-l)*(v-l)<=0)return i?Math.min(v,p):Math.max(v,p);m=(l-(v+p)/2)/(p-v),g=d+(Math.abs(Math.round(m))||1)*f,v=T.tickIncrement(v,g,m<0?!i:i,t.calendar),y++}return s.error("tickFirst did not converge",t),v}if("L"===d)return Math.log(o((Math.pow(10,l)-c)/f)*f+c)/Math.LN10;if("D"===d){var _="D2"===u?F:R,x=s.roundUp(s.mod(l,1),_,i);return Math.floor(l)+Math.log(n.round(Math.pow(10,x),1))/Math.LN10}throw"unrecognized dtick "+String(u)},T.tickText=function(t,e,r,n){var i,o=B(t,e),l="array"===t.tickmode,u=r||l,c=t.type,h="category"===c?t.d2l_noadd:t.d2l;if(l&&Array.isArray(t.ticktext)){var d=s.simpleMap(t.range,t.r2l),f=Math.abs(d[1]-d[0])/1e4;for(i=0;i<t.ticktext.length&&!(Math.abs(e-h(t.tickvals[i]))<f);i++);if(i<t.ticktext.length)return o.text=String(t.ticktext[i]),o}function p(n){if(void 0===n)return!0;if(r)return"none"===n;var a={first:t._tmin,last:t._tmax}[n];return"all"!==n&&e!==a}var m=r?"never":"none"!==t.exponentformat&&p(t.showexponent)?"hide":"";if("date"===c?function(t,e,r,n){var i=t._tickround,o=r&&t.hoverformat||T.getTickFormat(t);n&&(i=a(i)?4:{y:"m",m:"d",d:"M",M:"S",S:4}[i]);var l,u=s.formatDate(e.x,o,i,t._dateFormat,t.calendar,t._extraFormat),c=u.indexOf("\n");-1!==c&&(l=u.substr(c+1),u=u.substr(0,c)),n&&("00:00:00"===u||"00:00"===u?(u=l,l=""):8===u.length&&(u=u.replace(/:00$/,""))),l&&(r?"d"===i?u+=", "+l:u=l+(u?", "+u:""):t._inCalcTicks&&l===t._prevDateHead||(u+="<br>"+l,t._prevDateHead=l)),e.text=u}(t,o,r,u):"log"===c?function(t,e,r,n,i){var o=t.dtick,l=e.x,u=t.tickformat,c="string"==typeof o&&o.charAt(0);if("never"===i&&(i=""),n&&"L"!==c&&(o="L3",c="L"),u||"L"===c)e.text=W(Math.pow(10,l),t,i,n);else if(a(o)||"D"===c&&s.mod(l+.01,1)<.1){var h=Math.round(l),d=Math.abs(h),f=t.exponentformat;"power"===f||U(f)&&V(h)?(e.text=0===h?1:1===h?"10":"10<sup>"+(h>1?"":b)+d+"</sup>",e.fontSize*=1.25):("e"===f||"E"===f)&&d>2?e.text="1"+f+(h>0?"+":b)+d:(e.text=W(Math.pow(10,l),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==c)throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var p=String(e.text).charAt(0);"0"!==p&&"1"!==p||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(l<0?.5:.25)))}}(t,o,0,u,m):"category"===c?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}(t,o):"multicategory"===c?function(t,e,r){var n=Math.round(e.x),a=t._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?e.text=o+" - "+i:(e.text=i,e.text2=o)}(t,o,r):rt(t)?function(t,e,r,n,a){if("radians"!==t.thetaunit||r)e.text=W(e.x,t,a,n);else{var i=e.x/180;if(0===i)e.text="0";else{var o=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var r=function(t){for(var r=1;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),n=t*r,a=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)e.text=W(s.deg2rad(e.x),t,a,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="π":e.text=o[0]+"π":e.text=["<sup>",o[0],"</sup>","","<sub>",o[1],"</sub>","π"].join(""),l&&(e.text=b+e.text)}}}}(t,o,r,u,m):function(t,e,r,n,a){"never"===a?a="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(a="hide"),e.text=W(e.x,t,a,n)}(t,o,0,u,m),n||(t.tickprefix&&!p(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!p(t.showticksuffix)&&(o.text+=t.ticksuffix)),"boundaries"===t.tickson||t.showdividers){var g=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};o.xbnd=[g(o.x-.5),g(o.x+t.dtick-.5)]}return o},T.hoverLabelText=function(t,e,r){if(r!==w&&r!==e)return T.hoverLabelText(t,e)+" - "+T.hoverLabelText(t,r);var n="log"===t.type&&e<=0,a=T.tickText(t,t.c2l(n?-e:e),"hover").text;return n?0===e?"0":b+a:a};var H=["f","p","n","μ","m","","k","M","G","T"];function U(t){return"SI"===t||"B"===t}function V(t){return t>14||t<-15}function W(t,e,r,n){var i=t<0,o=e._tickround,l=r||e.exponentformat||"B",u=e._tickexponent,c=T.getTickFormat(e),h=e.separatethousands;if(n){var d={exponentformat:l,dtick:"none"===e.showexponent?e.dtick:a(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};j(d),o=(Number(d._tickround)||0)+4,u=d._tickexponent,e.hoverformat&&(c=e.hoverformat)}if(c)return e._numFormat(c)(t).replace(/-/g,b);var f,p=Math.pow(10,-o)/2;if("none"===l&&(u=0),(t=Math.abs(t))<p)t="0",i=!1;else{if(t+=p,u&&(t*=Math.pow(10,-u),o+=u),0===o)t=String(Math.floor(t));else if(o<0){t=(t=String(Math.round(t))).substr(0,t.length+o);for(var m=o;m<0;m++)t+="0"}else{var g=(t=String(t)).indexOf(".")+1;g&&(t=t.substr(0,g+o).replace(/\.?0+$/,""))}t=s.numSeparate(t,e._separators,h)}return u&&"hide"!==l&&(U(l)&&V(u)&&(l="power"),f=u<0?b+-u:"power"!==l?"+"+u:String(u),"e"===l||"E"===l?t+=l+f:"power"===l?t+="×10<sup>"+f+"</sup>":"B"===l&&9===u?t+="B":U(l)&&(t+=H[u/3+5])),i?b+t:t}function G(t,e){var r=t._id.charAt(0),n=t._tickAngles[e]||0,a=s.deg2rad(n),i=Math.sin(a),o=Math.cos(a),l=0,u=0;return t._selections[e].each((function(){var t=J(this),e=h.bBox(t.node()),r=e.width,n=e.height;l=Math.max(l,o*r,i*n),u=Math.max(u,i*r,o*n)})),{x:u,y:l}[r]}function q(t){return[t.text,t.x,t.axInfo,t.font,t.fontSize,t.fontColor].join("_")}function Z(t,e){var r,n=t._fullLayout._size,a=e._id.charAt(0),i=e.side;return"free"!==e.anchor?r=A.getFromId(t,e.anchor):"x"===a?r={_offset:n.t+(1-(e.position||0))*n.h,_length:0}:"y"===a&&(r={_offset:n.l+(e.position||0)*n.w,_length:0}),"top"===i||"left"===i?r._offset:"bottom"===i||"right"===i?r._offset+r._length:void 0}function X(t,e){var r=t.l2p(e);return r>1&&r<t._length-1}function J(t){var e=n.select(t),r=e.select(".text-math-group");return r.empty()?e.select("text"):r}function K(t){return t._id+".automargin"}function $(t){return t._id+".rangeslider"}function Q(t,e){for(var r=0;r<e.length;r++)-1===t.indexOf(e[r])&&t.push(e[r])}function tt(t,e,r){var n,a,i=[],o=[],l=t.layout;for(n=0;n<e.length;n++)i.push(T.getFromId(t,e[n]));for(n=0;n<r.length;n++)o.push(T.getFromId(t,r[n]));var u=Object.keys(d),c=["anchor","domain","overlaying","position","side","tickangle","editType"],h=["linear","log"];for(n=0;n<u.length;n++){var f=u[n],p=i[0][f],m=o[0][f],g=!0,y=!1,v=!1;if("_"!==f.charAt(0)&&"function"!=typeof p&&-1===c.indexOf(f)){for(a=1;a<i.length&&g;a++){var _=i[a][f];"type"===f&&-1!==h.indexOf(p)&&-1!==h.indexOf(_)&&p!==_?y=!0:_!==p&&(g=!1)}for(a=1;a<o.length&&g;a++){var x=o[a][f];"type"===f&&-1!==h.indexOf(m)&&-1!==h.indexOf(x)&&m!==x?v=!0:o[a][f]!==m&&(g=!1)}g&&(y&&(l[i[0]._name].type="linear"),v&&(l[o[0]._name].type="linear"),et(l,f,i,o,t._fullLayout._dfltTitle))}}for(n=0;n<t._fullLayout.annotations.length;n++){var b=t._fullLayout.annotations[n];-1!==e.indexOf(b.xref)&&-1!==r.indexOf(b.yref)&&s.swapAttrs(l.annotations[n],["?"])}}function et(t,e,r,n,a){var i,o=s.nestedProperty,l=o(t[r[0]._name],e).get(),u=o(t[n[0]._name],e).get();for("title"===e&&(l&&l.text===a.x&&(l.text=a.y),u&&u.text===a.y&&(u.text=a.x)),i=0;i<r.length;i++)o(t,r[i]._name+"."+e).set(u);for(i=0;i<n.length;i++)o(t,n[i]._name+"."+e).set(l)}function rt(t){return"angularaxis"===t._id}T.getTickFormat=function(t){var e,r,n,a,i,o,s,l;function u(t){return"string"!=typeof t?t:Number(t.replace("M",""))*g}function c(t,e){var r=["L","D"];if(typeof t==typeof e){if("number"==typeof t)return t-e;var n=r.indexOf(t.charAt(0)),a=r.indexOf(e.charAt(0));return n===a?Number(t.replace(/(L|D)/g,""))-Number(e.replace(/(L|D)/g,"")):n-a}return"number"==typeof t?1:-1}function h(t,e){var r=null===e[0],n=null===e[1],a=c(t,e[0])>=0,i=c(t,e[1])<=0;return(r||a)&&(n||i)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e<t.tickformatstops.length;e++)if((n=t.tickformatstops[e]).enabled&&(a=t.dtick,o=void 0,o=u||function(t){return t},s=(i=n.dtickrange)[0],l=i[1],(!s&&"number"!=typeof s||o(s)<=o(a))&&(!l&&"number"!=typeof l||o(l)>=o(a)))){r=n;break}break;case"log":for(e=0;e<t.tickformatstops.length;e++)if((n=t.tickformatstops[e]).enabled&&h(t.dtick,n.dtickrange)){r=n;break}}return r?r.value:t.tickformat},T.getSubplots=function(t,e){var r=t._fullLayout._subplots,n=r.cartesian.concat(r.gl2d||[]),a=e?T.findSubplotsWithAxis(n,e):n;return a.sort((function(t,e){var r=t.substr(1).split("y"),n=e.substr(1).split("y");return r[0]===n[0]?+r[1]-+n[1]:+r[0]-+n[0]})),a},T.findSubplotsWithAxis=function(t,e){for(var r=new RegExp("x"===e._id.charAt(0)?"^"+e._id+"y":e._id+"$"),n=[],a=0;a<t.length;a++){var i=t[a];r.test(i)&&n.push(i)}return n},T.makeClipPaths=function(t){var e=t._fullLayout;if(!e._hasOnlyLargeSploms){var r,a,i={_offset:0,_length:e.width,_id:""},o={_offset:0,_length:e.height,_id:""},s=T.list(t,"x",!0),l=T.list(t,"y",!0),u=[];for(r=0;r<s.length;r++)for(u.push({x:s[r],y:o}),a=0;a<l.length;a++)0===r&&u.push({x:i,y:l[a]}),u.push({x:s[r],y:l[a]});var c=e._clips.selectAll(".axesclip").data(u,(function(t){return t.x._id+t.y._id}));c.enter().append("clipPath").classed("axesclip",!0).attr("id",(function(t){return"clip"+e._uid+t.x._id+t.y._id})).append("rect"),c.exit().remove(),c.each((function(t){n.select(this).select("rect").attr({x:t.x._offset||0,y:t.y._offset||0,width:t.x._length||1,height:t.y._length||1})}))}},T.draw=function(t,e,r){var n=t._fullLayout;"redraw"===e&&n._paper.selectAll("g.subplot").each((function(t){var e=t[0],r=n._plots[e],a=r.xaxis,i=r.yaxis;r.xaxislayer.selectAll("."+a._id+"tick").remove(),r.yaxislayer.selectAll("."+i._id+"tick").remove(),r.xaxislayer.selectAll("."+a._id+"tick2").remove(),r.yaxislayer.selectAll("."+i._id+"tick2").remove(),r.xaxislayer.selectAll("."+a._id+"divider").remove(),r.yaxislayer.selectAll("."+i._id+"divider").remove(),r.gridlayer&&r.gridlayer.selectAll("path").remove(),r.zerolinelayer&&r.zerolinelayer.selectAll("path").remove(),n._infolayer.select(".g-"+a._id+"title").remove(),n._infolayer.select(".g-"+i._id+"title").remove()}));var a=e&&"redraw"!==e?e:T.listIds(t);return s.syncOrAsync(a.map((function(e){return function(){if(e){var n=T.getFromId(t,e),a=T.drawOne(t,n,r);return n._r=n.range.slice(),n._rl=s.simpleMap(n._r,n.r2l),a}}})))},T.drawOne=function(t,e,r){var n,a,l;r=r||{},e.setScale();var d=t._fullLayout,f=e._id,p=f.charAt(0),m=T.counterLetter(f),g=e._mainSubplot,y=e._mainLinePosition,v=e._mainMirrorPosition,_=d._plots[g][p+"axislayer"],x=e._subplotsWith,b=e._vals=T.calcTicks(e),w=[e.mirror,y,v].join("_");for(n=0;n<b.length;n++)b[n].axInfo=w;if(e.visible){e._selections={},e._tickAngles={};var M,L,A=T.makeTransFn(e);if("boundaries"===e.tickson){var S=function(t,e){var r,n=[],a=function(t,e){var r=t.xbnd[e];null!==r&&n.push(s.extendFlat({},t,{x:r}))};if(e.length){for(r=0;r<e.length;r++)a(e[r],0);a(e[r-1],1)}return n}(0,b);L=T.clipEnds(e,S),M="inside"===e.ticks?L:S}else L=T.clipEnds(e,b),M="inside"===e.ticks?L:b;var E=e._gridVals=L,C=function(t,e){var r,n,a=[],i=function(t,e){var r=t.xbnd[e];null!==r&&a.push(s.extendFlat({},t,{x:r}))};if(t.showdividers&&e.length){for(r=0;r<e.length;r++){var o=e[r];o.text2!==n&&i(o,0),n=o.text2}i(e[r-1],1)}return a}(e,b);if(!d._hasOnlyLargeSploms){var D={};for(n=0;n<x.length;n++){a=x[n];var P=(l=d._plots[a])[m+"axis"],O=P._mainAxis._id;if(!D[O]){D[O]=1;var z="x"===p?"M0,"+P._offset+"v"+P._length:"M"+P._offset+",0h"+P._length;T.drawGrid(t,e,{vals:E,counterAxis:P,layer:l.gridlayer.select("."+f),path:z,transFn:A}),T.drawZeroLine(t,e,{counterAxis:P,layer:l.zerolinelayer,path:z,transFn:A})}}}var I=T.getTickSigns(e),R=[];if(e.ticks){var F,N,Y,j=T.makeTickPath(e,y,I[2]);if(e._anchorAxis&&e.mirror&&!0!==e.mirror?(F=T.makeTickPath(e,v,I[3]),N=j+F):(F="",N=j),e.showdividers&&"outside"===e.ticks&&"boundaries"===e.tickson){var H={};for(n=0;n<C.length;n++)H[C[n].x]=1;Y=function(t){return H[t.x]?F:N}}else Y=N;T.drawTicks(t,e,{vals:M,layer:_,path:Y,transFn:A}),R=Object.keys(e._linepositions||{})}for(n=0;n<R.length;n++){a=R[n],l=d._plots[a];var U=e._linepositions[a]||[],V=T.makeTickPath(e,U[0],I[0])+T.makeTickPath(e,U[1],I[1]);T.drawTicks(t,e,{vals:M,layer:l[p+"axislayer"],path:V,transFn:A})}var W=[];if(W.push((function(){return T.drawLabels(t,e,{vals:b,layer:_,transFn:A,labelFns:T.makeLabelFns(e,y)})})),"multicategory"===e.type){var X=0,J={x:2,y:10}[p],Q=I[2]*("inside"===e.ticks?-1:1);W.push((function(){return X+=G(e,f+"tick")+J,X+=e._tickAngles[f+"tick"]?e.tickfont.size*k:0,T.drawLabels(t,e,{vals:function(t,e){for(var r=[],n={},a=0;a<e.length;a++){var i=e[a];n[i.text2]?n[i.text2].push(i.x):n[i.text2]=[i.x]}for(var o in n)r.push(B(t,s.interp(n[o],.5),o));return r}(e,b),layer:_,cls:f+"tick2",repositionOnUpdate:!0,secondary:!0,transFn:A,labelFns:T.makeLabelFns(e,y+X*Q)})})),W.push((function(){return X+=G(e,f+"tick2"),e._labelLength=X,function(t,e,r){var n=e._id+"divider",a=r.vals,i=r.layer.selectAll("path."+n).data(a,q);i.exit().remove(),i.enter().insert("path",":first-child").classed(n,1).classed("crisp",1).call(c.stroke,e.dividercolor).style("stroke-width",h.crispRound(t,e.dividerwidth,1)+"px"),i.attr("transform",r.transFn).attr("d",r.path)}(t,e,{vals:C,layer:_,path:T.makeTickPath(e,y,Q,X),transFn:A})}))}var tt=o.getComponentMethod("rangeslider","isVisible")(e);return W.push((function(){if(e.showticklabels){var r=t.getBoundingClientRect(),n=_.node().getBoundingClientRect();e._boundingBox={width:n.width,height:n.height,left:n.left-r.left,right:n.right-r.left,top:n.top-r.top,bottom:n.bottom-r.top}}else{var a,i=d._size;"x"===p?(a="free"===e.anchor?i.t+i.h*(1-e.position):i.t+i.h*(1-e._anchorAxis.domain[{bottom:0,top:1}[e.side]]),e._boundingBox={top:a,bottom:a,left:e._offset,right:e._offset+e._length,width:e._length,height:0}):(a="free"===e.anchor?i.l+i.w*e.position:i.l+i.w*e._anchorAxis.domain[{left:0,right:1}[e.side]],e._boundingBox={left:a,right:a,bottom:e._offset+e._length,top:e._offset,height:e._length,width:0})}if(x){for(var o=e._counterSpan=[1/0,-1/0],s=0;s<x.length;s++){var l=d._plots[x[s]]["x"===p?"yaxis":"xaxis"];et(o,[l._offset,l._offset+l._length])}"free"===e.anchor&&et(o,"x"===p?[e._boundingBox.bottom,e._boundingBox.top]:[e._boundingBox.right,e._boundingBox.left])}}),(function(){var r,n,a=e.side.charAt(0);if(tt&&(n=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),i.autoMargin(t,$(e),n),e.automargin&&(!tt||"b"!==a)){r={x:0,y:0,r:0,l:0,t:0,b:0};var s,l,u=e._boundingBox,c=Z(t,e);switch(p+a){case"xb":s=0,l=u.top-c,r[a]=u.height;break;case"xt":s=1,l=c-u.bottom,r[a]=u.height;break;case"yl":s=0,l=c-u.right,r[a]=u.width;break;case"yr":s=1,l=u.left-c,r[a]=u.width}if(r[m]="free"===e.anchor?e.position:e._anchorAxis.domain[s],r[a]>0&&(r[a]+=l),e.title.text!==d._dfltTitle[p]&&(r[a]+=e.title.font.size),"x"===p&&u.width>0){var h=u.right-(e._offset+e._length);h>0&&(r.x=1,r.r=h);var f=e._offset-u.left;f>0&&(r.x=0,r.l=f)}else if("y"===p&&u.height>0){var g=u.bottom-(e._offset+e._length);g>0&&(r.y=0,r.b=g);var y=e._offset-u.top;y>0&&(r.y=1,r.t=y)}}i.autoMargin(t,K(e),r)})),r.skipTitle||tt&&e._boundingBox&&"bottom"===e.side||W.push((function(){return function(t,e){var r,n=t._fullLayout,a=e._id,i=a.charAt(0),o=e.title.font.size;r="multicategory"===e.type?e._labelLength:10+1.5*o+(e.linewidth?e.linewidth-1:0);var s,l,c,d,f=Z(t,e);if("x"===i?(l=e._offset+e._length/2,c="top"===e.side?-r-o*(e.showticklabels?1:0):r+o*(e.showticklabels?1.5:.5),c+=f):(c=e._offset+e._length/2,l="right"===e.side?r+o*(e.showticklabels?1:.5):-r-o*(e.showticklabels?.5:0),l+=f,s={rotate:"-90",offset:0}),"multicategory"!==e.type){var p=e._selections[e._id+"tick"];if(d={selection:p,side:e.side},p&&p.node()&&p.node().parentNode){var m=h.getTranslate(p.node().parentNode);d.offsetLeft=m.x,d.offsetTop=m.y}}return u.draw(t,a+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[i],avoid:d,transform:s,attributes:{x:l,y:c,"text-anchor":"middle"}})}(t,e)})),s.syncOrAsync(W)}function et(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.max(t[1],e[1])}},T.getTickSigns=function(t){var e=t._id.charAt(0),r={x:"top",y:"right"}[e],n=t.side===r?1:-1,a=[-1,1,n,-n];return"inside"!==t.ticks==("x"===e)&&(a=a.map((function(t){return-t}))),a},T.makeTransFn=function(t){var e=t._id.charAt(0),r=t._offset;return"x"===e?function(e){return"translate("+(r+t.l2p(e.x))+",0)"}:function(e){return"translate(0,"+(r+t.l2p(e.x))+")"}},T.makeTickPath=function(t,e,r,n){n=void 0!==n?n:t.ticklen;var a=t._id.charAt(0),i=(t.linewidth||1)/2;return"x"===a?"M0,"+(e+i*r)+"v"+n*r:"M"+(e+i*r)+",0h"+n*r},T.makeLabelFns=function(t,e,r){var n=t._id.charAt(0),i="boundaries"!==t.tickson&&"outside"===t.ticks,o=0,l=0;if(i&&(o+=t.ticklen),r&&"outside"===t.ticks){var u=s.deg2rad(r);o=t.ticklen*Math.cos(u)+1,l=t.ticklen*Math.sin(u)}t.showticklabels&&(i||t.showline)&&(o+=.2*t.tickfont.size);var c,h,d,f,p={labelStandoff:o+=(t.linewidth||1)/2,labelShift:l};return"x"===n?(f="bottom"===t.side?1:-1,c=l*f,h=e+o*f,d="bottom"===t.side?1:-.2,p.xFn=function(t){return t.dx+c},p.yFn=function(t){return t.dy+h+t.fontSize*d},p.anchorFn=function(t,e){return a(e)&&0!==e&&180!==e?e*f<0?"end":"start":"middle"},p.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side?-n:0}):"y"===n&&(f="right"===t.side?1:-1,c=o,h=-l*f,d=90===Math.abs(t.tickangle)?.5:0,p.xFn=function(t){return t.dx+e+(c+t.fontSize*d)*f},p.yFn=function(t){return t.dy+h+t.fontSize*M},p.anchorFn=function(e,r){return a(r)&&90===Math.abs(r)?"middle":"right"===t.side?"start":"end"},p.heightFn=function(e,r,n){return(r*="left"===t.side?1:-1)<-30?-n:r<30?-.5*n:0}),p},T.drawTicks=function(t,e,r){r=r||{};var n=e._id+"tick",a=r.layer.selectAll("path."+n).data(e.ticks?r.vals:[],q);a.exit().remove(),a.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(c.stroke,e.tickcolor).style("stroke-width",h.crispRound(t,e.tickwidth,1)+"px").attr("d",r.path),a.attr("transform",r.transFn)},T.drawGrid=function(t,e,r){r=r||{};var n=e._id+"grid",a=r.vals,i=r.counterAxis;if(!1===e.showgrid)a=[];else if(i&&T.shouldShowZeroLine(t,e,i))for(var o="array"===e.tickmode,s=0;s<a.length;s++){var l=a[s].x;if(o?!l:Math.abs(l)<e.dtick/100){if(a=a.slice(0,s).concat(a.slice(s+1)),!o)break;s--}}var u=r.layer.selectAll("path."+n).data(a,q);u.exit().remove(),u.enter().append("path").classed(n,1).classed("crisp",!1!==r.crisp),e._gw=h.crispRound(t,e.gridwidth,1),u.attr("transform",r.transFn).attr("d",r.path).call(c.stroke,e.gridcolor||"#ddd").style("stroke-width",e._gw+"px"),"function"==typeof r.path&&u.attr("d",r.path)},T.drawZeroLine=function(t,e,r){r=r||r;var n=e._id+"zl",a=T.shouldShowZeroLine(t,e,r.counterAxis),i=r.layer.selectAll("path."+n).data(a?[{x:0,id:e._id}]:[]);i.exit().remove(),i.enter().append("path").classed(n,1).classed("zl",1).classed("crisp",!1!==r.crisp).each((function(){r.layer.selectAll("path").sort((function(t,e){return A.idSort(t.id,e.id)}))})),i.attr("transform",r.transFn).attr("d",r.path).call(c.stroke,e.zerolinecolor||c.defaultLine).style("stroke-width",h.crispRound(t,e.zerolinewidth,e._gw||1)+"px")},T.drawLabels=function(t,e,r){r=r||{};var i=e._id,o=i.charAt(0),u=r.cls||i+"tick",c=r.vals,d=r.labelFns,f=r.secondary?0:e.tickangle,p=(e._tickAngles||{})[u],m=r.layer.selectAll("g."+u).data(e.showticklabels?c:[],q),g=[];function y(t,e){t.each((function(t){var i=n.select(this),o=i.select(".text-math-group"),s=d.anchorFn(t,e),u=r.transFn.call(i.node(),t)+(a(e)&&0!=+e?" rotate("+e+","+d.xFn(t)+","+(d.yFn(t)-t.fontSize/2)+")":""),c=l.lineCount(i),f=k*t.fontSize,p=d.heightFn(t,a(e)?+e:0,(c-1)*f);if(p&&(u+=" translate(0, "+p+")"),o.empty())i.select("text").attr({transform:u,"text-anchor":s});else{var m=h.bBox(o.node()).width*{end:-.5,start:.5}[s];o.attr("transform",u+(m?"translate("+m+",0)":""))}}))}m.enter().append("g").classed(u,1).append("text").attr("text-anchor","middle").each((function(e){var r=n.select(this),a=t._promises.length;r.call(l.positionText,d.xFn(e),d.yFn(e)).call(h.font,e.font,e.fontSize,e.fontColor).text(e.text).call(l.convertToTspans,t),t._promises[a]?g.push(t._promises.pop().then((function(){y(r,f)}))):y(r,f)})),m.exit().remove(),r.repositionOnUpdate&&m.each((function(t){n.select(this).select("text").call(l.positionText,d.xFn(t),d.yFn(t))})),y(m,p||f),e._selections&&(e._selections[u]=m);var v=s.syncOrAsync([function(){return g.length&&Promise.all(g)},function(){y(m,f);var t=null;if(c.length&&"x"===o&&!a(f)&&("log"!==e.type||"D"!==String(e.dtick).charAt(0))){t=0;var n,i=0,l=[];if(m.each((function(t){i=Math.max(i,t.fontSize);var r=e.l2p(t.x),n=J(this),a=h.bBox(n.node());l.push({top:0,bottom:10,height:10,left:r-a.width/2,right:r+a.width/2+2,width:a.width+2})})),"boundaries"!==e.tickson&&!e.showdividers||r.secondary){var d=c.length,p=Math.abs((c[d-1].x-c[0].x)*e._m)/(d-1)<2.5*i||"multicategory"===e.type;for(n=0;n<l.length-1;n++)if(s.bBoxIntersect(l[n],l[n+1])){t=p?90:30;break}}else{var g=2;for(e.ticks&&(g+=e.tickwidth/2),n=0;n<l.length;n++){var v=c[n].xbnd,_=l[n];if(null!==v[0]&&_.left-e.l2p(v[0])<g||null!==v[1]&&e.l2p(v[1])-_.right<g){t=90;break}}}t&&y(m,t)}e._tickAngles&&(e._tickAngles[u]=null===t?a(f)?f:0:t)}]);return v&&v.then&&t._promises.push(v),v},T.shouldShowZeroLine=function(t,e,r){var n=s.simpleMap(e.range,e.r2l);return n[0]*n[1]<=0&&e.zeroline&&("linear"===e.type||"-"===e.type)&&e._gridVals.length&&(X(e,0)||!function(t,e,r,n){var a=r._mainAxis;if(a){var i=t._fullLayout,o=e._id.charAt(0),s=T.counterLetter(e._id),l=e._offset+(Math.abs(n[0])<Math.abs(n[1])==("x"===o)?0:e._length),u=i._plots[r._mainSubplot];if(!(u.mainplotinfo||u).overlays.length)return f(r);for(var c=T.list(t,s),h=0;h<c.length;h++){var d=c[h];if(d._mainAxis===a&&f(d))return!0}}function f(t){if(!t.showline||!t.linewidth)return!1;var r=Math.max((t.linewidth+e.zerolinewidth)/2,1);function n(t){return"number"==typeof t&&Math.abs(t-l)<r}if(n(t._mainLinePosition)||n(t._mainMirrorPosition))return!0;var a=t._linepositions||{};for(var i in a)if(n(a[i][0])||n(a[i][1]))return!0}}(t,e,r,n)||function(t,e){for(var r=t._fullData,n=e._mainSubplot,a=e._id.charAt(0),i=0;i<r.length;i++){var s=r[i];if(!0===s.visible&&s.xaxis+s.yaxis===n){if(o.traceIs(s,"bar-like")&&s.orientation==={x:"h",y:"v"}[a])return!0;if(s.fill&&s.fill.charAt(s.fill.length-1)===a)return!0}}return!1}(t,e))},T.clipEnds=function(t,e){return e.filter((function(e){return X(t,e.x)}))},T.allowAutoMargin=function(t){for(var e=T.list(t,"",!0),r=0;r<e.length;r++){var n=e[r];n.automargin&&i.allowAutoMargin(t,K(n)),o.getComponentMethod("rangeslider","isVisible")(n)&&i.allowAutoMargin(t,$(n))}},T.swap=function(t,e){for(var r=function(t,e){var r,n,a=[];for(r=0;r<e.length;r++){var i=[],o=t._fullData[e[r]].xaxis,s=t._fullData[e[r]].yaxis;if(o&&s){for(n=0;n<a.length;n++)-1===a[n].x.indexOf(o)&&-1===a[n].y.indexOf(s)||i.push(n);if(i.length){var l,u=a[i[0]];if(i.length>1)for(n=1;n<i.length;n++)l=a[i[n]],Q(u.x,l.x),Q(u.y,l.y);Q(u.x,[o]),Q(u.y,[s])}else a.push({x:[o],y:[s]})}}return a}(t,e),n=0;n<r.length;n++)tt(t,r[n].x,r[n].y)}},{"../../components/color":593,"../../components/drawing":614,"../../components/titles":681,"../../constants/alignment":688,"../../constants/numerical":695,"../../lib":719,"../../lib/svg_text_utils":743,"../../plots/plots":828,"../../registry":847,"./autorange":766,"./axis_autotype":768,"./axis_ids":770,"./clean_ticks":772,"./layout_attributes":779,"./set_convert":785,d3:163,"fast-isnumeric":225}],768:[function(t,e,r){var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r){return!(r=r||{}).noMultiCategory&&(o=t,a.isArrayOrTypedArray(o[0])&&a.isArrayOrTypedArray(o[1]))?"multicategory":function(t,e){for(var r=Math.max(1,(t.length-1)/1e3),i=0,o=0,s={},l=0;l<t.length;l+=r){var u=t[Math.round(l)],c=String(u);s[c]||(s[c]=1,a.isDateTime(u,e)&&(i+=1),n(u)&&(o+=1))}return i>2*o}(t,e)?"date":function(t){for(var e=Math.max(1,(t.length-1)/1e3),r=0,n=0,o={},s=0;s<t.length;s+=e){var l=t[Math.round(s)],u=String(l);o[u]||(o[u]=1,"boolean"==typeof l?n++:a.cleanNumber(l)!==i?r++:"string"==typeof l&&n++)}return n>2*r}(t)?"category":function(t){if(!t)return!1;for(var e=0;e<t.length;e++)if(n(t[e]))return!0;return!1}(t)?"linear":"-";var o}},{"../../constants/numerical":695,"../../lib":719,"fast-isnumeric":225}],769:[function(t,e,r){var n=t("../../registry"),a=t("../../lib"),i=t("./layout_attributes"),o=t("./tick_value_defaults"),s=t("./tick_mark_defaults"),l=t("./tick_label_defaults"),u=t("./category_order_defaults"),c=t("./line_grid_defaults"),h=t("./set_convert");e.exports=function(t,e,r,d,f){var p=d.letter,m=d.font||{},g=d.splomStash||{},y=r("visible",!d.visibleDflt),v=e.type;"date"===v&&n.getComponentMethod("calendars","handleDefaults")(t,e,"calendar",d.calendar),h(e,f);var _=!e.isValidRange(t.range);_&&d.reverseDflt&&(_="reversed"),!r("autorange",_)||"linear"!==v&&"-"!==v||r("rangemode"),r("range"),e.cleanRange(),u(t,e,r,d),"category"===v||d.noHover||r("hoverformat");var x=r("color"),b=x!==i.color.dflt?x:m.color,w=g.label||f._dfltTitle[p];if(l(t,e,r,v,d,{pass:1}),!y)return e;r("title.text",w),a.coerceFont(r,"title.font",{family:m.family,size:Math.round(1.2*m.size),color:b}),o(t,e,r,v),l(t,e,r,v,d,{pass:2}),s(t,e,r,d),c(t,e,r,{dfltColor:x,bgColor:d.bgColor,showGrid:d.showGrid,attributes:i}),(e.showline||e.ticks)&&r("mirror"),d.automargin&&r("automargin");var M,k="multicategory"===e.type;return d.noTickson||"category"!==e.type&&!k||!e.ticks&&!e.showgrid||(k&&(M="boundaries"),r("tickson",M)),k&&r("showdividers")&&(r("dividercolor"),r("dividerwidth")),e}},{"../../lib":719,"../../registry":847,"./category_order_defaults":771,"./layout_attributes":779,"./line_grid_defaults":781,"./set_convert":785,"./tick_label_defaults":786,"./tick_mark_defaults":787,"./tick_value_defaults":788}],770:[function(t,e,r){var n=t("../../registry"),a=t("./constants");r.id2name=function(t){if("string"==typeof t&&t.match(a.AX_ID_PATTERN)){var e=t.substr(1);return"1"===e&&(e=""),t.charAt(0)+"axis"+e}},r.name2id=function(t){if(t.match(a.AX_NAME_PATTERN)){var e=t.substr(5);return"1"===e&&(e=""),t.charAt(0)+e}},r.cleanId=function(t,e){if(t.match(a.AX_ID_PATTERN)&&(!e||t.charAt(0)===e)){var r=t.substr(1).replace(/^0+/,"");return"1"===r&&(r=""),t.charAt(0)+r}},r.list=function(t,e,n){var a=t._fullLayout;if(!a)return[];var i,o=r.listIds(t,e),s=new Array(o.length);for(i=0;i<o.length;i++){var l=o[i];s[i]=a[l.charAt(0)+"axis"+l.substr(1)]}if(!n){var u=a._subplots.gl3d||[];for(i=0;i<u.length;i++){var c=a[u[i]];e?s.push(c[e+"axis"]):s.push(c.xaxis,c.yaxis,c.zaxis)}}return s},r.listIds=function(t,e){var r=t._fullLayout;if(!r)return[];var n=r._subplots;return e?n[e+"axis"]:n.xaxis.concat(n.yaxis)},r.getFromId=function(t,e,n){var a=t._fullLayout;return"x"===n?e=e.replace(/y[0-9]*/,""):"y"===n&&(e=e.replace(/x[0-9]*/,"")),a[r.id2name(e)]},r.getFromTrace=function(t,e,a){var i=t._fullLayout,o=null;if(n.traceIs(e,"gl3d")){var s=e.scene;"scene"===s.substr(0,5)&&(o=i[s][a+"axis"])}else o=r.getFromId(t,e[a+"axis"]||a);return o},r.idSort=function(t,e){var r=t.charAt(0),n=e.charAt(0);return r!==n?r>n?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)},r.getAxisGroup=function(t,e){for(var r=t._axisMatchGroups,n=0;n<r.length;n++)if(r[n][e])return"g"+n;return e}},{"../../registry":847,"./constants":773}],771:[function(t,e,r){e.exports=function(t,e,r,n){if("category"===e.type){var a,i=t.categoryarray,o=Array.isArray(i)&&i.length>0;o&&(a="array");var s,l=r("categoryorder",a);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=e.categoryorder="trace"),"trace"===l?e._initialCategories=[]:"array"===l?e._initialCategories=s.slice():(s=function(t,e){var r,n,a,i=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;n<e.data.length;n++){var s=e.data[n];s[i+"axis"]===t._id&&r.push(s)}for(n=0;n<r.length;n++){var l=r[n][i];for(a=0;a<l.length;a++){var u=l[a];null!=u&&(o[u]=1)}}return Object.keys(o)}(e,n).sort(),"category ascending"===l?e._initialCategories=s:"category descending"===l&&(e._initialCategories=s.reverse()))}}},{}],772:[function(t,e,r){var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../constants/numerical").ONEDAY;r.dtick=function(t,e){var r="log"===e,a="date"===e,o="category"===e,s=a?i:1;if(!t)return s;if(n(t))return(t=Number(t))<=0?s:o?Math.max(1,Math.round(t)):a?Math.max(.1,t):t;if("string"!=typeof t||!a&&!r)return s;var l=t.charAt(0),u=t.substr(1);return(u=n(u)?Number(u):0)<=0||!(a&&"M"===l&&u===Math.round(u)||r&&"L"===l||r&&"D"===l&&(1===u||2===u))?s:t},r.tick0=function(t,e,r,i){return"date"===e?a.cleanDate(t,a.dateTick0(r)):"D1"!==i&&"D2"!==i?n(t)?Number(t):0:void 0}},{"../../constants/numerical":695,"../../lib":719,"fast-isnumeric":225}],773:[function(t,e,r){var n=t("../../lib/regex").counter;e.exports={idRegex:{x:n("x"),y:n("y")},attrRegex:n("[xy]axis"),xAxisMatch:n("xaxis"),yAxisMatch:n("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,BENDPX:1.5,REDRAWDELAY:50,SELECTDELAY:100,SELECTID:"-select",DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"}}},{"../../lib/regex":735}],774:[function(t,e,r){var n=t("../../lib"),a=t("./axis_ids").id2name,i=t("./scale_zoom"),o=t("./autorange").makePadFn,s=t("./autorange").concatExtremes,l=t("../../constants/numerical").ALMOST_EQUAL,u=t("../../constants/alignment").FROM_BL;function c(t,e,r,n,i){var o,s,l,u,c="range"!==i,h=n[a(e)].type,d=[];for(s=0;s<r.length;s++)(l=r[s])!==e&&(u=n[a(l)]).type===h&&(u.fixedrange?c&&u.anchor&&n[a(u.anchor)].fixedrange&&d.push(l):d.push(l));for(o=0;o<t.length;o++)if(t[o][e]){var f=t[o],p=[];for(s=0;s<d.length;s++)f[l=d[s]]||p.push(l);return{linkableAxes:p,thisGroup:f}}return{linkableAxes:d,thisGroup:null}}function h(t,e,r,n,a){var i,o,s,l,u;null===e?((e={})[r]=1,u=t.length,t.push(e)):u=t.indexOf(e);var c=Object.keys(e);for(i=0;i<t.length;i++)if(s=t[i],i!==u&&s[n]){var h=s[n];for(o=0;o<c.length;o++)s[l=c[o]]=h*a*e[l];return void t.splice(u,1)}if(1!==a)for(o=0;o<c.length;o++)e[c[o]]*=a;e[n]=1}function d(t,e){var r=t._inputDomain,n=u[t.constraintoward],a=r[0]+(r[1]-r[0])*n;t.domain=t._input.domain=[a+(r[0]-a)/e,a+(r[1]-a)/e],t.setScale()}r.handleConstraintDefaults=function(t,e,r,a,i){var o,s,l,u,d=i._axisConstraintGroups,f=i._axisMatchGroups,p=e._id,m=p.charAt(0),g=((i._splomAxes||{})[m]||{})[p]||{},y=e._id,v=y.charAt(0),_=r("constrain");if(n.coerce(t,e,{constraintoward:{valType:"enumerated",values:"x"===v?["left","center","right"]:["bottom","middle","top"],dflt:"x"===v?"center":"middle"}},"constraintoward"),!t.matches&&!g.matches||e.fixedrange||(s=c(f,y,a,i),o=n.coerce(t,e,{matches:{valType:"enumerated",values:s.linkableAxes||[],dflt:g.matches}},"matches")),o||!t.scaleanchor||e.fixedrange&&"domain"!==_||(u=c(d,y,a,i,_),l=n.coerce(t,e,{scaleanchor:{valType:"enumerated",values:u.linkableAxes||[]}},"scaleanchor")),o?(delete e.constrain,h(f,s.thisGroup,y,o,1)):-1!==a.indexOf(t.matches)&&n.warn("ignored "+e._name+'.matches: "'+t.matches+'" to avoid either an infinite loop or because the target axis has fixed range.'),l){var x=r("scaleratio");x||(x=e.scaleratio=1),h(d,u.thisGroup,y,l,x)}else-1!==a.indexOf(t.scaleanchor)&&n.warn("ignored "+e._name+'.scaleanchor: "'+t.scaleanchor+'" to avoid either an infinite loop and possibly inconsistent scaleratios, or because the target axis has fixed range or this axis declares a *matches* constraint.')},r.enforce=function(t){var e,r,n,u,c,h,f,p=t._fullLayout,m=p._axisConstraintGroups||[];for(e=0;e<m.length;e++){var g=m[e],y=Object.keys(g),v=1/0,_=0,x=1/0,b={},w={},M=!1;for(r=0;r<y.length;r++)w[n=y[r]]=u=p[a(n)],u._inputDomain?u.domain=u._inputDomain.slice():u._inputDomain=u.domain.slice(),u._inputRange||(u._inputRange=u.range.slice()),u.setScale(),b[n]=c=Math.abs(u._m)/g[n],v=Math.min(v,c),"domain"!==u.constrain&&u._constraintShrinkable||(x=Math.min(x,c)),delete u._constraintShrinkable,_=Math.max(_,c),"domain"===u.constrain&&(M=!0);if(!(v>l*_)||M)for(r=0;r<y.length;r++)if(c=b[n=y[r]],h=(u=w[n]).constrain,c!==x||"domain"===h)if(f=c/x,"range"===h)i(u,f);else{var k=u._inputDomain,T=(u.domain[1]-u.domain[0])/(k[1]-k[0]),L=(u.r2l(u.range[1])-u.r2l(u.range[0]))/(u.r2l(u._inputRange[1])-u.r2l(u._inputRange[0]));if((f/=T)*L<1){u.domain=u._input.domain=k.slice(),i(u,f);continue}if(L<1&&(u.range=u._input.range=u._inputRange.slice(),f*=L),u.autorange){var A=u.r2l(u.range[0]),S=u.r2l(u.range[1]),E=(A+S)/2,C=E,D=E,P=Math.abs(S-E),O=E-P*f*1.0001,z=E+P*f*1.0001,I=o(u);d(u,f);var R,F,N=Math.abs(u._m),Y=s(t,u),j=Y.min,B=Y.max;for(F=0;F<j.length;F++)(R=j[F].val-I(j[F])/N)>O&&R<C&&(C=R);for(F=0;F<B.length;F++)(R=B[F].val+I(B[F])/N)<z&&R>D&&(D=R);f/=(D-C)/(2*P),C=u.l2r(C),D=u.l2r(D),u.range=u._input.range=A<S?[C,D]:[D,C]}d(u,f)}}},r.clean=function(t,e){if(e._inputDomain){for(var r=!1,n=e._id,a=t._fullLayout._axisConstraintGroups,i=0;i<a.length;i++)if(a[i][n]){r=!0;break}r&&"domain"===e.constrain||(e._input.domain=e.domain=e._inputDomain,delete e._inputDomain)}}},{"../../constants/alignment":688,"../../constants/numerical":695,"../../lib":719,"./autorange":766,"./axis_ids":770,"./scale_zoom":783}],775:[function(t,e,r){var n=t("d3"),a=t("tinycolor2"),i=t("has-passive-events"),o=t("../../registry"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../../components/color"),c=t("../../components/drawing"),h=t("../../components/fx"),d=t("./axes"),f=t("../../lib/setcursor"),p=t("../../components/dragelement"),m=t("../../constants/alignment").FROM_TL,g=t("../../lib/clear_gl_canvases"),y=t("../../plot_api/subroutines").redrawReglTraces,v=t("../plots"),_=t("./axis_ids").getFromId,x=t("./select").prepSelect,b=t("./select").clearSelect,w=t("./select").selectOnClick,M=t("./scale_zoom"),k=t("./constants"),T=k.MINDRAG,L=k.MINZOOM,A=!0;function S(t,e,r,n){var a=s.ensureSingle(t.draglayer,e,r,(function(e){e.classed("drag",!0).style({fill:"transparent","stroke-width":0}).attr("data-subplot",t.id)}));return a.call(f,n),a.node()}function E(t,e,r,a,i,o,s){var l=S(t,"rect",e,r);return n.select(l).call(c.setRect,a,i,o,s),l}function C(t,e){for(var r=0;r<t.length;r++)if(!t[r].fixedrange)return e;return""}function D(t,e,r,n,a){for(var i=0;i<t.length;i++){var o=t[i];if(!o.fixedrange){var s=o._rl[0],l=o._rl[1]-s;n[o._name+".range[0]"]=o.l2r(s+l*e),n[o._name+".range[1]"]=o.l2r(s+l*r)}}if(a&&a.length){var u=(e+(1-r))/2;D(a,u,1-u,n,[])}}function P(t,e){for(var r=0;r<t.length;r++){var n=t[r];n.fixedrange||(n.range=[n.l2r(n._rl[0]-e/n._m),n.l2r(n._rl[1]-e/n._m)])}}function O(t){return 1-(t>=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function z(t,e,r,n,a){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",a+"Z")}function I(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function R(t,e,r,n,a,i){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),F(t,e,a,i)}function F(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function N(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function Y(t){A&&t.data&&t._context.showTips&&(s.notifier(s._(t,"Double-click to zoom back out"),"long"),A=!1)}function j(t){return"lasso"===t||"select"===t}function B(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,L)/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 H(t,e,r,n){for(var a,i,o,l,u=!1,c={},h={},d=0;d<e.length;d++){var f=e[d];for(a in r)if(f[a]){for(o in f)("x"===o.charAt(0)?r:n)[o]||(c[o]=a);for(i in n)f[i]&&(u=!0)}for(i in n)if(f[i])for(l in f)("x"===l.charAt(0)?r:n)[l]||(h[l]=i)}u&&(s.extendFlat(c,h),h={});var p={},m=[];for(o in c){var g=_(t,o);m.push(g),p[g._id]=g}var y={},v=[];for(l in h){var x=_(t,l);v.push(x),y[x._id]=x}return{xaHash:p,yaHash:y,xaxes:m,yaxes:v,xLinks:c,yLinks:h,isSubplotConstrained:u}}function U(t,e){if(i){var r=void 0!==t.onwheel?"wheel":"mousewheel";t._onwheel&&t.removeEventListener(r,t._onwheel),t._onwheel=e,t.addEventListener(r,e,{passive:!1})}else void 0!==t.onwheel?t.onwheel=e:void 0!==t.onmousewheel&&(t.onmousewheel=e)}function V(t){var e=[];for(var r in t)e.push(t[r]);return e}e.exports={makeDragBox:function(t,e,r,i,u,f,A,S){var F,W,G,q,Z,X,J,K,$,Q,tt,et,rt,nt,at,it,ot,st,lt,ut,ct,ht=t._fullLayout._zoomlayer,dt=A+S==="nsew",ft=1===(A+S).length;function pt(){if(F=e.xaxis,W=e.yaxis,$=F._length,Q=W._length,J=F._offset,K=W._offset,(G={})[F._id]=F,(q={})[W._id]=W,A&&S)for(var r=e.overlays,n=0;n<r.length;n++){var a=r[n].xaxis;G[a._id]=a;var i=r[n].yaxis;q[i._id]=i}Z=V(G),X=V(q),rt=C(Z,S),nt=C(X,A),at=!nt&&!rt,tt=H(t,t._fullLayout._axisConstraintGroups,G,q),et=H(t,t._fullLayout._axisMatchGroups,G,q),it=S||tt.isSubplotConstrained||et.isSubplotConstrained,ot=A||tt.isSubplotConstrained||et.isSubplotConstrained;var o=t._fullLayout;st=o._has("scattergl"),lt=o._has("splom"),ut=o._has("svg")}pt();var mt=function(t,e,r){return t?"nsew"===t?r?"":"pan"===e?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}(nt+rt,t._fullLayout.dragmode,dt),gt=E(e,A+S+"drag",mt,r,i,u,f);if(at&&!dt)return gt.onmousedown=null,gt.style.pointerEvents="none",gt;var yt,vt,_t,xt,bt,wt,Mt,kt,Tt,Lt,At={element:gt,gd:t,plotinfo:e};function St(){At.plotinfo.selection=!1,b(t)}function Et(r,a){var i=t._fullLayout.clickmode;if(N(t),2!==r||ft||function(){if(!t._transitioningWithDuration){var e=t._context.doubleClick,r=[];rt&&(r=r.concat(Z)),nt&&(r=r.concat(X)),et.xaxes&&(r=r.concat(et.xaxes)),et.yaxes&&(r=r.concat(et.yaxes));var n,a,i,s={};if("reset+autosize"===e)for(e="autosize",a=0;a<r.length;a++)if((n=r[a])._rangeInitial&&(n.range[0]!==n._rangeInitial[0]||n.range[1]!==n._rangeInitial[1])||!n._rangeInitial&&!n.autorange){e="reset";break}if("autosize"===e)for(a=0;a<r.length;a++)(n=r[a]).fixedrange||(s[n._name+".autorange"]=!0);else if("reset"===e)for((rt||tt.isSubplotConstrained)&&(r=r.concat(tt.xaxes)),nt&&!tt.isSubplotConstrained&&(r=r.concat(tt.yaxes)),tt.isSubplotConstrained&&(rt?nt||(r=r.concat(X)):r=r.concat(Z)),a=0;a<r.length;a++)(n=r[a]).fixedrange||(n._rangeInitial?(i=n._rangeInitial,s[n._name+".range[0]"]=i[0],s[n._name+".range[1]"]=i[1]):s[n._name+".autorange"]=!0);t.emit("plotly_doubleclick",null),o.call("_guiRelayout",t,s)}}(),dt)i.indexOf("select")>-1&&w(a,t,Z,X,e.id,At),i.indexOf("event")>-1&&h.click(t,a,e.id);else if(1===r&&ft){var s=A?W:F,u="s"===A||"w"===S?0:1,c=s._name+".range["+u+"]",d=function(t,e){var r,a=t.range[e],i=Math.abs(a-t.range[1-e]);return"date"===t.type?a:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,n.format("."+r+"g")(Math.pow(10,a))):(r=Math.floor(Math.log(Math.abs(a))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,n.format("."+String(r)+"g")(a))}(s,u),f="left",p="middle";if(s.fixedrange)return;A?(p="n"===A?"top":"bottom","right"===s.side&&(f="right")):"e"===S&&(f="right"),t._context.showAxisRangeEntryBoxes&&n.select(gt).call(l.makeEditable,{gd:t,immediate:!0,background:t._fullLayout.paper_bgcolor,text:String(d),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:f,verticalAlign:p}).on("edit",(function(e){var r=s.d2r(e);void 0!==r&&o.call("_guiRelayout",t,c,r)}))}}function Ct(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min($,e+yt)),a=Math.max(0,Math.min(Q,r+vt)),i=Math.abs(n-yt),o=Math.abs(a-vt);function s(){Mt="",_t.r=_t.l,_t.t=_t.b,Tt.attr("d","M0,0Z")}if(_t.l=Math.min(yt,n),_t.r=Math.max(yt,n),_t.t=Math.min(vt,a),_t.b=Math.max(vt,a),tt.isSubplotConstrained)i>L||o>L?(Mt="xy",i/$>o/Q?(o=i*Q/$,vt>a?_t.t=vt-o:_t.b=vt+o):(i=o*$/Q,yt>n?_t.l=yt-i:_t.r=yt+i),Tt.attr("d",B(_t))):s();else if(et.isSubplotConstrained)if(i>L||o>L){Mt="xy";var l=Math.min(_t.l/$,(Q-_t.b)/Q),u=Math.max(_t.r/$,(Q-_t.t)/Q);_t.l=l*$,_t.r=u*$,_t.b=(1-l)*Q,_t.t=(1-u)*Q,Tt.attr("d",B(_t))}else s();else!nt||o<Math.min(Math.max(.6*i,T),L)?i<T||!rt?s():(_t.t=0,_t.b=Q,Mt="x",Tt.attr("d",function(t,e){return"M"+(t.l-.5)+","+(e-L-.5)+"h-3v"+(2*L+1)+"h3ZM"+(t.r+.5)+","+(e-L-.5)+"h3v"+(2*L+1)+"h-3Z"}(_t,vt))):!rt||i<Math.min(.6*o,L)?(_t.l=0,_t.r=$,Mt="y",Tt.attr("d",function(t,e){return"M"+(e-L-.5)+","+(t.t-.5)+"v-3h"+(2*L+1)+"v3ZM"+(e-L-.5)+","+(t.b+.5)+"v3h"+(2*L+1)+"v-3Z"}(_t,yt))):(Mt="xy",Tt.attr("d",B(_t)));_t.w=_t.r-_t.l,_t.h=_t.b-_t.t,Mt&&(Lt=!0),t._dragged=Lt,R(kt,Tt,_t,bt,wt,xt),Dt(),t.emit("plotly_relayouting",ct),wt=!0}function Dt(){ct={},"xy"!==Mt&&"x"!==Mt||(D(Z,_t.l/$,_t.r/$,ct,tt.xaxes),Nt("x",ct)),"xy"!==Mt&&"y"!==Mt||(D(X,(Q-_t.b)/Q,(Q-_t.t)/Q,ct,tt.yaxes),Nt("y",ct))}function Pt(){if(Math.min(_t.h,_t.w)<2*T)return N(t);Dt(),N(t),jt(),Y(t)}At.prepFn=function(e,r,n){var i=At.dragmode,o=t._fullLayout.dragmode;o!==i&&(At.dragmode=o),pt(),at||(dt?e.shiftKey?"pan"===o?o="zoom":j(o)||(o="pan"):e.ctrlKey&&(o="pan"):o="pan"),At.minDrag="lasso"===o?1:void 0,j(o)?(At.xaxes=Z,At.yaxes=X,x(e,r,n,At,o)):(At.clickFn=Et,j(i)&&St(),at||("zoom"===o?(At.moveFn=Ct,At.doneFn=Pt,At.minDrag=1,function(e,r,n){var i=gt.getBoundingClientRect();yt=r-i.left,vt=n-i.top,_t={l:yt,r:yt,w:0,t:vt,b:vt,h:0},xt=t._hmpixcount?t._hmlumcount/t._hmpixcount:a(t._fullLayout.plot_bgcolor).getLuminance(),wt=!1,Mt="xy",Lt=!1,kt=z(ht,xt,J,K,bt="M0,0H"+$+"V"+Q+"H0V0"),Tt=I(ht,J,K)}(0,r,n)):"pan"===o&&(At.moveFn=Ft,At.doneFn=jt))),t._fullLayout._redrag=function(){var e=t._dragdata;e&&e.element===gt&&(j(t._fullLayout.dragmode)||(pt(),Bt([0,0,$,Q]),At.moveFn(e.dx,e.dy)))}},p.init(At);var Ot=[0,0,$,Q],zt=null,It=k.REDRAWDELAY,Rt=e.mainplot?t._fullLayout._plots[e.mainplot]:e;function Ft(e,r){if(!t._transitioningWithDuration){if(t._fullLayout._replotting=!0,"ew"===rt||"ns"===nt)return rt&&(P(Z,e),Nt("x")),nt&&(P(X,r),Nt("y")),Bt([rt?-e:0,nt?-r:0,$,Q]),Yt(),void t.emit("plotly_relayouting",ct);if(tt.isSubplotConstrained&&rt&&nt){var n="w"===rt==("n"===nt)?1:-1,a=(e/$+n*r/Q)/2;e=a*$,r=n*a*Q}"w"===rt?e=l(Z,0,e):"e"===rt?e=l(Z,1,-e):rt||(e=0),"n"===nt?r=l(X,1,r):"s"===nt?r=l(X,0,-r):nt||(r=0);var i="w"===rt?e:0,o="n"===nt?r:0;if(tt.isSubplotConstrained){var s;if(!rt&&1===nt.length){for(s=0;s<Z.length;s++)Z[s].range=Z[s]._r.slice(),M(Z[s],1-r/Q);i=(e=r*$/Q)/2}if(!nt&&1===rt.length){for(s=0;s<X.length;s++)X[s].range=X[s]._r.slice(),M(X[s],1-e/$);o=(r=e*Q/$)/2}}Nt("x"),Nt("y"),Bt([i,o,$-e,Q-r]),Yt(),t.emit("plotly_relayouting",ct)}function l(t,e,r){for(var n,a,i=1-e,o=0;o<t.length;o++){var s=t[o];if(!s.fixedrange){n=s,a=s._rl[i]+(s._rl[e]-s._rl[i])/O(r/s._length);var l=s.l2r(a);!1!==l&&void 0!==l&&(s.range[e]=l)}}return n._length*(n._rl[e]-a)/(n._rl[e]-n._rl[i])}}function Nt(t,e){for(var r=et.isSubplotConstrained?{x:X,y:Z}[t]:et[t+"axes"],n=et.isSubplotConstrained?{x:Z,y:X}[t]:[],a=0;a<r.length;a++){var i=r[a],o=i._id,s=et.xLinks[o]||et.yLinks[o],l=n[0]||G[s]||q[s];l&&(e?(e[i._name+".range[0]"]=e[l._name+".range[0]"],e[i._name+".range[1]"]=e[l._name+".range[1]"]):i.range=l.range.slice())}}function Yt(){var e,r=[];function n(t){for(e=0;e<t.length;e++)t[e].fixedrange||r.push(t[e]._id)}for(it&&(n(Z),n(tt.xaxes),n(et.xaxes)),ot&&(n(X),n(tt.yaxes),n(et.yaxes)),ct={},e=0;e<r.length;e++){var a=r[e],i=_(t,a);d.drawOne(t,i,{skipTitle:!0}),ct[i._name+".range[0]"]=i.range[0],ct[i._name+".range[1]"]=i.range[1]}d.redrawComponents(t,r)}function jt(){Bt([0,0,$,Q]),s.syncOrAsync([v.previousPromises,function(){t._fullLayout._replotting=!1,o.call("_guiRelayout",t,ct)}],t)}function Bt(e){var r,n,a,i,l=t._fullLayout,u=l._plots,h=l._subplots.cartesian;if(lt&&o.subplotsRegistry.splom.drag(t),st)for(r=0;r<h.length;r++)if(a=(n=u[h[r]]).xaxis,i=n.yaxis,n._scene){var d=s.simpleMap(a.range,a.r2l),f=s.simpleMap(i.range,i.r2l);n._scene.update({range:[d[0],f[0],d[1],f[1]]})}if((lt||st)&&(g(t),y(t)),ut){var p=e[2]/F._length,m=e[3]/W._length;for(r=0;r<h.length;r++){a=(n=u[h[r]]).xaxis,i=n.yaxis;var v,_,x,b,w=it&&!a.fixedrange&&G[a._id],M=ot&&!i.fixedrange&&q[i._id];if(w?(v=p,x=S?e[0]:Vt(a,v)):et.xaHash[a._id]?(v=p,x=e[0]*a._length/F._length):et.yaHash[a._id]?(v=m,x="ns"===nt?-e[1]*a._length/W._length:Vt(a,v,{n:"top",s:"bottom"}[nt])):x=Ut(a,v=Ht(a,p,m)),M?(_=m,b=A?e[1]:Vt(i,_)):et.yaHash[i._id]?(_=m,b=e[1]*i._length/W._length):et.xaHash[i._id]?(_=p,b="ew"===rt?-e[0]*i._length/F._length:Vt(i,_,{e:"right",w:"left"}[rt])):b=Ut(i,_=Ht(i,p,m)),v||_){v||(v=1),_||(_=1);var k=a._offset-x/v,T=i._offset-b/_;n.clipRect.call(c.setTranslate,x,b).call(c.setScale,v,_),n.plot.call(c.setTranslate,k,T).call(c.setScale,1/v,1/_),v===n.xScaleFactor&&_===n.yScaleFactor||(c.setPointGroupScale(n.zoomScalePts,v,_),c.setTextPointsScale(n.zoomScaleTxt,v,_)),c.hideOutsideRangePoints(n.clipOnAxisFalseTraces,n),n.xScaleFactor=v,n.yScaleFactor=_}}}}function Ht(t,e,r){return t.fixedrange?0:it&&tt.xaHash[t._id]?e:ot&&(tt.isSubplotConstrained?tt.xaHash:tt.yaHash)[t._id]?r:0}function Ut(t,e){return e?(t.range=t._r.slice(),M(t,e),Vt(t,e)):0}function Vt(t,e,r){return t._length*(1-e)*m[r||t.constraintoward||"middle"]}return A.length*S.length!=1&&U(gt,(function(e){if(t._context._scrollZoom.cartesian||t._fullLayout._enablescrollzoom){if(St(),t._transitioningWithDuration)return e.preventDefault(),void e.stopPropagation();pt(),clearTimeout(zt);var r=-e.deltaY;if(isFinite(r)||(r=e.wheelDelta/10),isFinite(r)){var n,a=Math.exp(-Math.min(Math.max(r,-20),20)/200),i=Rt.draglayer.select(".nsewdrag").node().getBoundingClientRect(),o=(e.clientX-i.left)/i.width,l=(i.bottom-e.clientY)/i.height;if(it){for(S||(o=.5),n=0;n<Z.length;n++)u(Z[n],o,a);Nt("x"),Ot[2]*=a,Ot[0]+=Ot[2]*o*(1/a-1)}if(ot){for(A||(l=.5),n=0;n<X.length;n++)u(X[n],l,a);Nt("y"),Ot[3]*=a,Ot[1]+=Ot[3]*(1-l)*(1/a-1)}Bt(Ot),Yt(),t.emit("plotly_relayouting",ct),zt=setTimeout((function(){Ot=[0,0,$,Q],jt()}),It),e.preventDefault()}else s.log("Did not find wheel motion attributes: ",e)}function u(t,e,r){if(!t.fixedrange){var n=s.simpleMap(t.range,t.r2l),a=n[0]+(n[1]-n[0])*e;t.range=n.map((function(e){return t.l2r(a+(e-a)*r)}))}}})),gt},makeDragger:S,makeRectDragger:E,makeZoombox:z,makeCorners:I,updateZoombox:R,xyCorners:B,transitionZoombox:F,removeZoombox:N,showDoubleClickNotifier:Y,attachWheelEventHandler:U}},{"../../components/color":593,"../../components/dragelement":611,"../../components/drawing":614,"../../components/fx":632,"../../constants/alignment":688,"../../lib":719,"../../lib/clear_gl_canvases":704,"../../lib/setcursor":739,"../../lib/svg_text_utils":743,"../../plot_api/subroutines":758,"../../registry":847,"../plots":828,"./axes":767,"./axis_ids":770,"./constants":773,"./scale_zoom":783,"./select":784,d3:163,"has-passive-events":411,tinycolor2:537}],776:[function(t,e,r){var n=t("d3"),a=t("../../components/fx"),i=t("../../components/dragelement"),o=t("../../lib/setcursor"),s=t("./dragbox").makeDragBox,l=t("./constants").DRAGGERSIZE;r.initInteractions=function(t){var e=t._fullLayout;if(t._context.staticPlot)n.select(t).selectAll(".drag").remove();else if(e._has("cartesian")||e._has("splom")){Object.keys(e._plots||{}).sort((function(t,r){if((e._plots[t].mainplot&&!0)===(e._plots[r].mainplot&&!0)){var n=t.split("y"),a=r.split("y");return n[0]===a[0]?Number(n[1]||1)-Number(a[1]||1):Number(n[0]||1)-Number(a[0]||1)}return e._plots[t].mainplot?1:-1})).forEach((function(r){var n=e._plots[r],o=n.xaxis,u=n.yaxis;if(!n.mainplot){var c=s(t,n,o._offset,u._offset,o._length,u._length,"ns","ew");c.onmousemove=function(e){t._fullLayout._rehover=function(){t._fullLayout._hoversubplot===r&&a.hover(t,e,r)},a.hover(t,e,r),t._fullLayout._lasthover=c,t._fullLayout._hoversubplot=r},c.onmouseout=function(e){t._dragging||(t._fullLayout._hoversubplot=null,i.unhover(t,e))},t._context.showAxisDragHandles&&(s(t,n,o._offset-l,u._offset-l,l,l,"n","w"),s(t,n,o._offset+o._length,u._offset-l,l,l,"n","e"),s(t,n,o._offset-l,u._offset+u._length,l,l,"s","w"),s(t,n,o._offset+o._length,u._offset+u._length,l,l,"s","e"))}if(t._context.showAxisDragHandles){if(r===o._mainSubplot){var h=o._mainLinePosition;"top"===o.side&&(h-=l),s(t,n,o._offset+.1*o._length,h,.8*o._length,l,"","ew"),s(t,n,o._offset,h,.1*o._length,l,"","w"),s(t,n,o._offset+.9*o._length,h,.1*o._length,l,"","e")}if(r===u._mainSubplot){var d=u._mainLinePosition;"right"!==u.side&&(d-=l),s(t,n,d,u._offset+.1*u._length,l,.8*u._length,"ns",""),s(t,n,d,u._offset+.9*u._length,l,.1*u._length,"s",""),s(t,n,d,u._offset,l,.1*u._length,"n","")}}}));var o=e._hoverlayer.node();o.onmousemove=function(r){r.target=t._fullLayout._lasthover,a.hover(t,r,e._hoversubplot)},o.onclick=function(e){e.target=t._fullLayout._lasthover,a.click(t,e)},o.onmousedown=function(e){t._fullLayout._lasthover.onmousedown(e)},r.updateFx(t)}},r.updateFx=function(t){var e=t._fullLayout,r="pan"===e.dragmode?"move":"crosshair";o(e._draggers,r)}},{"../../components/dragelement":611,"../../components/fx":632,"../../lib/setcursor":739,"./constants":773,"./dragbox":775,d3:163}],777:[function(t,e,r){var n=t("../../registry"),a=t("../../lib");e.exports=function(t){return function(e,r){var i=e[t];if(Array.isArray(i))for(var o=n.subplotsRegistry.cartesian,s=o.idRegex,l=r._subplots,u=l.xaxis,c=l.yaxis,h=l.cartesian,d=r._has("cartesian")||r._has("gl2d"),f=0;f<i.length;f++){var p=i[f];if(a.isPlainObject(p)){var m=p.xref,g=p.yref,y=s.x.test(m),v=s.y.test(g);if(y||v){d||a.pushUnique(r._basePlotModules,o);var _=!1;y&&-1===u.indexOf(m)&&(u.push(m),_=!0),v&&-1===c.indexOf(g)&&(c.push(g),_=!0),_&&y&&v&&h.push(m+g)}}}}}},{"../../lib":719,"../../registry":847}],778:[function(t,e,r){var n=t("d3"),a=t("../../registry"),i=t("../../lib"),o=t("../plots"),s=t("../../components/drawing"),l=t("../get_data").getModuleCalcData,u=t("./axis_ids"),c=t("./constants"),h=t("../../constants/xmlns_namespaces"),d=i.ensureSingle;function f(t,e,r){return i.ensureSingle(t,e,r,(function(t){t.datum(r)}))}function p(t,e,r,i,o){for(var u,h,d,f=c.traceLayerClasses,p=t._fullLayout,m=p._modules,g=[],y=[],v=0;v<m.length;v++){var _=(u=m[v]).name,x=a.modules[_].categories;if(x.svg){var b=u.layerName||_+"layer",w=u.plot;d=(h=l(r,w))[0],r=h[1],d.length&&g.push({i:f.indexOf(b),className:b,plotMethod:w,cdModule:d}),x.zoomScale&&y.push("."+b)}}g.sort((function(t,e){return t.i-e.i}));var M=e.plot.selectAll("g.mlayer").data(g,(function(t){return t.className}));if(M.enter().append("g").attr("class",(function(t){return t.className})).classed("mlayer",!0).classed("rangeplot",e.isRangePlot),M.exit().remove(),M.order(),M.each((function(r){var a=n.select(this),l=r.className;r.plotMethod(t,e,r.cdModule,a,i,o),-1===c.clipOnAxisFalseQuery.indexOf("."+l)&&s.setClipUrl(a,e.layerClipId,t)})),p._has("scattergl")&&(u=a.getModule("scattergl"),d=l(r,u)[0],u.plot(t,e,d)),!t._context.staticPlot&&(e._hasClipOnAxisFalse&&(e.clipOnAxisFalseTraces=e.plot.selectAll(c.clipOnAxisFalseQuery.join(",")).selectAll(".trace")),y.length)){var k=e.plot.selectAll(y.join(",")).selectAll(".trace");e.zoomScalePts=k.selectAll("path.point"),e.zoomScaleTxt=k.selectAll(".textpoint")}}function m(t,e){var r=e.plotgroup,n=e.id,a=c.layerValue2layerClass[e.xaxis.layer],i=c.layerValue2layerClass[e.yaxis.layer],o=t._fullLayout._hasOnlyLargeSploms;if(e.mainplot){var s=e.mainplotinfo,l=s.plotgroup,h=n+"-x",p=n+"-y";e.gridlayer=s.gridlayer,e.zerolinelayer=s.zerolinelayer,d(s.overlinesBelow,"path",h),d(s.overlinesBelow,"path",p),d(s.overaxesBelow,"g",h),d(s.overaxesBelow,"g",p),e.plot=d(s.overplot,"g",n),d(s.overlinesAbove,"path",h),d(s.overlinesAbove,"path",p),d(s.overaxesAbove,"g",h),d(s.overaxesAbove,"g",p),e.xlines=l.select(".overlines-"+a).select("."+h),e.ylines=l.select(".overlines-"+i).select("."+p),e.xaxislayer=l.select(".overaxes-"+a).select("."+h),e.yaxislayer=l.select(".overaxes-"+i).select("."+p)}else if(o)e.xlines=d(r,"path","xlines-above"),e.ylines=d(r,"path","ylines-above"),e.xaxislayer=d(r,"g","xaxislayer-above"),e.yaxislayer=d(r,"g","yaxislayer-above");else{var m=d(r,"g","layer-subplot");e.shapelayer=d(m,"g","shapelayer"),e.imagelayer=d(m,"g","imagelayer"),e.gridlayer=d(r,"g","gridlayer"),e.zerolinelayer=d(r,"g","zerolinelayer"),d(r,"path","xlines-below"),d(r,"path","ylines-below"),e.overlinesBelow=d(r,"g","overlines-below"),d(r,"g","xaxislayer-below"),d(r,"g","yaxislayer-below"),e.overaxesBelow=d(r,"g","overaxes-below"),e.plot=d(r,"g","plot"),e.overplot=d(r,"g","overplot"),e.xlines=d(r,"path","xlines-above"),e.ylines=d(r,"path","ylines-above"),e.overlinesAbove=d(r,"g","overlines-above"),d(r,"g","xaxislayer-above"),d(r,"g","yaxislayer-above"),e.overaxesAbove=d(r,"g","overaxes-above"),e.xlines=r.select(".xlines-"+a),e.ylines=r.select(".ylines-"+i),e.xaxislayer=r.select(".xaxislayer-"+a),e.yaxislayer=r.select(".yaxislayer-"+i)}o||(f(e.gridlayer,"g",e.xaxis._id),f(e.gridlayer,"g",e.yaxis._id),e.gridlayer.selectAll("g").map((function(t){return t[0]})).sort(u.idSort)),e.xlines.style("fill","none").classed("crisp",!0),e.ylines.style("fill","none").classed("crisp",!0)}function g(t,e){if(t){var r={};for(var a in t.each((function(t){var a=t[0];n.select(this).remove(),y(a,e),r[a]=!0})),e._plots)for(var i=e._plots[a].overlays||[],o=0;o<i.length;o++){var s=i[o];r[s.id]&&s.plot.selectAll(".trace").remove()}}}function y(t,e){e._draggers.selectAll("g."+t).remove(),e._defs.select("#clip"+e._uid+t+"plot").remove()}r.name="cartesian",r.attr=["xaxis","yaxis"],r.idRoot=["x","y"],r.idRegex=c.idRegex,r.attrRegex=c.attrRegex,r.attributes=t("./attributes"),r.layoutAttributes=t("./layout_attributes"),r.supplyLayoutDefaults=t("./layout_defaults"),r.transitionAxes=t("./transition_axes"),r.finalizeSubplots=function(t,e){var r,n,a,o=e._subplots,s=o.xaxis,l=o.yaxis,h=o.cartesian,d=h.concat(o.gl2d||[]),f={},p={};for(r=0;r<d.length;r++){var m=d[r].split("y");f[m[0]]=1,p["y"+m[1]]=1}for(r=0;r<s.length;r++)f[n=s[r]]||(a=(t[u.id2name(n)]||{}).anchor,c.idRegex.y.test(a)||(a="y"),h.push(n+a),d.push(n+a),p[a]||(p[a]=1,i.pushUnique(l,a)));for(r=0;r<l.length;r++)p[a=l[r]]||(n=(t[u.id2name(a)]||{}).anchor,c.idRegex.x.test(n)||(n="x"),h.push(n+a),d.push(n+a),f[n]||(f[n]=1,i.pushUnique(s,n)));if(!d.length){for(var g in n="",a="",t)c.attrRegex.test(g)&&("x"===g.charAt(0)?(!n||+g.substr(5)<+n.substr(5))&&(n=g):(!a||+g.substr(5)<+a.substr(5))&&(a=g));n=n?u.name2id(n):"x",a=a?u.name2id(a):"y",s.push(n),l.push(a),h.push(n+a)}},r.plot=function(t,e,r,n){var a,i=t._fullLayout,o=i._subplots.cartesian,s=t.calcdata;if(!Array.isArray(e))for(e=[],a=0;a<s.length;a++)e.push(a);for(a=0;a<o.length;a++){for(var l,u=o[a],c=i._plots[u],h=[],d=0;d<s.length;d++){var f=s[d],m=f[0].trace;m.xaxis+m.yaxis===u&&((-1!==e.indexOf(m.index)||m.carpet)&&(l&&l[0].trace.xaxis+l[0].trace.yaxis===u&&-1!==["tonextx","tonexty","tonext"].indexOf(m.fill)&&-1===h.indexOf(l)&&h.push(l),h.push(f)),l=f)}p(t,c,h,r,n)}},r.clean=function(t,e,r,n){var a,i,o,s=n._plots||{},l=e._plots||{},c=n._subplots||{};if(n._hasOnlyLargeSploms&&!e._hasOnlyLargeSploms)for(o in s)(a=s[o]).plotgroup&&a.plotgroup.remove();var h=n._has&&n._has("gl"),d=e._has&&e._has("gl");if(h&&!d)for(o in s)(a=s[o])._scene&&a._scene.destroy();if(c.xaxis&&c.yaxis){var f=u.listIds({_fullLayout:n});for(i=0;i<f.length;i++){var p=f[i];e[u.id2name(p)]||n._infolayer.selectAll(".g-"+p+"title").remove()}}var m=n._has&&n._has("cartesian"),v=e._has&&e._has("cartesian");if(m&&!v)g(n._cartesianlayer.selectAll(".subplot"),n),n._defs.selectAll(".axesclip").remove(),delete n._axisConstraintGroups;else if(c.cartesian)for(i=0;i<c.cartesian.length;i++){var _=c.cartesian[i];if(!l[_]){var x="."+_+",."+_+"-x,."+_+"-y";n._cartesianlayer.selectAll(x).remove(),y(_,n)}}},r.drawFramework=function(t){var e=t._fullLayout,r=function(t){var e,r,n,a,i,o,s=t._fullLayout,l=s._subplots.cartesian,u=l.length,c=[],h=[];for(e=0;e<u;e++){n=l[e],i=(a=s._plots[n]).xaxis,o=a.yaxis;var d=i._mainAxis,f=o._mainAxis,p=d._id+f._id,m=s._plots[p];a.overlays=[],p!==n&&m?(a.mainplot=p,a.mainplotinfo=m,h.push(n)):(a.mainplot=void 0,a.mainPlotinfo=void 0,c.push(n))}for(e=0;e<h.length;e++)n=h[e],(a=s._plots[n]).mainplotinfo.overlays.push(a);var g=c.concat(h),y=new Array(u);for(e=0;e<u;e++){n=g[e],i=(a=s._plots[n]).xaxis,o=a.yaxis;var v=[n,i.layer,o.layer,i.overlaying||"",o.overlaying||""];for(r=0;r<a.overlays.length;r++)v.push(a.overlays[r].id);y[e]=v}return y}(t),a=e._cartesianlayer.selectAll(".subplot").data(r,String);a.enter().append("g").attr("class",(function(t){return"subplot "+t[0]})),a.order(),a.exit().call(g,e),a.each((function(r){var a=r[0],i=e._plots[a];i.plotgroup=n.select(this),m(t,i),i.draglayer=d(e._draggers,"g",a)}))},r.rangePlot=function(t,e,r){m(t,e),p(t,e,r),o.style(t)},r.toSVG=function(t){var e=t._fullLayout._glimages,r=n.select(t).selectAll(".svg-container");r.filter((function(t,e){return e===r.size()-1})).selectAll(".gl-canvas-context, .gl-canvas-focus").each((function(){var t=this.toDataURL("image/png");e.append("svg:image").attr({xmlns:h.svg,"xlink:href":t,preserveAspectRatio:"none",x:0,y:0,width:this.width,height:this.height})}))},r.updateFx=t("./graph_interact").updateFx},{"../../components/drawing":614,"../../constants/xmlns_namespaces":696,"../../lib":719,"../../registry":847,"../get_data":802,"../plots":828,"./attributes":765,"./axis_ids":770,"./constants":773,"./graph_interact":776,"./layout_attributes":779,"./layout_defaults":780,"./transition_axes":789,d3:163}],779:[function(t,e,r){var n=t("../font_attributes"),a=t("../../components/color/attributes"),i=t("../../components/drawing/attributes").dash,o=t("../../lib/extend").extendFlat,s=t("../../plot_api/plot_template").templatedArray,l=(t("../../constants/docs").FORMAT_LINK,t("../../constants/docs").DATE_FORMAT_LINK,t("./constants"));e.exports={visible:{valType:"boolean",editType:"plot"},color:{valType:"color",dflt:a.defaultLine,editType:"ticks"},title:{text:{valType:"string",editType:"ticks"},font:n({editType:"ticks"}),editType:"ticks"},type:{valType:"enumerated",values:["-","linear","log","date","category","multicategory"],dflt:"-",editType:"calc",_noTemplating:!0},autorange:{valType:"enumerated",values:[!0,!1,"reversed"],dflt:!0,editType:"axrange",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"plot"},range:{valType:"info_array",items:[{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0},{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0}],editType:"axrange",impliedEdits:{autorange:!1},anim:!0},fixedrange:{valType:"boolean",dflt:!1,editType:"calc"},scaleanchor:{valType:"enumerated",values:[l.idRegex.x.toString(),l.idRegex.y.toString()],editType:"plot"},scaleratio:{valType:"number",min:0,dflt:1,editType:"plot"},constrain:{valType:"enumerated",values:["range","domain"],dflt:"range",editType:"plot"},constraintoward:{valType:"enumerated",values:["left","center","right","top","middle","bottom"],editType:"plot"},matches:{valType:"enumerated",values:[l.idRegex.x.toString(),l.idRegex.y.toString()],editType:"calc"},tickmode:{valType:"enumerated",values:["auto","linear","array"],editType:"ticks",impliedEdits:{tick0:void 0,dtick:void 0}},nticks:{valType:"integer",min:0,dflt:0,editType:"ticks"},tick0:{valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},dtick:{valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},tickvals:{valType:"data_array",editType:"ticks"},ticktext:{valType:"data_array",editType:"ticks"},ticks:{valType:"enumerated",values:["outside","inside",""],editType:"ticks"},tickson:{valType:"enumerated",values:["labels","boundaries"],dflt:"labels",editType:"ticks"},mirror:{valType:"enumerated",values:[!0,"ticks",!1,"all","allticks"],dflt:!1,editType:"ticks+layoutstyle"},ticklen:{valType:"number",min:0,dflt:5,editType:"ticks"},tickwidth:{valType:"number",min:0,dflt:1,editType:"ticks"},tickcolor:{valType:"color",dflt:a.defaultLine,editType:"ticks"},showticklabels:{valType:"boolean",dflt:!0,editType:"ticks"},automargin:{valType:"boolean",dflt:!1,editType:"ticks"},showspikes:{valType:"boolean",dflt:!1,editType:"modebar"},spikecolor:{valType:"color",dflt:null,editType:"none"},spikethickness:{valType:"number",dflt:3,editType:"none"},spikedash:o({},i,{dflt:"dash",editType:"none"}),spikemode:{valType:"flaglist",flags:["toaxis","across","marker"],dflt:"toaxis",editType:"none"},spikesnap:{valType:"enumerated",values:["data","cursor"],dflt:"data",editType:"none"},tickfont:n({editType:"ticks"}),tickangle:{valType:"angle",dflt:"auto",editType:"ticks"},tickprefix:{valType:"string",dflt:"",editType:"ticks"},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},ticksuffix:{valType:"string",dflt:"",editType:"ticks"},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B",editType:"ticks"},separatethousands:{valType:"boolean",dflt:!1,editType:"ticks"},tickformat:{valType:"string",dflt:"",editType:"ticks"},tickformatstops:s("tickformatstop",{enabled:{valType:"boolean",dflt:!0,editType:"ticks"},dtickrange:{valType:"info_array",items:[{valType:"any",editType:"ticks"},{valType:"any",editType:"ticks"}],editType:"ticks"},value:{valType:"string",dflt:"",editType:"ticks"},editType:"ticks"}),hoverformat:{valType:"string",dflt:"",editType:"none"},showline:{valType:"boolean",dflt:!1,editType:"ticks+layoutstyle"},linecolor:{valType:"color",dflt:a.defaultLine,editType:"layoutstyle"},linewidth:{valType:"number",min:0,dflt:1,editType:"ticks+layoutstyle"},showgrid:{valType:"boolean",editType:"ticks"},gridcolor:{valType:"color",dflt:a.lightLine,editType:"ticks"},gridwidth:{valType:"number",min:0,dflt:1,editType:"ticks"},zeroline:{valType:"boolean",editType:"ticks"},zerolinecolor:{valType:"color",dflt:a.defaultLine,editType:"ticks"},zerolinewidth:{valType:"number",dflt:1,editType:"ticks"},showdividers:{valType:"boolean",dflt:!0,editType:"ticks"},dividercolor:{valType:"color",dflt:a.defaultLine,editType:"ticks"},dividerwidth:{valType:"number",dflt:1,editType:"ticks"},anchor:{valType:"enumerated",values:["free",l.idRegex.x.toString(),l.idRegex.y.toString()],editType:"plot"},side:{valType:"enumerated",values:["top","bottom","left","right"],editType:"plot"},overlaying:{valType:"enumerated",values:["free",l.idRegex.x.toString(),l.idRegex.y.toString()],editType:"plot"},layer:{valType:"enumerated",values:["above traces","below traces"],dflt:"above traces",editType:"plot"},domain:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"plot"},{valType:"number",min:0,max:1,editType:"plot"}],dflt:[0,1],editType:"plot"},position:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array","total ascending","total descending","min ascending","min descending","max ascending","max descending","sum ascending","sum descending","mean ascending","mean descending","median ascending","median descending"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},uirevision:{valType:"any",editType:"none"},editType:"calc",_deprecated:{autotick:{valType:"boolean",editType:"ticks"},title:{valType:"string",editType:"ticks"},titlefont:n({editType:"ticks"})}}},{"../../components/color/attributes":592,"../../components/drawing/attributes":613,"../../constants/docs":690,"../../lib/extend":710,"../../plot_api/plot_template":757,"../font_attributes":793,"./constants":773}],780:[function(t,e,r){var n=t("../../lib"),a=t("../../components/color"),i=t("../../plot_api/plot_template"),o=t("../layout_attributes"),s=t("./layout_attributes"),l=t("./type_defaults"),u=t("./axis_defaults"),c=t("./constraints").handleConstraintDefaults,h=t("./position_defaults"),d=t("./axis_ids"),f=d.id2name,p=d.name2id,m=t("../../registry"),g=m.traceIs,y=m.getComponentMethod;function v(t,e,r){Array.isArray(t[e])?t[e].push(r):t[e]=[r]}e.exports=function(t,e,r){var d,m,_={},x={},b={},w={},M={},k={},T={},L={},A={};for(d=0;d<r.length;d++){var S=r[d];if(g(S,"cartesian")||g(S,"gl2d")){var E,C;if(S.xaxis)v(_,E=f(S.xaxis),S);else if(S.xaxes)for(m=0;m<S.xaxes.length;m++)v(_,f(S.xaxes[m]),S);if(S.yaxis)v(_,C=f(S.yaxis),S);else if(S.yaxes)for(m=0;m<S.yaxes.length;m++)v(_,f(S.yaxes[m]),S);"funnel"===S.type?"h"===S.orientation?(E&&(x[E]=!0),C&&(T[C]=!0)):C&&(b[C]=!0):(C&&(M[C]=!0,k[C]=!0),g(S,"carpet")&&("carpet"!==S.type||S._cheater)||E&&(w[E]=!0)),"carpet"===S.type&&S._cheater&&E&&(x[E]=!0),g(S,"2dMap")&&(L[E]=!0,L[C]=!0),g(S,"oriented")&&(A["h"===S.orientation?C:E]=!0)}}var D=e._subplots,P=D.xaxis,O=D.yaxis,z=n.simpleMap(P,f),I=n.simpleMap(O,f),R=z.concat(I),F=a.background;P.length&&O.length&&(F=n.coerce(t,e,o,"plot_bgcolor"));var N,Y,j,B,H=a.combine(F,e.paper_bgcolor);function U(t,e){return n.coerce(j,B,s,t,e)}function V(t,e){return n.coerce2(j,B,s,t,e)}function W(t){return"x"===t?O:P}var G={x:W("x"),y:W("y")},q=G.x.concat(G.y);function Z(e,r){for(var n="x"===e?z:I,a=[],i=0;i<n.length;i++){var o=n[i];o===r||(t[o]||{}).overlaying||a.push(p(o))}return a}for(d=0;d<R.length;d++){Y=(N=R[d]).charAt(0),n.isPlainObject(t[N])||(t[N]={}),j=t[N],B=i.newContainer(e,N,Y+"axis");var X=_[N]||[];B._traceIndices=X.map((function(t){return t._expandedIndex})),B._annIndices=[],B._shapeIndices=[],B._imgIndices=[],B._subplotsWith=[],B._counterAxes=[],B._name=B._attr=N;var J=B._id=p(N),K=Z(Y,N),$="x"===Y&&!w[N]&&x[N]||"y"===Y&&!M[N]&&b[N],Q="y"===Y&&!k[N]&&T[N],tt={letter:Y,font:e.font,outerTicks:L[N],showGrid:!A[N],data:X,bgColor:H,calendar:e.calendar,automargin:!0,visibleDflt:$,reverseDflt:Q,splomStash:((e._splomAxes||{})[Y]||{})[J]};U("uirevision",e.uirevision),l(j,B,U,tt),u(j,B,U,tt,e);var et=V("spikecolor"),rt=V("spikethickness"),nt=V("spikedash"),at=V("spikemode"),it=V("spikesnap");U("showspikes",!!(et||rt||nt||at||it))||(delete B.spikecolor,delete B.spikethickness,delete B.spikedash,delete B.spikemode,delete B.spikesnap),h(j,B,U,{letter:Y,counterAxes:G[Y],overlayableAxes:K,grid:e.grid}),B._input=j}var ot=y("rangeslider","handleDefaults"),st=y("rangeselector","handleDefaults");for(d=0;d<z.length;d++)N=z[d],j=t[N],B=e[N],ot(t,e,N),"date"===B.type&&st(j,B,e,I,B.calendar),U("fixedrange");for(d=0;d<I.length;d++){N=I[d],j=t[N],B=e[N];var lt=e[f(B.anchor)];U("fixedrange",y("rangeslider","isVisible")(lt))}var ut=e._axisConstraintGroups=[],ct=e._axisMatchGroups=[];for(d=0;d<R.length;d++)Y=(N=R[d]).charAt(0),j=t[N],B=e[N],c(j,B,U,q,e);for(d=0;d<ct.length;d++){var ht,dt=ct[d],ft=null,pt=null;for(ht in dt)(B=e[f(ht)]).matches||(ft=B.range,pt=B.autorange);if(null===ft||null===pt)for(ht in dt){ft=(B=e[f(ht)]).range,pt=B.autorange;break}for(ht in dt)(B=e[f(ht)]).matches&&(B.range=ft.slice(),B.autorange=pt),B._matchGroup=dt;if(ut.length)for(ht in dt)for(m=0;m<ut.length;m++){var mt=ut[m];for(var gt in mt)ht===gt&&(n.warn("Axis "+gt+" is set with both a *scaleanchor* and *matches* constraint; ignoring the scale constraint."),delete mt[gt],Object.keys(mt).length<2&&ut.splice(m,1))}}}},{"../../components/color":593,"../../lib":719,"../../plot_api/plot_template":757,"../../registry":847,"../layout_attributes":819,"./axis_defaults":769,"./axis_ids":770,"./constraints":774,"./layout_attributes":779,"./position_defaults":782,"./type_defaults":790}],781:[function(t,e,r){var n=t("tinycolor2").mix,a=t("../../components/color/attributes").lightFraction,i=t("../../lib");e.exports=function(t,e,r,o){var s=(o=o||{}).dfltColor;function l(r,n){return i.coerce2(t,e,o.attributes,r,n)}var u=l("linecolor",s),c=l("linewidth");r("showline",o.showLine||!!u||!!c)||(delete e.linecolor,delete e.linewidth);var h=l("gridcolor",n(s,o.bgColor,o.blend||a).toRgbString()),d=l("gridwidth");if(r("showgrid",o.showGrid||!!h||!!d)||(delete e.gridcolor,delete e.gridwidth),!o.noZeroLine){var f=l("zerolinecolor",s),p=l("zerolinewidth");r("zeroline",o.showGrid||!!f||!!p)||(delete e.zerolinecolor,delete e.zerolinewidth)}}},{"../../components/color/attributes":592,"../../lib":719,tinycolor2:537}],782:[function(t,e,r){var n=t("fast-isnumeric"),a=t("../../lib");e.exports=function(t,e,r,i){var o,s,l,u,c=i.counterAxes||[],h=i.overlayableAxes||[],d=i.letter,f=i.grid;f&&(s=f._domains[d][f._axisMap[e._id]],o=f._anchors[e._id],s&&(l=f[d+"side"].split(" ")[0],u=f.domain[d]["right"===l||"top"===l?1:0])),s=s||[0,1],o=o||(n(t.position)?"free":c[0]||"free"),l=l||("x"===d?"bottom":"left"),u=u||0,"free"===a.coerce(t,e,{anchor:{valType:"enumerated",values:["free"].concat(c),dflt:o}},"anchor")&&r("position",u),a.coerce(t,e,{side:{valType:"enumerated",values:"x"===d?["bottom","top"]:["left","right"],dflt:l}},"side");var p=!1;if(h.length&&(p=a.coerce(t,e,{overlaying:{valType:"enumerated",values:[!1].concat(h),dflt:!1}},"overlaying")),!p){var m=r("domain",s);m[0]>m[1]-1/4096&&(e.domain=s),a.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":719,"fast-isnumeric":225}],783:[function(t,e,r){var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var a=[t.r2l(t.range[0]),t.r2l(t.range[1])],i=a[0]+(a[1]-a[0])*r;t.range=t._input.range=[t.l2r(i+(a[0]-i)*e),t.l2r(i+(a[1]-i)*e)]}},{"../../constants/alignment":688}],784:[function(t,e,r){var n=t("polybooljs"),a=t("../../registry"),i=t("../../components/color"),o=t("../../components/fx"),s=t("../../lib"),l=t("../../lib/polygon"),u=t("../../lib/throttle"),c=t("../../components/fx/helpers").makeEventData,h=t("./axis_ids").getFromId,d=t("../../lib/clear_gl_canvases"),f=t("../../plot_api/subroutines").redrawReglTraces,p=t("./constants"),m=p.MINSELECT,g=l.filter,y=l.tester;function v(t){return t._id}function _(t,e,r,n,a,i,o){var s,l,u,c,h,d,f,p,m,g=e._hoverdata,y=e._fullLayout.clickmode.indexOf("event")>-1,v=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(g)){M(t,e,i);var _=function(t,e){var r,n,a=t[0],i=-1,o=[];for(n=0;n<e.length;n++)if(r=e[n],a.fullData._expandedIndex===r.cd[0].trace._expandedIndex){if(!0===a.hoverOnBox)break;void 0!==a.pointNumber?i=a.pointNumber:void 0!==a.binNumber&&(i=a.binNumber,o=a.pointNumbers);break}return{pointNumber:i,pointNumbers:o,searchInfo:r}}(g,s=T(e,r,n,a));if(_.pointNumbers.length>0?function(t,e){var r,n,a,i=[];for(a=0;a<t.length;a++)(r=t[a]).cd[0].trace.selectedpoints&&r.cd[0].trace.selectedpoints.length>0&&i.push(r);if(1===i.length&&i[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(a=0;a<e.pointNumbers.length;a++)if(n.selectedpoints.indexOf(e.pointNumbers[a])<0)return!1;return!0}return!1}(s,_):function(t){var e,r,n=0;for(r=0;r<t.length;r++)if((e=t[r].cd[0].trace).selectedpoints){if(e.selectedpoints.length>1)return!1;if((n+=e.selectedpoints.length)>1)return!1}return 1===n}(s)&&(d=A(_))){for(o&&o.remove(),m=0;m<s.length;m++)(l=s[m])._module.selectPoints(l,!1);S(e,s),k(i),y&&e.emit("plotly_deselect",null)}else{for(f=t.shiftKey&&(void 0!==d?d:A(_)),u=function(t,e,r){return{pointNumber:t,searchInfo:e,subtract:r}}(_.pointNumber,_.searchInfo,f),c=w(i.selectionDefs.concat([u])),m=0;m<s.length;m++)if(h=E(s[m]._module.selectPoints(s[m],c),s[m]),v.length)for(var x=0;x<h.length;x++)v.push(h[x]);else v=h;S(e,s,p={points:v}),u&&i&&i.selectionDefs.push(u),o&&L(i.mergedPolygons,o),y&&e.emit("plotly_selected",p)}}}function x(t){return"pointNumber"in t&&"searchInfo"in t}function b(t){return{xmin:0,xmax:0,ymin:0,ymax:0,pts:[],contains:function(e,r,n,a){var i=t.searchInfo.cd[0].trace._expandedIndex;return a.cd[0].trace._expandedIndex===i&&n===t.pointNumber},isRect:!1,degenerate:!1,subtract:t.subtract}}function w(t){for(var e=[],r=x(t[0])?0:t[0][0][0],n=r,a=x(t[0])?0:t[0][0][1],i=a,o=0;o<t.length;o++)if(x(t[o]))e.push(b(t[o]));else{var s=l.tester(t[o]);s.subtract=t[o].subtract,e.push(s),r=Math.min(r,s.xmin),n=Math.max(n,s.xmax),a=Math.min(a,s.ymin),i=Math.max(i,s.ymax)}return{xmin:r,xmax:n,ymin:a,ymax:i,pts:[],contains:function(t,r,n,a){for(var i=!1,o=0;o<e.length;o++)e[o].contains(t,r,n,a)&&(i=!1===e[o].subtract);return i},isRect:!1,degenerate:!1}}function M(t,e,r){var n=e._fullLayout,a=r.plotinfo,i=n._lastSelectedSubplot&&n._lastSelectedSubplot===a.id,o=t.shiftKey||t.altKey;i&&o&&a.selection&&a.selection.selectionDefs&&!r.selectionDefs?(r.selectionDefs=a.selection.selectionDefs,r.mergedPolygons=a.selection.mergedPolygons):o&&a.selection||k(r),i||(C(e),n._lastSelectedSubplot=a.id)}function k(t){var e=t.plotinfo;e.selection={},e.selection.selectionDefs=t.selectionDefs=[],e.selection.mergedPolygons=t.mergedPolygons=[]}function T(t,e,r,n){var a,i,o,s=[],l=e.map(v),u=r.map(v);for(o=0;o<t.calcdata.length;o++)if(!0===(i=(a=t.calcdata[o])[0].trace).visible&&i._module&&i._module.selectPoints)if(!n||i.subplot!==n&&i.geo!==n)if("splom"===i.type&&i._xaxes[l[0]]&&i._yaxes[u[0]]){var c=f(i._module,a,e[0],r[0]);c.scene=t._fullLayout._splomScenes[i.uid],s.push(c)}else if("sankey"===i.type){var d=f(i._module,a,e[0],r[0]);s.push(d)}else{if(-1===l.indexOf(i.xaxis))continue;if(-1===u.indexOf(i.yaxis))continue;s.push(f(i._module,a,h(t,i.xaxis),h(t,i.yaxis)))}else s.push(f(i._module,a,e[0],r[0]));return s;function f(t,e,r,n){return{_module:t,cd:e,xaxis:r,yaxis:n}}}function L(t,e){var r,n,a=[];for(r=0;r<t.length;r++){var i=t[r];a.push(i.join("L")+"L"+i[0])}n=t.length>0?"M"+a.join("M")+"Z":"M0,0Z",e.attr("d",n)}function A(t){var e=t.searchInfo.cd[0].trace,r=t.pointNumber,n=t.pointNumbers,a=n.length>0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(a)>-1}function S(t,e,r){var n,i,o,s;for(n=0;n<e.length;n++){var l=e[n].cd[0].trace._fullInput,u=t._fullLayout._tracePreGUI[l.uid]||{};void 0===u.selectedpoints&&(u.selectedpoints=l._input.selectedpoints||null)}if(r){var c=r.points||[];for(n=0;n<e.length;n++)(s=e[n].cd[0].trace)._input.selectedpoints=s._fullInput.selectedpoints=[],s._fullInput!==s&&(s.selectedpoints=[]);for(n=0;n<c.length;n++){var h=c[n],p=h.data,m=h.fullData;h.pointIndices?([].push.apply(p.selectedpoints,h.pointIndices),s._fullInput!==s&&[].push.apply(m.selectedpoints,h.pointIndices)):(p.selectedpoints.push(h.pointIndex),s._fullInput!==s&&m.selectedpoints.push(h.pointIndex))}}else for(n=0;n<e.length;n++)delete(s=e[n].cd[0].trace).selectedpoints,delete s._input.selectedpoints,s._fullInput!==s&&delete s._fullInput.selectedpoints;var g=!1;for(n=0;n<e.length;n++){s=(o=(i=e[n]).cd)[0].trace,a.traceIs(s,"regl")&&(g=!0);var y=i._module,v=y.styleOnSelect||y.style;v&&(v(t,o,o[0].node3),o[0].nodeRangePlot3&&v(t,o,o[0].nodeRangePlot3))}g&&(d(t),f(t))}function E(t,e){if(Array.isArray(t))for(var r=e.cd,n=e.cd[0].trace,a=0;a<t.length;a++)t[a]=c(t[a],n,r);return t}function C(t){var e=(t._fullLayout||{})._zoomlayer;e&&e.selectAll(".select-outline").remove()}e.exports={prepSelect:function(t,e,r,a,l){var c,h,d,f,v,x,b,A=a.gd,C=A._fullLayout,D=C._zoomlayer,P=a.element.getBoundingClientRect(),O=a.plotinfo,z=O.xaxis._offset,I=O.yaxis._offset,R=e-P.left,F=r-P.top,N=R,Y=F,j="M"+R+","+F,B=a.xaxes[0]._length,H=a.yaxes[0]._length,U=a.xaxes.concat(a.yaxes),V=t.altKey;M(t,A,a),"lasso"===l&&(c=g([[R,F]],p.BENDPX));var W=D.selectAll("path.select-outline-"+O.id).data([1,2]);W.enter().append("path").attr("class",(function(t){return"select-outline select-outline-"+t+" select-outline-"+O.id})).attr("transform","translate("+z+", "+I+")").attr("d",j+"Z");var G,q=D.append("path").attr("class","zoombox-corners").style({fill:i.background,stroke:i.defaultLine,"stroke-width":1}).attr("transform","translate("+z+", "+I+")").attr("d","M0,0Z"),Z=C._uid+p.SELECTID,X=[],J=T(A,a.xaxes,a.yaxes,a.subplot);function K(t,e){return"log"===t.type?t.p2d(e):t.p2r(e)}function $(t){var e="y"===t._id.charAt(0)?1:0;return function(r){return K(t,r[e])}}function Q(t,e){return t-e}G=O.fillRangeItems?O.fillRangeItems:"select"===l?function(t,e){var r=t.range={};for(v=0;v<U.length;v++){var n=U[v],a=n._id.charAt(0);r[n._id]=[K(n,e[a+"min"]),K(n,e[a+"max"])].sort(Q)}}:function(t,e,r){var n=t.lassoPoints={};for(v=0;v<U.length;v++){var a=U[v];n[a._id]=r.filtered.map($(a))}},a.moveFn=function(t,e){N=Math.max(0,Math.min(B,t+R)),Y=Math.max(0,Math.min(H,e+F));var r=Math.abs(N-R),i=Math.abs(Y-F);if("select"===l){var o=C.selectdirection;"h"===(o="any"===C.selectdirection?i<Math.min(.6*r,m)?"h":r<Math.min(.6*i,m)?"v":"d":C.selectdirection)?((f=[[R,0],[R,H],[N,H],[N,0]]).xmin=Math.min(R,N),f.xmax=Math.max(R,N),f.ymin=Math.min(0,H),f.ymax=Math.max(0,H),q.attr("d","M"+f.xmin+","+(F-m)+"h-4v"+2*m+"h4ZM"+(f.xmax-1)+","+(F-m)+"h4v"+2*m+"h-4Z")):"v"===o?((f=[[0,F],[0,Y],[B,Y],[B,F]]).xmin=Math.min(0,B),f.xmax=Math.max(0,B),f.ymin=Math.min(F,Y),f.ymax=Math.max(F,Y),q.attr("d","M"+(R-m)+","+f.ymin+"v-4h"+2*m+"v4ZM"+(R-m)+","+(f.ymax-1)+"v4h"+2*m+"v-4Z")):"d"===o&&((f=[[R,F],[R,Y],[N,Y],[N,F]]).xmin=Math.min(R,N),f.xmax=Math.max(R,N),f.ymin=Math.min(F,Y),f.ymax=Math.max(F,Y),q.attr("d","M0,0Z"))}else"lasso"===l&&(c.addPt([N,Y]),f=c.filtered);a.selectionDefs&&a.selectionDefs.length?(d=function(t,e,r){return r?n.difference({regions:t,inverted:!1},{regions:[e],inverted:!1}).regions:n.union({regions:t,inverted:!1},{regions:[e],inverted:!1}).regions}(a.mergedPolygons,f,V),f.subtract=V,h=w(a.selectionDefs.concat([f]))):(d=[f],h=y(f)),L(d,W),u.throttle(Z,p.SELECTDELAY,(function(){var t;X=[];var e,r=[];for(v=0;v<J.length;v++)if(e=(x=J[v])._module.selectPoints(x,h),r.push(e),t=E(e,x),X.length)for(var n=0;n<t.length;n++)X.push(t[n]);else X=t;S(A,J,b={points:X}),G(b,f,c),a.gd.emit("plotly_selecting",b)}))},a.clickFn=function(t,e){var r=C.clickmode;q.remove(),u.done(Z).then((function(){if(u.clear(Z),2===t){for(W.remove(),v=0;v<J.length;v++)(x=J[v])._module.selectPoints(x,!1);S(A,J),k(a),A.emit("plotly_deselect",null)}else r.indexOf("select")>-1&&_(e,A,a.xaxes,a.yaxes,a.subplot,a,W),"event"===r&&A.emit("plotly_selected",void 0);o.click(A,e)})).catch(s.error)},a.doneFn=function(){q.remove(),u.done(Z).then((function(){u.clear(Z),a.gd.emit("plotly_selected",b),f&&a.selectionDefs&&(f.subtract=V,a.selectionDefs.push(f),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,d)),a.doneFnCompleted&&a.doneFnCompleted(X)})).catch(s.error)}},clearSelect:C,selectOnClick:_}},{"../../components/color":593,"../../components/fx":632,"../../components/fx/helpers":628,"../../lib":719,"../../lib/clear_gl_canvases":704,"../../lib/polygon":731,"../../lib/throttle":744,"../../plot_api/subroutines":758,"../../registry":847,"./axis_ids":770,"./constants":773,polybooljs:473}],785:[function(t,e,r){var n=t("d3"),a=t("fast-isnumeric"),i=t("../../lib"),o=i.cleanNumber,s=i.ms2DateTime,l=i.dateTime2ms,u=i.ensureNumber,c=i.isArrayOrTypedArray,h=t("../../constants/numerical"),d=h.FP_SAFE,f=h.BADNUM,p=h.LOG_CLIP,m=t("./constants"),g=t("./axis_ids");function y(t){return Math.pow(10,t)}function v(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",h=r.charAt(0);function _(e,r){if(e>0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],a=t.range[1];return.5*(n+a-2*p*Math.abs(n-a))}return f}function x(e,r,n){var o=l(e,n||t.calendar);if(o===f){if(!a(e))return f;e=+e;var s=Math.floor(10*i.mod(e+.05,1)),u=Math.round(e-s/10);o=l(new Date(u))+s/10}return o}function b(e,r,n){return s(e,r,n||t.calendar)}function w(e){return t._categories[Math.round(e)]}function M(e){if(v(e)){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push("number"==typeof e?String(e):e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return f}function k(e){if(t._categoriesMap)return t._categoriesMap[e]}function T(t){var e=k(t);return void 0!==e?e:a(t)?+t:void 0}function L(e){return a(e)?n.round(t._b+t._m*e,2):f}function A(e){return(e-t._b)/t._m}t.c2l="log"===t.type?_:u,t.l2c="log"===t.type?y:u,t.l2p=L,t.p2l=A,t.c2p="log"===t.type?function(t,e){return L(_(t,e))}:L,t.p2c="log"===t.type?function(t){return y(A(t))}:A,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=o,t.c2d=t.c2r=t.l2d=t.l2r=u,t.d2p=t.r2p=function(e){return t.l2p(o(e))},t.p2d=t.p2r=A,t.cleanPos=u):"log"===t.type?(t.d2r=t.d2l=function(t,e){return _(o(t),e)},t.r2d=t.r2c=function(t){return y(o(t))},t.d2c=t.r2l=o,t.c2d=t.l2r=u,t.c2r=_,t.l2d=y,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return y(A(t))},t.r2p=function(e){return t.l2p(o(e))},t.p2r=A,t.cleanPos=u):"date"===t.type?(t.d2r=t.r2d=i.identity,t.d2c=t.r2c=t.d2l=t.r2l=x,t.c2d=t.c2r=t.l2d=t.l2r=b,t.d2p=t.r2p=function(e,r,n){return t.l2p(x(e,0,n))},t.p2d=t.p2r=function(t,e,r){return b(A(t),e,r)},t.cleanPos=function(e){return i.cleanDate(e,f,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=M,t.r2d=t.c2d=t.l2d=w,t.d2r=t.d2l_noadd=T,t.r2c=function(e){var r=T(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=u,t.r2l=T,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return w(A(t))},t.r2p=t.d2p,t.p2r=A,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:u(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=w,t.d2r=t.d2l_noadd=T,t.r2c=function(e){var r=T(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=k,t.l2r=t.c2r=u,t.r2l=T,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return w(A(t))},t.r2p=t.d2p,t.p2r=A,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:u(t)},t.setupMultiCategory=function(n){var a,o,s=t._traceIndices,l=e._axisMatchGroups;if(l&&l.length&&0===t._categories.length)for(a=0;a<l.length;a++){var u=l[a];if(u[r])for(var d in u)if(d!==r){var f=e[g.id2name(d)];s=s.concat(f._traceIndices)}}var p=[[0,{}],[0,{}]],m=[];for(a=0;a<s.length;a++){var y=n[s[a]];if(h in y){var _=y[h],x=y._length||i.minRowLength(_);if(c(_[0])&&c(_[1]))for(o=0;o<x;o++){var b=_[0][o],w=_[1][o];v(b)&&v(w)&&(m.push([b,w]),b in p[0][1]||(p[0][1][b]=p[0][0]++),w in p[1][1]||(p[1][1][w]=p[1][0]++))}}}for(m.sort((function(t,e){var r=p[0][1],n=r[t[0]]-r[e[0]];if(n)return n;var a=p[1][1];return a[t[1]]-a[e[1]]})),a=0;a<m.length;a++)M(m[a])}),t.fraction2r=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return t.l2r(r+e*(n-r))},t.r2fraction=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return(t.r2l(e)-r)/(n-r)},t.cleanRange=function(e,r){r||(r={}),e||(e="range");var n,o,s=i.nestedProperty(t,e).get();if(o=(o="date"===t.type?i.dfltRange(t.calendar):"y"===h?m.DFLTRANGEY:r.dfltRange||m.DFLTRANGEX).slice(),s&&2===s.length)for("date"!==t.type||t.autorange||(s[0]=i.cleanDate(s[0],f,t.calendar),s[1]=i.cleanDate(s[1],f,t.calendar)),n=0;n<2;n++)if("date"===t.type){if(!i.isDateTime(s[n],t.calendar)){t[e]=o;break}if(t.r2l(s[0])===t.r2l(s[1])){var l=i.constrain(t.r2l(s[0]),i.MIN_MS+1e3,i.MAX_MS-1e3);s[0]=t.l2r(l-1e3),s[1]=t.l2r(l+1e3);break}}else{if(!a(s[n])){if(!a(s[1-n])){t[e]=o;break}s[n]=s[1-n]*(n?10:.1)}if(s[n]<-d?s[n]=-d:s[n]>d&&(s[n]=d),s[0]===s[1]){var u=Math.max(1,Math.abs(1e-6*s[0]));s[0]-=u,s[1]+=u}}else i.nestedProperty(t,e).set(o)},t.setScale=function(r){var n=e._size;if(t.overlaying){var a=g.getFromId({_fullLayout:e},t.overlaying);t.domain=a.domain}var i=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(i);var s=t.r2l(t[i][0],o),l=t.r2l(t[i][1],o);if("y"===h?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(s-l),t._b=-t._m*l):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(l-s),t._b=-t._m*s),!isFinite(t._m)||!isFinite(t._b)||t._length<0)throw e._replotting=!1,new Error("Something went wrong with axis scaling")},t.makeCalcdata=function(e,r){var n,a,o,s,l=t.type,u="date"===l&&e[r+"calendar"];if(r in e){if(n=e[r],s=e._length||i.minRowLength(n),i.isTypedArray(n)&&("linear"===l||"log"===l)){if(s===n.length)return n;if(n.subarray)return n.subarray(0,s)}if("multicategory"===l)return function(t,e){for(var r=new Array(e),n=0;n<e;n++){var a=(t[0]||[])[n],i=(t[1]||[])[n];r[n]=k([a,i])}return r}(n,s);for(a=new Array(s),o=0;o<s;o++)a[o]=t.d2c(n[o],0,u)}else{var c=r+"0"in e?t.d2c(e[r+"0"],0,u):0,h=e["d"+r]?Number(e["d"+r]):1;for(n=e[{x:"y",y:"x"}[r]],s=e._length||n.length,a=new Array(s),o=0;o<s;o++)a[o]=c+o*h}return a},t.isValidRange=function(e){return Array.isArray(e)&&2===e.length&&a(t.r2l(e[0]))&&a(t.r2l(e[1]))},t.isPtWithinRange=function(e,r){var n=t.c2l(e[h],null,r),a=t.r2l(t.range[0]),i=t.r2l(t.range[1]);return a<i?a<=n&&n<=i:i<=n&&n<=a},t.clearCalc=function(){var n=function(){t._categories=[],t._categoriesMap={}},a=e._axisMatchGroups;if(a&&a.length){for(var i=!1,o=0;o<a.length;o++){var s=a[o];if(s[r]){i=!0;var l=null,u=null;for(var c in s){var h=e[g.id2name(c)];if(h._categories){l=h._categories,u=h._categoriesMap;break}}l&&u?(t._categories=l,t._categoriesMap=u):n();break}}i||n()}else n();if(t._initialCategories)for(var d=0;d<t._initialCategories.length;d++)M(t._initialCategories[d])},t.sortByInitialCategories=function(){var n=[];if(t._categories=[],t._categoriesMap={},t._initialCategories)for(var a=0;a<t._initialCategories.length;a++)M(t._initialCategories[a]);n=n.concat(t._traceIndices);var i=t._matchGroup;for(var o in i)if(r!==o){var s=e[g.id2name(o)];s._categories=t._categories,s._categoriesMap=t._categoriesMap,n=n.concat(s._traceIndices)}return n};var S=e._d3locale;"date"===t.type&&(t._dateFormat=S?S.timeFormat.utc:n.time.format.utc,t._extraFormat=e._extraFormat),t._separators=e.separators,t._numFormat=S?S.numberFormat:n.format,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":695,"../../lib":719,"./axis_ids":770,"./constants":773,d3:163,"fast-isnumeric":225}],786:[function(t,e,r){var n=t("../../lib"),a=t("./layout_attributes"),i=t("../array_container_defaults");function o(t){var e=["showexponent","showtickprefix","showticksuffix"].filter((function(e){return void 0!==t[e]}));if(e.every((function(r){return t[r]===t[e[0]]}))||1===e.length)return t[e[0]]}function s(t,e){function r(r,i){return n.coerce(t,e,a.tickformatstops,r,i)}r("enabled")&&(r("dtickrange"),r("value"))}e.exports=function(t,e,r,l,u,c){c&&1!==c.pass||function(t,e,r,n,a){var i=o(t);r("tickprefix")&&r("showtickprefix",i),r("ticksuffix",a.tickSuffixDflt)&&r("showticksuffix",i)}(t,0,r,0,u),c&&2!==c.pass||function(t,e,r,l,u){var c=o(t);if(r("tickprefix")&&r("showtickprefix",c),r("ticksuffix",u.tickSuffixDflt)&&r("showticksuffix",c),r("showticklabels")){var h=u.font||{},d=e.color,f=d&&d!==a.color.dflt?d:h.color;if(n.coerceFont(r,"tickfont",{family:h.family,size:h.size,color:f}),r("tickangle"),"category"!==l){var p=r("tickformat"),m=t.tickformatstops;Array.isArray(m)&&m.length&&i(t,e,{name:"tickformatstops",inclusionAttr:"enabled",handleItemDefaults:s}),p||"date"===l||(r("showexponent",c),r("exponentformat"),r("separatethousands"))}}}(t,e,r,l,u)}},{"../../lib":719,"../array_container_defaults":763,"./layout_attributes":779}],787:[function(t,e,r){var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r,i){var o=n.coerce2(t,e,a,"ticklen"),s=n.coerce2(t,e,a,"tickwidth"),l=n.coerce2(t,e,a,"tickcolor",e.color);r("ticks",i.outerTicks||o||s||l?"outside":"")||(delete e.ticklen,delete e.tickwidth,delete e.tickcolor)}},{"../../lib":719,"./layout_attributes":779}],788:[function(t,e,r){var n=t("./clean_ticks");e.exports=function(t,e,r,a){var i;if("auto"===(i="array"!==t.tickmode||"log"!==a&&"date"!==a?r("tickmode",Array.isArray(t.tickvals)?"array":t.dtick?"linear":"auto"):e.tickmode="auto"))r("nticks");else if("linear"===i){var o=e.dtick=n.dtick(t.dtick,a);e.tick0=n.tick0(t.tick0,a,e.calendar,o)}else"multicategory"!==a&&(void 0===r("tickvals")?e.tickmode="auto":r("ticktext"))}},{"./clean_ticks":772}],789:[function(t,e,r){var n=t("d3"),a=t("../../registry"),i=t("../../components/drawing"),o=t("./axes");e.exports=function(t,e,r,s){var l=t._fullLayout;if(0!==e.length){var u,c,h,d;s&&(u=s());var f=n.ease(r.easing);return t._transitionData._interruptCallbacks.push((function(){return window.cancelAnimationFrame(d),d=null,function(){for(var r={},n=0;n<e.length;n++){var i=e[n];i.xr0&&(r[i.plotinfo.xaxis._name+".range"]=i.xr0.slice()),i.yr0&&(r[i.plotinfo.yaxis._name+".range"]=i.yr0.slice())}return a.call("relayout",t,r).then((function(){for(var t=0;t<e.length;t++)p(e[t].plotinfo)}))}()})),c=Date.now(),d=window.requestAnimationFrame((function n(){h=Date.now();for(var i=Math.min(1,(h-c)/r.duration),o=f(i),s=0;s<e.length;s++)m(e[s],o);h-c>r.duration?(function(){for(var r={},n=0;n<e.length;n++){var i=e[n];i.xr1&&(r[i.plotinfo.xaxis._name+".range"]=i.xr1.slice()),i.yr1&&(r[i.plotinfo.yaxis._name+".range"]=i.yr1.slice())}u&&u(),a.call("relayout",t,r).then((function(){for(var t=0;t<e.length;t++)p(e[t].plotinfo)}))}(),d=window.cancelAnimationFrame(n)):d=window.requestAnimationFrame(n)})),Promise.resolve()}function p(t){var e=t.xaxis,r=t.yaxis;l._defs.select("#"+t.clipId+"> rect").call(i.setTranslate,0,0).call(i.setScale,1,1),t.plot.call(i.setTranslate,e._offset,r._offset).call(i.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(i.setPointGroupScale,1,1),n.selectAll(".textpoint").call(i.setTextPointsScale,1,1),n.call(i.hideOutsideRangePoints,t)}function m(e,r){var n=e.plotinfo,a=n.xaxis,s=n.yaxis,l=e.xr0,u=e.xr1,c=a._length,h=e.yr0,d=e.yr1,f=s._length,p=!!u,m=!!d,g=[];if(p){var y=l[1]-l[0],v=u[1]-u[0];g[0]=(l[0]*(1-r)+r*u[0]-l[0])/(l[1]-l[0])*c,g[2]=c*(1-r+r*v/y),a.range[0]=l[0]*(1-r)+r*u[0],a.range[1]=l[1]*(1-r)+r*u[1]}else g[0]=0,g[2]=c;if(m){var _=h[1]-h[0],x=d[1]-d[0];g[1]=(h[1]*(1-r)+r*d[1]-h[1])/(h[0]-h[1])*f,g[3]=f*(1-r+r*x/_),s.range[0]=h[0]*(1-r)+r*d[0],s.range[1]=h[1]*(1-r)+r*d[1]}else g[1]=0,g[3]=f;o.drawOne(t,a,{skipTitle:!0}),o.drawOne(t,s,{skipTitle:!0}),o.redrawComponents(t,[a._id,s._id]);var b=p?c/g[2]:1,w=m?f/g[3]:1,M=p?g[0]:0,k=m?g[1]:0,T=p?g[0]/g[2]*c:0,L=m?g[1]/g[3]*f:0,A=a._offset-T,S=s._offset-L;n.clipRect.call(i.setTranslate,M,k).call(i.setScale,1/b,1/w),n.plot.call(i.setTranslate,A,S).call(i.setScale,b,w),i.setPointGroupScale(n.zoomScalePts,1/b,1/w),i.setTextPointsScale(n.zoomScaleTxt,1/b,1/w)}o.redrawComponents(t)}},{"../../components/drawing":614,"../../registry":847,"./axes":767,d3:163}],790:[function(t,e,r){var n=t("../../registry").traceIs,a=t("./axis_autotype");function i(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=i(t),a=n(t,"box-violin"),o=n(t._fullInput||{},"candlestick");return a&&!o&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}e.exports=function(t,e,r,s){"-"===r("type",(s.splomStash||{}).type)&&(function(t,e){if("-"===t.type){var r=t._id,s=r.charAt(0);-1!==r.indexOf("scene")&&(r=s);var l=function(t,e,r){for(var n=0;n<t.length;n++){var a=t[n];if("splom"===a.type&&a._length>0&&(a["_"+r+"axes"]||{})[e])return a;if((a[r+"axis"]||r)===e){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(e,r,s);if(l)if("histogram"!==l.type||s!=={v:"y",h:"x"}[l.orientation||"v"]){var u,c=s+"calendar",h=l[c],d={noMultiCategory:!n(l,"cartesian")||n(l,"noMultiCategory")};if(o(l,s)){var f=i(l),p=[];for(u=0;u<e.length;u++){var m=e[u];n(m,"box-violin")&&(m[s+"axis"]||s)===r&&(void 0!==m[f]?p.push(m[f][0]):void 0!==m.name?p.push(m.name):p.push("text"),m[c]!==h&&(h=void 0))}t.type=a(p,h,d)}else if("splom"===l.type){var g=l.dimensions[l._axesDim[r]];g.visible&&(t.type=a(g.values,h,d))}else t.type=a(l[s]||[l[s+"0"]],h,d)}else t.type="linear"}}(e,s.data),"-"===e.type?e.type="linear":t.type=e.type)}},{"../../registry":847,"./axis_autotype":768}],791:[function(t,e,r){var n=t("../registry"),a=t("../lib");function i(t,e,r){var n,i,o,s=!1;if("data"===e.type)n=t._fullData[null!==e.traces?e.traces[0]:0];else{if("layout"!==e.type)return!1;n=t._fullLayout}return i=a.nestedProperty(n,e.prop).get(),(o=r[e.type]=r[e.type]||{}).hasOwnProperty(e.prop)&&o[e.prop]!==i&&(s=!0),o[e.prop]=i,{changed:s,value:i}}function o(t,e){var r=[],n=e[0],i={};if("string"==typeof n)i[n]=e[1];else{if(!a.isPlainObject(n))return r;i=n}return l(i,(function(t,e,n){r.push({type:"layout",prop:t,value:n})}),"",0),r}function s(t,e){var r,n,i,o,s=[];if(n=e[0],i=e[1],r=e[2],o={},"string"==typeof n)o[n]=i;else{if(!a.isPlainObject(n))return s;o=n,void 0===r&&(r=i)}return void 0===r&&(r=null),l(o,(function(e,n,a){var i,o;if(Array.isArray(a)){o=a.slice();var l=Math.min(o.length,t.data.length);r&&(l=Math.min(l,r.length)),i=[];for(var u=0;u<l;u++)i[u]=r?r[u]:u}else o=a,i=r?r.slice():null;if(null===i)Array.isArray(o)&&(o=o[0]);else if(Array.isArray(i)){if(!Array.isArray(o)){var c=o;o=[];for(var h=0;h<i.length;h++)o[h]=c}o.length=Math.min(i.length,o.length)}s.push({type:"data",prop:e,traces:i,value:o})}),"",0),s}function l(t,e,r,n){Object.keys(t).forEach((function(i){var o=t[i];if("_"!==i[0]){var s=r+(n>0?".":"")+i;a.isPlainObject(o)?l(o,e,s,n+1):e(s,i,o)}}))}r.manageCommandObserver=function(t,e,n,o){var s={},l=!0;e&&e._commandObserver&&(s=e._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var u=r.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(e&&e._commandObserver){if(u)return s;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,s}if(u){i(t,u,s.cache),s.check=function(){if(l){var e=i(t,u,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:u.type,prop:u.prop,traces:u.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],h=0;h<c.length;h++)t._internalOn(c[h],s.check);s.remove=function(){for(var e=0;e<c.length;e++)t._removeInternalListener(c[e],s.check)}}else a.log("Unable to automatically bind plot updates to API command"),s.lookupTable={},s.remove=function(){};return s.disable=function(){l=!1},s.enable=function(){l=!0},e&&(e._commandObserver=s),s},r.hasSimpleAPICommandBindings=function(t,e,n){var a,i,o=e.length;for(a=0;a<o;a++){var s,l=e[a],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(i){if((s=h[0]).type!==i.type)return!1;if(s.prop!==i.prop)return!1;if(Array.isArray(i.traces)){if(!Array.isArray(s.traces))return!1;s.traces.sort();for(var d=0;d<i.traces.length;d++)if(i.traces[d]!==s.traces[d])return!1}else if(s.prop!==i.prop)return!1}else i=h[0],Array.isArray(i.traces)&&i.traces.sort();var f=(s=h[0]).value;if(Array.isArray(f)){if(1!==f.length)return!1;f=f[0]}n&&(n[f]=a)}return i},r.executeAPICommand=function(t,e,r){if("skip"===e)return Promise.resolve();var i=n.apiMethodRegistry[e],o=[t];Array.isArray(r)||(r=[]);for(var s=0;s<r.length;s++)o.push(r[s]);return i.apply(null,o).catch((function(t){return a.warn("API call to Plotly."+e+" rejected.",t),Promise.reject(t)}))},r.computeAPICommandBindings=function(t,e,r){var n;switch(Array.isArray(r)||(r=[]),e){case"restyle":n=s(t,r);break;case"relayout":n=o(0,r);break;case"update":n=s(t,[r[0],r[2]]).concat(o(0,[r[1]]));break;case"animate":n=function(t,e){return Array.isArray(e[0])&&1===e[0].length&&-1!==["string","number"].indexOf(typeof e[0][0])?[{type:"layout",prop:"_currentFrame",value:e[0][0].toString()}]:[]}(0,r);break;default:n=[]}return n}},{"../lib":719,"../registry":847}],792:[function(t,e,r){var n=t("../lib/extend").extendFlat;r.attributes=function(t,e){e=e||{};var r={valType:"info_array",editType:(t=t||{}).editType,items:[{valType:"number",min:0,max:1,editType:t.editType},{valType:"number",min:0,max:1,editType:t.editType}],dflt:[0,1]},a=(t.name&&t.name,t.trace,e.description&&e.description,{x:n({},r,{}),y:n({},r,{}),editType:t.editType});return t.noGridCell||(a.row={valType:"integer",min:0,dflt:0,editType:t.editType},a.column={valType:"integer",min:0,dflt:0,editType:t.editType}),a},r.defaults=function(t,e,r,n){var a=n&&n.x||[0,1],i=n&&n.y||[0,1],o=e.grid;if(o){var s=r("domain.column");void 0!==s&&(s<o.columns?a=o._domains.x[s]:delete t.domain.column);var l=r("domain.row");void 0!==l&&(l<o.rows?i=o._domains.y[l]:delete t.domain.row)}r("domain.x",a),r("domain.y",i)}},{"../lib/extend":710}],793:[function(t,e,r){e.exports=function(t){var e=t.editType,r=t.colorEditType;void 0===r&&(r=e);var n={family:{valType:"string",noBlank:!0,strict:!0,editType:e},size:{valType:"number",min:1,editType:e},color:{valType:"color",editType:r},editType:e};return t.arrayOk&&(n.family.arrayOk=!0,n.size.arrayOk=!0,n.color.arrayOk=!0),n}},{}],794:[function(t,e,r){e.exports={_isLinkedToArray:"frames_entry",group:{valType:"string"},name:{valType:"string"},traces:{valType:"any"},baseframe:{valType:"string"},data:{valType:"any"},layout:{valType:"any"}}},{}],795:[function(t,e,r){r.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"},r.axesNames=["lonaxis","lataxis"],r.lonaxisSpan={orthographic:180,"azimuthal equal area":360,"azimuthal equidistant":360,"conic conformal":180,gnomonic:160,stereographic:180,"transverse mercator":180,"*":360},r.lataxisSpan={"conic conformal":150,stereographic:179.5,"*":180},r.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,85],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]}},r.clipPad=.001,r.precision=.1,r.landColor="#F0DC82",r.waterColor="#3399FF",r.locationmodeToLayer={"ISO-3":"countries","USA-states":"subunits","country names":"countries"},r.sphereSVG={type:"Sphere"},r.fillLayers={ocean:1,land:1,lakes:1},r.lineLayers={subunits:1,countries:1,coastlines:1,rivers:1,frame:1},r.layers=["bg","ocean","land","lakes","subunits","countries","coastlines","rivers","lataxis","lonaxis","frame","backplot","frontplot"],r.layersForChoropleth=["bg","ocean","land","subunits","countries","coastlines","lataxis","lonaxis","frame","backplot","rivers","lakes","frontplot"],r.layerNameToAdjective={ocean:"ocean",land:"land",lakes:"lake",subunits:"subunit",countries:"country",coastlines:"coastline",rivers:"river",frame:"frame"}},{}],796:[function(t,e,r){var n=t("d3"),a=t("../../registry"),i=t("../../lib"),o=t("../../components/color"),s=t("../../components/drawing"),l=t("../../components/fx"),u=t("../plots"),c=t("../cartesian/axes"),h=t("../../components/dragelement"),d=t("../cartesian/select").prepSelect,f=t("../cartesian/select").selectOnClick,p=t("./zoom"),m=t("./constants"),g=t("../../lib/topojson_utils"),y=t("topojson-client").feature;function v(t){this.id=t.id,this.graphDiv=t.graphDiv,this.container=t.container,this.topojsonURL=t.topojsonURL,this.isStatic=t.staticPlot,this.topojsonName=null,this.topojson=null,this.projection=null,this.scope=null,this.viewInitial=null,this.fitScale=null,this.bounds=null,this.midPt=null,this.hasChoropleth=!1,this.traceHash={},this.layers={},this.basePaths={},this.dataPaths={},this.dataPoints={},this.clipDef=null,this.clipRect=null,this.bgRect=null,this.makeFramework()}t("./projections")(n);var _=v.prototype;e.exports=function(t){return new v(t)},_.plot=function(t,e,r){var n=this,a=e[this.id],i=!1;for(var o in m.layerNameToAdjective)if("frame"!==o&&a["show"+o]){i=!0;break}for(var s=0;s<t.length;s++)if(t[0][0].trace.locationmode){i=!0;break}if(!i)return n.update(t,e);var l=g.getTopojsonName(a);null===n.topojson||l!==n.topojsonName?(n.topojsonName=l,void 0===PlotlyGeoAssets.topojson[n.topojsonName]?r.push(n.fetchTopojson().then((function(r){PlotlyGeoAssets.topojson[n.topojsonName]=r,n.topojson=r,n.update(t,e)}))):(n.topojson=PlotlyGeoAssets.topojson[n.topojsonName],n.update(t,e))):n.update(t,e)},_.fetchTopojson=function(){var t=g.getTopojsonPath(this.topojsonURL,this.topojsonName);return new Promise((function(e,r){n.json(t,(function(n,a){if(n)return 404===n.status?r(new Error(["plotly.js could not find topojson file at",t,".","Make sure the *topojsonURL* plot config option","is set properly."].join(" "))):r(new Error(["unexpected error while fetching topojson file at",t].join(" ")));e(a)}))}))},_.update=function(t,e){var r=e[this.id];if(!this.updateProjection(e,r)){this.hasChoropleth=!1;for(var n=0;n<t.length;n++)if("choropleth"===t[n][0].trace.type){this.hasChoropleth=!0;break}this.viewInitial&&this.scope===r.scope||this.saveViewInitial(r),this.scope=r.scope,this.updateBaseLayers(e,r),this.updateDims(e,r),this.updateFx(e,r),u.generalUpdatePerTraceModule(this.graphDiv,this,t,r);var a=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=a.selectAll(".point"),this.dataPoints.text=a.selectAll("text"),this.dataPaths.line=a.selectAll(".js-line");var i=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=i.selectAll("path"),this.render()}},_.updateProjection=function(t,e){var r=t._size,o=e.domain,s=e.projection,l=s.rotation||{},u=e.center||{},c=this.projection=function(t){for(var e=t.projection.type,r=n.geo[m.projNames[e]](),a=t._isClipped?m.lonaxisSpan[e]/2:null,i=["center","rotate","parallels","clipExtent"],o=function(t){return t?r:[]},s=0;s<i.length;s++){var l=i[s];"function"!=typeof r[l]&&(r[l]=o)}return r.isLonLatOverEdges=function(t){if(null===r(t))return!0;if(a){var e=r.rotate();return n.geo.distance(t,[-e[0],-e[1]])>a*Math.PI/180}return!1},r.getPath=function(){return n.geo.path().projection(r)},r.getBounds=function(t){return r.getPath().bounds(t)},r.fitExtent=function(t,e){var n=t[1][0]-t[0][0],a=t[1][1]-t[0][1],i=r.clipExtent&&r.clipExtent();r.scale(150).translate([0,0]),i&&r.clipExtent(null);var o=r.getBounds(e),s=Math.min(n/(o[1][0]-o[0][0]),a/(o[1][1]-o[0][1])),l=+t[0][0]+(n-s*(o[1][0]+o[0][0]))/2,u=+t[0][1]+(a-s*(o[1][1]+o[0][1]))/2;return i&&r.clipExtent(i),r.scale(150*s).translate([l,u])},r.precision(m.precision),a&&r.clipAngle(a-m.clipPad),r}(e);c.center([u.lon-l.lon,u.lat-l.lat]).rotate([-l.lon,-l.lat,l.roll]).parallels(s.parallels);var h=[[r.l+r.w*o.x[0],r.t+r.h*(1-o.y[1])],[r.l+r.w*o.x[1],r.t+r.h*(1-o.y[0])]],d=e.lonaxis,f=e.lataxis,p=function(t,e){var r=m.clipPad,n=t[0]+r,a=t[1]-r,i=e[0]+r,o=e[1]-r;n>0&&a<0&&(a+=360);var s=(a-n)/4;return{type:"Polygon",coordinates:[[[n,i],[n,o],[n+s,o],[n+2*s,o],[n+3*s,o],[a,o],[a,i],[a-s,i],[a-2*s,i],[a-3*s,i],[n,i]]]}}(d.range,f.range);c.fitExtent(h,p);var g=this.bounds=c.getBounds(p),y=this.fitScale=c.scale(),v=c.translate();if(!isFinite(g[0][0])||!isFinite(g[0][1])||!isFinite(g[1][0])||!isFinite(g[1][1])||isNaN(v[0])||isNaN(v[0])){for(var _=this.graphDiv,x=["projection.rotation","center","lonaxis.range","lataxis.range"],b="Invalid geo settings, relayout'ing to default view.",w={},M=0;M<x.length;M++)w[this.id+"."+x[M]]=null;return this.viewInitial=null,i.warn(b),_._promises.push(a.call("relayout",_,w)),b}var k=this.midPt=[(g[0][0]+g[1][0])/2,(g[0][1]+g[1][1])/2];if(c.scale(s.scale*y).translate([v[0]+(k[0]-v[0]),v[1]+(k[1]-v[1])]).clipExtent(g),e._isAlbersUsa){var T=c([u.lon,u.lat]),L=c.translate();c.translate([L[0]-(T[0]-L[0]),L[1]-(T[1]-L[1])])}},_.updateBaseLayers=function(t,e){var r=this,a=r.topojson,i=r.layers,l=r.basePaths;function u(t){return"lonaxis"===t||"lataxis"===t}function h(t){return Boolean(m.lineLayers[t])}function d(t){return Boolean(m.fillLayers[t])}var f=(this.hasChoropleth?m.layersForChoropleth:m.layers).filter((function(t){return h(t)||d(t)?e["show"+t]:!u(t)||e[t].showgrid})),p=r.framework.selectAll(".layer").data(f,String);p.exit().each((function(t){delete i[t],delete l[t],n.select(this).remove()})),p.enter().append("g").attr("class",(function(t){return"layer "+t})).each((function(t){var e=i[t]=n.select(this);"bg"===t?r.bgRect=e.append("rect").style("pointer-events","all"):u(t)?l[t]=e.append("path").style("fill","none"):"backplot"===t?e.append("g").classed("choroplethlayer",!0):"frontplot"===t?e.append("g").classed("scatterlayer",!0):h(t)?l[t]=e.append("path").style("fill","none").style("stroke-miterlimit",2):d(t)&&(l[t]=e.append("path").style("stroke","none"))})),p.order(),p.each((function(r){var n=l[r],i=m.layerNameToAdjective[r];"frame"===r?n.datum(m.sphereSVG):h(r)||d(r)?n.datum(y(a,a.objects[r])):u(r)&&n.datum(function(t,e,r){var n,a,i,o=e[t],s=m.scopeDefaults[e.scope];"lonaxis"===t?(n=s.lonaxisRange,a=s.lataxisRange,i=function(t,e){return[t,e]}):"lataxis"===t&&(n=s.lataxisRange,a=s.lonaxisRange,i=function(t,e){return[e,t]});var l={type:"linear",range:[n[0],n[1]-1e-6],tick0:o.tick0,dtick:o.dtick};c.setConvert(l,r);var u=c.calcTicks(l);e.isScoped||"lonaxis"!==t||u.pop();for(var h=u.length,d=new Array(h),f=0;f<h;f++)for(var p=u[f].x,g=d[f]=[],y=a[0];y<a[1]+2.5;y+=2.5)g.push(i(p,y));return{type:"MultiLineString",coordinates:d}}(r,e,t)).call(o.stroke,e[r].gridcolor).call(s.dashLine,"",e[r].gridwidth),h(r)?n.call(o.stroke,e[i+"color"]).call(s.dashLine,"",e[i+"width"]):d(r)&&n.call(o.fill,e[i+"color"])}))},_.updateDims=function(t,e){var r=this.bounds,n=(e.framewidth||0)/2,a=r[0][0]-n,i=r[0][1]-n,l=r[1][0]-a+n,u=r[1][1]-i+n;s.setRect(this.clipRect,a,i,l,u),this.bgRect.call(s.setRect,a,i,l,u).call(o.fill,e.bgcolor),this.xaxis._offset=a,this.xaxis._length=l,this.yaxis._offset=i,this.yaxis._length=u},_.updateFx=function(t,e){var r=this,i=r.graphDiv,o=r.bgRect,s=t.dragmode,u=t.clickmode;if(!r.isStatic){var c;"select"===s?c=function(t,e){(t.range={})[r.id]=[g([e.xmin,e.ymin]),g([e.xmax,e.ymax])]}:"lasso"===s&&(c=function(t,e,n){(t.lassoPoints={})[r.id]=n.filtered.map(g)});var m={element:r.bgRect.node(),gd:i,plotinfo:{id:r.id,xaxis:r.xaxis,yaxis:r.yaxis,fillRangeItems:c},xaxes:[r.xaxis],yaxes:[r.yaxis],subplot:r.id,clickFn:function(e){2===e&&t._zoomlayer.selectAll(".select-outline").remove()}};"pan"===s?(o.node().onmousedown=null,o.call(p(r,e)),o.on("dblclick.zoom",(function(){var t=r.viewInitial,e={};for(var n in t)e[r.id+"."+n]=t[n];a.call("_guiRelayout",i,e),i.emit("plotly_doubleclick",null)})),i._context._scrollZoom.geo||o.on("wheel.zoom",null)):"select"!==s&&"lasso"!==s||(o.on(".zoom",null),m.prepFn=function(t,e,r){d(t,e,r,m,s)},h.init(m)),o.on("mousemove",(function(){var t=r.projection.invert(n.mouse(this));if(!t||isNaN(t[0])||isNaN(t[1]))return h.unhover(i,n.event);r.xaxis.p2c=function(){return t[0]},r.yaxis.p2c=function(){return t[1]},l.hover(i,n.event,r.id)})),o.on("mouseout",(function(){i._dragging||h.unhover(i,n.event)})),o.on("click",(function(){"select"!==s&&"lasso"!==s&&(u.indexOf("select")>-1&&f(n.event,i,[r.xaxis],[r.yaxis],r.id,m),u.indexOf("event")>-1&&l.click(i,n.event))}))}function g(t){return r.projection.invert([t[0]+r.xaxis._offset,t[1]+r.yaxis._offset])}},_.makeFramework=function(){var t=this,e=t.graphDiv,r=e._fullLayout,a="clip"+r._uid+t.id;t.clipDef=r._clips.append("clipPath").attr("id",a),t.clipRect=t.clipDef.append("rect"),t.framework=n.select(t.container).append("g").attr("class","geo "+t.id).call(s.setClipUrl,a,e),t.project=function(e){var r=t.projection(e);return r?[r[0]-t.xaxis._offset,r[1]-t.yaxis._offset]:[null,null]},t.xaxis={_id:"x",c2p:function(e){return t.project(e)[0]}},t.yaxis={_id:"y",c2p:function(e){return t.project(e)[1]}},t.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},c.setConvert(t.mockAxis,r)},_.saveViewInitial=function(t){var e=t.center||{},r=t.projection,n=r.rotation||{};t._isScoped?this.viewInitial={"center.lon":e.lon,"center.lat":e.lat,"projection.scale":r.scale}:t._isClipped?this.viewInitial={"projection.scale":r.scale,"projection.rotation.lon":n.lon,"projection.rotation.lat":n.lat}:this.viewInitial={"center.lon":e.lon,"center.lat":e.lat,"projection.scale":r.scale,"projection.rotation.lon":n.lon}},_.render=function(){var t,e=this.projection,r=e.getPath();function n(t){var r=e(t.lonlat);return r?"translate("+r[0]+","+r[1]+")":null}function a(t){return e.isLonLatOverEdges(t.lonlat)?"none":null}for(t in this.basePaths)this.basePaths[t].attr("d",r);for(t in this.dataPaths)this.dataPaths[t].attr("d",(function(t){return r(t.geojson)}));for(t in this.dataPoints)this.dataPoints[t].attr("display",a).attr("transform",n)}},{"../../components/color":593,"../../components/dragelement":611,"../../components/drawing":614,"../../components/fx":632,"../../lib":719,"../../lib/topojson_utils":746,"../../registry":847,"../cartesian/axes":767,"../cartesian/select":784,"../plots":828,"./constants":795,"./projections":800,"./zoom":801,d3:163,"topojson-client":540}],797:[function(t,e,r){var n=t("../../plots/get_data").getSubplotCalcData,a=t("../../lib").counterRegex,i=t("./geo"),o="geo",s=a(o),l={};l[o]={valType:"subplotid",dflt:o,editType:"calc"},e.exports={attr:o,name:o,idRoot:o,idRegex:s,attrRegex:s,attributes:l,layoutAttributes:t("./layout_attributes"),supplyLayoutDefaults:t("./layout_defaults"),plot:function(t){for(var e=t._fullLayout,r=t.calcdata,a=e._subplots[o],s=0;s<a.length;s++){var l=a[s],u=n(r,o,l),c=e[l]._subplot;c||(c=i({id:l,graphDiv:t,container:e._geolayer.node(),topojsonURL:t._context.topojsonURL,staticPlot:t._context.staticPlot}),e[l]._subplot=c),c.plot(u,e,t._promises)}},updateFx:function(t){for(var e=t._fullLayout,r=e._subplots[o],n=0;n<r.length;n++){var a=e[r[n]];a._subplot.updateFx(e,a)}},clean:function(t,e,r,n){for(var a=n._subplots[o]||[],i=0;i<a.length;i++){var s=a[i],l=n[s]._subplot;!e[s]&&l&&(l.framework.remove(),l.clipDef.remove())}}}},{"../../lib":719,"../../plots/get_data":802,"./geo":796,"./layout_attributes":798,"./layout_defaults":799}],798:[function(t,e,r){var n=t("../../components/color/attributes"),a=t("../domain").attributes,i=t("./constants"),o=t("../../plot_api/edit_types").overrideAll,s={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number",dflt:0},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:n.lightLine},gridwidth:{valType:"number",min:0,dflt:1}};(e.exports=o({domain:a({name:"geo"},{}),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,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},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:s,lataxis:s},"plot","from-root")).uirevision={valType:"any",editType:"none"}},{"../../components/color/attributes":592,"../../plot_api/edit_types":750,"../domain":792,"./constants":795}],799:[function(t,e,r){var n=t("../subplot_defaults"),a=t("./constants"),i=t("./layout_attributes"),o=a.axesNames;function s(t,e,r){var n=r("resolution"),i=r("scope"),s=a.scopeDefaults[i],l=r("projection.type",s.projType),u=e._isAlbersUsa="albers usa"===l;u&&(i=e.scope="usa");var c=e._isScoped="world"!==i,h=e._isConic=-1!==l.indexOf("conic");e._isClipped=!!a.lonaxisSpan[l];for(var d=0;d<o.length;d++){var f,p=o[d],m=[30,10][d];if(c)f=s[p+"Range"];else{var g=a[p+"Span"],y=(g[l]||g["*"])/2,v=r("projection.rotation."+p.substr(0,3),s.projRotate[d]);f=[v-y,v+y]}r(p+".range",f),r(p+".tick0"),r(p+".dtick",m),r(p+".showgrid")&&(r(p+".gridcolor"),r(p+".gridwidth"))}var _=e.lonaxis.range,x=e.lataxis.range,b=_[0],w=_[1];b>0&&w<0&&(w+=360);var M,k,T,L=(b+w)/2;if(!u){var A=c?s.projRotate:[L,0,0];M=r("projection.rotation.lon",A[0]),r("projection.rotation.lat",A[1]),r("projection.rotation.roll",A[2]),r("showcoastlines",!c)&&(r("coastlinecolor"),r("coastlinewidth")),r("showocean")&&r("oceancolor")}u?(k=-96.6,T=38.7):(k=c?L:M,T=(x[0]+x[1])/2),r("center.lon",k),r("center.lat",T),h&&r("projection.parallels",s.projParallels||[0,60]),r("projection.scale"),r("showland")&&r("landcolor"),r("showlakes")&&r("lakecolor"),r("showrivers")&&(r("rivercolor"),r("riverwidth")),r("showcountries",c&&"usa"!==i)&&(r("countrycolor"),r("countrywidth")),("usa"===i||"north america"===i&&50===n)&&(r("showsubunits",!0),r("subunitcolor"),r("subunitwidth")),c||r("showframe",!0)&&(r("framecolor"),r("framewidth")),r("bgcolor")}e.exports=function(t,e,r){n(t,e,r,{type:"geo",attributes:i,handleDefaults:s,partition:"y"})}},{"../subplot_defaults":842,"./constants":795,"./layout_attributes":798}],800:[function(t,e,r){e.exports=function(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(!u.hasOwnProperty(e.type))return null;var a=u[e.type];return t.geo.stream(e,n(a)),a.result()}t.geo.project=function(t,e){var a=e.stream;if(!a)throw new Error("not yet supported");return(t&&n.hasOwnProperty(t.type)?n[t.type]:r)(t,a)};var n={Feature:e,FeatureCollection:function(t,r){return{type:"FeatureCollection",features:t.features.map((function(t){return e(t,r)}))}}},a=[],i=[],o={point:function(t,e){a.push([t,e])},result:function(){var t=a.length?a.length<2?{type:"Point",coordinates:a[0]}:{type:"MultiPoint",coordinates:a}:null;return a=[],t}},s={lineStart:c,point:function(t,e){a.push([t,e])},lineEnd:function(){a.length&&(i.push(a),a=[])},result:function(){var t=i.length?i.length<2?{type:"LineString",coordinates:i[0]}:{type:"MultiLineString",coordinates:i}:null;return i=[],t}},l={polygonStart:c,lineStart:c,point:function(t,e){a.push([t,e])},lineEnd:function(){var t=a.length;if(t){do{a.push(a[0].slice())}while(++t<4);i.push(a),a=[]}},polygonEnd:c,result:function(){if(!i.length)return null;var t=[],e=[];return i.forEach((function(r){!function(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}(r)?e.push(r):t.push([r])})),e.forEach((function(e){var r=e[0];t.some((function(t){if(function(t,e){for(var r=e[0],n=e[1],a=!1,i=0,o=t.length,s=o-1;i<o;s=i++){var l=t[i],u=l[0],c=l[1],h=t[s],d=h[0],f=h[1];c>n^f>n&&r<(d-u)*(n-c)/(f-c)+u&&(a=!a)}return a}(t[0],r))return t.push(e),!0}))||t.push([e])})),i=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}},u={Point:o,MultiPoint:o,LineString:s,MultiLineString:s,Polygon:l,MultiPolygon:l,Sphere:l};function c(){}var h=1e-6,d=Math.PI,f=d/2,p=(Math.sqrt(d),d/180),m=180/d;function g(t){return t>1?f:t<-1?-f:Math.asin(t)}function y(t){return t>1?0:t<-1?d:Math.acos(t)}var v=t.geo.projection,_=t.geo.projectionMutator;function x(t,e){var r=(2+f)*Math.sin(e);e/=2;for(var n=0,a=1/0;n<10&&Math.abs(a)>h;n++){var i=Math.cos(e);e-=a=(e+Math.sin(e)*(i+2)-r)/(2*i*(1+i))}return[2/Math.sqrt(d*(4+d))*t*(1+Math.cos(e)),2*Math.sqrt(d/(4+d))*Math.sin(e)]}t.geo.interrupt=function(e){var r,n=[[[[-d,0],[0,f],[d,0]]],[[[-d,0],[0,-f],[d,0]]]];function a(t,r){for(var a=r<0?-1:1,i=n[+(r<0)],o=0,s=i.length-1;o<s&&t>i[o][2][0];++o);var l=e(t-i[o][1][0],r);return l[0]+=e(i[o][1][0],a*r>a*i[o][0][1]?i[o][0][1]:r)[0],l}e.invert&&(a.invert=function(t,i){for(var o=r[+(i<0)],s=n[+(i<0)],u=0,c=o.length;u<c;++u){var h=o[u];if(h[0][0]<=t&&t<h[1][0]&&h[0][1]<=i&&i<h[1][1]){var d=e.invert(t-e(s[u][1][0],0)[0],i);return d[0]+=s[u][1][0],l(a(d[0],d[1]),[t,i])?d:null}}});var i=t.geo.projection(a),o=i.stream;function s(t,e){for(var r,n,a,i=-1,o=t.length,s=t[0],l=[];++i<o;){n=((r=t[i])[0]-s[0])/e,a=(r[1]-s[1])/e;for(var u=0;u<e;++u)l.push([s[0]+u*n,s[1]+u*a]);s=r}return l.push(r),l}function l(t,e){return Math.abs(t[0]-e[0])<h&&Math.abs(t[1]-e[1])<h}return i.stream=function(e){var r=i.rotate(),a=o(e),l=(i.rotate([0,0]),o(e));return i.rotate(r),a.sphere=function(){t.geo.stream(function(){for(var e=1e-6,r=[],a=0,i=n[0].length;a<i;++a){var o=180*(f=n[0][a])[0][0]/d,l=180*f[0][1]/d,u=180*f[1][1]/d,c=180*f[2][0]/d,h=180*f[2][1]/d;r.push(s([[o+e,l+e],[o+e,u-e],[c-e,u-e],[c-e,h+e]],30))}for(a=n[1].length-1;a>=0;--a){var f;o=180*(f=n[1][a])[0][0]/d,l=180*f[0][1]/d,u=180*f[1][1]/d,c=180*f[2][0]/d,h=180*f[2][1]/d,r.push(s([[c-e,h-e],[c-e,u+e],[o+e,u+e],[o+e,l-e]],30))}return{type:"Polygon",coordinates:[t.merge(r)]}}(),l)},a},i.lobes=function(t){return arguments.length?(n=t.map((function(t){return t.map((function(t){return[[t[0][0]*d/180,t[0][1]*d/180],[t[1][0]*d/180,t[1][1]*d/180],[t[2][0]*d/180,t[2][1]*d/180]]}))})),r=n.map((function(t){return t.map((function(t){var r,n=e(t[0][0],t[0][1])[0],a=e(t[2][0],t[2][1])[0],i=e(t[1][0],t[0][1])[1],o=e(t[1][0],t[1][1])[1];return i>o&&(r=i,i=o,o=r),[[n,i],[a,o]]}))})),i):n.map((function(t){return t.map((function(t){return[[180*t[0][0]/d,180*t[0][1]/d],[180*t[1][0]/d,180*t[1][1]/d],[180*t[2][0]/d,180*t[2][1]/d]]}))}))},i},x.invert=function(t,e){var r=.5*e*Math.sqrt((4+d)/d),n=g(r),a=Math.cos(n);return[t/(2/Math.sqrt(d*(4+d))*(1+a)),g((n+r*(a+2))/(2+f))]},(t.geo.eckert4=function(){return v(x)}).raw=x;var b=t.geo.azimuthalEqualArea.raw;function w(t,e){if(arguments.length<2&&(e=t),1===e)return b;if(e===1/0)return M;function r(r,n){var a=b(r/e,n);return a[0]*=t,a}return r.invert=function(r,n){var a=b.invert(r/t,n);return a[0]*=e,a},r}function M(t,e){return[t*Math.cos(e)/Math.cos(e/=2),2*Math.sin(e)]}function k(t,e){return[3*t/(2*d)*Math.sqrt(d*d/3-e*e),e]}function T(t,e){return[t,1.25*Math.log(Math.tan(d/4+.4*e))]}function L(t){return function(e){var r,n=t*Math.sin(e),a=30;do{e-=r=(e+Math.sin(e)-n)/(1+Math.cos(e))}while(Math.abs(r)>h&&--a>0);return e/2}}M.invert=function(t,e){var r=2*g(e/2);return[t*Math.cos(r/2)/Math.cos(r),r]},(t.geo.hammer=function(){var t=2,e=_(w),r=e(t);return r.coefficient=function(r){return arguments.length?e(t=+r):t},r}).raw=w,k.invert=function(t,e){return[2/3*d*t/Math.sqrt(d*d/3-e*e),e]},(t.geo.kavrayskiy7=function(){return v(k)}).raw=k,T.invert=function(t,e){return[t,2.5*Math.atan(Math.exp(.8*e))-.625*d]},(t.geo.miller=function(){return v(T)}).raw=T,L(d);var A=function(t,e,r){var n=L(r);function a(r,a){return[t*r*Math.cos(a=n(a)),e*Math.sin(a)]}return a.invert=function(n,a){var i=g(a/e);return[n/(t*Math.cos(i)),g((2*i+Math.sin(2*i))/r)]},a}(Math.SQRT2/f,Math.SQRT2,d);function S(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)))]}(t.geo.mollweide=function(){return v(A)}).raw=A,S.invert=function(t,e){var r,n=e,a=25;do{var i=n*n,o=i*i;n-=r=(n*(1.007226+i*(.015085+o*(.028874*i-.044475-.005916*o)))-e)/(1.007226+i*(.045255+o*(.259866*i-.311325-.005916*11*o)))}while(Math.abs(r)>h&&--a>0);return[t/(.8707+(i=n*n)*(i*(i*i*i*(.003971-.001529*i)-.013791)-.131979)),n]},(t.geo.naturalEarth=function(){return v(S)}).raw=S;var E=[[.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]];function C(t,e){var r,n=Math.min(18,36*Math.abs(e)/d),a=Math.floor(n),i=n-a,o=(r=E[a])[0],s=r[1],l=(r=E[++a])[0],u=r[1],c=(r=E[Math.min(19,++a)])[0],h=r[1];return[t*(l+i*(c-o)/2+i*i*(c-2*l+o)/2),(e>0?f:-f)*(u+i*(h-s)/2+i*i*(h-2*u+s)/2)]}function D(t,e){return[t*Math.cos(e),e]}function P(t,e){var r,n=Math.cos(e),a=(r=y(n*Math.cos(t/=2)))?r/Math.sin(r):1;return[2*n*Math.sin(t)*a,Math.sin(e)*a]}function O(t,e){var r=P(t,e);return[(r[0]+t/f)/2,(r[1]+e)/2]}E.forEach((function(t){t[1]*=1.0144})),C.invert=function(t,e){var r=e/f,n=90*r,a=Math.min(18,Math.abs(n/5)),i=Math.max(0,Math.floor(a));do{var o=E[i][1],s=E[i+1][1],l=E[Math.min(19,i+2)][1],u=l-o,c=l-2*s+o,h=2*(Math.abs(r)-s)/u,d=c/u,g=h*(1-d*h*(1-2*d*h));if(g>=0||1===i){n=(e>=0?5:-5)*(g+a);var y,v=50;do{g=(a=Math.min(18,Math.abs(n)/5))-(i=Math.floor(a)),o=E[i][1],s=E[i+1][1],l=E[Math.min(19,i+2)][1],n-=(y=(e>=0?f:-f)*(s+g*(l-o)/2+g*g*(l-2*s+o)/2)-e)*m}while(Math.abs(y)>1e-12&&--v>0);break}}while(--i>=0);var _=E[i][0],x=E[i+1][0],b=E[Math.min(19,i+2)][0];return[t/(x+g*(b-_)/2+g*g*(b-2*x+_)/2),n*p]},(t.geo.robinson=function(){return v(C)}).raw=C,D.invert=function(t,e){return[t/Math.cos(e),e]},(t.geo.sinusoidal=function(){return v(D)}).raw=D,P.invert=function(t,e){if(!(t*t+4*e*e>d*d+h)){var r=t,n=e,a=25;do{var i,o=Math.sin(r),s=Math.sin(r/2),l=Math.cos(r/2),u=Math.sin(n),c=Math.cos(n),f=Math.sin(2*n),p=u*u,m=c*c,g=s*s,v=1-m*l*l,_=v?y(c*l)*Math.sqrt(i=1/v):i=0,x=2*_*c*s-t,b=_*u-e,w=i*(m*g+_*c*l*p),M=i*(.5*o*f-2*_*u*s),k=.25*i*(f*s-_*u*m*o),T=i*(p*l+_*g*c),L=M*k-T*w;if(!L)break;var A=(b*M-x*T)/L,S=(x*k-b*w)/L;r-=A,n-=S}while((Math.abs(A)>h||Math.abs(S)>h)&&--a>0);return[r,n]}},(t.geo.aitoff=function(){return v(P)}).raw=P,O.invert=function(t,e){var r=t,n=e,a=25;do{var i,o=Math.cos(n),s=Math.sin(n),l=Math.sin(2*n),u=s*s,c=o*o,d=Math.sin(r),p=Math.cos(r/2),m=Math.sin(r/2),g=m*m,v=1-c*p*p,_=v?y(o*p)*Math.sqrt(i=1/v):i=0,x=.5*(2*_*o*m+r/f)-t,b=.5*(_*s+n)-e,w=.5*i*(c*g+_*o*p*u)+.5/f,M=i*(d*l/4-_*s*m),k=.125*i*(l*m-_*s*c*d),T=.5*i*(u*p+_*g*o)+.5,L=M*k-T*w,A=(b*M-x*T)/L,S=(x*k-b*w)/L;r-=A,n-=S}while((Math.abs(A)>h||Math.abs(S)>h)&&--a>0);return[r,n]},(t.geo.winkel3=function(){return v(O)}).raw=O}},{}],801:[function(t,e,r){var n=t("d3"),a=t("../../lib"),i=t("../../registry"),o=Math.PI/180,s=180/Math.PI,l={cursor:"pointer"},u={cursor:"auto"};function c(t,e){return n.behavior.zoom().translate(e.translate()).scale(e.scale())}function h(t,e,r){var n=t.id,o=t.graphDiv,s=o.layout,l=s[n],u=o._fullLayout,c=u[n],h={},d={};function f(t,e){h[n+"."+t]=a.nestedProperty(l,t).get(),i.call("_storeDirectGUIEdit",s,u._preGUI,h);var r=a.nestedProperty(c,t);r.get()!==e&&(r.set(e),a.nestedProperty(l,t).set(e),d[n+"."+t]=e)}r(f),f("projection.scale",e.scale()/t.fitScale),o.emit("plotly_relayout",d)}function d(t,e){var r=c(0,e);function a(r){var n=e.invert(t.midPt);r("center.lon",n[0]),r("center.lat",n[1])}return r.on("zoomstart",(function(){n.select(this).style(l)})).on("zoom",(function(){e.scale(n.event.scale).translate(n.event.translate),t.render();var r=e.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.center.lon":r[0],"geo.center.lat":r[1]})})).on("zoomend",(function(){n.select(this).style(u),h(t,e,a)})),r}function f(t,e){var r,a,i,o,s,d,f,p,m,g=c(0,e);function y(t){return e.invert(t)}function v(r){var n=e.rotate(),a=e.invert(t.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",a[0]),r("center.lat",a[1])}return g.on("zoomstart",(function(){n.select(this).style(l),r=n.mouse(this),a=e.rotate(),i=e.translate(),o=a,s=y(r)})).on("zoom",(function(){if(d=n.mouse(this),function(t){var r=y(t);if(!r)return!0;var n=e(r);return Math.abs(n[0]-t[0])>2||Math.abs(n[1]-t[1])>2}(r))return g.scale(e.scale()),void g.translate(e.translate());e.scale(n.event.scale),e.translate([i[0],n.event.translate[1]]),s?y(d)&&(p=y(d),f=[o[0]+(p[0]-s[0]),a[1],a[2]],e.rotate(f),o=f):s=y(r=d),m=!0,t.render();var l=e.rotate(),u=e.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.center.lon":u[0],"geo.center.lat":u[1],"geo.projection.rotation.lon":-l[0]})})).on("zoomend",(function(){n.select(this).style(u),m&&h(t,e,v)})),g}function p(t,e){var r,a={r:e.rotate(),k:e.scale()},i=c(0,e),d=function(t){for(var e=0,r=arguments.length,a=[];++e<r;)a.push(arguments[e]);var i=n.dispatch.apply(null,a);return i.of=function(e,r){return function(a){var o;try{o=a.sourceEvent=n.event,a.target=t,n.event=a,i[a.type].apply(e,r)}finally{n.event=o}}},i}(i,"zoomstart","zoom","zoomend"),f=0,p=i.on;function y(t){var r=e.rotate();t("projection.rotation.lon",-r[0]),t("projection.rotation.lat",-r[1])}return i.on("zoomstart",(function(){n.select(this).style(l);var t,u,c,h,y,x,b,w,M,k,T,L=n.mouse(this),A=e.rotate(),S=A,E=e.translate(),C=(u=.5*(t=A)[0]*o,c=.5*t[1]*o,h=.5*t[2]*o,y=Math.sin(u),x=Math.cos(u),b=Math.sin(c),w=Math.cos(c),M=Math.sin(h),[x*w*(k=Math.cos(h))+y*b*M,y*w*k-x*b*M,x*b*k+y*w*M,x*w*M-y*b*k]);r=m(e,L),p.call(i,"zoom",(function(){var t,i,o,l,u,c,h,f,p,y,x=n.mouse(this);if(e.scale(a.k=n.event.scale),r){if(m(e,x)){e.rotate(A).translate(E);var b=m(e,x),w=function(t,e){if(t&&e){var r=function(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]]}(t,e),n=Math.sqrt(_(r,r)),a=.5*Math.acos(Math.max(-1,Math.min(1,_(t,e)))),i=Math.sin(a)/n;return n&&[Math.cos(a),r[2]*i,-r[1]*i,r[0]*i]}}(r,b),M=function(t){return[Math.atan2(2*(t[0]*t[1]+t[2]*t[3]),1-2*(t[1]*t[1]+t[2]*t[2]))*s,Math.asin(Math.max(-1,Math.min(1,2*(t[0]*t[2]-t[3]*t[1]))))*s,Math.atan2(2*(t[0]*t[3]+t[1]*t[2]),1-2*(t[2]*t[2]+t[3]*t[3]))*s]}((i=w,o=(t=C)[0],l=t[1],u=t[2],c=t[3],[o*(h=i[0])-l*(f=i[1])-u*(p=i[2])-c*(y=i[3]),o*f+l*h+u*y-c*p,o*p-l*y+u*h+c*f,o*y+l*p-u*f+c*h])),k=a.r=function(t,e,r){var n=v(e,2,t[0]);n=v(n,1,t[1]),n=v(n,0,t[2]-r[2]);var a,i,o=e[0],l=e[1],u=e[2],c=n[0],h=n[1],d=n[2],f=Math.atan2(l,o)*s,p=Math.sqrt(o*o+l*l);Math.abs(h)>p?(i=(h>0?90:-90)-f,a=0):(i=Math.asin(h/p)*s-f,a=Math.sqrt(p*p-h*h));var m=180-i-2*f,y=(Math.atan2(d,c)-Math.atan2(u,a))*s,_=(Math.atan2(d,c)-Math.atan2(u,-a))*s;return g(r[0],r[1],i,y)<=g(r[0],r[1],m,_)?[i,y,r[2]]:[m,_,r[2]]}(M,r,S);isFinite(k[0])&&isFinite(k[1])&&isFinite(k[2])||(k=S),e.rotate(k),S=k}}else r=m(e,L=x);d.of(this,arguments)({type:"zoom"})})),T=d.of(this,arguments),f++||T({type:"zoomstart"})})).on("zoomend",(function(){var r;n.select(this).style(u),p.call(i,"zoom",null),r=d.of(this,arguments),--f||r({type:"zoomend"}),h(t,e,y)})).on("zoom.redraw",(function(){t.render();var r=e.rotate();t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.projection.rotation.lon":-r[0],"geo.projection.rotation.lat":-r[1]})})),n.rebind(i,d,"on")}function m(t,e){var r=t.invert(e);return r&&isFinite(r[0])&&isFinite(r[1])&&function(t){var e=t[0]*o,r=t[1]*o,n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}(r)}function g(t,e,r,n){var a=y(r-t),i=y(n-e);return Math.sqrt(a*a+i*i)}function y(t){return(t%360+540)%360-180}function v(t,e,r){var n=r*o,a=t.slice(),i=0===e?1:0,s=2===e?1:2,l=Math.cos(n),u=Math.sin(n);return a[i]=t[i]*l-t[s]*u,a[s]=t[s]*l+t[i]*u,a}function _(t,e){for(var r=0,n=0,a=t.length;n<a;++n)r+=t[n]*e[n];return r}e.exports=function(t,e){var r=t.projection;return(e._isScoped?d:e._isClipped?p:f)(t,r)}},{"../../lib":719,"../../registry":847,d3:163}],802:[function(t,e,r){var n=t("../registry"),a=t("./cartesian/constants").SUBPLOT_PATTERN;r.getSubplotCalcData=function(t,e,r){var a=n.subplotsRegistry[e];if(!a)return[];for(var i=a.attr,o=[],s=0;s<t.length;s++){var l=t[s];l[0].trace[i]===r&&o.push(l)}return o},r.getModuleCalcData=function(t,e){var r,a=[],i=[];if(!(r="string"==typeof e?n.getModule(e).plot:"function"==typeof e?e:e.plot))return[a,t];for(var o=0;o<t.length;o++){var s=t[o],l=s[0].trace;!0===l.visible&&0!==l._length&&(l._module.plot===r?a.push(s):i.push(s))}return[a,i]},r.getSubplotData=function(t,e,r){if(!n.subplotsRegistry[e])return[];var i,o,s,l=n.subplotsRegistry[e].attr,u=[];if("gl2d"===e){var c=r.match(a);o="x"+c[1],s="y"+c[2]}for(var h=0;h<t.length;h++)i=t[h],"gl2d"===e&&n.traceIs(i,"gl2d")?i[l[0]]===o&&i[l[1]]===s&&u.push(i):i[l]===r&&u.push(i);return u}},{"../registry":847,"./cartesian/constants":773}],803:[function(t,e,r){var n=t("mouse-change"),a=t("mouse-wheel"),i=t("mouse-event-offset"),o=t("../cartesian/constants"),s=t("has-passive-events");function l(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]}e.exports=function(t){var e=t.mouseContainer,r=t.glplot,u=new l(e,r);function c(){t.xaxis.autorange=!1,t.yaxis.autorange=!1}function h(e,n,a){var i,s,l=t.calcDataBox(),h=r.viewBox,d=u.lastPos[0],f=u.lastPos[1],p=o.MINDRAG*r.pixelRatio,m=o.MINZOOM*r.pixelRatio;function g(e,r,n){var a=Math.min(r,n),i=Math.max(r,n);a!==i?(l[e]=a,l[e+2]=i,u.dataBox=l,t.setRanges(l)):(t.selectBox.selectBox=[0,0,1,1],t.glplot.setDirty())}switch(n*=r.pixelRatio,a*=r.pixelRatio,a=h[3]-h[1]-a,t.fullLayout.dragmode){case"zoom":if(e){var y=n/(h[2]-h[0])*(l[2]-l[0])+l[0],v=a/(h[3]-h[1])*(l[3]-l[1])+l[1];u.boxInited||(u.boxStart[0]=y,u.boxStart[1]=v,u.dragStart[0]=n,u.dragStart[1]=a),u.boxEnd[0]=y,u.boxEnd[1]=v,u.boxInited=!0,u.boxEnabled||u.boxStart[0]===u.boxEnd[0]&&u.boxStart[1]===u.boxEnd[1]||(u.boxEnabled=!0);var _=Math.abs(u.dragStart[0]-n)<m,x=Math.abs(u.dragStart[1]-a)<m;if(!function(){for(var e=t.graphDiv._fullLayout._axisConstraintGroups,r=t.xaxis._id,n=t.yaxis._id,a=0;a<e.length;a++)if(-1!==e[a][r]){if(-1!==e[a][n])return!0;break}return!1}()||_&&x)_&&(u.boxEnd[0]=u.boxStart[0]),x&&(u.boxEnd[1]=u.boxStart[1]);else{i=u.boxEnd[0]-u.boxStart[0],s=u.boxEnd[1]-u.boxStart[1];var b=(l[3]-l[1])/(l[2]-l[0]);Math.abs(i*b)>Math.abs(s)?(u.boxEnd[1]=u.boxStart[1]+Math.abs(i)*b*(s>=0?1:-1),u.boxEnd[1]<l[1]?(u.boxEnd[1]=l[1],u.boxEnd[0]=u.boxStart[0]+(l[1]-u.boxStart[1])/Math.abs(b)):u.boxEnd[1]>l[3]&&(u.boxEnd[1]=l[3],u.boxEnd[0]=u.boxStart[0]+(l[3]-u.boxStart[1])/Math.abs(b))):(u.boxEnd[0]=u.boxStart[0]+Math.abs(s)/b*(i>=0?1:-1),u.boxEnd[0]<l[0]?(u.boxEnd[0]=l[0],u.boxEnd[1]=u.boxStart[1]+(l[0]-u.boxStart[0])*Math.abs(b)):u.boxEnd[0]>l[2]&&(u.boxEnd[0]=l[2],u.boxEnd[1]=u.boxStart[1]+(l[2]-u.boxStart[0])*Math.abs(b)))}}else u.boxEnabled?(i=u.boxStart[0]!==u.boxEnd[0],s=u.boxStart[1]!==u.boxEnd[1],i||s?(i&&(g(0,u.boxStart[0],u.boxEnd[0]),t.xaxis.autorange=!1),s&&(g(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,e?(u.panning||(u.dragStart[0]=n,u.dragStart[1]=a),Math.abs(u.dragStart[0]-n)<p&&(n=u.dragStart[0]),Math.abs(u.dragStart[1]-a)<p&&(a=u.dragStart[1]),i=(d-n)*(l[2]-l[0])/(r.viewBox[2]-r.viewBox[0]),s=(f-a)*(l[3]-l[1])/(r.viewBox[3]-r.viewBox[1]),l[0]+=i,l[2]+=i,l[1]+=s,l[3]+=s,t.setRanges(l),u.panning=!0,u.lastInputTime=Date.now(),c(),t.cameraChanged(),t.handleAnnotations()):u.panning&&(u.panning=!1,t.relayoutCallback())}u.lastPos[0]=n,u.lastPos[1]=a}return u.mouseListener=n(e,h),e.addEventListener("touchstart",(function(t){var r=i(t.changedTouches[0],e);h(0,r[0],r[1]),h(1,r[0],r[1]),t.preventDefault()}),!!s&&{passive:!1}),e.addEventListener("touchmove",(function(t){t.preventDefault();var r=i(t.changedTouches[0],e);h(1,r[0],r[1]),t.preventDefault()}),!!s&&{passive:!1}),e.addEventListener("touchend",(function(t){h(0,u.lastPos[0],u.lastPos[1]),t.preventDefault()}),!!s&&{passive:!1}),u.wheelListener=a(e,(function(e,n){if(!t.scrollZoom)return!1;var a=t.calcDataBox(),i=r.viewBox,o=u.lastPos[0],s=u.lastPos[1],l=Math.exp(5*n/(i[3]-i[1])),h=o/(i[2]-i[0])*(a[2]-a[0])+a[0],d=s/(i[3]-i[1])*(a[3]-a[1])+a[1];return a[0]=(a[0]-h)*l+h,a[2]=(a[2]-h)*l+h,a[1]=(a[1]-d)*l+d,a[3]=(a[3]-d)*l+d,t.setRanges(a),u.lastInputTime=Date.now(),c(),t.cameraChanged(),t.handleAnnotations(),t.relayoutCallback(),!0}),!0),u}},{"../cartesian/constants":773,"has-passive-events":411,"mouse-change":435,"mouse-event-offset":436,"mouse-wheel":438}],804:[function(t,e,r){var n=t("../cartesian/axes"),a=t("../../lib/str2rgbarray");function i(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}var o=i.prototype,s=["xaxis","yaxis"];o.merge=function(t){var e,r,n,i,o,l,u,c,h,d,f;for(this.titleEnable=!1,this.backgroundColor=a(t.plot_bgcolor),d=0;d<2;++d){var p=(e=s[d]).charAt(0);for(n=(r=t[this.scene[e]._name]).title.text===this.scene.fullLayout._dfltTitle[p]?"":r.title.text,f=0;f<=2;f+=2)this.labelEnable[d+f]=!1,this.labels[d+f]=n,this.labelColor[d+f]=a(r.title.font.color),this.labelFont[d+f]=r.title.font.family,this.labelSize[d+f]=r.title.font.size,this.labelPad[d+f]=this.getLabelPad(e,r),this.tickEnable[d+f]=!1,this.tickColor[d+f]=a((r.tickfont||{}).color),this.tickAngle[d+f]="auto"===r.tickangle?0:Math.PI*-r.tickangle/180,this.tickPad[d+f]=this.getTickPad(r),this.tickMarkLength[d+f]=0,this.tickMarkWidth[d+f]=r.tickwidth||0,this.tickMarkColor[d+f]=a(r.tickcolor),this.borderLineEnable[d+f]=!1,this.borderLineColor[d+f]=a(r.linecolor),this.borderLineWidth[d+f]=r.linewidth||0;u=this.hasSharedAxis(r),o=this.hasAxisInDfltPos(e,r)&&!u,l=this.hasAxisInAltrPos(e,r)&&!u,i=r.mirror||!1,c=u?-1!==String(i).indexOf("all"):!!i,h=u?"allticks"===i:-1!==String(i).indexOf("ticks"),o?this.labelEnable[d]=!0:l&&(this.labelEnable[d+2]=!0),o?this.tickEnable[d]=r.showticklabels:l&&(this.tickEnable[d+2]=r.showticklabels),(o||c)&&(this.borderLineEnable[d]=r.showline),(l||c)&&(this.borderLineEnable[d+2]=r.showline),(o||h)&&(this.tickMarkLength[d]=this.getTickMarkLength(r)),(l||h)&&(this.tickMarkLength[d+2]=this.getTickMarkLength(r)),this.gridLineEnable[d]=r.showgrid,this.gridLineColor[d]=a(r.gridcolor),this.gridLineWidth[d]=r.gridwidth,this.zeroLineEnable[d]=r.zeroline,this.zeroLineColor[d]=a(r.zerolinecolor),this.zeroLineWidth[d]=r.zerolinewidth}},o.hasSharedAxis=function(t){var e=this.scene,r=e.fullLayout._subplots.gl2d;return 0!==n.findSubplotsWithAxis(r,t).indexOf(e.id)},o.hasAxisInDfltPos=function(t,e){var r=e.side;return"xaxis"===t?"bottom"===r:"yaxis"===t?"left"===r:void 0},o.hasAxisInAltrPos=function(t,e){var r=e.side;return"xaxis"===t?"top"===r:"yaxis"===t?"right"===r:void 0},o.getLabelPad=function(t,e){var r=e.title.font.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},o.getTickPad=function(t){return"outside"===t.ticks?10+t.ticklen:15},o.getTickMarkLength=function(t){if(!t.ticks)return 0;var e=t.ticklen;return"inside"===t.ticks?-e:e},e.exports=function(t){return new i(t)}},{"../../lib/str2rgbarray":742,"../cartesian/axes":767}],805:[function(t,e,r){var n=t("../../plot_api/edit_types").overrideAll,a=t("./scene2d"),i=t("../layout_attributes"),o=t("../../constants/xmlns_namespaces"),s=t("../cartesian/constants"),l=t("../cartesian"),u=t("../../components/fx/layout_attributes"),c=t("../get_data").getSubplotData;r.name="gl2d",r.attr=["xaxis","yaxis"],r.idRoot=["x","y"],r.idRegex=s.idRegex,r.attrRegex=s.attrRegex,r.attributes=t("../cartesian/attributes"),r.supplyLayoutDefaults=function(t,e,r){e._has("cartesian")||l.supplyLayoutDefaults(t,e,r)},r.layoutAttrOverrides=n(l.layoutAttributes,"plot","from-root"),r.baseLayoutAttrOverrides=n({plot_bgcolor:i.plot_bgcolor,hoverlabel:u.hoverlabel},"plot","nested"),r.plot=function(t){for(var e=t._fullLayout,r=t._fullData,n=e._subplots.gl2d,i=0;i<n.length;i++){var o=n[i],s=e._plots[o],l=c(r,"gl2d",o),u=s._scene2d;void 0===u&&(u=new a({id:o,graphDiv:t,container:t.querySelector(".gl-container"),staticPlot:t._context.staticPlot,plotGlPixelRatio:t._context.plotGlPixelRatio},e),s._scene2d=u),u.plot(l,t.calcdata,e,t.layout)}},r.clean=function(t,e,r,n){for(var a=n._subplots.gl2d||[],i=0;i<a.length;i++){var o=a[i],s=n._plots[o];s._scene2d&&0===c(t,"gl2d",o).length&&(s._scene2d.destroy(),delete n._plots[o])}l.clean.apply(this,arguments)},r.drawFramework=function(t){t._context.staticPlot||l.drawFramework(t)},r.toSVG=function(t){for(var e=t._fullLayout,r=e._subplots.gl2d,n=0;n<r.length;n++){var a=e._plots[r[n]]._scene2d,i=a.toImage("png");e._glimages.append("svg:image").attr({xmlns:o.svg,"xlink:href":i,x:0,y:0,width:"100%",height:"100%",preserveAspectRatio:"none"}),a.destroy()}},r.updateFx=function(t){for(var e=t._fullLayout,r=e._subplots.gl2d,n=0;n<r.length;n++)e._plots[r[n]]._scene2d.updateFx(e.dragmode)}},{"../../components/fx/layout_attributes":633,"../../constants/xmlns_namespaces":696,"../../plot_api/edit_types":750,"../cartesian":778,"../cartesian/attributes":765,"../cartesian/constants":773,"../get_data":802,"../layout_attributes":819,"./scene2d":806}],806:[function(t,e,r){var n,a,i=t("../../registry"),o=t("../../plots/cartesian/axes"),s=t("../../components/fx"),l=t("gl-plot2d"),u=t("gl-spikes2d"),c=t("gl-select-box"),h=t("webgl-context"),d=t("./convert"),f=t("./camera"),p=t("../../lib/show_no_webgl_msg"),m=t("../cartesian/constraints"),g=m.enforce,y=m.clean,v=t("../cartesian/autorange").doAutoRange,_=["xaxis","yaxis"],x=t("../cartesian/constants").SUBPLOT_PATTERN;function b(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.scrollZoom=this.graphDiv._context._scrollZoom.cartesian,this.fullData=null,this.updateRefs(e),this.makeFramework(),this.stopped||(this.glplotOptions=d(this),this.glplotOptions.merge(e),this.glplot=l(this.glplotOptions),this.camera=f(this),this.traces={},this.spikes=u(this.glplot),this.selectBox=c(this.glplot,{innerFill:!1,outerFill:!0}),this.lastButtonState=0,this.pickResult=null,this.isMouseOver=!0,this.stopped=!1,this.redraw=this.draw.bind(this),this.redraw())}e.exports=b;var w=b.prototype;w.makeFramework=function(){if(this.staticPlot){if(!(a||(n=document.createElement("canvas"),a=h({canvas:n,preserveDrawingBuffer:!1,premultipliedAlpha:!0,antialias:!0}))))throw new Error("Error creating static canvas/context for image server");this.canvas=n,this.gl=a}else{var t=this.container.querySelector(".gl-canvas-focus"),e=h({canvas:t,preserveDrawingBuffer:!0,premultipliedAlpha:!0});if(!e)return p(this),void(this.stopped=!0);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 i=this.svgContainer=document.createElementNS("http://www.w3.org/2000/svg","svg");i.style.position="absolute",i.style.top=i.style.left="0px",i.style.width=i.style.height="100%",i.style["z-index"]=20,i.style["pointer-events"]="none";var o=this.mouseContainer=document.createElement("div");o.style.position="absolute",o.style["pointer-events"]="auto",this.pickCanvas=this.container.querySelector(".gl-canvas-pick");var s=this.container;s.appendChild(i),s.appendChild(o);var l=this;o.addEventListener("mouseout",(function(){l.isMouseOver=!1,l.unhover()})),o.addEventListener("mouseover",(function(){l.isMouseOver=!0}))},w.toImage=function(t){t||(t="png"),this.stopped=!0,this.staticPlot&&this.container.appendChild(n),this.updateSize(this.canvas);var e=this.glplot.gl,r=e.drawingBufferWidth,a=e.drawingBufferHeight;e.clearColor(1,1,1,0),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT),this.glplot.setDirty(),this.glplot.draw(),e.bindFramebuffer(e.FRAMEBUFFER,null);var i=new Uint8Array(r*a*4);e.readPixels(0,0,r,a,e.RGBA,e.UNSIGNED_BYTE,i);for(var o=0,s=a-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=a;var d,f=h.getContext("2d"),p=f.createImageData(r,a);switch(p.data.set(i),f.putImageData(p,0,0),t){case"jpeg":d=h.toDataURL("image/jpeg");break;case"webp":d=h.toDataURL("image/webp");break;default:d=h.toDataURL("image/png")}return this.staticPlot&&this.container.removeChild(n),d},w.updateSize=function(t){t||(t=this.canvas);var e=this.pixelRatio,r=this.fullLayout,n=r.width,a=r.height,i=0|Math.ceil(e*n),o=0|Math.ceil(e*a);return t.width===i&&t.height===o||(t.width=i,t.height=o),t},w.computeTickMarks=function(){this.xaxis.setScale(),this.yaxis.setScale();for(var t=[o.calcTicks(this.xaxis),o.calcTicks(this.yaxis)],e=0;e<2;++e)for(var r=0;r<t[e].length;++r)t[e][r].text=t[e][r].text+"";return t},w.updateRefs=function(t){this.fullLayout=t;var e=this.id.match(x),r="xaxis"+e[1],n="yaxis"+e[2];this.xaxis=this.fullLayout[r],this.yaxis=this.fullLayout[n]},w.relayoutCallback=function(){var t=this.graphDiv,e=this.xaxis,r=this.yaxis,n=t.layout,a={},o=a[e._name+".range"]=e.range.slice(),s=a[r._name+".range"]=r.range.slice();a[e._name+".autorange"]=e.autorange,a[r._name+".autorange"]=r.autorange,i.call("_storeDirectGUIEdit",t.layout,t._fullLayout._preGUI,a);var l=n[e._name];l.range=o,l.autorange=e.autorange;var u=n[r._name];u.range=s,u.autorange=r.autorange,a.lastInputTime=this.camera.lastInputTime,t.emit("plotly_relayout",a)},w.cameraChanged=function(){var t=this.camera;this.glplot.setDataBox(this.calcDataBox());var e=this.computeTickMarks();(function(t,e){for(var r=0;r<2;++r){var n=t[r],a=e[r];if(n.length!==a.length)return!0;for(var i=0;i<n.length;++i)if(n[i].x!==a[i].x)return!0}return!1})(e,this.glplotOptions.ticks)&&(this.glplotOptions.ticks=e,this.glplotOptions.dataBox=t.dataBox,this.glplot.update(this.glplotOptions),this.handleAnnotations())},w.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&&i.getComponentMethod("annotations","drawOne")(t,r)}},w.destroy=function(){if(this.glplot){var t=this.traces;t&&Object.keys(t).map((function(e){t[e].dispose(),delete t[e]})),this.glplot.dispose(),this.container.removeChild(this.svgContainer),this.container.removeChild(this.mouseContainer),this.fullData=null,this.glplot=null,this.stopped=!0,this.camera.mouseListener.enabled=!1,this.mouseContainer.removeEventListener("wheel",this.camera.wheelListener),this.camera=null}},w.plot=function(t,e,r){var n=this.glplot;this.updateRefs(r),this.xaxis.clearCalc(),this.yaxis.clearCalc(),this.updateTraces(t,e),this.updateFx(r.dragmode);var a=r.width,i=r.height;this.updateSize(this.canvas);var o=this.glplotOptions;o.merge(r),o.screenBox=[0,0,a,i];var s={_fullLayout:{_axisConstraintGroups:this.graphDiv._fullLayout._axisConstraintGroups,xaxis:this.xaxis,yaxis:this.yaxis}};y(s,this.xaxis),y(s,this.yaxis);var l,u,c=r._size,h=this.xaxis.domain,d=this.yaxis.domain;for(o.viewBox=[c.l+h[0]*c.w,c.b+d[0]*c.h,a-c.r-(1-h[1])*c.w,i-c.t-(1-d[1])*c.h],this.mouseContainer.style.width=c.w*(h[1]-h[0])+"px",this.mouseContainer.style.height=c.h*(d[1]-d[0])+"px",this.mouseContainer.height=c.h*(d[1]-d[0]),this.mouseContainer.style.left=c.l+h[0]*c.w+"px",this.mouseContainer.style.top=c.t+(1-d[1])*c.h+"px",u=0;u<2;++u)(l=this[_[u]])._length=o.viewBox[u+2]-o.viewBox[u],v(this.graphDiv,l),l.setScale();g(s),o.ticks=this.computeTickMarks(),o.dataBox=this.calcDataBox(),o.merge(r),n.update(o),this.glplot.draw()},w.calcDataBox=function(){var t=this.xaxis,e=this.yaxis,r=t.range,n=e.range,a=t.r2l,i=e.r2l;return[a(r[0]),i(n[0]),a(r[1]),i(n[1])]},w.setRanges=function(t){var e=this.xaxis,r=this.yaxis,n=e.l2r,a=r.l2r;e.range=[n(t[0]),n(t[2])],r.range=[a(t[1]),a(t[3])]},w.updateTraces=function(t,e){var r,n,a,i=Object.keys(this.traces);this.fullData=t;t:for(r=0;r<i.length;r++){var o=i[r],s=this.traces[o];for(n=0;n<t.length;n++)if((a=t[n]).uid===o&&a.type===s.type)continue t;s.dispose(),delete this.traces[o]}for(r=0;r<t.length;r++){a=t[r];var l=e[r],u=this.traces[a.uid];u?u.update(a,l):(u=a._module.plot(this,a,l),this.traces[a.uid]=u)}this.glplot.objects.sort((function(t,e){return t._trace.index-e._trace.index}))},w.updateFx=function(t){"lasso"===t||"select"===t?(this.pickCanvas.style["pointer-events"]="none",this.mouseContainer.style["pointer-events"]="none"):(this.pickCanvas.style["pointer-events"]="auto",this.mouseContainer.style["pointer-events"]="auto"),this.mouseContainer.style.cursor="pan"===t?"move":"zoom"===t?"crosshair":null},w.emitPointAction=function(t,e){for(var r,n=t.trace.uid,a=t.pointIndex,i=0;i<this.fullData.length;i++)this.fullData[i].uid===n&&(r=this.fullData[i]);var o={x:t.traceCoord[0],y:t.traceCoord[1],curveNumber:r.index,pointNumber:a,data:r._input,fullData:this.fullData,xaxis:this.xaxis,yaxis:this.yaxis};s.appendArrayPointValue(o,r,a),this.graphDiv.emit(e,{points:[o]})},w.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,a=this.fullLayout;this.lastButtonState=r.buttons,this.cameraChanged();var i,o=r.x*t.pixelRatio,l=this.canvas.height-t.pixelRatio*r.y;if(e.boxEnabled&&"zoom"===a.dragmode){this.selectBox.enabled=!0;for(var u=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]&&(u[c]=t.dataBox[c],u[c+2]=t.dataBox[c+2]);t.setDirty()}else if(!e.panning&&this.isMouseOver){this.selectBox.enabled=!1;var h=a._size,d=this.xaxis.domain,f=this.yaxis.domain,p=(i=t.pick(o/t.pixelRatio+h.l+d[0]*h.w,l/t.pixelRatio-(h.t+(1-f[1])*h.h)))&&i.object._trace.handlePick(i);if(p&&n&&this.emitPointAction(p,"plotly_click"),i&&"skip"!==i.object._trace.hoverinfo&&a.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:i.dataCoord}),m.screenCoord=[((t.viewBox[2]-t.viewBox[0])*(i.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])*(i.dataCoord[1]-t.dataBox[1])/(t.dataBox[3]-t.dataBox[1])-t.viewBox[1])/t.pixelRatio],this.emitPointAction(p,"plotly_hover");var g=this.fullData[m.trace.index]||{},y=m.pointIndex,v=s.castHoverinfo(g,a,y);if(v&&"all"!==v){var _=v.split("+");-1===_.indexOf("x")&&(m.traceCoord[0]=void 0),-1===_.indexOf("y")&&(m.traceCoord[1]=void 0),-1===_.indexOf("z")&&(m.traceCoord[2]=void 0),-1===_.indexOf("text")&&(m.textLabel=void 0),-1===_.indexOf("name")&&(m.name=void 0)}s.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:s.castHoverOption(g,y,"bgcolor")||m.color,borderColor:s.castHoverOption(g,y,"bordercolor"),fontFamily:s.castHoverOption(g,y,"font.family"),fontSize:s.castHoverOption(g,y,"font.size"),fontColor:s.castHoverOption(g,y,"font.color"),nameLength:s.castHoverOption(g,y,"namelength"),textAlign:s.castHoverOption(g,y,"align")},{container:this.svgContainer,gd:this.graphDiv})}}i||this.unhover(),t.draw()}},w.unhover=function(){this.lastPickResult&&(this.spikes.update({}),this.lastPickResult=null,this.graphDiv.emit("plotly_unhover"),s.loneUnhover(this.svgContainer))},w.hoverFormatter=function(t,e){if(void 0!==e){var r=this[t];return o.tickText(r,r.c2l(e),"hover").text}}},{"../../components/fx":632,"../../lib/show_no_webgl_msg":740,"../../plots/cartesian/axes":767,"../../registry":847,"../cartesian/autorange":766,"../cartesian/constants":773,"../cartesian/constraints":774,"./camera":803,"./convert":804,"gl-plot2d":287,"gl-select-box":299,"gl-spikes2d":308,"webgl-context":556}],807:[function(t,e,r){var n=t("../../plot_api/edit_types").overrideAll,a=t("../../components/fx/layout_attributes"),i=t("./scene"),o=t("../get_data").getSubplotData,s=t("../../lib"),l=t("../../constants/xmlns_namespaces");r.name="gl3d",r.attr="scene",r.idRoot="scene",r.idRegex=r.attrRegex=s.counterRegex("scene"),r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.baseLayoutAttrOverrides=n({hoverlabel:a.hoverlabel},"plot","nested"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){for(var e=t._fullLayout,r=t._fullData,n=e._subplots.gl3d,a=0;a<n.length;a++){var s=n[a],l=o(r,"gl3d",s),u=e[s],c=u.camera,h=u._scene;h||(h=new i({id:s,graphDiv:t,container:t.querySelector(".gl-container"),staticPlot:t._context.staticPlot,plotGlPixelRatio:t._context.plotGlPixelRatio,camera:c},e),u._scene=h),h.viewInitial||(h.viewInitial={up:{x:c.up.x,y:c.up.y,z:c.up.z},eye:{x:c.eye.x,y:c.eye.y,z:c.eye.z},center:{x:c.center.x,y:c.center.y,z:c.center.z}}),h.plot(l,e,t.layout)}},r.clean=function(t,e,r,n){for(var a=n._subplots.gl3d||[],i=0;i<a.length;i++){var o=a[i];!e[o]&&n[o]._scene&&(n[o]._scene.destroy(),n._infolayer&&n._infolayer.selectAll(".annotation-"+o).remove())}},r.toSVG=function(t){for(var e=t._fullLayout,r=e._subplots.gl3d,n=e._size,a=0;a<r.length;a++){var i=e[r[a]],o=i.domain,s=i._scene,u=s.toImage("png");e._glimages.append("svg:image").attr({xmlns:l.svg,"xlink:href":u,x:n.l+n.w*o.x[0],y:n.t+n.h*(1-o.y[1]),width:n.w*(o.x[1]-o.x[0]),height:n.h*(o.y[1]-o.y[0]),preserveAspectRatio:"none"}),s.destroy()}},r.cleanId=function(t){if(t.match(/^scene[0-9]*$/)){var e=t.substr(5);return"1"===e&&(e=""),"scene"+e}},r.updateFx=function(t){for(var e=t._fullLayout,r=e._subplots.gl3d,n=0;n<r.length;n++)e[r[n]]._scene.updateFx(e.dragmode,e.hovermode)}},{"../../components/fx/layout_attributes":633,"../../constants/xmlns_namespaces":696,"../../lib":719,"../../plot_api/edit_types":750,"../get_data":802,"./layout/attributes":808,"./layout/defaults":812,"./layout/layout_attributes":813,"./scene":817}],808:[function(t,e,r){e.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}},{}],809:[function(t,e,r){var n=t("../../../components/color"),a=t("../../cartesian/layout_attributes"),i=t("../../../lib/extend").extendFlat,o=t("../../../plot_api/edit_types").overrideAll;e.exports=o({visible:a.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:a.color,categoryorder:a.categoryorder,categoryarray:a.categoryarray,title:a.title,type:i({},a.type,{values:["-","linear","log","date","category"]}),autorange:a.autorange,rangemode:a.rangemode,range:i({},a.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],anim:!1}),tickmode:a.tickmode,nticks:a.nticks,tick0:a.tick0,dtick:a.dtick,tickvals:a.tickvals,ticktext:a.ticktext,ticks:a.ticks,mirror:a.mirror,ticklen:a.ticklen,tickwidth:a.tickwidth,tickcolor:a.tickcolor,showticklabels:a.showticklabels,tickfont:a.tickfont,tickangle:a.tickangle,tickprefix:a.tickprefix,showtickprefix:a.showtickprefix,ticksuffix:a.ticksuffix,showticksuffix:a.showticksuffix,showexponent:a.showexponent,exponentformat:a.exponentformat,separatethousands:a.separatethousands,tickformat:a.tickformat,tickformatstops:a.tickformatstops,hoverformat:a.hoverformat,showline:a.showline,linecolor:a.linecolor,linewidth:a.linewidth,showgrid:a.showgrid,gridcolor:i({},a.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:a.gridwidth,zeroline:a.zeroline,zerolinecolor:a.zerolinecolor,zerolinewidth:a.zerolinewidth,_deprecated:{title:a._deprecated.title,titlefont:a._deprecated.titlefont}},"plot","from-root")},{"../../../components/color":593,"../../../lib/extend":710,"../../../plot_api/edit_types":750,"../../cartesian/layout_attributes":779}],810:[function(t,e,r){var n=t("tinycolor2").mix,a=t("../../../lib"),i=t("../../../plot_api/plot_template"),o=t("./axis_attributes"),s=t("../../cartesian/type_defaults"),l=t("../../cartesian/axis_defaults"),u=["xaxis","yaxis","zaxis"];e.exports=function(t,e,r){var c,h;function d(t,e){return a.coerce(c,h,o,t,e)}for(var f=0;f<u.length;f++){var p=u[f];c=t[p]||{},(h=i.newContainer(e,p))._id=p[0]+r.scene,h._name=p,s(c,h,d,r),l(c,h,d,{font:r.font,letter:p[0],data:r.data,showGrid:!0,noTickson:!0,bgColor:r.bgColor,calendar:r.calendar},r.fullLayout),d("gridcolor",n(h.color,r.bgColor,13600/187).toRgbString()),d("title.text",p[0]),h.setScale=a.noop,d("showspikes")&&(d("spikesides"),d("spikethickness"),d("spikecolor",h.color)),d("showaxeslabels"),d("showbackground")&&d("backgroundcolor")}}},{"../../../lib":719,"../../../plot_api/plot_template":757,"../../cartesian/axis_defaults":769,"../../cartesian/type_defaults":790,"./axis_attributes":809,tinycolor2:537}],811:[function(t,e,r){var n=t("../../../lib/str2rgbarray"),a=t("../../../lib"),i=["xaxis","yaxis","zaxis"];function o(){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.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()}o.prototype.merge=function(t,e){for(var r=0;r<3;++r){var o=e[i[r]];o.visible?(this.labels[r]=t._meta?a.templateString(o.title.text,t._meta):o.title.text,"font"in o.title&&(o.title.font.color&&(this.labelColor[r]=n(o.title.font.color)),o.title.font.family&&(this.labelFont[r]=o.title.font.family),o.title.font.size&&(this.labelSize[r]=o.title.font.size)),"showline"in o&&(this.lineEnable[r]=o.showline),"linecolor"in o&&(this.lineColor[r]=n(o.linecolor)),"linewidth"in o&&(this.lineWidth[r]=o.linewidth),"showgrid"in o&&(this.gridEnable[r]=o.showgrid),"gridcolor"in o&&(this.gridColor[r]=n(o.gridcolor)),"gridwidth"in o&&(this.gridWidth[r]=o.gridwidth),"log"===o.type?this.zeroEnable[r]=!1:"zeroline"in o&&(this.zeroEnable[r]=o.zeroline),"zerolinecolor"in o&&(this.zeroLineColor[r]=n(o.zerolinecolor)),"zerolinewidth"in o&&(this.zeroLineWidth[r]=o.zerolinewidth),"ticks"in o&&o.ticks?this.lineTickEnable[r]=!0:this.lineTickEnable[r]=!1,"ticklen"in o&&(this.lineTickLength[r]=this._defaultLineTickLength[r]=o.ticklen),"tickcolor"in o&&(this.lineTickColor[r]=n(o.tickcolor)),"tickwidth"in o&&(this.lineTickWidth[r]=o.tickwidth),"tickangle"in o&&(this.tickAngle[r]="auto"===o.tickangle?-3600:Math.PI*-o.tickangle/180),"showticklabels"in o&&(this.tickEnable[r]=o.showticklabels),"tickfont"in o&&(o.tickfont.color&&(this.tickColor[r]=n(o.tickfont.color)),o.tickfont.family&&(this.tickFont[r]=o.tickfont.family),o.tickfont.size&&(this.tickSize[r]=o.tickfont.size)),"mirror"in o?-1!==["ticks","all","allticks"].indexOf(o.mirror)?(this.lineTickMirror[r]=!0,this.lineMirror[r]=!0):!0===o.mirror?(this.lineTickMirror[r]=!1,this.lineMirror[r]=!0):(this.lineTickMirror[r]=!1,this.lineMirror[r]=!1):this.lineMirror[r]=!1,"showbackground"in o&&!1!==o.showbackground?(this.backgroundEnable[r]=!0,this.backgroundColor[r]=n(o.backgroundcolor)):this.backgroundEnable[r]=!1):(this.tickEnable[r]=!1,this.labelEnable[r]=!1,this.lineEnable[r]=!1,this.lineTickEnable[r]=!1,this.gridEnable[r]=!1,this.zeroEnable[r]=!1,this.backgroundEnable[r]=!1)}},e.exports=function(t,e){var r=new o;return r.merge(t,e),r}},{"../../../lib":719,"../../../lib/str2rgbarray":742}],812:[function(t,e,r){var n=t("../../../lib"),a=t("../../../components/color"),i=t("../../../registry"),o=t("../../subplot_defaults"),s=t("./axis_defaults"),l=t("./layout_attributes"),u=t("../../get_data").getSubplotData,c="gl3d";function h(t,e,r,n){for(var o=r("bgcolor"),l=a.combine(o,n.paper_bgcolor),h=["up","center","eye"],d=0;d<h.length;d++)r("camera."+h[d]+".x"),r("camera."+h[d]+".y"),r("camera."+h[d]+".z");r("camera.projection.type");var f=!!r("aspectratio.x")&&!!r("aspectratio.y")&&!!r("aspectratio.z"),p=r("aspectmode",f?"manual":"auto");f||(t.aspectratio=e.aspectratio={x:1,y:1,z:1},"manual"===p&&(e.aspectmode="auto"),t.aspectmode=e.aspectmode);var m=u(n.fullData,c,n.id);s(t,e,{font:n.font,scene:n.id,data:m,bgColor:l,calendar:n.calendar,fullLayout:n.fullLayout}),i.getComponentMethod("annotations3d","handleDefaults")(t,e,n);var g=n.getDfltFromLayout("dragmode");if(!1!==g&&!g)if(g="orbit",t.camera&&t.camera.up){var y=t.camera.up.x,v=t.camera.up.y,_=t.camera.up.z;0!==_&&(y&&v&&_?_/Math.sqrt(y*y+v*v+_*_)>.999&&(g="turntable"):g="turntable")}else g="turntable";r("dragmode",g),r("hovermode",n.getDfltFromLayout("hovermode"))}e.exports=function(t,e,r){var a=e._basePlotModules.length>1;o(t,e,r,{type:c,attributes:l,handleDefaults:h,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:function(e){if(!a)return n.validate(t[e],l[e])?t[e]:void 0},paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":593,"../../../lib":719,"../../../registry":847,"../../get_data":802,"../../subplot_defaults":842,"./axis_defaults":810,"./layout_attributes":813}],813:[function(t,e,r){var n=t("./axis_attributes"),a=t("../../domain").attributes,i=t("../../../lib/extend").extendFlat,o=t("../../../lib").counterRegex;function s(t,e,r){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:e,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}e.exports={_arrayAttrRegexps:[o("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:i(s(0,0,1),{}),center:i(s(0,0,0),{}),eye:i(s(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:a({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:n,yaxis:n,zaxis:n,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},{"../../../lib":719,"../../../lib/extend":710,"../../domain":792,"./axis_attributes":809}],814:[function(t,e,r){var n=t("../../../lib/str2rgbarray"),a=["xaxis","yaxis","zaxis"];function i(){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]}i.prototype.merge=function(t){for(var e=0;e<3;++e){var r=t[a[e]];r.visible?(this.enabled[e]=r.showspikes,this.colors[e]=n(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},e.exports=function(t){var e=new i;return e.merge(t),e}},{"../../../lib/str2rgbarray":742}],815:[function(t,e,r){e.exports=function(t){for(var e=t.axesOptions,r=t.glplot.axesPixels,s=t.fullSceneLayout,l=[[],[],[]],u=0;u<3;++u){var c=s[i[u]];if(c._length=(r[u].hi-r[u].lo)*r[u].pixelsPerDataUnit/t.dataScale[u],Math.abs(c._length)===1/0||isNaN(c._length))l[u]=[];else{c._input_range=c.range.slice(),c.range[0]=r[u].lo/t.dataScale[u],c.range[1]=r[u].hi/t.dataScale[u],c._m=1/(t.dataScale[u]*r[u].pixelsPerDataUnit),c.range[0]===c.range[1]&&(c.range[0]-=1,c.range[1]+=1);var h=c.tickmode;if("auto"===c.tickmode){c.tickmode="linear";var d=c.nticks||a.constrain(c._length/40,4,9);n.autoTicks(c,Math.abs(c.range[1]-c.range[0])/d)}for(var f=n.calcTicks(c),p=0;p<f.length;++p)f[p].x=f[p].x*t.dataScale[u],"date"===c.type&&(f[p].text=f[p].text.replace(/\<br\>/g," "));l[u]=f,c.tickmode=h}}for(e.ticks=l,u=0;u<3;++u)for(o[u]=.5*(t.glplot.bounds[0][u]+t.glplot.bounds[1][u]),p=0;p<2;++p)e.bounds[p][u]=t.glplot.bounds[p][u];t.contourLevels=function(t){for(var e=new Array(3),r=0;r<3;++r){for(var n=t[r],a=new Array(n.length),i=0;i<n.length;++i)a[i]=n[i].x;e[r]=a}return e}(l)};var n=t("../../cartesian/axes"),a=t("../../../lib"),i=["xaxis","yaxis","zaxis"],o=[0,0,0]},{"../../../lib":719,"../../cartesian/axes":767}],816:[function(t,e,r){function n(t,e){var r,n,a=[0,0,0,0];for(r=0;r<4;++r)for(n=0;n<4;++n)a[n]+=t[4*r+n]*e[r];return a}e.exports=function(t,e){return n(t.projection,n(t.view,n(t.model,[e[0],e[1],e[2],1])))}},{}],817:[function(t,e,r){var n,a,i=t("gl-plot3d").createCamera,o=t("gl-plot3d").createScene,s=t("webgl-context"),l=t("has-passive-events"),u=t("../../registry"),c=t("../../lib"),h=t("../../plots/cartesian/axes"),d=t("../../components/fx"),f=t("../../lib/str2rgbarray"),p=t("../../lib/show_no_webgl_msg"),m=t("./project"),g=t("./layout/convert"),y=t("./layout/spikes"),v=t("./layout/tick_marks");function _(t,e,r,i){if(t.initializeGLCamera(),!function(t,e,r,i,l){var u={canvas:i,gl:l,container:t.container,axes:t.axesOptions,spikes:t.spikeOptions,pickRadius:10,snapToData:!0,autoScale:!0,autoBounds:!1,cameraObject:e,pixelRatio:r};if(t.staticMode){if(!(a||(n=document.createElement("canvas"),a=s({canvas:n,preserveDrawingBuffer:!0,premultipliedAlpha:!0,antialias:!0}))))throw new Error("error creating static canvas/context for image server");u.pixelRatio=t.pixelRatio,u.gl=a,u.canvas=n}try{t.glplot=o(u)}catch(t){return!1}return!0}(t,t.camera,e,r,i))return p(t);var u=t.graphDiv,f=function(t){if(!1!==t.fullSceneLayout.dragmode){var e={};e[t.id+".camera"]=k(t.camera),t.saveCamera(u.layout),t.graphDiv.emit("plotly_relayout",e)}};return t.glplot.canvas.addEventListener("mouseup",(function(){f(t)})),t.glplot.canvas.addEventListener("wheel",(function(){u._context._scrollZoom.gl3d&&f(t)}),!!l&&{passive:!1}),t.glplot.canvas.addEventListener("mousemove",(function(){if(!1!==t.fullSceneLayout.dragmode&&0!==t.camera.mouseListener.buttons){var e={};e[t.id+".camera"]=k(t.camera),t.graphDiv.emit("plotly_relayouting",e)}})),t.staticMode||t.glplot.canvas.addEventListener("webglcontextlost",(function(e){u&&u.emit&&u.emit("plotly_webglcontextlost",{event:e,layer:t.id})}),!1),t.glplot.camera=t.camera,t.glplot.oncontextloss=function(){t.recoverContext()},t.glplot.onrender=function(t){var e,r=t.graphDiv,n=t.svgContainer,a=t.container.getBoundingClientRect(),i=a.width,o=a.height;n.setAttributeNS(null,"viewBox","0 0 "+i+" "+o),n.setAttributeNS(null,"width",i),n.setAttributeNS(null,"height",o),v(t),t.glplot.axes.update(t.axesOptions);for(var s,l=Object.keys(t.traces),u=null,f=t.glplot.selection,p=0;p<l.length;++p)"skip"!==(e=t.traces[l[p]]).data.hoverinfo&&e.handlePick(f)&&(u=e),e.setContourLevels&&e.setContourLevels();function g(e,r){var n=t.fullSceneLayout[e];return h.tickText(n,n.d2l(r),"hover").text}if(null!==u){var y=m(t.glplot.cameraParams,f.dataCoordinate);e=u.data;var _,x=r._fullData[e.index],b=f.index,w={xLabel:g("xaxis",f.traceCoordinate[0]),yLabel:g("yaxis",f.traceCoordinate[1]),zLabel:g("zaxis",f.traceCoordinate[2])},M=d.castHoverinfo(x,t.fullLayout,b),k=(M||"").split("+"),T=M&&"all"===M;x.hovertemplate||T||(-1===k.indexOf("x")&&(w.xLabel=void 0),-1===k.indexOf("y")&&(w.yLabel=void 0),-1===k.indexOf("z")&&(w.zLabel=void 0),-1===k.indexOf("text")&&(f.textLabel=void 0),-1===k.indexOf("name")&&(u.name=void 0));var L=[];"cone"===e.type||"streamtube"===e.type?(w.uLabel=g("xaxis",f.traceCoordinate[3]),(T||-1!==k.indexOf("u"))&&L.push("u: "+w.uLabel),w.vLabel=g("yaxis",f.traceCoordinate[4]),(T||-1!==k.indexOf("v"))&&L.push("v: "+w.vLabel),w.wLabel=g("zaxis",f.traceCoordinate[5]),(T||-1!==k.indexOf("w"))&&L.push("w: "+w.wLabel),w.normLabel=f.traceCoordinate[6].toPrecision(3),(T||-1!==k.indexOf("norm"))&&L.push("norm: "+w.normLabel),"streamtube"===e.type&&(w.divergenceLabel=f.traceCoordinate[7].toPrecision(3),(T||-1!==k.indexOf("divergence"))&&L.push("divergence: "+w.divergenceLabel)),f.textLabel&&L.push(f.textLabel),_=L.join("<br>")):"isosurface"===e.type||"volume"===e.type?(w.valueLabel=h.tickText(t.mockAxis,t.mockAxis.d2l(f.traceCoordinate[3]),"hover").text,L.push("value: "+w.valueLabel),f.textLabel&&L.push(f.textLabel),_=L.join("<br>")):_=f.textLabel;var A={x:f.traceCoordinate[0],y:f.traceCoordinate[1],z:f.traceCoordinate[2],data:x._input,fullData:x,curveNumber:x.index,pointNumber:b};d.appendArrayPointValue(A,x,b),e._module.eventData&&(A=x._module.eventData(A,f,x,{},b));var S={points:[A]};t.fullSceneLayout.hovermode&&d.loneHover({trace:x,x:(.5+.5*y[0]/y[3])*i,y:(.5-.5*y[1]/y[3])*o,xLabel:w.xLabel,yLabel:w.yLabel,zLabel:w.zLabel,text:_,name:u.name,color:d.castHoverOption(x,b,"bgcolor")||u.color,borderColor:d.castHoverOption(x,b,"bordercolor"),fontFamily:d.castHoverOption(x,b,"font.family"),fontSize:d.castHoverOption(x,b,"font.size"),fontColor:d.castHoverOption(x,b,"font.color"),nameLength:d.castHoverOption(x,b,"namelength"),textAlign:d.castHoverOption(x,b,"align"),hovertemplate:c.castOption(x,b,"hovertemplate"),hovertemplateLabels:c.extendFlat({},A,w),eventData:[A]},{container:n,gd:r}),f.buttons&&f.distance<5?r.emit("plotly_click",S):r.emit("plotly_hover",S),s=S}else d.loneUnhover(n),r.emit("plotly_unhover",s);t.drawAnnotations(t)}.bind(null,t),t.traces={},t.make4thDimension(),!0}function x(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=g(e,e[this.id]),this.spikeOptions=y(e[this.id]),this.container=r,this.staticMode=!!t.staticPlot,this.pixelRatio=this.pixelRatio||t.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],this.convertAnnotations=u.getComponentMethod("annotations3d","convert"),this.drawAnnotations=u.getComponentMethod("annotations3d","draw"),_(this,this.pixelRatio)}var b=x.prototype;b.initializeGLCamera=function(){var t=this.fullSceneLayout.camera,e="orthographic"===t.projection.type;this.camera=i(this.container,{center:[t.center.x,t.center.y,t.center.z],eye:[t.eye.x,t.eye.y,t.eye.z],up:[t.up.x,t.up.y,t.up.z],_ortho:e,zoomMin:.01,zoomMax:100,mode:"orbit"})},b.recoverContext=function(){var t=this,e=this.glplot.gl,r=this.glplot.canvas,n=this.glplot.camera,a=this.glplot.pixelRatio;this.glplot.dispose(),requestAnimationFrame((function i(){e.isContextLost()?requestAnimationFrame(i):_(t,n,a,r)?t.plot.apply(t,t.plotArgs):c.error("Catastrophic and unrecoverable WebGL error. Context lost.")}))};var w=["xaxis","yaxis","zaxis"];function M(t,e,r){for(var n=t.fullSceneLayout,a=0;a<3;a++){var i=w[a],o=i.charAt(0),s=n[i],l=e[o],u=e[o+"calendar"],h=e["_"+o+"length"];if(c.isArrayOrTypedArray(l))for(var d,f=0;f<(h||l.length);f++)if(c.isArrayOrTypedArray(l[f]))for(var p=0;p<l[f].length;++p)d=s.d2l(l[f][p],0,u),!isNaN(d)&&isFinite(d)&&(r[0][a]=Math.min(r[0][a],d),r[1][a]=Math.max(r[1][a],d));else d=s.d2l(l[f],0,u),!isNaN(d)&&isFinite(d)&&(r[0][a]=Math.min(r[0][a],d),r[1][a]=Math.max(r[1][a],d));else r[0][a]=Math.min(r[0][a],0),r[1][a]=Math.max(r[1][a],h-1)}}function k(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]},projection:{type:!0===t._ortho?"orthographic":"perspective"}}}b.plot=function(t,e,r){if(this.plotArgs=[t,e,r],!this.glplot.contextLost){var n,a,i,o,s,l,u=e[this.id],c=r[this.id];u.bgcolor?this.glplot.clearColor=f(u.bgcolor):this.glplot.clearColor=[0,0,0,0],this.glplot.snapToData=!0,this.fullLayout=e,this.fullSceneLayout=u,this.glplotLayout=u,this.axesOptions.merge(e,u),this.spikeOptions.merge(u),this.setCamera(u.camera),this.updateFx(u.dragmode,u.hovermode),this.camera.enableWheel=this.graphDiv._context._scrollZoom.gl3d,this.glplot.update({}),this.setConvert(s),t?Array.isArray(t)||(t=[t]):t=[];var h=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];for(i=0;i<t.length;++i)!0===(n=t[i]).visible&&0!==n._length&&M(this,n,h);!function(t,e){for(var r=t.fullSceneLayout,n=r.annotations||[],a=0;a<3;a++)for(var i=w[a],o=i.charAt(0),s=r[i],l=0;l<n.length;l++){var u=n[l];if(u.visible){var c=s.r2l(u[o]);!isNaN(c)&&isFinite(c)&&(e[0][a]=Math.min(e[0][a],c),e[1][a]=Math.max(e[1][a],c))}}}(this,h);var d=[1,1,1];for(o=0;o<3;++o)h[1][o]===h[0][o]?d[o]=1:d[o]=1/(h[1][o]-h[0][o]);for(this.dataScale=d,this.convertAnnotations(this),i=0;i<t.length;++i)!0===(n=t[i]).visible&&0!==n._length&&((a=this.traces[n.uid])?a.data.type===n.type?a.update(n):(a.dispose(),a=n._module.plot(this,n),this.traces[n.uid]=a):(a=n._module.plot(this,n),this.traces[n.uid]=a),a.name=n.name);var p=Object.keys(this.traces);t:for(i=0;i<p.length;++i){for(o=0;o<t.length;++o)if(t[o].uid===p[i]&&!0===t[o].visible&&0!==t[o]._length)continue t;(a=this.traces[p[i]]).dispose(),delete this.traces[p[i]]}this.glplot.objects.sort((function(t,e){return t._trace.data.index-e._trace.data.index}));var m=[[0,0,0],[0,0,0]],g=[],y={};for(i=0;i<3;++i){if((l=(s=u[w[i]]).type)in y?(y[l].acc*=d[i],y[l].count+=1):y[l]={acc:d[i],count:1},s.autorange){m[0][i]=1/0,m[1][i]=-1/0;var v=this.glplot.objects,_=this.fullSceneLayout.annotations||[],x=s._name.charAt(0);for(o=0;o<v.length;o++){var b=v[o],k=b.bounds,T=b._trace.data._pad||0;"ErrorBars"===b.constructor.name&&s._lowerLogErrorBound?m[0][i]=Math.min(m[0][i],s._lowerLogErrorBound):m[0][i]=Math.min(m[0][i],k[0][i]/d[i]-T),m[1][i]=Math.max(m[1][i],k[1][i]/d[i]+T)}for(o=0;o<_.length;o++){var L=_[o];if(L.visible){var A=s.r2l(L[x]);m[0][i]=Math.min(m[0][i],A),m[1][i]=Math.max(m[1][i],A)}}if("rangemode"in s&&"tozero"===s.rangemode&&(m[0][i]=Math.min(m[0][i],0),m[1][i]=Math.max(m[1][i],0)),m[0][i]>m[1][i])m[0][i]=-1,m[1][i]=1;else{var S=m[1][i]-m[0][i];m[0][i]-=S/32,m[1][i]+=S/32}if("reversed"===s.autorange){var E=m[0][i];m[0][i]=m[1][i],m[1][i]=E}}else{var C=s.range;m[0][i]=s.r2l(C[0]),m[1][i]=s.r2l(C[1])}m[0][i]===m[1][i]&&(m[0][i]-=1,m[1][i]+=1),g[i]=m[1][i]-m[0][i],this.glplot.bounds[0][i]=m[0][i]*d[i],this.glplot.bounds[1][i]=m[1][i]*d[i]}var D,P=[1,1,1];for(i=0;i<3;++i){var O=y[l=(s=u[w[i]]).type];P[i]=Math.pow(O.acc,1/O.count)/d[i]}if("auto"===u.aspectmode)D=Math.max.apply(null,P)/Math.min.apply(null,P)<=4?P:[1,1,1];else if("cube"===u.aspectmode)D=[1,1,1];else if("data"===u.aspectmode)D=P;else{if("manual"!==u.aspectmode)throw new Error("scene.js aspectRatio was not one of the enumerated types");var z=u.aspectratio;D=[z.x,z.y,z.z]}u.aspectratio.x=c.aspectratio.x=D[0],u.aspectratio.y=c.aspectratio.y=D[1],u.aspectratio.z=c.aspectratio.z=D[2],this.glplot.aspect=D;var I=u.domain||null,R=e._size||null;if(I&&R){var F=this.container.style;F.position="absolute",F.left=R.l+I.x[0]*R.w+"px",F.top=R.t+(1-I.y[1])*R.h+"px",F.width=R.w*(I.x[1]-I.x[0])+"px",F.height=R.h*(I.y[1]-I.y[0])+"px"}this.glplot.redraw()}},b.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=this.glplot.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},b.getCamera=function(){return this.glplot.camera.view.recalcMatrix(this.camera.view.lastT()),k(this.glplot.camera)},b.setCamera=function(t){var e;this.glplot.camera.lookAt.apply(this,[[(e=t).eye.x,e.eye.y,e.eye.z],[e.center.x,e.center.y,e.center.z],[e.up.x,e.up.y,e.up.z]]);var r="orthographic"===t.projection.type;if(r!==this.glplot.camera._ortho){this.glplot.redraw();var n=this.glplot.pixelRatio,a=this.glplot.clearColor;this.glplot.gl.clearColor(a[0],a[1],a[2],a[3]),this.glplot.gl.clear(this.glplot.gl.DEPTH_BUFFER_BIT|this.glplot.gl.COLOR_BUFFER_BIT),this.glplot.dispose(),_(this,n),this.glplot.camera._ortho=r}},b.saveCamera=function(t){var e=this.fullLayout,r=this.getCamera(),n=c.nestedProperty(t,this.id+".camera"),a=n.get(),i=!1;function o(t,e,r,n){var a=["up","center","eye"],i=["x","y","z"];return e[a[r]]&&t[a[r]][i[n]]===e[a[r]][i[n]]}if(void 0===a)i=!0;else{for(var s=0;s<3;s++)for(var l=0;l<3;l++)if(!o(r,a,s,l)){i=!0;break}(!a.projection||r.projection&&r.projection.type!==a.projection.type)&&(i=!0)}if(i){var h={};h[this.id+".camera"]=a,u.call("_storeDirectGUIEdit",t,e._preGUI,h),n.set(r),c.nestedProperty(e,this.id+".camera").set(r)}return i},b.updateFx=function(t,e){var r=this.camera;if(r)if("orbit"===t)r.mode="orbit",r.keyBindingMode="rotate";else if("turntable"===t){r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate";var n=this.graphDiv,a=n._fullLayout,i=this.fullSceneLayout.camera,o=i.up.x,s=i.up.y,l=i.up.z;if(l/Math.sqrt(o*o+s*s+l*l)<.999){var h=this.id+".camera.up",d={x:0,y:0,z:1},f={};f[h]=d;var p=n.layout;u.call("_storeDirectGUIEdit",p,a._preGUI,f),i.up=d,c.nestedProperty(p,h).set(d)}}else r.keyBindingMode=t;this.fullSceneLayout.hovermode=e},b.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(n),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,a=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var i=new Uint8Array(r*a*4);e.readPixels(0,0,r,a,e.RGBA,e.UNSIGNED_BYTE,i);for(var o=0,s=a-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=a;var d,f=h.getContext("2d"),p=f.createImageData(r,a);switch(p.data.set(i),f.putImageData(p,0,0),t){case"jpeg":d=h.toDataURL("image/jpeg");break;case"webp":d=h.toDataURL("image/webp");break;default:d=h.toDataURL("image/png")}return this.staticMode&&this.container.removeChild(n),d},b.setConvert=function(){for(var t=0;t<3;t++){var e=this.fullSceneLayout[w[t]];h.setConvert(e,this.fullLayout),e.setScale=c.noop}},b.make4thDimension=function(){var t=this.graphDiv._fullLayout;this.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},h.setConvert(this.mockAxis,t)},e.exports=x},{"../../components/fx":632,"../../lib":719,"../../lib/show_no_webgl_msg":740,"../../lib/str2rgbarray":742,"../../plots/cartesian/axes":767,"../../registry":847,"./layout/convert":811,"./layout/spikes":814,"./layout/tick_marks":815,"./project":816,"gl-plot3d":290,"has-passive-events":411,"webgl-context":556}],818:[function(t,e,r){e.exports=function(t,e,r,n){n=n||t.length;for(var a=new Array(n),i=0;i<n;i++)a[i]=[t[i],e[i],r[i]];return a}},{}],819:[function(t,e,r){var n=t("./font_attributes"),a=t("./animation_attributes"),i=t("../components/color/attributes"),o=t("./pad_attributes"),s=t("../lib/extend").extendFlat,l=n({editType:"calc"});l.family.dflt='"Open Sans", verdana, arial, sans-serif',l.size.dflt=12,l.color.dflt=i.defaultLine,e.exports={font:l,title:{text:{valType:"string",editType:"layoutstyle"},font:n({editType:"layoutstyle"}),xref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},yref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},x:{valType:"number",min:0,max:1,dflt:.5,editType:"layoutstyle"},y:{valType:"number",min:0,max:1,dflt:"auto",editType:"layoutstyle"},xanchor:{valType:"enumerated",dflt:"auto",values:["auto","left","center","right"],editType:"layoutstyle"},yanchor:{valType:"enumerated",dflt:"auto",values:["auto","top","middle","bottom"],editType:"layoutstyle"},pad:s(o({editType:"layoutstyle"}),{}),editType:"layoutstyle"},autosize:{valType:"boolean",dflt:!1,editType:"none"},width:{valType:"number",min:10,dflt:700,editType:"plot"},height:{valType:"number",min:10,dflt:450,editType:"plot"},margin:{l:{valType:"number",min:0,dflt:80,editType:"plot"},r:{valType:"number",min:0,dflt:80,editType:"plot"},t:{valType:"number",min:0,dflt:100,editType:"plot"},b:{valType:"number",min:0,dflt:80,editType:"plot"},pad:{valType:"number",min:0,dflt:0,editType:"plot"},autoexpand:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},paper_bgcolor:{valType:"color",dflt:i.background,editType:"plot"},plot_bgcolor:{valType:"color",dflt:i.background,editType:"layoutstyle"},separators:{valType:"string",editType:"plot"},hidesources:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:{valType:"boolean",editType:"legend"},colorway:{valType:"colorlist",dflt:i.defaults,editType:"calc"},datarevision:{valType:"any",editType:"calc"},uirevision:{valType:"any",editType:"none"},editrevision:{valType:"any",editType:"none"},selectionrevision:{valType:"any",editType:"none"},template:{valType:"any",editType:"calc"},modebar:{orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"modebar"},meta:{valType:"any",arrayOk:!0,editType:"plot"},transition:s({},a.transition,{editType:"none"}),_deprecated:{title:{valType:"string",editType:"layoutstyle"},titlefont:n({editType:"layoutstyle"})}}},{"../components/color/attributes":592,"../lib/extend":710,"./animation_attributes":762,"./font_attributes":793,"./pad_attributes":827}],820:[function(t,e,r){var n={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:'<a href="http://www.openstreetmap.org/about/" target="_blank">© OpenStreetMap</a>',tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}]},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}]},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:'<a href="https://carto.com/" target="_blank">© CARTO</a>',tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}]},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:'<a href="https://carto.com/" target="_blank">© CARTO</a>',tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}]},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:'Map tiles by <a href="http://stamen.com">Stamen Design</a>, under <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> | Data by <a href="http://openstreetmap.org">OpenStreetMap</a>, under <a href="http://www.openstreetmap.org/copyright">ODbL</a>.',tiles:["https://stamen-tiles.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}]},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:'Map tiles by <a href="http://stamen.com">Stamen Design</a>, under <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> | Data by <a href="http://openstreetmap.org">OpenStreetMap</a>, under <a href="http://www.openstreetmap.org/copyright">ODbL</a>.',tiles:["https://stamen-tiles.a.ssl.fastly.net/toner/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}]},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:'Map tiles by <a href="http://stamen.com">Stamen Design</a>, under <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> | Data by <a href="http://openstreetmap.org">OpenStreetMap</a>, under <a href="http://creativecommons.org/licenses/by-sa/3.0">CC BY SA</a>.',tiles:["https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}]}},a=Object.keys(n);e.exports={requiredVersion:"1.1.1",styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:n,styleValuesNonMapbox:a,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install mapbox-gl@1.1.1."].join("\n"),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.plot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join("\n"),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",a.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join("\n"),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join("\n"),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":'content: ""; cursor: pointer; position: absolute; background-image: url(\'data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E\'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;',"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":'display:block; width: 21px; height: 21px; background-image: url(\'data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E\')'}}},{}],821:[function(t,e,r){var n=t("../../lib");e.exports=function(t,e){var r=t.split(" "),a=r[0],i=r[1],o=n.isArrayOrTypedArray(e)?n.mean(e):e,s=.5+o/100,l=1.5+o/100,u=["",""],c=[0,0];switch(a){case"top":u[0]="top",c[1]=-l;break;case"bottom":u[0]="bottom",c[1]=l}switch(i){case"left":u[1]="right",c[0]=-s;break;case"right":u[1]="left",c[0]=s}return{anchor:u[0]&&u[1]?u.join("-"):u[0]?u[0]:u[1]?u[1]:"center",offset:c}}},{"../../lib":719}],822:[function(t,e,r){var n=t("mapbox-gl"),a=t("../../lib"),i=t("../../plots/get_data").getSubplotCalcData,o=t("../../constants/xmlns_namespaces"),s=t("d3"),l=t("../../components/drawing"),u=t("../../lib/svg_text_utils"),c=t("./mapbox"),h=r.constants=t("./constants");function d(t){return"string"==typeof t&&-1!==h.styleValuesMapbox.indexOf(t)}r.name="mapbox",r.attr="subplot",r.idRoot="mapbox",r.idRegex=r.attrRegex=a.counterRegex("mapbox"),r.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},r.layoutAttributes=t("./layout_attributes"),r.supplyLayoutDefaults=t("./layout_defaults"),r.plot=function(t){var e=t._fullLayout,r=t.calcdata,o=e._subplots.mapbox;if(n.version!==h.requiredVersion)throw new Error(h.wrongVersionErrorMsg);var s=function(t,e){var r=t._fullLayout;if(""===t._context.mapboxAccessToken)return"";for(var n=[],i=[],o=!1,s=!1,l=0;l<e.length;l++){var u=r[e[l]],c=u.accesstoken;d(u.style)&&(c?a.pushUnique(n,c):(d(u._input.style)&&(a.error("Uses Mapbox map style, but did not set an access token."),o=!0),s=!0)),c&&a.pushUnique(i,c)}if(s){var f=o?h.noAccessTokenErrorMsg:h.missingStyleErrorMsg;throw new Error(f)}return n.length?(n.length>1&&a.warn(h.multipleTokensErrorMsg),n[0]):(i.length&&a.log(["Listed mapbox access token(s)",i.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}(t,o);n.accessToken=s;for(var l=0;l<o.length;l++){var u=o[l],f=i(r,"mapbox",u),p=e[u],m=p._subplot;m||(m=new c(t,u),e[u]._subplot=m),m.viewInitial||(m.viewInitial={center:a.extendFlat({},p.center),zoom:p.zoom,bearing:p.bearing,pitch:p.pitch}),m.plot(f,e,t._promises)}},r.clean=function(t,e,r,n){for(var a=n._subplots.mapbox||[],i=0;i<a.length;i++){var o=a[i];!e[o]&&n[o]._subplot&&n[o]._subplot.destroy()}},r.toSVG=function(t){for(var e=t._fullLayout,r=e._subplots.mapbox,n=e._size,a=0;a<r.length;a++){var i=e[r[a]],c=i.domain,d=i._subplot.toImage("png");e._glimages.append("svg:image").attr({xmlns:o.svg,"xlink:href":d,x:n.l+n.w*c.x[0],y:n.t+n.h*(1-c.y[1]),width:n.w*(c.x[1]-c.x[0]),height:n.h*(c.y[1]-c.y[0]),preserveAspectRatio:"none"});var f=s.select(i._subplot.div);if(null!==f.select(".mapboxgl-ctrl-logo").node().offsetParent){var p=e._glimages.append("g");p.attr("transform","translate("+(n.l+n.w*c.x[0]+10)+", "+(n.t+n.h*(1-c.y[0])-31)+")"),p.append("path").attr("d",h.mapboxLogo.path0).style({opacity:.9,fill:"#ffffff","enable-background":"new"}),p.append("path").attr("d",h.mapboxLogo.path1).style("opacity",.35).style("enable-background","new"),p.append("path").attr("d",h.mapboxLogo.path2).style("opacity",.35).style("enable-background","new"),p.append("polygon").attr("points",h.mapboxLogo.polygon).style({opacity:.9,fill:"#ffffff","enable-background":"new"})}var m=f.select(".mapboxgl-ctrl-attrib").text().replace("Improve this map",""),g=e._glimages.append("g"),y=g.append("text");y.text(m).classed("static-attribution",!0).attr({"font-size":12,"font-family":"Arial",color:"rgba(0, 0, 0, 0.75)","text-anchor":"end","data-unformatted":m});var v=l.bBox(y.node()),_=n.w*(c.x[1]-c.x[0]);if(v.width>_/2){var x=m.split("|").join("<br>");y.text(x).attr("data-unformatted",x).call(u.convertToTspans,t),v=l.bBox(y.node())}y.attr("transform","translate(-3, "+(8-v.height)+")"),g.insert("rect",".static-attribution").attr({x:-v.width-6,y:-v.height-3,width:v.width+6,height:v.height+3,fill:"rgba(255, 255, 255, 0.75)"});var b=1;v.width+6>_&&(b=_/(v.width+6));var w=[n.l+n.w*c.x[1],n.t+n.h*(1-c.y[0])];g.attr("transform","translate("+w[0]+","+w[1]+") scale("+b+")")}},r.updateFx=function(t){for(var e=t._fullLayout,r=e._subplots.mapbox,n=0;n<r.length;n++)e[r[n]]._subplot.updateFx(e)}},{"../../components/drawing":614,"../../constants/xmlns_namespaces":696,"../../lib":719,"../../lib/svg_text_utils":743,"../../plots/get_data":802,"./constants":820,"./layout_attributes":824,"./layout_defaults":825,"./mapbox":826,d3:163,"mapbox-gl":426}],823:[function(t,e,r){var n=t("../../lib"),a=t("./convert_text_opts"),i=t("./constants");function o(t,e){this.subplot=t,this.uid=t.uid+"-"+e,this.index=e,this.idSource="source-"+this.uid,this.idLayer=i.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var s=o.prototype;function l(t){var e=t.source;return t.visible&&(n.isPlainObject(e)||("string"==typeof e||Array.isArray(e))&&e.length>0)}function u(t){var e={},r={};switch(t.type){case"circle":n.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":n.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity,"line-dasharray":t.line.dash});break;case"fill":n.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var i=t.symbol,o=a(i.textposition,i.iconsize);n.extendFlat(e,{"icon-image":i.icon+"-15","icon-size":i.iconsize/10,"text-field":i.text,"text-size":i.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":i.placement}),n.extendFlat(r,{"icon-color":t.color,"text-color":i.textfont.color,"text-opacity":t.opacity})}return{layout:e,paint:r}}s.update=function(t){this.visible?this.needsNewSource(t)?(this.removeLayer(),this.updateSource(t),this.updateLayer(t)):this.needsNewLayer(t)?this.updateLayer(t):this.updateStyle(t):(this.updateSource(t),this.updateLayer(t)),this.visible=l(t)},s.needsNewSource=function(t){return this.sourceType!==t.sourcetype||this.source!==t.source||this.layerType!==t.type},s.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},s.updateSource=function(t){var e=this.subplot.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,l(t)){var r=function(t){var e,r=t.sourcetype,n=t.source,a={type:r};return"geojson"===r?e="data":"vector"===r?e="string"==typeof n?"url":"tiles":"raster"===r?(e="tiles",a.tileSize=256):"image"===r&&(e="url",a.coordinates=t.coordinates),a[e]=n,t.sourceattribution&&(a.attribution=t.sourceattribution),a}(t);e.addSource(this.idSource,r)}},s.updateLayer=function(t){var e,r=this.subplot,n=u(t),a=this.subplot.belowLookup["layout-"+this.index];if("traces"===a)for(var o=r.getMapLayers(),s=0;s<o.length;s++){var c=o[s].id;if("string"==typeof c&&0===c.indexOf(i.traceLayerPrefix)){e=c;break}}else e=a;this.removeLayer(),l(t)&&r.addLayer({id:this.idLayer,source:this.idSource,"source-layer":t.sourcelayer||"",type:t.type,minzoom:t.minzoom,maxzoom:t.maxzoom,layout:n.layout,paint:n.paint},e),this.layerType=t.type,this.below=a},s.updateStyle=function(t){if(l(t)){var e=u(t);this.subplot.setOptions(this.idLayer,"setLayoutProperty",e.layout),this.subplot.setOptions(this.idLayer,"setPaintProperty",e.paint)}},s.removeLayer=function(){var t=this.subplot.map;t.getLayer(this.idLayer)&&t.removeLayer(this.idLayer)},s.dispose=function(){var t=this.subplot.map;t.removeLayer(this.idLayer),t.removeSource(this.idSource)},e.exports=function(t,e,r){var n=new o(t,e);return n.update(r),n}},{"../../lib":719,"./constants":820,"./convert_text_opts":821}],824:[function(t,e,r){var n=t("../../lib"),a=t("../../components/color").defaultLine,i=t("../domain").attributes,o=t("../font_attributes"),s=t("../../traces/scatter/attributes").textposition,l=t("../../plot_api/edit_types").overrideAll,u=t("../../plot_api/plot_template").templatedArray,c=t("./constants"),h=o({});h.family.dflt="Open Sans Regular, Arial Unicode MS Regular",(e.exports=l({_arrayAttrRegexps:[n.counterRegex("mapbox",".layers",!0)],domain:i({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:c.styleValuesMapbox.concat(c.styleValuesNonMapbox),dflt:c.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},layers:u("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:a},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:a}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:h,textposition:n.extendFlat({},s,{arrayOk:!1})}})},"plot","from-root")).uirevision={valType:"any",editType:"none"}},{"../../components/color":593,"../../lib":719,"../../plot_api/edit_types":750,"../../plot_api/plot_template":757,"../../traces/scatter/attributes":1112,"../domain":792,"../font_attributes":793,"./constants":820}],825:[function(t,e,r){var n=t("../../lib"),a=t("../subplot_defaults"),i=t("../array_container_defaults"),o=t("./layout_attributes");function s(t,e,r,n){r("accesstoken",n.accessToken),r("style"),r("center.lon"),r("center.lat"),r("zoom"),r("bearing"),r("pitch"),i(t,e,{name:"layers",handleItemDefaults:l}),e._input=t}function l(t,e){function r(r,a){return n.coerce(t,e,o.layers,r,a)}if(r("visible")){var a,i=r("sourcetype"),s="raster"===i||"image"===i;r("source"),r("sourceattribution"),"vector"===i&&r("sourcelayer"),"image"===i&&r("coordinates"),s&&(a="raster");var l=r("type",a);s&&"raster"!==l&&(l=e.type="raster",n.log("Source types *raster* and *image* must drawn *raster* layer type.")),r("below"),r("color"),r("opacity"),r("minzoom"),r("maxzoom"),"circle"===l&&r("circle.radius"),"line"===l&&(r("line.width"),r("line.dash")),"fill"===l&&r("fill.outlinecolor"),"symbol"===l&&(r("symbol.icon"),r("symbol.iconsize"),r("symbol.text"),n.coerceFont(r,"symbol.textfont"),r("symbol.textposition"),r("symbol.placement"))}}e.exports=function(t,e,r){a(t,e,r,{type:"mapbox",attributes:o,handleDefaults:s,partition:"y",accessToken:e._mapboxAccessToken})}},{"../../lib":719,"../array_container_defaults":763,"../subplot_defaults":842,"./layout_attributes":824}],826:[function(t,e,r){var n=t("mapbox-gl"),a=t("d3"),i=t("../../components/fx"),o=t("../../lib"),s=t("../../registry"),l=t("../cartesian/axes"),u=t("../../components/dragelement"),c=t("../cartesian/select").prepSelect,h=t("../cartesian/select").selectOnClick,d=t("./constants"),f=t("./layers");function p(t,e){this.id=e,this.gd=t;var r=t._fullLayout,n=t._context;this.container=r._glcontainer.node(),this.isStatic=n.staticPlot,this.uid=r._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(r),this.map=null,this.accessToken=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={}}var m=p.prototype;m.plot=function(t,e,r){var n,a=this,i=e[a.id];a.map&&i.accesstoken!==a.accessToken&&(a.map.remove(),a.map=null,a.styleObj=null,a.traceHash=[],a.layerList={}),n=a.map?new Promise((function(r,n){a.updateMap(t,e,r,n)})):new Promise((function(r,n){a.createMap(t,e,r,n)})),r.push(n)},m.createMap=function(t,e,r,a){var i=this,o=e[i.id],s=i.styleObj=y(o.style);i.accessToken=o.accesstoken;var l=i.map=new n.Map({container:i.div,style:s.style,center:_(o.center),zoom:o.zoom,bearing:o.bearing,pitch:o.pitch,interactive:!i.isStatic,preserveDrawingBuffer:i.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new n.AttributionControl({compact:!0}));l._canvas.style.left="0px",l._canvas.style.top="0px",i.rejectOnError(a),i.isStatic||i.initFx(t,e);var u=[];u.push(new Promise((function(t){l.once("load",t)}))),u=u.concat(i.fetchMapData(t,e)),Promise.all(u).then((function(){i.fillBelowLookup(t,e),i.updateData(t),i.updateLayout(e),i.resolveOnRender(r)})).catch(a)},m.fetchMapData=function(t){var e=[];function r(t){return new Promise((function(e,r){a.json(t,(function(n,a){if(n){delete PlotlyGeoAssets[t];var i=404===n.status?'GeoJSON at URL "'+t+'" does not exist.':"Unexpected error while fetching from "+t;return r(new Error(i))}PlotlyGeoAssets[t]=a,e(a)}))}))}for(var n=0;n<t.length;n++){var i=t[n][0].trace.geojson;"string"!=typeof i||PlotlyGeoAssets[i]||(PlotlyGeoAssets[i]="pending",e.push(r(i)))}return e},m.updateMap=function(t,e,r,n){var a=this,i=a.map,o=e[this.id];a.rejectOnError(n);var s=[],l=y(o.style);a.styleObj.id!==l.id&&(a.styleObj=l,i.setStyle(l.style),a.traceHash={},s.push(new Promise((function(t){i.once("styledata",t)})))),s=s.concat(a.fetchMapData(t,e)),Promise.all(s).then((function(){a.fillBelowLookup(t,e),a.updateData(t),a.updateLayout(e),a.resolveOnRender(r)})).catch(n)},m.fillBelowLookup=function(t,e){var r,n,a=e[this.id].layers,i=this.belowLookup={},o=!1;for(r=0;r<t.length;r++){var s=t[r][0].trace,l=s._module;"string"==typeof s.below?n=s.below:l.getBelow&&(n=l.getBelow(s,this)),""===n&&(o=!0),i["trace-"+s.uid]=n||""}for(r=0;r<a.length;r++){var u=a[r];n="string"==typeof u.below?u.below:o?"traces":"",i["layout-"+r]=n}var c,h,d={};for(c in i)d[n=i[c]]?d[n].push(c):d[n]=[c];for(n in d){var f=d[n];if(f.length>1)for(r=0;r<f.length;r++)0===(c=f[r]).indexOf("trace-")?(h=c.split("trace-")[1],this.traceHash[h]&&(this.traceHash[h].below=null)):0===c.indexOf("layout-")&&(h=c.split("layout-")[1],this.layerList[h]&&(this.layerList[h].below=null))}};var g={choroplethmapbox:0,densitymapbox:1,scattermapbox:2};function y(t){var e={};return o.isPlainObject(t)?(e.id=t.id,e.style=t):"string"==typeof t?(e.id=t,-1!==d.styleValuesMapbox.indexOf(t)?e.style=v(t):d.stylesNonMapbox[t]?e.style=d.stylesNonMapbox[t]:e.style=t):(e.id=d.styleValueDflt,e.style=v(d.styleValueDflt)),e.transition={duration:0,delay:0},e}function v(t){return d.styleUrlPrefix+t+"-"+d.styleUrlSuffix}function _(t){return[t.lon,t.lat]}m.updateData=function(t){var e,r,n,a,i=this.traceHash,o=t.slice().sort((function(t,e){return g[t[0].trace.type]-g[e[0].trace.type]}));for(n=0;n<o.length;n++){var s=o[n];(e=i[(r=s[0].trace).uid])?e.update(s):r._module&&(i[r.uid]=r._module.plot(this,s))}var l=Object.keys(i);t:for(n=0;n<l.length;n++){var u=l[n];for(a=0;a<t.length;a++)if(u===(r=t[a][0].trace).uid)continue t;(e=i[u]).dispose(),delete i[u]}},m.updateLayout=function(t){var e=this.map,r=t[this.id];e.setCenter(_(r.center)),e.setZoom(r.zoom),e.setBearing(r.bearing),e.setPitch(r.pitch),this.updateLayers(t),this.updateFramework(t),this.updateFx(t),this.map.resize(),this.gd._context._scrollZoom.mapbox?e.scrollZoom.enable():e.scrollZoom.disable()},m.resolveOnRender=function(t){var e=this.map;e.on("render",(function r(){e.loaded()&&(e.off("render",r),setTimeout(t,0))}))},m.rejectOnError=function(t){var e=this.map;function r(){t(new Error(d.mapOnErrorMsg))}e.once("error",r),e.once("style.error",r),e.once("source.error",r),e.once("tile.error",r),e.once("layer.error",r)},m.createFramework=function(t){var e=this,r=e.div=document.createElement("div");r.id=e.uid,r.style.position="absolute",e.container.appendChild(r),e.xaxis={_id:"x",c2p:function(t){return e.project(t).x}},e.yaxis={_id:"y",c2p:function(t){return e.project(t).y}},e.updateFramework(t),e.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},l.setConvert(e.mockAxis,t)},m.initFx=function(t,e){var r=this,n=r.gd,a=r.map,o=!1;function l(){i.loneUnhover(e._hoverlayer)}function u(){var t=r.getView();n.emit("plotly_relayouting",r.getViewEdits(t))}a.on("moveend",(function(t){if(r.map){var e=n._fullLayout;if(t.originalEvent||o){var a=e[r.id];s.call("_storeDirectGUIEdit",n.layout,e._preGUI,r.getViewEdits(a));var i=r.getView();a._input.center=a.center=i.center,a._input.zoom=a.zoom=i.zoom,a._input.bearing=a.bearing=i.bearing,a._input.pitch=a.pitch=i.pitch,n.emit("plotly_relayout",r.getViewEdits(i))}o=!1,e._rehover&&e._rehover()}})),a.on("wheel",(function(){o=!0})),a.on("mousemove",(function(t){var e=r.div.getBoundingClientRect();t.clientX=t.point.x+e.left,t.clientY=t.point.y+e.top,t.target.getBoundingClientRect=function(){return e},r.xaxis.p2c=function(){return t.lngLat.lng},r.yaxis.p2c=function(){return t.lngLat.lat},n._fullLayout._rehover=function(){n._fullLayout._hoversubplot===r.id&&i.hover(n,t,r.id)},i.hover(n,t,r.id),n._fullLayout._hoversubplot=r.id})),a.on("dragstart",l),a.on("zoomstart",l),a.on("mouseout",(function(){n._fullLayout._hoversubplot=null})),a.on("drag",u),a.on("zoom",u),a.on("dblclick",(function(){var t=n._fullLayout[r.id];s.call("_storeDirectGUIEdit",n.layout,n._fullLayout._preGUI,r.getViewEdits(t));var e=r.viewInitial;a.setCenter(_(e.center)),a.setZoom(e.zoom),a.setBearing(e.bearing),a.setPitch(e.pitch);var i=r.getView();t._input.center=t.center=i.center,t._input.zoom=t.zoom=i.zoom,t._input.bearing=t.bearing=i.bearing,t._input.pitch=t.pitch=i.pitch,n.emit("plotly_doubleclick",null),n.emit("plotly_relayout",r.getViewEdits(i))})),r.clearSelect=function(){n._fullLayout._zoomlayer.selectAll(".select-outline").remove()},r.onClickInPanFn=function(t){return function(e){var a=n._fullLayout.clickmode;a.indexOf("select")>-1&&h(e.originalEvent,n,[r.xaxis],[r.yaxis],r.id,t),a.indexOf("event")>-1&&i.click(n,e.originalEvent)}}},m.updateFx=function(t){var e=this,r=e.map,n=e.gd;if(!e.isStatic){var a,i=t.dragmode;a="select"===i?function(t,r){(t.range={})[e.id]=[l([r.xmin,r.ymin]),l([r.xmax,r.ymax])]}:function(t,r,n){(t.lassoPoints={})[e.id]=n.filtered.map(l)};var s=e.dragOptions;e.dragOptions=o.extendDeep(s||{},{element:e.div,gd:n,plotinfo:{id:e.id,xaxis:e.xaxis,yaxis:e.yaxis,fillRangeItems:a},xaxes:[e.xaxis],yaxes:[e.yaxis],subplot:e.id}),r.off("click",e.onClickInPanHandler),"select"===i||"lasso"===i?(r.dragPan.disable(),r.on("zoomstart",e.clearSelect),e.dragOptions.prepFn=function(t,r,n){c(t,r,n,e.dragOptions,i)},u.init(e.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",e.clearSelect),e.div.onmousedown=null,e.onClickInPanHandler=e.onClickInPanFn(e.dragOptions),r.on("click",e.onClickInPanHandler))}function l(t){var r=e.map.unproject(t);return[r.lng,r.lat]}},m.updateFramework=function(t){var e=t[this.id].domain,r=t._size,n=this.div.style;n.width=r.w*(e.x[1]-e.x[0])+"px",n.height=r.h*(e.y[1]-e.y[0])+"px",n.left=r.l+e.x[0]*r.w+"px",n.top=r.t+(1-e.y[1])*r.h+"px",this.xaxis._offset=r.l+e.x[0]*r.w,this.xaxis._length=r.w*(e.x[1]-e.x[0]),this.yaxis._offset=r.t+(1-e.y[1])*r.h,this.yaxis._length=r.h*(e.y[1]-e.y[0])},m.updateLayers=function(t){var e,r=t[this.id].layers,n=this.layerList;if(r.length!==n.length){for(e=0;e<n.length;e++)n[e].dispose();for(n=this.layerList=[],e=0;e<r.length;e++)n.push(f(this,e,r[e]))}else for(e=0;e<r.length;e++)n[e].update(r[e])},m.destroy=function(){this.map&&(this.map.remove(),this.map=null,this.container.removeChild(this.div))},m.toImage=function(){return this.map.stop(),this.map.getCanvas().toDataURL()},m.setOptions=function(t,e,r){for(var n in r)this.map[e](t,n,r[n])},m.getMapLayers=function(){return this.map.getStyle().layers},m.addLayer=function(t,e){var r=this.map;if("string"==typeof e){if(""===e)return void r.addLayer(t,e);for(var n=this.getMapLayers(),a=0;a<n.length;a++)if(e===n[a].id)return void r.addLayer(t,e);o.warn(["Trying to add layer with *below* value",e,"referencing a layer that does not exist","or that does not yet exist."].join(" "))}r.addLayer(t)},m.project=function(t){return this.map.project(new n.LngLat(t[0],t[1]))},m.getView=function(){var t=this.map,e=t.getCenter();return{center:{lon:e.lng,lat:e.lat},zoom:t.getZoom(),bearing:t.getBearing(),pitch:t.getPitch()}},m.getViewEdits=function(t){for(var e=this.id,r=["center","zoom","bearing","pitch"],n={},a=0;a<r.length;a++){var i=r[a];n[e+"."+i]=t[i]}return n},e.exports=p},{"../../components/dragelement":611,"../../components/fx":632,"../../lib":719,"../../registry":847,"../cartesian/axes":767,"../cartesian/select":784,"./constants":820,"./layers":823,d3:163,"mapbox-gl":426}],827:[function(t,e,r){e.exports=function(t){var e=t.editType;return{t:{valType:"number",dflt:0,editType:e},r:{valType:"number",dflt:0,editType:e},b:{valType:"number",dflt:0,editType:e},l:{valType:"number",dflt:0,editType:e},editType:e}}},{}],828:[function(t,e,r){var n=t("d3"),a=t("fast-isnumeric"),i=t("../registry"),o=t("../plot_api/plot_schema"),s=t("../plot_api/plot_template"),l=t("../lib"),u=t("../components/color"),c=t("../constants/numerical").BADNUM,h=t("./cartesian/axis_ids"),d=t("./animation_attributes"),f=t("./frame_attributes"),p=l.relinkPrivateKeys,m=l._,g=e.exports={};l.extendFlat(g,i),g.attributes=t("./attributes"),g.attributes.type.values=g.allTypes,g.fontAttrs=t("./font_attributes"),g.layoutAttributes=t("./layout_attributes"),g.fontWeight="normal";var y=g.transformsRegistry,v=t("./command");g.executeAPICommand=v.executeAPICommand,g.computeAPICommandBindings=v.computeAPICommandBindings,g.manageCommandObserver=v.manageCommandObserver,g.hasSimpleAPICommandBindings=v.hasSimpleAPICommandBindings,g.redrawText=function(t){var e=(t=l.getGraphDiv(t))._fullLayout||{};if(e._has&&e._has("polar")||!t.data||!t.data[0]||!t.data[0].r)return new Promise((function(e){setTimeout((function(){i.getComponentMethod("annotations","draw")(t),i.getComponentMethod("legend","draw")(t),i.getComponentMethod("colorbar","draw")(t),e(g.previousPromises(t))}),300)}))},g.resize=function(t){return t=l.getGraphDiv(t),new Promise((function(e,r){t&&!l.isHidden(t)||r(new Error("Resize must be passed a displayed plot div element.")),t._redrawTimer&&clearTimeout(t._redrawTimer),t._redrawTimer=setTimeout((function(){if(!t.layout||t.layout.width&&t.layout.height||l.isHidden(t))e(t);else{delete t.layout.width,delete t.layout.height;var r=t.changed;t.autoplay=!0,i.call("relayout",t,{autosize:!0}).then((function(){t.changed=r,e(t)}))}}),100)}))},g.previousPromises=function(t){if((t._promises||[]).length)return Promise.all(t._promises).then((function(){t._promises=[]}))},g.addLinks=function(t){if(t._context.showLink||t._context.showSources){var e=t._fullLayout,r=l.ensureSingle(e._paper,"text","js-plot-link-container",(function(t){t.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:u.defaultLine,"pointer-events":"all"}).each((function(){var t=n.select(this);t.append("tspan").classed("js-link-to-tool",!0),t.append("tspan").classed("js-link-spacer",!0),t.append("tspan").classed("js-sourcelinks",!0)}))})),a=r.node(),i={y:e._paper.attr("height")-9};document.body.contains(a)&&a.getComputedTextLength()>=e.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=e._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),c=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(t,e){e.text("");var r=e.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(t._context.linkText+" "+String.fromCharCode(187));if(t._context.sendData)r.on("click",(function(){g.sendDataToCloud(t)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(t,o),s.text(o.text()&&c.text()?" - ":"")}},g.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL,r=n.select(t).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=g.graphJson(t,!1,"keepdata"),a.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1};var _=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],x=["year","month","dayMonth","dayMonthYear"];function b(t,e){var r=t._context.locale,n=!1,a={};function o(t){for(var r=!0,i=0;i<e.length;i++){var o=e[i];a[o]||(t[o]?a[o]=t[o]:r=!1)}r&&(n=!0)}for(var s=0;s<2;s++){for(var l=t._context.locales,u=0;u<2;u++){var c=(l[r]||{}).format;if(c&&(o(c),n))break;l=i.localeRegistry}var h=r.split("-")[0];if(n||h===r)break;r=h}return n||o(i.localeRegistry.en.format),a}function w(t,e){var r={_fullLayout:e},n="x"===t._id.charAt(0),a=t._mainAxis._anchorAxis,i="",o="",s="";if(a&&(s=a._mainAxis._id,i=n?t._id+s:s+t._id),!i||!e._plots[i]){i="";for(var l=t._counterAxes,u=0;u<l.length;u++){var c=l[u],d=n?t._id+c:c+t._id;o||(o=d);var f=h.getFromId(r,c);if(s&&f.overlaying===s){i=d;break}}}return i||o}function M(t){var e=t.transforms;if(Array.isArray(e)&&e.length)for(var r=0;r<e.length;r++){var n=e[r],a=n._module||y[n.type];if(a&&a.makesData)return!0}return!1}function k(t,e,r,n){for(var a=t.transforms,i=[t],o=0;o<a.length;o++){var s=a[o],l=y[s.type];l&&l.transform&&(i=l.transform(i,{transform:s,fullTrace:t,fullData:e,layout:r,fullLayout:n,transformIndex:o}))}return i}function T(t){var e=t.margin;if(!t._size){var r=t._size={l:Math.round(e.l),r:Math.round(e.r),t:Math.round(e.t),b:Math.round(e.b),p:Math.round(e.pad)};r.w=Math.round(t.width)-r.l-r.r,r.h=Math.round(t.height)-r.t-r.b}t._pushmargin||(t._pushmargin={}),t._pushmarginIds||(t._pushmarginIds={})}g.supplyDefaults=function(t,e){var r=e&&e.skipUpdateCalc,a=t._fullLayout||{};if(a._skipDefaults)delete a._skipDefaults;else{var o,s=t._fullLayout={},u=t.layout||{},c=t._fullData||[],h=t._fullData=[],d=t.data||[],f=t.calcdata||[],y=t._context||{};t._transitionData||g.createTransitionData(t),s._dfltTitle={plot:m(t,"Click to enter Plot title"),x:m(t,"Click to enter X axis title"),y:m(t,"Click to enter Y axis title"),colorbar:m(t,"Click to enter Colorscale title"),annotation:m(t,"new text")},s._traceWord=m(t,"trace");var v=b(t,_);if(s._mapboxAccessToken=y.mapboxAccessToken,a._initialAutoSizeIsDone){var w=a.width,M=a.height;g.supplyLayoutGlobalDefaults(u,s,v),u.width||(s.width=w),u.height||(s.height=M),g.sanitizeMargins(s)}else{g.supplyLayoutGlobalDefaults(u,s,v);var k=!u.width||!u.height,L=s.autosize,A=y.autosizable;k&&(L||A)?g.plotAutoSize(t,u,s):k&&g.sanitizeMargins(s),!L&&k&&(u.width=s.width,u.height=s.height)}s._d3locale=function(t,e){return t.decimal=e.charAt(0),t.thousands=e.charAt(1),n.locale(t)}(v,s.separators),s._extraFormat=b(t,x),s._initialAutoSizeIsDone=!0,s._dataLength=d.length,s._modules=[],s._visibleModules=[],s._basePlotModules=[];var S=s._subplots=function(){var t,e,r=i.collectableSubplotTypes,n={};if(!r){r=[];var a=i.subplotsRegistry;for(var o in a){var s=a[o].attr;if(s&&(r.push(o),Array.isArray(s)))for(e=0;e<s.length;e++)l.pushUnique(r,s[e])}}for(t=0;t<r.length;t++)n[r[t]]=[];return n}(),E=s._splomAxes={x:{},y:{}},C=s._splomSubplots={};s._splomGridDflt={},s._scatterStackOpts={},s._firstScatter={},s._alignmentOpts={},s._colorAxes={},s._requestRangeslider={},s._traceUids=function(t,e){var r,n,a=e.length,i=[];for(r=0;r<t.length;r++){var o=t[r]._fullInput;o!==n&&i.push(o),n=o}var s=i.length,u=new Array(a),c={};function h(t,e){u[e]=t,c[t]=1}function d(t,e){if(t&&"string"==typeof t&&!c[t])return h(t,e),!0}for(r=0;r<a;r++){var f=e[r].uid;"number"==typeof f&&(f=String(f)),d(f,r)||r<s&&d(i[r].uid,r)||h(l.randstr(c),r)}return u}(c,d),s._globalTransforms=(t._context||{}).globalTransforms,g.supplyDataDefaults(d,h,u,s);var D=Object.keys(E.x),P=Object.keys(E.y);if(D.length>1&&P.length>1){for(i.getComponentMethod("grid","sizeDefaults")(u,s),o=0;o<D.length;o++)l.pushUnique(S.xaxis,D[o]);for(o=0;o<P.length;o++)l.pushUnique(S.yaxis,P[o]);for(var O in C)l.pushUnique(S.cartesian,O)}if(s._has=g._hasPlotType.bind(s),c.length===h.length)for(o=0;o<h.length;o++)p(h[o],c[o]);g.supplyLayoutModuleDefaults(u,s,h,t._transitionData);var z=s._visibleModules,I=[];for(o=0;o<z.length;o++){var R=z[o].crossTraceDefaults;R&&l.pushUnique(I,R)}for(o=0;o<I.length;o++)I[o](h,s);s._hasOnlyLargeSploms=1===s._basePlotModules.length&&"splom"===s._basePlotModules[0].name&&D.length>15&&P.length>15&&0===s.shapes.length&&0===s.images.length,s._hasCartesian=s._has("cartesian"),s._hasGeo=s._has("geo"),s._hasGL3D=s._has("gl3d"),s._hasGL2D=s._has("gl2d"),s._hasTernary=s._has("ternary"),s._hasPie=s._has("pie"),g.linkSubplots(h,s,c,a),g.cleanPlot(h,s,c,a),a._zoomlayer&&!t._dragging&&a._zoomlayer.selectAll(".select-outline").remove(),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var a=0;a<t.length;a++){var i=t[a];i.meta?n[i.index]=i._meta={meta:i.meta}:e.meta&&(i._meta={meta:e.meta}),e.meta&&(i._meta.layout={meta:e.meta})}n.length&&(r||(r=e._meta={}),r.data=n)}(h,s),p(s,a),i.getComponentMethod("colorscale","crossTraceDefaults")(h,s),s._preGUI||(s._preGUI={}),s._tracePreGUI||(s._tracePreGUI={});var F,N=s._tracePreGUI,Y={};for(F in N)Y[F]="old";for(o=0;o<h.length;o++)Y[F=h[o]._fullInput.uid]||(N[F]={}),Y[F]="new";for(F in Y)"old"===Y[F]&&delete N[F];T(s),i.getComponentMethod("rangeslider","makeData")(s),r||f.length!==h.length||g.supplyDefaultsUpdateCalc(f,h)}},g.supplyDefaultsUpdateCalc=function(t,e){for(var r=0;r<e.length;r++){var n=e[r],a=(t[r]||[])[0];if(a&&a.trace){var i=a.trace;if(i._hasCalcTransform){var o,s,u,c=i._arrayAttrs;for(o=0;o<c.length;o++)s=c[o],u=l.nestedProperty(i,s).get().slice(),l.nestedProperty(n,s).set(u)}a.trace=n}}},g.createTransitionData=function(t){t._transitionData||(t._transitionData={}),t._transitionData._frames||(t._transitionData._frames=[]),t._transitionData._frameHash||(t._transitionData._frameHash={}),t._transitionData._counter||(t._transitionData._counter=0),t._transitionData._interruptCallbacks||(t._transitionData._interruptCallbacks=[])},g._hasPlotType=function(t){var e,r=this._basePlotModules||[];for(e=0;e<r.length;e++)if(r[e].name===t)return!0;var n=this._modules||[];for(e=0;e<n.length;e++){var a=n[e].name;if(a===t)return!0;var o=i.modules[a];if(o&&o.categories[t])return!0}return!1},g.cleanPlot=function(t,e,r,n){var a,i,o=n._basePlotModules||[];for(a=0;a<o.length;a++){var s=o[a];s.clean&&s.clean(t,e,r,n)}var l=n._has&&n._has("gl"),u=e._has&&e._has("gl");l&&!u&&void 0!==n._glcontainer&&(n._glcontainer.selectAll(".gl-canvas").remove(),n._glcontainer.selectAll(".no-webgl").remove(),n._glcanvas=null);var c=!!n._infolayer;t:for(a=0;a<r.length;a++){var h=r[a].uid;for(i=0;i<t.length;i++)if(h===t[i].uid)continue t;c&&n._infolayer.select(".cb"+h).remove()}},g.linkSubplots=function(t,e,r,n){var a,i,o=n._plots||{},s=e._plots={},u=e._subplots,c={_fullData:t,_fullLayout:e},d=u.cartesian.concat(u.gl2d||[]);for(a=0;a<d.length;a++){var f,p=d[a],m=o[p],g=h.getFromId(c,p,"x"),y=h.getFromId(c,p,"y");for(m?f=s[p]=m:(f=s[p]={}).id=p,g._counterAxes.push(y._id),y._counterAxes.push(g._id),g._subplotsWith.push(p),y._subplotsWith.push(p),f.xaxis=g,f.yaxis=y,f._hasClipOnAxisFalse=!1,i=0;i<t.length;i++){var v=t[i];if(v.xaxis===f.xaxis._id&&v.yaxis===f.yaxis._id&&!1===v.cliponaxis){f._hasClipOnAxisFalse=!0;break}}}var _,x=h.list(c,null,!0);for(a=0;a<x.length;a++){var b=null;(_=x[a]).overlaying&&(b=h.getFromId(c,_.overlaying))&&b.overlaying&&(_.overlaying=!1,b=null),_._mainAxis=b||_,b&&(_.domain=b.domain.slice()),_._anchorAxis="free"===_.anchor?null:h.getFromId(c,_.anchor)}for(a=0;a<x.length;a++)(_=x[a])._counterAxes.sort(h.idSort),_._subplotsWith.sort(l.subplotSort),_._mainSubplot=w(_,e)},g.clearExpandedTraceDefaultColors=function(t){var e,r,n;for(r=[],(e=t._module._colorAttrs)||(t._module._colorAttrs=e=[],o.crawl(t._module.attributes,(function(t,n,a,i){r[i]=n,r.length=i+1,"color"===t.valType&&void 0===t.dflt&&e.push(r.join("."))}))),n=0;n<e.length;n++)l.nestedProperty(t,"_input."+e[n]).get()||l.nestedProperty(t,e[n]).set(null)},g.supplyDataDefaults=function(t,e,r,n){var a,o,u,c=n._modules,h=n._visibleModules,d=n._basePlotModules,f=0,m=0;function y(t){e.push(t);var r=t._module;r&&(l.pushUnique(c,r),!0===t.visible&&l.pushUnique(h,r),l.pushUnique(d,t._module.basePlotModule),f++,!1!==t._input.visible&&m++)}n._transformModules=[];var v={},_=[],x=(r.template||{}).data||{},b=s.traceTemplater(x);for(a=0;a<t.length;a++){if(u=t[a],(o=b.newTrace(u)).uid=n._traceUids[a],g.supplyTraceDefaults(u,o,m,n,a),o.index=a,o._input=u,o._expandedIndex=f,o.transforms&&o.transforms.length)for(var w=!1!==u.visible&&!1===o.visible,M=k(o,e,r,n),T=0;T<M.length;T++){var L=M[T],A={_template:o._template,type:o.type,uid:o.uid+T};w&&!1===L.visible&&delete L.visible,g.supplyTraceDefaults(L,A,f,n,a),p(A,L),A.index=a,A._input=u,A._fullInput=o,A._expandedIndex=f,A._expandedInput=L,y(A)}else o._fullInput=o,o._expandedInput=o,y(o);i.traceIs(o,"carpetAxis")&&(v[o.carpet]=o),i.traceIs(o,"carpetDependent")&&_.push(a)}for(a=0;a<_.length;a++)if((o=e[_[a]]).visible){var S=v[o.carpet];o._carpet=S,S&&S.visible?(o.xaxis=S.xaxis,o.yaxis=S.yaxis):o.visible=!1}},g.supplyAnimationDefaults=function(t){var e;t=t||{};var r={};function n(e,n){return l.coerce(t||{},r,d,e,n)}if(n("mode"),n("direction"),n("fromcurrent"),Array.isArray(t.frame))for(r.frame=[],e=0;e<t.frame.length;e++)r.frame[e]=g.supplyAnimationFrameDefaults(t.frame[e]||{});else r.frame=g.supplyAnimationFrameDefaults(t.frame||{});if(Array.isArray(t.transition))for(r.transition=[],e=0;e<t.transition.length;e++)r.transition[e]=g.supplyAnimationTransitionDefaults(t.transition[e]||{});else r.transition=g.supplyAnimationTransitionDefaults(t.transition||{});return r},g.supplyAnimationFrameDefaults=function(t){var e={};function r(r,n){return l.coerce(t||{},e,d.frame,r,n)}return r("duration"),r("redraw"),e},g.supplyAnimationTransitionDefaults=function(t){var e={};function r(r,n){return l.coerce(t||{},e,d.transition,r,n)}return r("duration"),r("easing"),e},g.supplyFrameDefaults=function(t){var e={};function r(r,n){return l.coerce(t,e,f,r,n)}return r("group"),r("name"),r("traces"),r("baseframe"),r("data"),r("layout"),e},g.supplyTraceDefaults=function(t,e,r,n,a){var o,s=n.colorway||u.defaults,c=s[r%s.length];function h(r,n){return l.coerce(t,e,g.attributes,r,n)}var d=h("visible");h("type"),h("name",n._traceWord+" "+a),h("uirevision",n.uirevision);var f=g.getModule(e);if(e._module=f,f){var p=f.basePlotModule,m=p.attr,y=p.attributes;if(m&&y){var v=n._subplots,_="";if("gl2d"!==p.name||d){if(Array.isArray(m))for(o=0;o<m.length;o++){var x=m[o],b=l.coerce(t,e,y,x);v[x]&&l.pushUnique(v[x],b),_+=b}else _=l.coerce(t,e,y,m);v[p.name]&&l.pushUnique(v[p.name],_)}}}return d&&(h("customdata"),h("ids"),h("meta"),i.traceIs(e,"showLegend")?(e._dfltShowLegend=!0,h("showlegend"),h("legendgroup")):e._dfltShowLegend=!1,f&&f.supplyDefaults(t,e,c,n),i.traceIs(e,"noOpacity")||h("opacity"),i.traceIs(e,"notLegendIsolatable")&&(e.visible=!!e.visible),i.traceIs(e,"noHover")||(e.hovertemplate||l.coerceHoverinfo(t,e,n),"parcats"!==e.type&&i.getComponentMethod("fx","supplyDefaults")(t,e,c,n)),f&&f.selectPoints&&h("selectedpoints"),g.supplyTransformDefaults(t,e,n)),e},g.hasMakesDataTransform=M,g.supplyTransformDefaults=function(t,e,r){if(e._length||M(t)){var n=r._globalTransforms||[],a=r._transformModules||[];if(Array.isArray(t.transforms)||0!==n.length)for(var i=t.transforms||[],o=n.concat(i),s=e.transforms=[],u=0;u<o.length;u++){var c,h=o[u],d=h.type,f=y[d],p=!(h._module&&h._module===f),m=f&&"function"==typeof f.transform;f||l.warn("Unrecognized transform type "+d+"."),f&&f.supplyDefaults&&(p||m)?((c=f.supplyDefaults(h,e,r,t)).type=d,c._module=f,l.pushUnique(a,f)):c=l.extendFlat({},h),s.push(c)}}},g.supplyLayoutGlobalDefaults=function(t,e,r){function n(r,n){return l.coerce(t,e,g.layoutAttributes,r,n)}var a=t.template;l.isPlainObject(a)&&(e.template=a,e._template=a.layout,e._dataTemplate=a.data);var o=l.coerceFont(n,"font");n("title.text",e._dfltTitle.plot),l.coerceFont(n,"title.font",{family:o.family,size:Math.round(1.4*o.size),color:o.color}),n("title.xref"),n("title.yref"),n("title.x"),n("title.y"),n("title.xanchor"),n("title.yanchor"),n("title.pad.t"),n("title.pad.r"),n("title.pad.b"),n("title.pad.l"),n("autosize",!(t.width&&t.height)),n("width"),n("height"),n("margin.l"),n("margin.r"),n("margin.t"),n("margin.b"),n("margin.pad"),n("margin.autoexpand"),t.width&&t.height&&g.sanitizeMargins(e),i.getComponentMethod("grid","sizeDefaults")(t,e),n("paper_bgcolor"),n("separators",r.decimal+r.thousands),n("hidesources"),n("colorway"),n("datarevision");var s=n("uirevision");n("editrevision",s),n("selectionrevision",s),n("modebar.orientation"),n("modebar.bgcolor",u.addOpacity(e.paper_bgcolor,.5));var c=u.contrast(u.rgb(e.modebar.bgcolor));n("modebar.color",u.addOpacity(c,.3)),n("modebar.activecolor",u.addOpacity(c,.7)),n("modebar.uirevision",s),n("meta"),l.isPlainObject(t.transition)&&(n("transition.duration"),n("transition.easing"),n("transition.ordering")),i.getComponentMethod("calendars","handleDefaults")(t,e,"calendar"),i.getComponentMethod("fx","supplyLayoutGlobalDefaults")(t,e,n)},g.plotAutoSize=function(t,e,r){var n,i,o=t._context||{},s=o.frameMargins,u=l.isPlotDiv(t);if(u&&t.emit("plotly_autosize"),o.fillFrame)n=window.innerWidth,i=window.innerHeight,document.body.style.overflow="hidden";else{var c=u?window.getComputedStyle(t):{};if(n=parseFloat(c.width)||parseFloat(c.maxWidth)||r.width,i=parseFloat(c.height)||parseFloat(c.maxHeight)||r.height,a(s)&&s>0){var h=1-2*s;n=Math.round(h*n),i=Math.round(h*i)}}var d=g.layoutAttributes.width.min,f=g.layoutAttributes.height.min;n<d&&(n=d),i<f&&(i=f);var p=!e.width&&Math.abs(r.width-n)>1,m=!e.height&&Math.abs(r.height-i)>1;(m||p)&&(p&&(r.width=n),m&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),g.sanitizeMargins(r)},g.supplyLayoutModuleDefaults=function(t,e,r,n){var a,o,s,u=i.componentsRegistry,c=e._basePlotModules,h=i.subplotsRegistry.cartesian;for(a in u)(s=u[a]).includeBasePlot&&s.includeBasePlot(t,e);for(var d in c.length||c.push(h),e._has("cartesian")&&(i.getComponentMethod("grid","contentDefaults")(t,e),h.finalizeSubplots(t,e)),e._subplots)e._subplots[d].sort(l.subplotSort);for(o=0;o<c.length;o++)(s=c[o]).supplyLayoutDefaults&&s.supplyLayoutDefaults(t,e,r);var f=e._modules;for(o=0;o<f.length;o++)(s=f[o]).supplyLayoutDefaults&&s.supplyLayoutDefaults(t,e,r);var p=e._transformModules;for(o=0;o<p.length;o++)(s=p[o]).supplyLayoutDefaults&&s.supplyLayoutDefaults(t,e,r,n);for(a in u)(s=u[a]).supplyLayoutDefaults&&s.supplyLayoutDefaults(t,e,r)},g.purge=function(t){var e=t._fullLayout||{};void 0!==e._glcontainer&&(e._glcontainer.selectAll(".gl-canvas").remove(),e._glcontainer.remove(),e._glcanvas=null),void 0!==e._geocontainer&&e._geocontainer.remove(),e._modeBar&&e._modeBar.destroy(),t._transitionData&&(t._transitionData._interruptCallbacks&&(t._transitionData._interruptCallbacks.length=0),t._transitionData._animationRaf&&window.cancelAnimationFrame(t._transitionData._animationRaf)),l.clearThrottle(),l.clearResponsive(t),delete t.data,delete t.layout,delete t._fullData,delete t._fullLayout,delete t.calcdata,delete t.framework,delete t.empty,delete t.fid,delete t.undoqueue,delete t.undonum,delete t.autoplay,delete t.changed,delete t._promises,delete t._redrawTimer,delete t._hmlumcount,delete t._hmpixcount,delete t._transitionData,delete t._transitioning,delete t._initialAutoSize,delete t._transitioningWithDuration,delete t._dragging,delete t._dragged,delete t._dragdata,delete t._hoverdata,delete t._snapshotInProgress,delete t._editing,delete t._mouseDownTime,delete t._legendMouseDownTime,t.removeAllListeners&&t.removeAllListeners()},g.style=function(t){var e,r=t._fullLayout._visibleModules,n=[];for(e=0;e<r.length;e++){var a=r[e];a.style&&l.pushUnique(n,a.style)}for(e=0;e<n.length;e++)n[e](t)},g.sanitizeMargins=function(t){if(t&&t.margin){var e,r=t.width,n=t.height,a=t.margin,i=r-(a.l+a.r),o=n-(a.t+a.b);i<0&&(e=(r-1)/(a.l+a.r),a.l=Math.floor(e*a.l),a.r=Math.floor(e*a.r)),o<0&&(e=(n-1)/(a.t+a.b),a.t=Math.floor(e*a.t),a.b=Math.floor(e*a.b))}},g.clearAutoMarginIds=function(t){t._fullLayout._pushmarginIds={}},g.allowAutoMargin=function(t,e){t._fullLayout._pushmarginIds[e]=1},g.autoMargin=function(t,e,r){var n=t._fullLayout,a=n._pushmargin,i=n._pushmarginIds;if(!1!==n.margin.autoexpand){if(r){var o=r.pad;if(void 0===o){var s=n.margin;o=Math.min(12,s.l,s.r,s.t,s.b)}r.l+r.r>.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0);var l=void 0!==r.xl?r.xl:r.x,u=void 0!==r.xr?r.xr:r.x,c=void 0!==r.yt?r.yt:r.y,h=void 0!==r.yb?r.yb:r.y;a[e]={l:{val:l,size:r.l+o},r:{val:u,size:r.r+o},b:{val:h,size:r.b+o},t:{val:c,size:r.t+o}},i[e]=1}else delete a[e],delete i[e];n._replotting||g.doAutoMargin(t)}},g.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),T(e);var r=e._size,n=e.margin,o=l.extendFlat({},r),s=n.l,u=n.r,c=n.t,h=n.b,d=e.width,f=e.height,p=e._pushmargin,m=e._pushmarginIds;if(!1!==e.margin.autoexpand){for(var y in p)m[y]||delete p[y];for(var v in p.base={l:{val:0,size:s},r:{val:1,size:u},t:{val:1,size:c},b:{val:0,size:h}},p){var _=p[v].l||{},x=p[v].b||{},b=_.val,w=_.size,M=x.val,k=x.size;for(var L in p){if(a(w)&&p[L].r){var A=p[L].r.val,S=p[L].r.size;if(A>b){var E=(w*A+(S-d)*b)/(A-b),C=(S*(1-b)+(w-d)*(1-A))/(A-b);E>=0&&C>=0&&d-(E+C)>0&&E+C>s+u&&(s=E,u=C)}}if(a(k)&&p[L].t){var D=p[L].t.val,P=p[L].t.size;if(D>M){var O=(k*D+(P-f)*M)/(D-M),z=(P*(1-M)+(k-f)*(1-D))/(D-M);O>=0&&z>=0&&f-(z+O)>0&&O+z>h+c&&(h=O,c=z)}}}}}if(r.l=Math.round(s),r.r=Math.round(u),r.t=Math.round(c),r.b=Math.round(h),r.p=Math.round(n.pad),r.w=Math.round(d)-r.l-r.r,r.h=Math.round(f)-r.t-r.b,!e._replotting&&g.didMarginChange(o,r))return"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1,i.call("plot",t)};var L=["l","r","t","b","p","w","h"];function A(t,e,r){var n=!1,a=[g.previousPromises,function(){if(t._transitionData)return t._transitioning=!1,function(t){var e=Promise.resolve();if(!t)return e;for(;t.length;)e=e.then(t.shift());return e}(t._transitionData._interruptCallbacks)},r.prepareFn,g.rehover,function(){return t.emit("plotly_transitioning",[]),new Promise((function(a){t._transitioning=!0,e.duration>0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return i.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var o=0,s=0;function l(){return o++,function(){var e;s++,n||s!==o||(e=a,t._transitionData&&(function(t){if(t)for(;t.length;)t.shift()}(t._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return i.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)))}}r.runFn(l),setTimeout(l())}))}],o=l.syncOrAsync(a,t);return o&&o.then||(o=Promise.resolve()),o.then((function(){return t}))}g.didMarginChange=function(t,e){for(var r=0;r<L.length;r++){var n=L[r],i=t[n],o=e[n];if(!a(i)||Math.abs(o-i)>1)return!0}return!1},g.graphJson=function(t,e,r,n,a){(a&&e&&!t._fullData||a&&!e&&!t._fullLayout)&&g.supplyDefaults(t);var i=a?t._fullData:t.data,o=a?t._fullLayout:t.layout,s=(t._transitionData||{})._frames;function u(t){if("function"==typeof t)return null;if(l.isPlainObject(t)){var e,n,a={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if("string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0&&!l.isPlainObject(t.stream))continue}else if("keepall"!==r&&"string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0)continue;a[e]=u(t[e])}return a}return Array.isArray(t)?t.map(u):l.isTypedArray(t)?l.simpleMap(t,l.identity):l.isJSDate(t)?l.ms2DateTimeLocal(+t):t}var c={data:(i||[]).map((function(t){var r=u(t);return e&&delete r.fit,r}))};return e||(c.layout=u(o)),t.framework&&t.framework.isPolar&&(c=t.framework.getConfig()),s&&(c.frames=u(s)),"object"===n?c:JSON.stringify(c)},g.modifyFrames=function(t,e){var r,n,a,i=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r<e.length;r++)switch((n=e[r]).type){case"replace":a=n.value;var s=(i[n.index]||{}).name,l=a.name;i[n.index]=o[l]=a,l!==s&&(delete o[s],o[l]=a);break;case"insert":o[(a=n.value).name]=a,i.splice(n.index,0,a);break;case"delete":delete o[(a=i[n.index]).name],i.splice(n.index,1)}return Promise.resolve()},g.computeFrame=function(t,e){var r,n,a,i,o=t._transitionData._frameHash;if(!e)throw new Error("computeFrame must be given a string frame name");var s=o[e.toString()];if(!s)return!1;for(var l=[s],u=[s.name];s.baseframe&&(s=o[s.baseframe.toString()])&&-1===u.indexOf(s.name);)l.push(s),u.push(s.name);for(var c={};s=l.pop();)if(s.layout&&(c.layout=g.extendLayout(c.layout,s.layout)),s.data){if(c.data||(c.data=[]),!(n=s.traces))for(n=[],r=0;r<s.data.length;r++)n[r]=r;for(c.traces||(c.traces=[]),r=0;r<s.data.length;r++)null!=(a=n[r])&&(-1===(i=c.traces.indexOf(a))&&(i=c.data.length,c.traces[i]=a),c.data[i]=g.extendTrace(c.data[i],s.data[r]))}return c},g.recomputeFrameHash=function(t){for(var e=t._transitionData._frameHash={},r=t._transitionData._frames,n=0;n<r.length;n++){var a=r[n];a&&a.name&&(e[a.name]=a)}},g.extendObjectWithContainers=function(t,e,r){var n,a,i,o,s,u,c,h=l.extendDeepNoArrays({},e||{}),d=l.expandObjectPaths(h),f={};if(r&&r.length)for(i=0;i<r.length;i++)void 0===(a=(n=l.nestedProperty(d,r[i])).get())?l.nestedProperty(f,r[i]).set(null):(n.set(null),l.nestedProperty(f,r[i]).set(a));if(t=l.extendDeepNoArrays(t||{},d),r&&r.length)for(i=0;i<r.length;i++)if(u=l.nestedProperty(f,r[i]).get()){for(c=(s=l.nestedProperty(t,r[i])).get(),Array.isArray(c)||(c=[],s.set(c)),o=0;o<u.length;o++){var p=u[o];c[o]=null===p?null:g.extendObjectWithContainers(c[o],p)}s.set(c)}return t},g.dataArrayContainers=["transforms","dimensions"],g.layoutArrayContainers=i.layoutArrayContainers,g.extendTrace=function(t,e){return g.extendObjectWithContainers(t,e,g.dataArrayContainers)},g.extendLayout=function(t,e){return g.extendObjectWithContainers(t,e,g.layoutArrayContainers)},g.transition=function(t,e,r,n,a,i){var o={redraw:a.redraw},s={},u=[];return o.prepareFn=function(){for(var a=Array.isArray(e)?e.length:0,i=n.slice(0,a),o=0;o<i.length;o++){var c=i[o],h=t._fullData[c]._module;if(h){if(h.animatable){var d=h.basePlotModule.name;s[d]||(s[d]=[]),s[d].push(c)}t.data[i[o]]=g.extendTrace(t.data[i[o]],e[o])}}var f=l.expandObjectPaths(l.extendDeepNoArrays({},r)),p=/^[xy]axis[0-9]*$/;for(var m in f)p.test(m)&&delete f[m].range;g.extendLayout(t.layout,f),delete t.calcdata,g.supplyDefaults(t),g.doCalcdata(t);var y=l.expandObjectPaths(r);if(y){var v=t._fullLayout._plots;for(var _ in v){var x,b,w,M,k=v[_],T=k.xaxis,L=k.yaxis,A=T.range.slice(),S=L.range.slice();Array.isArray(y[T._name+".range"])?x=y[T._name+".range"].slice():Array.isArray((y[T._name]||{}).range)&&(x=y[T._name].range.slice()),Array.isArray(y[L._name+".range"])?b=y[L._name+".range"].slice():Array.isArray((y[L._name]||{}).range)&&(b=y[L._name].range.slice()),A&&x&&(A[0]!==x[0]||A[1]!==x[1])&&(w={xr0:A,xr1:x}),S&&b&&(S[0]!==b[0]||S[1]!==b[1])&&(M={yr0:S,yr1:b}),(w||M)&&u.push(l.extendFlat({plotinfo:k},w,M))}}return Promise.resolve()},o.runFn=function(e){var n,a,o=t._fullLayout._basePlotModules,c=u.length;if(r)for(a=0;a<o.length;a++)o[a].transitionAxes&&o[a].transitionAxes(t,u,i,e);for(var h in c?((n=l.extendFlat({},i)).duration=0,delete s.cartesian):n=i,s){var d=s[h];t._fullData[d[0]]._module.basePlotModule.plot(t,d,n,e)}},A(t,i,o)},g.transitionFromReact=function(t,e,r,n){var a=t._fullLayout,i=a.transition,o={},s=[];return o.prepareFn=function(){var t=a._plots;for(var i in o.redraw=!1,"some"===e.anim&&(o.redraw=!0),"some"===r.anim&&(o.redraw=!0),t){var u,c,h=t[i],d=h.xaxis,f=h.yaxis,p=n[d._name].range.slice(),m=n[f._name].range.slice(),g=d.range.slice(),y=f.range.slice();d.setScale(),f.setScale(),p[0]===g[0]&&p[1]===g[1]||(u={xr0:p,xr1:g}),m[0]===y[0]&&m[1]===y[1]||(c={yr0:m,yr1:y}),(u||c)&&s.push(l.extendFlat({plotinfo:h},u,c))}return Promise.resolve()},o.runFn=function(r){for(var n,a,o,u=t._fullData,c=t._fullLayout._basePlotModules,h=[],d=0;d<u.length;d++)h.push(d);function f(){for(var e=0;e<c.length;e++)c[e].transitionAxes&&c[e].transitionAxes(t,s,n,r)}function p(){for(var e=0;e<c.length;e++)c[e].plot(t,o,a,r)}s.length&&e.anim?"traces first"===i.ordering?(n=l.extendFlat({},i,{duration:0}),o=h,a=i,p(),setTimeout(f,i.duration)):(n=i,o=null,a=l.extendFlat({},i,{duration:0}),f(),p()):s.length?(n=i,f()):e.anim&&(o=h,a=i,p())},A(t,i,o)},g.doCalcdata=function(t,e){var r,n,a,s,u=h.list(t),d=t._fullData,f=t._fullLayout,p=new Array(d.length),m=(t.calcdata||[]).slice();for(t.calcdata=p,f._numBoxes=0,f._numViolins=0,f._violinScaleGroupStats={},t._hmpixcount=0,t._hmlumcount=0,f._piecolormap={},f._sunburstcolormap={},f._funnelareacolormap={},a=0;a<d.length;a++)Array.isArray(e)&&-1===e.indexOf(a)&&(p[a]=m[a]);for(a=0;a<d.length;a++)(r=d[a])._arrayAttrs=o.findArrayAttributes(r),r._extremes={};var g=f._subplots.polar||[];for(a=0;a<g.length;a++)u.push(f[g[a]].radialaxis,f[g[a]].angularaxis);var v=!1;function _(e){if(r=d[e],n=r._module,!0===r.visible&&r.transforms){if(n&&n.calc){var a=n.calc(t,r);a[0]&&a[0].t&&a[0].t._scene&&delete a[0].t._scene.dirty}for(s=0;s<r.transforms.length;s++){var i=r.transforms[s];(n=y[i.type])&&n.calcTransform&&(r._hasCalcTransform=!0,v=!0,n.calcTransform(t,r,i))}}}function x(e,a){if(r=d[e],!!(n=r._module).isContainer===a){var i=[];if(!0===r.visible&&0!==r._length){delete r._indexToPoints;var o=r.transforms||[];for(s=o.length-1;s>=0;s--)if(o[s].enabled){r._indexToPoints=o[s]._indexToPoints;break}n&&n.calc&&(i=n.calc(t,r))}Array.isArray(i)&&i[0]||(i=[{x:c,y:c}]),i[0].t||(i[0].t={}),i[0].trace=r,p[e]=i}}for(E(u,d),a=0;a<d.length;a++)x(a,!0);for(a=0;a<d.length;a++)_(a);for(v&&E(u,d),a=0;a<d.length;a++)x(a,!0);for(a=0;a<d.length;a++)x(a,!1);C(t);var b=function(t,e){var r,n,a,o,s,u=[];function c(t,r,n){var a=r._id.charAt(0);if("histogram2dcontour"===t){var i=r._counterAxes[0],o=h.getFromId(e,i),s="x"===a||"x"===i&&"category"===o.type,l="y"===a||"y"===i&&"category"===o.type;return function(t,e){return 0===t||0===e||s&&t===n[e].length-1||l&&e===n.length-1?-1:("y"===a?e:t)-1}}return function(t,e){return"y"===a?e:t}}var d={min:function(t){return l.aggNums(Math.min,null,t)},max:function(t){return l.aggNums(Math.max,null,t)},sum:function(t){return l.aggNums((function(t,e){return t+e}),null,t)},total:function(t){return l.aggNums((function(t,e){return t+e}),null,t)},mean:function(t){return l.mean(t)},median:function(t){return l.median(t)}};for(r=0;r<t.length;r++){var f=t[r];if("category"===f.type){var p=f.categoryorder.match(S);if(p){var m=p[1],g=p[2],y=[];for(n=0;n<f._categories.length;n++)y.push([f._categories[n],[]]);for(n=0;n<f._traceIndices.length;n++){var v=f._traceIndices[n],_=e._fullData[v],x=f._id.charAt(0);if(!0===_.visible){var b=_.type;i.traceIs(_,"histogram")&&(delete _._xautoBinFinished,delete _._yautoBinFinished);var w=e.calcdata[v];for(a=0;a<w.length;a++){var M,k,T,L=w[a];if("splom"===b){var A=_._axesDim[f._id];if("y"===x){var E=_._diag[A][0];E&&(f=e._fullLayout[h.id2name(E)])}var C=L.trace.dimensions[A].values;for(o=0;o<C.length;o++)for(M=C[o],k=f._categoriesMap[M],s=0;s<L.trace.dimensions.length;s++)if(s!==A){var D=L.trace.dimensions[s];y[k][1].push(D.values[o])}}else if("scattergl"===b){for(o=0;o<L.t.x.length;o++)"x"===x&&(k=M=L.t.x[o],T=L.t.y[o]),"y"===x&&(k=M=L.t.y[o],T=L.t.x[o]),y[k][1].push(T);L.t&&L.t._scene&&delete L.t._scene.dirty}else if(L.hasOwnProperty("z")){T=L.z;var P=c(_.type,f,T);for(o=0;o<T.length;o++)for(s=0;s<T[o].length;s++)(k=P(s,o))+1&&y[k][1].push(T[o][s])}else for("x"===x?(M=L.p+1?L.p:L.x,T=L.s||L.v||L.y):"y"===x&&(M=L.p+1?L.p:L.y,T=L.s||L.v||L.x),Array.isArray(T)||(T=[T]),o=0;o<T.length;o++)y[M][1].push(T[o])}}}f._categoriesValue=y;var O=[];for(n=0;n<y.length;n++)O.push([y[n][0],d[m](y[n][1])]);O.sort((function(t,e){return t[1]-e[1]})),f._categoriesAggregatedValue=O,f._initialCategories=O.map((function(t){return t[0]})),"descending"===g&&f._initialCategories.reverse(),u=u.concat(f.sortByInitialCategories())}}}return u}(u,t);if(b.length){for(f._numBoxes=0,f._numViolins=0,a=0;a<b.length;a++)x(b[a],!0);for(a=0;a<b.length;a++)x(b[a],!1);C(t)}i.getComponentMethod("fx","calc")(t),i.getComponentMethod("errorbars","calc")(t)};var S=/(total|sum|min|max|mean|median) (ascending|descending)/;function E(t,e){for(var r=0;r<t.length;r++){var n=t[r];n.clearCalc(),"multicategory"===n.type&&n.setupMultiCategory(e)}}function C(t){var e,r,n,a=t._fullLayout,i=a._visibleModules,o={};for(r=0;r<i.length;r++){var s=i[r],u=s.crossTraceCalc;if(u){var c=s.basePlotModule.name;o[c]?l.pushUnique(o[c],u):o[c]=[u]}}for(n in o){var h=o[n],d=a._subplots[n];if(Array.isArray(d))for(e=0;e<d.length;e++){var f=d[e],p="cartesian"===n?a._plots[f]:a[f];for(r=0;r<h.length;r++)h[r](t,p,f)}else for(r=0;r<h.length;r++)h[r](t)}}g.rehover=function(t){t._fullLayout._rehover&&t._fullLayout._rehover()},g.redrag=function(t){t._fullLayout._redrag&&t._fullLayout._redrag()},g.generalUpdatePerTraceModule=function(t,e,r,n){var a,i=e.traceHash,o={};for(a=0;a<r.length;a++){var s=r[a],u=s[0].trace;u.visible&&(o[u.type]=o[u.type]||[],o[u.type].push(s))}for(var c in i)if(!o[c]){var h=i[c][0];h[0].trace.visible=!1,o[c]=[h]}for(var d in o){var f=o[d];f[0][0].trace._module.plot(t,e,l.filterVisible(f),n)}e.traceHash=o}},{"../components/color":593,"../constants/numerical":695,"../lib":719,"../plot_api/plot_schema":756,"../plot_api/plot_template":757,"../registry":847,"./animation_attributes":762,"./attributes":764,"./cartesian/axis_ids":770,"./command":791,"./font_attributes":793,"./frame_attributes":794,"./layout_attributes":819,d3:163,"fast-isnumeric":225}],829:[function(t,e,r){e.exports={attr:"subplot",name:"polar",axisNames:["angularaxis","radialaxis"],axisName2dataArray:{angularaxis:"theta",radialaxis:"r"},layerNames:["draglayer","plotbg","backplot","angular-grid","radial-grid","frontplot","angular-line","radial-line","angular-axis","radial-axis"],radialDragBoxSize:50,angularDragBoxSize:30,cornerLen:25,cornerHalfWidth:2,MINDRAG:8,MINZOOM:20,OFFEDGE:20}},{}],830:[function(t,e,r){var n=t("../../lib"),a=t("../../lib/polygon").tester,i=n.findIndexOfMin,o=n.isAngleInsideSector,s=n.angleDelta,l=n.angleDist;function u(t,e,r,n){var a,i,o=n[0],s=n[1],l=h(Math.sin(e)-Math.sin(t)),u=h(Math.cos(e)-Math.cos(t)),c=Math.tan(r),d=h(1/c),f=l/u,p=s-f*o;return d?l&&u?i=c*(a=p/(c-f)):u?(a=s*d,i=s):(a=o,i=o*c):l&&u?(a=0,i=p):u?(a=0,i=s):a=i=NaN,[a,i]}function c(t,e,r,a){return n.isFullCircle([e,r])?function(t,e){var r,n=e.length,a=new Array(n+1);for(r=0;r<n;r++){var i=e[r];a[r]=[t*Math.cos(i),t*Math.sin(i)]}return a[r]=a[0].slice(),a}(t,a):function(t,e,r,a){var s,c,h=a.length,d=[];function f(e){return[t*Math.cos(e),t*Math.sin(e)]}function p(t,e,r){return u(t,e,r,f(t))}function m(t){return n.mod(t,h)}function g(t){return o(t,[e,r])}var y=i(a,(function(t){return g(t)?l(t,e):1/0})),v=p(a[y],a[m(y-1)],e);for(d.push(v),s=y,c=0;c<h;s++,c++){var _=a[m(s)];if(!g(_))break;d.push(f(_))}var x=i(a,(function(t){return g(t)?l(t,r):1/0})),b=p(a[x],a[m(x+1)],r);return d.push(b),d.push([0,0]),d.push(d[0].slice()),d}(t,e,r,a)}function h(t){return Math.abs(t)>1e-10?t:0}function d(t,e,r){e=e||0,r=r||0;for(var n=t.length,a=new Array(n),i=0;i<n;i++){var o=t[i];a[i]=[e+o[0],r-o[1]]}return a}e.exports={isPtInsidePolygon:function(t,e,r,n,i){if(!o(e,n))return!1;var s,l;r[0]<r[1]?(s=r[0],l=r[1]):(s=r[1],l=r[0]);var u=a(c(s,n[0],n[1],i)),h=a(c(l,n[0],n[1],i)),d=[t*Math.cos(e),t*Math.sin(e)];return h.contains(d)&&!u.contains(d)},findPolygonOffset:function(t,e,r,n){for(var a=1/0,i=1/0,o=c(t,e,r,n),s=0;s<o.length;s++){var l=o[s];a=Math.min(a,l[0]),i=Math.min(i,-l[1])}return[a,i]},findEnclosingVertexAngles:function(t,e){var r=i(e,(function(e){var r=s(e,t);return r>0?r:1/0})),a=n.mod(r+1,e.length);return[e[r],e[a]]},findIntersectionXY:u,findXYatLength:function(t,e,r,n){var a=-e*r,i=e*e+1,o=2*(e*a-r),s=a*a+r*r-t*t,l=Math.sqrt(o*o-4*i*s),u=(-o+l)/(2*i),c=(-o-l)/(2*i);return[[u,e*u+a+n],[c,e*c+a+n]]},clampTiny:h,pathPolygon:function(t,e,r,n,a,i){return"M"+d(c(t,e,r,n),a,i).join("L")},pathPolygonAnnulus:function(t,e,r,n,a,i,o){var s,l;t<e?(s=t,l=e):(s=e,l=t);var u=d(c(s,r,n,a),i,o);return"M"+d(c(l,r,n,a),i,o).reverse().join("L")+"M"+u.join("L")}}},{"../../lib":719,"../../lib/polygon":731}],831:[function(t,e,r){var n=t("../get_data").getSubplotCalcData,a=t("../../lib").counterRegex,i=t("./polar"),o=t("./constants"),s=o.attr,l=o.name,u=a(l),c={};c[s]={valType:"subplotid",dflt:l,editType:"calc"},e.exports={attr:s,name:l,idRoot:l,idRegex:u,attrRegex:u,attributes:c,layoutAttributes:t("./layout_attributes"),supplyLayoutDefaults:t("./layout_defaults"),plot:function(t){for(var e=t._fullLayout,r=t.calcdata,a=e._subplots[l],o=0;o<a.length;o++){var s=a[o],u=n(r,l,s),c=e[s]._subplot;c||(c=i(t,s),e[s]._subplot=c),c.plot(u,e,t._promises)}},clean:function(t,e,r,n){for(var a=n._subplots[l]||[],i=n._has&&n._has("gl"),o=e._has&&e._has("gl"),s=i&&!o,u=0;u<a.length;u++){var c=a[u],h=n[c]._subplot;if(!e[c]&&h)for(var d in h.framework.remove(),h.layers["radial-axis-title"].remove(),h.clipPaths)h.clipPaths[d].remove();s&&h._scene&&(h._scene.destroy(),h._scene=null)}},toSVG:t("../cartesian").toSVG}},{"../../lib":719,"../cartesian":778,"../get_data":802,"./constants":829,"./layout_attributes":832,"./layout_defaults":833,"./polar":840}],832:[function(t,e,r){var n=t("../../components/color/attributes"),a=t("../cartesian/layout_attributes"),i=t("../domain").attributes,o=t("../../lib").extendFlat,s=t("../../plot_api/edit_types").overrideAll,l=s({color:a.color,showline:o({},a.showline,{dflt:!0}),linecolor:a.linecolor,linewidth:a.linewidth,showgrid:o({},a.showgrid,{dflt:!0}),gridcolor:a.gridcolor,gridwidth:a.gridwidth},"plot","from-root"),u=s({tickmode:a.tickmode,nticks:a.nticks,tick0:a.tick0,dtick:a.dtick,tickvals:a.tickvals,ticktext:a.ticktext,ticks:a.ticks,ticklen:a.ticklen,tickwidth:a.tickwidth,tickcolor:a.tickcolor,showticklabels:a.showticklabels,showtickprefix:a.showtickprefix,tickprefix:a.tickprefix,showticksuffix:a.showticksuffix,ticksuffix:a.ticksuffix,showexponent:a.showexponent,exponentformat:a.exponentformat,separatethousands:a.separatethousands,tickfont:a.tickfont,tickangle:a.tickangle,tickformat:a.tickformat,tickformatstops:a.tickformatstops,layer:a.layer},"plot","from-root"),c={visible:o({},a.visible,{dflt:!0}),type:o({},a.type,{values:["-","linear","log","date","category"]}),autorange:o({},a.autorange,{editType:"plot"}),rangemode:{valType:"enumerated",values:["tozero","nonnegative","normal"],dflt:"tozero",editType:"calc"},range:o({},a.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],editType:"plot"}),categoryorder:a.categoryorder,categoryarray:a.categoryarray,angle:{valType:"angle",editType:"plot"},side:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"clockwise",editType:"plot"},title:s(a.title,"plot","from-root"),hoverformat:a.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc",_deprecated:{title:a._deprecated.title,titlefont:a._deprecated.titlefont}};c.title.text.dflt="",o(c,l,u);var h={visible:o({},a.visible,{dflt:!0}),type:{valType:"enumerated",values:["-","linear","category"],dflt:"-",editType:"calc",_noTemplating:!0},categoryorder:a.categoryorder,categoryarray:a.categoryarray,thetaunit:{valType:"enumerated",values:["radians","degrees"],dflt:"degrees",editType:"calc"},period:{valType:"number",editType:"calc",min:0},direction:{valType:"enumerated",values:["counterclockwise","clockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",editType:"calc"},hoverformat:a.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};o(h,l,u),e.exports={domain:i({name:"polar",editType:"plot"}),sector:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],dflt:[0,360],editType:"plot"},hole:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},bgcolor:{valType:"color",editType:"plot",dflt:n.background},radialaxis:c,angularaxis:h,gridshape:{valType:"enumerated",values:["circular","linear"],dflt:"circular",editType:"plot"},uirevision:{valType:"any",editType:"none"},editType:"calc"}},{"../../components/color/attributes":592,"../../lib":719,"../../plot_api/edit_types":750,"../cartesian/layout_attributes":779,"../domain":792}],833:[function(t,e,r){var n=t("../../lib"),a=t("../../components/color"),i=t("../../plot_api/plot_template"),o=t("../subplot_defaults"),s=t("../get_data").getSubplotData,l=t("../cartesian/tick_value_defaults"),u=t("../cartesian/tick_mark_defaults"),c=t("../cartesian/tick_label_defaults"),h=t("../cartesian/category_order_defaults"),d=t("../cartesian/line_grid_defaults"),f=t("../cartesian/axis_autotype"),p=t("./layout_attributes"),m=t("./set_convert"),g=t("./constants"),y=g.axisNames;function v(t,e,r,o){var f=r("bgcolor");o.bgColor=a.combine(f,o.paper_bgcolor);var v=r("sector");r("hole");var x,b=s(o.fullData,g.name,o.id),w=o.layoutOut;function M(t,e){return r(x+"."+t,e)}for(var k=0;k<y.length;k++){x=y[k],n.isPlainObject(t[x])||(t[x]={});var T=t[x],L=i.newContainer(e,x);L._id=L._name=x,L._attr=o.id+"."+x,L._traceIndices=b.map((function(t){return t._expandedIndex}));var A=g.axisName2dataArray[x],S=_(T,L,M,b,A);h(T,L,M,{axData:b,dataAttr:A});var E,C,D=M("visible");switch(m(L,e,w),M("uirevision",e.uirevision),D&&(C=(E=M("color"))===T.color?E:o.font.color),L._m=1,x){case"radialaxis":var P=M("autorange",!L.isValidRange(T.range));T.autorange=P,!P||"linear"!==S&&"-"!==S||M("rangemode"),"reversed"===P&&(L._m=-1),M("range"),L.cleanRange("range",{dfltRange:[0,1]}),D&&(M("side"),M("angle",v[0]),M("title.text"),n.coerceFont(M,"title.font",{family:o.font.family,size:Math.round(1.2*o.font.size),color:C}));break;case"angularaxis":if("date"===S){n.log("Polar plots do not support date angular axes yet.");for(var O=0;O<b.length;O++)b[O].visible=!1;S=T.type=L.type="linear"}M("linear"===S?"thetaunit":"period");var z=M("direction");M("rotation",{counterclockwise:0,clockwise:90}[z])}D&&(l(T,L,M,L.type),c(T,L,M,L.type,{tickSuffixDflt:"degrees"===L.thetaunit?"°":void 0}),u(T,L,M,{outerTicks:!0}),M("showticklabels")&&(n.coerceFont(M,"tickfont",{family:o.font.family,size:o.font.size,color:C}),M("tickangle"),M("tickformat")),d(T,L,M,{dfltColor:E,bgColor:o.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:p[x]}),M("layer")),"category"!==S&&M("hoverformat"),L._input=T}"category"===e.angularaxis.type&&r("gridshape")}function _(t,e,r,n,a){if("-"===r("type")){for(var i,o=0;o<n.length;o++)if(n[o].visible){i=n[o];break}i&&i[a]&&(e.type=f(i[a],"gregorian")),"-"===e.type?e.type="linear":t.type=e.type}return e.type}e.exports=function(t,e,r){o(t,e,r,{type:g.name,attributes:p,handleDefaults:v,font:e.font,paper_bgcolor:e.paper_bgcolor,fullData:r,layoutOut:e})}},{"../../components/color":593,"../../lib":719,"../../plot_api/plot_template":757,"../cartesian/axis_autotype":768,"../cartesian/category_order_defaults":771,"../cartesian/line_grid_defaults":781,"../cartesian/tick_label_defaults":786,"../cartesian/tick_mark_defaults":787,"../cartesian/tick_value_defaults":788,"../get_data":802,"../subplot_defaults":842,"./constants":829,"./layout_attributes":832,"./set_convert":841}],834:[function(t,e,r){var n=t("../../../traces/scatter/attributes"),a=n.marker,i=t("../../../lib/extend").extendFlat;["Area traces are deprecated!","Please switch to the *barpolar* trace type."].join(" "),e.exports={r:i({},n.r,{}),t:i({},n.t,{}),marker:{color:i({},a.color,{}),size:i({},a.size,{}),symbol:i({},a.symbol,{}),opacity:i({},a.opacity,{}),editType:"calc"}}},{"../../../lib/extend":710,"../../../traces/scatter/attributes":1112}],835:[function(t,e,r){var n=t("../../cartesian/layout_attributes"),a=t("../../../lib/extend").extendFlat,i=t("../../../plot_api/edit_types").overrideAll,o=["Legacy polar charts are deprecated!","Please switch to *polar* subplots."].join(" "),s=a({},n.domain,{});function l(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",description:o},visible:{valType:"boolean"}})}e.exports=i({radialaxis:l(0,{range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},domain:s,orientation:{valType:"number"}}),angularaxis:l(0,{range:{valType:"info_array",items:[{valType:"number",dflt:0},{valType:"number",dflt:360}]},domain:s}),layout:{direction:{valType:"enumerated",values:["clockwise","counterclockwise"]},orientation:{valType:"angle"}}},"plot","nested")},{"../../../lib/extend":710,"../../../plot_api/edit_types":750,"../../cartesian/layout_attributes":779}],836:[function(t,e,r){(e.exports=t("./micropolar")).manager=t("./micropolar_manager")},{"./micropolar":837,"./micropolar_manager":838}],837:[function(t,e,r){var n=t("d3"),a=t("../../../lib").extendDeepAll,i=t("../../../constants/alignment").MID_SHIFT,o=e.exports={version:"0.2.2"};o.Axis=function(){var t,e,r,s,l={data:[],layout:{}},u={},c={},h=n.dispatch("hover"),d={render:function(u){return function(u){e=u||e;var h=l.data,d=l.layout;("string"==typeof e||e.nodeName)&&(e=n.select(e)),e.datum(h).each((function(e,l){var u=e.slice();c={data:o.util.cloneJson(u),layout:o.util.cloneJson(d)};var h=0;u.forEach((function(t,e){t.color||(t.color=d.defaultColorRange[h],h=(h+1)%d.defaultColorRange.length),t.strokeColor||(t.strokeColor="LinePlot"===t.geometry?t.color:n.rgb(t.color).darker().toString()),c.data[e].color=t.color,c.data[e].strokeColor=t.strokeColor,c.data[e].strokeDash=t.strokeDash,c.data[e].strokeSize=t.strokeSize}));var f=u.filter((function(t,e){var r=t.visible;return void 0===r||!0===r})),p=!1,m=f.map((function(t,e){return p=p||void 0!==t.groupId,t}));if(p){var g=n.nest().key((function(t,e){return void 0!==t.groupId?t.groupId:"unstacked"})).entries(m),y=[],v=g.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],y.push(r),r=o.util.sumArrays(t.r,r)})),t.values}));f=n.merge(v)}f.forEach((function(t,e){t.t=Array.isArray(t.t[0])?t.t:[t.t],t.r=Array.isArray(t.r[0])?t.r:[t.r]}));var _=Math.min(d.width-d.margin.left-d.margin.right,d.height-d.margin.top-d.margin.bottom)/2;_=Math.max(10,_);var x,b=[d.margin.left+_,d.margin.top+_];x=p?[0,n.max(o.util.sumArrays(o.util.arrayLast(f).r[0],o.util.arrayLast(y)))]:n.extent(o.util.flattenArray(f.map((function(t,e){return t.r})))),d.radialAxis.domain!=o.DATAEXTENT&&(x[0]=0),r=n.scale.linear().domain(d.radialAxis.domain!=o.DATAEXTENT&&d.radialAxis.domain?d.radialAxis.domain:x).range([0,_]),c.layout.radialAxis.domain=r.domain();var w,M=o.util.flattenArray(f.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),f=f.map((function(t,e){var r=t;return t.t=[M],p&&(r.yStack=t.yStack),r})));var T=f.filter((function(t,e){return"LinePlot"===t.geometry||"DotPlot"===t.geometry})).length===f.length,L=null===d.needsEndSpacing?k||!T:d.needsEndSpacing,A=d.angularAxis.domain&&d.angularAxis.domain!=o.DATAEXTENT&&!k&&d.angularAxis.domain[0]>=0?d.angularAxis.domain:n.extent(M),S=Math.abs(M[1]-M[0]);T&&!k&&(S=0);var E=A.slice();L&&k&&(E[1]+=S);var C=d.angularAxis.ticksCount||4;C>8&&(C=C/(C/8)+C%8),d.angularAxis.ticksStep&&(C=(E[1]-E[0])/C);var D=d.angularAxis.ticksStep||(E[1]-E[0])/(C*(d.minorTicks+1));w&&(D=Math.max(Math.round(D),1)),E[2]||(E[2]=D);var P=n.range.apply(this,E);if(P=P.map((function(t,e){return parseFloat(t.toPrecision(12))})),s=n.scale.linear().domain(E.slice(0,2)).range("clockwise"===d.direction?[0,360]:[360,0]),c.layout.angularAxis.domain=s.domain(),c.layout.angularAxis.endPadding=L?S:0,void 0===(t=n.select(this).select("svg.chart-root"))||t.empty()){var O=(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"),z=this.appendChild(this.ownerDocument.importNode(O.documentElement,!0));t=n.select(z)}t.select(".guides-group").style({"pointer-events":"none"}),t.select(".angular.axis-group").style({"pointer-events":"none"}),t.select(".radial.axis-group").style({"pointer-events":"none"});var I,R=t.select(".chart-group"),F={fill:"none",stroke:d.tickColor},N={"font-size":d.font.size,"font-family":d.font.family,fill:d.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map((function(t,e){return" "+t+" 0 "+d.font.outlineColor})).join(",")};if(d.showLegend){I=t.select(".legend-group").attr({transform:"translate("+[_,d.margin.top]+")"}).style({display:"block"});var Y=f.map((function(t,e){var r=o.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend=void 0===t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r}));o.Legend().config({data:f.map((function(t,e){return t.name||"Element"+e})),legendConfig:a({},o.Legend.defaultConfig().legendConfig,{container:I,elements:Y,reverseOrder:d.legend.reverseOrder})})();var j=I.node().getBBox();_=Math.min(d.width-j.width-d.margin.left-d.margin.right,d.height-d.margin.top-d.margin.bottom)/2,_=Math.max(10,_),b=[d.margin.left+_,d.margin.top+_],r.range([0,_]),c.layout.radialAxis.domain=r.domain(),I.attr("transform","translate("+[b[0]+_,b[1]-_]+")")}else I=t.select(".legend-group").style({display:"none"});t.attr({width:d.width,height:d.height}).style({opacity:d.opacity}),R.attr("transform","translate("+b+")").style({cursor:"crosshair"});var B=[(d.width-(d.margin.left+d.margin.right+2*_+(j?j.width:0)))/2,(d.height-(d.margin.top+d.margin.bottom+2*_))/2];if(B[0]=Math.max(0,B[0]),B[1]=Math.max(0,B[1]),t.select(".outer-group").attr("transform","translate("+B+")"),d.title&&d.title.text){var H=t.select("g.title-group text").style(N).text(d.title.text),U=H.node().getBBox();H.attr({x:b[0]-U.width/2,y:b[1]-_-20})}var V=t.select(".radial.axis-group");if(d.radialAxis.gridLinesVisible){var W=V.selectAll("circle.grid-circle").data(r.ticks(5));W.enter().append("circle").attr({class:"grid-circle"}).style(F),W.attr("r",r),W.exit().remove()}V.select("circle.outside-circle").attr({r:_}).style(F);var G=t.select("circle.background-circle").attr({r:_}).style({fill:d.backgroundColor,stroke:d.stroke});function q(t,e){return s(t)%360+d.orientation}if(d.radialAxis.visible){var Z=n.svg.axis().scale(r).ticks(5).tickSize(5);V.call(Z).attr({transform:"rotate("+d.radialAxis.orientation+")"}),V.selectAll(".domain").style(F),V.selectAll("g>text").text((function(t,e){return this.textContent+d.radialAxis.ticksSuffix})).style(N).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===d.radialAxis.tickOrientation?"rotate("+-d.radialAxis.orientation+") translate("+[0,N["font-size"]]+")":"translate("+[0,N["font-size"]]+")"}}),V.selectAll("g>line").style({stroke:"black"})}var X=t.select(".angular.axis-group").selectAll("g.angular-tick").data(P),J=X.enter().append("g").classed("angular-tick",!0);X.attr({transform:function(t,e){return"rotate("+q(t)+")"}}).style({display:d.angularAxis.visible?"block":"none"}),X.exit().remove(),J.append("line").classed("grid-line",!0).classed("major",(function(t,e){return e%(d.minorTicks+1)==0})).classed("minor",(function(t,e){return!(e%(d.minorTicks+1)==0)})).style(F),J.selectAll(".minor").style({stroke:d.minorTickColor}),X.select("line.grid-line").attr({x1:d.tickLength?_-d.tickLength:0,x2:_}).style({display:d.angularAxis.gridLinesVisible?"block":"none"}),J.append("text").classed("axis-text",!0).style(N);var K=X.select("text.axis-text").attr({x:_+d.labelOffset,dy:i+"em",transform:function(t,e){var r=q(t),n=_+d.labelOffset,a=d.angularAxis.tickOrientation;return"horizontal"==a?"rotate("+-r+" "+n+" 0)":"radial"==a?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:d.angularAxis.labelsVisible?"block":"none"}).text((function(t,e){return e%(d.minorTicks+1)!=0?"":w?w[t]+d.angularAxis.ticksSuffix:t+d.angularAxis.ticksSuffix})).style(N);d.angularAxis.rewriteTicks&&K.text((function(t,e){return e%(d.minorTicks+1)!=0?"":d.angularAxis.rewriteTicks(this.textContent,e)}));var $=n.max(R.selectAll(".angular-tick text")[0].map((function(t,e){return t.getCTM().e+t.getBBox().width})));I.attr({transform:"translate("+[_+$,d.margin.top]+")"});var Q=t.select("g.geometry-group").selectAll("g").size()>0,tt=t.select("g.geometry-group").selectAll("g.geometry").data(f);if(tt.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),tt.exit().remove(),f[0]||Q){var et=[];f.forEach((function(t,e){var n={};n.radialScale=r,n.angularScale=s,n.container=tt.filter((function(t,r){return r==e})),n.geometry=t.geometry,n.orientation=d.orientation,n.direction=d.direction,n.index=e,et.push({data:t,geometryConfig:n})}));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 at,it,ot=t.select(".guides-group"),st=t.select(".tooltips-group"),lt=o.tooltipPanel().config({container:st,fontSize:8})(),ut=o.tooltipPanel().config({container:st,fontSize:8})(),ct=o.tooltipPanel().config({container:st,hasTick:!0})();if(!k){var ht=ot.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});R.on("mousemove.angular-guide",(function(t,e){var r=o.util.getMousePos(G).angle;ht.attr({x2:-_,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-d.orientation)%360;at=s.invert(n);var a=o.util.convertToCartesian(_+12,r+180);lt.text(o.util.round(at)).move([a[0]+b[0],a[1]+b[1]])})).on("mouseout.angular-guide",(function(t,e){ot.select("line").style({opacity:0})}))}var dt=ot.select("circle").style({stroke:"grey",fill:"none"});R.on("mousemove.radial-guide",(function(t,e){var n=o.util.getMousePos(G).radius;dt.attr({r:n}).style({opacity:.5}),it=r.invert(o.util.getMousePos(G).radius);var a=o.util.convertToCartesian(n,d.radialAxis.orientation);ut.text(o.util.round(it)).move([a[0]+b[0],a[1]+b[1]])})).on("mouseout.radial-guide",(function(t,e){dt.style({opacity:0}),ct.hide(),lt.hide(),ut.hide()})),t.selectAll(".geometry-group .mark").on("mouseover.tooltip",(function(e,r){var a=n.select(this),i=this.style.fill,s="black",l=this.style.opacity||1;if(a.attr({"data-opacity":l}),i&&"none"!==i){a.attr({"data-fill":i}),s=n.hsl(i).darker().toString(),a.style({fill:s,opacity:1});var u={t:o.util.round(e[0]),r:o.util.round(e[1])};k&&(u.t=w[e[0]]);var c="t: "+u.t+", r: "+u.r,h=this.getBoundingClientRect(),d=t.node().getBoundingClientRect(),f=[h.left+h.width/2-B[0]-d.left,h.top+h.height/2-B[1]-d.top];ct.config({color:s}).text(c),ct.move(f)}else i=this.style.stroke||"black",a.attr({"data-stroke":i}),s=n.hsl(i).darker().toString(),a.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),a=r.attr("data-fill");a?r.style({fill:a,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})}))}))}(u),this},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},getLiveConfig:function(){return c},getinputConfig:function(){return u},radialScale:function(t){return r},angularScale:function(t){return s},svg:function(){return t}};return n.rebind(d,h,"on"),d},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 a=e||6,i=[],o=[];n.range(0,360+a,a).forEach((function(e,r){var n=e*Math.PI/180,a=t(n);i.push(e),o.push(a)}));var s={t:i,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-2===r},o.util.flattenArray=function(t){for(var e=[];!o.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},o.util.deduplicate=function(t){return t.filter((function(t,e,r){return r.indexOf(t)==e}))},o.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},o.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},o.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],a=e[1],i={};return i.x=r,i.y=a,i.pos=e,i.angle=180*(Math.atan2(a,r)+Math.PI)/Math.PI,i.radius=Math.sqrt(r*r+a*a),i},o.util.duplicatesCount=function(t){for(var e,r={},n={},a=0,i=t.length;a<i;a++)(e=t[a])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 a=r.slice();r=e,e=a}var i=e.reduce((function(t,e){if(void 0!==t)return t[e]}),t);void 0!==i&&(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]=i),t[e]}),t))},o.PolyChart=function(){var t=[o.PolyChart.defaultConfig()],e=n.dispatch("hover"),r={solid:"none",dash:[5,2],dot:[2,5]};function i(){var e=t[0].geometryConfig,a=e.container;"string"==typeof a&&(a=n.select(a)),a.datum(t).each((function(t,a){var i=!!t[0].data.yStack,o=t.map((function(t,e){return i?n.zip(t.data.t[0],t.data.r[0],t.data.yStack[0]):n.zip(t.data.t[0],t.data.r[0])})),s=e.angularScale,l=e.radialScale.domain()[0],u={bar:function(r,a,i){var o=t[i].data,l=e.radialScale(r[1])-e.radialScale(0),u=e.radialScale(r[2]||0),c=o.barWidth;n.select(this).attr({class:"mark bar",d:"M"+[[l+u,-c/2],[l+u,c/2],[u,c/2],[u,-c/2]].join("L")+"Z",transform:function(t,r){return"rotate("+(e.orientation+s(t[0]))+")"}})},dot:function(r,a,i){var o=r[2]?[r[0],r[1]+r[2]]:r,s=n.svg.symbol().size(t[i].data.dotSize).type(t[i].data.dotType)(r,a);n.select(this).attr({class:"mark dot",d:s,transform:function(t,r){var n,a=(n=function(t,r){return{r:e.radialScale(t[1]),t:(e.angularScale(t[0])+e.orientation)*Math.PI/180}}(o),{x:n.r*Math.cos(n.t),y:n.r*Math.sin(n.t)});return"translate("+[a.x,a.y]+")"}})}},c=n.svg.line.radial().interpolate(t[0].data.lineInterpolation).radius((function(t){return e.radialScale(t[1])})).angle((function(t){return e.angularScale(t[0])*Math.PI/180}));u.line=function(r,a,i){var s=r[2]?o[i].map((function(t,e){return[t[0],t[1]+t[2]]})):o[i];if(n.select(this).each(u.dot).style({opacity:function(e,r){return+t[i].data.dotVisible},fill:p.stroke(r,a,i)}).attr({class:"mark dot"}),!(a>0)){var l=n.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({class:"line",d:c(s),transform:function(t,r){return"rotate("+(e.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return p.fill(r,a,i)},"fill-opacity":0,stroke:function(t,e){return p.stroke(r,a,i)},"stroke-width":function(t,e){return p["stroke-width"](r,a,i)},"stroke-dasharray":function(t,e){return p["stroke-dasharray"](r,a,i)},opacity:function(t,e){return p.opacity(r,a,i)},display:function(t,e){return p.display(r,a,i)}})}};var h=e.angularScale.range(),d=Math.abs(h[1]-h[0])/o[0].length*Math.PI/180,f=n.svg.arc().startAngle((function(t){return-d/2})).endAngle((function(t){return d/2})).innerRadius((function(t){return e.radialScale(l+(t[2]||0))})).outerRadius((function(t){return e.radialScale(l+(t[2]||0))+e.radialScale(t[1])}));u.arc=function(t,r,a){n.select(this).attr({class:"mark arc",d:f,transform:function(t,r){return"rotate("+(e.orientation+s(t[0])+90)+")"}})};var p={fill:function(e,r,n){return t[n].data.color},stroke:function(e,r,n){return t[n].data.strokeColor},"stroke-width":function(e,r,n){return t[n].data.strokeSize+"px"},"stroke-dasharray":function(e,n,a){return r[t[a].data.strokeDash]},opacity:function(e,r,n){return t[n].data.opacity},display:function(e,r,n){return void 0===t[n].data.visible||t[n].data.visible?"block":"none"}},m=n.select(this).selectAll("g.layer").data(o);m.enter().append("g").attr({class:"layer"});var g=m.selectAll("path.mark").data((function(t,e){return t}));g.enter().append("path").attr({class:"mark"}),g.style(p).each(u[e.geometryType]),g.exit().remove(),m.exit().remove()}))}return i.config=function(e){return arguments.length?(e.forEach((function(e,r){t[r]||(t[r]={}),a(t[r],o.PolyChart.defaultConfig()),a(t[r],e)})),this):t},i.getColorScale=function(){},n.rebind(i,e,"on"),i},o.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},o.Legend=function(){var t=o.Legend.defaultConfig(),e=n.dispatch("hover");function r(){var e=t.legendConfig,i=t.data.map((function(t,r){return[].concat(t).map((function(t,n){var i=a({},e.elements[r]);return i.name=t,i.color=[].concat(e.elements[r].color)[n],i}))})),o=n.merge(i);o=o.filter((function(t,r){return e.elements[r]&&(e.elements[r].visibleInLegend||void 0===e.elements[r].visibleInLegend)})),e.reverseOrder&&(o=o.reverse());var s=e.container;("string"==typeof s||s.nodeName)&&(s=n.select(s));var l=o.map((function(t,e){return t.color})),u=e.fontSize,c=null==e.isContinuous?"number"==typeof o[0]:e.isContinuous,h=c?e.height:u*o.length,d=s.classed("legend-group",!0).selectAll("svg").data([0]),f=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"});f.append("g").classed("legend-axis",!0),f.append("g").classed("legend-marks",!0);var p=n.range(o.length),m=n.scale[c?"linear":"ordinal"]().domain(p).range(l),g=n.scale[c?"linear":"ordinal"]().domain(p)[c?"range":"rangePoints"]([0,h]);if(c){var y=d.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);y.enter().append("stop"),y.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:e.height,width:e.colorBandWidth,fill:"url(#grad1)"})}else{var v=d.select(".legend-marks").selectAll("path.legend-mark").data(o);v.enter().append("path").classed("legend-mark",!0),v.attr({transform:function(t,e){return"translate("+[u/2,g(e)+u/2]+")"},d:function(t,e){var r,a,i,o=t.symbol;return i=3*(a=u),"line"===(r=o)?"M"+[[-a/2,-a/12],[a/2,-a/12],[a/2,a/12],[-a/2,a/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(r)?n.svg.symbol().type(r).size(i)():n.svg.symbol().type("square").size(i)()},fill:function(t,e){return m(e)}}),v.exit().remove()}var _=n.svg.axis().scale(g).orient("right"),x=d.select("g.legend-axis").attr({transform:"translate("+[c?e.colorBandWidth:u,u/2]+")"}).call(_);return x.selectAll(".domain").style({fill:"none",stroke:"none"}),x.selectAll("line").style({fill:"none",stroke:c?e.textColor:"none"}),x.selectAll("text").style({fill:e.textColor,"font-size":e.fontSize}).text((function(t,e){return o[e].name})),r}return r.config=function(e){return arguments.length?(a(t,e),this):t},n.rebind(r,e,"on"),r},o.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},o.tooltipPanel=function(){var t,e,r,i={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},s="tooltip-"+o.tooltipPanel.uid++,l=10,u=function(){var n=(t=i.container.selectAll("g."+s).data([0])).enter().append("g").classed(s,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=n.append("text").attr({dx:i.padding+l,dy:.3*+i.fontSize}),u};return u.text=function(a){var o=n.hsl(i.color).l,s=o>=.5?"#aaa":"white",c=o>=.5?"black":"white",h=a||"";e.style({fill:c,"font-size":i.fontSize+"px"}).text(h);var d=i.padding,f=e.node().getBBox(),p={fill:i.color,stroke:s,"stroke-width":"2px"},m=f.width+2*d+l,g=f.height+2*d;return r.attr({d:"M"+[[l,-g/2],[l,-g/4],[i.hasTick?0:l,0],[l,g/4],[l,g/2],[m,g/2],[m,-g/2]].join("L")+"Z"}).style(p),t.attr({transform:"translate("+[l,-g/2+2*d]+")"}),t.style({display:"block"}),u},u.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),u},u.hide=function(){if(t)return t.style({display:"none"}),u},u.show=function(){if(t)return t.style({display:"block"}),u},u.config=function(t){return a(i,t),u},u},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var t={convert:function(t,e){var r={};if(t.data&&(r.data=t.data.map((function(t,r){var n=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",!0===n.dotVisible?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n})),!e&&t.layout&&"stack"===t.layout.barmode)){var 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);-1!=n&&(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}};return t}},{"../../../constants/alignment":688,"../../../lib":719,d3:163}],838:[function(t,e,r){var n=t("d3"),a=t("../../../lib"),i=t("../../../components/color"),o=t("./micropolar"),s=t("./undo_manager"),l=a.extendDeepAll,u=e.exports={};u.framework=function(t){var e,r,a,i,c,h=new s;function d(r,s){return s&&(c=s),n.select(n.select(c).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),e=e?l(e,r):r,a||(a=o.Axis()),i=o.adapter.plotly().convert(e),a.config(i).render(c),t.data=e.data,t.layout=e.layout,u.fillLayout(t),e}return d.isPolar=!0,d.svg=function(){return a.svg()},d.getConfig=function(){return e},d.getLiveConfig=function(){return o.adapter.plotly().convert(a.getLiveConfig(),!0)},d.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},d.setUndoPoint=function(){var t,n,a=this,i=o.util.cloneJson(e);t=i,n=r,h.add({undo:function(){n&&a(n)},redo:function(){a(t)}}),r=o.util.cloneJson(i)},d.undo=function(){h.undo()},d.redo=function(){h.redo()},d},u.fillLayout=function(t){var e=n.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),a=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:i.background,_container:e,_paperdiv:r,_paper:a};t._fullLayout=l(o,t.layout)}},{"../../../components/color":593,"../../../lib":719,"./micropolar":837,"./undo_manager":839,d3:163}],839:[function(t,e,r){e.exports=function(){var t,e=[],r=-1,n=!1;function a(t,e){return t?(n=!0,t[e](),n=!1,this):this}return{add:function(t){return n||(e.splice(r+1,e.length-r),e.push(t),r=e.length-1),this},setCallback:function(e){t=e},undo:function(){var n=e[r];return n?(a(n,"undo"),r-=1,t&&t(n.undo),this):this},redo:function(){var n=e[r+1];return n?(a(n,"redo"),r+=1,t&&t(n.redo),this):this},clear:function(){e=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return r<e.length-1},getCommands:function(){return e},getPreviousCommand:function(){return e[r-1]},getIndex:function(){return r}}}},{}],840:[function(t,e,r){var n=t("d3"),a=t("tinycolor2"),i=t("../../registry"),o=t("../../lib"),s=t("../../components/color"),l=t("../../components/drawing"),u=t("../plots"),c=t("../../plots/cartesian/axes"),h=t("../cartesian/set_convert"),d=t("./set_convert"),f=t("../cartesian/autorange").doAutoRange,p=t("../cartesian/dragbox"),m=t("../../components/dragelement"),g=t("../../components/fx"),y=t("../../components/titles"),v=t("../cartesian/select").prepSelect,_=t("../cartesian/select").selectOnClick,x=t("../cartesian/select").clearSelect,b=t("../../lib/setcursor"),w=t("../../lib/clear_gl_canvases"),M=t("../../plot_api/subroutines").redrawReglTraces,k=t("../../constants/alignment").MID_SHIFT,T=t("./constants"),L=t("./helpers"),A=o._,S=o.mod,E=o.deg2rad,C=o.rad2deg;function D(t,e){this.id=e,this.gd=t,this._hasClipOnAxisFalse=null,this.vangles=null,this.radialAxisAngle=null,this.traceHash={},this.layers={},this.clipPaths={},this.clipIds={},this.viewInitial={};var r=t._fullLayout,n="clip"+r._uid+e;this.clipIds.forTraces=n+"-for-traces",this.clipPaths.forTraces=r._clips.append("clipPath").attr("id",this.clipIds.forTraces),this.clipPaths.forTraces.append("path"),this.framework=r._polarlayer.append("g").attr("class",e),this.radialTickLayout=null,this.angularTickLayout=null}var P=D.prototype;function O(t){var e=t.ticks+String(t.ticklen)+String(t.showticklabels);return"side"in t&&(e+=t.side),e}function z(t,e){return e[o.findIndexOfMin(e,(function(e){return o.angleDist(t,e)}))]}function I(t,e,r){return e?(t.attr("display",null),t.attr(r)):t&&t.attr("display","none"),t}function R(t,e){return"translate("+t+","+e+")"}function F(t){return"rotate("+t+")"}e.exports=function(t,e){return new D(t,e)},P.plot=function(t,e){var r=e[this.id];this._hasClipOnAxisFalse=!1;for(var n=0;n<t.length;n++)if(!1===t[n][0].trace.cliponaxis){this._hasClipOnAxisFalse=!0;break}this.updateLayers(e,r),this.updateLayout(e,r),u.generalUpdatePerTraceModule(this.gd,this,t,r),this.updateFx(e,r)},P.updateLayers=function(t,e){var r=this.layers,a=e.radialaxis,i=e.angularaxis,o=T.layerNames,s=o.indexOf("frontplot"),l=o.slice(0,s),u="below traces"===i.layer,c="below traces"===a.layer;u&&l.push("angular-line"),c&&l.push("radial-line"),u&&l.push("angular-axis"),c&&l.push("radial-axis"),l.push("frontplot"),u||l.push("angular-line"),c||l.push("radial-line"),u||l.push("angular-axis"),c||l.push("radial-axis");var h=this.framework.selectAll(".polarsublayer").data(l,String);h.enter().append("g").attr("class",(function(t){return"polarsublayer "+t})).each((function(t){var e=r[t]=n.select(this);switch(t){case"frontplot":e.append("g").classed("barlayer",!0),e.append("g").classed("scatterlayer",!0);break;case"backplot":e.append("g").classed("maplayer",!0);break;case"plotbg":r.bg=e.append("path");break;case"radial-grid":case"angular-grid":e.style("fill","none");break;case"radial-line":e.append("line").style("fill","none");break;case"angular-line":e.append("path").style("fill","none")}})),h.order()},P.updateLayout=function(t,e){var r=this.layers,n=t._size,a=e.radialaxis,i=e.angularaxis,o=e.domain.x,u=e.domain.y;this.xOffset=n.l+n.w*o[0],this.yOffset=n.t+n.h*(1-u[1]);var c=this.xLength=n.w*(o[1]-o[0]),h=this.yLength=n.h*(u[1]-u[0]),d=e.sector;this.sectorInRad=d.map(E);var f,p,m,g,y,v=this.sectorBBox=function(t){var e,r=t[0],n=t[1]-r,a=S(r,360),i=a+n,o=Math.cos(E(a)),s=Math.sin(E(a)),l=Math.cos(E(i)),u=Math.sin(E(i));return e=a<=90&&i>=90||a>90&&i>=450?1:s<=0&&u<=0?0:Math.max(s,u),[a<=180&&i>=180||a>180&&i>=540?-1:o>=0&&l>=0?0:Math.min(o,l),a<=270&&i>=270||a>270&&i>=630?-1:s>=0&&u>=0?0:Math.min(s,u),i>=360?1:o<=0&&l<=0?0:Math.max(o,l),e]}(d),_=v[2]-v[0],x=v[3]-v[1],b=h/c,w=Math.abs(x/_);b>w?(f=c,y=(h-(p=c*w))/n.h/2,m=[o[0],o[1]],g=[u[0]+y,u[1]-y]):(p=h,y=(c-(f=h/w))/n.w/2,m=[o[0]+y,o[1]-y],g=[u[0],u[1]]),this.xLength2=f,this.yLength2=p,this.xDomain2=m,this.yDomain2=g;var M=this.xOffset2=n.l+n.w*m[0],k=this.yOffset2=n.t+n.h*(1-g[1]),T=this.radius=f/_,L=this.innerRadius=e.hole*T,A=this.cx=M-T*v[0],C=this.cy=k+T*v[3],D=this.cxx=A-M,P=this.cyy=C-k;this.radialAxis=this.mockAxis(t,e,a,{_id:"x",side:{counterclockwise:"top",clockwise:"bottom"}[a.side],domain:[L/n.w,T/n.w]}),this.angularAxis=this.mockAxis(t,e,i,{side:"right",domain:[0,Math.PI],autorange:!1}),this.doAutoRange(t,e),this.updateAngularAxis(t,e),this.updateRadialAxis(t,e),this.updateRadialAxisTitle(t,e),this.xaxis=this.mockCartesianAxis(t,e,{_id:"x",domain:m}),this.yaxis=this.mockCartesianAxis(t,e,{_id:"y",domain:g});var O=this.pathSubplot();this.clipPaths.forTraces.select("path").attr("d",O).attr("transform",R(D,P)),r.frontplot.attr("transform",R(M,k)).call(l.setClipUrl,this._hasClipOnAxisFalse?null:this.clipIds.forTraces,this.gd),r.bg.attr("d",O).attr("transform",R(A,C)).call(s.fill,e.bgcolor)},P.mockAxis=function(t,e,r,n){var a=o.extendFlat({anchor:"free",position:0},r,n);return d(a,e,t),a},P.mockCartesianAxis=function(t,e,r){var n=this,a=r._id,i=o.extendFlat({type:"linear"},r);h(i,t);var s={x:[0,2],y:[1,3]};return i.setRange=function(){var t=n.sectorBBox,r=s[a],o=n.radialAxis._rl,l=(o[1]-o[0])/(1-e.hole);i.range=[t[r[0]]*l,t[r[1]]*l]},i.isPtWithinRange="x"===a?function(t){return n.isPtInside(t)}:function(){return!0},i.setRange(),i.setScale(),i},P.doAutoRange=function(t,e){var r=this.gd,n=this.radialAxis,a=e.radialaxis;n.setScale(),f(r,n);var i=n.range;a.range=i.slice(),a._input.range=i.slice(),n._rl=[n.r2l(i[0],null,"gregorian"),n.r2l(i[1],null,"gregorian")]},P.updateRadialAxis=function(t,e){var r=this,n=r.gd,a=r.layers,i=r.radius,l=r.innerRadius,u=r.cx,h=r.cy,d=e.radialaxis,f=S(e.sector[0],360),p=r.radialAxis,m=l<i;r.fillViewInitialKey("radialaxis.angle",d.angle),r.fillViewInitialKey("radialaxis.range",p.range.slice()),p.setGeometry(),"auto"===p.tickangle&&f>90&&f<=270&&(p.tickangle=180);var g=function(t){return"translate("+(p.l2p(t.x)+l)+",0)"},y=O(d);if(r.radialTickLayout!==y&&(a["radial-axis"].selectAll(".xtick").remove(),r.radialTickLayout=y),m){p.setScale();var v=c.calcTicks(p),_=c.clipEnds(p,v),x=c.getTickSigns(p)[2];c.drawTicks(n,p,{vals:v,layer:a["radial-axis"],path:c.makeTickPath(p,0,x),transFn:g,crisp:!1}),c.drawGrid(n,p,{vals:_,layer:a["radial-grid"],path:function(t){return r.pathArc(p.r2p(t.x)+l)},transFn:o.noop,crisp:!1}),c.drawLabels(n,p,{vals:v,layer:a["radial-axis"],transFn:g,labelFns:c.makeLabelFns(p,0)})}var b=r.radialAxisAngle=r.vangles?C(z(E(d.angle),r.vangles)):d.angle,w=R(u,h),M=w+F(-b);I(a["radial-axis"],m&&(d.showticklabels||d.ticks),{transform:M}),I(a["radial-grid"],m&&d.showgrid,{transform:w}),I(a["radial-line"].select("line"),m&&d.showline,{x1:l,y1:0,x2:i,y2:0,transform:M}).attr("stroke-width",d.linewidth).call(s.stroke,d.linecolor)},P.updateRadialAxisTitle=function(t,e,r){var n=this.gd,a=this.radius,i=this.cx,o=this.cy,s=e.radialaxis,u=this.id+"title",c=void 0!==r?r:this.radialAxisAngle,h=E(c),d=Math.cos(h),f=Math.sin(h),p=0;if(s.title){var m=l.bBox(this.layers["radial-axis"].node()).height,g=s.title.font.size;p="counterclockwise"===s.side?-m-.4*g:m+.8*g}this.layers["radial-axis-title"]=y.draw(n,u,{propContainer:s,propName:this.id+".radialaxis.title",placeholder:A(n,"Click to enter radial axis title"),attributes:{x:i+a/2*d+p*f,y:o-a/2*f+p*d,"text-anchor":"middle"},transform:{rotate:-c}})},P.updateAngularAxis=function(t,e){var r=this,n=r.gd,a=r.layers,i=r.radius,l=r.innerRadius,u=r.cx,h=r.cy,d=e.angularaxis,f=r.angularAxis;r.fillViewInitialKey("angularaxis.rotation",d.rotation),f.setGeometry(),f.setScale();var p=function(t){return f.t2g(t.x)};"linear"===f.type&&"radians"===f.thetaunit&&(f.tick0=C(f.tick0),f.dtick=C(f.dtick));var m=function(t){return R(u+i*Math.cos(t),h-i*Math.sin(t))},g=c.makeLabelFns(f,0).labelStandoff,y={xFn:function(t){var e=p(t);return Math.cos(e)*g},yFn:function(t){var e=p(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(g+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*k)},anchorFn:function(t){var e=p(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},heightFn:function(t,e,r){var n=p(t);return-.5*(1+Math.sin(n))*r}},v=O(d);r.angularTickLayout!==v&&(a["angular-axis"].selectAll("."+f._id+"tick").remove(),r.angularTickLayout=v);var _,x=c.calcTicks(f);if("linear"===e.gridshape?(_=x.map(p),o.angleDelta(_[0],_[1])<0&&(_=_.slice().reverse())):_=null,r.vangles=_,"category"===f.type&&(x=x.filter((function(t){return o.isAngleInsideSector(p(t),r.sectorInRad)}))),f.visible){var b="inside"===f.ticks?-1:1,w=(f.linewidth||1)/2;c.drawTicks(n,f,{vals:x,layer:a["angular-axis"],path:"M"+b*w+",0h"+b*f.ticklen,transFn:function(t){var e=p(t);return m(e)+F(-C(e))},crisp:!1}),c.drawGrid(n,f,{vals:x,layer:a["angular-grid"],path:function(t){var e=p(t),r=Math.cos(e),n=Math.sin(e);return"M"+[u+l*r,h-l*n]+"L"+[u+i*r,h-i*n]},transFn:o.noop,crisp:!1}),c.drawLabels(n,f,{vals:x,layer:a["angular-axis"],repositionOnUpdate:!0,transFn:function(t){return m(p(t))},labelFns:y})}I(a["angular-line"].select("path"),d.showline,{d:r.pathSubplot(),transform:R(u,h)}).attr("stroke-width",d.linewidth).call(s.stroke,d.linecolor)},P.updateFx=function(t,e){this.gd._context.staticPlot||(this.updateAngularDrag(t),this.updateRadialDrag(t,e,0),this.updateRadialDrag(t,e,1),this.updateMainDrag(t))},P.updateMainDrag=function(t){var e=this,r=e.gd,o=e.layers,s=t._zoomlayer,l=T.MINZOOM,u=T.OFFEDGE,c=e.radius,h=e.innerRadius,d=e.cx,f=e.cy,y=e.cxx,b=e.cyy,w=e.sectorInRad,M=e.vangles,k=e.radialAxis,A=L.clampTiny,S=L.findXYatLength,E=L.findEnclosingVertexAngles,C=T.cornerHalfWidth,D=T.cornerLen/2,P=p.makeDragger(o,"path","maindrag","crosshair");n.select(P).attr("d",e.pathSubplot()).attr("transform",R(d,f));var O,z,I,F,N,Y,j,B,H,U={element:P,gd:r,subplot:e.id,plotinfo:{id:e.id,xaxis:e.xaxis,yaxis:e.yaxis},xaxes:[e.xaxis],yaxes:[e.yaxis]};function V(t,e){return Math.sqrt(t*t+e*e)}function W(t,e){return V(t-y,e-b)}function G(t,e){return Math.atan2(b-e,t-y)}function q(t,e){return[t*Math.cos(e),t*Math.sin(-e)]}function Z(t,r){if(0===t)return e.pathSector(2*C);var n=D/t,a=r-n,i=r+n,o=Math.max(0,Math.min(t,c)),s=o-C,l=o+C;return"M"+q(s,a)+"A"+[s,s]+" 0,0,0 "+q(s,i)+"L"+q(l,i)+"A"+[l,l]+" 0,0,1 "+q(l,a)+"Z"}function X(t,r,n){if(0===t)return e.pathSector(2*C);var a,i,o=q(t,r),s=q(t,n),l=A((o[0]+s[0])/2),u=A((o[1]+s[1])/2);if(l&&u){var c=u/l,h=-1/c,d=S(C,c,l,u);a=S(D,h,d[0][0],d[0][1]),i=S(D,h,d[1][0],d[1][1])}else{var f,p;u?(f=D,p=C):(f=C,p=D),a=[[l-f,u-p],[l+f,u-p]],i=[[l-f,u+p],[l+f,u+p]]}return"M"+a.join("L")+"L"+i.reverse().join("L")+"Z"}function J(t,e){return e=Math.max(Math.min(e,c),h),t<u?t=0:c-t<u?t=c:e<u?e=0:c-e<u&&(e=c),Math.abs(e-t)>l?(t<e?(I=t,F=e):(I=e,F=t),!0):(I=null,F=null,!1)}function K(t,e){t=t||N,e=e||"M0,0Z",B.attr("d",t),H.attr("d",e),p.transitionZoombox(B,H,Y,j),Y=!0;var n={};rt(n),r.emit("plotly_relayouting",n)}function $(t,r){var n,a,i=O+t,o=z+r,s=W(O,z),l=Math.min(W(i,o),c),u=G(O,z);J(s,l)&&(n=N+e.pathSector(F),I&&(n+=e.pathSector(I)),a=Z(I,u)+Z(F,u)),K(n,a)}function Q(t,e,r,n){var a=L.findIntersectionXY(r,n,r,[t-y,b-e]);return V(a[0],a[1])}function tt(t,r){var n,a,i=O+t,o=z+r,s=G(O,z),l=G(i,o),u=E(s,M),h=E(l,M);J(Q(O,z,u[0],u[1]),Math.min(Q(i,o,h[0],h[1]),c))&&(n=N+e.pathSector(F),I&&(n+=e.pathSector(I)),a=[X(I,u[0],u[1]),X(F,u[0],u[1])].join(" ")),K(n,a)}function et(){if(p.removeZoombox(r),null!==I&&null!==F){var t={};rt(t),p.showDoubleClickNotifier(r),i.call("_guiRelayout",r,t)}}function rt(t){var r=k._rl,n=(r[1]-r[0])/(1-h/c)/c,a=[r[0]+(I-h)*n,r[0]+(F-h)*n];t[e.id+".radialaxis.range"]=a}function nt(t,n){var a=r._fullLayout.clickmode;if(p.removeZoombox(r),2===t){var o={};for(var s in e.viewInitial)o[e.id+"."+s]=e.viewInitial[s];r.emit("plotly_doubleclick",null),i.call("_guiRelayout",r,o)}a.indexOf("select")>-1&&1===t&&_(n,r,[e.xaxis],[e.yaxis],e.id,U),a.indexOf("event")>-1&&g.click(r,n,e.id)}U.prepFn=function(t,n,i){var o=r._fullLayout.dragmode,l=P.getBoundingClientRect();if(O=n-l.left,z=i-l.top,M){var u=L.findPolygonOffset(c,w[0],w[1],M);O+=y+u[0],z+=b+u[1]}switch(o){case"zoom":U.moveFn=M?tt:$,U.clickFn=nt,U.doneFn=et,function(){I=null,F=null,N=e.pathSubplot(),Y=!1;var t=r._fullLayout[e.id];j=a(t.bgcolor).getLuminance(),(B=p.makeZoombox(s,j,d,f,N)).attr("fill-rule","evenodd"),H=p.makeCorners(s,d,f),x(r)}();break;case"select":case"lasso":v(t,n,i,U,o)}},P.onmousemove=function(t){g.hover(r,t,e.id),r._fullLayout._lasthover=P,r._fullLayout._hoversubplot=e.id},P.onmouseout=function(t){r._dragging||m.unhover(r,t)},m.init(U)},P.updateRadialDrag=function(t,e,r){var a=this,s=a.gd,l=a.layers,u=a.radius,c=a.innerRadius,h=a.cx,d=a.cy,f=a.radialAxis,g=T.radialDragBoxSize,y=g/2;if(f.visible){var v,_,b,k=E(a.radialAxisAngle),L=f._rl,A=L[0],S=L[1],D=L[r],P=.75*(L[1]-L[0])/(1-e.hole)/u;r?(v=h+(u+y)*Math.cos(k),_=d-(u+y)*Math.sin(k),b="radialdrag"):(v=h+(c-y)*Math.cos(k),_=d-(c-y)*Math.sin(k),b="radialdrag-inner");var O,N,Y,j=p.makeRectDragger(l,b,"crosshair",-y,-y,g,g),B={element:j,gd:s};I(n.select(j),f.visible&&c<u,{transform:R(v,_)}),B.prepFn=function(){O=null,N=null,Y=null,B.moveFn=H,B.doneFn=U,x(s)},B.clampFn=function(t,e){return Math.sqrt(t*t+e*e)<T.MINDRAG&&(t=0,e=0),[t,e]},m.init(B)}function H(t,e){if(O)O(t,e);else{var n=[t,-e],i=[Math.cos(k),Math.sin(k)],l=Math.abs(o.dot(n,i)/Math.sqrt(o.dot(n,n)));isNaN(l)||(O=l<.5?V:W)}var u={};!function(t){null!==N?t[a.id+".radialaxis.angle"]=N:null!==Y&&(t[a.id+".radialaxis.range["+r+"]"]=Y)}(u),s.emit("plotly_relayouting",u)}function U(){null!==N?i.call("_guiRelayout",s,a.id+".radialaxis.angle",N):null!==Y&&i.call("_guiRelayout",s,a.id+".radialaxis.range["+r+"]",Y)}function V(t,e){if(0!==r){var n=v+t,i=_+e;N=Math.atan2(d-i,n-h),a.vangles&&(N=z(N,a.vangles)),N=C(N);var o=R(h,d)+F(-N);l["radial-axis"].attr("transform",o),l["radial-line"].select("line").attr("transform",o);var s=a.gd._fullLayout,u=s[a.id];a.updateRadialAxisTitle(s,u,N)}}function W(t,e){var n=o.dot([t,-e],[Math.cos(k),Math.sin(k)]);if(Y=D-P*n,P>0==(r?Y>A:Y<S)){var l=s._fullLayout,u=l[a.id];f.range[r]=Y,f._rl[r]=Y,a.updateRadialAxis(l,u),a.xaxis.setRange(),a.xaxis.setScale(),a.yaxis.setRange(),a.yaxis.setScale();var c=!1;for(var h in a.traceHash){var d=a.traceHash[h],p=o.filterVisible(d);d[0][0].trace._module.plot(s,a,p,u),i.traceIs(h,"gl")&&p.length&&(c=!0)}c&&(w(s),M(s))}else Y=null}},P.updateAngularDrag=function(t){var e=this,r=e.gd,a=e.layers,s=e.radius,u=e.angularAxis,c=e.cx,h=e.cy,d=e.cxx,f=e.cyy,g=T.angularDragBoxSize,y=p.makeDragger(a,"path","angulardrag","move"),v={element:y,gd:r};function _(t,e){return Math.atan2(f+g-e,t-d-g)}n.select(y).attr("d",e.pathAnnulus(s,s+g)).attr("transform",R(c,h)).call(b,"move");var k,L,A,S,E,D,P=a.frontplot.select(".scatterlayer").selectAll(".trace"),O=P.selectAll(".point"),z=P.selectAll(".textpoint");function I(t,s){var p=e.gd._fullLayout,m=p[e.id],g=_(k+t,L+s),y=C(g-D);if(S=A+y,a.frontplot.attr("transform",R(e.xOffset2,e.yOffset2)+F([-y,d,f])),e.vangles){E=e.radialAxisAngle+y;var v=R(c,h)+F(-y),x=R(c,h)+F(-E);a.bg.attr("transform",v),a["radial-grid"].attr("transform",v),a["radial-axis"].attr("transform",x),a["radial-line"].select("line").attr("transform",x),e.updateRadialAxisTitle(p,m,E)}else e.clipPaths.forTraces.select("path").attr("transform",R(d,f)+F(y));O.each((function(){var t=n.select(this),e=l.getTranslate(t);t.attr("transform",R(e.x,e.y)+F([y]))})),z.each((function(){var t=n.select(this),e=t.select("text"),r=l.getTranslate(t);t.attr("transform",F([y,e.attr("x"),e.attr("y")])+R(r.x,r.y))})),u.rotation=o.modHalf(S,360),e.updateAngularAxis(p,m),e._hasClipOnAxisFalse&&!o.isFullCircle(e.sectorInRad)&&P.call(l.hideOutsideRangePoints,e);var b=!1;for(var T in e.traceHash)if(i.traceIs(T,"gl")){var I=e.traceHash[T],Y=o.filterVisible(I);I[0][0].trace._module.plot(r,e,Y,m),Y.length&&(b=!0)}b&&(w(r),M(r));var j={};N(j),r.emit("plotly_relayouting",j)}function N(t){t[e.id+".angularaxis.rotation"]=S,e.vangles&&(t[e.id+".radialaxis.angle"]=E)}function Y(){z.select("text").attr("transform",null);var t={};N(t),i.call("_guiRelayout",r,t)}v.prepFn=function(n,a,i){var o=t[e.id];A=o.angularaxis.rotation;var s=y.getBoundingClientRect();k=a-s.left,L=i-s.top,D=_(k,L),v.moveFn=I,v.doneFn=Y,x(r)},e.vangles&&!o.isFullCircle(e.sectorInRad)&&(v.prepFn=o.noop,b(n.select(y),null)),m.init(v)},P.isPtInside=function(t){var e=this.sectorInRad,r=this.vangles,n=this.angularAxis.c2g(t.theta),a=this.radialAxis,i=a.c2l(t.r),s=a._rl;return(r?L.isPtInsidePolygon:o.isPtInsideSector)(i,n,s,e,r)},P.pathArc=function(t){var e=this.sectorInRad,r=this.vangles;return(r?L.pathPolygon:o.pathArc)(t,e[0],e[1],r)},P.pathSector=function(t){var e=this.sectorInRad,r=this.vangles;return(r?L.pathPolygon:o.pathSector)(t,e[0],e[1],r)},P.pathAnnulus=function(t,e){var r=this.sectorInRad,n=this.vangles;return(n?L.pathPolygonAnnulus:o.pathAnnulus)(t,e,r[0],r[1],n)},P.pathSubplot=function(){var t=this.innerRadius,e=this.radius;return t?this.pathAnnulus(t,e):this.pathSector(e)},P.fillViewInitialKey=function(t,e){t in this.viewInitial||(this.viewInitial[t]=e)}},{"../../components/color":593,"../../components/dragelement":611,"../../components/drawing":614,"../../components/fx":632,"../../components/titles":681,"../../constants/alignment":688,"../../lib":719,"../../lib/clear_gl_canvases":704,"../../lib/setcursor":739,"../../plot_api/subroutines":758,"../../plots/cartesian/axes":767,"../../registry":847,"../cartesian/autorange":766,"../cartesian/dragbox":775,"../cartesian/select":784,"../cartesian/set_convert":785,"../plots":828,"./constants":829,"./helpers":830,"./set_convert":841,d3:163,tinycolor2:537}],841:[function(t,e,r){var n=t("../../lib"),a=t("../cartesian/set_convert"),i=n.deg2rad,o=n.rad2deg;e.exports=function(t,e,r){switch(a(t,r),t._id){case"x":case"radialaxis":!function(t,e){var r=e._subplot;t.setGeometry=function(){var e=t._rl[0],n=t._rl[1],a=r.innerRadius,i=(r.radius-a)/(n-e),o=a/i,s=e>n?function(t){return t<=0}:function(t){return t>=0};t.c2g=function(r){var n=t.c2l(r)-e;return(s(n)?n:0)+o},t.g2c=function(r){return t.l2c(r+e-o)},t.g2p=function(t){return t*i},t.c2p=function(e){return t.g2p(t.c2g(e))}}}(t,e);break;case"angularaxis":!function(t,e){var r=t.type;if("linear"===r){var a=t.d2c,s=t.c2d;t.d2c=function(t,e){return function(t,e){return"degrees"===e?i(t):t}(a(t),e)},t.c2d=function(t,e){return s(function(t,e){return"degrees"===e?o(t):t}(t,e))}}t.makeCalcdata=function(e,a){var i,o,s=e[a],l=e._length,u=function(r){return t.d2c(r,e.thetaunit)};if(s){if(n.isTypedArray(s)&&"linear"===r){if(l===s.length)return s;if(s.subarray)return s.subarray(0,l)}for(i=new Array(l),o=0;o<l;o++)i[o]=u(s[o])}else{var c=a+"0",h="d"+a,d=c in e?u(e[c]):0,f=e[h]?u(e[h]):(t.period||2*Math.PI)/l;for(i=new Array(l),o=0;o<l;o++)i[o]=d+o*f}return i},t.setGeometry=function(){var a,s,l,u,c=e.sector,h=c.map(i),d={clockwise:-1,counterclockwise:1}[t.direction],f=i(t.rotation),p=function(t){return d*t+f},m=function(t){return(t-f)/d};switch(r){case"linear":s=a=n.identity,u=i,l=o,t.range=n.isFullCircle(h)?[c[0],c[0]+360]:h.map(m).map(o);break;case"category":var g=t._categories.length,y=t.period?Math.max(t.period,g):g;0===y&&(y=1),s=u=function(t){return 2*t*Math.PI/y},a=l=function(t){return t*y/Math.PI/2},t.range=[0,y]}t.c2g=function(t){return p(s(t))},t.g2c=function(t){return a(m(t))},t.t2g=function(t){return p(u(t))},t.g2t=function(t){return l(m(t))}}}(t,e)}}},{"../../lib":719,"../cartesian/set_convert":785}],842:[function(t,e,r){var n=t("../lib"),a=t("../plot_api/plot_template"),i=t("./domain").defaults;e.exports=function(t,e,r,o){var s,l,u=o.type,c=o.attributes,h=o.handleDefaults,d=o.partition||"x",f=e._subplots[u],p=f.length,m=p&&f[0].replace(/\d+$/,"");function g(t,e){return n.coerce(s,l,c,t,e)}for(var y=0;y<p;y++){var v=f[y];s=t[v]?t[v]:t[v]={},l=a.newContainer(e,v,m),g("uirevision",e.uirevision);var _={};_[d]=[y/p,(y+1)/p],i(l,e,g,_),o.id=v,h(s,l,g,o)}}},{"../lib":719,"../plot_api/plot_template":757,"./domain":792}],843:[function(t,e,r){var n=t("./ternary"),a=t("../../plots/get_data").getSubplotCalcData,i=t("../../lib").counterRegex;r.name="ternary";var o=r.attr="subplot";r.idRoot="ternary",r.idRegex=r.attrRegex=i("ternary"),(r.attributes={})[o]={valType:"subplotid",dflt:"ternary",editType:"calc"},r.layoutAttributes=t("./layout_attributes"),r.supplyLayoutDefaults=t("./layout_defaults"),r.plot=function(t){for(var e=t._fullLayout,r=t.calcdata,i=e._subplots.ternary,o=0;o<i.length;o++){var s=i[o],l=a(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=n._subplots.ternary||[],i=0;i<a.length;i++){var o=a[i],s=n[o]._subplot;!e[o]&&s&&(s.plotContainer.remove(),s.clipDef.remove(),s.clipDefRelative.remove(),s.layers["a-title"].remove(),s.layers["b-title"].remove(),s.layers["c-title"].remove())}}},{"../../lib":719,"../../plots/get_data":802,"./layout_attributes":844,"./layout_defaults":845,"./ternary":846}],844:[function(t,e,r){var n=t("../../components/color/attributes"),a=t("../domain").attributes,i=t("../cartesian/layout_attributes"),o=t("../../plot_api/edit_types").overrideAll,s=t("../../lib/extend").extendFlat,l={title:i.title,color:i.color,tickmode:i.tickmode,nticks:s({},i.nticks,{dflt:6,min:1}),tick0:i.tick0,dtick:i.dtick,tickvals:i.tickvals,ticktext:i.ticktext,ticks:i.ticks,ticklen:i.ticklen,tickwidth:i.tickwidth,tickcolor:i.tickcolor,showticklabels:i.showticklabels,showtickprefix:i.showtickprefix,tickprefix:i.tickprefix,showticksuffix:i.showticksuffix,ticksuffix:i.ticksuffix,showexponent:i.showexponent,exponentformat:i.exponentformat,separatethousands:i.separatethousands,tickfont:i.tickfont,tickangle:i.tickangle,tickformat:i.tickformat,tickformatstops:i.tickformatstops,hoverformat:i.hoverformat,showline:s({},i.showline,{dflt:!0}),linecolor:i.linecolor,linewidth:i.linewidth,showgrid:s({},i.showgrid,{dflt:!0}),gridcolor:i.gridcolor,gridwidth:i.gridwidth,layer:i.layer,min:{valType:"number",dflt:0,min:0},_deprecated:{title:i._deprecated.title,titlefont:i._deprecated.titlefont}},u=e.exports=o({domain:a({name:"ternary"}),bgcolor:{valType:"color",dflt:n.background},sum:{valType:"number",dflt:1,min:0},aaxis:l,baxis:l,caxis:l},"plot","from-root");u.uirevision={valType:"any",editType:"none"},u.aaxis.uirevision=u.baxis.uirevision=u.caxis.uirevision={valType:"any",editType:"none"}},{"../../components/color/attributes":592,"../../lib/extend":710,"../../plot_api/edit_types":750,"../cartesian/layout_attributes":779,"../domain":792}],845:[function(t,e,r){var n=t("../../components/color"),a=t("../../plot_api/plot_template"),i=t("../../lib"),o=t("../subplot_defaults"),s=t("../cartesian/tick_label_defaults"),l=t("../cartesian/tick_mark_defaults"),u=t("../cartesian/tick_value_defaults"),c=t("../cartesian/line_grid_defaults"),h=t("./layout_attributes"),d=["aaxis","baxis","caxis"];function f(t,e,r,i){var o,s,l,u=r("bgcolor"),c=r("sum");i.bgColor=n.combine(u,i.paper_bgcolor);for(var h=0;h<d.length;h++)s=t[o=d[h]]||{},(l=a.newContainer(e,o))._name=o,p(s,l,i,e);var f=e.aaxis,m=e.baxis,g=e.caxis;f.min+m.min+g.min>=c&&(f.min=0,m.min=0,g.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}function p(t,e,r,n){var a=h[e._name];function o(r,n){return i.coerce(t,e,a,r,n)}o("uirevision",n.uirevision),e.type="linear";var d=o("color"),f=d!==a.color.dflt?d:r.font.color,p=e._name.charAt(0).toUpperCase(),m="Component "+p,g=o("title.text",m);e._hovertitle=g===m?g:p,i.coerceFont(o,"title.font",{family:r.font.family,size:Math.round(1.2*r.font.size),color:f}),o("min"),u(t,e,o,"linear"),s(t,e,o,"linear",{}),l(t,e,o,{outerTicks:!0}),o("showticklabels")&&(i.coerceFont(o,"tickfont",{family:r.font.family,size:r.font.size,color:f}),o("tickangle"),o("tickformat")),c(t,e,o,{dfltColor:d,bgColor:r.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:a}),o("hoverformat"),o("layer")}e.exports=function(t,e,r){o(t,e,r,{type:"ternary",attributes:h,handleDefaults:f,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../components/color":593,"../../lib":719,"../../plot_api/plot_template":757,"../cartesian/line_grid_defaults":781,"../cartesian/tick_label_defaults":786,"../cartesian/tick_mark_defaults":787,"../cartesian/tick_value_defaults":788,"../subplot_defaults":842,"./layout_attributes":844}],846:[function(t,e,r){var n=t("d3"),a=t("tinycolor2"),i=t("../../registry"),o=t("../../lib"),s=o._,l=t("../../components/color"),u=t("../../components/drawing"),c=t("../cartesian/set_convert"),h=t("../../lib/extend").extendFlat,d=t("../plots"),f=t("../cartesian/axes"),p=t("../../components/dragelement"),m=t("../../components/fx"),g=t("../../components/titles"),y=t("../cartesian/select").prepSelect,v=t("../cartesian/select").selectOnClick,_=t("../cartesian/select").clearSelect,x=t("../cartesian/constants");function b(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework(e),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}e.exports=b;var w=b.prototype;w.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={},this.layers={}},w.plot=function(t,e){var r=e[this.id],n=e._size;this._hasClipOnAxisFalse=!1;for(var a=0;a<t.length;a++)if(!1===t[a][0].trace.cliponaxis){this._hasClipOnAxisFalse=!0;break}this.updateLayers(r),this.adjustLayout(r,n),d.generalUpdatePerTraceModule(this.graphDiv,this,t,r),this.layers.plotbg.select("path").call(l.fill,r.bgcolor)},w.makeFramework=function(t){var e=this.graphDiv,r=t[this.id],n=this.clipId="clip"+this.layoutId+this.id,a=this.clipIdRelative="clip-relative"+this.layoutId+this.id;this.clipDef=o.ensureSingleById(t._clips,"clipPath",n,(function(t){t.append("path").attr("d","M0,0Z")})),this.clipDefRelative=o.ensureSingleById(t._clips,"clipPath",a,(function(t){t.append("path").attr("d","M0,0Z")})),this.plotContainer=o.ensureSingle(this.container,"g",this.id),this.updateLayers(r),u.setClipUrl(this.layers.backplot,n,e),u.setClipUrl(this.layers.grids,n,e)},w.updateLayers=function(t){var e=this.layers,r=["draglayer","plotbg","backplot","grids"];"below traces"===t.aaxis.layer&&r.push("aaxis","aline"),"below traces"===t.baxis.layer&&r.push("baxis","bline"),"below traces"===t.caxis.layer&&r.push("caxis","cline"),r.push("frontplot"),"above traces"===t.aaxis.layer&&r.push("aaxis","aline"),"above traces"===t.baxis.layer&&r.push("baxis","bline"),"above traces"===t.caxis.layer&&r.push("caxis","cline");var a=this.plotContainer.selectAll("g.toplevel").data(r,String),i=["agrid","bgrid","cgrid"];a.enter().append("g").attr("class",(function(t){return"toplevel "+t})).each((function(t){var r=n.select(this);e[t]=r,"frontplot"===t?r.append("g").classed("scatterlayer",!0):"backplot"===t?r.append("g").classed("maplayer",!0):"plotbg"===t?r.append("path").attr("d","M0,0Z"):"aline"===t||"bline"===t||"cline"===t?r.append("path"):"grids"===t&&i.forEach((function(t){e[t]=r.append("g").classed("grid "+t,!0)}))})),a.order()};var M=Math.sqrt(4/3);w.adjustLayout=function(t,e){var r,n,a,i,o,s,d=this,f=t.domain,p=(f.x[0]+f.x[1])/2,m=(f.y[0]+f.y[1])/2,g=f.x[1]-f.x[0],y=f.y[1]-f.y[0],v=g*e.w,_=y*e.h,x=t.sum,b=t.aaxis.min,w=t.baxis.min,k=t.caxis.min;v>M*_?a=(i=_)*M:i=(a=v)/M,o=g*a/v,s=y*i/_,r=e.l+e.w*p-a/2,n=e.t+e.h*(1-m)-i/2,d.x0=r,d.y0=n,d.w=a,d.h=i,d.sum=x,d.xaxis={type:"linear",range:[b+2*k-x,x-b-2*w],domain:[p-o/2,p+o/2],_id:"x"},c(d.xaxis,d.graphDiv._fullLayout),d.xaxis.setScale(),d.xaxis.isPtWithinRange=function(t){return t.a>=d.aaxis.range[0]&&t.a<=d.aaxis.range[1]&&t.b>=d.baxis.range[1]&&t.b<=d.baxis.range[0]&&t.c>=d.caxis.range[1]&&t.c<=d.caxis.range[0]},d.yaxis={type:"linear",range:[b,x-w-k],domain:[m-s/2,m+s/2],_id:"y"},c(d.yaxis,d.graphDiv._fullLayout),d.yaxis.setScale(),d.yaxis.isPtWithinRange=function(){return!0};var T=d.yaxis.domain[0],L=d.aaxis=h({},t.aaxis,{range:[b,x-w-k],side:"left",tickangle:(+t.aaxis.tickangle||0)-30,domain:[T,T+s*M],anchor:"free",position:0,_id:"y",_length:a});c(L,d.graphDiv._fullLayout),L.setScale();var A=d.baxis=h({},t.baxis,{range:[x-b-k,w],side:"bottom",domain:d.xaxis.domain,anchor:"free",position:0,_id:"x",_length:a});c(A,d.graphDiv._fullLayout),A.setScale();var S=d.caxis=h({},t.caxis,{range:[x-b-w,k],side:"right",tickangle:(+t.caxis.tickangle||0)+30,domain:[T,T+s*M],anchor:"free",position:0,_id:"y",_length:a});c(S,d.graphDiv._fullLayout),S.setScale();var E="M"+r+","+(n+i)+"h"+a+"l-"+a/2+",-"+i+"Z";d.clipDef.select("path").attr("d",E),d.layers.plotbg.select("path").attr("d",E);var C="M0,"+i+"h"+a+"l-"+a/2+",-"+i+"Z";d.clipDefRelative.select("path").attr("d",C);var D="translate("+r+","+n+")";d.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",D),d.clipDefRelative.select("path").attr("transform",null);var P="translate("+(r-A._offset)+","+(n+i)+")";d.layers.baxis.attr("transform",P),d.layers.bgrid.attr("transform",P);var O="translate("+(r+a/2)+","+n+")rotate(30)translate(0,"+-L._offset+")";d.layers.aaxis.attr("transform",O),d.layers.agrid.attr("transform",O);var z="translate("+(r+a/2)+","+n+")rotate(-30)translate(0,"+-S._offset+")";d.layers.caxis.attr("transform",z),d.layers.cgrid.attr("transform",z),d.drawAxes(!0),d.layers.aline.select("path").attr("d",L.showline?"M"+r+","+(n+i)+"l"+a/2+",-"+i:"M0,0").call(l.stroke,L.linecolor||"#000").style("stroke-width",(L.linewidth||0)+"px"),d.layers.bline.select("path").attr("d",A.showline?"M"+r+","+(n+i)+"h"+a:"M0,0").call(l.stroke,A.linecolor||"#000").style("stroke-width",(A.linewidth||0)+"px"),d.layers.cline.select("path").attr("d",S.showline?"M"+(r+a/2)+","+n+"l"+a/2+","+i:"M0,0").call(l.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),d.graphDiv._context.staticPlot||d.initInteractions(),u.setClipUrl(d.layers.frontplot,d._hasClipOnAxisFalse?null:d.clipId,d.graphDiv)},w.drawAxes=function(t){var e=this.graphDiv,r=this.id.substr(7)+"title",n=this.layers,a=this.aaxis,i=this.baxis,o=this.caxis;if(this.drawAx(a),this.drawAx(i),this.drawAx(o),t){var l=Math.max(a.showticklabels?a.tickfont.size/2:0,(o.showticklabels?.75*o.tickfont.size:0)+("outside"===o.ticks?.87*o.ticklen:0)),u=(i.showticklabels?i.tickfont.size:0)+("outside"===i.ticks?i.ticklen:0)+3;n["a-title"]=g.draw(e,"a"+r,{propContainer:a,propName:this.id+".aaxis.title",placeholder:s(e,"Click to enter Component A title"),attributes:{x:this.x0+this.w/2,y:this.y0-a.title.font.size/3-l,"text-anchor":"middle"}}),n["b-title"]=g.draw(e,"b"+r,{propContainer:i,propName:this.id+".baxis.title",placeholder:s(e,"Click to enter Component B title"),attributes:{x:this.x0-u,y:this.y0+this.h+.83*i.title.font.size+u,"text-anchor":"middle"}}),n["c-title"]=g.draw(e,"c"+r,{propContainer:o,propName:this.id+".caxis.title",placeholder:s(e,"Click to enter Component C title"),attributes:{x:this.x0+this.w+u,y:this.y0+this.h+.83*o.title.font.size+u,"text-anchor":"middle"}})}},w.drawAx=function(t){var e,r=this.graphDiv,n=t._name,a=n.charAt(0),i=t._id,s=this.layers[n],l=a+"tickLayout",u=(e=t).ticks+String(e.ticklen)+String(e.showticklabels);this[l]!==u&&(s.selectAll("."+i+"tick").remove(),this[l]=u),t.setScale();var c=f.calcTicks(t),h=f.clipEnds(t,c),d=f.makeTransFn(t),p=f.getTickSigns(t)[2],m=o.deg2rad(30),g=p*(t.linewidth||1)/2,y=p*t.ticklen,v=this.w,_=this.h,x="b"===a?"M0,"+g+"l"+Math.sin(m)*y+","+Math.cos(m)*y:"M"+g+",0l"+Math.cos(m)*y+","+-Math.sin(m)*y,b={a:"M0,0l"+_+",-"+v/2,b:"M0,0l-"+v/2+",-"+_,c:"M0,0l-"+_+","+v/2}[a];f.drawTicks(r,t,{vals:"inside"===t.ticks?h:c,layer:s,path:x,transFn:d,crisp:!1}),f.drawGrid(r,t,{vals:h,layer:this.layers[a+"grid"],path:b,transFn:d,crisp:!1}),f.drawLabels(r,t,{vals:c,layer:s,transFn:d,labelFns:f.makeLabelFns(t,0,30)})};var k=x.MINZOOM/2+.87,T="m-0.87,.5h"+k+"v3h-"+(k+5.2)+"l"+(k/2+2.6)+",-"+(.87*k+4.5)+"l2.6,1.5l-"+k/2+","+.87*k+"Z",L="m0.87,.5h-"+k+"v3h"+(k+5.2)+"l-"+(k/2+2.6)+",-"+(.87*k+4.5)+"l-2.6,1.5l"+k/2+","+.87*k+"Z",A="m0,1l"+k/2+","+.87*k+"l2.6,-1.5l-"+(k/2+2.6)+",-"+(.87*k+4.5)+"l-"+(k/2+2.6)+","+(.87*k+4.5)+"l2.6,1.5l"+k/2+",-"+.87*k+"Z",S=!0;function E(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}w.initInteractions=function(){var t,e,r,n,c,h,d,f,g,b,w=this,k=w.layers.plotbg.select("path").node(),C=w.graphDiv,D=C._fullLayout._zoomlayer,P={element:k,gd:C,plotinfo:{id:w.id,xaxis:w.xaxis,yaxis:w.yaxis},subplot:w.id,prepFn:function(i,o,s){P.xaxes=[w.xaxis],P.yaxes=[w.yaxis];var u=C._fullLayout.dragmode;P.minDrag="lasso"===u?1:void 0,"zoom"===u?(P.moveFn=N,P.clickFn=z,P.doneFn=Y,function(i,o,s){var u=k.getBoundingClientRect();t=o-u.left,e=s-u.top,r={a:w.aaxis.range[0],b:w.baxis.range[1],c:w.caxis.range[1]},c=r,n=w.aaxis.range[1]-r.a,h=a(w.graphDiv._fullLayout[w.id].bgcolor).getLuminance(),d="M0,"+w.h+"L"+w.w/2+", 0L"+w.w+","+w.h+"Z",f=!1,g=D.append("path").attr("class","zoombox").attr("transform","translate("+w.x0+", "+w.y0+")").style({fill:h>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",d),b=D.append("path").attr("class","zoombox-corners").attr("transform","translate("+w.x0+", "+w.y0+")").style({fill:l.background,stroke:l.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),_(C)}(0,o,s)):"pan"===u?(P.moveFn=j,P.clickFn=z,P.doneFn=B,r={a:w.aaxis.range[0],b:w.baxis.range[1],c:w.caxis.range[1]},c=r,_(C)):"select"!==u&&"lasso"!==u||y(i,o,s,P,u)}};function O(t){var e={};return e[w.id+".aaxis.min"]=t.a,e[w.id+".baxis.min"]=t.b,e[w.id+".caxis.min"]=t.c,e}function z(t,e){var r=C._fullLayout.clickmode;E(C),2===t&&(C.emit("plotly_doubleclick",null),i.call("_guiRelayout",C,O({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===t&&v(e,C,[w.xaxis],[w.yaxis],w.id,P),r.indexOf("event")>-1&&m.click(C,e,w.id)}function I(t,e){return 1-e/w.h}function R(t,e){return 1-(t+(w.h-e)/Math.sqrt(3))/w.w}function F(t,e){return(t-(w.h-e)/Math.sqrt(3))/w.w}function N(a,i){var o=t+a,s=e+i,l=Math.max(0,Math.min(1,I(0,e),I(0,s))),u=Math.max(0,Math.min(1,R(t,e),R(o,s))),p=Math.max(0,Math.min(1,F(t,e),F(o,s))),m=(l/2+p)*w.w,y=(1-l/2-u)*w.w,v=(m+y)/2,_=y-m,k=(1-l)*w.h,S=k-_/M;_<x.MINZOOM?(c=r,g.attr("d",d),b.attr("d","M0,0Z")):(c={a:r.a+l*n,b:r.b+u*n,c:r.c+p*n},g.attr("d",d+"M"+m+","+k+"H"+y+"L"+v+","+S+"L"+m+","+k+"Z"),b.attr("d","M"+t+","+e+"m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2ZM"+m+","+k+T+"M"+y+","+k+L+"M"+v+","+S+A)),f||(g.transition().style("fill",h>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),b.transition().style("opacity",1).duration(200),f=!0),C.emit("plotly_relayouting",O(c))}function Y(){E(C),c!==r&&(i.call("_guiRelayout",C,O(c)),S&&C.data&&C._context.showTips&&(o.notifier(s(C,"Double-click to zoom back out"),"long"),S=!1))}function j(t,e){var n=t/w.xaxis._m,a=e/w.yaxis._m,i=[(c={a:r.a-a,b:r.b+(n+a)/2,c:r.c-(n-a)/2}).a,c.b,c.c].sort(),o=i.indexOf(c.a),s=i.indexOf(c.b),l=i.indexOf(c.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),c={a:i[o],b:i[s],c:i[l]},e=(r.a-c.a)*w.yaxis._m,t=(r.c-c.c-r.b+c.b)*w.xaxis._m);var h="translate("+(w.x0+t)+","+(w.y0+e)+")";w.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",h);var d="translate("+-t+","+-e+")";w.clipDefRelative.select("path").attr("transform",d),w.aaxis.range=[c.a,w.sum-c.b-c.c],w.baxis.range=[w.sum-c.a-c.c,c.b],w.caxis.range=[w.sum-c.a-c.b,c.c],w.drawAxes(!1),w._hasClipOnAxisFalse&&w.plotContainer.select(".scatterlayer").selectAll(".trace").call(u.hideOutsideRangePoints,w),C.emit("plotly_relayouting",O(c))}function B(){i.call("_guiRelayout",C,O(c))}k.onmousemove=function(t){m.hover(C,t,w.id),C._fullLayout._lasthover=k,C._fullLayout._hoversubplot=w.id},k.onmouseout=function(t){C._dragging||p.unhover(C,t)},p.init(P)}},{"../../components/color":593,"../../components/dragelement":611,"../../components/drawing":614,"../../components/fx":632,"../../components/titles":681,"../../lib":719,"../../lib/extend":710,"../../registry":847,"../cartesian/axes":767,"../cartesian/constants":773,"../cartesian/select":784,"../cartesian/set_convert":785,"../plots":828,d3:163,tinycolor2:537}],847:[function(t,e,r){var n=t("./lib/loggers"),a=t("./lib/noop"),i=t("./lib/push_unique"),o=t("./lib/is_plain_object"),s=t("./lib/dom").addStyleRule,l=t("./lib/extend"),u=t("./plots/attributes"),c=t("./plots/layout_attributes"),h=l.extendFlat,d=l.extendDeepAll;function f(t){var e=t.name,a=t.categories,i=t.meta;if(r.modules[e])n.log("Type "+e+" already registered");else{r.subplotsRegistry[t.basePlotModule.name]||function(t){var e=t.name;if(r.subplotsRegistry[e])n.log("Plot type "+e+" already registered.");else for(var a in y(t),r.subplotsRegistry[e]=t,r.componentsRegistry)x(a,t.name)}(t.basePlotModule);for(var o={},l=0;l<a.length;l++)o[a[l]]=!0,r.allCategories[a[l]]=!0;for(var u in r.modules[e]={_module:t,categories:o},i&&Object.keys(i).length&&(r.modules[e].meta=i),r.allTypes.push(e),r.componentsRegistry)v(u,e);t.layoutAttributes&&h(r.traceLayoutAttributes,t.layoutAttributes);var c=t.basePlotModule,d=c.name;if("mapbox"===d){var f=c.constants.styleRules;for(var p in f)s(".js-plotly-plot .plotly .mapboxgl-"+p,f[p])}"geo"!==d&&"mapbox"!==d||void 0===typeof window||void 0!==window.PlotlyGeoAssets||(window.PlotlyGeoAssets={topojson:{}})}}function p(t){if("string"!=typeof t.name)throw new Error("Component module *name* must be a string.");var e=t.name;for(var n in r.componentsRegistry[e]=t,t.layoutAttributes&&(t.layoutAttributes._isLinkedToArray&&i(r.layoutArrayContainers,e),y(t)),r.modules)v(e,n);for(var a in r.subplotsRegistry)x(e,a);for(var o in r.transformsRegistry)_(e,o);t.schema&&t.schema.layout&&d(c,t.schema.layout)}function m(t){if("string"!=typeof t.name)throw new Error("Transform module *name* must be a string.");var e="Transform module "+t.name,a="function"==typeof t.transform,i="function"==typeof t.calcTransform;if(!a&&!i)throw new Error(e+" is missing a *transform* or *calcTransform* method.");for(var s in a&&i&&n.log([e+" has both a *transform* and *calcTransform* methods.","Please note that all *transform* methods are executed","before all *calcTransform* methods."].join(" ")),o(t.attributes)||n.log(e+" registered without an *attributes* object."),"function"!=typeof t.supplyDefaults&&n.log(e+" registered without a *supplyDefaults* method."),r.transformsRegistry[t.name]=t,r.componentsRegistry)_(s,t.name)}function g(t){var e=t.name,n=e.split("-")[0],a=t.dictionary,i=t.format,o=a&&Object.keys(a).length,s=i&&Object.keys(i).length,l=r.localeRegistry,u=l[e];if(u||(l[e]=u={}),n!==e){var c=l[n];c||(l[n]=c={}),o&&c.dictionary===u.dictionary&&(c.dictionary=a),s&&c.format===u.format&&(c.format=i)}o&&(u.dictionary=a),s&&(u.format=i)}function y(t){if(t.layoutAttributes){var e=t.layoutAttributes._arrayAttrRegexps;if(e)for(var n=0;n<e.length;n++)i(r.layoutArrayRegexes,e[n])}}function v(t,e){var n=r.componentsRegistry[t].schema;if(n&&n.traces){var a=n.traces[e];a&&d(r.modules[e]._module.attributes,a)}}function _(t,e){var n=r.componentsRegistry[t].schema;if(n&&n.transforms){var a=n.transforms[e];a&&d(r.transformsRegistry[e].attributes,a)}}function x(t,e){var n=r.componentsRegistry[t].schema;if(n&&n.subplots){var a=r.subplotsRegistry[e],i=a.layoutAttributes,o="subplot"===a.attr?a.name:a.attr;Array.isArray(o)&&(o=o[0]);var s=n.subplots[o];i&&s&&d(i,s)}}function b(t){return"object"==typeof t&&(t=t.type),t}r.modules={},r.allCategories={},r.allTypes=[],r.subplotsRegistry={},r.transformsRegistry={},r.componentsRegistry={},r.layoutArrayContainers=[],r.layoutArrayRegexes=[],r.traceLayoutAttributes={},r.localeRegistry={},r.apiMethodRegistry={},r.collectableSubplotTypes=null,r.register=function(t){if(r.collectableSubplotTypes=null,!t)throw new Error("No argument passed to Plotly.register.");t&&!Array.isArray(t)&&(t=[t]);for(var e=0;e<t.length;e++){var n=t[e];if(!n)throw new Error("Invalid module was attempted to be registered!");switch(n.moduleType){case"trace":f(n);break;case"transform":m(n);break;case"component":p(n);break;case"locale":g(n);break;case"apiMethod":var a=n.name;r.apiMethodRegistry[a]=n.fn;break;default:throw new Error("Invalid module was attempted to be registered!")}}},r.getModule=function(t){var e=r.modules[b(t)];return!!e&&e._module},r.traceIs=function(t,e){if("various"===(t=b(t)))return!1;var a=r.modules[t];return a||(t&&"area"!==t&&n.log("Unrecognized trace type "+t+"."),a=r.modules[u.type.dflt]),!!a.categories[e]},r.getTransformIndices=function(t,e){for(var r=[],n=t.transforms||[],a=0;a<n.length;a++)n[a].type===e&&r.push(a);return r},r.hasTransform=function(t,e){for(var r=t.transforms||[],n=0;n<r.length;n++)if(r[n].type===e)return!0;return!1},r.getComponentMethod=function(t,e){var n=r.componentsRegistry[t];return n&&n[e]||a},r.call=function(){var t=arguments[0],e=[].slice.call(arguments,1);return r.apiMethodRegistry[t].apply(null,e)}},{"./lib/dom":708,"./lib/extend":710,"./lib/is_plain_object":720,"./lib/loggers":723,"./lib/noop":728,"./lib/push_unique":733,"./plots/attributes":764,"./plots/layout_attributes":819}],848:[function(t,e,r){var n=t("../registry"),a=t("../lib"),i=a.extendFlat,o=a.extendDeep;function s(t){var e;switch(t){case"themes__thumb":e={autosize:!0,width:150,height:150,title:{text:""},showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":e={title:{text:""},hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:e={}}return e}e.exports=function(t,e){var r;t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var a,l=t.data,u=t.layout,c=o([],l),h=o({},u,s(e.tileClass)),d=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 f=Object.keys(h);for(r=0;r<f.length;r++)a=f[r],["xaxis","yaxis","zaxis"].indexOf(a.slice(0,5))>-1&&(h[f[r]].title={text:""});for(r=0;r<c.length;r++){var p=c[r];p.showscale=!1,p.marker&&(p.marker.showscale=!1),n.traceIs(p,"pie-like")&&(p.textposition="none")}}if(Array.isArray(e.annotations))for(r=0;r<e.annotations.length;r++)h.annotations.push(e.annotations[r]);var m=Object.keys(h).filter((function(t){return t.match(/^scene\d*$/)}));if(m.length){var g={};for("thumbnail"===e.tileClass&&(g={title:{text:""},showaxeslabels:!1,showticklabels:!1,linetickenable:!1}),r=0;r<m.length;r++){var y=h[m[r]];y.xaxis||(y.xaxis={}),y.yaxis||(y.yaxis={}),y.zaxis||(y.zaxis={}),i(y.xaxis,g),i(y.yaxis,g),i(y.zaxis,g),y._scene=null}}var v=document.createElement("div");e.tileClass&&(v.className=e.tileClass);var _={gd:v,td:v,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:d.mapboxAccessToken}};return"transparent"!==e.setBackground&&(_.config.setBackground=e.setBackground||"opaque"),_.gd.defaultLayout=s(e.tileClass),_}},{"../lib":719,"../registry":847}],849:[function(t,e,r){var n=t("../lib"),a=t("../plot_api/to_image"),i=t("./filesaver"),o=t("./helpers");e.exports=function(t,e){var r;return n.isPlainObject(t)||(r=n.getGraphDiv(t)),(e=e||{}).format=e.format||"png",e.imageDataOnly=!0,new Promise((function(s,l){r&&r._snapshotInProgress&&l(new Error("Snapshotting already in progress.")),n.isIE()&&"svg"!==e.format&&l(new Error(o.MSG_IE_BAD_FORMAT)),r&&(r._snapshotInProgress=!0);var u=a(t,e),c=e.filename||t.fn||"newplot";c+="."+e.format,u.then((function(t){return r&&(r._snapshotInProgress=!1),i(t,c,e.format)})).then((function(t){s(t)})).catch((function(t){r&&(r._snapshotInProgress=!1),l(t)}))}))}},{"../lib":719,"../plot_api/to_image":760,"./filesaver":850,"./helpers":851}],850:[function(t,e,r){var n=t("../lib"),a=t("./helpers");e.exports=function(t,e,r){var i=document.createElement("a"),o="download"in i;return new Promise((function(s,l){var u,c;if(n.isIE9orBelow()&&l(new Error("IE < 10 unsupported")),n.isSafari()){var h="svg"===r?",":";base64,";return a.octetStream(h+encodeURIComponent(t)),s(e)}return n.isIE()?(u=a.createBlob(t,"svg"),window.navigator.msSaveBlob(u,e),u=null,s(e)):o?(u=a.createBlob(t,r),c=a.createObjectURL(u),i.href=c,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),a.revokeObjectURL(c),u=null,s(e)):void l(new Error("download error"))}))}},{"../lib":719,"./helpers":851}],851:[function(t,e,r){var n=t("../registry");r.getDelay=function(t){return t._has&&(t._has("gl3d")||t._has("gl2d")||t._has("mapbox"))?500:0},r.getRedrawFunc=function(t){return function(){var e=t._fullLayout||{};(!e._has||!e._has("polar"))&&t.data&&t.data[0]&&t.data[0].r||n.getComponentMethod("colorbar","draw")(t)}},r.encodeSVG=function(t){return"data:image/svg+xml,"+encodeURIComponent(t)};var a=window.URL||window.webkitURL;r.createObjectURL=function(t){return a.createObjectURL(t)},r.revokeObjectURL=function(t){return a.revokeObjectURL(t)},r.createBlob=function(t,e){if("svg"===e)return new window.Blob([t],{type:"image/svg+xml;charset=utf-8"});var r=function(t){for(var e=t.length,r=new ArrayBuffer(e),n=new Uint8Array(r),a=0;a<e;a++)n[a]=t.charCodeAt(a);return r}(window.atob(t));return new window.Blob([r],{type:"image/"+e})},r.octetStream=function(t){document.location.href="data:application/octet-stream"+t},r.IMAGE_URL_PREFIX=/^data:image\/\w+;base64,/,r.MSG_IE_BAD_FORMAT="Sorry IE does not support downloading from canvas. Try {format:'svg'} instead."},{"../registry":847}],852:[function(t,e,r){var n=t("./helpers"),a={getDelay:n.getDelay,getRedrawFunc:n.getRedrawFunc,clone:t("./cloneplot"),toSVG:t("./tosvg"),svgToImg:t("./svgtoimg"),toImage:t("./toimage"),downloadImage:t("./download")};e.exports=a},{"./cloneplot":848,"./download":849,"./helpers":851,"./svgtoimg":853,"./toimage":854,"./tosvg":855}],853:[function(t,e,r){var n=t("../lib"),a=t("events").EventEmitter,i=t("./helpers");e.exports=function(t){var e=t.emitter||new a,r=new Promise((function(a,o){var s=window.Image,l=t.svg,u=t.format||"png";if(n.isIE()&&"svg"!==u){var c=new Error(i.MSG_IE_BAD_FORMAT);return o(c),t.promise?r:e.emit("error",c)}var h,d,f=t.canvas,p=t.scale||1,m=t.width||300,g=t.height||150,y=p*m,v=p*g,_=f.getContext("2d"),x=new s;"svg"===u||n.isIE9orBelow()||n.isSafari()?d=i.encodeSVG(l):(h=i.createBlob(l,"svg"),d=i.createObjectURL(h)),f.width=y,f.height=v,x.onload=function(){var r;switch(h=null,i.revokeObjectURL(d),"svg"!==u&&_.drawImage(x,0,0,y,v),u){case"jpeg":r=f.toDataURL("image/jpeg");break;case"png":r=f.toDataURL("image/png");break;case"webp":r=f.toDataURL("image/webp");break;case"svg":r=d;break;default:var n="Image format is not jpeg, png, svg or webp.";if(o(new Error(n)),!t.promise)return e.emit("error",n)}a(r),t.promise||e.emit("success",r)},x.onerror=function(r){if(h=null,i.revokeObjectURL(d),o(r),!t.promise)return e.emit("error",r)},x.src=d}));return t.promise?r:e}},{"../lib":719,"./helpers":851,events:104}],854:[function(t,e,r){var n=t("events").EventEmitter,a=t("../registry"),i=t("../lib"),o=t("./helpers"),s=t("./cloneplot"),l=t("./tosvg"),u=t("./svgtoimg");e.exports=function(t,e){var r=new n,c=s(t,{format:"png"}),h=c.gd;h.style.position="absolute",h.style.left="-5000px",document.body.appendChild(h);var d=o.getRedrawFunc(h);return a.call("plot",h,c.data,c.layout,c.config).then(d).then((function(){var t=o.getDelay(h._fullLayout);setTimeout((function(){var t=l(h),n=document.createElement("canvas");n.id=i.randstr(),(r=u({format:e.format,width:h._fullLayout.width,height:h._fullLayout.height,canvas:n,emitter:r,svg:t})).clean=function(){h&&document.body.removeChild(h)}}),t)})).catch((function(t){r.emit("error",t)})),r}},{"../lib":719,"../registry":847,"./cloneplot":848,"./helpers":851,"./svgtoimg":853,"./tosvg":855,events:104}],855:[function(t,e,r){var n=t("d3"),a=t("../lib"),i=t("../components/drawing"),o=t("../components/color"),s=t("../constants/xmlns_namespaces"),l=/"/g,u=new RegExp('("TOBESTRIPPED)|(TOBESTRIPPED")',"g");e.exports=function(t,e,r){var c,h=t._fullLayout,d=h._paper,f=h._toppaper,p=h.width,m=h.height;d.insert("rect",":first-child").call(i.setRect,0,0,p,m).call(o.fill,h.paper_bgcolor);var g=h._basePlotModules||[];for(c=0;c<g.length;c++){var y=g[c];y.toSVG&&y.toSVG(t)}if(f){var v=f.node().childNodes,_=Array.prototype.slice.call(v);for(c=0;c<_.length;c++){var x=_[c];x.childNodes.length&&d.node().appendChild(x)}}h._draggers&&h._draggers.remove(),d.node().style.background="",d.selectAll("text").attr({"data-unformatted":null,"data-math":null}).each((function(){var t=n.select(this);if("hidden"!==this.style.visibility&&"none"!==this.style.display){t.style({visibility:null,display:null});var e=this.style.fontFamily;e&&-1!==e.indexOf('"')&&t.style("font-family",e.replace(l,"TOBESTRIPPED"))}else t.remove()})),d.selectAll(".point, .scatterpts, .legendfill>path, .legendlines>path, .cbfill").each((function(){var t=n.select(this),e=this.style.fill;e&&-1!==e.indexOf("url(")&&t.style("fill",e.replace(l,"TOBESTRIPPED"));var r=this.style.stroke;r&&-1!==r.indexOf("url(")&&t.style("stroke",r.replace(l,"TOBESTRIPPED"))})),"pdf"!==e&&"eps"!==e||d.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width",0),d.node().setAttributeNS(s.xmlns,"xmlns",s.svg),d.node().setAttributeNS(s.xmlns,"xmlns:xlink",s.xlink),"svg"===e&&r&&(d.attr("width",r*p),d.attr("height",r*m),d.attr("viewBox","0 0 "+p+" "+m));var b=(new window.XMLSerializer).serializeToString(d.node());return b=function(t){var e=n.select("body").append("div").style({display:"none"}).html(""),r=t.replace(/(&[^;]*;)/gi,(function(t){return"&lt;"===t?"&#60;":"&rt;"===t?"&#62;":-1!==t.indexOf("<")||-1!==t.indexOf(">")?"":e.html(t).text()}));return e.remove(),r}(b),b=(b=b.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&amp;")).replace(u,"'"),a.isIE()&&(b=(b=(b=b.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),b}},{"../components/color":593,"../components/drawing":614,"../constants/xmlns_namespaces":696,"../lib":719,d3:163}],856:[function(t,e,r){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");var a=e.marker;if(a){n.mergeArray(a.opacity,t,"mo",!0),n.mergeArray(a.color,t,"mc");var i=a.line;i&&(n.mergeArray(i.color,t,"mlc"),n.mergeArrayCastPositive(i.width,t,"mlw"))}}},{"../../lib":719}],857:[function(t,e,r){var n=t("../scatter/attributes"),a=t("../../components/fx/hovertemplate_attributes"),i=t("../../components/colorscale/attributes"),o=t("../../plots/font_attributes"),s=t("./constants.js"),l=t("../../lib/extend").extendFlat,u=o({editType:"calc",arrayOk:!0,colorEditType:"style"}),c=l({},n.marker.line.width,{dflt:0}),h=l({width:c,editType:"calc"},i("marker.line")),d=l({line:h,editType:"calc"},i("marker"),{opacity:{valType:"number",arrayOk:!0,dflt:1,min:0,max:1,editType:"style"}});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,hovertemplate:a({},{keys:s.eventDataKeys}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"none",arrayOk:!0,editType:"calc"},insidetextanchor:{valType:"enumerated",values:["end","middle","start"],dflt:"end",editType:"plot"},textangle:{valType:"angle",dflt:"auto",editType:"plot"},textfont:l({},u,{}),insidetextfont:l({},u,{}),outsidetextfont:l({},u,{}),constraintext:{valType:"enumerated",values:["inside","outside","both","none"],dflt:"both",editType:"calc"},cliponaxis:l({},n.cliponaxis,{}),orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},base:{valType:"any",dflt:null,arrayOk:!0,editType:"calc"},offset:{valType:"number",dflt:null,arrayOk:!0,editType:"calc"},width:{valType:"number",dflt:null,min:0,arrayOk:!0,editType:"calc"},marker:d,offsetgroup:{valType:"string",dflt:"",editType:"calc"},alignmentgroup:{valType:"string",dflt:"",editType:"calc"},selected:{marker:{opacity:n.selected.marker.opacity,color:n.selected.marker.color,editType:"style"},textfont:n.selected.textfont,editType:"style"},unselected:{marker:{opacity:n.unselected.marker.opacity,color:n.unselected.marker.color,editType:"style"},textfont:n.unselected.textfont,editType:"style"},r:n.r,t:n.t,_deprecated:{bardir:{valType:"enumerated",editType:"calc",values:["v","h"]}}}},{"../../components/colorscale/attributes":600,"../../components/fx/hovertemplate_attributes":631,"../../lib/extend":710,"../../plots/font_attributes":793,"../scatter/attributes":1112,"./constants.js":859}],858:[function(t,e,r){var n=t("../../plots/cartesian/axes"),a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/calc"),o=t("./arrays_to_calcdata"),s=t("../scatter/calc_selection");e.exports=function(t,e){var r,l,u=n.getFromId(t,e.xaxis||"x"),c=n.getFromId(t,e.yaxis||"y");"h"===e.orientation?(r=u.makeCalcdata(e,"x"),l=c.makeCalcdata(e,"y")):(r=c.makeCalcdata(e,"y"),l=u.makeCalcdata(e,"x"));for(var h=Math.min(l.length,r.length),d=new Array(h),f=0;f<h;f++)d[f]={p:l[f],s:r[f]},e.ids&&(d[f].id=String(e.ids[f]));return a(e,"marker")&&i(t,e,{vals:e.marker.color,containerStr:"marker",cLetter:"c"}),a(e,"marker.line")&&i(t,e,{vals:e.marker.line.color,containerStr:"marker.line",cLetter:"c"}),o(d,e),s(d,e),d}},{"../../components/colorscale/calc":601,"../../components/colorscale/helpers":604,"../../plots/cartesian/axes":767,"../scatter/calc_selection":1114,"./arrays_to_calcdata":856}],859:[function(t,e,r){e.exports={eventDataKeys:[]}},{}],860:[function(t,e,r){var n=t("fast-isnumeric"),a=t("../../lib").isArrayOrTypedArray,i=t("../../constants/numerical").BADNUM,o=t("../../registry"),s=t("../../plots/cartesian/axes"),l=t("../../plots/cartesian/axis_ids").getAxisGroup,u=t("./sieve.js");function c(t,e,r,o,c){if(o.length){var x,b,w,M;switch(function(t,e){var r,i;for(r=0;r<e.length;r++){var o,s=e[r],l=s[0].trace,u="funnel"===l.type?l._base:l.base,c="h"===l.orientation?l.xcalendar:l.ycalendar,h="category"===t.type||"multicategory"===t.type?function(){return null}:t.d2c;if(a(u)){for(i=0;i<Math.min(u.length,s.length);i++)o=h(u[i],0,c),n(o)?(s[i].b=+o,s[i].hasB=1):s[i].b=0;for(;i<s.length;i++)s[i].b=0}else{o=h(u,0,c);var d=n(o);for(o=d?o:0,i=0;i<s.length;i++)s[i].b=o,d&&(s[i].hasB=1)}}}(r,o),c.mode){case"overlay":h(e,r,o,c);break;case"group":for(x=[],b=[],w=0;w<o.length;w++)void 0===(M=o[w])[0].trace.offset?b.push(M):x.push(M);b.length&&function(t,e,r,n,a){var o=new u(n,{sepNegVal:!1,overlapNoMerge:!a.norm});(function(t,e,r,n){for(var a=t._fullLayout,i=r.positions,o=r.distinctPositions,s=r.minDiff,u=r.traces,c=u.length,h=i.length!==o.length,d=s*(1-n.gap),g=l(a,e._id)+u[0][0].trace.orientation,y=a._alignmentOpts[g]||{},v=0;v<c;v++){var _,x,b=u[v],w=b[0].trace,M=y[w.alignmentgroup]||{},k=Object.keys(M.offsetGroups||{}).length,T=(_=k?d/k:h?d/c:d)*(1-(n.groupgap||0));x=k?((2*w._offsetIndex+1-k)*_-T)/2:h?((2*v+1-c)*_-T)/2:-T/2;var L=b[0].t;L.barwidth=T,L.poffset=x,L.bargroupwidth=d,L.bardelta=s}r.binWidth=u[0][0].t.barwidth/100,f(r),p(e,r),m(e,r,h)})(t,e,o,a),function(t){for(var e=t.traces,r=0;r<e.length;r++){var n=e[r];if(void 0===n[0].trace.base)for(var a=new u([n],{sepNegVal:!0,overlapNoMerge:!0}),o=0;o<n.length;o++){var s=n[o];if(s.p!==i){var l=a.put(s.p,s.b+s.s);l&&(s.b=l)}}}}(o),a.norm?(y(o),v(r,o,a)):g(r,o)}(t,e,r,b,c),x.length&&h(e,r,x,c);break;case"stack":case"relative":for(x=[],b=[],w=0;w<o.length;w++)void 0===(M=o[w])[0].trace.base?b.push(M):x.push(M);b.length&&function(t,e,r,n,a){var o=new u(n,{sepNegVal:"relative"===a.mode,overlapNoMerge:!(a.norm||"stack"===a.mode||"relative"===a.mode)});d(e,o,a),function(t,e,r){var n,a,o,l,u,c,h=_(t),d=e.traces;for(l=0;l<d.length;l++)if("funnel"===(a=(n=d[l])[0].trace).type)for(u=0;u<n.length;u++)(c=n[u]).s!==i&&e.put(c.p,-.5*c.s);for(l=0;l<d.length;l++){o="funnel"===(a=(n=d[l])[0].trace).type;var f=[];for(u=0;u<n.length;u++)if((c=n[u]).s!==i){var p;p=o?c.s:c.s+c.b;var m=e.put(c.p,p),g=m+p;c.b=m,c[h]=g,r.norm||(f.push(g),c.hasB&&f.push(m))}r.norm||(a._extremes[t._id]=s.findExtremes(t,f,{tozero:!0,padded:!0}))}}(r,o,a);for(var l=0;l<n.length;l++)for(var c=n[l],h=0;h<c.length;h++){var f=c[h];f.s!==i&&f.b+f.s===o.get(f.p,f.s)&&(f._outmost=!0)}a.norm&&v(r,o,a)}(0,e,r,b,c),x.length&&h(e,r,x,c)}!function(t,e){var r,a,i,o=_(e),s={},l=1/0,u=-1/0;for(r=0;r<t.length;r++)for(i=t[r],a=0;a<i.length;a++){var c=i[a].p;n(c)&&(l=Math.min(l,c),u=Math.max(u,c))}var h=1e4/(u-l),d=s.round=function(t){return String(Math.round(h*(t-l)))};for(r=0;r<t.length;r++){(i=t[r])[0].t.extents=s;var f=i[0].t.poffset,p=Array.isArray(f);for(a=0;a<i.length;a++){var m=i[a],g=m[o]-m.w/2;if(n(g)){var y=m[o]+m.w/2,v=d(m.p);s[v]?s[v]=[Math.min(g,s[v][0]),Math.max(y,s[v][1])]:s[v]=[g,y]}m.p0=m.p+(p?f[a]:f),m.p1=m.p0+m.w,m.s0=m.b,m.s1=m.s0+m.s}}}(o,e)}}function h(t,e,r,n){for(var a=0;a<r.length;a++){var i=r[a],o=new u([i],{sepNegVal:!1,overlapNoMerge:!n.norm});d(t,o,n),n.norm?(y(o),v(e,o,n)):g(e,o)}}function d(t,e,r){for(var n=e.minDiff,a=e.traces,i=n*(1-r.gap),o=i*(1-(r.groupgap||0)),s=-o/2,l=0;l<a.length;l++){var u=a[l][0].t;u.barwidth=o,u.poffset=s,u.bargroupwidth=i,u.bardelta=n}e.binWidth=a[0][0].t.barwidth/100,f(e),p(t,e),m(t,e)}function f(t){var e,r,i=t.traces;for(e=0;e<i.length;e++){var o,s=i[e],l=s[0],u=l.trace,c=l.t,h=u._offset||u.offset,d=c.poffset;if(a(h)){for(o=Array.prototype.slice.call(h,0,s.length),r=0;r<o.length;r++)n(o[r])||(o[r]=d);for(r=o.length;r<s.length;r++)o.push(d);c.poffset=o}else void 0!==h&&(c.poffset=h);var f=u._width||u.width,p=c.barwidth;if(a(f)){var m=Array.prototype.slice.call(f,0,s.length);for(r=0;r<m.length;r++)n(m[r])||(m[r]=p);for(r=m.length;r<s.length;r++)m.push(p);if(c.barwidth=m,void 0===h){for(o=[],r=0;r<s.length;r++)o.push(d+(p-m[r])/2);c.poffset=o}}else void 0!==f&&(c.barwidth=f,void 0===h&&(c.poffset=d+(p-f)/2))}}function p(t,e){for(var r=e.traces,n=_(t),a=0;a<r.length;a++)for(var i=r[a],o=i[0].t,s=o.poffset,l=Array.isArray(s),u=o.barwidth,c=Array.isArray(u),h=0;h<i.length;h++){var d=i[h],f=d.w=c?u[h]:u;d[n]=d.p+(l?s[h]:s)+f/2}}function m(t,e,r){var n=e.traces,a=e.minDiff/2;s.minDtick(t,e.minDiff,e.distinctPositions[0],r);for(var i=0;i<n.length;i++){var o,l,u,c,h=n[i],d=h[0],f=d.trace,p=[];for(c=0;c<h.length;c++)l=(o=h[c]).p-a,u=o.p+a,p.push(l,u);if(f.width||f.offset){var m=d.t,g=m.poffset,y=m.barwidth,v=Array.isArray(g),_=Array.isArray(y);for(c=0;c<h.length;c++){o=h[c];var x=v?g[c]:g,b=_?y[c]:y;u=(l=o.p+x)+b,p.push(l,u)}}f._extremes[t._id]=s.findExtremes(t,p,{padded:!1})}}function g(t,e){for(var r=e.traces,n=_(t),a=0;a<r.length;a++){for(var i=r[a],o=i[0].trace,l=[],u=!0,c=0;c<i.length;c++){var h=i[c],d=h.b,f=d+h.s;h[n]=f,l.push(f),h.hasB&&l.push(d),h.hasB&&h.b>0&&h.s>0||(u=!1)}o._extremes[t._id]=s.findExtremes(t,l,{tozero:!u,padded:!0})}}function y(t){for(var e=t.traces,r=0;r<e.length;r++)for(var n=e[r],a=0;a<n.length;a++){var o=n[a];o.s!==i&&t.put(o.p,o.b+o.s)}}function v(t,e,r){var a=e.traces,o=_(t),l="fraction"===r.norm?1:100,u=l/1e9,c=t.l2c(t.c2l(0)),h="stack"===r.mode?l:c;function d(e){return n(t.c2l(e))&&(e<c-u||e>h+u||!n(c))}for(var f=0;f<a.length;f++){for(var p=a[f],m=p[0].trace,g=[],y=!0,v=!1,x=0;x<p.length;x++){var b=p[x];if(b.s!==i){var w=Math.abs(l/e.get(b.p,b.s));b.b*=w,b.s*=w;var M=b.b,k=M+b.s;b[o]=k,g.push(k),v=v||d(k),b.hasB&&(g.push(M),v=v||d(M)),b.hasB&&b.b>0&&b.s>0||(y=!1)}}m._extremes[t._id]=s.findExtremes(t,g,{tozero:!y,padded:v})}}function _(t){return t._id.charAt(0)}e.exports={crossTraceCalc:function(t,e){for(var r=e.xaxis,n=e.yaxis,a=t._fullLayout,i=t._fullData,s=t.calcdata,l=[],u=[],h=0;h<i.length;h++){var d=i[h];!0===d.visible&&o.traceIs(d,"bar")&&d.xaxis===r._id&&d.yaxis===n._id&&("h"===d.orientation?l.push(s[h]):u.push(s[h]))}var f={mode:a.barmode,norm:a.barnorm,gap:a.bargap,groupgap:a.bargroupgap};c(t,r,n,u,f),c(t,n,r,l,f)},setGroupPositions:c}},{"../../constants/numerical":695,"../../lib":719,"../../plots/cartesian/axes":767,"../../plots/cartesian/axis_ids":770,"../../registry":847,"./sieve.js":869,"fast-isnumeric":225}],861:[function(t,e,r){var n=t("../../lib"),a=t("../../components/color"),i=t("../../registry"),o=t("../scatter/xy_defaults"),s=t("./style_defaults"),l=t("../../plots/cartesian/axis_ids").getAxisGroup,u=t("./attributes"),c=n.coerceFont;function h(t,e,r,n){var a=e.orientation,i=e[{v:"x",h:"y"}[a]+"axis"],o=l(r,i)+a,s=r._alignmentOpts||{},u=n("alignmentgroup"),c=s[o];c||(c=s[o]={});var h=c[u];h?h.traces.push(e):h=c[u]={traces:[e],alignmentIndex:Object.keys(c).length,offsetGroups:{}};var d=n("offsetgroup"),f=h.offsetGroups,p=f[d];d&&(p||(p=f[d]={offsetIndex:Object.keys(f).length}),e._offsetIndex=p.offsetIndex)}function d(t,e,r,a,i,o){var s=!(!1===(o=o||{}).moduleHasSelected),l=!(!1===o.moduleHasUnselected),u=!(!1===o.moduleHasConstrain),h=!(!1===o.moduleHasCliponaxis),d=!(!1===o.moduleHasTextangle),f=!(!1===o.moduleHasInsideanchor),p=Array.isArray(i)||"auto"===i,m=p||"inside"===i,g=p||"outside"===i;if(m||g){var y=c(a,"textfont",r.font),v=n.extendFlat({},y);!(t.textfont&&t.textfont.color)&&delete v.color,c(a,"insidetextfont",v),g&&c(a,"outsidetextfont",y),s&&a("selected.textfont.color"),l&&a("unselected.textfont.color"),u&&a("constraintext"),h&&a("cliponaxis"),d&&a("textangle")}m&&f&&a("insidetextanchor")}e.exports={supplyDefaults:function(t,e,r,l){function c(r,a){return n.coerce(t,e,u,r,a)}if(o(t,e,l,c)){c("orientation",e.x&&!e.y?"h":"v"),c("base"),c("offset"),c("width"),c("text"),c("hovertext"),c("hovertemplate");var h=c("textposition");d(t,0,l,c,h,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),s(t,e,c,r,l);var f=(e.marker.line||{}).color,p=i.getComponentMethod("errorbars","supplyDefaults");p(t,e,f||a.defaultLine,{axis:"y"}),p(t,e,f||a.defaultLine,{axis:"x",inherit:"y"}),n.coerceSelectionMarkerOpacity(e,c)}else e.visible=!1},crossTraceDefaults:function(t,e){var r;function a(t){return n.coerce(r._input,r,u,t)}if("group"===e.barmode)for(var i=0;i<t.length;i++)"bar"===(r=t[i]).type&&(r._input,h(0,r,e,a))},handleGroupingDefaults:h,handleText:d}},{"../../components/color":593,"../../lib":719,"../../plots/cartesian/axis_ids":770,"../../registry":847,"../scatter/xy_defaults":1137,"./attributes":857,"./style_defaults":871}],862:[function(t,e,r){var n=t("fast-isnumeric"),a=t("tinycolor2"),i=t("../../lib").isArrayOrTypedArray;r.coerceString=function(t,e,r){if("string"==typeof e){if(e||!t.noBlank)return e}else if(("number"==typeof e||!0===e)&&!t.strict)return String(e);return void 0!==r?r:t.dflt},r.coerceNumber=function(t,e,r){if(n(e)){e=+e;var a=t.min,i=t.max;if(!(void 0!==a&&e<a||void 0!==i&&e>i))return e}return void 0!==r?r:t.dflt},r.coerceColor=function(t,e,r){return a(e).isValid()?e:void 0!==r?r:t.dflt},r.coerceEnumerated=function(t,e,r){return t.coerceNumber&&(e=+e),-1!==t.values.indexOf(e)?e:void 0!==r?r:t.dflt},r.getValue=function(t,e){var r;return Array.isArray(t)?e<t.length&&(r=t[e]):r=t,r},r.getLineWidth=function(t,e){return 0<e.mlw?e.mlw:i(t.marker.line.width)?0:t.marker.line.width}},{"../../lib":719,"fast-isnumeric":225,tinycolor2:537}],863:[function(t,e,r){var n=t("../../components/fx"),a=t("../../registry"),i=t("../../components/color"),o=t("../../lib").fillText,s=t("./helpers").getLineWidth;function l(t,e,r,a){var i,s,l,u,c,h,d,f=t.cd,p=f[0].trace,m=f[0].t,g="closest"===a,y="waterfall"===p.type,v=t.maxHoverDistance,_=t.maxSpikeDistance;function x(t){return t[l]-t.w/2}function b(t){return t[l]+t.w/2}var w=g?x:function(t){return Math.min(x(t),t.p-m.bardelta/2)},M=g?b:function(t){return Math.max(b(t),t.p+m.bardelta/2)};function k(t,e){return n.inbox(t-i,e-i,v+Math.min(1,Math.abs(e-t)/d)-1)}function T(t){return k(w(t),M(t))}function L(t){var e=s,r=t.b,a=t[u];return y&&(a+=Math.abs(t.rawS||0)),n.inbox(r-e,a-e,v+(a-e)/(a-r)-1)}"h"===p.orientation?(i=r,s=e,l="y",u="x",c=L,h=T):(i=e,s=r,l="x",u="y",h=L,c=T);var A=t[l+"a"],S=t[u+"a"];d=Math.abs(A.r2c(A.range[1])-A.r2c(A.range[0]));var E=n.getDistanceFunction(a,c,h,(function(t){return(c(t)+h(t))/2}));if(n.getClosest(f,E,t),!1!==t.index){g||(w=function(t){return Math.min(x(t),t.p-m.bargroupwidth/2)},M=function(t){return Math.max(b(t),t.p+m.bargroupwidth/2)});var C=f[t.index],D=p.base?C.b+C.s:C.s;t[u+"0"]=t[u+"1"]=S.c2p(C[u],!0),t[u+"LabelVal"]=D;var P=m.extents[m.extents.round(C.p)];return t[l+"0"]=A.c2p(g?w(C):P[0],!0),t[l+"1"]=A.c2p(g?M(C):P[1],!0),t[l+"LabelVal"]=C.p,t.spikeDistance=(L(C)+function(t){return k(x(t),b(t))}(C))/2+_-v,t[l+"Spike"]=A.c2p(C.p,!0),o(C,p,t),t.hovertemplate=p.hovertemplate,t}}function u(t,e){var r=e.mcc||t.marker.color,n=e.mlcc||t.marker.line.color,a=s(t,e);return i.opacity(r)?r:i.opacity(n)&&a?n:void 0}e.exports={hoverPoints:function(t,e,r,n){var i=l(t,e,r,n);if(i){var o=i.cd,s=o[0].trace,c=o[i.index];return i.color=u(s,c),a.getComponentMethod("errorbars","hoverInfo")(c,s,i),[i]}},hoverOnBars:l,getTraceColor:u}},{"../../components/color":593,"../../components/fx":632,"../../lib":719,"../../registry":847,"./helpers":862}],864:[function(t,e,r){e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults").supplyDefaults,crossTraceDefaults:t("./defaults").crossTraceDefaults,supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),crossTraceCalc:t("./cross_trace_calc").crossTraceCalc,colorbar:t("../scatter/marker_colorbar"),arraysToCalcdata:t("./arrays_to_calcdata"),plot:t("./plot").plot,style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover").hoverPoints,selectPoints:t("./select"),moduleType:"trace",name:"bar",basePlotModule:t("../../plots/cartesian"),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":778,"../scatter/marker_colorbar":1129,"./arrays_to_calcdata":856,"./attributes":857,"./calc":858,"./cross_trace_calc":860,"./defaults":861,"./hover":863,"./layout_attributes":865,"./layout_defaults":866,"./plot":867,"./select":868,"./style":870}],865:[function(t,e,r){e.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],866:[function(t,e,r){var n=t("../../registry"),a=t("../../plots/cartesian/axes"),i=t("../../lib"),o=t("./layout_attributes");e.exports=function(t,e,r){function s(r,n){return i.coerce(t,e,o,r,n)}for(var l=!1,u=!1,c=!1,h={},d=s("barmode"),f=0;f<r.length;f++){var p=r[f];if(n.traceIs(p,"bar")&&p.visible){if(l=!0,"group"===d){var m=p.xaxis+p.yaxis;h[m]&&(c=!0),h[m]=!0}p.visible&&"histogram"===p.type&&"category"!==a.getFromId({_fullLayout:e},p["v"===p.orientation?"xaxis":"yaxis"]).type&&(u=!0)}}l?("overlay"!==d&&s("barnorm"),s("bargap",u&&!c?0:.2),s("bargroupgap")):delete e.barmode}},{"../../lib":719,"../../plots/cartesian/axes":767,"../../registry":847,"./layout_attributes":865}],867:[function(t,e,r){var n=t("d3"),a=t("fast-isnumeric"),i=t("../../lib"),o=t("../../lib/svg_text_utils"),s=t("../../components/color"),l=t("../../components/drawing"),u=t("../../registry"),c=t("../../plots/cartesian/axes").tickText,h=t("./style"),d=t("./helpers"),f=t("./attributes"),p=f.text,m=f.textposition;function g(t,e){return t<e?1:-1}function y(t){return"auto"===t?0:t}function v(t,e,r,n,a,i){var o=!!i.isHorizontal,s=!!i.constrained,l=i.angle||0,u=i.anchor||0,c=a.width,h=a.height,d=Math.abs(e-t),f=Math.abs(n-r),p=d>6&&f>6?3:0;d-=2*p,f-=2*p;var m=!1;if(!("auto"===l)||c<=d&&h<=f||!(c>d||h>f)||(c>f||h>d)&&c<h==d<f||(m=!0),m){var v=f;f=d,d=v}var _=y(l),x=Math.abs(Math.sin(Math.PI/180*_)),b=Math.abs(Math.cos(Math.PI/180*_)),w=Math.max(d*b,f*x),M=Math.max(d*x,f*b),k=s?Math.min(w/c,M/h):Math.max(b,x);k=Math.min(1,k);var T=(t+e)/2,L=(r+n)/2;return"middle"!==u&&(p+=.5*(k*(o!==m?h:c)*x+k*(o!==m?c:h)*b),o?(p*=g(t,e),T="start"===u?t+p:e-p):(p*=g(r,n),L="start"===u?r+p:n-p)),m&&(_+=90),{textX:(a.left+a.right)/2,textY:(a.top+a.bottom)/2,targetX:T,targetY:L,scale:k,rotate:_}}function _(t,e,r,n,a,i){var o,s=!!i.isHorizontal,l=!!i.constrained,u=i.angle||0,c=a.width,h=a.height,d=Math.abs(e-t),f=Math.abs(n-r);o=s?f>6?3:0:d>6?3:0;var p=1;l&&(p=s?Math.min(1,f/h):Math.min(1,d/c));var m=y(u);o+=.5*(p*(s?h:c)*Math.abs(Math.sin(Math.PI/180*m))+p*(s?c:h)*Math.abs(Math.cos(Math.PI/180*m)));var v=(t+e)/2,_=(r+n)/2;return s?v=e-o*g(e,t):_=n+o*g(r,n),{textX:(a.left+a.right)/2,textY:(a.top+a.bottom)/2,targetX:v,targetY:_,scale:p,rotate:m}}function x(t){var e,r=t.textX,n=t.textY,a=t.targetX,i=t.targetY,o=t.scale,s=t.rotate;return o<1?e="scale("+o+") ":(o=1,e=""),"translate("+(a-o*r)+" "+(i-o*n)+")"+e+(s?"rotate("+s+" "+r+" "+n+") ":"")}e.exports={plot:function(t,e,r,f,y){var b=e.xaxis,w=e.yaxis,M=t._fullLayout;y||(y={mode:M.barmode,norm:M.barmode,gap:M.bargap,groupgap:M.bargroupgap});var k=i.makeTraceGroups(f,r,"trace bars").each((function(r){var u=n.select(this),f=r[0].trace,M="waterfall"===f.type,k="funnel"===f.type,T="bar"===f.type||k,L=0;M&&f.connector.visible&&"between"===f.connector.mode&&(L=f.connector.line.width/2);var A="h"===f.orientation,S=i.ensureSingle(u,"g","points").selectAll("g.point").data(i.identity);S.enter().append("g").classed("point",!0),S.exit().remove(),S.each((function(u,M){var k,S,E=n.select(this),C=function(t,e,r,n){var a=[],i=[],o=n?e:r,s=n?r:e;return a[0]=o.c2p(t.s0,!0),i[0]=s.c2p(t.p0,!0),a[1]=o.c2p(t.s1,!0),i[1]=s.c2p(t.p1,!0),n?[a,i]:[i,a]}(u,b,w,A),D=C[0][0],P=C[0][1],O=C[1][0],z=C[1][1],I=!(D!==P&&O!==z&&a(D)&&a(P)&&a(O)&&a(z));if(I&&T&&d.getLineWidth(f,u)&&(A?P-D==0:z-O==0)&&(I=!1),u.isBlank=I,L&&(A?(D-=g(D,P)*L,P+=g(D,P)*L):(O-=g(O,z)*L,z+=g(O,z)*L)),"waterfall"===f.type){if(!I){var R=f[u.dir].marker;k=R.line.width,S=R.color}}else k=d.getLineWidth(f,u),S=u.mc||f.marker.color;var F=n.round(k/2%1,2);function N(t){return 0===y.gap&&0===y.groupgap?n.round(Math.round(t)-F,2):t}if(!t._context.staticPlot){var Y=s.opacity(S)<1||k>.01?N:function(t,e){return Math.abs(t-e)>=2?N(t):t>e?Math.ceil(t):Math.floor(t)};D=Y(D,P),P=Y(P,D),O=Y(O,z),z=Y(z,O)}i.ensureSingle(E,"path").style("vector-effect","non-scaling-stroke").attr("d",I?"M0,0Z":"M"+D+","+O+"V"+z+"H"+P+"V"+O+"Z").call(l.setClipUrl,e.layerClipId,t),function(t,e,r,n,a,s,u,f,g,y){var b,w=e.xaxis,M=e.yaxis,k=t._fullLayout;function T(e,r,n){return i.ensureSingle(e,"text").text(r).attr({class:"bartext bartext-"+b,transform:"","text-anchor":"middle","data-notex":1}).call(l.font,n).call(o.convertToTspans,t)}var L=n[0].trace,A="h"===L.orientation,S=function(t,e,r,n){var a,o=t[0].trace;return a=o.textinfo?function(t,e,r,n){var a=t[0].trace,o="h"===a.orientation,s="waterfall"===a.type,l="funnel"===a.type;function u(t){return c(o?r:n,+t,!0).text}var h,d,f=a.textinfo,p=t[e],m=f.split("+"),g=[],y=function(t){return-1!==m.indexOf(t)};if(y("label")&&g.push((d=t[e].p,c(o?n:r,d,!0).text)),y("text")&&(0===(h=i.castOption(a,p.i,"text"))||h)&&g.push(h),s){var v=+p.rawS||p.s,_=p.v,x=_-v;y("initial")&&g.push(u(x)),y("delta")&&g.push(u(v)),y("final")&&g.push(u(_))}if(l){y("value")&&g.push(u(p.s));var b=0;y("percent initial")&&b++,y("percent previous")&&b++,y("percent total")&&b++;var w=b>1;y("percent initial")&&(h=i.formatPercent(p.begR),w&&(h+=" of initial"),g.push(h)),y("percent previous")&&(h=i.formatPercent(p.difR),w&&(h+=" of previous"),g.push(h)),y("percent total")&&(h=i.formatPercent(p.sumR),w&&(h+=" of total"),g.push(h))}return g.join("<br>")}(t,e,r,n):d.getValue(o.text,e),d.coerceString(p,a)}(n,a,w,M);b=function(t,e){var r=d.getValue(t.textposition,e);return d.coerceEnumerated(m,r)}(L,a);var E="stack"===y.mode||"relative"===y.mode,C=n[a],D=!E||C._outmost;if(S&&"none"!==b&&(!C.isBlank&&s!==u&&f!==g||"auto"!==b&&"inside"!==b)){var P=k.font,O=h.getBarColor(n[a],L),z=h.getInsideTextFont(L,a,P,O),I=h.getOutsideTextFont(L,a,P),R=r.datum();A?"log"===w.type&&R.s0<=0&&(s=w.range[0]<w.range[1]?0:w._length):"log"===M.type&&R.s0<=0&&(f=M.range[0]<M.range[1]?M._length:0);var F,N,Y,j,B,H=Math.abs(u-s)-6,U=Math.abs(g-f)-6;"outside"===b&&(D||C.hasB||(b="inside")),"auto"===b&&(D?(b="inside",F=T(r,S,z),Y=(N=l.bBox(F.node())).width,j=N.height,Y>0&&j>0&&(Y<=H&&j<=U||Y<=U&&j<=H||(A?H>=Y*(U/j):U>=j*(H/Y)))?b="inside":(b="outside",F.remove(),F=null)):b="inside"),!F&&(F=T(r,S,"outside"===b?I:z),Y=(N=l.bBox(F.node())).width,j=N.height,Y<=0||j<=0)?F.remove():(B=x("outside"===b?_(s,u,f,g,N,{isHorizontal:A,constrained:"both"===L.constraintext||"outside"===L.constraintext,angle:L.textangle}):v(s,u,f,g,N,{isHorizontal:A,constrained:"both"===L.constraintext||"inside"===L.constraintext,angle:L.textangle,anchor:L.insidetextanchor})),F.attr("transform",B))}else r.select("text").remove()}(t,e,E,r,M,D,P,O,z,y),e.layerClipId&&l.hideOutsideRangePoint(u,E.select("text"),b,w,f.xcalendar,f.ycalendar)}));var E=!1===f.cliponaxis;l.setClipUrl(u,E?null:e.layerClipId,t)}));u.getComponentMethod("errorbars","plot")(t,k,e)},getTransform:x,toMoveInsideBar:v,toMoveOutsideBar:_}},{"../../components/color":593,"../../components/drawing":614,"../../lib":719,"../../lib/svg_text_utils":743,"../../plots/cartesian/axes":767,"../../registry":847,"./attributes":857,"./helpers":862,"./style":870,d3:163,"fast-isnumeric":225}],868:[function(t,e,r){function n(t,e,r,n,a){var i=e.c2p(n?t.s0:t.p0,!0),o=e.c2p(n?t.s1:t.p1,!0),s=r.c2p(n?t.p0:t.s0,!0),l=r.c2p(n?t.p1:t.s1,!0);return a?[(i+o)/2,(s+l)/2]:n?[o,(s+l)/2]:[(i+o)/2,l]}e.exports=function(t,e){var r,a=t.cd,i=t.xaxis,o=t.yaxis,s=a[0].trace,l="funnel"===s.type,u="h"===s.orientation,c=[];if(!1===e)for(r=0;r<a.length;r++)a[r].selected=0;else for(r=0;r<a.length;r++){var h=a[r],d="ct"in h?h.ct:n(h,i,o,u,l);e.contains(d,!1,r,t)?(c.push({pointNumber:r,x:i.c2d(h.x),y:o.c2d(h.y)}),h.selected=1):h.selected=0}return c}},{}],869:[function(t,e,r){e.exports=i;var n=t("../../lib").distinctVals,a=t("../../constants/numerical").BADNUM;function i(t,e){this.traces=t,this.sepNegVal=e.sepNegVal,this.overlapNoMerge=e.overlapNoMerge;for(var r=1/0,i=[],o=0;o<t.length;o++){for(var s=t[o],l=0;l<s.length;l++){var u=s[l];u.p!==a&&i.push(u.p)}s[0]&&s[0].width1&&(r=Math.min(s[0].width1,r))}this.positions=i;var c=n(i);this.distinctPositions=c.vals,1===c.vals.length&&r!==1/0?this.minDiff=r:this.minDiff=Math.min(c.minDiff,r),this.binWidth=this.minDiff,this.bins={}}i.prototype.put=function(t,e){var r=this.getLabel(t,e),n=this.bins[r]||0;return this.bins[r]=n+e,n},i.prototype.get=function(t,e){var r=this.getLabel(t,e);return this.bins[r]||0},i.prototype.getLabel=function(t,e){return(e<0&&this.sepNegVal?"v":"^")+(this.overlapNoMerge?t:Math.round(t/this.binWidth))}},{"../../constants/numerical":695,"../../lib":719}],870:[function(t,e,r){var n=t("d3"),a=t("../../components/color"),i=t("../../components/drawing"),o=t("../../lib"),s=t("../../registry"),l=t("./attributes"),u=l.textfont,c=l.insidetextfont,h=l.outsidetextfont,d=t("./helpers");function f(t,e,r){i.pointStyle(t.selectAll("path"),e,r),p(t,e,r)}function p(t,e,r){t.selectAll("text").each((function(t){var a=n.select(this),o=m(a,t,e,r);i.font(a,o)}))}function m(t,e,r,n){var a=n._fullLayout.font,i=r.textfont;if(t.classed("bartext-inside")){var o=x(e,r);i=y(r,e.i,a,o)}else t.classed("bartext-outside")&&(i=v(r,e.i,a));return i}function g(t,e,r){return _(u,t.textfont,e,r)}function y(t,e,r,n){var i=g(t,e,r);return(void 0===t._input.textfont||void 0===t._input.textfont.color||Array.isArray(t.textfont.color)&&void 0===t.textfont.color[e])&&(i={color:a.contrast(n),family:i.family,size:i.size}),_(c,t.insidetextfont,e,i)}function v(t,e,r){var n=g(t,e,r);return _(h,t.outsidetextfont,e,n)}function _(t,e,r,n){e=e||{};var a=d.getValue(e.family,r),i=d.getValue(e.size,r),o=d.getValue(e.color,r);return{family:d.coerceString(t.family,a,n.family),size:d.coerceNumber(t.size,i,n.size),color:d.coerceColor(t.color,o,n.color)}}function x(t,e){return"waterfall"===e.type?e[t.dir].marker.color:t.mc||e.marker.color}e.exports={style:function(t){var e=n.select(t).selectAll("g.barlayer").selectAll("g.trace"),r=e.size(),a=t._fullLayout;e.style("opacity",(function(t){return t[0].trace.opacity})).each((function(t){("stack"===a.barmode&&r>1||0===a.bargap&&0===a.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")})),e.selectAll("g.points").each((function(e){f(n.select(this),e[0].trace,t)})),s.getComponentMethod("errorbars","style")(e)},styleTextPoints:p,styleOnSelect:function(t,e,r){var a=e[0].trace;a.selectedpoints?function(t,e,r){i.selectedPointStyle(t.selectAll("path"),e),function(t,e,r){t.each((function(t){var a,s=n.select(this);if(t.selected){a=o.extendFlat({},m(s,t,e,r));var l=e.selected.textfont&&e.selected.textfont.color;l&&(a.color=l),i.font(s,a)}else i.selectedTextStyle(s,e)}))}(t.selectAll("text"),e,r)}(r,a,t):(f(r,a,t),s.getComponentMethod("errorbars","style")(r))},getInsideTextFont:y,getOutsideTextFont:v,getBarColor:x}},{"../../components/color":593,"../../components/drawing":614,"../../lib":719,"../../registry":847,"./attributes":857,"./helpers":862,d3:163}],871:[function(t,e,r){var n=t("../../components/color"),a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s){r("marker.color",o),a(t,"marker")&&i(t,e,s,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(t,"marker.line")&&i(t,e,s,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":593,"../../components/colorscale/defaults":603,"../../components/colorscale/helpers":604}],872:[function(t,e,r){var n=t("../../components/fx/hovertemplate_attributes"),a=t("../../lib/extend").extendFlat,i=t("../scatterpolar/attributes"),o=t("../bar/attributes");e.exports={r:i.r,theta:i.theta,r0:i.r0,dr:i.dr,theta0:i.theta0,dtheta:i.dtheta,thetaunit:i.thetaunit,base:a({},o.base,{}),offset:a({},o.offset,{}),width:a({},o.width,{}),text:a({},o.text,{}),hovertext:a({},o.hovertext,{}),marker:o.marker,hoverinfo:i.hoverinfo,hovertemplate:n(),selected:o.selected,unselected:o.unselected}},{"../../components/fx/hovertemplate_attributes":631,"../../lib/extend":710,"../bar/attributes":857,"../scatterpolar/attributes":1179}],873:[function(t,e,r){var n=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/calc"),i=t("../bar/arrays_to_calcdata"),o=t("../bar/cross_trace_calc").setGroupPositions,s=t("../scatter/calc_selection"),l=t("../../registry").traceIs,u=t("../../lib").extendFlat;e.exports={calc:function(t,e){for(var r=t._fullLayout,o=e.subplot,l=r[o].radialaxis,u=r[o].angularaxis,c=l.makeCalcdata(e,"r"),h=u.makeCalcdata(e,"theta"),d=e._length,f=new Array(d),p=c,m=h,g=0;g<d;g++)f[g]={p:m[g],s:p[g]};function y(t){var r=e[t];void 0!==r&&(e["_"+t]=Array.isArray(r)?u.makeCalcdata(e,t):u.d2c(r,e.thetaunit))}return"linear"===u.type&&(y("width"),y("offset")),n(e,"marker")&&a(t,e,{vals:e.marker.color,containerStr:"marker",cLetter:"c"}),n(e,"marker.line")&&a(t,e,{vals:e.marker.line.color,containerStr:"marker.line",cLetter:"c"}),i(f,e),s(f,e),f},crossTraceCalc:function(t,e,r){for(var n=t.calcdata,a=[],i=0;i<n.length;i++){var s=n[i],c=s[0].trace;!0===c.visible&&l(c,"bar")&&c.subplot===r&&a.push(s)}var h=u({},e.radialaxis,{_id:"x"}),d=e.angularaxis;o(t,d,h,a,{mode:e.barmode,norm:e.barnorm,gap:e.bargap,groupgap:e.bargroupgap})}}},{"../../components/colorscale/calc":601,"../../components/colorscale/helpers":604,"../../lib":719,"../../registry":847,"../bar/arrays_to_calcdata":856,"../bar/cross_trace_calc":860,"../scatter/calc_selection":1114}],874:[function(t,e,r){var n=t("../../lib"),a=t("../scatterpolar/defaults").handleRThetaDefaults,i=t("../bar/style_defaults"),o=t("./attributes");e.exports=function(t,e,r,s){function l(r,a){return n.coerce(t,e,o,r,a)}a(t,e,s,l)?(l("thetaunit"),l("base"),l("offset"),l("width"),l("text"),l("hovertext"),l("hovertemplate"),i(t,e,l,r,s),n.coerceSelectionMarkerOpacity(e,l)):e.visible=!1}},{"../../lib":719,"../bar/style_defaults":871,"../scatterpolar/defaults":1181,"./attributes":872}],875:[function(t,e,r){var n=t("../../components/fx"),a=t("../../lib"),i=t("../bar/hover").getTraceColor,o=a.fillText,s=t("../scatterpolar/hover").makeHoverPointText,l=t("../../plots/polar/helpers").isPtInsidePolygon;e.exports=function(t,e,r){var u=t.cd,c=u[0].trace,h=t.subplot,d=h.radialAxis,f=h.angularAxis,p=h.vangles,m=p?l:a.isPtInsideSector,g=t.maxHoverDistance,y=f._period||2*Math.PI,v=Math.abs(d.g2p(Math.sqrt(e*e+r*r))),_=Math.atan2(r,e);if(d.range[0]>d.range[1]&&(_+=Math.PI),n.getClosest(u,(function(t){return m(v,_,[t.rp0,t.rp1],[t.thetag0,t.thetag1],p)?g+Math.min(1,Math.abs(t.thetag1-t.thetag0)/y)-1+(t.rp1-v)/(t.rp1-t.rp0)-1:1/0}),t),!1!==t.index){var x=u[t.index];t.x0=t.x1=x.ct[0],t.y0=t.y1=x.ct[1];var b=a.extendFlat({},x,{r:x.s,theta:x.p});return o(x,c,t),s(b,c,h,t),t.hovertemplate=c.hovertemplate,t.color=i(c,x),t.xLabelVal=t.yLabelVal=void 0,x.s<0&&(t.idealAlign="left"),[t]}}},{"../../components/fx":632,"../../lib":719,"../../plots/polar/helpers":830,"../bar/hover":863,"../scatterpolar/hover":1182}],876:[function(t,e,r){e.exports={moduleType:"trace",name:"barpolar",basePlotModule:t("../../plots/polar"),categories:["polar","bar","showLegend"],attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot"),colorbar:t("../scatter/marker_colorbar"),style:t("../bar/style").style,styleOnSelect:t("../bar/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../bar/select"),meta:{}}},{"../../plots/polar":831,"../bar/select":868,"../bar/style":870,"../scatter/marker_colorbar":1129,"./attributes":872,"./calc":873,"./defaults":874,"./hover":875,"./layout_attributes":877,"./layout_defaults":878,"./plot":879}],877:[function(t,e,r){e.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}},{}],878:[function(t,e,r){var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r){var i,o={};function s(r,o){return n.coerce(t[i]||{},e[i],a,r,o)}for(var l=0;l<r.length;l++){var u=r[l];"barpolar"===u.type&&!0===u.visible&&(o[i=u.subplot]||(s("barmode"),s("bargap"),o[i]=1))}}},{"../../lib":719,"./layout_attributes":877}],879:[function(t,e,r){var n=t("d3"),a=t("fast-isnumeric"),i=t("../../lib"),o=t("../../components/drawing"),s=t("../../plots/polar/helpers");e.exports=function(t,e,r){var l=e.xaxis,u=e.yaxis,c=e.radialAxis,h=e.angularAxis,d=function(t){var e=t.cxx,r=t.cyy;return t.vangles?function(n,a,o,l){var u,c;i.angleDelta(o,l)>0?(u=o,c=l):(u=l,c=o);var h=[s.findEnclosingVertexAngles(u,t.vangles)[0],(u+c)/2,s.findEnclosingVertexAngles(c,t.vangles)[1]];return s.pathPolygonAnnulus(n,a,u,c,h,e,r)}:function(t,n,a,o){return i.pathAnnulus(t,n,a,o,e,r)}}(e),f=e.layers.frontplot.select("g.barlayer");i.makeTraceGroups(f,r,"trace bars").each((function(){var r=n.select(this),s=i.ensureSingle(r,"g","points").selectAll("g.point").data(i.identity);s.enter().append("g").style("vector-effect","non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),s.exit().remove(),s.each((function(t){var e,r=n.select(this),o=t.rp0=c.c2p(t.s0),s=t.rp1=c.c2p(t.s1),f=t.thetag0=h.c2g(t.p0),p=t.thetag1=h.c2g(t.p1);if(a(o)&&a(s)&&a(f)&&a(p)&&o!==s&&f!==p){var m=c.c2g(t.s1),g=(f+p)/2;t.ct=[l.c2p(m*Math.cos(g)),u.c2p(m*Math.sin(g))],e=d(o,s,f,p)}else e="M0,0Z";i.ensureSingle(r,"path").attr("d",e)})),o.setClipUrl(r,e._hasClipOnAxisFalse?e.clipIds.forTraces:null,t)}))}},{"../../components/drawing":614,"../../lib":719,"../../plots/polar/helpers":830,d3:163,"fast-isnumeric":225}],880:[function(t,e,r){var n=t("../scatter/attributes"),a=t("../bar/attributes"),i=t("../../components/color/attributes"),o=t("../../components/fx/hovertemplate_attributes"),s=t("../../lib/extend").extendFlat,l=n.marker,u=l.line;e.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},name:{valType:"string",editType:"calc+clearAxisTypes"},text:s({},n.text,{}),hovertext:s({},n.hovertext,{}),hovertemplate:o({}),whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},notched:{valType:"boolean",editType:"calc"},notchwidth:{valType:"number",min:0,max:.5,dflt:.25,editType:"calc"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers",editType:"calc"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1,editType:"calc"},jitter:{valType:"number",min:0,max:1,editType:"calc"},pointpos:{valType:"number",min:-2,max:2,editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},width:{valType:"number",min:0,dflt:0,editType:"calc"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:s({},l.symbol,{arrayOk:!1,editType:"plot"}),opacity:s({},l.opacity,{arrayOk:!1,dflt:1,editType:"style"}),size:s({},l.size,{arrayOk:!1,editType:"calc"}),color:s({},l.color,{arrayOk:!1,editType:"style"}),line:{color:s({},u.color,{arrayOk:!1,dflt:i.defaultLine,editType:"style"}),width:s({},u.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor,offsetgroup:a.offsetgroup,alignmentgroup:a.alignmentgroup,selected:{marker:n.selected.marker,editType:"style"},unselected:{marker:n.unselected.marker,editType:"style"},hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"}}},{"../../components/color/attributes":592,"../../components/fx/hovertemplate_attributes":631,"../../lib/extend":710,"../bar/attributes":857,"../scatter/attributes":1112}],881:[function(t,e,r){var n=t("fast-isnumeric"),a=t("../../lib"),i=a._,o=t("../../plots/cartesian/axes");function s(t,e,r){var n={text:"tx",hovertext:"htx"};for(var a in n)Array.isArray(e[a])&&(t[n[a]]=e[a][r])}function l(t,e){return t.v-e.v}function u(t){return t.v}e.exports=function(t,e){var r,c,h,d,f,p=t._fullLayout,m=o.getFromId(t,e.xaxis||"x"),g=o.getFromId(t,e.yaxis||"y"),y=[],v="violin"===e.type?"_numViolins":"_numBoxes";"h"===e.orientation?(c=m,h="x",d=g,f="y"):(c=g,h="y",d=m,f="x");var _,x=c.makeCalcdata(e,h),b=function(t,e,r,i,o){if(e in t)return r.makeCalcdata(t,e);var s;s=e+"0"in t?t[e+"0"]:"name"in t&&("category"===r.type||n(t.name)&&-1!==["linear","log"].indexOf(r.type)||a.isDateTime(t.name)&&"date"===r.type)?t.name:o;var l="multicategory"===r.type?r.r2c_just_indices(s):r.d2c(s,0,t[e+"calendar"]);return i.map((function(){return l}))}(e,f,d,x,p[v]),w=a.distinctVals(b),M=w.vals,k=w.minDiff/2,T=function(t,e){for(var r=t.length,n=new Array(r+1),a=0;a<r;a++)n[a]=t[a]-e;return n[r]=t[r-1]+e,n}(M,k),L=M.length,A=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=[];return e}(L);for(r=0;r<e._length;r++){var S=x[r];if(n(S)){var E=a.findBin(b[r],T);if(E>=0&&E<L){var C={v:S,i:r};s(C,e,r),A[E].push(C)}}}var D="all"===(e.boxpoints||e.points)?a.identity:function(t){return t.v<_.lf||t.v>_.uf};for(r=0;r<L;r++)if(A[r].length>0){var P=A[r].sort(l),O=P.map(u),z=O.length;(_={}).pos=M[r],_.pts=P,_[f]=_.pos,_[h]=_.pts.map((function(t){return t.v})),_.min=O[0],_.max=O[z-1],_.mean=a.mean(O,z),_.sd=a.stdev(O,z,_.mean),_.q1=a.interp(O,.25),_.med=a.interp(O,.5),_.q3=a.interp(O,.75),_.lf=Math.min(_.q1,O[Math.min(a.findBin(2.5*_.q1-1.5*_.q3,O,!0)+1,z-1)]),_.uf=Math.max(_.q3,O[Math.max(a.findBin(2.5*_.q3-1.5*_.q1,O),0)]),_.lo=4*_.q1-3*_.q3,_.uo=4*_.q3-3*_.q1;var I=1.57*(_.q3-_.q1)/Math.sqrt(z);_.ln=_.med-I,_.un=_.med+I,_.pts2=P.filter(D),y.push(_)}!function(t,e){if(a.isArrayOrTypedArray(e.selectedpoints))for(var r=0;r<t.length;r++){for(var n=t[r].pts||[],i={},o=0;o<n.length;o++)i[n[o].i]=o;a.tagSelected(n,e,i)}}(y,e);var R=o.findExtremes(c,x,{padded:!0});return e._extremes[c._id]=R,y.length>0?(y[0].t={num:p[v],dPos:k,posLetter:f,valLetter:h,labels:{med:i(t,"median:"),min:i(t,"min:"),q1:i(t,"q1:"),q3:i(t,"q3:"),max:i(t,"max:"),mean:"sd"===e.boxmean?i(t,"mean ± σ:"):i(t,"mean:"),lf:i(t,"lower fence:"),uf:i(t,"upper fence:")}},p[v]++,y):[{t:{empty:!0}}]}},{"../../lib":719,"../../plots/cartesian/axes":767,"fast-isnumeric":225}],882:[function(t,e,r){var n=t("../../plots/cartesian/axes"),a=t("../../lib"),i=t("../../plots/cartesian/axis_ids").getAxisGroup,o=["v","h"];function s(t,e,r,o){var s,l,u,c=e.calcdata,h=e._fullLayout,d=o._id,f=d.charAt(0),p=[],m=0;for(s=0;s<r.length;s++)for(u=c[r[s]],l=0;l<u.length;l++)p.push(u[l].pos),m+=(u[l].pts2||[]).length;if(p.length){var g=a.distinctVals(p),y=g.minDiff/2;n.minDtick(o,g.minDiff,g.vals[0],!0);var v=h["violin"===t?"_numViolins":"_numBoxes"],_="group"===h[t+"mode"]&&v>1,x=1-h[t+"gap"],b=1-h[t+"groupgap"];for(s=0;s<r.length;s++){var w,M,k,T,L,A,S=(u=c[r[s]])[0].trace,E=u[0].t,C=S.width,D=S.side;if(C)w=M=T=C/2,k=0;else if(w=y,_){var P=i(h,o._id)+S.orientation,O=(h._alignmentOpts[P]||{})[S.alignmentgroup]||{},z=Object.keys(O.offsetGroups||{}).length,I=z||v;M=w*x*b/I,k=2*w*(((z?S._offsetIndex:E.num)+.5)/I-.5)*x,T=w*x/I}else M=w*x*b,k=0,T=w;E.dPos=w,E.bPos=k,E.bdPos=M,E.wHover=T;var R,F,N,Y,j,B,H=k+M,U=Boolean(C);if("positive"===D?(L=w*(C?1:.5),R=H,A=R=k):"negative"===D?(L=R=k,A=w*(C?1:.5),F=H):(L=A=w,R=F=H),(S.boxpoints||S.points)&&m>0){var V=S.pointpos,W=S.jitter,G=S.marker.size/2,q=0;V+W>=0&&((q=H*(V+W))>L?(U=!0,j=G,N=q):q>R&&(j=G,N=L)),q<=L&&(N=L);var Z=0;V-W<=0&&((Z=-H*(V-W))>A?(U=!0,B=G,Y=Z):Z>F&&(B=G,Y=A)),Z<=A&&(Y=A)}else N=L,Y=A;var X=new Array(u.length);for(l=0;l<u.length;l++)X[l]=u[l].pos;S._extremes[d]=n.findExtremes(o,X,{padded:U,vpadminus:Y,vpadplus:N,ppadminus:{x:B,y:j}[f],ppadplus:{x:j,y:B}[f]})}}}e.exports={crossTraceCalc:function(t,e){for(var r=t.calcdata,n=e.xaxis,a=e.yaxis,i=0;i<o.length;i++){for(var l=o[i],u="h"===l?a:n,c=[],h=0;h<r.length;h++){var d=r[h],f=d[0].t,p=d[0].trace;!0!==p.visible||"box"!==p.type&&"candlestick"!==p.type||f.empty||(p.orientation||"v")!==l||p.xaxis!==n._id||p.yaxis!==a._id||c.push(h)}s("box",t,c,u)}},setPositionOffset:s}},{"../../lib":719,"../../plots/cartesian/axes":767,"../../plots/cartesian/axis_ids":770}],883:[function(t,e,r){var n=t("../../lib"),a=t("../../registry"),i=t("../../components/color"),o=t("../bar/defaults").handleGroupingDefaults,s=t("./attributes");function l(t,e,r,i){var o,s,l=r("y"),u=r("x"),c=u&&u.length;if(l&&l.length)o="v",c?s=Math.min(n.minRowLength(u),n.minRowLength(l)):(r("x0"),s=n.minRowLength(l));else{if(!c)return void(e.visible=!1);o="h",r("y0"),s=n.minRowLength(u)}e._length=s,a.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],i),r("orientation",o)}function u(t,e,r,a){var i=a.prefix,o=n.coerce2(t,e,s,"marker.outliercolor"),l=r("marker.line.outliercolor"),u=r(i+"points",o||l?"suspectedoutliers":void 0);u?(r("jitter","all"===u?.3:0),r("pointpos","all"===u?-1.5:0),r("marker.symbol"),r("marker.opacity"),r("marker.size"),r("marker.color",e.line.color),r("marker.line.color"),r("marker.line.width"),"suspectedoutliers"===u&&(r("marker.line.outliercolor",e.marker.color),r("marker.line.outlierwidth")),r("selected.marker.color"),r("unselected.marker.color"),r("selected.marker.size"),r("unselected.marker.size"),r("text"),r("hovertext")):delete e.marker;var c=r("hoveron");"all"!==c&&-1===c.indexOf("points")||r("hovertemplate"),n.coerceSelectionMarkerOpacity(e,r)}e.exports={supplyDefaults:function(t,e,r,a){function o(r,a){return n.coerce(t,e,s,r,a)}l(t,e,o,a),!1!==e.visible&&(o("line.color",(t.marker||{}).color||r),o("line.width"),o("fillcolor",i.addOpacity(e.line.color,.5)),o("whiskerwidth"),o("boxmean"),o("width"),o("notched",void 0!==t.notchwidth)&&o("notchwidth"),u(t,e,o,{prefix:"box"}))},crossTraceDefaults:function(t,e){var r,a;function i(t){return n.coerce(a._input,a,s,t)}for(var l=0;l<t.length;l++){var u=(a=t[l]).type;"box"!==u&&"violin"!==u||(r=a._input,"group"===e[u+"mode"]&&o(r,a,e,i))}},handleSampleDefaults:l,handlePointsDefaults:u}},{"../../components/color":593,"../../lib":719,"../../registry":847,"../bar/defaults":861,"./attributes":880}],884:[function(t,e,r){e.exports=function(t,e){return e.hoverOnBox&&(t.hoverOnBox=e.hoverOnBox),"xVal"in e&&(t.x=e.xVal),"yVal"in e&&(t.y=e.yVal),e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),t}},{}],885:[function(t,e,r){var n=t("../../plots/cartesian/axes"),a=t("../../lib"),i=t("../../components/fx"),o=t("../../components/color"),s=a.fillText;function l(t,e,r,s){var l,u,c,h,d,f,p,m,g,y,v,_,x,b,w=t.cd,M=t.xa,k=t.ya,T=w[0].trace,L=w[0].t,A="violin"===T.type,S=[],E=L.bdPos,C=L.wHover,D=function(t){return t.pos+L.bPos-f};A&&"both"!==T.side?("positive"===T.side&&(g=function(t){var e=D(t);return i.inbox(e,e+C,y)},_=E,x=0),"negative"===T.side&&(g=function(t){var e=D(t);return i.inbox(e-C,e,y)},_=0,x=E)):(g=function(t){var e=D(t);return i.inbox(e-C,e+C,y)},_=x=E),b=A?function(t){return i.inbox(t.span[0]-d,t.span[1]-d,y)}:function(t){return i.inbox(t.min-d,t.max-d,y)},"h"===T.orientation?(d=e,f=r,p=b,m=g,l="y",c=k,u="x",h=M):(d=r,f=e,p=g,m=b,l="x",c=M,u="y",h=k);var P=Math.min(1,E/Math.abs(c.r2c(c.range[1])-c.r2c(c.range[0])));function O(t){return(p(t)+m(t))/2}y=t.maxHoverDistance-P,v=t.maxSpikeDistance-P;var z=i.getDistanceFunction(s,p,m,O);if(i.getClosest(w,z,t),!1===t.index)return[];var I=w[t.index],R=T.line.color,F=(T.marker||{}).color;o.opacity(R)&&T.line.width?t.color=R:o.opacity(F)&&T.boxpoints?t.color=F:t.color=T.fillcolor,t[l+"0"]=c.c2p(I.pos+L.bPos-x,!0),t[l+"1"]=c.c2p(I.pos+L.bPos+_,!0),t[l+"LabelVal"]=I.pos;var N=l+"Spike";t.spikeDistance=O(I)*v/y,t[N]=c.c2p(I.pos,!0);var Y={},j=["med","q1","q3","min","max"];(T.boxmean||(T.meanline||{}).visible)&&j.push("mean"),(T.boxpoints||T.points)&&j.push("lf","uf");for(var B=0;B<j.length;B++){var H=j[B];if(H in I&&!(I[H]in Y)){Y[I[H]]=!0;var U=I[H],V=h.c2p(U,!0),W=a.extendFlat({},t);W.attr=H,W[u+"0"]=W[u+"1"]=V,W[u+"LabelVal"]=U,W[u+"Label"]=(L.labels?L.labels[H]+" ":"")+n.hoverLabelText(h,U),W.hoverOnBox=!0,"mean"===H&&"sd"in I&&"sd"===T.boxmean&&(W[u+"err"]=I.sd),t.name="",t.spikeDistance=void 0,t[N]=void 0,W.hovertemplate=!1,S.push(W)}}return S}function u(t,e,r){for(var n,o,l,u=t.cd,c=t.xa,h=t.ya,d=u[0].trace,f=c.c2p(e),p=h.c2p(r),m=i.quadrature((function(t){var e=Math.max(3,t.mrc||0);return Math.max(Math.abs(c.c2p(t.x)-f)-e,1-3/e)}),(function(t){var e=Math.max(3,t.mrc||0);return Math.max(Math.abs(h.c2p(t.y)-p)-e,1-3/e)})),g=!1,y=0;y<u.length;y++){o=u[y];for(var v=0;v<(o.pts||[]).length;v++){var _=m(l=o.pts[v]);_<=t.distance&&(t.distance=_,g=[y,v])}}if(!g)return!1;l=(o=u[g[0]]).pts[g[1]];var x,b=c.c2p(l.x,!0),w=h.c2p(l.y,!0),M=l.mrc||1;return n=a.extendFlat({},t,{index:l.i,color:(d.marker||{}).color,name:d.name,x0:b-M,x1:b+M,y0:w-M,y1:w+M,spikeDistance:t.distance,hovertemplate:d.hovertemplate}),"h"===d.orientation?(x=h,n.xLabelVal=l.x,n.yLabelVal=o.pos):(x=c,n.xLabelVal=o.pos,n.yLabelVal=l.y),n[x._id.charAt(0)+"Spike"]=x.c2p(o.pos,!0),s(l,d,n),n}e.exports={hoverPoints:function(t,e,r,n){var a,i=t.cd[0].trace.hoveron,o=[];return-1!==i.indexOf("boxes")&&(o=o.concat(l(t,e,r,n))),-1!==i.indexOf("points")&&(a=u(t,e,r)),"closest"===n?a?[a]:o:a?(o.push(a),o):o},hoverOnBoxes:l,hoverOnPoints:u}},{"../../components/color":593,"../../components/fx":632,"../../lib":719,"../../plots/cartesian/axes":767}],886:[function(t,e,r){e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults").supplyDefaults,crossTraceDefaults:t("./defaults").crossTraceDefaults,supplyLayoutDefaults:t("./layout_defaults").supplyLayoutDefaults,calc:t("./calc"),crossTraceCalc:t("./cross_trace_calc").crossTraceCalc,plot:t("./plot").plot,style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover").hoverPoints,eventData:t("./event_data"),selectPoints:t("./select"),moduleType:"trace",name:"box",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","boxLayout","zoomScale"],meta:{}}},{"../../plots/cartesian":778,"./attributes":880,"./calc":881,"./cross_trace_calc":882,"./defaults":883,"./event_data":884,"./hover":885,"./layout_attributes":887,"./layout_defaults":888,"./plot":889,"./select":890,"./style":891}],887:[function(t,e,r){e.exports={boxmode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},boxgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"},boxgroupgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"}}},{}],888:[function(t,e,r){var n=t("../../registry"),a=t("../../lib"),i=t("./layout_attributes");function o(t,e,r,a,i){for(var o=i+"Layout",s=!1,l=0;l<r.length;l++){var u=r[l];if(n.traceIs(u,o)){s=!0;break}}s&&(a(i+"mode"),a(i+"gap"),a(i+"groupgap"))}e.exports={supplyLayoutDefaults:function(t,e,r){o(0,0,r,(function(r,n){return a.coerce(t,e,i,r,n)}),"box")},_supply:o}},{"../../lib":719,"../../registry":847,"./layout_attributes":887}],889:[function(t,e,r){var n=t("d3"),a=t("../../lib"),i=t("../../components/drawing");function o(t,e,r,i){var o,s,l=e.pos,u=e.val,c=i.bPos,h=i.wdPos||0,d=i.bPosPxOffset||0,f=r.whiskerwidth||0,p=r.notched||!1,m=p?1-2*r.notchwidth:1;Array.isArray(i.bdPos)?(o=i.bdPos[0],s=i.bdPos[1]):(o=i.bdPos,s=i.bdPos);var g=t.selectAll("path.box").data("violin"!==r.type||r.box.visible?a.identity:[]);g.enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","box"),g.exit().remove(),g.each((function(t){if(t.empty)return"M0,0Z";var e=t.pos,i=l.c2p(e+c,!0)+d,g=l.c2p(e+c-o,!0)+d,y=l.c2p(e+c+s,!0)+d,v=l.c2p(e+c-h,!0)+d,_=l.c2p(e+c+h,!0)+d,x=l.c2p(e+c-o*m,!0)+d,b=l.c2p(e+c+s*m,!0)+d,w=u.c2p(t.q1,!0),M=u.c2p(t.q3,!0),k=a.constrain(u.c2p(t.med,!0),Math.min(w,M)+1,Math.max(w,M)-1),T=void 0===t.lf||!1===r.boxpoints,L=u.c2p(T?t.min:t.lf,!0),A=u.c2p(T?t.max:t.uf,!0),S=u.c2p(t.ln,!0),E=u.c2p(t.un,!0);"h"===r.orientation?n.select(this).attr("d","M"+k+","+x+"V"+b+"M"+w+","+g+"V"+y+(p?"H"+S+"L"+k+","+b+"L"+E+","+y:"")+"H"+M+"V"+g+(p?"H"+E+"L"+k+","+x+"L"+S+","+g:"")+"ZM"+w+","+i+"H"+L+"M"+M+","+i+"H"+A+(0===f?"":"M"+L+","+v+"V"+_+"M"+A+","+v+"V"+_)):n.select(this).attr("d","M"+x+","+k+"H"+b+"M"+g+","+w+"H"+y+(p?"V"+S+"L"+b+","+k+"L"+y+","+E:"")+"V"+M+"H"+g+(p?"V"+E+"L"+x+","+k+"L"+g+","+S:"")+"ZM"+i+","+w+"V"+L+"M"+i+","+M+"V"+A+(0===f?"":"M"+v+","+L+"H"+_+"M"+v+","+A+"H"+_))}))}function s(t,e,r,n){var o=e.x,s=e.y,l=n.bdPos,u=n.bPos,c=r.boxpoints||r.points;a.seedPseudoRandom();var h=t.selectAll("g.points").data(c?function(t){return t.forEach((function(t){t.t=n,t.trace=r})),t}:[]);h.enter().append("g").attr("class","points"),h.exit().remove();var d=h.selectAll("path").data((function(t){var e,n,i=t.pts2,o=Math.max((t.max-t.min)/10,t.q3-t.q1),s=1e-9*o,h=.01*o,d=[],f=0;if(r.jitter){if(0===o)for(f=1,d=new Array(i.length),e=0;e<i.length;e++)d[e]=1;else for(e=0;e<i.length;e++){var p=Math.max(0,e-5),m=i[p].v,g=Math.min(i.length-1,e+5),y=i[g].v;"all"!==c&&(i[e].v<t.lf?y=Math.min(y,t.lf):m=Math.max(m,t.uf));var v=Math.sqrt(h*(g-p)/(y-m+s))||0;v=a.constrain(Math.abs(v),0,1),d.push(v),f=Math.max(v,f)}n=2*r.jitter/(f||1)}for(e=0;e<i.length;e++){var _=i[e],x=_.v,b=r.jitter?n*d[e]*(a.pseudoRandom()-.5):0,w=t.pos+u+l*(r.pointpos+b);"h"===r.orientation?(_.y=w,_.x=x):(_.x=w,_.y=x),"suspectedoutliers"===c&&x<t.uo&&x>t.lo&&(_.so=!0)}return i}));d.enter().append("path").classed("point",!0),d.exit().remove(),d.call(i.translatePoints,o,s)}function l(t,e,r,i){var o,s,l=e.pos,u=e.val,c=i.bPos,h=i.bPosPxOffset||0,d=r.boxmean||(r.meanline||{}).visible;Array.isArray(i.bdPos)?(o=i.bdPos[0],s=i.bdPos[1]):(o=i.bdPos,s=i.bdPos);var f=t.selectAll("path.mean").data("box"===r.type&&r.boxmean||"violin"===r.type&&r.box.visible&&r.meanline.visible?a.identity:[]);f.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),f.exit().remove(),f.each((function(t){var e=l.c2p(t.pos+c,!0)+h,a=l.c2p(t.pos+c-o,!0)+h,i=l.c2p(t.pos+c+s,!0)+h,f=u.c2p(t.mean,!0),p=u.c2p(t.mean-t.sd,!0),m=u.c2p(t.mean+t.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+f+","+a+"V"+i+("sd"===d?"m0,0L"+p+","+e+"L"+f+","+a+"L"+m+","+e+"Z":"")):n.select(this).attr("d","M"+a+","+f+"H"+i+("sd"===d?"m0,0L"+e+","+p+"L"+a+","+f+"L"+e+","+m+"Z":""))}))}e.exports={plot:function(t,e,r,i){var u=e.xaxis,c=e.yaxis;a.makeTraceGroups(i,r,"trace boxes").each((function(t){var e,r,a=n.select(this),i=t[0],h=i.t,d=i.trace;h.wdPos=h.bdPos*d.whiskerwidth,!0!==d.visible||h.empty?a.remove():("h"===d.orientation?(e=c,r=u):(e=u,r=c),o(a,{pos:e,val:r},d,h),s(a,{x:u,y:c},d,h),l(a,{pos:e,val:r},d,h))}))},plotBoxAndWhiskers:o,plotPoints:s,plotBoxMean:l}},{"../../components/drawing":614,"../../lib":719,d3:163}],890:[function(t,e,r){e.exports=function(t,e){var r,n,a=t.cd,i=t.xaxis,o=t.yaxis,s=[];if(!1===e)for(r=0;r<a.length;r++)for(n=0;n<(a[r].pts||[]).length;n++)a[r].pts[n].selected=0;else for(r=0;r<a.length;r++)for(n=0;n<(a[r].pts||[]).length;n++){var l=a[r].pts[n],u=i.c2p(l.x),c=o.c2p(l.y);e.contains([u,c],null,l.i,t)?(s.push({pointNumber:l.i,x:i.c2d(l.x),y:o.c2d(l.y)}),l.selected=1):l.selected=0}return s}},{}],891:[function(t,e,r){var n=t("d3"),a=t("../../components/color"),i=t("../../components/drawing");e.exports={style:function(t,e,r){var o=r||n.select(t).selectAll("g.trace.boxes");o.style("opacity",(function(t){return t[0].trace.opacity})),o.each((function(e){var r=n.select(this),o=e[0].trace,s=o.line.width;function l(t,e,r,n){t.style("stroke-width",e+"px").call(a.stroke,r).call(a.fill,n)}var u=r.selectAll("path.box");if("candlestick"===o.type)u.each((function(t){if(!t.empty){var e=n.select(this),r=o[t.dir];l(e,r.line.width,r.line.color,r.fillcolor),e.style("opacity",o.selectedpoints&&!t.selected?.3:1)}}));else{l(u,s,o.line.color,o.fillcolor),r.selectAll("path.mean").style({"stroke-width":s,"stroke-dasharray":2*s+"px,"+s+"px"}).call(a.stroke,o.line.color);var c=r.selectAll("path.point");i.pointStyle(c,o,t)}}))},styleOnSelect:function(t,e,r){var n=e[0].trace,a=r.selectAll("path.point");n.selectedpoints?i.selectedPointStyle(a,n):i.pointStyle(a,n,t)}}},{"../../components/color":593,"../../components/drawing":614,d3:163}],892:[function(t,e,r){var n=t("../../lib").extendFlat,a=t("../ohlc/attributes"),i=t("../box/attributes");function o(t){return{line:{color:n({},i.line.color,{dflt:t}),width:i.line.width,editType:"style"},fillcolor:i.fillcolor,editType:"style"}}e.exports={x:a.x,open:a.open,high:a.high,low:a.low,close:a.close,line:{width:n({},i.line.width,{}),editType:"style"},increasing:o(a.increasing.line.color.dflt),decreasing:o(a.decreasing.line.color.dflt),text:a.text,hovertext:a.hovertext,whiskerwidth:n({},i.whiskerwidth,{dflt:0}),hoverlabel:a.hoverlabel}},{"../../lib":719,"../box/attributes":880,"../ohlc/attributes":1058}],893:[function(t,e,r){var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../ohlc/calc").calcCommon;function o(t,e,r,n){return{min:r,q1:Math.min(t,n),med:n,q3:Math.max(t,n),max:e}}e.exports=function(t,e){var r=t._fullLayout,s=a.getFromId(t,e.xaxis),l=a.getFromId(t,e.yaxis),u=s.makeCalcdata(e,"x"),c=i(t,e,u,l,o);return c.length?(n.extendFlat(c[0].t,{num:r._numBoxes,dPos:n.distinctVals(u).minDiff/2,posLetter:"x",valLetter:"y"}),r._numBoxes++,c):[{t:{empty:!0}}]}},{"../../lib":719,"../../plots/cartesian/axes":767,"../ohlc/calc":1059}],894:[function(t,e,r){var n=t("../../lib"),a=t("../../components/color"),i=t("../ohlc/ohlc_defaults"),o=t("./attributes");function s(t,e,r,n){var i=r(n+".line.color");r(n+".line.width",e.line.width),r(n+".fillcolor",a.addOpacity(i,.5))}e.exports=function(t,e,r,a){function l(r,a){return n.coerce(t,e,o,r,a)}i(t,e,l,a)?(l("line.width"),s(0,e,l,"increasing"),s(0,e,l,"decreasing"),l("text"),l("hovertext"),l("whiskerwidth"),a._requestRangeslider[e.xaxis]=!0):e.visible=!1}},{"../../components/color":593,"../../lib":719,"../ohlc/ohlc_defaults":1063,"./attributes":892}],895:[function(t,e,r){e.exports={moduleType:"trace",name:"candlestick",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","showLegend","candlestick","boxLayout"],meta:{},attributes:t("./attributes"),layoutAttributes:t("../box/layout_attributes"),supplyLayoutDefaults:t("../box/layout_defaults").supplyLayoutDefaults,crossTraceCalc:t("../box/cross_trace_calc").crossTraceCalc,supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("../box/plot").plot,layerName:"boxlayer",style:t("../box/style").style,hoverPoints:t("../ohlc/hover").hoverPoints,selectPoints:t("../ohlc/select")}},{"../../plots/cartesian":778,"../box/cross_trace_calc":882,"../box/layout_attributes":887,"../box/layout_defaults":888,"../box/plot":889,"../box/style":891,"../ohlc/hover":1061,"../ohlc/select":1065,"./attributes":892,"./calc":893,"./defaults":894}],896:[function(t,e,r){var n=t("./axis_defaults"),a=t("../../plot_api/plot_template");e.exports=function(t,e,r,i,o){i("a")||(i("da"),i("a0")),i("b")||(i("db"),i("b0")),function(t,e,r,i){["aaxis","baxis"].forEach((function(o){var s=o.charAt(0),l=t[o]||{},u=a.newContainer(e,o),c={tickfont:"x",id:s+"axis",letter:s,font:e.font,name:o,data:t[s],calendar:e.calendar,dfltColor:i,bgColor:r.paper_bgcolor,fullLayout:r};n(l,u,c),u._categories=u._categories||[],t[o]||"-"===l.type||(t[o]={type:l.type})}))}(t,e,r,o)}},{"../../plot_api/plot_template":757,"./axis_defaults":901}],897:[function(t,e,r){var n=t("../../lib").isArrayOrTypedArray;e.exports=function(t){return function t(e,r){if(!n(e)||r>=10)return null;for(var a=1/0,i=-1/0,o=e.length,s=0;s<o;s++){var l=e[s];if(n(l)){var u=t(l,r+1);u&&(a=Math.min(u[0],a),i=Math.max(u[1],i))}else a=Math.min(l,a),i=Math.max(l,i)}return[a,i]}(t,0)}},{"../../lib":719}],898:[function(t,e,r){var n=t("../../plots/font_attributes"),a=t("./axis_attributes"),i=t("../../components/color/attributes"),o=n({editType:"calc"});o.family.dflt='"Open Sans", verdana, arial, sans-serif',o.size.dflt=12,o.color.dflt=i.defaultLine,e.exports={carpet:{valType:"string",editType:"calc"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},a:{valType:"data_array",editType:"calc"},a0:{valType:"number",dflt:0,editType:"calc"},da:{valType:"number",dflt:1,editType:"calc"},b:{valType:"data_array",editType:"calc"},b0:{valType:"number",dflt:0,editType:"calc"},db:{valType:"number",dflt:1,editType:"calc"},cheaterslope:{valType:"number",dflt:1,editType:"calc"},aaxis:a,baxis:a,font:o,color:{valType:"color",dflt:i.defaultLine,editType:"plot"},transforms:void 0}},{"../../components/color/attributes":592,"../../plots/font_attributes":793,"./axis_attributes":900}],899:[function(t,e,r){var n=t("../../lib").isArrayOrTypedArray;e.exports=function(t,e,r,a){var i,o,s,l,u,c,h,d,f,p,m,g,y,v=n(r)?"a":"b",_=("a"===v?t.aaxis:t.baxis).smoothing,x="a"===v?t.a2i:t.b2j,b="a"===v?r:a,w="a"===v?a:r,M="a"===v?e.a.length:e.b.length,k="a"===v?e.b.length:e.a.length,T=Math.floor("a"===v?t.b2j(w):t.a2i(w)),L="a"===v?function(e){return t.evalxy([],e,T)}:function(e){return t.evalxy([],T,e)};_&&(s=Math.max(0,Math.min(k-2,T)),l=T-s,o="a"===v?function(e,r){return t.dxydi([],e,s,r,l)}:function(e,r){return t.dxydj([],s,e,l,r)});var A=x(b[0]),S=x(b[1]),E=A<S?1:-1,C=1e-8*(S-A),D=E>0?Math.floor:Math.ceil,P=E>0?Math.ceil:Math.floor,O=E>0?Math.min:Math.max,z=E>0?Math.max:Math.min,I=D(A+C),R=P(S-C),F=[[h=L(A)]];for(i=I;i*E<R*E;i+=E)u=[],m=z(A,i),y=(g=O(S,i+E))-m,c=Math.max(0,Math.min(M-2,Math.floor(.5*(m+g)))),d=L(g),_&&(f=o(c,m-c),p=o(c,g-c),u.push([h[0]+f[0]/3*y,h[1]+f[1]/3*y]),u.push([d[0]-p[0]/3*y,d[1]-p[1]/3*y])),u.push(d),F.push(u),h=d;return F}},{"../../lib":719}],900:[function(t,e,r){var n=t("../../plots/font_attributes"),a=t("../../components/color/attributes"),i=t("../../plots/cartesian/layout_attributes"),o=t("../../plot_api/edit_types").overrideAll;t("../../constants/docs").FORMAT_LINK,t("../../constants/docs").TIME_FORMAT_LINK,e.exports={color:{valType:"color",editType:"calc"},smoothing:{valType:"number",dflt:1,min:0,max:1.3,editType:"calc"},title:{text:{valType:"string",dflt:"",editType:"calc"},font:n({editType:"calc"}),offset:{valType:"number",dflt:10,editType:"calc"},editType:"calc"},type:{valType:"enumerated",values:["-","linear","date","category"],dflt:"-",editType:"calc"},autorange:{valType:"enumerated",values:[!0,!1,"reversed"],dflt:!0,editType:"calc"},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"calc"},range:{valType:"info_array",editType:"calc",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}]},fixedrange:{valType:"boolean",dflt:!1,editType:"calc"},cheatertype:{valType:"enumerated",values:["index","value"],dflt:"value",editType:"calc"},tickmode:{valType:"enumerated",values:["linear","array"],dflt:"array",editType:"calc"},nticks:{valType:"integer",min:0,dflt:0,editType:"calc"},tickvals:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},showticklabels:{valType:"enumerated",values:["start","end","both","none"],dflt:"start",editType:"calc"},tickfont:n({editType:"calc"}),tickangle:{valType:"angle",dflt:"auto",editType:"calc"},tickprefix:{valType:"string",dflt:"",editType:"calc"},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},ticksuffix:{valType:"string",dflt:"",editType:"calc"},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B",editType:"calc"},separatethousands:{valType:"boolean",dflt:!1,editType:"calc"},tickformat:{valType:"string",dflt:"",editType:"calc"},tickformatstops:o(i.tickformatstops,"calc","from-root"),categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},labelpadding:{valType:"integer",dflt:10,editType:"calc"},labelprefix:{valType:"string",editType:"calc"},labelsuffix:{valType:"string",dflt:"",editType:"calc"},showline:{valType:"boolean",dflt:!1,editType:"calc"},linecolor:{valType:"color",dflt:a.defaultLine,editType:"calc"},linewidth:{valType:"number",min:0,dflt:1,editType:"calc"},gridcolor:{valType:"color",editType:"calc"},gridwidth:{valType:"number",min:0,dflt:1,editType:"calc"},showgrid:{valType:"boolean",dflt:!0,editType:"calc"},minorgridcount:{valType:"integer",min:0,dflt:0,editType:"calc"},minorgridwidth:{valType:"number",min:0,dflt:1,editType:"calc"},minorgridcolor:{valType:"color",dflt:a.lightLine,editType:"calc"},startline:{valType:"boolean",editType:"calc"},startlinecolor:{valType:"color",editType:"calc"},startlinewidth:{valType:"number",dflt:1,editType:"calc"},endline:{valType:"boolean",editType:"calc"},endlinewidth:{valType:"number",dflt:1,editType:"calc"},endlinecolor:{valType:"color",editType:"calc"},tick0:{valType:"number",min:0,dflt:0,editType:"calc"},dtick:{valType:"number",min:0,dflt:1,editType:"calc"},arraytick0:{valType:"integer",min:0,dflt:0,editType:"calc"},arraydtick:{valType:"integer",min:1,dflt:1,editType:"calc"},_deprecated:{title:{valType:"string",editType:"calc"},titlefont:n({editType:"calc"}),titleoffset:{valType:"number",dflt:10,editType:"calc"}},editType:"calc"}},{"../../components/color/attributes":592,"../../constants/docs":690,"../../plot_api/edit_types":750,"../../plots/cartesian/layout_attributes":779,"../../plots/font_attributes":793}],901:[function(t,e,r){var n=t("./attributes"),a=t("../../components/color").addOpacity,i=t("../../registry"),o=t("../../lib"),s=t("../../plots/cartesian/tick_value_defaults"),l=t("../../plots/cartesian/tick_label_defaults"),u=t("../../plots/cartesian/category_order_defaults"),c=t("../../plots/cartesian/set_convert"),h=t("../../plots/cartesian/axis_autotype");e.exports=function(t,e,r){var d=r.letter,f=r.font||{},p=n[d+"axis"];function m(r,n){return o.coerce(t,e,p,r,n)}function g(r,n){return o.coerce2(t,e,p,r,n)}r.name&&(e._name=r.name,e._id=r.name);var y=m("type");"-"===y&&(r.data&&function(t,e){if("-"===t.type){var r=t._id.charAt(0),n=t[r+"calendar"];t.type=h(e,n)}}(e,r.data),"-"===e.type?e.type="linear":y=t.type=e.type),m("smoothing"),m("cheatertype"),m("showticklabels"),m("labelprefix",d+" = "),m("labelsuffix"),m("showtickprefix"),m("showticksuffix"),m("separatethousands"),m("tickformat"),m("exponentformat"),m("showexponent"),m("categoryorder"),m("tickmode"),m("tickvals"),m("ticktext"),m("tick0"),m("dtick"),"array"===e.tickmode&&(m("arraytick0"),m("arraydtick")),m("labelpadding"),e._hovertitle=d,"date"===y&&i.getComponentMethod("calendars","handleDefaults")(t,e,"calendar",r.calendar),c(e,r.fullLayout),e.c2p=o.identity;var v=m("color",r.dfltColor),_=v===t.color?v:f.color;m("title.text")&&(o.coerceFont(m,"title.font",{family:f.family,size:Math.round(1.2*f.size),color:_}),m("title.offset")),m("tickangle"),m("autorange",!e.isValidRange(t.range))&&m("rangemode"),m("range"),e.cleanRange(),m("fixedrange"),s(t,e,m,y),l(t,e,m,y,r),u(t,e,m,{data:r.data,dataAttr:d});var x=g("gridcolor",a(v,.3)),b=g("gridwidth"),w=m("showgrid");w||(delete e.gridcolor,delete e.gridwidth);var M=g("startlinecolor",v),k=g("startlinewidth",b);m("startline",e.showgrid||!!M||!!k)||(delete e.startlinecolor,delete e.startlinewidth);var T=g("endlinecolor",v),L=g("endlinewidth",b);return m("endline",e.showgrid||!!T||!!L)||(delete e.endlinecolor,delete e.endlinewidth),w?(m("minorgridcount"),m("minorgridwidth",b),m("minorgridcolor",a(x,.06)),e.minorgridcount||(delete e.minorgridwidth,delete e.minorgridcolor)):(delete e.gridcolor,delete e.gridWidth),"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,m("tickmode"),e}},{"../../components/color":593,"../../lib":719,"../../plots/cartesian/axis_autotype":768,"../../plots/cartesian/category_order_defaults":771,"../../plots/cartesian/set_convert":785,"../../plots/cartesian/tick_label_defaults":786,"../../plots/cartesian/tick_value_defaults":788,"../../registry":847,"./attributes":898}],902:[function(t,e,r){var n=t("../../plots/cartesian/axes"),a=t("../../lib").isArray1D,i=t("./cheater_basis"),o=t("./array_minmax"),s=t("./calc_gridlines"),l=t("./calc_labels"),u=t("./calc_clippath"),c=t("../heatmap/clean_2d_array"),h=t("./smooth_fill_2d_array"),d=t("../heatmap/convert_column_xyz"),f=t("./set_convert");e.exports=function(t,e){var r=n.getFromId(t,e.xaxis),p=n.getFromId(t,e.yaxis),m=e.aaxis,g=e.baxis,y=e.x,v=e.y,_=[];y&&a(y)&&_.push("x"),v&&a(v)&&_.push("y"),_.length&&d(e,m,g,"a","b",_);var x=e._a=e._a||e.a,b=e._b=e._b||e.b;y=e._x||e.x,v=e._y||e.y;var w={};if(e._cheater){var M="index"===m.cheatertype?x.length:x,k="index"===g.cheatertype?b.length:b;y=i(M,k,e.cheaterslope)}e._x=y=c(y),e._y=v=c(v),h(y,x,b),h(v,x,b),f(e),e.setScale();var T=o(y),L=o(v),A=.5*(T[1]-T[0]),S=.5*(T[1]+T[0]),E=.5*(L[1]-L[0]),C=.5*(L[1]+L[0]);return T=[S-1.3*A,S+1.3*A],L=[C-1.3*E,C+1.3*E],e._extremes[r._id]=n.findExtremes(r,T,{padded:!0}),e._extremes[p._id]=n.findExtremes(p,L,{padded:!0}),s(e,"a","b"),s(e,"b","a"),l(e,m),l(e,g),w.clipsegments=u(e._xctrl,e._yctrl,m,g),w.x=y,w.y=v,w.a=x,w.b=b,[w]}},{"../../lib":719,"../../plots/cartesian/axes":767,"../heatmap/clean_2d_array":1003,"../heatmap/convert_column_xyz":1005,"./array_minmax":897,"./calc_clippath":903,"./calc_gridlines":904,"./calc_labels":905,"./cheater_basis":907,"./set_convert":920,"./smooth_fill_2d_array":921}],903:[function(t,e,r){e.exports=function(t,e,r,n){var a,i,o,s=[],l=!!r.smoothing,u=!!n.smoothing,c=t[0].length-1,h=t.length-1;for(a=0,i=[],o=[];a<=c;a++)i[a]=t[0][a],o[a]=e[0][a];for(s.push({x:i,y:o,bicubic:l}),a=0,i=[],o=[];a<=h;a++)i[a]=t[a][c],o[a]=e[a][c];for(s.push({x:i,y:o,bicubic:u}),a=c,i=[],o=[];a>=0;a--)i[c-a]=t[h][a],o[c-a]=e[h][a];for(s.push({x:i,y:o,bicubic:l}),a=h,i=[],o=[];a>=0;a--)i[h-a]=t[a][0],o[h-a]=e[a][0];return s.push({x:i,y:o,bicubic:u}),s}},{}],904:[function(t,e,r){var n=t("../../plots/cartesian/axes"),a=t("../../lib/extend").extendFlat;e.exports=function(t,e,r){var i,o,s,l,u,c,h,d,f,p,m,g,y,v,_=t["_"+e],x=t[e+"axis"],b=x._gridlines=[],w=x._minorgridlines=[],M=x._boundarylines=[],k=t["_"+r],T=t[r+"axis"];"array"===x.tickmode&&(x.tickvals=_.slice());var L=t._xctrl,A=t._yctrl,S=L[0].length,E=L.length,C=t._a.length,D=t._b.length;n.prepTicks(x),"array"===x.tickmode&&delete x.tickvals;var P=x.smoothing?3:1;function O(n){var a,i,o,s,l,u,c,h,f,p,m,g,y=[],v=[],_={};if("b"===e)for(i=t.b2j(n),o=Math.floor(Math.max(0,Math.min(D-2,i))),s=i-o,_.length=D,_.crossLength=C,_.xy=function(e){return t.evalxy([],e,i)},_.dxy=function(e,r){return t.dxydi([],e,o,r,s)},a=0;a<C;a++)u=Math.min(C-2,a),c=a-u,h=t.evalxy([],a,i),T.smoothing&&a>0&&(f=t.dxydi([],a-1,o,0,s),y.push(l[0]+f[0]/3),v.push(l[1]+f[1]/3),p=t.dxydi([],a-1,o,1,s),y.push(h[0]-p[0]/3),v.push(h[1]-p[1]/3)),y.push(h[0]),v.push(h[1]),l=h;else for(a=t.a2i(n),u=Math.floor(Math.max(0,Math.min(C-2,a))),c=a-u,_.length=C,_.crossLength=D,_.xy=function(e){return t.evalxy([],a,e)},_.dxy=function(e,r){return t.dxydj([],u,e,c,r)},i=0;i<D;i++)o=Math.min(D-2,i),s=i-o,h=t.evalxy([],a,i),T.smoothing&&i>0&&(m=t.dxydj([],u,i-1,c,0),y.push(l[0]+m[0]/3),v.push(l[1]+m[1]/3),g=t.dxydj([],u,i-1,c,1),y.push(h[0]-g[0]/3),v.push(h[1]-g[1]/3)),y.push(h[0]),v.push(h[1]),l=h;return _.axisLetter=e,_.axis=x,_.crossAxis=T,_.value=n,_.constvar=r,_.index=d,_.x=y,_.y=v,_.smoothing=T.smoothing,_}function z(n){var a,i,o,s,l,u=[],c=[],h={};if(h.length=_.length,h.crossLength=k.length,"b"===e)for(o=Math.max(0,Math.min(D-2,n)),l=Math.min(1,Math.max(0,n-o)),h.xy=function(e){return t.evalxy([],e,n)},h.dxy=function(e,r){return t.dxydi([],e,o,r,l)},a=0;a<S;a++)u[a]=L[n*P][a],c[a]=A[n*P][a];else for(i=Math.max(0,Math.min(C-2,n)),s=Math.min(1,Math.max(0,n-i)),h.xy=function(e){return t.evalxy([],n,e)},h.dxy=function(e,r){return t.dxydj([],i,e,s,r)},a=0;a<E;a++)u[a]=L[a][n*P],c[a]=A[a][n*P];return h.axisLetter=e,h.axis=x,h.crossAxis=T,h.value=_[n],h.constvar=r,h.index=n,h.x=u,h.y=c,h.smoothing=T.smoothing,h}if("array"===x.tickmode){for(l=5e-15,c=(u=[Math.floor((_.length-1-x.arraytick0)/x.arraydtick*(1+l)),Math.ceil(-x.arraytick0/x.arraydtick/(1+l))].sort((function(t,e){return t-e})))[0]-1,h=u[1]+1,d=c;d<h;d++)(o=x.arraytick0+x.arraydtick*d)<0||o>_.length-1||b.push(a(z(o),{color:x.gridcolor,width:x.gridwidth}));for(d=c;d<h;d++)if(s=x.arraytick0+x.arraydtick*d,m=Math.min(s+x.arraydtick,_.length-1),!(s<0||s>_.length-1||m<0||m>_.length-1))for(g=_[s],y=_[m],i=0;i<x.minorgridcount;i++)(v=m-s)<=0||(p=g+(y-g)*(i+1)/(x.minorgridcount+1)*(x.arraydtick/v))<_[0]||p>_[_.length-1]||w.push(a(O(p),{color:x.minorgridcolor,width:x.minorgridwidth}));x.startline&&M.push(a(z(0),{color:x.startlinecolor,width:x.startlinewidth})),x.endline&&M.push(a(z(_.length-1),{color:x.endlinecolor,width:x.endlinewidth}))}else{for(l=5e-15,c=(u=[Math.floor((_[_.length-1]-x.tick0)/x.dtick*(1+l)),Math.ceil((_[0]-x.tick0)/x.dtick/(1+l))].sort((function(t,e){return t-e})))[0],h=u[1],d=c;d<=h;d++)f=x.tick0+x.dtick*d,b.push(a(O(f),{color:x.gridcolor,width:x.gridwidth}));for(d=c-1;d<h+1;d++)for(f=x.tick0+x.dtick*d,i=0;i<x.minorgridcount;i++)(p=f+x.dtick*(i+1)/(x.minorgridcount+1))<_[0]||p>_[_.length-1]||w.push(a(O(p),{color:x.minorgridcolor,width:x.minorgridwidth}));x.startline&&M.push(a(O(_[0]),{color:x.startlinecolor,width:x.startlinewidth})),x.endline&&M.push(a(O(_[_.length-1]),{color:x.endlinecolor,width:x.endlinewidth}))}}},{"../../lib/extend":710,"../../plots/cartesian/axes":767}],905:[function(t,e,r){var n=t("../../plots/cartesian/axes"),a=t("../../lib/extend").extendFlat;e.exports=function(t,e){var r,i,o,s=e._labels=[],l=e._gridlines;for(r=0;r<l.length;r++)o=l[r],-1!==["start","both"].indexOf(e.showticklabels)&&(i=n.tickText(e,o.value),a(i,{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(i)),-1!==["end","both"].indexOf(e.showticklabels)&&(i=n.tickText(e,o.value),a(i,{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(i))}},{"../../lib/extend":710,"../../plots/cartesian/axes":767}],906:[function(t,e,r){e.exports=function(t,e,r,n){var a=t[0]-e[0],i=t[1]-e[1],o=r[0]-e[0],s=r[1]-e[1],l=Math.pow(a*a+i*i,.25),u=Math.pow(o*o+s*s,.25),c=(u*u*a-l*l*o)*n,h=(u*u*i-l*l*s)*n,d=u*(l+u)*3,f=l*(l+u)*3;return[[e[0]+(d&&c/d),e[1]+(d&&h/d)],[e[0]-(f&&c/f),e[1]-(f&&h/f)]]}},{}],907:[function(t,e,r){var n=t("../../lib").isArrayOrTypedArray;e.exports=function(t,e,r){var a,i,o,s,l,u,c=[],h=n(t)?t.length:t,d=n(e)?e.length:e,f=n(t)?t:null,p=n(e)?e:null;f&&(o=(f.length-1)/(f[f.length-1]-f[0])/(h-1)),p&&(s=(p.length-1)/(p[p.length-1]-p[0])/(d-1));var m=1/0,g=-1/0;for(i=0;i<d;i++)for(c[i]=[],l=p?(p[i]-p[0])*s:i/(d-1),a=0;a<h;a++)u=(f?(f[a]-f[0])*o:a/(h-1))-l*r,m=Math.min(u,m),g=Math.max(u,g),c[i][a]=u;var y=1/(g-m),v=-m*y;for(i=0;i<d;i++)for(a=0;a<h;a++)c[i][a]=y*c[i][a]+v;return c}},{"../../lib":719}],908:[function(t,e,r){var n=t("./catmull_rom"),a=t("../../lib").ensureArray;function i(t,e,r){var n=-.5*r[0]+1.5*e[0],a=-.5*r[1]+1.5*e[1];return[(2*n+t[0])/3,(2*a+t[1])/3]}e.exports=function(t,e,r,o,s,l){var u,c,h,d,f,p,m,g,y,v,_=r[0].length,x=r.length,b=s?3*_-2:_,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],b),e[h]=a(e[h],b);for(c=0,d=0;c<x;c++,d+=l?3:1)for(f=t[d],p=e[d],m=r[c],g=o[c],u=0,h=0;u<_;u++,h+=s?3:1)f[h]=m[u],p[h]=g[u];if(s)for(c=0,d=0;c<x;c++,d+=l?3:1){for(u=1,h=3;u<_-1;u++,h+=3)y=n([r[c][u-1],o[c][u-1]],[r[c][u],o[c][u]],[r[c][u+1],o[c][u+1]],s),t[d][h-1]=y[0][0],e[d][h-1]=y[0][1],t[d][h+1]=y[1][0],e[d][h+1]=y[1][1];v=i([t[d][0],e[d][0]],[t[d][2],e[d][2]],[t[d][3],e[d][3]]),t[d][1]=v[0],e[d][1]=v[1],v=i([t[d][b-1],e[d][b-1]],[t[d][b-3],e[d][b-3]],[t[d][b-4],e[d][b-4]]),t[d][b-2]=v[0],e[d][b-2]=v[1]}if(l)for(h=0;h<b;h++){for(d=3;d<w-3;d+=3)y=n([t[d-3][h],e[d-3][h]],[t[d][h],e[d][h]],[t[d+3][h],e[d+3][h]],l),t[d-1][h]=y[0][0],e[d-1][h]=y[0][1],t[d+1][h]=y[1][0],e[d+1][h]=y[1][1];v=i([t[0][h],e[0][h]],[t[2][h],e[2][h]],[t[3][h],e[3][h]]),t[1][h]=v[0],e[1][h]=v[1],v=i([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]=v[0],e[w-2][h]=v[1]}if(s&&l)for(d=1;d<w;d+=(d+1)%3==0?2:1){for(h=3;h<b-3;h+=3)y=n([t[d][h-3],e[d][h-3]],[t[d][h],e[d][h]],[t[d][h+3],e[d][h+3]],s),t[d][h-1]=.5*(t[d][h-1]+y[0][0]),e[d][h-1]=.5*(e[d][h-1]+y[0][1]),t[d][h+1]=.5*(t[d][h+1]+y[1][0]),e[d][h+1]=.5*(e[d][h+1]+y[1][1]);v=i([t[d][0],e[d][0]],[t[d][2],e[d][2]],[t[d][3],e[d][3]]),t[d][1]=.5*(t[d][1]+v[0]),e[d][1]=.5*(e[d][1]+v[1]),v=i([t[d][b-1],e[d][b-1]],[t[d][b-3],e[d][b-3]],[t[d][b-4],e[d][b-4]]),t[d][b-2]=.5*(t[d][b-2]+v[0]),e[d][b-2]=.5*(e[d][b-2]+v[1])}return[t,e]}},{"../../lib":719,"./catmull_rom":906}],909:[function(t,e,r){e.exports={RELATIVE_CULL_TOLERANCE:1e-6}},{}],910:[function(t,e,r){e.exports=function(t,e,r){return e&&r?function(e,r,n,a,i){var o,s,l,u,c,h;e||(e=[]),r*=3,n*=3;var d=a*a,f=1-a,p=f*f,m=f*a*2,g=-3*p,y=3*(p-m),v=3*(m-d),_=3*d,x=i*i,b=x*i,w=1-i,M=w*w,k=M*w;for(h=0;h<t.length;h++)o=g*(c=t[h])[n][r]+y*c[n][r+1]+v*c[n][r+2]+_*c[n][r+3],s=g*c[n+1][r]+y*c[n+1][r+1]+v*c[n+1][r+2]+_*c[n+1][r+3],l=g*c[n+2][r]+y*c[n+2][r+1]+v*c[n+2][r+2]+_*c[n+2][r+3],u=g*c[n+3][r]+y*c[n+3][r+1]+v*c[n+3][r+2]+_*c[n+3][r+3],e[h]=k*o+3*(M*i*s+w*x*l)+b*u;return e}:e?function(e,r,n,a,i){var o,s,l,u;e||(e=[]),r*=3;var c=a*a,h=1-a,d=h*h,f=h*a*2,p=-3*d,m=3*(d-f),g=3*(f-c),y=3*c,v=1-i;for(l=0;l<t.length;l++)o=p*(u=t[l])[n][r]+m*u[n][r+1]+g*u[n][r+2]+y*u[n][r+3],s=p*u[n+1][r]+m*u[n+1][r+1]+g*u[n+1][r+2]+y*u[n+1][r+3],e[l]=v*o+i*s;return e}:r?function(e,r,n,a,i){var o,s,l,u,c,h;e||(e=[]),n*=3;var d=i*i,f=d*i,p=1-i,m=p*p,g=m*p;for(c=0;c<t.length;c++)o=(h=t[c])[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]=g*o+3*(m*i*s+p*d*l)+f*u;return e}:function(e,r,n,a,i){var o,s,l,u;e||(e=[]);var c=1-i;for(l=0;l<t.length;l++)o=(u=t[l])[n][r+1]-u[n][r],s=u[n+1][r+1]-u[n+1][r],e[l]=c*o+i*s;return e}}},{}],911:[function(t,e,r){e.exports=function(t,e,r){return e&&r?function(e,r,n,a,i){var o,s,l,u,c,h;e||(e=[]),r*=3,n*=3;var d=a*a,f=d*a,p=1-a,m=p*p,g=m*p,y=i*i,v=1-i,_=v*v,x=v*i*2,b=-3*_,w=3*(_-x),M=3*(x-y),k=3*y;for(h=0;h<t.length;h++)o=b*(c=t[h])[n][r]+w*c[n+1][r]+M*c[n+2][r]+k*c[n+3][r],s=b*c[n][r+1]+w*c[n+1][r+1]+M*c[n+2][r+1]+k*c[n+3][r+1],l=b*c[n][r+2]+w*c[n+1][r+2]+M*c[n+2][r+2]+k*c[n+3][r+2],u=b*c[n][r+3]+w*c[n+1][r+3]+M*c[n+2][r+3]+k*c[n+3][r+3],e[h]=g*o+3*(m*a*s+p*d*l)+f*u;return e}:e?function(e,r,n,a,i){var o,s,l,u,c,h;e||(e=[]),r*=3;var d=i*i,f=d*i,p=1-i,m=p*p,g=m*p;for(c=0;c<t.length;c++)o=(h=t[c])[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]=g*o+3*(m*i*s+p*d*l)+f*u;return e}:r?function(e,r,n,a,i){var o,s,l,u;e||(e=[]),n*=3;var c=1-a,h=i*i,d=1-i,f=d*d,p=d*i*2,m=-3*f,g=3*(f-p),y=3*(p-h),v=3*h;for(l=0;l<t.length;l++)o=m*(u=t[l])[n][r]+g*u[n+1][r]+y*u[n+2][r]+v*u[n+3][r],s=m*u[n][r+1]+g*u[n+1][r+1]+y*u[n+2][r+1]+v*u[n+3][r+1],e[l]=c*o+a*s;return e}:function(e,r,n,a,i){var o,s,l,u;e||(e=[]);var c=1-a;for(l=0;l<t.length;l++)o=(u=t[l])[n+1][r]-u[n][r],s=u[n+1][r+1]-u[n][r+1],e[l]=c*o+a*s;return e}}},{}],912:[function(t,e,r){e.exports=function(t,e,r,n,a){var i=e-2,o=r-2;return n&&a?function(e,r,n){var a,s,l,u,c,h;e||(e=[]);var d=Math.max(0,Math.min(Math.floor(r),i)),f=Math.max(0,Math.min(Math.floor(n),o)),p=Math.max(0,Math.min(1,r-d)),m=Math.max(0,Math.min(1,n-f));d*=3,f*=3;var g=p*p,y=g*p,v=1-p,_=v*v,x=_*v,b=m*m,w=b*m,M=1-m,k=M*M,T=k*M;for(h=0;h<t.length;h++)a=x*(c=t[h])[f][d]+3*(_*p*c[f][d+1]+v*g*c[f][d+2])+y*c[f][d+3],s=x*c[f+1][d]+3*(_*p*c[f+1][d+1]+v*g*c[f+1][d+2])+y*c[f+1][d+3],l=x*c[f+2][d]+3*(_*p*c[f+2][d+1]+v*g*c[f+2][d+2])+y*c[f+2][d+3],u=x*c[f+3][d]+3*(_*p*c[f+3][d+1]+v*g*c[f+3][d+2])+y*c[f+3][d+3],e[h]=T*a+3*(k*m*s+M*b*l)+w*u;return e}:n?function(e,r,n){e||(e=[]);var a,s,l,u,c,h,d=Math.max(0,Math.min(Math.floor(r),i)),f=Math.max(0,Math.min(Math.floor(n),o)),p=Math.max(0,Math.min(1,r-d)),m=Math.max(0,Math.min(1,n-f));d*=3;var g=p*p,y=g*p,v=1-p,_=v*v,x=_*v,b=1-m;for(c=0;c<t.length;c++)a=b*(h=t[c])[f][d]+m*h[f+1][d],s=b*h[f][d+1]+m*h[f+1][d+1],l=b*h[f][d+2]+m*h[f+1][d+1],u=b*h[f][d+3]+m*h[f+1][d+1],e[c]=x*a+3*(_*p*s+v*g*l)+y*u;return e}:a?function(e,r,n){e||(e=[]);var a,s,l,u,c,h,d=Math.max(0,Math.min(Math.floor(r),i)),f=Math.max(0,Math.min(Math.floor(n),o)),p=Math.max(0,Math.min(1,r-d)),m=Math.max(0,Math.min(1,n-f));f*=3;var g=m*m,y=g*m,v=1-m,_=v*v,x=_*v,b=1-p;for(c=0;c<t.length;c++)a=b*(h=t[c])[f][d]+p*h[f][d+1],s=b*h[f+1][d]+p*h[f+1][d+1],l=b*h[f+2][d]+p*h[f+2][d+1],u=b*h[f+3][d]+p*h[f+3][d+1],e[c]=x*a+3*(_*m*s+v*g*l)+y*u;return e}:function(e,r,n){e||(e=[]);var a,s,l,u,c=Math.max(0,Math.min(Math.floor(r),i)),h=Math.max(0,Math.min(Math.floor(n),o)),d=Math.max(0,Math.min(1,r-c)),f=Math.max(0,Math.min(1,n-h)),p=1-f,m=1-d;for(l=0;l<t.length;l++)a=m*(u=t[l])[h][c]+d*u[h][c+1],s=m*u[h+1][c]+d*u[h+1][c+1],e[l]=p*a+f*s;return e}}},{}],913:[function(t,e,r){var n=t("../../lib"),a=t("./xy_defaults"),i=t("./ab_defaults"),o=t("./attributes"),s=t("../../components/color/attributes");e.exports=function(t,e,r,l){function u(r,a){return n.coerce(t,e,o,r,a)}e._clipPathId="clip"+e.uid+"carpet";var c=u("color",s.defaultLine);n.coerceFont(u,"font"),u("carpet"),i(t,e,l,u,c),e.a&&e.b?(e.a.length<3&&(e.aaxis.smoothing=0),e.b.length<3&&(e.baxis.smoothing=0),a(t,e,u)||(e.visible=!1),e._cheater&&u("cheaterslope")):e.visible=!1}},{"../../components/color/attributes":592,"../../lib":719,"./ab_defaults":896,"./attributes":898,"./xy_defaults":922}],914:[function(t,e,r){e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),plot:t("./plot"),calc:t("./calc"),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory"],meta:{}}},{"../../plots/cartesian":778,"./attributes":898,"./calc":902,"./defaults":913,"./plot":919}],915:[function(t,e,r){e.exports=function(t,e){for(var r,n=t._fullData.length,a=0;a<n;a++){var i=t._fullData[a];if(i.index!==e.index&&"carpet"===i.type&&(r||(r=i),i.carpet===e.carpet))return i}return r}},{}],916:[function(t,e,r){e.exports=function(t,e,r){if(0===t.length)return"";var n,a=[],i=r?3:1;for(n=0;n<t.length;n+=i)a.push(t[n]+","+e[n]),r&&n<t.length-i&&(a.push("C"),a.push([t[n+1]+","+e[n+1],t[n+2]+","+e[n+2]+" "].join(" ")));return a.join(r?"":"L")}},{}],917:[function(t,e,r){var n=t("../../lib").isArrayOrTypedArray;e.exports=function(t,e,r){var a;for(n(t)?t.length>e.length&&(t=t.slice(0,e.length)):t=[],a=0;a<e.length;a++)t[a]=r(e[a]);return t}},{"../../lib":719}],918:[function(t,e,r){e.exports=function(t,e,r,n,a,i){var o=a[0]*t.dpdx(e),s=a[1]*t.dpdy(r),l=1,u=1;if(i){var c=Math.sqrt(a[0]*a[0]+a[1]*a[1]),h=Math.sqrt(i[0]*i[0]+i[1]*i[1]),d=(a[0]*i[0]+a[1]*i[1])/c/h;u=Math.max(0,d)}var f=180*Math.atan2(s,o)/Math.PI;return f<-90?(f+=180,l=-l):f>90&&(f-=180,l=-l),{angle:f,flip:l,p:t.c2p(n,e,r),offsetMultplier:u}}},{}],919:[function(t,e,r){var n=t("d3"),a=t("../../components/drawing"),i=t("./map_1d_array"),o=t("./makepath"),s=t("./orient_text"),l=t("../../lib/svg_text_utils"),u=t("../../lib"),c=t("../../constants/alignment");function h(t,e,r,a,s,l){var u="const-"+s+"-lines",c=r.selectAll("."+u).data(l);c.enter().append("path").classed(u,!0).style("vector-effect","non-scaling-stroke"),c.each((function(r){var a=r,s=a.x,l=a.y,u=i([],s,t.c2p),c=i([],l,e.c2p),h="M"+o(u,c,a.smoothing);n.select(this).attr("d",h).style("stroke-width",a.width).style("stroke",a.color).style("fill","none")})),c.exit().remove()}function d(t,e,r,i,o,u,c,h){var d=u.selectAll("text."+h).data(c);d.enter().append("text").classed(h,!0);var f=0,p={};return d.each((function(o,u){var c;if("auto"===o.axis.tickangle)c=s(i,e,r,o.xy,o.dxy);else{var h=(o.axis.tickangle+180)*Math.PI/180;c=s(i,e,r,o.xy,[Math.cos(h),Math.sin(h)])}u||(p={angle:c.angle,flip:c.flip});var d=(o.endAnchor?-1:1)*c.flip,m=n.select(this).attr({"text-anchor":d>0?"start":"end","data-notex":1}).call(a.font,o.font).text(o.text).call(l.convertToTspans,t),g=a.bBox(this);m.attr("transform","translate("+c.p[0]+","+c.p[1]+") rotate("+c.angle+")translate("+o.axis.labelpadding*d+","+.3*g.height+")"),f=Math.max(f,g.width+o.axis.labelpadding)})),d.exit().remove(),p.maxExtent=f,p}e.exports=function(t,e,r,a){var l=e.xaxis,c=e.yaxis,f=t._fullLayout._clips;u.makeTraceGroups(a,r,"trace").each((function(e){var r=n.select(this),a=e[0],p=a.trace,g=p.aaxis,y=p.baxis,v=u.ensureSingle(r,"g","minorlayer"),_=u.ensureSingle(r,"g","majorlayer"),x=u.ensureSingle(r,"g","boundarylayer"),b=u.ensureSingle(r,"g","labellayer");r.style("opacity",p.opacity),h(l,c,_,0,"a",g._gridlines),h(l,c,_,0,"b",y._gridlines),h(l,c,v,0,"a",g._minorgridlines),h(l,c,v,0,"b",y._minorgridlines),h(l,c,x,0,"a-boundary",g._boundarylines),h(l,c,x,0,"b-boundary",y._boundarylines);var w=d(t,l,c,p,0,b,g._labels,"a-label"),M=d(t,l,c,p,0,b,y._labels,"b-label");!function(t,e,r,n,a,i,o,l){var c,h,d,f,p=u.aggNums(Math.min,null,r.a),g=u.aggNums(Math.max,null,r.a),y=u.aggNums(Math.min,null,r.b),v=u.aggNums(Math.max,null,r.b);c=.5*(p+g),h=y,d=r.ab2xy(c,h,!0),f=r.dxyda_rough(c,h),void 0===o.angle&&u.extendFlat(o,s(r,a,i,d,r.dxydb_rough(c,h))),m(t,e,r,0,d,f,r.aaxis,a,i,o,"a-title"),c=p,h=.5*(y+v),d=r.ab2xy(c,h,!0),f=r.dxydb_rough(c,h),void 0===l.angle&&u.extendFlat(l,s(r,a,i,d,r.dxyda_rough(c,h))),m(t,e,r,0,d,f,r.baxis,a,i,l,"b-title")}(t,b,p,0,l,c,w,M),function(t,e,r,n,a){var s,l,c,h,d=r.select("#"+t._clipPathId);d.size()||(d=r.append("clipPath").classed("carpetclip",!0));var f=u.ensureSingle(d,"path","carpetboundary"),p=e.clipsegments,m=[];for(h=0;h<p.length;h++)s=p[h],l=i([],s.x,n.c2p),c=i([],s.y,a.c2p),m.push(o(l,c,s.bicubic));var g="M"+m.join("L")+"Z";d.attr("id",t._clipPathId),f.attr("d",g)}(p,a,f,l,c)}))};var f=c.LINE_SPACING,p=(1-c.MID_SHIFT)/f+1;function m(t,e,r,i,o,u,c,h,d,m,g){var y=[];c.title.text&&y.push(c.title.text);var v=e.selectAll("text."+g).data(y),_=m.maxExtent;v.enter().append("text").classed(g,!0),v.each((function(){var e=s(r,h,d,o,u);-1===["start","both"].indexOf(c.showticklabels)&&(_=0);var i=c.title.font.size;_+=i+c.title.offset;var g=(m.angle+(m.flip<0?180:0)-e.angle+450)%360,y=g>90&&g<270,v=n.select(this);v.text(c.title.text).call(l.convertToTspans,t),y&&(_=(-l.lineCount(v)+p)*f*i-_),v.attr("transform","translate("+e.p[0]+","+e.p[1]+") rotate("+e.angle+") translate(0,"+_+")").classed("user-select-none",!0).attr("text-anchor","middle").call(a.font,c.title.font)})),v.exit().remove()}},{"../../components/drawing":614,"../../constants/alignment":688,"../../lib":719,"../../lib/svg_text_utils":743,"./makepath":916,"./map_1d_array":917,"./orient_text":918,d3:163}],920:[function(t,e,r){var n=t("./constants"),a=t("../../lib/search").findBin,i=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=e.length,c=r.length,h=t.aaxis,d=t.baxis,f=e[0],p=e[u-1],m=r[0],g=r[c-1],y=e[e.length-1]-e[0],v=r[r.length-1]-r[0],_=y*n.RELATIVE_CULL_TOLERANCE,x=v*n.RELATIVE_CULL_TOLERANCE;f-=_,p+=_,m-=x,g+=x,t.isVisible=function(t,e){return t>f&&t<p&&e>m&&e<g},t.isOccluded=function(t,e){return t<f||t>p||e<m||e>g},t.setScale=function(){var e=t._x,r=t._y,n=i(t._xctrl,t._yctrl,e,r,h.smoothing,d.smoothing);t._xctrl=n[0],t._yctrl=n[1],t.evalxy=o([t._xctrl,t._yctrl],u,c,h.smoothing,d.smoothing),t.dxydi=s([t._xctrl,t._yctrl],h.smoothing,d.smoothing),t.dxydj=l([t._xctrl,t._yctrl],h.smoothing,d.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(a(t,e),u-2)),n=e[r],i=e[r+1];return Math.max(0,Math.min(u-1,r+(t-n)/(i-n)))},t.b2j=function(t){var e=Math.max(0,Math.min(a(t,r),c-2)),n=r[e],i=r[e+1];return Math.max(0,Math.min(c-1,e+(t-n)/(i-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,a,i){if(!i&&(n<e[0]||n>e[u-1]|a<r[0]||a>r[c-1]))return[!1,!1];var o=t.a2i(n),s=t.b2j(a),l=t.evalxy([],o,s);if(i){var h,d,f,p,m=0,g=0,y=[];n<e[0]?(h=0,d=0,m=(n-e[0])/(e[1]-e[0])):n>e[u-1]?(h=u-2,d=1,m=(n-e[u-1])/(e[u-1]-e[u-2])):d=o-(h=Math.max(0,Math.min(u-2,Math.floor(o)))),a<r[0]?(f=0,p=0,g=(a-r[0])/(r[1]-r[0])):a>r[c-1]?(f=c-2,p=1,g=(a-r[c-1])/(r[c-1]-r[c-2])):p=s-(f=Math.max(0,Math.min(c-2,Math.floor(s)))),m&&(t.dxydi(y,h,f,d,p),l[0]+=y[0]*m,l[1]+=y[1]*m),g&&(t.dxydj(y,h,f,d,p),l[0]+=y[0]*g,l[1]+=y[1]*g)}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,a){var i=t.dxydi(null,e,r,n,a),o=t.dadi(e,n);return[i[0]/o,i[1]/o]},t.dxydb=function(e,r,n,a){var i=t.dxydj(null,e,r,n,a),o=t.dbdj(r,a);return[i[0]/o,i[1]/o]},t.dxyda_rough=function(e,r,n){var a=y*(n||.1),i=t.ab2xy(e+a,r,!0),o=t.ab2xy(e-a,r,!0);return[.5*(i[0]-o[0])/a,.5*(i[1]-o[1])/a]},t.dxydb_rough=function(e,r,n){var a=v*(n||.1),i=t.ab2xy(e,r+a,!0),o=t.ab2xy(e,r-a,!0);return[.5*(i[0]-o[0])/a,.5*(i[1]-o[1])/a]},t.dpdx=function(t){return t._m},t.dpdy=function(t){return t._m}}},{"../../lib/search":738,"./compute_control_points":908,"./constants":909,"./create_i_derivative_evaluator":910,"./create_j_derivative_evaluator":911,"./create_spline_evaluator":912}],921:[function(t,e,r){var n=t("../../lib");e.exports=function(t,e,r){var a,i,o,s=[],l=[],u=t[0].length,c=t.length;function h(e,r){var n,a=0,i=0;return e>0&&void 0!==(n=t[r][e-1])&&(i++,a+=n),e<u-1&&void 0!==(n=t[r][e+1])&&(i++,a+=n),r>0&&void 0!==(n=t[r-1][e])&&(i++,a+=n),r<c-1&&void 0!==(n=t[r+1][e])&&(i++,a+=n),a/Math.max(1,i)}var d,f,p,m,g,y,v,_,x,b,w,M=0;for(a=0;a<u;a++)for(i=0;i<c;i++)void 0===t[i][a]&&(s.push(a),l.push(i),t[i][a]=h(a,i)),M=Math.max(M,Math.abs(t[i][a]));if(!s.length)return t;var k=0,T=0,L=s.length;do{for(k=0,o=0;o<L;o++){a=s[o],i=l[o];var A,S,E,C,D,P,O=0,z=0;0===a?(E=e[D=Math.min(u-1,2)],C=e[1],A=t[i][D],z+=(S=t[i][1])+(S-A)*(e[0]-C)/(C-E),O++):a===u-1&&(E=e[D=Math.max(0,u-3)],C=e[u-2],A=t[i][D],z+=(S=t[i][u-2])+(S-A)*(e[u-1]-C)/(C-E),O++),(0===a||a===u-1)&&i>0&&i<c-1&&(d=r[i+1]-r[i],z+=((f=r[i]-r[i-1])*t[i+1][a]+d*t[i-1][a])/(f+d),O++),0===i?(E=r[P=Math.min(c-1,2)],C=r[1],A=t[P][a],z+=(S=t[1][a])+(S-A)*(r[0]-C)/(C-E),O++):i===c-1&&(E=r[P=Math.max(0,c-3)],C=r[c-2],A=t[P][a],z+=(S=t[c-2][a])+(S-A)*(r[c-1]-C)/(C-E),O++),(0===i||i===c-1)&&a>0&&a<u-1&&(d=e[a+1]-e[a],z+=((f=e[a]-e[a-1])*t[i][a+1]+d*t[i][a-1])/(f+d),O++),O?z/=O:(p=e[a+1]-e[a],m=e[a]-e[a-1],_=(g=r[i+1]-r[i])*(y=r[i]-r[i-1])*(g+y),z=((v=p*m*(p+m))*(y*t[i+1][a]+g*t[i-1][a])+_*(m*t[i][a+1]+p*t[i][a-1]))/(_*(m+p)+v*(y+g))),k+=(b=(x=z-t[i][a])/M)*b,w=O?0:.85,t[i][a]+=x*(1+w)}k=Math.sqrt(k)}while(T++<100&&k>1e-5);return n.log("Smoother converged to",k,"after",T,"iterations"),t}},{"../../lib":719}],922:[function(t,e,r){var n=t("../../lib").isArray1D;e.exports=function(t,e,r){var a=r("x"),i=a&&a.length,o=r("y"),s=o&&o.length;if(!i&&!s)return!1;if(e._cheater=!a,i&&!n(a)||s&&!n(o))e._length=null;else{var l=i?a.length:1/0;s&&(l=Math.min(l,o.length)),e.a&&e.a.length&&(l=Math.min(l,e.a.length)),e.b&&e.b.length&&(l=Math.min(l,e.b.length)),e._length=l}return!0}},{"../../lib":719}],923:[function(t,e,r){var n=t("../../components/fx/hovertemplate_attributes"),a=t("../scattergeo/attributes"),i=t("../../components/colorscale/attributes"),o=t("../../plots/attributes"),s=t("../../components/color/attributes").defaultLine,l=t("../../lib/extend").extendFlat,u=a.marker.line;e.exports=l({locations:{valType:"data_array",editType:"calc"},locationmode:a.locationmode,z:{valType:"data_array",editType:"calc"},text:l({},a.text,{}),hovertext:l({},a.hovertext,{}),marker:{line:{color:l({},u.color,{dflt:s}),width:l({},u.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:a.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:a.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:l({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:n()},i("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/color/attributes":592,"../../components/colorscale/attributes":600,"../../components/fx/hovertemplate_attributes":631,"../../lib/extend":710,"../../plots/attributes":764,"../scattergeo/attributes":1151}],924:[function(t,e,r){var n=t("fast-isnumeric"),a=t("../../constants/numerical").BADNUM,i=t("../../components/colorscale/calc"),o=t("../scatter/arrays_to_calcdata"),s=t("../scatter/calc_selection");function l(t){return t&&"string"==typeof t}e.exports=function(t,e){var r,u=e._length,c=new Array(u);r=e.geojson?function(t){return l(t)||n(t)}:l;for(var h=0;h<u;h++){var d=c[h]={},f=e.locations[h],p=e.z[h];r(f)&&n(p)?(d.loc=f,d.z=p):(d.loc=null,d.z=a),d.index=h}return o(c,e),i(t,e,{vals:e.z,containerStr:"",cLetter:"z"}),s(c,e),c}},{"../../components/colorscale/calc":601,"../../constants/numerical":695,"../scatter/arrays_to_calcdata":1111,"../scatter/calc_selection":1114,"fast-isnumeric":225}],925:[function(t,e,r){var n=t("../../lib"),a=t("../../components/colorscale/defaults"),i=t("./attributes");e.exports=function(t,e,r,o){function s(r,a){return n.coerce(t,e,i,r,a)}var l=s("locations"),u=s("z");l&&l.length&&n.isArrayOrTypedArray(u)&&u.length?(e._length=Math.min(l.length,u.length),s("locationmode"),s("text"),s("hovertext"),s("hovertemplate"),s("marker.line.width")&&s("marker.line.color"),s("marker.opacity"),a(t,e,o,s,{prefix:"",cLetter:"z"}),n.coerceSelectionMarkerOpacity(e,s)):e.visible=!1}},{"../../components/colorscale/defaults":603,"../../lib":719,"./attributes":923}],926:[function(t,e,r){e.exports=function(t,e,r,n,a){t.location=e.location,t.z=e.z;var i=n[a];return i.fIn&&(t.properties=i.fIn.properties),t}},{}],927:[function(t,e,r){var n=t("../../plots/cartesian/axes"),a=t("./attributes"),i=t("../../lib").fillText;e.exports=function(t,e,r){var o,s,l,u,c=t.cd,h=c[0].trace,d=t.subplot;for(s=0;s<c.length;s++)if(u=!1,(o=c[s])._polygons){for(l=0;l<o._polygons.length;l++)o._polygons[l].contains([e,r])&&(u=!u),o._polygons[l].contains([e+360,r])&&(u=!u);if(u)break}if(u&&o)return t.x0=t.x1=t.xa.c2p(o.ct),t.y0=t.y1=t.ya.c2p(o.ct),t.index=o.index,t.location=o.loc,t.z=o.z,t.zLabel=n.tickText(d.mockAxis,d.mockAxis.c2l(o.z),"hover").text,t.hovertemplate=o.hovertemplate,function(t,e,r){if(!e.hovertemplate){var n=r.hi||e.hoverinfo,o="all"===n?a.hoverinfo.flags:n.split("+"),s=-1!==o.indexOf("name"),l=-1!==o.indexOf("location"),u=-1!==o.indexOf("z"),c=-1!==o.indexOf("text"),h=[];!s&&l?t.nameOverride=r.loc:(s&&(t.nameOverride=e.name),l&&h.push(r.loc)),u&&h.push(t.zLabel),c&&i(r,e,h),t.extraText=h.join("<br>")}}(t,h,o,d.mockAxis),[t]}},{"../../lib":719,"../../plots/cartesian/axes":767,"./attributes":923}],928:[function(t,e,r){e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../heatmap/colorbar"),calc:t("./calc"),plot:t("./plot").plot,style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("./select"),moduleType:"trace",name:"choropleth",basePlotModule:t("../../plots/geo"),categories:["geo","noOpacity"],meta:{}}},{"../../plots/geo":797,"../heatmap/colorbar":1004,"./attributes":923,"./calc":924,"./defaults":925,"./event_data":926,"./hover":927,"./plot":929,"./select":930,"./style":931}],929:[function(t,e,r){var n=t("d3"),a=t("../../lib"),i=t("../../lib/polygon"),o=t("../../lib/topojson_utils").getTopojsonFeatures,s=t("../../lib/geo_location_utils").locationToFeature,l=t("./style").style;function u(t,e){for(var r=t[0].trace,n=t.length,a=o(r,e),i=0;i<n;i++){var l=t[i],u=s(r.locationmode,l.loc,a);u?(l.geojson=u,l.ct=u.properties.ct,l._polygons=c(u)):l.geojson=null}}function c(t){var e,r,n,a,o=t.geometry,s=o.coordinates,l=t.id,u=[];function c(t){for(var e=0;e<t.length-1;e++)if(t[e][0]>0&&t[e+1][0]<0)return e;return null}switch(e="RUS"===l||"FJI"===l?function(t){var e;if(null===c(t))e=t;else for(e=new Array(t.length),a=0;a<t.length;a++)e[a]=[t[a][0]<0?t[a][0]+360:t[a][0],t[a][1]];u.push(i.tester(e))}:"ATA"===l?function(t){var e=c(t);if(null===e)return u.push(i.tester(t));var r=new Array(t.length+1),n=0;for(a=0;a<t.length;a++)a>e?r[n++]=[t[a][0]+360,t[a][1]]:a===e?(r[n++]=t[a],r[n++]=[t[a][0],-90]):r[n++]=t[a];var o=i.tester(r);o.pts.pop(),u.push(o)}:function(t){u.push(i.tester(t))},o.type){case"MultiPolygon":for(r=0;r<s.length;r++)for(n=0;n<s[r].length;n++)e(s[r][n]);break;case"Polygon":for(r=0;r<s.length;r++)e(s[r])}return u}e.exports={plot:function(t,e,r){for(var i=0;i<r.length;i++)u(r[i],e.topojson);var o=e.layers.backplot.select(".choroplethlayer");a.makeTraceGroups(o,r,"trace choropleth").each((function(e){var r=n.select(this).selectAll("path.choroplethlocation").data(a.identity);r.enter().append("path").classed("choroplethlocation",!0),r.exit().remove(),l(t,e)}))},feature2polygons:c}},{"../../lib":719,"../../lib/geo_location_utils":713,"../../lib/polygon":731,"../../lib/topojson_utils":746,"./style":931,d3:163}],930:[function(t,e,r){e.exports=function(t,e){var r,n,a,i,o,s=t.cd,l=t.xaxis,u=t.yaxis,c=[];if(!1===e)for(r=0;r<s.length;r++)s[r].selected=0;else for(r=0;r<s.length;r++)(a=(n=s[r]).ct)&&(i=l.c2p(a),o=u.c2p(a),e.contains([i,o],null,r,t)?(c.push({pointNumber:r,lon:a[0],lat:a[1]}),n.selected=1):n.selected=0);return c}},{}],931:[function(t,e,r){var n=t("d3"),a=t("../../components/color"),i=t("../../components/drawing"),o=t("../../components/colorscale");function s(t,e){var r=e[0].trace,s=e[0].node3.selectAll(".choroplethlocation"),l=r.marker||{},u=l.line||{},c=o.makeColorScaleFuncFromTrace(r);s.each((function(t){n.select(this).attr("fill",c(t.z)).call(a.stroke,t.mlc||u.color).call(i.dashLine,"",t.mlw||u.width||0).style("opacity",l.opacity)})),i.selectedPointStyle(s,r,t)}e.exports={style:function(t,e){e&&s(t,e)},styleOnSelect:function(t,e){var r=e[0].node3,n=e[0].trace;n.selectedpoints?i.selectedPointStyle(r.selectAll(".choroplethlocation"),n,t):s(t,e)}}},{"../../components/color":593,"../../components/colorscale":605,"../../components/drawing":614,d3:163}],932:[function(t,e,r){var n=t("../choropleth/attributes"),a=t("../../components/colorscale/attributes"),i=t("../../components/fx/hovertemplate_attributes"),o=t("../../lib/extend").extendFlat;e.exports=o({locations:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},geojson:{valType:"any",editType:"calc"},below:{valType:"string",editType:"plot"},text:n.text,hovertext:n.hovertext,marker:{line:{color:o({},n.marker.line.color,{editType:"plot"}),width:o({},n.marker.line.width,{editType:"plot"}),editType:"calc"},opacity:o({},n.marker.opacity,{editType:"plot"}),editType:"calc"},selected:{marker:{opacity:o({},n.selected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},unselected:{marker:{opacity:o({},n.unselected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},hoverinfo:n.hoverinfo,hovertemplate:i({},{keys:["properties"]})},a("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/colorscale/attributes":600,"../../components/fx/hovertemplate_attributes":631,"../../lib/extend":710,"../choropleth/attributes":923}],933:[function(t,e,r){var n=t("fast-isnumeric"),a=t("@turf/area"),i=t("@turf/centroid"),o=t("../../lib"),s=t("../../components/colorscale"),l=t("../../components/drawing"),u=t("../../lib/geojson_utils").makeBlank,c=t("../choropleth/plot").feature2polygons;function h(t){var e,r=t[0].trace,n=r._opts;if(r.selectedpoints){for(var a=l.makeSelectedPointStyleFns(r),i=0;i<t.length;i++){var s=t[i];s.fOut&&(s.fOut.properties.mo2=a.selectedOpacityFn(s))}e={type:"identity",property:"mo2"}}else e=o.isArrayOrTypedArray(r.marker.opacity)?{type:"identity",property:"mo"}:r.marker.opacity;return o.extendFlat(n.fill.paint,{"fill-opacity":e}),o.extendFlat(n.line.paint,{"line-opacity":e}),n}e.exports={convert:function(t){var e=t[0].trace,r=!0===e.visible&&0!==e._length,l={layout:{visibility:"none"},paint:{}},d={layout:{visibility:"none"},paint:{}},f=e._opts={fill:l,line:d,geojson:u()};if(!r)return f;var p="string"==typeof e.geojson?(window.PlotlyGeoAssets||{})[e.geojson]:e.geojson;if(!o.isPlainObject(p))return o.error("Oops ... something when wrong when fetching "+e.geojson),f;var m,g={},y=[];for(m=0;m<t.length;m++){var v=t[m];v.loc&&(g[v.loc]=v)}var _,x,b,w=s.makeColorScaleFuncFromTrace(e),M=e.marker,k=M.line||{};function T(t){var e=g[t.id];if(e){var r=t.geometry;if("Polygon"===r.type||"MultiPolygon"===r.type){var n={fc:w(e.z)};_&&(n.mo=_(e)),x&&(n.mlc=x(e)),b&&(n.mlw=b(e));var s={type:"Feature",geometry:r,properties:n};e._polygons=c(s),e.ct=function(t){var e,r=t.geometry;if("MultiPolygon"===r.type)for(var n=r.coordinates,o=0,s=0;s<n.length;s++){var l={type:"Polygon",coordinates:n[s]},u=a.default(l);u>o&&(o=u,e=l)}else e=r;return i.default(e).geometry.coordinates}(s),e.fIn=t,e.fOut=s,y.push(s)}else o.log(["Location with id",e.loc,"does not have a valid GeoJSON geometry,","choroplethmapbox traces only support *Polygon* and *MultiPolygon* geometries."].join(" "))}delete g[t.id]}switch(o.isArrayOrTypedArray(M.opacity)&&(_=function(t){var e=t.mo;return n(e)?+o.constrain(e,0,1):0}),o.isArrayOrTypedArray(k.color)&&(x=function(t){return t.mlc}),o.isArrayOrTypedArray(k.width)&&(b=function(t){return t.mlw}),p.type){case"FeatureCollection":var L=p.features;for(m=0;m<L.length;m++)T(L[m]);break;case"Feature":T(p);break;default:return o.warn(["Invalid GeoJSON type",(p.type||"none")+",","choroplethmapbox traces only support *FeatureCollection* and *Feature* types."].join(" ")),f}for(var A in g)o.log("Location with id "+A+" does not have a matching feature");var S=_?{type:"identity",property:"mo"}:M.opacity;return o.extendFlat(l.paint,{"fill-color":{type:"identity",property:"fc"},"fill-opacity":S}),o.extendFlat(d.paint,{"line-color":x?{type:"identity",property:"mlc"}:k.color,"line-width":b?{type:"identity",property:"mlw"}:k.width,"line-opacity":S}),l.layout.visibility="visible",d.layout.visibility="visible",f.geojson={type:"FeatureCollection",features:y},h(t),f},convertOnSelect:h}},{"../../components/colorscale":605,"../../components/drawing":614,"../../lib":719,"../../lib/geojson_utils":714,"../choropleth/plot":929,"@turf/area":55,"@turf/centroid":56,"fast-isnumeric":225}],934:[function(t,e,r){var n=t("../../lib"),a=t("../../components/colorscale/defaults"),i=t("./attributes");e.exports=function(t,e,r,o){function s(r,a){return n.coerce(t,e,i,r,a)}var l=s("locations"),u=s("z"),c=s("geojson");n.isArrayOrTypedArray(l)&&l.length&&n.isArrayOrTypedArray(u)&&u.length&&("string"==typeof c&&""!==c||n.isPlainObject(c))?(e._length=Math.min(l.length,u.length),s("below"),s("text"),s("hovertext"),s("hovertemplate"),s("marker.line.width")&&s("marker.line.color"),s("marker.opacity"),a(t,e,o,s,{prefix:"",cLetter:"z"}),n.coerceSelectionMarkerOpacity(e,s)):e.visible=!1}},{"../../components/colorscale/defaults":603,"../../lib":719,"./attributes":932}],935:[function(t,e,r){e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../heatmap/colorbar"),calc:t("../choropleth/calc"),plot:t("./plot"),hoverPoints:t("../choropleth/hover"),eventData:t("../choropleth/event_data"),selectPoints:t("../choropleth/select"),styleOnSelect:function(t,e){e&&e[0].trace._glTrace.updateOnSelect(e)},getBelow:function(t,e){for(var r=e.getMapLayers(),n=r.length-2;n>=0;n--){var a=r[n].id;if("string"==typeof a&&0===a.indexOf("water"))for(var i=n+1;i<r.length;i++)if("string"==typeof(a=r[i].id)&&-1===a.indexOf("plotly-"))return a}},moduleType:"trace",name:"choroplethmapbox",basePlotModule:t("../../plots/mapbox"),categories:["mapbox","gl","noOpacity"],meta:{hr_name:"choropleth_mapbox"}}},{"../../plots/mapbox":822,"../choropleth/calc":924,"../choropleth/event_data":926,"../choropleth/hover":927,"../choropleth/select":930,"../heatmap/colorbar":1004,"./attributes":932,"./defaults":934,"./plot":936}],936:[function(t,e,r){var n=t("./convert").convert,a=t("./convert").convertOnSelect,i=t("../../plots/mapbox/constants").traceLayerPrefix;function o(t,e){this.subplot=t,this.uid=e,this.sourceId="source-"+e,this.layerList=[["fill",i+e+"-fill"],["line",i+e+"-line"]],this.below=null}var s=o.prototype;s.update=function(t){this._update(n(t))},s.updateOnSelect=function(t){this._update(a(t))},s._update=function(t){var e=this.subplot,r=this.layerList,n=e.belowLookup["trace-"+this.uid];e.map.getSource(this.sourceId).setData(t.geojson),n!==this.below&&(this._removeLayers(),this._addLayers(t,n),this.below=n);for(var a=0;a<r.length;a++){var i=r[a],o=i[0],s=i[1],l=t[o];e.setOptions(s,"setLayoutProperty",l.layout),"visible"===l.layout.visibility&&e.setOptions(s,"setPaintProperty",l.paint)}},s._addLayers=function(t,e){for(var r=this.subplot,n=this.layerList,a=this.sourceId,i=0;i<n.length;i++){var o=n[i],s=o[0],l=t[s];r.addLayer({type:s,id:o[1],source:a,layout:l.layout,paint:l.paint},e)}},s._removeLayers=function(){for(var t=this.subplot.map,e=this.layerList,r=e.length-1;r>=0;r--)t.removeLayer(e[r][1])},s.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,a=new o(t,r.uid),i=a.sourceId,s=n(e),l=a.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(i,{type:"geojson",data:s.geojson}),a._addLayers(s,l),e[0].trace._glTrace=a,a}},{"../../plots/mapbox/constants":820,"./convert":933}],937:[function(t,e,r){var n=t("../../components/colorscale/attributes"),a=t("../../components/fx/hovertemplate_attributes"),i=t("../mesh3d/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat,l={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:a({editType:"calc"},{keys:["norm"]})};s(l,n("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"})),["opacity","lightposition","lighting"].forEach((function(t){l[t]=i[t]})),l.hoverinfo=s({},o.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),l.transforms=void 0,e.exports=l},{"../../components/colorscale/attributes":600,"../../components/fx/hovertemplate_attributes":631,"../../lib/extend":710,"../../plots/attributes":764,"../mesh3d/attributes":1053}],938:[function(t,e,r){var n=t("../../components/colorscale/calc");e.exports=function(t,e){for(var r=e.u,a=e.v,i=e.w,o=Math.min(e.x.length,e.y.length,e.z.length,r.length,a.length,i.length),s=-1/0,l=1/0,u=0;u<o;u++){var c=r[u],h=a[u],d=i[u],f=Math.sqrt(c*c+h*h+d*d);s=Math.max(s,f),l=Math.min(l,f)}e._len=o,e._normMax=s,n(t,e,{vals:[l,s],containerStr:"",cLetter:"c"})}},{"../../components/colorscale/calc":601}],939:[function(t,e,r){var n=t("gl-cone3d"),a=t("gl-cone3d").createConeMesh,i=t("../../lib").simpleMap,o=t("../../lib/gl_format_color").parseColorScale,s=t("../../components/colorscale").extractOpts,l=t("../../plots/gl3d/zip3");function u(t,e){this.scene=t,this.uid=e,this.mesh=null,this.data=null}var c=u.prototype;c.handlePick=function(t){if(t.object===this.mesh){var e=t.index=t.data.index,r=this.data.x[e],n=this.data.y[e],a=this.data.z[e],i=this.data.u[e],o=this.data.v[e],s=this.data.w[e];t.traceCoordinate=[r,n,a,i,o,s,Math.sqrt(i*i+o*o+s*s)];var l=this.data.hovertext||this.data.text;return Array.isArray(l)&&void 0!==l[e]?t.textLabel=l[e]:l&&(t.textLabel=l),!0}};var h={xaxis:0,yaxis:1,zaxis:2},d={tip:1,tail:0,cm:.25,center:.5},f={tip:1,tail:1,cm:.75,center:.5};function p(t,e){var r=t.fullSceneLayout,a=t.dataScale,u={};function c(t,e){var n=r[e],o=a[h[e]];return i(t,(function(t){return n.d2l(t)*o}))}u.vectors=l(c(e.u,"xaxis"),c(e.v,"yaxis"),c(e.w,"zaxis"),e._len),u.positions=l(c(e.x,"xaxis"),c(e.y,"yaxis"),c(e.z,"zaxis"),e._len);var p=s(e);u.colormap=o(e),u.vertexIntensityBounds=[p.min/e._normMax,p.max/e._normMax],u.coneOffset=d[e.anchor],"scaled"===e.sizemode?u.coneSize=e.sizeref||.5:u.coneSize=e.sizeref&&e._normMax?e.sizeref/e._normMax:.5;var m=n(u),g=e.lightposition;return m.lightPosition=[g.x,g.y,g.z],m.ambient=e.lighting.ambient,m.diffuse=e.lighting.diffuse,m.specular=e.lighting.specular,m.roughness=e.lighting.roughness,m.fresnel=e.lighting.fresnel,m.opacity=e.opacity,e._pad=f[e.anchor]*m.vectorScale*m.coneScale*e._normMax,m}c.update=function(t){this.data=t;var e=p(this.scene,t);this.mesh.update(e)},c.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=function(t,e){var r=t.glplot.gl,n=p(t,e),i=a(r,n),o=new u(t,e.uid);return o.mesh=i,o.data=e,i._trace=o,t.glplot.add(i),o}},{"../../components/colorscale":605,"../../lib":719,"../../lib/gl_format_color":716,"../../plots/gl3d/zip3":818,"gl-cone3d":242}],940:[function(t,e,r){var n=t("../../lib"),a=t("../../components/colorscale/defaults"),i=t("./attributes");e.exports=function(t,e,r,o){function s(r,a){return n.coerce(t,e,i,r,a)}var l=s("u"),u=s("v"),c=s("w"),h=s("x"),d=s("y"),f=s("z");l&&l.length&&u&&u.length&&c&&c.length&&h&&h.length&&d&&d.length&&f&&f.length?(s("sizeref"),s("sizemode"),s("anchor"),s("lighting.ambient"),s("lighting.diffuse"),s("lighting.specular"),s("lighting.roughness"),s("lighting.fresnel"),s("lightposition.x"),s("lightposition.y"),s("lightposition.z"),a(t,e,o,s,{prefix:"",cLetter:"c"}),s("text"),s("hovertext"),s("hovertemplate"),e._length=null):e.visible=!1}},{"../../components/colorscale/defaults":603,"../../lib":719,"./attributes":937}],941:[function(t,e,r){e.exports={moduleType:"trace",name:"cone",basePlotModule:t("../../plots/gl3d"),categories:["gl3d"],attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:{min:"cmin",max:"cmax"},calc:t("./calc"),plot:t("./convert"),eventData:function(t,e){return t.norm=e.traceCoordinate[6],t},meta:{}}},{"../../plots/gl3d":807,"./attributes":937,"./calc":938,"./convert":939,"./defaults":940}],942:[function(t,e,r){var n=t("../heatmap/attributes"),a=t("../scatter/attributes"),i=t("../../components/colorscale/attributes"),o=t("../../components/drawing/attributes").dash,s=t("../../plots/font_attributes"),l=t("../../lib/extend").extendFlat,u=t("../../constants/filter_ops"),c=u.COMPARISON_OPS2,h=u.INTERVAL_OPS,d=(t("../../constants/docs").FORMAT_LINK,a.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,hovertext:n.hovertext,transpose:n.transpose,xtype:n.xtype,ytype:n.ytype,zhoverformat:n.zhoverformat,hovertemplate:n.hovertemplate,connectgaps:n.connectgaps,fillcolor:{valType:"color",editType:"calc"},autocontour:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"contours.start":void 0,"contours.end":void 0,"contours.size":void 0}},ncontours:{valType:"integer",dflt:15,min:1,editType:"calc"},contours:{type:{valType:"enumerated",values:["levels","constraint"],dflt:"levels",editType:"calc"},start:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},end:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},size:{valType:"number",dflt:null,min:0,editType:"plot",impliedEdits:{"^autocontour":!1}},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill",editType:"calc"},showlines:{valType:"boolean",dflt:!0,editType:"plot"},showlabels:{valType:"boolean",dflt:!1,editType:"plot"},labelfont:s({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot"},operation:{valType:"enumerated",values:[].concat(c).concat(h),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},editType:"calc",impliedEdits:{autocontour:!1}},line:{color:l({},d.color,{editType:"style+colorbars"}),width:l({},d.width,{editType:"style+colorbars"}),dash:o,smoothing:l({},d.smoothing,{}),editType:"plot"}},i("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))},{"../../components/colorscale/attributes":600,"../../components/drawing/attributes":613,"../../constants/docs":690,"../../constants/filter_ops":691,"../../lib/extend":710,"../../plots/font_attributes":793,"../heatmap/attributes":1001,"../scatter/attributes":1112}],943:[function(t,e,r){var n=t("../../components/colorscale"),a=t("../heatmap/calc"),i=t("./set_contours"),o=t("./end_plus");e.exports=function(t,e){var r=a(t,e),s=r[0].z;i(e,s);var l,u=e.contours,c=n.extractOpts(e);if("heatmap"===u.coloring&&c.auto&&!1===e.autocontour){var h=u.start,d=o(u),f=u.size||1,p=Math.floor((d-h)/f)+1;isFinite(f)||(f=1,p=1);var m=h-f/2;l=[m,m+p*f]}else l=s;return n.calc(t,e,{vals:l,cLetter:"z"}),r}},{"../../components/colorscale":605,"../heatmap/calc":1002,"./end_plus":953,"./set_contours":961}],944:[function(t,e,r){e.exports=function(t,e,r,n){var a,i,o,s=t[0],l=s.x.length,u=s.y.length,c=s.z,h=n.contours,d=-1/0,f=1/0;for(a=0;a<u;a++)f=Math.min(f,c[a][0]),f=Math.min(f,c[a][l-1]),d=Math.max(d,c[a][0]),d=Math.max(d,c[a][l-1]);for(a=1;a<l-1;a++)f=Math.min(f,c[0][a]),f=Math.min(f,c[u-1][a]),d=Math.max(d,c[0][a]),d=Math.max(d,c[u-1][a]);switch(s.prefixBoundary=!1,e){case">":h.value>d&&(s.prefixBoundary=!0);break;case"<":h.value<f&&(s.prefixBoundary=!0);break;case"[]":i=Math.min.apply(null,h.value),((o=Math.max.apply(null,h.value))<f||i>d)&&(s.prefixBoundary=!0);break;case"][":i=Math.min.apply(null,h.value),o=Math.max.apply(null,h.value),i<f&&o>d&&(s.prefixBoundary=!0)}}},{}],945:[function(t,e,r){var n=t("../../components/colorscale").extractOpts,a=t("./make_color_map"),i=t("./end_plus");e.exports={min:"zmin",max:"zmax",calc:function(t,e,r){var o=e.contours,s=e.line,l=o.size||1,u=o.coloring,c=a(e,{isColorbar:!0});if("heatmap"===u){var h=n(e);r._fillgradient=e.colorscale,r._zrange=[h.min,h.max]}else"fill"===u&&(r._fillcolor=c);r._line={color:"lines"===u?c:s.color,width:!1!==o.showlines?s.width:0,dash:s.dash},r._levels={start:o.start,end:i(o),size:l}}}},{"../../components/colorscale":605,"./end_plus":953,"./make_color_map":958}],946:[function(t,e,r){e.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],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]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}},{}],947:[function(t,e,r){var n=t("fast-isnumeric"),a=t("./label_defaults"),i=t("../../components/color"),o=i.addOpacity,s=i.opacity,l=t("../../constants/filter_ops"),u=l.CONSTRAINT_REDUCTION,c=l.COMPARISON_OPS2;e.exports=function(t,e,r,i,l,h){var d,f,p,m=e.contours,g=r("contours.operation");m._operation=u[g],function(t,e){var r;-1===c.indexOf(e.operation)?(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])]:n(e.value)&&(r=parseFloat(e.value),e.value=[r,r+1])):(t("contours.value",0),n(e.value)||(Array.isArray(e.value)?e.value=parseFloat(e.value[0]):e.value=0))}(r,m),"="===g?d=m.showlines=!0:(d=r("contours.showlines"),p=r("fillcolor",o((t.line||{}).color||l,.5))),d&&(f=r("line.color",p&&s(p)?o(e.fillcolor,1):l),r("line.width",2),r("line.dash")),r("line.smoothing"),a(r,i,f,h)}},{"../../components/color":593,"../../constants/filter_ops":691,"./label_defaults":957,"fast-isnumeric":225}],948:[function(t,e,r){var n=t("../../constants/filter_ops"),a=t("fast-isnumeric");function i(t,e){var r,i=Array.isArray(e);function o(t){return a(t)?+t:null}return-1!==n.COMPARISON_OPS2.indexOf(t)?r=o(i?e[0]:e):-1!==n.INTERVAL_OPS.indexOf(t)?r=i?[o(e[0]),o(e[1])]:[o(e),o(e)]:-1!==n.SET_OPS.indexOf(t)&&(r=i?e.map(o):[o(e)]),r}function o(t){return function(e){e=i(t,e);var r=Math.min(e[0],e[1]),n=Math.max(e[0],e[1]);return{start:r,end:n,size:n-r}}}function s(t){return function(e){return{start:e=i(t,e),end:1/0,size:1/0}}}e.exports={"[]":o("[]"),"][":o("]["),">":s(">"),"<":s("<"),"=":s("=")}},{"../../constants/filter_ops":691,"fast-isnumeric":225}],949:[function(t,e,r){e.exports=function(t,e,r,n){var a=n("contours.start"),i=n("contours.end"),o=!1===a||!1===i,s=r("contours.size");!(o?e.autocontour=!0:r("autocontour",!1))&&s||r("ncontours")}},{}],950:[function(t,e,r){var n=t("../../lib");function a(t){return n.extendFlat({},t,{edgepaths:n.extendDeep([],t.edgepaths),paths:n.extendDeep([],t.paths)})}e.exports=function(t,e){var r,i,o,s=function(t){return t.reverse()},l=function(t){return t};switch(e){case"=":case"<":return t;case">":for(1!==t.length&&n.warn("Contour data invalid for the specified inequality operation."),i=t[0],r=0;r<i.edgepaths.length;r++)i.edgepaths[r]=s(i.edgepaths[r]);for(r=0;r<i.paths.length;r++)i.paths[r]=s(i.paths[r]);return t;case"][":var u=s;s=l,l=u;case"[]":for(2!==t.length&&n.warn("Contour data invalid for the specified inequality range operation."),i=a(t[0]),o=a(t[1]),r=0;r<i.edgepaths.length;r++)i.edgepaths[r]=s(i.edgepaths[r]);for(r=0;r<i.paths.length;r++)i.paths[r]=s(i.paths[r]);for(;o.edgepaths.length;)i.edgepaths.push(l(o.edgepaths.shift()));for(;o.paths.length;)i.paths.push(l(o.paths.shift()));return[i]}}},{"../../lib":719}],951:[function(t,e,r){var n=t("../../lib"),a=t("../heatmap/xyz_defaults"),i=t("./constraint_defaults"),o=t("./contours_defaults"),s=t("./style_defaults"),l=t("./attributes");e.exports=function(t,e,r,u){function c(r,a){return n.coerce(t,e,l,r,a)}if(a(t,e,c,u)){c("text"),c("hovertext"),c("hovertemplate");var h="constraint"===c("contours.type");c("connectgaps",n.isArray1D(e.z)),h?i(t,e,c,u,r):(o(t,e,c,(function(r){return n.coerce2(t,e,l,r)})),s(t,e,c,u))}else e.visible=!1}},{"../../lib":719,"../heatmap/xyz_defaults":1015,"./attributes":942,"./constraint_defaults":947,"./contours_defaults":949,"./style_defaults":963}],952:[function(t,e,r){var n=t("../../lib"),a=t("./constraint_mapping"),i=t("./end_plus");e.exports=function(t,e,r){for(var o="constraint"===t.type?a[t._operation](t.value):t,s=o.size,l=[],u=i(o),c=r.trace._carpetTrace,h=c?{xaxis:c.aaxis,yaxis:c.baxis,x:r.a,y:r.b}:{xaxis:e.xaxis,yaxis:e.yaxis,x:r.x,y:r.y},d=o.start;d<u;d+=s)if(l.push(n.extendFlat({level:d,crossings:{},starts:[],edgepaths:[],paths:[],z:r.z,smoothing:r.trace.line.smoothing},h)),l.length>1e3){n.warn("Too many contours, clipping at 1000",t);break}return l}},{"../../lib":719,"./constraint_mapping":948,"./end_plus":953}],953:[function(t,e,r){e.exports=function(t){return t.end+t.size/1e6}},{}],954:[function(t,e,r){var n=t("../../lib"),a=t("./constants");function i(t,e,r,n){return Math.abs(t[0]-e[0])<r&&Math.abs(t[1]-e[1])<n}function o(t,e,r,o,l){var u,c=e.join(","),h=c,d=t.crossings[h],f=function(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:-1!==a.BOTTOMSTART.indexOf(t)?i=1:-1!==a.LEFTSTART.indexOf(t)?n=1:-1!==a.TOPSTART.indexOf(t)?i=-1:n=-1,[n,i]}(d,r,e),p=[s(t,e,[-f[0],-f[1]])],m=f.join(","),g=t.z.length,y=t.z[0].length;for(u=0;u<1e4;u++){if(d>20?(d=a.CHOOSESADDLE[d][(f[0]||f[1])<0?0:1],t.crossings[h]=a.SADDLEREMAINDER[d]):delete t.crossings[h],!(f=a.NEWDELTA[d])){n.log("Found bad marching index:",d,e,t.level);break}p.push(s(t,e,f)),e[0]+=f[0],e[1]+=f[1],i(p[p.length-1],p[p.length-2],o,l)&&p.pop(),h=e.join(",");var v=f[0]&&(e[0]<0||e[0]>y-2)||f[1]&&(e[1]<0||e[1]>g-2);if(h===c&&f.join(",")===m||r&&v)break;d=t.crossings[h]}1e4===u&&n.log("Infinite loop in contour?");var _,x,b,w,M,k,T,L,A,S,E,C,D,P,O,z=i(p[0],p[p.length-1],o,l),I=0,R=.2*t.smoothing,F=[],N=0;for(u=1;u<p.length;u++)C=p[u],D=p[u-1],P=C[2]-D[2],O=C[3]-D[3],I+=T=Math.sqrt(P*P+O*O),F.push(T);var Y=I/F.length*R;function j(t){return p[t%p.length]}for(u=p.length-2;u>=N;u--)if((_=F[u])<Y){for(b=0,x=u-1;x>=N&&_+F[x]<Y;x--)_+=F[x];if(z&&u===p.length-2)for(b=0;b<x&&_+F[b]<Y;b++)_+=F[b];M=u-x+b+1,k=Math.floor((u+x+b+2)/2),w=z||u!==p.length-2?z||-1!==x?M%2?j(k):[(j(k)[0]+j(k+1)[0])/2,(j(k)[1]+j(k+1)[1])/2]:p[0]:p[p.length-1],p.splice(x+1,u-x+1,w),u=x+1,b&&(N=b),z&&(u===p.length-2?p[b]=p[p.length-1]:0===u&&(p[p.length-1]=p[0]))}for(p.splice(0,N),u=0;u<p.length;u++)p[u].length=2;if(!(p.length<2))if(z)p.pop(),t.paths.push(p);else{r||n.log("Unclosed interior contour?",t.level,c,p.join("L"));var B=!1;for(L=0;L<t.edgepaths.length;L++)if(S=t.edgepaths[L],!B&&i(S[0],p[p.length-1],o,l)){p.pop(),B=!0;var H=!1;for(A=0;A<t.edgepaths.length;A++)if(i((E=t.edgepaths[A])[E.length-1],p[0],o,l)){H=!0,p.shift(),t.edgepaths.splice(L,1),A===L?t.paths.push(p.concat(E)):(A>L&&A--,t.edgepaths[A]=E.concat(p,S));break}H||(t.edgepaths[L]=p.concat(S))}for(L=0;L<t.edgepaths.length&&!B;L++)i((S=t.edgepaths[L])[S.length-1],p[0],o,l)&&(p.shift(),t.edgepaths[L]=S.concat(p),B=!0);B||t.edgepaths.push(p)}}function s(t,e,r){var n=e[0]+Math.max(r[0],0),a=e[1]+Math.max(r[1],0),i=t.z[a][n],o=t.xaxis,s=t.yaxis;if(r[1]){var l=(t.level-i)/(t.z[a][n+1]-i);return[o.c2p((1-l)*t.x[n]+l*t.x[n+1],!0),s.c2p(t.y[a],!0),n+l,a]}var u=(t.level-i)/(t.z[a+1][n]-i);return[o.c2p(t.x[n],!0),s.c2p((1-u)*t.y[a]+u*t.y[a+1],!0),n,a+u]}e.exports=function(t,e,r){var a,i,s,l;for(e=e||.01,r=r||.01,i=0;i<t.length;i++){for(s=t[i],l=0;l<s.starts.length;l++)o(s,s.starts[l],"edge",e,r);for(a=0;Object.keys(s.crossings).length&&a<1e4;)a++,o(s,Object.keys(s.crossings)[0].split(",").map(Number),void 0,e,r);1e4===a&&n.log("Infinite loop in contour?")}}},{"../../lib":719,"./constants":946}],955:[function(t,e,r){var n=t("../../components/color"),a=t("../heatmap/hover");e.exports=function(t,e,r,i,o){var s=a(t,e,r,i,o,!0);return s&&s.forEach((function(t){var e=t.trace;"constraint"===e.contours.type&&(e.fillcolor&&n.opacity(e.fillcolor)?t.color=n.addOpacity(e.fillcolor,1):e.contours.showlines&&n.opacity(e.line.color)&&(t.color=n.addOpacity(e.line.color,1)))})),s}},{"../../components/color":593,"../heatmap/hover":1008}],956:[function(t,e,r){e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot").plot,style:t("./style"),colorbar:t("./colorbar"),hoverPoints:t("./hover"),moduleType:"trace",name:"contour",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","2dMap","contour","showLegend"],meta:{}}},{"../../plots/cartesian":778,"./attributes":942,"./calc":943,"./colorbar":945,"./defaults":951,"./hover":955,"./plot":960,"./style":962}],957:[function(t,e,r){var n=t("../../lib");e.exports=function(t,e,r,a){if(a||(a={}),t("contours.showlabels")){var i=e.font;n.coerceFont(t,"contours.labelfont",{family:i.family,size:i.size,color:r}),t("contours.labelformat")}!1!==a.hasHover&&t("zhoverformat")}},{"../../lib":719}],958:[function(t,e,r){var n=t("d3"),a=t("../../components/colorscale"),i=t("./end_plus");e.exports=function(t){var e=t.contours,r=e.start,o=i(e),s=e.size||1,l=Math.floor((o-r)/s)+1,u="lines"===e.coloring?0:1,c=a.extractOpts(t);isFinite(s)||(s=1,l=1);var h,d,f=c.reversescale?a.flipScale(c.colorscale):c.colorscale,p=f.length,m=new Array(p),g=new Array(p);if("heatmap"===e.coloring){var y=c.min,v=c.max;for(d=0;d<p;d++)h=f[d],m[d]=h[0]*(v-y)+y,g[d]=h[1];var _=n.extent([y,v,e.start,e.start+s*(l-1)]),x=_[y<v?0:1],b=_[y<v?1:0];x!==y&&(m.splice(0,0,x),g.splice(0,0,g[0])),b!==v&&(m.push(b),g.push(g[g.length-1]))}else for(d=0;d<p;d++)h=f[d],m[d]=(h[0]*(l+u-1)-u/2)*s+r,g[d]=h[1];return a.makeColorScaleFunc({domain:m,range:g},{noNumericCheck:!0})}},{"../../components/colorscale":605,"./end_plus":953,d3:163}],959:[function(t,e,r){var n=t("./constants");function a(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);return 5===r||10===r?t>(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4?5===r?713:1114:5===r?104:208:15===r?0:r}e.exports=function(t){var e,r,i,o,s,l,u,c,h,d=t[0].z,f=d.length,p=d[0].length,m=2===f||2===p;for(r=0;r<f-1;r++)for(o=[],0===r&&(o=o.concat(n.BOTTOMSTART)),r===f-2&&(o=o.concat(n.TOPSTART)),e=0;e<p-1;e++)for(i=o.slice(),0===e&&(i=i.concat(n.LEFTSTART)),e===p-2&&(i=i.concat(n.RIGHTSTART)),s=e+","+r,l=[[d[r][e],d[r][e+1]],[d[r+1][e],d[r+1][e+1]]],h=0;h<t.length;h++)(u=a((c=t[h]).level,l))&&(c.crossings[s]=u,-1!==i.indexOf(u)&&(c.starts.push([e,r]),m&&-1!==i.indexOf(u,i.indexOf(u)+1)&&c.starts.push([e,r])))}},{"./constants":946}],960:[function(t,e,r){var n=t("d3"),a=t("../../lib"),i=t("../../components/drawing"),o=t("../../lib/svg_text_utils"),s=t("../../plots/cartesian/axes"),l=t("../../plots/cartesian/set_convert"),u=t("../heatmap/plot"),c=t("./make_crossings"),h=t("./find_all_paths"),d=t("./empty_pathinfo"),f=t("./convert_to_constraints"),p=t("./close_boundaries"),m=t("./constants"),g=m.LABELOPTIMIZER;function y(t,e){var r,n,o,s,l,u,c,h=function(t,e){var r=t.prefixBoundary;if(void 0===r){var n=Math.min(t.z[0][0],t.z[0][1]);r=!t.edgepaths.length&&n>t.level}return r?"M"+e.join("L")+"Z":""}(t,e),d=0,f=t.edgepaths.map((function(t,e){return e})),p=!0;function m(t){return Math.abs(t[1]-e[2][1])<.01}function g(t){return Math.abs(t[0]-e[0][0])<.01}function y(t){return Math.abs(t[0]-e[2][0])<.01}for(;f.length;){for(u=i.smoothopen(t.edgepaths[d],t.smoothing),h+=p?u:u.replace(/^M/,"L"),f.splice(f.indexOf(d),1),r=t.edgepaths[d][t.edgepaths[d].length-1],s=-1,o=0;o<4;o++){if(!r){a.log("Missing end?",d,t);break}for(c=r,Math.abs(c[1]-e[0][1])<.01&&!y(r)?n=e[1]:g(r)?n=e[0]:m(r)?n=e[3]:y(r)&&(n=e[2]),l=0;l<t.edgepaths.length;l++){var v=t.edgepaths[l][0];Math.abs(r[0]-n[0])<.01?Math.abs(r[0]-v[0])<.01&&(v[1]-r[1])*(n[1]-v[1])>=0&&(n=v,s=l):Math.abs(r[1]-n[1])<.01?Math.abs(r[1]-v[1])<.01&&(v[0]-r[0])*(n[0]-v[0])>=0&&(n=v,s=l):a.log("endpt to newendpt is not vert. or horz.",r,n,v)}if(r=n,s>=0)break;h+="L"+n}if(s===t.edgepaths.length){a.log("unclosed perimeter path");break}d=s,(p=-1===f.indexOf(d))&&(d=f[0],h+="Z")}for(d=0;d<t.paths.length;d++)h+=i.smoothclosed(t.paths[d],t.smoothing);return h}function v(t,e,r,n){var i=e.width/2,o=e.height/2,s=t.x,l=t.y,u=t.theta,c=Math.cos(u)*i,h=Math.sin(u)*i,d=(s>n.center?n.right-s:s-n.left)/(c+Math.abs(Math.sin(u)*o)),f=(l>n.middle?n.bottom-l:l-n.top)/(Math.abs(h)+Math.cos(u)*o);if(d<1||f<1)return 1/0;var p=g.EDGECOST*(1/(d-1)+1/(f-1));p+=g.ANGLECOST*u*u;for(var m=s-c,y=l-h,v=s+c,_=l+h,x=0;x<r.length;x++){var b=r[x],w=Math.cos(b.theta)*b.width/2,M=Math.sin(b.theta)*b.width/2,k=2*a.segmentDistance(m,y,v,_,b.x-w,b.y-M,b.x+w,b.y+M)/(e.height+b.height),T=b.level===e.level,L=T?g.SAMELEVELDISTANCE:1;if(k<=L)return 1/0;p+=g.NEIGHBORCOST*(T?g.SAMELEVELFACTOR:1)/(k-L)}return p}r.plot=function(t,e,o,s){var l=e.xaxis,g=e.yaxis;a.makeTraceGroups(s,o,"contour").each((function(o){var s=n.select(this),v=o[0],_=v.trace,x=v.x,b=v.y,w=_.contours,M=d(w,e,v),k=a.ensureSingle(s,"g","heatmapcoloring"),T=[];"heatmap"===w.coloring&&(T=[o]),u(t,e,T,k),c(M),h(M);var L=l.c2p(x[0],!0),A=l.c2p(x[x.length-1],!0),S=g.c2p(b[0],!0),E=g.c2p(b[b.length-1],!0),C=[[L,E],[A,E],[A,S],[L,S]],D=M;"constraint"===w.type&&(D=f(M,w._operation),p(D,w._operation,C,_)),function(t,e,r){var n=a.ensureSingle(t,"g","contourbg").selectAll("path").data("fill"===r.coloring?[0]:[]);n.enter().append("path"),n.exit().remove(),n.attr("d","M"+e.join("L")+"Z").style("stroke","none")}(s,C,w),function(t,e,r,i){var o=a.ensureSingle(t,"g","contourfill").selectAll("path").data("fill"===i.coloring||"constraint"===i.type&&"="!==i._operation?e:[]);o.enter().append("path"),o.exit().remove(),o.each((function(t){var e=y(t,r);e?n.select(this).attr("d",e).style("stroke","none"):n.select(this).remove()}))}(s,D,C,w),function(t,e,o,s,l){var u=a.ensureSingle(t,"g","contourlines"),c=!1!==l.showlines,h=l.showlabels,d=c&&h,f=r.createLines(u,c||h,e),p=r.createLineClip(u,d,o,s.trace.uid),g=t.selectAll("g.contourlabels").data(h?[0]:[]);if(g.exit().remove(),g.enter().append("g").classed("contourlabels",!0),h){var y=[],v=[];a.clearLocationCache();var _=r.labelFormatter(l,s.t.cb,o._fullLayout),x=i.tester.append("text").attr("data-notex",1).call(i.font,l.labelfont),b=e[0].xaxis,w=e[0].yaxis,M=b._length,k=w._length,T=b.range,L=w.range,A=a.aggNums(Math.min,null,s.x),S=a.aggNums(Math.max,null,s.x),E=a.aggNums(Math.min,null,s.y),C=a.aggNums(Math.max,null,s.y),D=Math.max(b.c2p(A,!0),0),P=Math.min(b.c2p(S,!0),M),O=Math.max(w.c2p(C,!0),0),z=Math.min(w.c2p(E,!0),k),I={};T[0]<T[1]?(I.left=D,I.right=P):(I.left=P,I.right=D),L[0]<L[1]?(I.top=O,I.bottom=z):(I.top=z,I.bottom=O),I.middle=(I.top+I.bottom)/2,I.center=(I.left+I.right)/2,y.push([[I.left,I.top],[I.right,I.top],[I.right,I.bottom],[I.left,I.bottom]]);var R=Math.sqrt(M*M+k*k),F=m.LABELDISTANCE*R/Math.max(1,e.length/m.LABELINCREASE);f.each((function(t){var e=r.calcTextOpts(t.level,_,x,o);n.select(this).selectAll("path").each((function(){var t=a.getVisibleSegment(this,I,e.height/2);if(t&&!(t.len<(e.width+e.height)*m.LABELMIN))for(var n=Math.min(Math.ceil(t.len/F),m.LABELMAX),i=0;i<n;i++){var o=r.findBestTextLocation(this,t,e,v,I);if(!o)break;r.addLabelData(o,e,v,y)}}))})),x.remove(),r.drawLabels(g,v,o,p,d?y:null)}h&&!c&&f.remove()}(s,M,t,v,w),function(t,e,r,n,o){var s=r._fullLayout._clips,l="clip"+n.trace.uid,u=s.selectAll("#"+l).data(n.trace.connectgaps?[]:[0]);if(u.enter().append("clipPath").classed("contourclip",!0).attr("id",l),u.exit().remove(),!1===n.trace.connectgaps){var d={level:.9,crossings:{},starts:[],edgepaths:[],paths:[],xaxis:e.xaxis,yaxis:e.yaxis,x:n.x,y:n.y,z:function(t){var e,r,n=t.trace._emptypoints,a=[],i=t.z.length,o=t.z[0].length,s=[];for(e=0;e<o;e++)s.push(1);for(e=0;e<i;e++)a.push(s.slice());for(e=0;e<n.length;e++)a[(r=n[e])[0]][r[1]]=0;return t.zmask=a,a}(n),smoothing:0};c([d]),h([d]);var f=y(d,o);a.ensureSingle(u,"path","").attr("d",f)}else l=null;i.setClipUrl(t,l,r)}(s,e,t,v,C)}))},r.createLines=function(t,e,r){var n=r[0].smoothing,a=t.selectAll("g.contourlevel").data(e?r:[]);if(a.exit().remove(),a.enter().append("g").classed("contourlevel",!0),e){var o=a.selectAll("path.openline").data((function(t){return t.pedgepaths||t.edgepaths}));o.exit().remove(),o.enter().append("path").classed("openline",!0),o.attr("d",(function(t){return i.smoothopen(t,n)})).style("stroke-miterlimit",1).style("vector-effect","non-scaling-stroke");var s=a.selectAll("path.closedline").data((function(t){return t.ppaths||t.paths}));s.exit().remove(),s.enter().append("path").classed("closedline",!0),s.attr("d",(function(t){return i.smoothclosed(t,n)})).style("stroke-miterlimit",1).style("vector-effect","non-scaling-stroke")}return a},r.createLineClip=function(t,e,r,n){var a=e?"clipline"+n:null,o=r._fullLayout._clips.selectAll("#"+a).data(e?[0]:[]);return o.exit().remove(),o.enter().append("clipPath").classed("contourlineclip",!0).attr("id",a),i.setClipUrl(t,a,r),o},r.labelFormatter=function(t,e,r){if(t.labelformat)return r._d3locale.numberFormat(t.labelformat);var n;if(e)n=e.axis;else{if(n={type:"linear",_id:"ycontour",showexponent:"all",exponentformat:"B"},"constraint"===t.type){var a=t.value;Array.isArray(a)?n.range=[a[0],a[a.length-1]]:n.range=[a,a]}else n.range=[t.start,t.end],n.nticks=(t.end-t.start)/t.size;n.range[0]===n.range[1]&&(n.range[1]+=n.range[0]||1),n.nticks||(n.nticks=1e3),l(n,r),s.prepTicks(n),n._tmin=null,n._tmax=null}return function(t){return s.tickText(n,t).text}},r.calcTextOpts=function(t,e,r,n){var a=e(t);r.text(a).call(o.convertToTspans,n);var s=i.bBox(r.node(),!0);return{text:a,width:s.width,height:s.height,level:t,dy:(s.top+s.bottom)/2}},r.findBestTextLocation=function(t,e,r,n,i){var o,s,l,u,c,h=r.width;e.isClosed?(s=e.len/g.INITIALSEARCHPOINTS,o=e.min+s/2,l=e.max):(s=(e.len-h)/(g.INITIALSEARCHPOINTS+1),o=e.min+s+h/2,l=e.max-(s+h)/2);for(var d=1/0,f=0;f<g.ITERATIONS;f++){for(var p=o;p<l;p+=s){var m=a.getTextLocation(t,e.total,p,h),y=v(m,r,n,i);y<d&&(d=y,c=m,u=p)}if(d>2*g.MAXCOST)break;f&&(s/=2),l=(o=u-s/2)+1.5*s}if(d<=g.MAXCOST)return c},r.addLabelData=function(t,e,r,n){var a=e.width/2,i=e.height/2,o=t.x,s=t.y,l=t.theta,u=Math.sin(l),c=Math.cos(l),h=a*c,d=i*u,f=a*u,p=-i*c,m=[[o-h-d,s-f-p],[o+h-d,s+f-p],[o+h+d,s+f+p],[o-h+d,s-f+p]];r.push({text:e.text,x:o,y:s,dy:e.dy,theta:l,level:e.level,width:e.width,height:e.height}),n.push(m)},r.drawLabels=function(t,e,r,i,s){var l=t.selectAll("text").data(e,(function(t){return t.text+","+t.x+","+t.y+","+t.theta}));if(l.exit().remove(),l.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each((function(t){var e=t.x+Math.sin(t.theta)*t.dy,a=t.y-Math.cos(t.theta)*t.dy;n.select(this).text(t.text).attr({x:e,y:a,transform:"rotate("+180*t.theta/Math.PI+" "+e+" "+a+")"}).call(o.convertToTspans,r)})),s){for(var u="",c=0;c<s.length;c++)u+="M"+s[c].join("L")+"Z";a.ensureSingle(i,"path","").attr("d",u)}}},{"../../components/drawing":614,"../../lib":719,"../../lib/svg_text_utils":743,"../../plots/cartesian/axes":767,"../../plots/cartesian/set_convert":785,"../heatmap/plot":1012,"./close_boundaries":944,"./constants":946,"./convert_to_constraints":950,"./empty_pathinfo":952,"./find_all_paths":954,"./make_crossings":959,d3:163}],961:[function(t,e,r){var n=t("../../plots/cartesian/axes"),a=t("../../lib");function i(t,e,r){var a={type:"linear",range:[t,e]};return n.autoTicks(a,(e-t)/(r||15)),a}e.exports=function(t,e){var r=t.contours;if(t.autocontour){var o=t.zmin,s=t.zmax;(t.zauto||void 0===o)&&(o=a.aggNums(Math.min,null,e)),(t.zauto||void 0===s)&&(s=a.aggNums(Math.max,null,e));var l=i(o,s,t.ncontours);r.size=l.dtick,r.start=n.tickFirst(l),l.range.reverse(),r.end=n.tickFirst(l),r.start===o&&(r.start+=r.size),r.end===s&&(r.end-=r.size),r.start>r.end&&(r.start=r.end=(r.start+r.end)/2),t._input.contours||(t._input.contours={}),a.extendFlat(t._input.contours,{start:r.start,end:r.end,size:r.size}),t._input.autocontour=!0}else if("constraint"!==r.type){var u,c=r.start,h=r.end,d=t._input.contours;c>h&&(r.start=d.start=h,h=r.end=d.end=c,c=r.start),r.size>0||(u=c===h?1:i(c,h,t.ncontours).dtick,d.size=r.size=u)}}},{"../../lib":719,"../../plots/cartesian/axes":767}],962:[function(t,e,r){var n=t("d3"),a=t("../../components/drawing"),i=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[0].trace.opacity})),e.each((function(t){var e=n.select(this),r=t[0].trace,i=r.contours,s=r.line,l=i.size||1,u=i.start,c="constraint"===i.type,h=!c&&"lines"===i.coloring,d=!c&&"fill"===i.coloring,f=h||d?o(r):null;e.selectAll("g.contourlevel").each((function(t){n.select(this).selectAll("path").call(a.lineGroupStyle,s.width,h?f(t.level):s.color,s.dash)}));var p=i.labelfont;if(e.selectAll("g.contourlabels text").each((function(t){a.font(n.select(this),{family:p.family,size:p.size,color:p.color||(h?f(t.level):s.color)})})),c)e.selectAll("g.contourfill path").style("fill",r.fillcolor);else if(d){var m;e.selectAll("g.contourfill path").style("fill",(function(t){return void 0===m&&(m=t.level),f(t.level+.5*l)})),void 0===m&&(m=u),e.selectAll("g.contourbg path").style("fill",f(m-.5*l))}})),i(t)}},{"../../components/drawing":614,"../heatmap/style":1013,"./make_color_map":958,d3:163}],963:[function(t,e,r){var n=t("../../components/colorscale/defaults"),a=t("./label_defaults");e.exports=function(t,e,r,i,o){var s,l=r("contours.coloring"),u="";"fill"===l&&(s=r("contours.showlines")),!1!==s&&("lines"!==l&&(u=r("line.color","#000")),r("line.width",.5),r("line.dash")),"none"!==l&&(!0!==t.showlegend&&(e.showlegend=!1),e._dfltShowLegend=!1,n(t,e,i,r,{prefix:"",cLetter:"z"})),r("line.smoothing"),a(r,i,u,o)}},{"../../components/colorscale/defaults":603,"./label_defaults":957}],964:[function(t,e,r){var n=t("../heatmap/attributes"),a=t("../contour/attributes"),i=a.contours,o=t("../scatter/attributes"),s=t("../../components/colorscale/attributes"),l=t("../../lib/extend").extendFlat,u=o.line;e.exports=l({carpet:{valType:"string",editType:"calc"},z:n.z,a:n.x,a0:n.x0,da:n.dx,b:n.y,b0:n.y0,db:n.dy,text:n.text,hovertext:n.hovertext,transpose:n.transpose,atype:n.xtype,btype:n.ytype,fillcolor:a.fillcolor,autocontour:a.autocontour,ncontours:a.ncontours,contours:{type:i.type,start:i.start,end:i.end,size:i.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:i.showlines,showlabels:i.showlabels,labelfont:i.labelfont,labelformat:i.labelformat,operation:i.operation,value:i.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:l({},u.color,{}),width:u.width,dash:u.dash,smoothing:l({},u.smoothing,{}),editType:"plot"},transforms:void 0},s("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":600,"../../lib/extend":710,"../contour/attributes":942,"../heatmap/attributes":1001,"../scatter/attributes":1112}],965:[function(t,e,r){var n=t("../../components/colorscale/calc"),a=t("../../lib"),i=t("../heatmap/convert_column_xyz"),o=t("../heatmap/clean_2d_array"),s=t("../heatmap/interp2d"),l=t("../heatmap/find_empties"),u=t("../heatmap/make_bound_array"),c=t("./defaults"),h=t("../carpet/lookup_carpetid"),d=t("../contour/set_contours");e.exports=function(t,e){var r=e._carpetTrace=h(t,e);if(r&&r.visible&&"legendonly"!==r.visible){if(!e.a||!e.b){var f=t.data[r.index],p=t.data[e.index];p.a||(p.a=f.a),p.b||(p.b=f.b),c(p,e,e._defaultColor,t._fullLayout)}var m=function(t,e){var r,c,h,d,f,p,m,g=e._carpetTrace,y=g.aaxis,v=g.baxis;y._minDtick=0,v._minDtick=0,a.isArray1D(e.z)&&i(e,y,v,"a","b",["z"]),r=e._a=e._a||e.a,d=e._b=e._b||e.b,r=r?y.makeCalcdata(e,"_a"):[],d=d?v.makeCalcdata(e,"_b"):[],c=e.a0||0,h=e.da||1,f=e.b0||0,p=e.db||1,m=e._z=o(e._z||e.z,e.transpose),e._emptypoints=l(m),s(m,e._emptypoints);var _=a.maxRowLength(m),x="scaled"===e.xtype?"":r,b=u(e,x,c,h,_,y),w="scaled"===e.ytype?"":d,M={a:b,b:u(e,w,f,p,m.length,v),z:m};return"levels"===e.contours.type&&"none"!==e.contours.coloring&&n(t,e,{vals:m,containerStr:"",cLetter:"z"}),[M]}(t,e);return d(e,e._z),m}}},{"../../components/colorscale/calc":601,"../../lib":719,"../carpet/lookup_carpetid":915,"../contour/set_contours":961,"../heatmap/clean_2d_array":1003,"../heatmap/convert_column_xyz":1005,"../heatmap/find_empties":1007,"../heatmap/interp2d":1010,"../heatmap/make_bound_array":1011,"./defaults":966}],966:[function(t,e,r){var n=t("../../lib"),a=t("../heatmap/xyz_defaults"),i=t("./attributes"),o=t("../contour/constraint_defaults"),s=t("../contour/contours_defaults"),l=t("../contour/style_defaults");e.exports=function(t,e,r,u){function c(r,a){return n.coerce(t,e,i,r,a)}if(c("carpet"),t.a&&t.b){if(!a(t,e,c,u,"a","b"))return void(e.visible=!1);c("text"),"constraint"===c("contours.type")?o(t,e,c,u,r,{hasHover:!1}):(s(t,e,c,(function(r){return n.coerce2(t,e,i,r)})),l(t,e,c,u,{hasHover:!1}))}else e._defaultColor=r,e._length=null}},{"../../lib":719,"../contour/constraint_defaults":947,"../contour/contours_defaults":949,"../contour/style_defaults":963,"../heatmap/xyz_defaults":1015,"./attributes":964}],967:[function(t,e,r){e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../contour/colorbar"),calc:t("./calc"),plot:t("./plot"),style:t("../contour/style"),moduleType:"trace",name:"contourcarpet",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent"],meta:{}}},{"../../plots/cartesian":778,"../contour/colorbar":945,"../contour/style":962,"./attributes":964,"./calc":965,"./defaults":966,"./plot":970}],968:[function(t,e,r){var n=t("../../components/drawing"),a=t("../carpet/axis_aligned_line"),i=t("../../lib");e.exports=function(t,e,r,o,s,l,u,c){var h,d,f,p,m,g,y,v="",_=e.edgepaths.map((function(t,e){return e})),x=!0,b=1e-4*Math.abs(r[0][0]-r[2][0]),w=1e-4*Math.abs(r[0][1]-r[2][1]);function M(t){return Math.abs(t[1]-r[0][1])<w}function k(t){return Math.abs(t[1]-r[2][1])<w}function T(t){return Math.abs(t[0]-r[0][0])<b}function L(t){return Math.abs(t[0]-r[2][0])<b}function A(t,e){var r,n,i,o,h="";for(M(t)&&!L(t)||k(t)&&!T(t)?(o=s.aaxis,i=a(s,l,[t[0],e[0]],.5*(t[1]+e[1]))):(o=s.baxis,i=a(s,l,.5*(t[0]+e[0]),[t[1],e[1]])),r=1;r<i.length;r++)for(h+=o.smoothing?"C":"L",n=0;n<i[r].length;n++){var d=i[r][n];h+=[u.c2p(d[0]),c.c2p(d[1])]+" "}return h}for(h=0,d=null;_.length;){var S=e.edgepaths[h][0];for(d&&(v+=A(d,S)),y=n.smoothopen(e.edgepaths[h].map(o),e.smoothing),v+=x?y:y.replace(/^M/,"L"),_.splice(_.indexOf(h),1),d=e.edgepaths[h][e.edgepaths[h].length-1],m=-1,p=0;p<4;p++){if(!d){i.log("Missing end?",h,e);break}for(M(d)&&!L(d)?f=r[1]:T(d)?f=r[0]:k(d)?f=r[3]:L(d)&&(f=r[2]),g=0;g<e.edgepaths.length;g++){var E=e.edgepaths[g][0];Math.abs(d[0]-f[0])<b?Math.abs(d[0]-E[0])<b&&(E[1]-d[1])*(f[1]-E[1])>=0&&(f=E,m=g):Math.abs(d[1]-f[1])<w?Math.abs(d[1]-E[1])<w&&(E[0]-d[0])*(f[0]-E[0])>=0&&(f=E,m=g):i.log("endpt to newendpt is not vert. or horz.",d,f,E)}if(m>=0)break;v+=A(d,f),d=f}if(m===e.edgepaths.length){i.log("unclosed perimeter path");break}h=m,(x=-1===_.indexOf(h))&&(h=_[0],v+=A(d,f)+"Z",d=null)}for(h=0;h<e.paths.length;h++)v+=n.smoothclosed(e.paths[h].map(o),e.smoothing);return v}},{"../../components/drawing":614,"../../lib":719,"../carpet/axis_aligned_line":899}],969:[function(t,e,r){e.exports=function(t,e){var r,n,a,i,o,s,l,u,c;for(r=0;r<t.length;r++){for(o=(i=t[r]).pedgepaths=[],s=i.ppaths=[],n=0;n<i.edgepaths.length;n++){for(c=i.edgepaths[n],l=[],a=0;a<c.length;a++)l[a]=e(c[a]);o.push(l)}for(n=0;n<i.paths.length;n++){for(c=i.paths[n],u=[],a=0;a<c.length;a++)u[a]=e(c[a]);s.push(u)}}}},{}],970:[function(t,e,r){var n=t("d3"),a=t("../carpet/map_1d_array"),i=t("../carpet/makepath"),o=t("../../components/drawing"),s=t("../../lib"),l=t("../contour/make_crossings"),u=t("../contour/find_all_paths"),c=t("../contour/plot"),h=t("../contour/constants"),d=t("../contour/convert_to_constraints"),f=t("./join_all_paths"),p=t("../contour/empty_pathinfo"),m=t("./map_pathinfo"),g=t("../carpet/lookup_carpetid"),y=t("../contour/close_boundaries");function v(t,e,r){var n=t.getPointAtLength(e),a=t.getPointAtLength(r),i=a.x-n.x,o=a.y-n.y,s=Math.sqrt(i*i+o*o);return[i/s,o/s]}function _(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}function x(t,e){var r=Math.abs(t[0]*e[0]+t[1]*e[1]);return Math.sqrt(1-r*r)/r}e.exports=function(t,e,r,b){var w=e.xaxis,M=e.yaxis;s.makeTraceGroups(b,r,"contour").each((function(r){var b=n.select(this),k=r[0],T=k.trace,L=T._carpetTrace=g(t,T),A=t.calcdata[L.index][0];if(L.visible&&"legendonly"!==L.visible){var S=k.a,E=k.b,C=T.contours,D=p(C,e,k),P="constraint"===C.type,O=C._operation,z=P?"="===O?"lines":"fill":C.coloring,I=[[S[0],E[E.length-1]],[S[S.length-1],E[E.length-1]],[S[S.length-1],E[0]],[S[0],E[0]]];l(D);var R=1e-8*(S[S.length-1]-S[0]),F=1e-8*(E[E.length-1]-E[0]);u(D,R,F);var N,Y,j,B,H=D;"constraint"===C.type&&(H=d(D,O),y(H,O,I,T)),m(D,W);var U=[];for(B=A.clipsegments.length-1;B>=0;B--)N=A.clipsegments[B],Y=a([],N.x,w.c2p),j=a([],N.y,M.c2p),Y.reverse(),j.reverse(),U.push(i(Y,j,N.bicubic));var V="M"+U.join("L")+"Z";!function(t,e,r,n,o,l){var u,c,h,d,f=s.ensureSingle(t,"g","contourbg").selectAll("path").data("fill"!==l||o?[]:[0]);f.enter().append("path"),f.exit().remove();var p=[];for(d=0;d<e.length;d++)u=e[d],c=a([],u.x,r.c2p),h=a([],u.y,n.c2p),p.push(i(c,h,u.bicubic));f.attr("d","M"+p.join("L")+"Z").style("stroke","none")}(b,A.clipsegments,w,M,P,z),function(t,e,r,a,i,o,l,u,c,h,d){var p=s.ensureSingle(e,"g","contourfill").selectAll("path").data("fill"===h?i:[]);p.enter().append("path"),p.exit().remove(),p.each((function(e){var i=f(t,e,o,l,u,c,r,a);e.prefixBoundary&&(i=d+i),i?n.select(this).attr("d",i).style("stroke","none"):n.select(this).remove()}))}(T,b,w,M,H,I,W,L,A,z,V),function(t,e,r,a,i,l,u){var d=s.ensureSingle(t,"g","contourlines"),f=!1!==i.showlines,p=i.showlabels,m=f&&p,g=c.createLines(d,f||p,e),y=c.createLineClip(d,m,r,a.trace.uid),b=t.selectAll("g.contourlabels").data(p?[0]:[]);if(b.exit().remove(),b.enter().append("g").classed("contourlabels",!0),p){var w=l.xaxis,M=l.yaxis,k=w._length,T=M._length,L=[[[0,0],[k,0],[k,T],[0,T]]],A=[];s.clearLocationCache();var S=c.labelFormatter(i,a.t.cb,r._fullLayout),E=o.tester.append("text").attr("data-notex",1).call(o.font,i.labelfont),C={left:0,right:k,center:k/2,top:0,bottom:T,middle:T/2},D=Math.sqrt(k*k+T*T),P=h.LABELDISTANCE*D/Math.max(1,e.length/h.LABELINCREASE);g.each((function(t){var e=c.calcTextOpts(t.level,S,E,r);n.select(this).selectAll("path").each((function(r){var n=s.getVisibleSegment(this,C,e.height/2);if(n&&(function(t,e,r,n,a,i){for(var o,s=0;s<r.pedgepaths.length;s++)e===r.pedgepaths[s]&&(o=r.edgepaths[s]);if(o){var l=a.a[0],u=a.a[a.a.length-1],c=a.b[0],h=a.b[a.b.length-1],d=v(t,0,1),f=v(t,n.total,n.total-1),p=g(o[0],d),m=n.total-g(o[o.length-1],f);n.min<p&&(n.min=p),n.max>m&&(n.max=m),n.len=n.max-n.min}function g(t,e){var r,n=0;return(Math.abs(t[0]-l)<.1||Math.abs(t[0]-u)<.1)&&(r=_(a.dxydb_rough(t[0],t[1],.1)),n=Math.max(n,i*x(e,r)/2)),(Math.abs(t[1]-c)<.1||Math.abs(t[1]-h)<.1)&&(r=_(a.dxyda_rough(t[0],t[1],.1)),n=Math.max(n,i*x(e,r)/2)),n}}(this,r,t,n,u,e.height),!(n.len<(e.width+e.height)*h.LABELMIN)))for(var a=Math.min(Math.ceil(n.len/P),h.LABELMAX),i=0;i<a;i++){var o=c.findBestTextLocation(this,n,e,A,C);if(!o)break;c.addLabelData(o,e,A,L)}}))})),E.remove(),c.drawLabels(b,A,r,y,m?L:null)}p&&!f&&g.remove()}(b,D,t,k,C,e,L),o.setClipUrl(b,L._clipPathId,t)}function W(t){var e=L.ab2xy(t[0],t[1],!0);return[w.c2p(e[0]),M.c2p(e[1])]}}))}},{"../../components/drawing":614,"../../lib":719,"../carpet/lookup_carpetid":915,"../carpet/makepath":916,"../carpet/map_1d_array":917,"../contour/close_boundaries":944,"../contour/constants":946,"../contour/convert_to_constraints":950,"../contour/empty_pathinfo":952,"../contour/find_all_paths":954,"../contour/make_crossings":959,"../contour/plot":960,"./join_all_paths":968,"./map_pathinfo":969,d3:163}],971:[function(t,e,r){var n=t("../../components/colorscale/attributes"),a=t("../../components/fx/hovertemplate_attributes"),i=t("../../plots/attributes"),o=t("../scattermapbox/attributes"),s=t("../../lib/extend").extendFlat;e.exports=s({lon:o.lon,lat:o.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:o.text,hovertext:o.hovertext,hoverinfo:s({},i.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:a()},n("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/colorscale/attributes":600,"../../components/fx/hovertemplate_attributes":631,"../../lib/extend":710,"../../plots/attributes":764,"../scattermapbox/attributes":1171}],972:[function(t,e,r){var n=t("fast-isnumeric"),a=t("../../lib").isArrayOrTypedArray,i=t("../../constants/numerical").BADNUM,o=t("../../components/colorscale/calc"),s=t("../../lib")._;e.exports=function(t,e){for(var r=e._length,l=new Array(r),u=e.z,c=a(u)&&u.length,h=0;h<r;h++){var d=l[h]={},f=e.lon[h],p=e.lat[h];if(d.lonlat=n(f)&&n(p)?[+f,+p]:[i,i],c){var m=u[h];d.z=n(m)?m:i}}return o(t,e,{vals:c?u:[0,1],containerStr:"",cLetter:"z"}),r&&(l[0].t={labels:{lat:s(t,"lat:")+" ",lon:s(t,"lon:")+" "}}),l}},{"../../components/colorscale/calc":601,"../../constants/numerical":695,"../../lib":719,"fast-isnumeric":225}],973:[function(t,e,r){var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../components/color"),o=t("../../components/colorscale"),s=t("../../constants/numerical").BADNUM,l=t("../../lib/geojson_utils").makeBlank;e.exports=function(t){var e=t[0].trace,r=!0===e.visible&&0!==e._length,u=e._opts={heatmap:{layout:{visibility:"none"},paint:{}},geojson:l()};if(!r)return u;var c,h=[],d=e.z,f=e.radius,p=a.isArrayOrTypedArray(d)&&d.length,m=a.isArrayOrTypedArray(f);for(c=0;c<t.length;c++){var g=t[c],y=g.lonlat;if(y[0]!==s){var v={};if(p){var _=g.z;v.z=_!==s?_:0}m&&(v.r=n(f[c])&&f[c]>0?+f[c]:0),h.push({type:"Feature",geometry:{type:"Point",coordinates:y},properties:v})}}var x=o.extractOpts(e),b=x.reversescale?o.flipScale(x.colorscale):x.colorscale,w=b[0][1],M=["interpolate",["linear"],["heatmap-density"],0,i.opacity(w)<1?w:i.addOpacity(w,0)];for(c=1;c<b.length;c++)M.push(b[c][0],b[c][1]);var k=["interpolate",["linear"],["get","z"],x.min,0,x.max,1];return a.extendFlat(u.heatmap.paint,{"heatmap-weight":p?k:1/(x.max-x.min),"heatmap-color":M,"heatmap-radius":m?{type:"identity",property:"r"}:e.radius,"heatmap-opacity":e.opacity}),u.geojson={type:"FeatureCollection",features:h},u.heatmap.layout.visibility="visible",u}},{"../../components/color":593,"../../components/colorscale":605,"../../constants/numerical":695,"../../lib":719,"../../lib/geojson_utils":714,"fast-isnumeric":225}],974:[function(t,e,r){var n=t("../../lib"),a=t("../../components/colorscale/defaults"),i=t("./attributes");e.exports=function(t,e,r,o){function s(r,a){return n.coerce(t,e,i,r,a)}var l=s("lon")||[],u=s("lat")||[],c=Math.min(l.length,u.length);c?(e._length=c,s("z"),s("radius"),s("below"),s("text"),s("hovertext"),s("hovertemplate"),a(t,e,o,s,{prefix:"",cLetter:"z"})):e.visible=!1}},{"../../components/colorscale/defaults":603,"../../lib":719,"./attributes":971}],975:[function(t,e,r){e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t.z=e.z,t}},{}],976:[function(t,e,r){var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../scattermapbox/hover");e.exports=function(t,e,r){var o=i(t,e,r);if(o){var s=o[0],l=s.cd,u=l[0].trace,c=l[s.index];if(delete s.color,"z"in c){var h=s.subplot.mockAxis;s.z=c.z,s.zLabel=a.tickText(h,h.c2l(c.z),"hover").text}return s.extraText=function(t,e,r){if(!t.hovertemplate){var a=(e.hi||t.hoverinfo).split("+"),i=-1!==a.indexOf("all"),o=-1!==a.indexOf("lon"),s=-1!==a.indexOf("lat"),l=e.lonlat,u=[];return i||o&&s?u.push("("+c(l[0])+", "+c(l[1])+")"):o?u.push(r.lon+c(l[0])):s&&u.push(r.lat+c(l[1])),(i||-1!==a.indexOf("text"))&&n.fillText(e,t,u),u.join("<br>")}function c(t){return t+"°"}}(u,c,l[0].t.labels),[s]}}},{"../../lib":719,"../../plots/cartesian/axes":767,"../scattermapbox/hover":1175}],977:[function(t,e,r){e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../heatmap/colorbar"),calc:t("./calc"),plot:t("./plot"),hoverPoints:t("./hover"),eventData:t("./event_data"),getBelow:function(t,e){for(var r=e.getMapLayers(),n=0;n<r.length;n++){var a=r[n],i=a.id;if("symbol"===a.type&&"string"==typeof i&&-1===i.indexOf("plotly-"))return i}},moduleType:"trace",name:"densitymapbox",basePlotModule:t("../../plots/mapbox"),categories:["mapbox","gl"],meta:{hr_name:"density_mapbox"}}},{"../../plots/mapbox":822,"../heatmap/colorbar":1004,"./attributes":971,"./calc":972,"./defaults":974,"./event_data":975,"./hover":976,"./plot":978}],978:[function(t,e,r){var n=t("./convert"),a=t("../../plots/mapbox/constants").traceLayerPrefix;function i(t,e){this.subplot=t,this.uid=e,this.sourceId="source-"+e,this.layerList=[["heatmap",a+e+"-heatmap"]],this.below=null}var o=i.prototype;o.update=function(t){var e=this.subplot,r=this.layerList,a=n(t),i=e.belowLookup["trace-"+this.uid];e.map.getSource(this.sourceId).setData(a.geojson),i!==this.below&&(this._removeLayers(),this._addLayers(a,i),this.below=i);for(var o=0;o<r.length;o++){var s=r[o],l=s[0],u=s[1],c=a[l];e.setOptions(u,"setLayoutProperty",c.layout),"visible"===c.layout.visibility&&e.setOptions(u,"setPaintProperty",c.paint)}},o._addLayers=function(t,e){for(var r=this.subplot,n=this.layerList,a=this.sourceId,i=0;i<n.length;i++){var o=n[i],s=o[0],l=t[s];r.addLayer({type:s,id:o[1],source:a,layout:l.layout,paint:l.paint},e)}},o._removeLayers=function(){for(var t=this.subplot.map,e=this.layerList,r=e.length-1;r>=0;r--)t.removeLayer(e[r][1])},o.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,a=new i(t,r.uid),o=a.sourceId,s=n(e),l=a.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),a._addLayers(s,l),a}},{"../../plots/mapbox/constants":820,"./convert":973}],979:[function(t,e,r){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");var a=e.marker;if(a){n.mergeArray(a.opacity,t,"mo"),n.mergeArray(a.color,t,"mc");var i=a.line;i&&(n.mergeArray(i.color,t,"mlc"),n.mergeArrayCastPositive(i.width,t,"mlw"))}}},{"../../lib":719}],980:[function(t,e,r){var n=t("../bar/attributes"),a=t("../scatter/attributes").line,i=t("../../plots/attributes"),o=t("../../components/fx/hovertemplate_attributes"),s=t("./constants"),l=t("../../lib/extend").extendFlat,u=t("../../components/color");e.exports={x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,hovertext:n.hovertext,hovertemplate:o({},{keys:s.eventDataKeys}),hoverinfo:l({},i.hoverinfo,{flags:["name","x","y","text","percent initial","percent previous","percent total"]}),textinfo:{valType:"flaglist",flags:["label","text","percent initial","percent previous","percent total","value"],extras:["none"],editType:"plot",arrayOk:!1},text:n.text,textposition:l({},n.textposition,{dflt:"auto"}),insidetextanchor:l({},n.insidetextanchor,{dflt:"middle"}),textangle:l({},n.textangle,{dflt:0}),textfont:n.textfont,insidetextfont:n.insidetextfont,outsidetextfont:n.outsidetextfont,constraintext:n.constraintext,cliponaxis:n.cliponaxis,orientation:l({},n.orientation,{}),offset:l({},n.offset,{arrayOk:!1}),width:l({},n.width,{arrayOk:!1}),marker:n.marker,connector:{fillcolor:{valType:"color",editType:"style"},line:{color:l({},a.color,{dflt:u.defaultLine}),width:l({},a.width,{dflt:0,editType:"plot"}),dash:a.dash,editType:"style"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:n.offsetgroup,alignmentgroup:n.alignmentgroup}},{"../../components/color":593,"../../components/fx/hovertemplate_attributes":631,"../../lib/extend":710,"../../plots/attributes":764,"../bar/attributes":857,"../scatter/attributes":1112,"./constants":982}],981:[function(t,e,r){var n=t("../../plots/cartesian/axes"),a=t("./arrays_to_calcdata"),i=t("../scatter/calc_selection"),o=t("../../constants/numerical").BADNUM;function s(t){return t===o?0:t}e.exports=function(t,e){var r,l,u,c,h=n.getFromId(t,e.xaxis||"x"),d=n.getFromId(t,e.yaxis||"y");"h"===e.orientation?(r=h.makeCalcdata(e,"x"),l=d.makeCalcdata(e,"y")):(r=d.makeCalcdata(e,"y"),l=h.makeCalcdata(e,"x"));var f,p=Math.min(l.length,r.length),m=new Array(p);for(e._base=[],u=0;u<p;u++){r[u]<0&&(r[u]=o);var g=!1;r[u]!==o&&u+1<p&&r[u+1]!==o&&(g=!0),c=m[u]={p:l[u],s:r[u],cNext:g},e._base[u]=-.5*c.s,e.ids&&(c.id=String(e.ids[u])),0===u&&(m[0].vTotal=0),m[0].vTotal+=s(c.s),c.begR=s(c.s)/s(m[0].s)}for(u=0;u<p;u++)(c=m[u]).s!==o&&(c.sumR=c.s/m[0].vTotal,c.difR=void 0!==f?c.s/f:1,f=c.s);return a(m,e),i(m,e),m}},{"../../constants/numerical":695,"../../plots/cartesian/axes":767,"../scatter/calc_selection":1114,"./arrays_to_calcdata":979}],982:[function(t,e,r){e.exports={eventDataKeys:["percentInitial","percentPrevious","percentTotal"]}},{}],983:[function(t,e,r){var n=t("../bar/cross_trace_calc").setGroupPositions;e.exports=function(t,e){var r,a,i=t._fullLayout,o=t._fullData,s=t.calcdata,l=e.xaxis,u=e.yaxis,c=[],h=[],d=[];for(a=0;a<o.length;a++){var f=o[a],p="h"===f.orientation;!0===f.visible&&f.xaxis===l._id&&f.yaxis===u._id&&"funnel"===f.type&&(r=s[a],p?d.push(r):h.push(r),c.push(r))}var m={mode:i.funnelmode,norm:i.funnelnorm,gap:i.funnelgap,groupgap:i.funnelgroupgap};for(n(t,l,u,h,m),n(t,u,l,d,m),a=0;a<c.length;a++){r=c[a];for(var g=0;g<r.length;g++)g+1<r.length&&(r[g].nextP0=r[g+1].p0,r[g].nextS0=r[g+1].s0,r[g].nextP1=r[g+1].p1,r[g].nextS1=r[g+1].s1)}}},{"../bar/cross_trace_calc":860}],984:[function(t,e,r){var n=t("../../lib"),a=t("../bar/defaults").handleGroupingDefaults,i=t("../bar/defaults").handleText,o=t("../scatter/xy_defaults"),s=t("./attributes"),l=t("../../components/color");e.exports={supplyDefaults:function(t,e,r,a){function u(r,a){return n.coerce(t,e,s,r,a)}if(o(t,e,a,u)){u("orientation",e.y&&!e.x?"v":"h"),u("offset"),u("width");var c=u("text");u("hovertext"),u("hovertemplate");var h=u("textposition");i(t,e,a,u,h,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),"none"!==e.textposition&&u("textinfo",Array.isArray(c)?"text+value":"value");var d=u("marker.color",r);u("marker.line.color",l.defaultLine),u("marker.line.width"),u("connector.visible")&&(u("connector.fillcolor",function(t){var e=n.isArrayOrTypedArray(t)?"#000":t;return l.addOpacity(e,.5*l.opacity(e))}(d)),u("connector.line.width")&&(u("connector.line.color"),u("connector.line.dash")))}else e.visible=!1},crossTraceDefaults:function(t,e){var r,i;function o(t){return n.coerce(i._input,i,s,t)}if("group"===e.funnelmode)for(var l=0;l<t.length;l++)r=(i=t[l])._input,a(r,i,e,o)}}},{"../../components/color":593,"../../lib":719,"../bar/defaults":861,"../scatter/xy_defaults":1137,"./attributes":980}],985:[function(t,e,r){e.exports=function(t,e){return t.x="xVal"in e?e.xVal:e.x,t.y="yVal"in e?e.yVal:e.y,"percentInitial"in e&&(t.percentInitial=e.percentInitial),"percentPrevious"in e&&(t.percentPrevious=e.percentPrevious),"percentTotal"in e&&(t.percentTotal=e.percentTotal),e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),t}},{}],986:[function(t,e,r){var n=t("../../components/color").opacity,a=t("../bar/hover").hoverOnBars,i=t("../../lib").formatPercent;e.exports=function(t,e,r,o){var s=a(t,e,r,o);if(s){var l=s.cd,u=l[0].trace,c="h"===u.orientation,h=l[s.index];s[(c?"x":"y")+"LabelVal"]=h.s,s.percentInitial=h.begR,s.percentInitialLabel=i(h.begR,1),s.percentPrevious=h.difR,s.percentPreviousLabel=i(h.difR,1),s.percentTotal=h.sumR,s.percentTotalLabel=i(h.sumR,1);var d=h.hi||u.hoverinfo,f=[];if(d&&"none"!==d&&"skip"!==d){var p="all"===d,m=d.split("+"),g=function(t){return p||-1!==m.indexOf(t)};g("percent initial")&&f.push(s.percentInitialLabel+" of initial"),g("percent previous")&&f.push(s.percentPreviousLabel+" of previous"),g("percent total")&&f.push(s.percentTotalLabel+" of total")}return s.extraText=f.join("<br>"),s.color=function(t,e){var r=t.marker,a=e.mc||r.color,i=e.mlc||r.line.color,o=e.mlw||r.line.width;return n(a)?a:n(i)&&o?i:void 0}(u,h),[s]}}},{"../../components/color":593,"../../lib":719,"../bar/hover":863}],987:[function(t,e,r){e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults").supplyDefaults,crossTraceDefaults:t("./defaults").crossTraceDefaults,supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),crossTraceCalc:t("./cross_trace_calc"),plot:t("./plot"),style:t("./style").style,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("../bar/select"),moduleType:"trace",name:"funnel",basePlotModule:t("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":778,"../bar/select":868,"./attributes":980,"./calc":981,"./cross_trace_calc":983,"./defaults":984,"./event_data":985,"./hover":986,"./layout_attributes":988,"./layout_defaults":989,"./plot":990,"./style":991}],988:[function(t,e,r){e.exports={funnelmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"stack",editType:"calc"},funnelgap:{valType:"number",min:0,max:1,editType:"calc"},funnelgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],989:[function(t,e,r){var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r){var i=!1;function o(r,i){return n.coerce(t,e,a,r,i)}for(var s=0;s<r.length;s++){var l=r[s];if(l.visible&&"funnel"===l.type){i=!0;break}}i&&(o("funnelmode"),o("funnelgap",.2),o("funnelgroupgap"))}},{"../../lib":719,"./layout_attributes":988}],990:[function(t,e,r){var n=t("d3"),a=t("../../lib"),i=t("../../components/drawing"),o=t("../bar/plot").plot;function s(t,e,r,n){var a=[],i=[],o=n?e:r,s=n?r:e;return a[0]=o.c2p(t.s0,!0),i[0]=s.c2p(t.p0,!0),a[1]=o.c2p(t.s1,!0),i[1]=s.c2p(t.p1,!0),a[2]=o.c2p(t.nextS0,!0),i[2]=s.c2p(t.nextP0,!0),a[3]=o.c2p(t.nextS1,!0),i[3]=s.c2p(t.nextP1,!0),n?[a,i]:[i,a]}e.exports=function(t,e,r,l){var u=t._fullLayout;!function(t,e,r,o){var l=e.xaxis,u=e.yaxis;a.makeTraceGroups(o,r,"trace bars").each((function(r){var o=n.select(this),c=r[0].trace,h=a.ensureSingle(o,"g","regions");if(c.connector&&c.connector.visible){var d="h"===c.orientation,f=h.selectAll("g.region").data(a.identity);f.enter().append("g").classed("region",!0),f.exit().remove();var p=f.size();f.each((function(r,o){if(o===p-1||r.cNext){var c=s(r,l,u,d),h=c[0],f=c[1],m="";void 0!==h[3]&&void 0!==f[3]&&(m+=d?"M"+h[0]+","+f[1]+"L"+h[2]+","+f[2]+"H"+h[3]+"L"+h[1]+","+f[1]+"Z":"M"+h[1]+","+f[1]+"L"+h[2]+","+f[3]+"V"+f[2]+"L"+h[1]+","+f[0]+"Z"),a.ensureSingle(n.select(this),"path").attr("d",m).call(i.setClipUrl,e.layerClipId,t)}}))}else h.remove()}))}(t,e,r,l),function(t,e,r,o){var l=e.xaxis,u=e.yaxis;a.makeTraceGroups(o,r,"trace bars").each((function(r){var o=n.select(this),c=r[0].trace,h=a.ensureSingle(o,"g","lines");if(c.connector&&c.connector.visible&&c.connector.line.width){var d="h"===c.orientation,f=h.selectAll("g.line").data(a.identity);f.enter().append("g").classed("line",!0),f.exit().remove();var p=f.size();f.each((function(r,o){if(o===p-1||r.cNext){var c=s(r,l,u,d),h=c[0],f=c[1],m="";void 0!==h[3]&&void 0!==f[3]&&(d?(m+="M"+h[0]+","+f[1]+"L"+h[2]+","+f[2],m+="M"+h[1]+","+f[1]+"L"+h[3]+","+f[2]):(m+="M"+h[1]+","+f[1]+"L"+h[2]+","+f[3],m+="M"+h[1]+","+f[0]+"L"+h[2]+","+f[2])),""===m&&(m="M0,0Z"),a.ensureSingle(n.select(this),"path").attr("d",m).call(i.setClipUrl,e.layerClipId,t)}}))}else h.remove()}))}(t,e,r,l),o(t,e,r,l,{mode:u.funnelmode,norm:u.funnelmode,gap:u.funnelgap,groupgap:u.funnelgroupgap})}},{"../../components/drawing":614,"../../lib":719,"../bar/plot":867,d3:163}],991:[function(t,e,r){var n=t("d3"),a=t("../../components/drawing"),i=t("../../components/color"),o=t("../../constants/interactions").DESELECTDIM,s=t("../bar/style").styleTextPoints;e.exports={style:function(t,e,r){var l=r||n.select(t).selectAll("g.funnellayer").selectAll("g.trace");l.style("opacity",(function(t){return t[0].trace.opacity})),l.each((function(e){var r=n.select(this),l=e[0].trace;r.selectAll(".point > path").each((function(t){if(!t.isBlank){var e=l.marker;n.select(this).call(i.fill,t.mc||e.color).call(i.stroke,t.mlc||e.line.color).call(a.dashLine,e.line.dash,t.mlw||e.line.width).style("opacity",l.selectedpoints&&!t.selected?o:1)}})),s(r,l,t),r.selectAll(".regions").each((function(){n.select(this).selectAll("path").style("stroke-width",0).call(i.fill,l.connector.fillcolor)})),r.selectAll(".lines").each((function(){var t=l.connector.line;a.lineGroupStyle(n.select(this).selectAll("path"),t.width,t.color,t.dash)}))}))}}},{"../../components/color":593,"../../components/drawing":614,"../../constants/interactions":694,"../bar/style":870,d3:163}],992:[function(t,e,r){var n=t("../pie/attributes"),a=t("../../plots/attributes"),i=t("../../plots/domain").attributes,o=t("../../components/fx/hovertemplate_attributes"),s=t("../../lib/extend").extendFlat;e.exports={labels:n.labels,label0:n.label0,dlabel:n.dlabel,values:n.values,marker:{colors:n.marker.colors,line:{color:s({},n.marker.line.color,{dflt:null}),width:s({},n.marker.line.width,{dflt:1}),editType:"calc"},editType:"calc"},text:n.text,hovertext:n.hovertext,scalegroup:s({},n.scalegroup,{}),textinfo:s({},n.textinfo,{flags:["label","text","value","percent"]}),hoverinfo:s({},a.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","percent","text"]}),textposition:s({},n.textposition,{values:["inside","none"],dflt:"inside"}),textfont:n.textfont,insidetextfont:n.insidetextfont,title:{text:n.title.text,font:n.title.font,position:s({},n.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:i({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}},{"../../components/fx/hovertemplate_attributes":631,"../../lib/extend":710,"../../plots/attributes":764,"../../plots/domain":792,"../pie/attributes":1086}],993:[function(t,e,r){var n=t("../../registry"),a=t("../../plots/get_data").getModuleCalcData;r.name="funnelarea",r.plot=function(t){var e=n.getModule("funnelarea"),r=a(t.calcdata,e)[0];e.plot(t,r)},r.clean=function(t,e,r,n){var a=n._has&&n._has("funnelarea"),i=e._has&&e._has("funnelarea");a&&!i&&n._funnelarealayer.selectAll("g.trace").remove()}},{"../../plots/get_data":802,"../../registry":847}],994:[function(t,e,r){var n=t("../pie/calc");e.exports={calc:function(t,e){return n.calc(t,e)},crossTraceCalc:function(t){n.crossTraceCalc(t,{type:"funnelarea"})}}},{"../pie/calc":1088}],995:[function(t,e,r){var n=t("../../lib"),a=t("./attributes"),i=t("../../plots/domain").defaults,o=t("../bar/defaults").handleText;e.exports=function(t,e,r,s){function l(r,i){return n.coerce(t,e,a,r,i)}var u,c=l("values"),h=n.isArrayOrTypedArray(c),d=l("labels");if(Array.isArray(d)?(u=d.length,h&&(u=Math.min(u,c.length))):h&&(u=c.length,l("label0"),l("dlabel")),u){e._length=u,l("marker.line.width")&&l("marker.line.color",s.paper_bgcolor),l("marker.colors"),l("scalegroup");var f=l("text"),p=l("textinfo",Array.isArray(f)?"text+percent":"percent");if(l("hovertext"),l("hovertemplate"),p&&"none"!==p){var m=l("textposition");o(t,e,s,l,m,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}i(e,s,l),l("title.text")&&(l("title.position"),n.coerceFont(l,"title.font",s.font)),l("aspectratio"),l("baseratio")}else e.visible=!1}},{"../../lib":719,"../../plots/domain":792,"../bar/defaults":861,"./attributes":992}],996:[function(t,e,r){e.exports={moduleType:"trace",name:"funnelarea",basePlotModule:t("./base_plot"),categories:["pie-like","funnelarea","showLegend"],attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot"),style:t("./style"),styleOne:t("../pie/style_one"),meta:{}}},{"../pie/style_one":1097,"./attributes":992,"./base_plot":993,"./calc":994,"./defaults":995,"./layout_attributes":997,"./layout_defaults":998,"./plot":999,"./style":1e3}],997:[function(t,e,r){var n=t("../pie/layout_attributes").hiddenlabels;e.exports={hiddenlabels:n,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{"../pie/layout_attributes":1093}],998:[function(t,e,r){var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){function r(r,i){return n.coerce(t,e,a,r,i)}r("hiddenlabels"),r("funnelareacolorway",e.colorway),r("extendfunnelareacolors")}},{"../../lib":719,"./layout_attributes":997}],999:[function(t,e,r){var n=t("d3"),a=t("../../components/drawing"),i=t("../../lib"),o=t("../../lib/svg_text_utils"),s=t("../bar/plot"),l=s.getTransform,u=s.toMoveInsideBar,c=t("../pie/helpers"),h=t("../pie/plot"),d=h.attachFxHandlers,f=h.determineInsideTextFont,p=h.layoutAreas,m=h.prerenderTitles,g=h.positionTitleOutside;function y(t,e){return"l"+(e[0]-t[0])+","+(e[1]-t[1])}e.exports=function(t,e){var r=t._fullLayout;m(e,t),p(e,r._size),i.makeTraceGroups(r._funnelarealayer,e,"trace").each((function(e){var s=n.select(this),h=e[0],p=h.trace;!function(t){if(t.length){var e=t[0],r=e.trace,n=r.aspectratio,a=r.baseratio;a>.999&&(a=.999);var i,o,s,l=Math.pow(a,2),u=e.vTotal,c=u,h=u*l/(1-l)/u,d=[];for(d.push(S()),o=t.length-1;o>-1;o--)if(!(s=t[o]).hidden){var f=s.v/c;h+=f,d.push(S())}var p=1/0,m=-1/0;for(o=0;o<d.length;o++)i=d[o],p=Math.min(p,i[1]),m=Math.max(m,i[1]);for(o=0;o<d.length;o++)d[o][1]-=(m+p)/2;var g=d[d.length-1][0],y=e.r,v=(m-p)/2,_=y/g,x=y/v*n;for(e.r=x*v,o=0;o<d.length;o++)d[o][0]*=_,d[o][1]*=x;var b,w,M=[-(i=d[0])[0],i[1]],k=[i[0],i[1]],T=0;for(o=t.length-1;o>-1;o--)if(!(s=t[o]).hidden){var L=d[T+=1][0],A=d[T][1];s.TL=[-L,A],s.TR=[L,A],s.BL=M,s.BR=k,s.pxmid=(b=s.TR,w=s.BR,[.5*(b[0]+w[0]),.5*(b[1]+w[1])]),M=s.TL,k=s.TR}}function S(){var t,e={x:t=Math.sqrt(h),y:-t};return[e.x,e.y]}}(e),s.each((function(){var s=n.select(this).selectAll("g.slice").data(e);s.enter().append("g").classed("slice",!0),s.exit().remove(),s.each((function(r){if(r.hidden)n.select(this).selectAll("path,g").remove();else{r.pointNumber=r.i,r.curveNumber=p.index;var s=h.cx,m=h.cy,g=n.select(this),v=g.selectAll("path.surface").data([r]);v.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),g.call(d,t,e);var _="M"+(s+r.TR[0])+","+(m+r.TR[1])+y(r.TR,r.BR)+y(r.BR,r.BL)+y(r.BL,r.TL)+"Z";v.attr("d",_);var x=c.castOption(p.textposition,r.pts),b=g.selectAll("g.slicetext").data(r.text&&"none"!==x?[0]:[]);b.enter().append("g").classed("slicetext",!0),b.exit().remove(),b.each((function(){var e=i.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)}));e.text(r.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(a.font,f(p,r,t._fullLayout.font)).call(o.convertToTspans,t);var c,h,d,g=a.bBox(e.node()),y=Math.min(r.BL[1],r.BR[1]),v=Math.max(r.TL[1],r.TR[1]);h=Math.max(r.TL[0],r.BL[0]),d=Math.min(r.TR[0],r.BR[0]),c=l(u(h,d,y,v,g,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})),e.attr("transform","translate("+s+","+m+")"+c)}))}}));var m=n.select(this).selectAll("g.titletext").data(p.title.text?[0]:[]);m.enter().append("g").classed("titletext",!0),m.exit().remove(),m.each((function(){var e=i.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),s=p.title.text;p._meta&&(s=i.templateString(s,p._meta)),e.text(s).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(a.font,p.title.font).call(o.convertToTspans,t);var l=g(h,r._size);e.attr("transform","translate("+l.x+","+l.y+")"+(l.scale<1?"scale("+l.scale+")":"")+"translate("+l.tx+","+l.ty+")")}))}))}))}},{"../../components/drawing":614,"../../lib":719,"../../lib/svg_text_utils":743,"../bar/plot":867,"../pie/helpers":1091,"../pie/plot":1095,d3:163}],1e3:[function(t,e,r){var n=t("d3"),a=t("../pie/style_one");e.exports=function(t){t._fullLayout._funnelarealayer.selectAll(".trace").each((function(t){var e=t[0].trace,r=n.select(this);r.style({opacity:e.opacity}),r.selectAll("path.surface").each((function(t){n.select(this).call(a,t,e)}))}))}},{"../pie/style_one":1097,d3:163}],1001:[function(t,e,r){var n=t("../scatter/attributes"),a=t("../../components/fx/hovertemplate_attributes"),i=t("../../components/colorscale/attributes"),o=(t("../../constants/docs").FORMAT_LINK,t("../../lib/extend").extendFlat);e.exports=o({z:{valType:"data_array",editType:"calc"},x:o({},n.x,{impliedEdits:{xtype:"array"}}),x0:o({},n.x0,{impliedEdits:{xtype:"scaled"}}),dx:o({},n.dx,{impliedEdits:{xtype:"scaled"}}),y:o({},n.y,{impliedEdits:{ytype:"array"}}),y0:o({},n.y0,{impliedEdits:{ytype:"scaled"}}),dy:o({},n.dy,{impliedEdits:{ytype:"scaled"}}),text:{valType:"data_array",editType:"calc"},hovertext:{valType:"data_array",editType:"calc"},transpose:{valType:"boolean",dflt:!1,editType:"calc"},xtype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},ytype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1,editType:"calc"},connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},xgap:{valType:"number",dflt:0,min:0,editType:"plot"},ygap:{valType:"number",dflt:0,min:0,editType:"plot"},zhoverformat:{valType:"string",dflt:"",editType:"none"},hovertemplate:a()},{transforms:void 0},i("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":600,"../../components/fx/hovertemplate_attributes":631,"../../constants/docs":690,"../../lib/extend":710,"../scatter/attributes":1112}],1002:[function(t,e,r){var n=t("../../registry"),a=t("../../lib"),i=t("../../plots/cartesian/axes"),o=t("../histogram2d/calc"),s=t("../../components/colorscale/calc"),l=t("./convert_column_xyz"),u=t("./clean_2d_array"),c=t("./interp2d"),h=t("./find_empties"),d=t("./make_bound_array");e.exports=function(t,e){var r,f,p,m,g,y,v,_,x,b=i.getFromId(t,e.xaxis||"x"),w=i.getFromId(t,e.yaxis||"y"),M=n.traceIs(e,"contour"),k=n.traceIs(e,"histogram"),T=n.traceIs(e,"gl2d"),L=M?"best":e.zsmooth;if(b._minDtick=0,w._minDtick=0,k)r=(x=o(t,e)).x,f=x.x0,p=x.dx,m=x.y,g=x.y0,y=x.dy,v=x.z;else{var A=e.z;a.isArray1D(A)?(l(e,b,w,"x","y",["z"]),r=e._x,m=e._y,A=e._z):(r=e._x=e.x?b.makeCalcdata(e,"x"):[],m=e._y=e.y?w.makeCalcdata(e,"y"):[]),f=e.x0,p=e.dx,g=e.y0,y=e.dy,v=u(A,e,b,w),(M||e.connectgaps)&&(e._emptypoints=h(v),c(v,e._emptypoints))}function S(t){L=e._input.zsmooth=e.zsmooth=!1,a.warn('cannot use zsmooth: "fast": '+t)}if("fast"===L)if("log"===b.type||"log"===w.type)S("log axis found");else if(!k){if(r.length){var E=(r[r.length-1]-r[0])/(r.length-1),C=Math.abs(E/100);for(_=0;_<r.length-1;_++)if(Math.abs(r[_+1]-r[_]-E)>C){S("x scale is not linear");break}}if(m.length&&"fast"===L){var D=(m[m.length-1]-m[0])/(m.length-1),P=Math.abs(D/100);for(_=0;_<m.length-1;_++)if(Math.abs(m[_+1]-m[_]-D)>P){S("y scale is not linear");break}}}var O=a.maxRowLength(v),z="scaled"===e.xtype?"":r,I=d(e,z,f,p,O,b),R="scaled"===e.ytype?"":m,F=d(e,R,g,y,v.length,w);T||(e._extremes[b._id]=i.findExtremes(b,I),e._extremes[w._id]=i.findExtremes(w,F));var N={x:I,y:F,z:v,text:e._text||e.text,hovertext:e._hovertext||e.hovertext};if(z&&z.length===I.length-1&&(N.xCenter=z),R&&R.length===F.length-1&&(N.yCenter=R),k&&(N.xRanges=x.xRanges,N.yRanges=x.yRanges,N.pts=x.pts),M||s(t,e,{vals:v,cLetter:"z"}),M&&e.contours&&"heatmap"===e.contours.coloring){var Y={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};N.xfill=d(Y,z,f,p,O,b),N.yfill=d(Y,R,g,y,v.length,w)}return[N]}},{"../../components/colorscale/calc":601,"../../lib":719,"../../plots/cartesian/axes":767,"../../registry":847,"../histogram2d/calc":1033,"./clean_2d_array":1003,"./convert_column_xyz":1005,"./find_empties":1007,"./interp2d":1010,"./make_bound_array":1011}],1003:[function(t,e,r){var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r,o){var s,l,u,c,h,d;function f(t){if(n(t))return+t}if(e&&e.transpose){for(s=0,h=0;h<t.length;h++)s=Math.max(s,t[h].length);if(0===s)return!1;u=function(t){return t.length},c=function(t,e,r){return(t[r]||[])[e]}}else s=t.length,u=function(t,e){return t[e].length},c=function(t,e,r){return(t[e]||[])[r]};var p=function(t,e,r){return e===i||r===i?i:c(t,e,r)};function m(t){if(e&&"carpet"!==e.type&&"contourcarpet"!==e.type&&t&&"category"===t.type&&e["_"+t._id.charAt(0)].length){var r=t._id.charAt(0),n={},o=e["_"+r+"CategoryMap"]||e[r];for(h=0;h<o.length;h++)n[o[h]]=h;return function(e){var r=n[t._categories[e]];return r+1?r:i}}return a.identity}var g=m(r),y=m(o);o&&"category"===o.type&&(s=o._categories.length);var v=new Array(s);for(h=0;h<s;h++)for(l=r&&"category"===r.type?r._categories.length:u(t,h),v[h]=new Array(l),d=0;d<l;d++)v[h][d]=f(p(t,y(h),g(d)));return v}},{"../../constants/numerical":695,"../../lib":719,"fast-isnumeric":225}],1004:[function(t,e,r){e.exports={min:"zmin",max:"zmax"}},{}],1005:[function(t,e,r){var n=t("../../lib"),a=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r,i,o,s){var l,u,c,h,d=t._length,f=e.makeCalcdata(t,i),p=r.makeCalcdata(t,o),m=t.text,g=void 0!==m&&n.isArray1D(m),y=t.hovertext,v=void 0!==y&&n.isArray1D(y),_=n.distinctVals(f),x=_.vals,b=n.distinctVals(p),w=b.vals,M=[];for(l=0;l<s.length;l++)M[l]=n.init2dArray(w.length,x.length);for(g&&(c=n.init2dArray(w.length,x.length)),v&&(h=n.init2dArray(w.length,x.length)),l=0;l<d;l++)if(f[l]!==a&&p[l]!==a){var k=n.findBin(f[l]+_.minDiff/2,x),T=n.findBin(p[l]+b.minDiff/2,w);for(u=0;u<s.length;u++){var L=t[s[u]];M[u][T][k]=L[l]}g&&(c[T][k]=m[l]),v&&(h[T][k]=y[l])}for(t["_"+i]=x,t["_"+o]=w,u=0;u<s.length;u++)t["_"+s[u]]=M[u];g&&(t._text=c),v&&(t._hovertext=h),e&&"category"===e.type&&(t["_"+i+"CategoryMap"]=x.map((function(t){return e._categories[t]}))),r&&"category"===r.type&&(t["_"+o+"CategoryMap"]=w.map((function(t){return r._categories[t]})))}},{"../../constants/numerical":695,"../../lib":719}],1006:[function(t,e,r){var n=t("../../lib"),a=t("./xyz_defaults"),i=t("./style_defaults"),o=t("../../components/colorscale/defaults"),s=t("./attributes");e.exports=function(t,e,r,l){function u(r,a){return n.coerce(t,e,s,r,a)}a(t,e,u,l)?(u("text"),u("hovertext"),u("hovertemplate"),i(t,e,u,l),u("connectgaps",n.isArray1D(e.z)&&!1!==e.zsmooth),o(t,e,l,u,{prefix:"",cLetter:"z"})):e.visible=!1}},{"../../components/colorscale/defaults":603,"../../lib":719,"./attributes":1001,"./style_defaults":1014,"./xyz_defaults":1015}],1007:[function(t,e,r){var n=t("../../lib").maxRowLength;e.exports=function(t){var e,r,a,i,o,s,l,u,c=[],h={},d=[],f=t[0],p=[],m=[0,0,0],g=n(t);for(r=0;r<t.length;r++)for(e=p,p=f,f=t[r+1]||[],a=0;a<g;a++)void 0===p[a]&&((s=(void 0!==p[a-1]?1:0)+(void 0!==p[a+1]?1:0)+(void 0!==e[a]?1:0)+(void 0!==f[a]?1:0))?(0===r&&s++,0===a&&s++,r===t.length-1&&s++,a===p.length-1&&s++,s<4&&(h[[r,a]]=[r,a,s]),c.push([r,a,s])):d.push([r,a]));for(;d.length;){for(l={},u=!1,o=d.length-1;o>=0;o--)(s=((h[[(r=(i=d[o])[0])-1,a=i[1]]]||m)[2]+(h[[r+1,a]]||m)[2]+(h[[r,a-1]]||m)[2]+(h[[r,a+1]]||m)[2])/20)&&(l[i]=[r,a,s],d.splice(o,1),u=!0);if(!u)throw"findEmpties iterated with no new neighbors";for(i in l)h[i]=l[i],c.push(l[i])}return c.sort((function(t,e){return e[2]-t[2]}))}},{"../../lib":719}],1008:[function(t,e,r){var n=t("../../components/fx"),a=t("../../lib"),i=t("../../plots/cartesian/axes"),o=t("../../components/colorscale").extractOpts;e.exports=function(t,e,r,s,l,u){var c,h,d,f,p=t.cd[0],m=p.trace,g=t.xa,y=t.ya,v=p.x,_=p.y,x=p.z,b=p.xCenter,w=p.yCenter,M=p.zmask,k=m.zhoverformat,T=v,L=_;if(!1!==t.index){try{d=Math.round(t.index[1]),f=Math.round(t.index[0])}catch(e){return void a.error("Error hovering on heatmap, pointNumber must be [row,col], found:",t.index)}if(d<0||d>=x[0].length||f<0||f>x.length)return}else{if(n.inbox(e-v[0],e-v[v.length-1],0)>0||n.inbox(r-_[0],r-_[_.length-1],0)>0)return;if(u){var A;for(T=[2*v[0]-v[1]],A=1;A<v.length;A++)T.push((v[A]+v[A-1])/2);for(T.push([2*v[v.length-1]-v[v.length-2]]),L=[2*_[0]-_[1]],A=1;A<_.length;A++)L.push((_[A]+_[A-1])/2);L.push([2*_[_.length-1]-_[_.length-2]])}d=Math.max(0,Math.min(T.length-2,a.findBin(e,T))),f=Math.max(0,Math.min(L.length-2,a.findBin(r,L)))}var S=g.c2p(v[d]),E=g.c2p(v[d+1]),C=y.c2p(_[f]),D=y.c2p(_[f+1]);u?(E=S,c=v[d],D=C,h=_[f]):(c=b?b[d]:(v[d]+v[d+1])/2,h=w?w[f]:(_[f]+_[f+1])/2,g&&"category"===g.type&&(c=v[d]),y&&"category"===y.type&&(h=_[f]),m.zsmooth&&(S=E=g.c2p(c),C=D=y.c2p(h)));var P,O=x[f][d];M&&!M[f][d]&&(O=void 0),Array.isArray(p.hovertext)&&Array.isArray(p.hovertext[f])?P=p.hovertext[f][d]:Array.isArray(p.text)&&Array.isArray(p.text[f])&&(P=p.text[f][d]);var z=o(m),I={type:"linear",range:[z.min,z.max],hoverformat:k,_separators:g._separators,_numFormat:g._numFormat},R=i.tickText(I,O,"hover").text;return[a.extendFlat(t,{index:[f,d],distance:t.maxHoverDistance,spikeDistance:t.maxSpikeDistance,x0:S,x1:E,y0:C,y1:D,xLabelVal:c,yLabelVal:h,zLabelVal:O,zLabel:R,text:P})]}},{"../../components/colorscale":605,"../../components/fx":632,"../../lib":719,"../../plots/cartesian/axes":767}],1009:[function(t,e,r){e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),colorbar:t("./colorbar"),style:t("./style"),hoverPoints:t("./hover"),moduleType:"trace",name:"heatmap",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","2dMap"],meta:{}}},{"../../plots/cartesian":778,"./attributes":1001,"./calc":1002,"./colorbar":1004,"./defaults":1006,"./hover":1008,"./plot":1012,"./style":1013}],1010:[function(t,e,r){var n=t("../../lib"),a=[[-1,0],[1,0],[0,-1],[0,1]];function i(t){return.5-.25*Math.min(1,.5*t)}function o(t,e,r){var n,i,o,s,l,u,c,h,d,f,p,m,g,y=0;for(s=0;s<e.length;s++){for(i=(n=e[s])[0],o=n[1],p=t[i][o],f=0,d=0,l=0;l<4;l++)(c=t[i+(u=a[l])[0]])&&void 0!==(h=c[o+u[1]])&&(0===f?m=g=h:(m=Math.min(m,h),g=Math.max(g,h)),d++,f+=h);if(0===d)throw"iterateInterp2d order is wrong: no defined neighbors";t[i][o]=f/d,void 0===p?d<4&&(y=1):(t[i][o]=(1+r)*t[i][o]-r*p,g>m&&(y=Math.max(y,Math.abs(t[i][o]-p)/(g-m))))}return y}e.exports=function(t,e){var r,a=1;for(o(t,e),r=0;r<e.length&&!(e[r][2]<4);r++);for(e=e.slice(r),r=0;r<100&&a>.01;r++)a=o(t,e,i(a));return a>.01&&n.log("interp2d didn't converge quickly",a),t}},{"../../lib":719}],1011:[function(t,e,r){var n=t("../../registry"),a=t("../../lib").isArrayOrTypedArray;e.exports=function(t,e,r,i,o,s){var l,u,c,h=[],d=n.traceIs(t,"contour"),f=n.traceIs(t,"histogram"),p=n.traceIs(t,"gl2d");if(a(e)&&e.length>1&&!f&&"category"!==s.type){var m=e.length;if(!(m<=o))return d?e.slice(0,o):e.slice(0,o+1);if(d||p)h=e.slice(0,o);else if(1===o)h=[e[0]-.5,e[0]+.5];else{for(h=[1.5*e[0]-.5*e[1]],c=1;c<m;c++)h.push(.5*(e[c-1]+e[c]));h.push(1.5*e[m-1]-.5*e[m-2])}if(m<o){var g=h[h.length-1],y=g-h[h.length-2];for(c=m;c<o;c++)g+=y,h.push(g)}}else{var v=t[s._id.charAt(0)+"calendar"];for(l=f?s.r2c(r,0,v):a(e)&&1===e.length?e[0]:void 0===r?0:("log"===s.type?s.d2c:s.r2c)(r,0,v),u=i||1,c=d||p?0:-.5;c<o;c++)h.push(l+u*c)}return h}},{"../../lib":719,"../../registry":847}],1012:[function(t,e,r){var n=t("d3"),a=t("tinycolor2"),i=t("../../registry"),o=t("../../lib"),s=t("../../components/colorscale").makeColorScaleFuncFromTrace,l=t("../../constants/xmlns_namespaces");function u(t,e){var r=e.length-2,n=o.constrain(o.findBin(t,e),0,r),a=e[n],i=e[n+1],s=o.constrain(n+(t-a)/(i-a)-.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){var r=e.length-1,n=o.constrain(o.findBin(t,e),0,r),a=e[n],i=(t-a)/(e[n+1]-a)||0;return i<=0?{bin0:n,bin1:n,frac:0}:i<.5?{bin0:n,bin1:n+1,frac:i}:{bin0:n+1,bin1:n,frac:1-i}}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])}e.exports=function(t,e,r,d){var f=e.xaxis,p=e.yaxis;o.makeTraceGroups(d,r,"hm").each((function(e){var r,d,m,g,y,v,_=n.select(this),x=e[0],b=x.trace,w=x.z,M=x.x,k=x.y,T=x.xCenter,L=x.yCenter,A=i.traceIs(b,"contour"),S=A?"best":b.zsmooth,E=w.length,C=o.maxRowLength(w),D=!1,P=!1;for(v=0;void 0===r&&v<M.length-1;)r=f.c2p(M[v]),v++;for(v=M.length-1;void 0===d&&v>0;)d=f.c2p(M[v]),v--;for(d<r&&(m=d,d=r,r=m,D=!0),v=0;void 0===g&&v<k.length-1;)g=p.c2p(k[v]),v++;for(v=k.length-1;void 0===y&&v>0;)y=p.c2p(k[v]),v--;if(y<g&&(m=g,g=y,y=m,P=!0),A&&(T=M,L=k,M=x.xfill,k=x.yfill),"fast"!==S){var O="best"===S?0:.5;r=Math.max(-O*f._length,r),d=Math.min((1+O)*f._length,d),g=Math.max(-O*p._length,g),y=Math.min((1+O)*p._length,y)}var z=Math.round(d-r),I=Math.round(y-g);if(z<=0||I<=0)_.selectAll("image").data([]).exit().remove();else{var R,F;"fast"===S?(R=C,F=E):(R=z,F=I);var N=document.createElement("canvas");N.width=R,N.height=F;var Y,j,B=N.getContext("2d"),H=s(b,{noNumericCheck:!0,returnArray:!0});"fast"===S?(Y=D?function(t){return C-1-t}:o.identity,j=P?function(t){return E-1-t}:o.identity):(Y=function(t){return o.constrain(Math.round(f.c2p(M[t])-r),0,z)},j=function(t){return o.constrain(Math.round(p.c2p(k[t])-g),0,I)});var U,V,W,G,q,Z=j(0),X=[Z,Z],J=D?0:1,K=P?0:1,$=0,Q=0,tt=0,et=0;if(S){var rt,nt=0;try{rt=new Uint8Array(z*I*4)}catch(t){rt=new Array(z*I*4)}if("best"===S){var at,it,ot,st=T||M,lt=L||k,ut=new Array(st.length),ct=new Array(lt.length),ht=new Array(z),dt=T?c:u,ft=L?c:u;for(v=0;v<st.length;v++)ut[v]=Math.round(f.c2p(st[v])-r);for(v=0;v<lt.length;v++)ct[v]=Math.round(p.c2p(lt[v])-g);for(v=0;v<z;v++)ht[v]=dt(v,ut);for(V=0;V<I;V++)for(it=w[(at=ft(V,ct)).bin0],ot=w[at.bin1],v=0;v<z;v++,nt+=4)h(rt,nt,q=kt(it,ot,ht[v],at))}else for(V=0;V<E;V++)for(G=w[V],X=j(V),v=0;v<z;v++)q=Mt(G[v],1),h(rt,nt=4*(X*z+Y(v)),q);var pt=B.createImageData(z,I);try{pt.data.set(rt)}catch(t){var mt=pt.data,gt=mt.length;for(V=0;V<gt;V++)mt[V]=rt[V]}B.putImageData(pt,0,0)}else{var yt=b.xgap,vt=b.ygap,_t=Math.floor(yt/2),xt=Math.floor(vt/2);for(V=0;V<E;V++)if(G=w[V],X.reverse(),X[K]=j(V+1),X[0]!==X[1]&&void 0!==X[0]&&void 0!==X[1])for(U=[W=Y(0),W],v=0;v<C;v++)U.reverse(),U[J]=Y(v+1),U[0]!==U[1]&&void 0!==U[0]&&void 0!==U[1]&&(q=Mt(G[v],(U[1]-U[0])*(X[1]-X[0])),B.fillStyle="rgba("+q.join(",")+")",B.fillRect(U[0]+_t,X[0]+xt,U[1]-U[0]-yt,X[1]-X[0]-vt))}Q=Math.round(Q/$),tt=Math.round(tt/$),et=Math.round(et/$);var bt=a("rgb("+Q+","+tt+","+et+")");t._hmpixcount=(t._hmpixcount||0)+$,t._hmlumcount=(t._hmlumcount||0)+$*bt.getLuminance();var wt=_.selectAll("image").data(e);wt.enter().append("svg:image").attr({xmlns:l.svg,preserveAspectRatio:"none"}),wt.attr({height:I,width:z,x:r,y:g,"xlink:href":N.toDataURL("image/png")})}function Mt(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]),$+=e,Q+=r[0]*e,tt+=r[1]*e,et+=r[2]*e,r}return[0,0,0,0]}function kt(t,e,r,n){var a=t[r.bin0];if(void 0===a)return Mt(void 0,1);var i,o=t[r.bin1],s=e[r.bin0],l=e[r.bin1],u=o-a||0,c=s-a||0;return i=void 0===o?void 0===l?0:void 0===s?2*(l-a):2*(2*l-s-a)/3:void 0===l?void 0===s?0:2*(2*a-o-s)/3:void 0===s?2*(2*l-o-a)/3:l+a-o-s,Mt(a+r.frac*u+n.frac*(c+r.frac*i))}}))}},{"../../components/colorscale":605,"../../constants/xmlns_namespaces":696,"../../lib":719,"../../registry":847,d3:163,tinycolor2:537}],1013:[function(t,e,r){var n=t("d3");e.exports=function(t){n.select(t).selectAll(".hm image").style("opacity",(function(t){return t.trace.opacity}))}},{d3:163}],1014:[function(t,e,r){e.exports=function(t,e,r){!1===r("zsmooth")&&(r("xgap"),r("ygap")),r("zhoverformat")}},{}],1015:[function(t,e,r){var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../registry");function o(t,e){var r=e(t);return"scaled"===(r?e(t+"type","array"):"scaled")&&(e(t+"0"),e("d"+t)),r}e.exports=function(t,e,r,s,l,u){var c,h,d=r("z");if(l=l||"x",u=u||"y",void 0===d||!d.length)return 0;if(a.isArray1D(t.z)){c=r(l),h=r(u);var f=a.minRowLength(c),p=a.minRowLength(h);if(0===f||0===p)return 0;e._length=Math.min(f,p,d.length)}else{if(c=o(l,r),h=o(u,r),!function(t){for(var e,r=!0,i=!1,o=!1,s=0;s<t.length;s++){if(e=t[s],!a.isArrayOrTypedArray(e)){r=!1;break}e.length>0&&(i=!0);for(var l=0;l<e.length;l++)if(n(e[l])){o=!0;break}}return r&&i&&o}(d))return 0;r("transpose"),e._length=null}return i.getComponentMethod("calendars","handleTraceDefaults")(t,e,[l,u],s),!0}},{"../../lib":719,"../../registry":847,"fast-isnumeric":225}],1016:[function(t,e,r){for(var n=t("../heatmap/attributes"),a=t("../../components/colorscale/attributes"),i=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,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]}i(l,a("",{cLetter:"z",autoColorDflt:!1})),e.exports=o(l,"calc","nested")},{"../../components/colorscale/attributes":600,"../../lib/extend":710,"../../plot_api/edit_types":750,"../heatmap/attributes":1001}],1017:[function(t,e,r){var n=t("gl-heatmap2d"),a=t("../../plots/cartesian/axes"),i=t("../../lib/str2rgbarray");function o(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=n(t.glplot,this.options),this.heatmap._trace=this}var s=o.prototype;s.handlePick=function(t){var e=this.options,r=e.shape,n=t.pointId,a=n%r[0],i=Math.floor(n/r[0]),o=n;return{trace:this,dataCoord:t.dataCoord,traceCoord:[e.x[a],e.y[i],e.z[o]],textLabel:this.textLabels[n],name:this.name,pointIndex:[i,a],hoverinfo:this.hoverinfo}},s.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 o=n[0].length,s=n.length;this.options.shape=[o,s],this.options.x=r.x,this.options.y=r.y;var l=function(t){for(var e=t.colorscale,r=t.zmin,n=t.zmax,a=e.length,o=new Array(a),s=new Array(4*a),l=0;l<a;l++){var u=e[l],c=i(u[1]);o[l]=r+u[0]*(n-r);for(var h=0;h<4;h++)s[4*l+h]=c[h]}return{colorLevels:o,colorValues:s}}(t);this.options.colorLevels=l.colorLevels,this.options.colorValues=l.colorValues,this.textLabels=[].concat.apply([],t.text),this.heatmap.update(this.options);var u=this.scene.xaxis,c=this.scene.yaxis;t._extremes[u._id]=a.findExtremes(u,r.x),t._extremes[c._id]=a.findExtremes(c,r.y)},s.dispose=function(){this.heatmap.dispose()},e.exports=function(t,e,r){var n=new o(t,e.uid);return n.update(e,r),n}},{"../../lib/str2rgbarray":742,"../../plots/cartesian/axes":767,"gl-heatmap2d":251}],1018:[function(t,e,r){e.exports={attributes:t("./attributes"),supplyDefaults:t("../heatmap/defaults"),colorbar:t("../heatmap/colorbar"),calc:t("../heatmap/calc"),plot:t("./convert"),moduleType:"trace",name:"heatmapgl",basePlotModule:t("../../plots/gl2d"),categories:["gl","gl2d","2dMap"],meta:{}}},{"../../plots/gl2d":805,"../heatmap/calc":1002,"../heatmap/colorbar":1004,"../heatmap/defaults":1006,"./attributes":1016,"./convert":1017}],1019:[function(t,e,r){var n=t("../bar/attributes"),a=t("../../components/fx/hovertemplate_attributes"),i=t("./bin_attributes"),o=t("./constants"),s=t("../../lib/extend").extendFlat;e.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},text:s({},n.text,{}),hovertext:s({},n.hovertext,{}),orientation:n.orientation,histfunc:{valType:"enumerated",values:["count","sum","avg","min","max"],dflt:"count",editType:"calc"},histnorm:{valType:"enumerated",values:["","percent","probability","density","probability density"],dflt:"",editType:"calc"},cumulative:{enabled:{valType:"boolean",dflt:!1,editType:"calc"},direction:{valType:"enumerated",values:["increasing","decreasing"],dflt:"increasing",editType:"calc"},currentbin:{valType:"enumerated",values:["include","exclude","half"],dflt:"include",editType:"calc"},editType:"calc"},nbinsx:{valType:"integer",min:0,dflt:0,editType:"calc"},xbins:i("x",!0),nbinsy:{valType:"integer",min:0,dflt:0,editType:"calc"},ybins:i("y",!0),autobinx:{valType:"boolean",dflt:null,editType:"calc"},autobiny:{valType:"boolean",dflt:null,editType:"calc"},bingroup:{valType:"string",dflt:"",editType:"calc"},hovertemplate:a({},{keys:o.eventDataKeys}),marker:n.marker,offsetgroup:n.offsetgroup,alignmentgroup:n.alignmentgroup,selected:n.selected,unselected:n.unselected,_deprecated:{bardir:n._deprecated.bardir}}},{"../../components/fx/hovertemplate_attributes":631,"../../lib/extend":710,"../bar/attributes":857,"./bin_attributes":1021,"./constants":1025}],1020:[function(t,e,r){e.exports=function(t,e){for(var r=t.length,n=0,a=0;a<r;a++)e[a]?(t[a]/=e[a],n+=t[a]):t[a]=null;return n}},{}],1021:[function(t,e,r){e.exports=function(t,e){return{start:{valType:"any",editType:"calc"},end:{valType:"any",editType:"calc"},size:{valType:"any",editType:"calc"},editType:"calc"}}},{}],1022:[function(t,e,r){var n=t("fast-isnumeric");e.exports={count:function(t,e,r){return r[t]++,1},sum:function(t,e,r,a){var i=a[e];return n(i)?(i=Number(i),r[t]+=i,i):0},avg:function(t,e,r,a,i){var o=a[e];return n(o)&&(o=Number(o),r[t]+=o,i[t]++),0},min:function(t,e,r,a){var i=a[e];if(n(i)){if(i=Number(i),!n(r[t]))return r[t]=i,i;if(r[t]>i){var o=i-r[t];return r[t]=i,o}}return 0},max:function(t,e,r,a){var i=a[e];if(n(i)){if(i=Number(i),!n(r[t]))return r[t]=i,i;if(r[t]<i){var o=i-r[t];return r[t]=i,o}}return 0}}},{"fast-isnumeric":225}],1023:[function(t,e,r){var n=t("../../constants/numerical"),a=n.ONEAVGYEAR,i=n.ONEAVGMONTH,o=n.ONEDAY,s=n.ONEHOUR,l=n.ONEMIN,u=n.ONESEC,c=t("../../plots/cartesian/axes").tickIncrement;function h(t,e,r,n){if(t*e<=0)return 1/0;for(var a=Math.abs(e-t),i="date"===r.type,o=d(a,i),s=0;s<10;s++){var l=d(80*o,i);if(o===l)break;if(!f(l,t,e,i,r,n))break;o=l}return o}function d(t,e){return e&&t>u?t>o?t>1.1*a?a:t>1.1*i?i:o:t>s?s:t>l?l:u:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function f(t,e,r,n,i,s){if(n&&t>o){var l=p(e,i,s),u=p(r,i,s),c=t===a?0:1;return l[c]!==u[c]}return Math.floor(r/t)-Math.floor(e/t)>.1}function p(t,e,r){var n=e.c2d(t,a,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}e.exports=function(t,e,r,n,i){var s,l,u=-1.1*e,d=-.1*e,f=t-d,p=r[0],m=r[1],g=Math.min(h(p+d,p+f,n,i),h(m+d,m+f,n,i)),y=Math.min(h(p+u,p+d,n,i),h(m+u,m+d,n,i));if(g>y&&y<Math.abs(m-p)/4e3?(s=g,l=!1):(s=Math.min(g,y),l=!0),"date"===n.type&&s>o){var v=s===a?1:6,_=s===a?"M12":"M1";return function(e,r){var o=n.c2d(e,a,i),s=o.indexOf("-",v);s>0&&(o=o.substr(0,s));var u=n.d2c(o,0,i);if(u<e){var h=c(u,_,!1,i);(u+h)/2<e+t&&(u=h)}return r&&l?c(u,_,!0,i):u}}return function(e,r){var n=s*Math.round(e/s);return n+s/10<e&&n+.9*s<e+t&&(n+=s),r&&l&&(n-=s),n}}},{"../../constants/numerical":695,"../../plots/cartesian/axes":767}],1024:[function(t,e,r){var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../registry"),o=t("../../plots/cartesian/axes"),s=t("../bar/arrays_to_calcdata"),l=t("./bin_functions"),u=t("./norm_functions"),c=t("./average"),h=t("./bin_label_vals");function d(t,e,r,s,l){var u,c,h,f,p,m,g,y=s+"bins",v=t._fullLayout,_=e["_"+s+"bingroup"],x=v._histogramBinOpts[_],b="overlay"===v.barmode,w=function(t){return r.r2c(t,0,f)},M=function(t){return r.c2r(t,0,f)},k="date"===r.type?function(t){return t||0===t?a.cleanDate(t,null,f):null}:function(t){return n(t)?Number(t):null};function T(t,e,r){e[t+"Found"]?(e[t]=k(e[t]),null===e[t]&&(e[t]=r[t])):(m[t]=e[t]=r[t],a.nestedProperty(c[0],y+"."+t).set(r[t]))}if(e["_"+s+"autoBinFinished"])delete e["_"+s+"autoBinFinished"];else{c=x.traces;var L=[],A=!0,S=!1,E=!1;for(u=0;u<c.length;u++)if((h=c[u]).visible){var C=x.dirs[u];p=h["_"+C+"pos0"]=r.makeCalcdata(h,C),L=a.concat(L,p),delete h["_"+s+"autoBinFinished"],!0===e.visible&&(A?A=!1:(delete h._autoBin,h["_"+s+"autoBinFinished"]=1),i.traceIs(h,"2dMap")&&(S=!0),"histogram2dcontour"===h.type&&(E=!0))}f=c[0][s+"calendar"];var D=o.autoBin(L,r,x.nbins,S,f,x.sizeFound&&x.size),P=c[0]._autoBin={};if(m=P[x.dirs[0]]={},E&&(x.size||(D.start=M(o.tickIncrement(w(D.start),D.size,!0,f))),void 0===x.end&&(D.end=M(o.tickIncrement(w(D.end),D.size,!1,f)))),b&&!i.traceIs(e,"2dMap")&&0===D._dataSpan&&"category"!==r.type&&"multicategory"!==r.type){if(l)return[D,p,!0];D=function(t,e,r,n,i){var o,s,l,u=t._fullLayout,c=function(t,e){for(var r=e.xaxis,n=e.yaxis,a=e.orientation,i=[],o=t._fullData,s=0;s<o.length;s++){var l=o[s];"histogram"===l.type&&!0===l.visible&&l.orientation===a&&l.xaxis===r&&l.yaxis===n&&i.push(l)}return i}(t,e),h=!1,f=1/0,p=[e];for(o=0;o<c.length;o++)if((s=c[o])===e)h=!0;else if(h){var m=d(t,s,r,n,!0),g=m[0],y=m[2];s["_"+n+"autoBinFinished"]=1,s["_"+n+"pos0"]=m[1],y?p.push(s):f=Math.min(f,g.size)}else l=u._histogramBinOpts[s["_"+n+"bingroup"]],f=Math.min(f,l.size||s[i].size);var v=new Array(p.length);for(o=0;o<p.length;o++)for(var _=p[o]["_"+n+"pos0"],x=0;x<_.length;x++)if(void 0!==_[x]){v[o]=_[x];break}for(isFinite(f)||(f=a.distinctVals(v).minDiff),o=0;o<p.length;o++){var b=(s=p[o])[n+"calendar"],w={start:r.c2r(v[o]-f/2,0,b),end:r.c2r(v[o]+f/2,0,b),size:f};s._input[i]=s[i]=w,(l=u._histogramBinOpts[s["_"+n+"bingroup"]])&&a.extendFlat(l,w)}return e[i]}(t,e,r,s,y)}(g=h.cumulative||{}).enabled&&"include"!==g.currentbin&&("decreasing"===g.direction?D.start=M(o.tickIncrement(w(D.start),D.size,!0,f)):D.end=M(o.tickIncrement(w(D.end),D.size,!1,f))),x.size=D.size,x.sizeFound||(m.size=D.size,a.nestedProperty(c[0],y+".size").set(D.size)),T("start",x,D),T("end",x,D)}p=e["_"+s+"pos0"],delete e["_"+s+"pos0"];var O=e._input[y]||{},z=a.extendFlat({},x),I=x.start,R=r.r2l(O.start),F=void 0!==R;if((x.startFound||F)&&R!==r.r2l(I)){var N=F?R:a.aggNums(Math.min,null,p),Y={type:"category"===r.type||"multicategory"===r.type?"linear":r.type,r2l:r.r2l,dtick:x.size,tick0:I,calendar:f,range:[N,o.tickIncrement(N,x.size,!1,f)].map(r.l2r)},j=o.tickFirst(Y);j>r.r2l(N)&&(j=o.tickIncrement(j,x.size,!0,f)),z.start=r.l2r(j),F||a.nestedProperty(e,y+".start").set(z.start)}var B=x.end,H=r.r2l(O.end),U=void 0!==H;if((x.endFound||U)&&H!==r.r2l(B)){var V=U?H:a.aggNums(Math.max,null,p);z.end=r.l2r(V),U||a.nestedProperty(e,y+".start").set(z.end)}var W="autobin"+s;return!1===e._input[W]&&(e._input[y]=a.extendFlat({},e[y]||{}),delete e._input[W],delete e[W]),[z,p]}e.exports={calc:function(t,e){var r,i,f,p,m=[],g=[],y=o.getFromId(t,"h"===e.orientation?e.yaxis:e.xaxis),v="h"===e.orientation?"y":"x",_={x:"y",y:"x"}[v],x=e[v+"calendar"],b=e.cumulative,w=d(t,e,y,v),M=w[0],k=w[1],T="string"==typeof M.size,L=[],A=T?L:M,S=[],E=[],C=[],D=0,P=e.histnorm,O=e.histfunc,z=-1!==P.indexOf("density");b.enabled&&z&&(P=P.replace(/ ?density$/,""),z=!1);var I,R="max"===O||"min"===O?null:0,F=l.count,N=u[P],Y=!1,j=function(t){return y.r2c(t,0,x)};for(a.isArrayOrTypedArray(e[_])&&"count"!==O&&(I=e[_],Y="avg"===O,F=l[O]),r=j(M.start),f=j(M.end)+(r-o.tickIncrement(r,M.size,!1,x))/1e6;r<f&&m.length<1e6&&(i=o.tickIncrement(r,M.size,!1,x),m.push((r+i)/2),g.push(R),C.push([]),L.push(r),z&&S.push(1/(i-r)),Y&&E.push(0),!(i<=r));)r=i;L.push(r),T||"date"!==y.type||(A={start:j(A.start),end:j(A.end),size:A.size});var B,H=g.length,U=!0,V=1/0,W=1/0,G={};for(r=0;r<k.length;r++){var q=k[r];(p=a.findBin(q,A))>=0&&p<H&&(D+=F(p,r,g,I,E),U&&C[p].length&&q!==k[C[p][0]]&&(U=!1),C[p].push(r),G[r]=p,V=Math.min(V,q-L[p]),W=Math.min(W,L[p+1]-q))}U||(B=h(V,W,L,y,x)),Y&&(D=c(g,E)),N&&N(g,D,S),b.enabled&&function(t,e,r){var n,a,i;function o(e){i=t[e],t[e]/=2}function s(e){a=t[e],t[e]=i+a/2,i+=a}if("half"===r)if("increasing"===e)for(o(0),n=1;n<t.length;n++)s(n);else for(o(t.length-1),n=t.length-2;n>=0;n--)s(n);else if("increasing"===e){for(n=1;n<t.length;n++)t[n]+=t[n-1];"exclude"===r&&(t.unshift(0),t.pop())}else{for(n=t.length-2;n>=0;n--)t[n]+=t[n+1];"exclude"===r&&(t.push(0),t.shift())}}(g,b.direction,b.currentbin);var Z=Math.min(m.length,g.length),X=[],J=0,K=Z-1;for(r=0;r<Z;r++)if(g[r]){J=r;break}for(r=Z-1;r>=J;r--)if(g[r]){K=r;break}for(r=J;r<=K;r++)if(n(m[r])&&n(g[r])){var $={p:m[r],s:g[r],b:0};b.enabled||($.pts=C[r],U?$.ph0=$.ph1=C[r].length?k[C[r][0]]:m[r]:($.ph0=B(L[r]),$.ph1=B(L[r+1],!0))),X.push($)}return 1===X.length&&(X[0].width1=o.tickIncrement(X[0].p,M.size,!1,x)-X[0].p),s(X,e),a.isArrayOrTypedArray(e.selectedpoints)&&a.tagSelected(X,e,G),X},calcAllAutoBins:d}},{"../../lib":719,"../../plots/cartesian/axes":767,"../../registry":847,"../bar/arrays_to_calcdata":856,"./average":1020,"./bin_functions":1022,"./bin_label_vals":1023,"./norm_functions":1031,"fast-isnumeric":225}],1025:[function(t,e,r){e.exports={eventDataKeys:["binNumber"]}},{}],1026:[function(t,e,r){var n=t("../../lib"),a=t("../../plots/cartesian/axis_ids"),i=t("../../registry").traceIs,o=t("../bar/defaults").handleGroupingDefaults,s=n.nestedProperty,l=a.getAxisGroup,u=[{aStr:{x:"xbins.start",y:"ybins.start"},name:"start"},{aStr:{x:"xbins.end",y:"ybins.end"},name:"end"},{aStr:{x:"xbins.size",y:"ybins.size"},name:"size"},{aStr:{x:"nbinsx",y:"nbinsy"},name:"nbins"}],c=["x","y"];e.exports=function(t,e){var r,h,d,f,p,m,g,y=e._histogramBinOpts={},v=[],_={},x=[];function b(t,e){return n.coerce(r._input,r,r._module.attributes,t,e)}function w(t){return"v"===t.orientation?"x":"y"}function M(t,r,i){var o=t.uid+"__"+i;r||(r=o);var s=function(t,r){return a.getFromTrace({_fullLayout:e},t,r).type}(t,i),l=t[i+"calendar"],u=y[r],c=!0;u&&(s===u.axType&&l===u.calendar?(c=!1,u.traces.push(t),u.dirs.push(i)):(r=o,s!==u.axType&&n.warn(["Attempted to group the bins of trace",t.index,"set on a","type:"+s,"axis","with bins on","type:"+u.axType,"axis."].join(" ")),l!==u.calendar&&n.warn(["Attempted to group the bins of trace",t.index,"set with a",l,"calendar","with bins",u.calendar?"on a "+u.calendar+" calendar":"w/o a set calendar"].join(" ")))),c&&(y[r]={traces:[t],dirs:[i],axType:s,calendar:t[i+"calendar"]||""}),t["_"+i+"bingroup"]=r}for(p=0;p<t.length;p++)r=t[p],i(r,"histogram")&&(v.push(r),delete r._xautoBinFinished,delete r._yautoBinFinished,i(r,"2dMap")||o(r._input,r,e,b));var k=e._alignmentOpts||{};for(p=0;p<v.length;p++){if(r=v[p],d="",!i(r,"2dMap")){if(f=w(r),"group"===e.barmode&&r.alignmentgroup){var T=r[f+"axis"],L=l(e,T)+r.orientation;(k[L]||{})[r.alignmentgroup]&&(d=L)}d||"overlay"===e.barmode||(d=l(e,r.xaxis)+l(e,r.yaxis)+w(r))}d?(_[d]||(_[d]=[]),_[d].push(r)):x.push(r)}for(d in _)if(1!==(h=_[d]).length){var A=!1;for(p=0;p<h.length;p++){r=h[p],A=b("bingroup");break}for(d=A||d,p=0;p<h.length;p++){var S=(r=h[p])._input.bingroup;S&&S!==d&&n.warn(["Trace",r.index,"must match","within bingroup",d+".","Ignoring its bingroup:",S,"setting."].join(" ")),r.bingroup=d,M(r,d,w(r))}}else x.push(h[0]);for(p=0;p<x.length;p++){r=x[p];var E=b("bingroup");if(i(r,"2dMap"))for(g=0;g<2;g++){var C=b((f=c[g])+"bingroup",E?E+"__"+f:null);M(r,C,f)}else M(r,E,w(r))}for(d in y){var D=y[d];for(h=D.traces,m=0;m<u.length;m++){var P,O,z=u[m],I=z.name;if("nbins"!==I||!D.sizeFound){for(p=0;p<h.length;p++){if(r=h[p],f=D.dirs[p],P=z.aStr[f],void 0!==s(r._input,P).get()){D[I]=b(P),D[I+"Found"]=!0;break}(O=(r._autoBin||{})[f]||{})[I]&&s(r,P).set(O[I])}if("start"===I||"end"===I)for(;p<h.length;p++)(r=h[p])["_"+f+"bingroup"]&&b(P,(O=(r._autoBin||{})[f]||{})[I]);"nbins"!==I||D.sizeFound||D.nbinsFound||(r=h[0],D[I]=b(P))}}}}},{"../../lib":719,"../../plots/cartesian/axis_ids":770,"../../registry":847,"../bar/defaults":861}],1027:[function(t,e,r){var n=t("../../registry"),a=t("../../lib"),i=t("../../components/color"),o=t("../bar/style_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=u("x"),h=u("y");u("cumulative.enabled")&&(u("cumulative.direction"),u("cumulative.currentbin")),u("text"),u("hovertext"),u("hovertemplate");var d=u("orientation",h&&!c?"h":"v"),f="v"===d?"x":"y",p="v"===d?"y":"x",m=c&&h?Math.min(a.minRowLength(c)&&a.minRowLength(h)):a.minRowLength(e[f]||[]);if(m){e._length=m,n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],l),e[p]&&u("histfunc"),u("histnorm"),u("autobin"+f),o(t,e,u,r,l),a.coerceSelectionMarkerOpacity(e,u);var g=(e.marker.line||{}).color,y=n.getComponentMethod("errorbars","supplyDefaults");y(t,e,g||i.defaultLine,{axis:"y"}),y(t,e,g||i.defaultLine,{axis:"x",inherit:"y"})}else e.visible=!1}},{"../../components/color":593,"../../lib":719,"../../registry":847,"../bar/style_defaults":871,"./attributes":1019}],1028:[function(t,e,r){e.exports=function(t,e,r,n,a){if(t.x="xVal"in e?e.xVal:e.x,t.y="yVal"in e?e.yVal:e.y,"zLabelVal"in e&&(t.z=e.zLabelVal),e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),!(r.cumulative||{}).enabled){var i,o=Array.isArray(a)?n[0].pts[a[0]][a[1]]:n[a].pts;if(t.pointNumbers=o,t.binNumber=t.pointNumber,delete t.pointNumber,delete t.pointIndex,r._indexToPoints){i=[];for(var s=0;s<o.length;s++)i=i.concat(r._indexToPoints[o[s]])}else i=o;t.pointIndices=i}return t}},{}],1029:[function(t,e,r){var n=t("../bar/hover").hoverPoints,a=t("../../plots/cartesian/axes").hoverLabelText;e.exports=function(t,e,r,i){var o=n(t,e,r,i);if(o){var s=(t=o[0]).cd[t.index],l=t.cd[0].trace;if(!l.cumulative.enabled){var u="h"===l.orientation?"y":"x";t[u+"Label"]=a(t[u+"a"],s.ph0,s.ph1)}return l.hovermplate&&(t.hovertemplate=l.hovertemplate),o}}},{"../../plots/cartesian/axes":767,"../bar/hover":863}],1030:[function(t,e,r){e.exports={attributes:t("./attributes"),layoutAttributes:t("../bar/layout_attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("./cross_trace_defaults"),supplyLayoutDefaults:t("../bar/layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("../bar/cross_trace_calc").crossTraceCalc,plot:t("../bar/plot").plot,layerName:"barlayer",style:t("../bar/style").style,styleOnSelect:t("../bar/style").styleOnSelect,colorbar:t("../scatter/marker_colorbar"),hoverPoints:t("./hover"),selectPoints:t("../bar/select"),eventData:t("./event_data"),moduleType:"trace",name:"histogram",basePlotModule:t("../../plots/cartesian"),categories:["bar-like","cartesian","svg","bar","histogram","oriented","errorBarsOK","showLegend"],meta:{}}},{"../../plots/cartesian":778,"../bar/cross_trace_calc":860,"../bar/layout_attributes":865,"../bar/layout_defaults":866,"../bar/plot":867,"../bar/select":868,"../bar/style":870,"../scatter/marker_colorbar":1129,"./attributes":1019,"./calc":1024,"./cross_trace_defaults":1026,"./defaults":1027,"./event_data":1028,"./hover":1029}],1031:[function(t,e,r){e.exports={percent:function(t,e){for(var r=t.length,n=100/e,a=0;a<r;a++)t[a]*=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 a=t.length;n=n||1;for(var i=0;i<a;i++)t[i]*=r[i]*n},"probability density":function(t,e,r,n){var a=t.length;n&&(e/=n);for(var i=0;i<a;i++)t[i]*=r[i]/e}}},{}],1032:[function(t,e,r){var n=t("../histogram/attributes"),a=t("../histogram/bin_attributes"),i=t("../heatmap/attributes"),o=t("../../components/fx/hovertemplate_attributes"),s=t("../../components/colorscale/attributes"),l=t("../../lib/extend").extendFlat;e.exports=l({x:n.x,y:n.y,z:{valType:"data_array",editType:"calc"},marker:{color:{valType:"data_array",editType:"calc"},editType:"calc"},histnorm:n.histnorm,histfunc:n.histfunc,nbinsx:n.nbinsx,xbins:a("x"),nbinsy:n.nbinsy,ybins:a("y"),autobinx:n.autobinx,autobiny:n.autobiny,bingroup:l({},n.bingroup,{}),xbingroup:l({},n.bingroup,{}),ybingroup:l({},n.bingroup,{}),xgap:i.xgap,ygap:i.ygap,zsmooth:i.zsmooth,zhoverformat:i.zhoverformat,hovertemplate:o({},{keys:"z"})},s("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":600,"../../components/fx/hovertemplate_attributes":631,"../../lib/extend":710,"../heatmap/attributes":1001,"../histogram/attributes":1019,"../histogram/bin_attributes":1021}],1033:[function(t,e,r){var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../histogram/bin_functions"),o=t("../histogram/norm_functions"),s=t("../histogram/average"),l=t("../histogram/bin_label_vals"),u=t("../histogram/calc").calcAllAutoBins;function c(t,e,r,n){var a,i=new Array(t);if(n)for(a=0;a<t;a++)i[a]=1/(e[a+1]-e[a]);else{var o=1/r;for(a=0;a<t;a++)i[a]=o}return i}function h(t,e){return{start:t(e.start),end:t(e.end),size:e.size}}function d(t,e,r,n,a,i){var o,s=t.length-1,u=new Array(s),c=l(r,n,t,a,i);for(o=0;o<s;o++){var h=(e||[])[o];u[o]=void 0===h?[c(t[o]),c(t[o+1],!0)]:[h,h]}return u}e.exports=function(t,e){var r,l,f,p,m=a.getFromId(t,e.xaxis),g=a.getFromId(t,e.yaxis),y=e.xcalendar,v=e.ycalendar,_=function(t){return m.r2c(t,0,y)},x=function(t){return g.r2c(t,0,v)},b=u(t,e,m,"x"),w=b[0],M=b[1],k=u(t,e,g,"y"),T=k[0],L=k[1],A=e._length;M.length>A&&M.splice(A,M.length-A),L.length>A&&L.splice(A,L.length-A);var S=[],E=[],C=[],D="string"==typeof w.size,P="string"==typeof T.size,O=[],z=[],I=D?O:w,R=P?z:T,F=0,N=[],Y=[],j=e.histnorm,B=e.histfunc,H=-1!==j.indexOf("density"),U="max"===B||"min"===B?null:0,V=i.count,W=o[j],G=!1,q=[],Z=[],X="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";X&&"count"!==B&&(G="avg"===B,V=i[B]);var J=w.size,K=_(w.start),$=_(w.end)+(K-a.tickIncrement(K,J,!1,y))/1e6;for(r=K;r<$;r=a.tickIncrement(r,J,!1,y))E.push(U),O.push(r),G&&C.push(0);O.push(r);var Q,tt=E.length,et=(r-K)/tt,rt=(Q=K+et/2,m.c2r(Q,0,y)),nt=T.size,at=x(T.start),it=x(T.end)+(at-a.tickIncrement(at,nt,!1,v))/1e6;for(r=at;r<it;r=a.tickIncrement(r,nt,!1,v)){S.push(E.slice()),z.push(r);var ot=new Array(tt);for(l=0;l<tt;l++)ot[l]=[];Y.push(ot),G&&N.push(C.slice())}z.push(r);var st=S.length,lt=(r-at)/st,ut=function(t){return g.c2r(t,0,v)}(at+lt/2);H&&(q=c(E.length,I,et,D),Z=c(S.length,R,lt,P)),D||"date"!==m.type||(I=h(_,I)),P||"date"!==g.type||(R=h(x,R));var ct=!0,ht=!0,dt=new Array(tt),ft=new Array(st),pt=1/0,mt=1/0,gt=1/0,yt=1/0;for(r=0;r<A;r++){var vt=M[r],_t=L[r];f=n.findBin(vt,I),p=n.findBin(_t,R),f>=0&&f<tt&&p>=0&&p<st&&(F+=V(f,r,S[p],X,N[p]),Y[p][f].push(r),ct&&(void 0===dt[f]?dt[f]=vt:dt[f]!==vt&&(ct=!1)),ht&&(void 0===ft[p]?ft[p]=_t:ft[p]!==_t&&(ht=!1)),pt=Math.min(pt,vt-O[f]),mt=Math.min(mt,O[f+1]-vt),gt=Math.min(gt,_t-z[p]),yt=Math.min(yt,z[p+1]-_t))}if(G)for(p=0;p<st;p++)F+=s(S[p],N[p]);if(W)for(p=0;p<st;p++)W(S[p],F,q,Z[p]);return{x:M,xRanges:d(O,ct&&dt,pt,mt,m,y),x0:rt,dx:et,y:L,yRanges:d(z,ht&&ft,gt,yt,g,v),y0:ut,dy:lt,z:S,pts:Y}}},{"../../lib":719,"../../plots/cartesian/axes":767,"../histogram/average":1020,"../histogram/bin_functions":1022,"../histogram/bin_label_vals":1023,"../histogram/calc":1024,"../histogram/norm_functions":1031}],1034:[function(t,e,r){var n=t("../../lib"),a=t("./sample_defaults"),i=t("../heatmap/style_defaults"),o=t("../../components/colorscale/defaults"),s=t("./attributes");e.exports=function(t,e,r,l){function u(r,a){return n.coerce(t,e,s,r,a)}a(t,e,u,l),!1!==e.visible&&(i(t,e,u,l),o(t,e,l,u,{prefix:"",cLetter:"z"}),u("hovertemplate"))}},{"../../components/colorscale/defaults":603,"../../lib":719,"../heatmap/style_defaults":1014,"./attributes":1032,"./sample_defaults":1037}],1035:[function(t,e,r){var n=t("../heatmap/hover"),a=t("../../plots/cartesian/axes").hoverLabelText;e.exports=function(t,e,r,i,o,s){var l=n(t,e,r,i,o,s);if(l){var u=(t=l[0]).index,c=u[0],h=u[1],d=t.cd[0],f=d.xRanges[h],p=d.yRanges[c];return t.xLabel=a(t.xa,f[0],f[1]),t.yLabel=a(t.ya,p[0],p[1]),l}}},{"../../plots/cartesian/axes":767,"../heatmap/hover":1008}],1036:[function(t,e,r){e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("../histogram/cross_trace_defaults"),calc:t("../heatmap/calc"),plot:t("../heatmap/plot"),layerName:"heatmaplayer",colorbar:t("../heatmap/colorbar"),style:t("../heatmap/style"),hoverPoints:t("./hover"),eventData:t("../histogram/event_data"),moduleType:"trace",name:"histogram2d",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","2dMap","histogram"],meta:{}}},{"../../plots/cartesian":778,"../heatmap/calc":1002,"../heatmap/colorbar":1004,"../heatmap/plot":1012,"../heatmap/style":1013,"../histogram/cross_trace_defaults":1026,"../histogram/event_data":1028,"./attributes":1032,"./defaults":1034,"./hover":1035}],1037:[function(t,e,r){var n=t("../../registry"),a=t("../../lib");e.exports=function(t,e,r,i){var o=r("x"),s=r("y"),l=a.minRowLength(o),u=a.minRowLength(s);l&&u?(e._length=Math.min(l,u),n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],i),(r("z")||r("marker.color"))&&r("histfunc"),r("histnorm"),r("autobinx"),r("autobiny")):e.visible=!1}},{"../../lib":719,"../../registry":847}],1038:[function(t,e,r){var n=t("../histogram2d/attributes"),a=t("../contour/attributes"),i=t("../../components/colorscale/attributes"),o=t("../../lib/extend").extendFlat;e.exports=o({x:n.x,y:n.y,z:n.z,marker:n.marker,histnorm:n.histnorm,histfunc:n.histfunc,nbinsx:n.nbinsx,xbins:n.xbins,nbinsy:n.nbinsy,ybins:n.ybins,autobinx:n.autobinx,autobiny:n.autobiny,bingroup:n.bingroup,xbingroup:n.xbingroup,ybingroup:n.ybingroup,autocontour:a.autocontour,ncontours:a.ncontours,contours:a.contours,line:a.line,zhoverformat:n.zhoverformat,hovertemplate:n.hovertemplate},i("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/colorscale/attributes":600,"../../lib/extend":710,"../contour/attributes":942,"../histogram2d/attributes":1032}],1039:[function(t,e,r){var n=t("../../lib"),a=t("../histogram2d/sample_defaults"),i=t("../contour/contours_defaults"),o=t("../contour/style_defaults"),s=t("./attributes");e.exports=function(t,e,r,l){function u(r,a){return n.coerce(t,e,s,r,a)}a(t,e,u,l),!1!==e.visible&&(i(t,e,u,(function(r){return n.coerce2(t,e,s,r)})),o(t,e,u,l),u("hovertemplate"))}},{"../../lib":719,"../contour/contours_defaults":949,"../contour/style_defaults":963,"../histogram2d/sample_defaults":1037,"./attributes":1038}],1040:[function(t,e,r){e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("../histogram/cross_trace_defaults"),calc:t("../contour/calc"),plot:t("../contour/plot").plot,layerName:"contourlayer",style:t("../contour/style"),colorbar:t("../contour/colorbar"),hoverPoints:t("../contour/hover"),moduleType:"trace",name:"histogram2dcontour",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","2dMap","contour","histogram","showLegend"],meta:{}}},{"../../plots/cartesian":778,"../contour/calc":943,"../contour/colorbar":945,"../contour/hover":955,"../contour/plot":960,"../contour/style":962,"../histogram/cross_trace_defaults":1026,"./attributes":1038,"./defaults":1039}],1041:[function(t,e,r){var n=t("../../lib/extend").extendFlat,a=t("../../lib/extend").extendDeep,i=t("../../plot_api/edit_types").overrideAll,o=t("../../plots/font_attributes"),s=t("../../components/color/attributes"),l=t("../../plots/domain").attributes,u=t("../../plots/cartesian/layout_attributes"),c=t("../../plot_api/plot_template").templatedArray,h=t("../../constants/delta.js"),d=(t("../../constants/docs").FORMAT_LINK,o({editType:"plot",colorEditType:"plot"})),f={color:{valType:"color",editType:"plot"},line:{color:{valType:"color",dflt:s.defaultLine,editType:"plot"},width:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},thickness:{valType:"number",min:0,max:1,dflt:1,editType:"plot"},editType:"calc"},p={valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},m=c("steps",a({},f,{range:p}));e.exports={mode:{valType:"flaglist",editType:"calc",flags:["number","delta","gauge"],dflt:"number"},value:{valType:"number",editType:"calc",anim:!0},align:{valType:"enumerated",values:["left","center","right"],editType:"plot"},domain:l({name:"indicator",trace:!0,editType:"calc"}),title:{text:{valType:"string",editType:"plot"},align:{valType:"enumerated",values:["left","center","right"],editType:"plot"},font:n({},d,{}),editType:"plot"},number:{valueformat:{valType:"string",dflt:"",editType:"plot"},font:n({},d,{}),prefix:{valType:"string",dflt:"",editType:"plot"},suffix:{valType:"string",dflt:"",editType:"plot"},editType:"plot"},delta:{reference:{valType:"number",editType:"calc"},position:{valType:"enumerated",values:["top","bottom","left","right"],dflt:"bottom",editType:"plot"},relative:{valType:"boolean",editType:"plot",dflt:!1},valueformat:{valType:"string",editType:"plot"},increasing:{symbol:{valType:"string",dflt:h.INCREASING.SYMBOL,editType:"plot"},color:{valType:"color",dflt:h.INCREASING.COLOR,editType:"plot"},editType:"plot"},decreasing:{symbol:{valType:"string",dflt:h.DECREASING.SYMBOL,editType:"plot"},color:{valType:"color",dflt:h.DECREASING.COLOR,editType:"plot"},editType:"plot"},font:n({},d,{}),editType:"calc"},gauge:{shape:{valType:"enumerated",editType:"plot",dflt:"angular",values:["angular","bullet"]},bar:a({},f,{color:{dflt:"green"}}),bgcolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:s.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:1,editType:"plot"},axis:i({range:p,visible:n({},u.visible,{dflt:!0}),tickmode:u.tickmode,nticks:u.nticks,tick0:u.tick0,dtick:u.dtick,tickvals:u.tickvals,ticktext:u.ticktext,ticks:n({},u.ticks,{dflt:"outside"}),ticklen:u.ticklen,tickwidth:u.tickwidth,tickcolor:u.tickcolor,showticklabels:u.showticklabels,tickfont:o({}),tickangle:u.tickangle,tickformat:u.tickformat,tickformatstops:u.tickformatstops,tickprefix:u.tickprefix,showtickprefix:u.showtickprefix,ticksuffix:u.ticksuffix,showticksuffix:u.showticksuffix,separatethousands:u.separatethousands,exponentformat:u.exponentformat,showexponent:u.showexponent,editType:"plot"},"plot"),steps:m,threshold:{line:{color:n({},f.line.color,{}),width:n({},f.line.width,{dflt:1}),editType:"plot"},thickness:n({},f.thickness,{dflt:.85}),value:{valType:"number",editType:"calc",dflt:!1},editType:"plot"},editType:"plot"}}},{"../../components/color/attributes":592,"../../constants/delta.js":689,"../../constants/docs":690,"../../lib/extend":710,"../../plot_api/edit_types":750,"../../plot_api/plot_template":757,"../../plots/cartesian/layout_attributes":779,"../../plots/domain":792,"../../plots/font_attributes":793}],1042:[function(t,e,r){var n=t("../../registry"),a=t("../../plots/get_data").getModuleCalcData,i=r.name="indicator";r.plot=function(t,e,r,o){var s=n.getModule(i),l=a(t.calcdata,s)[0];s.plot(t,l,r,o)},r.clean=function(t,e,r,n){var a=n._has&&n._has(i),o=e._has&&e._has(i);a&&!o&&n._indicatorlayer.selectAll("g.trace").remove()}},{"../../plots/get_data":802,"../../registry":847}],1043:[function(t,e,r){e.exports={calc:function(t,e){var r=[],n=e.value;"number"!=typeof e._lastValue&&(e._lastValue=e.value);var a=e._lastValue,i=a;return e._hasDelta&&"number"==typeof e.delta.reference&&(i=e.delta.reference),r[0]={y:n,lastY:a,delta:n-i,relativeDelta:(n-i)/i},r}}},{}],1044:[function(t,e,r){e.exports={defaultNumberFontSize:80,bulletNumberDomainSize:.25,bulletPadding:.025,innerRadius:.75,valueThickness:.5,titlePadding:5,horizontalPadding:10}},{}],1045:[function(t,e,r){var n=t("../../lib"),a=t("./attributes"),i=t("../../plots/domain").defaults,o=t("../../plot_api/plot_template"),s=t("../../plots/array_container_defaults"),l=t("./constants.js"),u=t("../../plots/cartesian/tick_value_defaults"),c=t("../../plots/cartesian/tick_mark_defaults"),h=t("../../plots/cartesian/tick_label_defaults");function d(t,e){function r(r,i){return n.coerce(t,e,a.gauge.steps,r,i)}r("color"),r("line.color"),r("line.width"),r("range"),r("thickness")}e.exports={supplyDefaults:function(t,e,r,f){function p(r,i){return n.coerce(t,e,a,r,i)}i(e,f,p),p("mode"),e._hasNumber=-1!==e.mode.indexOf("number"),e._hasDelta=-1!==e.mode.indexOf("delta"),e._hasGauge=-1!==e.mode.indexOf("gauge");var m=p("value");e._range=[0,"number"==typeof m?1.5*m:1];var g,y,v,_,x,b,w=new Array(2);function M(t,e){return n.coerce(v,_,a.gauge,t,e)}function k(t,e){return n.coerce(x,b,a.gauge.axis,t,e)}if(e._hasNumber&&(p("number.valueformat"),p("number.font.color",f.font.color),p("number.font.family",f.font.family),p("number.font.size"),void 0===e.number.font.size&&(e.number.font.size=l.defaultNumberFontSize,w[0]=!0),p("number.prefix"),p("number.suffix"),g=e.number.font.size),e._hasDelta&&(p("delta.font.color",f.font.color),p("delta.font.family",f.font.family),p("delta.font.size"),void 0===e.delta.font.size&&(e.delta.font.size=(e._hasNumber?.5:1)*(g||l.defaultNumberFontSize),w[1]=!0),p("delta.reference",e.value),p("delta.relative"),p("delta.valueformat",e.delta.relative?"2%":""),p("delta.increasing.symbol"),p("delta.increasing.color"),p("delta.decreasing.symbol"),p("delta.decreasing.color"),p("delta.position"),y=e.delta.font.size),e._scaleNumbers=(!e._hasNumber||w[0])&&(!e._hasDelta||w[1])||!1,p("title.font.color",f.font.color),p("title.font.family",f.font.family),p("title.font.size",.25*(g||y||l.defaultNumberFontSize)),p("title.text"),e._hasGauge){(v=t.gauge)||(v={}),_=o.newContainer(e,"gauge"),M("shape"),(e._isBullet="bullet"===e.gauge.shape)||p("title.align","center"),(e._isAngular="angular"===e.gauge.shape)||p("align","center"),M("bgcolor",f.paper_bgcolor),M("borderwidth"),M("bordercolor"),M("bar.color"),M("bar.line.color"),M("bar.line.width"),M("bar.thickness",l.valueThickness*("bullet"===e.gauge.shape?.5:1)),s(v,_,{name:"steps",handleItemDefaults:d}),M("threshold.value"),M("threshold.thickness"),M("threshold.line.width"),M("threshold.line.color"),x={},v&&(x=v.axis||{}),b=o.newContainer(_,"axis"),k("visible"),e._range=k("range",e._range);var T={outerTicks:!0};u(x,b,k,"linear"),h(x,b,k,"linear",T),c(x,b,k,T)}else p("title.align","center"),p("align","center"),e._isAngular=e._isBullet=!1;e._length=null}}},{"../../lib":719,"../../plot_api/plot_template":757,"../../plots/array_container_defaults":763,"../../plots/cartesian/tick_label_defaults":786,"../../plots/cartesian/tick_mark_defaults":787,"../../plots/cartesian/tick_value_defaults":788,"../../plots/domain":792,"./attributes":1041,"./constants.js":1044}],1046:[function(t,e,r){e.exports={moduleType:"trace",name:"indicator",basePlotModule:t("./base_plot"),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:t("./attributes"),supplyDefaults:t("./defaults").supplyDefaults,calc:t("./calc").calc,plot:t("./plot"),meta:{}}},{"./attributes":1041,"./base_plot":1042,"./calc":1043,"./defaults":1045,"./plot":1047}],1047:[function(t,e,r){var n=t("d3"),a=t("../../lib"),i=a.rad2deg,o=t("../../constants/alignment").MID_SHIFT,s=t("../../components/drawing"),l=t("./constants"),u=t("../../lib/svg_text_utils"),c=t("../../plots/cartesian/axes"),h=t("../../plots/cartesian/axis_defaults"),d=t("../../plots/cartesian/position_defaults"),f=t("../../plots/cartesian/layout_attributes"),p=t("../../components/color"),m={left:"start",center:"middle",right:"end"},g={left:0,center:.5,right:1},y=/[yzafpn\xb5mkMGTPEZY]/;function v(t){return t&&t.duration>0}function _(t){t.each((function(t){p.stroke(n.select(this),t.line.color)})).each((function(t){p.fill(n.select(this),t.color)})).style("stroke-width",(function(t){return t.line.width}))}function x(t,e,r){var n=t._fullLayout,i=a.extendFlat({type:"linear",ticks:"outside",range:r,showline:!0},e),o={type:"linear",_id:"x"+e._id},s={letter:"x",font:n.font,noHover:!0,noTickson:!0};function l(t,e){return a.coerce(i,o,f,t,e)}return h(i,o,l,s,n),d(i,o,l,s),o}function b(t,e){return"translate("+t+","+e+")"}function w(t,e,r){return[Math.min(e/t.width,r/t.height),t,e+"x"+r]}function M(t,e,r,a){var i=document.createElementNS("http://www.w3.org/2000/svg","text"),o=n.select(i);return o.text(t).attr("x",0).attr("y",0).attr("text-anchor",r).attr("data-unformatted",t).call(u.convertToTspans,a).call(s.font,e),s.bBox(o.node())}function k(t,e,r,n,i,o){var s="_cache"+e;t[s]&&t[s].key===i||(t[s]={key:i,value:r});var l=a.aggNums(o,null,[t[s].value,n],2);return t[s].value=l,l}e.exports=function(t,e,r,h){var d,f=t._fullLayout;v(r)&&h&&(d=h()),a.makeTraceGroups(f._indicatorlayer,e,"trace").each((function(e){var h,T,L,A,S,E=e[0].trace,C=n.select(this),D=E._hasGauge,P=E._isAngular,O=E._isBullet,z=E.domain,I={w:f._size.w*(z.x[1]-z.x[0]),h:f._size.h*(z.y[1]-z.y[0]),l:f._size.l+f._size.w*z.x[0],r:f._size.r+f._size.w*(1-z.x[1]),t:f._size.t+f._size.h*(1-z.y[1]),b:f._size.b+f._size.h*z.y[0]},R=I.l+I.w/2,F=I.t+I.h/2,N=Math.min(I.w/2,I.h),Y=l.innerRadius*N,j=E.align||"center";if(T=F,D){if(P&&(h=R,T=F+N/2,L=function(t){return e=t,[(r=.9*Y)/Math.sqrt(e.width/2*(e.width/2)+e.height*e.height),e,r];var e,r}),O){var B=l.bulletPadding,H=1-l.bulletNumberDomainSize+B;h=I.l+(H+(1-H)*g[j])*I.w,L=function(t){return w(t,(l.bulletNumberDomainSize-B)*I.w,I.h)}}}else h=I.l+g[j]*I.w,L=function(t){return w(t,I.w,I.h)};!function(t,e,r,i){var o,l,h,d=r[0].trace,f=i.numbersX,_=i.numbersY,w=d.align||"center",T=m[w],L=i.transitionOpts,A=i.onComplete,S=a.ensureSingle(e,"g","numbers"),E=[];d._hasNumber&&E.push("number"),d._hasDelta&&(E.push("delta"),"left"===d.delta.position&&E.reverse());var C=S.selectAll("text").data(E);function D(e,r,n,a){if(!e.match("s")||n>=0==a>=0||r(n).slice(-1).match(y)||r(a).slice(-1).match(y))return r;var i=e.slice().replace("s","f").replace(/\d+/,(function(t){return parseInt(t)-1})),o=x(t,{tickformat:i});return function(t){return Math.abs(t)<1?c.tickText(o,t).text:r(t)}}C.enter().append("text"),C.attr("text-anchor",(function(){return T})).attr("class",(function(t){return t})).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),C.exit().remove();var P,O=d.mode+d.align;if(d._hasDelta&&(P=function(){var e=x(t,{tickformat:d.delta.valueformat},d._range);e.setScale(),c.calcTicks(e);var a=function(t){return c.tickText(e,t).text},i=function(t){return d.delta.relative?t.relativeDelta:t.delta},o=function(t,e){return 0===t||"number"!=typeof t||isNaN(t)?"-":(t>0?d.delta.increasing.symbol:d.delta.decreasing.symbol)+e(t)},h=function(t){return t.delta>=0?d.delta.increasing.color:d.delta.decreasing.color};void 0===d._deltaLastValue&&(d._deltaLastValue=i(r[0]));var f=S.select("text.delta");function m(){f.text(o(i(r[0]),a)).call(p.fill,h(r[0])).call(u.convertToTspans,t)}return f.call(s.font,d.delta.font).call(p.fill,h({delta:d._deltaLastValue})),v(L)?f.transition().duration(L.duration).ease(L.easing).tween("text",(function(){var t=n.select(this),e=i(r[0]),s=d._deltaLastValue,l=D(d.delta.valueformat,a,s,e),u=n.interpolateNumber(s,e);return d._deltaLastValue=e,function(e){t.text(o(u(e),l)),t.call(p.fill,h({delta:u(e)}))}})).each("end",(function(){m(),A&&A()})).each("interrupt",(function(){m(),A&&A()})):m(),l=M(o(i(r[0]),a),d.delta.font,T,t),f}(),O+=d.delta.position+d.delta.font.size+d.delta.font.family+d.delta.valueformat,O+=d.delta.increasing.symbol+d.delta.decreasing.symbol,h=l),d._hasNumber&&(function(){var e=x(t,{tickformat:d.number.valueformat},d._range);e.setScale(),c.calcTicks(e);var a=function(t){return c.tickText(e,t).text},i=d.number.suffix,l=d.number.prefix,h=S.select("text.number");function f(){var e="number"==typeof r[0].y?l+a(r[0].y)+i:"-";h.text(e).call(s.font,d.number.font).call(u.convertToTspans,t)}v(L)?h.transition().duration(L.duration).ease(L.easing).each("end",(function(){f(),A&&A()})).each("interrupt",(function(){f(),A&&A()})).attrTween("text",(function(){var t=n.select(this),e=n.interpolateNumber(r[0].lastY,r[0].y);d._lastValue=r[0].y;var o=D(d.number.valueformat,a,r[0].lastY,r[0].y);return function(r){t.text(l+o(e(r))+i)}})):f(),o=M(l+a(r[0].y)+i,d.number.font,T,t)}(),O+=d.number.font.size+d.number.font.family+d.number.valueformat+d.number.suffix+d.number.prefix,h=o),d._hasDelta&&d._hasNumber){var z,I,R=[(o.left+o.right)/2,(o.top+o.bottom)/2],F=[(l.left+l.right)/2,(l.top+l.bottom)/2],N=.75*d.delta.font.size;"left"===d.delta.position&&(z=k(d,"deltaPos",0,-1*(o.width*g[d.align]+l.width*(1-g[d.align])+N),O,Math.min),I=R[1]-F[1],h={width:o.width+l.width+N,height:Math.max(o.height,l.height),left:l.left+z,right:o.right,top:Math.min(o.top,l.top+I),bottom:Math.max(o.bottom,l.bottom+I)}),"right"===d.delta.position&&(z=k(d,"deltaPos",0,o.width*(1-g[d.align])+l.width*g[d.align]+N,O,Math.max),I=R[1]-F[1],h={width:o.width+l.width+N,height:Math.max(o.height,l.height),left:o.left,right:l.right+z,top:Math.min(o.top,l.top+I),bottom:Math.max(o.bottom,l.bottom+I)}),"bottom"===d.delta.position&&(z=null,I=l.height,h={width:Math.max(o.width,l.width),height:o.height+l.height,left:Math.min(o.left,l.left),right:Math.max(o.right,l.right),top:o.bottom-o.height,bottom:o.bottom+l.height}),"top"===d.delta.position&&(z=null,I=o.top,h={width:Math.max(o.width,l.width),height:o.height+l.height,left:Math.min(o.left,l.left),right:Math.max(o.right,l.right),top:o.bottom-o.height-l.height,bottom:o.bottom}),P.attr({dx:z,dy:I})}(d._hasNumber||d._hasDelta)&&S.attr("transform",(function(){var t=i.numbersScaler(h);O+=t[2];var e,r=k(d,"numbersScale",1,t[0],O,Math.min);d._scaleNumbers||(r=1),e=d._isAngular?_-r*h.bottom:_-r*(h.top+h.bottom)/2,d._numbersTop=r*h.top+e;var n=h[w];"center"===w&&(n=(h.left+h.right)/2);var a=f-r*n;return b(a=k(d,"numbersTranslate",0,a,O,Math.max),e)+" scale("+r+")"}))}(t,C,e,{numbersX:h,numbersY:T,numbersScaler:L,transitionOpts:r,onComplete:d}),D&&(A={range:E.gauge.axis.range,color:E.gauge.bgcolor,line:{color:E.gauge.bordercolor,width:0},thickness:1},S={range:E.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:E.gauge.bordercolor,width:E.gauge.borderwidth},thickness:1});var U=C.selectAll("g.angular").data(P?e:[]);U.exit().remove();var V=C.selectAll("g.angularaxis").data(P?e:[]);V.exit().remove(),P&&function(t,e,r,a){var s,l,u,h,d=r[0].trace,f=a.size,p=a.radius,m=a.innerRadius,g=a.gaugeBg,y=a.gaugeOutline,w=[f.l+f.w/2,f.t+f.h/2+p/2],M=a.gauge,k=a.layer,T=a.transitionOpts,L=a.onComplete,A=Math.PI/2;function S(t){var e=d.gauge.axis.range[0],r=(t-e)/(d.gauge.axis.range[1]-e)*Math.PI-A;return r<-A?-A:r>A?A:r}function E(t){return n.svg.arc().innerRadius((m+p)/2-t/2*(p-m)).outerRadius((m+p)/2+t/2*(p-m)).startAngle(-A)}function C(t){t.attr("d",(function(t){return E(t.thickness).startAngle(S(t.range[0])).endAngle(S(t.range[1]))()}))}M.enter().append("g").classed("angular",!0),M.attr("transform",b(w[0],w[1])),k.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),k.selectAll("g.xangularaxistick,path,text").remove(),(s=x(t,d.gauge.axis)).type="linear",s.range=d.gauge.axis.range,s._id="xangularaxis",s.setScale();var D=function(t){return(s.range[0]-t.x)/(s.range[1]-s.range[0])*Math.PI+Math.PI},P={},O=c.makeLabelFns(s,0).labelStandoff;P.xFn=function(t){var e=D(t);return Math.cos(e)*O},P.yFn=function(t){var e=D(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(O+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*o)},P.anchorFn=function(t){var e=D(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},P.heightFn=function(t,e,r){var n=D(t);return-.5*(1+Math.sin(n))*r};var z=function(t){return b(w[0]+p*Math.cos(t),w[1]-p*Math.sin(t))};if(u=function(t){return z(D(t))},l=c.calcTicks(s),h=c.getTickSigns(s)[2],s.visible){h="inside"===s.ticks?-1:1;var I=(s.linewidth||1)/2;c.drawTicks(t,s,{vals:l,layer:k,path:"M"+h*I+",0h"+h*s.ticklen,transFn:function(t){var e=D(t);return z(e)+"rotate("+-i(e)+")"}}),c.drawLabels(t,s,{vals:l,layer:k,transFn:u,labelFns:P})}var R=[g].concat(d.gauge.steps),F=M.selectAll("g.bg-arc").data(R);F.enter().append("g").classed("bg-arc",!0).append("path"),F.select("path").call(C).call(_),F.exit().remove();var N=E(d.gauge.bar.thickness),Y=M.selectAll("g.value-arc").data([d.gauge.bar]);Y.enter().append("g").classed("value-arc",!0).append("path");var j,B,H,U=Y.select("path");v(T)?(U.transition().duration(T.duration).ease(T.easing).each("end",(function(){L&&L()})).each("interrupt",(function(){L&&L()})).attrTween("d",(j=N,B=S(r[0].lastY),H=S(r[0].y),function(){var t=n.interpolate(B,H);return function(e){return j.endAngle(t(e))()}})),d._lastValue=r[0].y):U.attr("d","number"==typeof r[0].y?N.endAngle(S(r[0].y)):"M0,0Z"),U.call(_),Y.exit().remove(),R=[];var V=d.gauge.threshold.value;V&&R.push({range:[V,V],color:d.gauge.threshold.color,line:{color:d.gauge.threshold.line.color,width:d.gauge.threshold.line.width},thickness:d.gauge.threshold.thickness});var W=M.selectAll("g.threshold-arc").data(R);W.enter().append("g").classed("threshold-arc",!0).append("path"),W.select("path").call(C).call(_),W.exit().remove();var G=M.selectAll("g.gauge-outline").data([y]);G.enter().append("g").classed("gauge-outline",!0).append("path"),G.select("path").call(C).call(_),G.exit().remove()}(t,0,e,{radius:N,innerRadius:Y,gauge:U,layer:V,size:I,gaugeBg:A,gaugeOutline:S,transitionOpts:r,onComplete:d});var W=C.selectAll("g.bullet").data(O?e:[]);W.exit().remove();var G=C.selectAll("g.bulletaxis").data(O?e:[]);G.exit().remove(),O&&function(t,e,r,n){var a,i,o,s,u,h=r[0].trace,d=n.gauge,f=n.layer,m=n.gaugeBg,g=n.gaugeOutline,y=n.size,b=h.domain,w=n.transitionOpts,M=n.onComplete;d.enter().append("g").classed("bullet",!0),d.attr("transform","translate("+y.l+", "+y.t+")"),f.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),f.selectAll("g.xbulletaxistick,path,text").remove();var k=y.h,T=h.gauge.bar.thickness*k,L=b.x[0],A=b.x[0]+(b.x[1]-b.x[0])*(h._hasNumber||h._hasDelta?1-l.bulletNumberDomainSize:1);function S(t){t.attr("width",(function(t){return Math.max(0,a.c2p(t.range[1])-a.c2p(t.range[0]))})).attr("x",(function(t){return a.c2p(t.range[0])})).attr("y",(function(t){return.5*(1-t.thickness)*k})).attr("height",(function(t){return t.thickness*k}))}(a=x(t,h.gauge.axis))._id="xbulletaxis",a.domain=[L,A],a.setScale(),i=c.calcTicks(a),o=c.makeTransFn(a),s=c.getTickSigns(a)[2],u=y.t+y.h,a.visible&&(c.drawTicks(t,a,{vals:"inside"===a.ticks?c.clipEnds(a,i):i,layer:f,path:c.makeTickPath(a,u,s),transFn:o}),c.drawLabels(t,a,{vals:i,layer:f,transFn:o,labelFns:c.makeLabelFns(a,u)}));var E=[m].concat(h.gauge.steps),C=d.selectAll("g.bg-bullet").data(E);C.enter().append("g").classed("bg-bullet",!0).append("rect"),C.select("rect").call(S).call(_),C.exit().remove();var D=d.selectAll("g.value-bullet").data([h.gauge.bar]);D.enter().append("g").classed("value-bullet",!0).append("rect"),D.select("rect").attr("height",T).attr("y",(k-T)/2).call(_),v(w)?D.select("rect").transition().duration(w.duration).ease(w.easing).each("end",(function(){M&&M()})).each("interrupt",(function(){M&&M()})).attr("width",Math.max(0,a.c2p(Math.min(h.gauge.axis.range[1],r[0].y)))):D.select("rect").attr("width","number"==typeof r[0].y?Math.max(0,a.c2p(Math.min(h.gauge.axis.range[1],r[0].y))):0),D.exit().remove();var P=r.filter((function(){return h.gauge.threshold.value})),O=d.selectAll("g.threshold-bullet").data(P);O.enter().append("g").classed("threshold-bullet",!0).append("line"),O.select("line").attr("x1",a.c2p(h.gauge.threshold.value)).attr("x2",a.c2p(h.gauge.threshold.value)).attr("y1",(1-h.gauge.threshold.thickness)/2*k).attr("y2",(1-(1-h.gauge.threshold.thickness)/2)*k).call(p.stroke,h.gauge.threshold.line.color).style("stroke-width",h.gauge.threshold.line.width),O.exit().remove();var z=d.selectAll("g.gauge-outline").data([g]);z.enter().append("g").classed("gauge-outline",!0).append("rect"),z.select("rect").call(S).call(_),z.exit().remove()}(t,0,e,{gauge:W,layer:G,size:I,gaugeBg:A,gaugeOutline:S,transitionOpts:r,onComplete:d});var q=C.selectAll("text.title").data(e);q.exit().remove(),q.enter().append("text").classed("title",!0),q.attr("text-anchor",(function(){return O?m.right:m[E.title.align]})).text(E.title.text).call(s.font,E.title.font).call(u.convertToTspans,t),q.attr("transform",(function(){var t,e=I.l+I.w*g[E.title.align],r=l.titlePadding,n=s.bBox(q.node());return D?(P&&(t=E.gauge.axis.visible?s.bBox(V.node()).top-r-n.bottom:I.t+I.h/2-N/2-n.bottom-r),O&&(t=T-(n.top+n.bottom)/2,e=I.l-l.bulletPadding*I.w)):t=E._numbersTop-r-n.bottom,b(e,t)}))}))}},{"../../components/color":593,"../../components/drawing":614,"../../constants/alignment":688,"../../lib":719,"../../lib/svg_text_utils":743,"../../plots/cartesian/axes":767,"../../plots/cartesian/axis_defaults":769,"../../plots/cartesian/layout_attributes":779,"../../plots/cartesian/position_defaults":782,"./constants":1044,d3:163}],1048:[function(t,e,r){var n=t("../../components/colorscale/attributes"),a=t("../../components/fx/hovertemplate_attributes"),i=t("../mesh3d/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat,l=t("../../plot_api/edit_types").overrideAll,u=e.exports=l(s({x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},value:{valType:"data_array"},isomin:{valType:"number"},isomax:{valType:"number"},surface:{show:{valType:"boolean",dflt:!0},count:{valType:"integer",dflt:2,min:1},fill:{valType:"number",min:0,max:1,dflt:1},pattern:{valType:"flaglist",flags:["A","B","C","D","E"],extras:["all","odd","even"],dflt:"all"}},spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:.15}},slices:{x:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}}},caps:{x:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}}},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:a()},n("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:i.opacity,lightposition:i.lightposition,lighting:i.lighting,flatshading:i.flatshading,contour:i.contour,hoverinfo:s({},o.hoverinfo)}),"calc","nested");u.flatshading.dflt=!0,u.lighting.facenormalsepsilon.dflt=0,u.x.editType=u.y.editType=u.z.editType=u.value.editType="calc+clearAxisTypes",u.transforms=void 0},{"../../components/colorscale/attributes":600,"../../components/fx/hovertemplate_attributes":631,"../../lib/extend":710,"../../plot_api/edit_types":750,"../../plots/attributes":764,"../mesh3d/attributes":1053}],1049:[function(t,e,r){var n=t("../../components/colorscale/calc");e.exports=function(t,e){e._len=Math.min(e.x.length,e.y.length,e.z.length,e.value.length);for(var r=1/0,a=-1/0,i=e.value.length,o=0;o<i;o++){var s=e.value[o];r=Math.min(r,s),a=Math.max(a,s)}e._minValues=r,e._maxValues=a,e._vMin=void 0===e.isomin||null===e.isomin?r:e.isomin,e._vMax=void 0===e.isomax||null===e.isomin?a:e.isomax,n(t,e,{vals:[e._vMin,e._vMax],containerStr:"",cLetter:"c"})}},{"../../components/colorscale/calc":601}],1050:[function(t,e,r){var n=t("gl-mesh3d"),a=t("../../lib"),i=t("../../lib/gl_format_color").parseColorScale,o=t("../../lib/str2rgbarray"),s=t("../../components/colorscale").extractOpts,l=t("../../plots/gl3d/zip3");function u(t){return a.distinctVals(t).vals}var c=function(t,e){for(var r=e.length-1;r>0;r--){var n=Math.min(e[r],e[r-1]),a=Math.max(e[r],e[r-1]);if(a>n&&n<t&&t<=a)return{id:r,distRatio:(a-t)/(a-n)}}return{id:0,distRatio:0}};function h(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.data=null,this.showContour=!1}var d=h.prototype;function f(t){t._i=[],t._j=[],t._k=[];var e,r,n=t.surface.show,a=t.spaceframe.show,i=t.surface.fill,o=t.spaceframe.fill,s=!1,l=!1,h=0,d=u(t.x.slice(0,t._len)),f=u(t.y.slice(0,t._len)),p=u(t.z.slice(0,t._len)),m=d.length,g=f.length,y=p.length;function v(t,e,r){return r+y*e+y*g*t}var _,x,b,w,M,k=t._minValues,T=t._maxValues,L=t._vMin,A=t._vMax;function S(t,e,n){for(var a=w.length,i=r;i<a;i++)if(t===_[i]&&e===x[i]&&n===b[i])return i;return-1}function E(){r=e}function C(){_=[],x=[],b=[],w=[],e=0,E()}function D(t,r,n,a){return _.push(t),x.push(r),b.push(n),w.push(a),++e-1}function P(t,e,r){for(var n=[],a=0;a<t.length;a++)n[a]=t[a]*(1-r)+r*e[a];return n}function O(t){M=t}function z(t,e){return"all"===t||null===t||t.indexOf(e)>-1}function I(t,e){return null===t?e:t}function R(e,r,n){E();var a,i,o,s=[r],l=[n];if(M>=1)s=[r],l=[n];else if(M>0){var u=function(t,e){var r=t[0],n=t[1],a=t[2],i=function(t,e,r){for(var n=[],a=0;a<t.length;a++)n[a]=(t[a]+e[a]+r[a])/3;return n}(r,n,a),o=Math.sqrt(1-M),s=P(i,r,o),l=P(i,n,o),u=P(i,a,o),c=e[0],h=e[1],d=e[2];return{xyzv:[[r,n,l],[l,s,r],[n,a,u],[u,l,n],[a,r,s],[s,u,a]],abc:[[c,h,-1],[-1,-1,c],[h,d,-1],[-1,-1,h],[d,c,-1],[-1,-1,d]]}}(r,n);s=u.xyzv,l=u.abc}for(var c=0;c<s.length;c++){r=s[c],n=l[c];for(var d=[],f=0;f<3;f++){var p=r[f][0],m=r[f][1],g=r[f][2],y=r[f][3],v=n[f]>-1?n[f]:S(p,m,g);d[f]=v>-1?v:D(p,m,g,I(e,y))}a=d[0],i=d[1],o=d[2],t._i.push(a),t._j.push(i),t._k.push(o),++h}}function F(t,e,r,n){var a=t[3];a<r&&(a=r),a>n&&(a=n);for(var i=(t[3]-a)/(t[3]-e[3]+1e-9),o=[],s=0;s<4;s++)o[s]=(1-i)*t[s]+i*e[s];return o}function N(t,e,r){return t>=e&&t<=r}function Y(t){var e=.001*(A-L);return t>=L-e&&t<=A+e}function j(e){for(var r=[],n=0;n<4;n++){var a=e[n];r.push([t.x[a],t.y[a],t.z[a],t.value[a]])}return r}function B(t,e,r,n,a,i){i||(i=1),r=[-1,-1,-1];var o=!1,s=[N(e[0][3],n,a),N(e[1][3],n,a),N(e[2][3],n,a)];if(!s[0]&&!s[1]&&!s[2])return!1;var l=function(t,e,r){return Y(e[0][3])&&Y(e[1][3])&&Y(e[2][3])?(R(t,e,r),!0):i<3&&B(t,e,r,L,A,++i)};if(s[0]&&s[1]&&s[2])return l(t,e,r)||o;var u=!1;return[[0,1,2],[2,0,1],[1,2,0]].forEach((function(i){if(s[i[0]]&&s[i[1]]&&!s[i[2]]){var c=e[i[0]],h=e[i[1]],d=e[i[2]],f=F(d,c,n,a),p=F(d,h,n,a);o=l(t,[p,f,c],[-1,-1,r[i[0]]])||o,o=l(t,[c,h,p],[r[i[0]],r[i[1]],-1])||o,u=!0}})),u||[[0,1,2],[1,2,0],[2,0,1]].forEach((function(i){if(s[i[0]]&&!s[i[1]]&&!s[i[2]]){var c=e[i[0]],h=e[i[1]],d=e[i[2]],f=F(h,c,n,a),p=F(d,c,n,a);o=l(t,[p,f,c],[-1,-1,r[i[0]]])||o,u=!0}})),o}function H(t,e,r,n){var a=!1,i=j(e),o=[N(i[0][3],r,n),N(i[1][3],r,n),N(i[2][3],r,n),N(i[3][3],r,n)];if(!(o[0]||o[1]||o[2]||o[3]))return a;if(o[0]&&o[1]&&o[2]&&o[3])return l&&(a=function(t,e,r){var n=function(n,a,i){R(t,[e[n],e[a],e[i]],[r[n],r[a],r[i]])};n(0,1,2),n(3,0,1),n(2,3,0),n(1,2,3)}(t,i,e)||a),a;var s=!1;return[[0,1,2,3],[3,0,1,2],[2,3,0,1],[1,2,3,0]].forEach((function(u){if(o[u[0]]&&o[u[1]]&&o[u[2]]&&!o[u[3]]){var c=i[u[0]],h=i[u[1]],d=i[u[2]],f=i[u[3]];if(l)a=R(t,[c,h,d],[e[u[0]],e[u[1]],e[u[2]]])||a;else{var p=F(f,c,r,n),m=F(f,h,r,n),g=F(f,d,r,n);a=R(null,[p,m,g],[-1,-1,-1])||a}s=!0}})),s||([[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2],[0,2,3,1],[1,3,2,0]].forEach((function(u){if(o[u[0]]&&o[u[1]]&&!o[u[2]]&&!o[u[3]]){var c=i[u[0]],h=i[u[1]],d=i[u[2]],f=i[u[3]],p=F(d,c,r,n),m=F(d,h,r,n),g=F(f,h,r,n),y=F(f,c,r,n);l?(a=R(t,[c,y,p],[e[u[0]],-1,-1])||a,a=R(t,[h,m,g],[e[u[1]],-1,-1])||a):a=function(t,e,r){var n=function(t,n,a){R(null,[e[t],e[n],e[a]],[r[t],r[n],r[a]])};n(0,1,2),n(2,3,0)}(0,[p,m,g,y],[-1,-1,-1,-1])||a,s=!0}})),s||[[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2]].forEach((function(u){if(o[u[0]]&&!o[u[1]]&&!o[u[2]]&&!o[u[3]]){var c=i[u[0]],h=i[u[1]],d=i[u[2]],f=i[u[3]],p=F(h,c,r,n),m=F(d,c,r,n),g=F(f,c,r,n);l?(a=R(t,[c,p,m],[e[u[0]],-1,-1])||a,a=R(t,[c,m,g],[e[u[0]],-1,-1])||a,a=R(t,[c,g,p],[e[u[0]],-1,-1])||a):a=R(null,[p,m,g],[-1,-1,-1])||a,s=!0}}))),a}function U(t,e,r,n,a,i,o,u,c,h,d){var f=!1;return s&&(z(t,"A")&&(f=H(null,[e,r,n,i],h,d)||f),z(t,"B")&&(f=H(null,[r,n,a,c],h,d)||f),z(t,"C")&&(f=H(null,[r,i,o,c],h,d)||f),z(t,"D")&&(f=H(null,[n,i,u,c],h,d)||f),z(t,"E")&&(f=H(null,[r,n,i,c],h,d)||f)),l&&(f=H(t,[r,n,i,c],h,d)||f),f}function V(t,e,r,n,a,i,o,s){return[!0===s[0]||B(t,j([e,r,n]),[e,r,n],i,o),!0===s[1]||B(t,j([n,a,e]),[n,a,e],i,o)]}function W(t,e,r,n,a,i,o,s,l){return s?V(t,e,r,a,n,i,o,l):V(t,r,a,n,e,i,o,l)}function G(t,e,r,n,a,i,o){var s,l,u,c,h=!1,d=function(){h=B(t,[s,l,u],[-1,-1,-1],a,i)||h,h=B(t,[u,c,s],[-1,-1,-1],a,i)||h},f=o[0],p=o[1],m=o[2];return f&&(s=P(j([v(e,r-0,n-0)])[0],j([v(e-1,r-0,n-0)])[0],f),l=P(j([v(e,r-0,n-1)])[0],j([v(e-1,r-0,n-1)])[0],f),u=P(j([v(e,r-1,n-1)])[0],j([v(e-1,r-1,n-1)])[0],f),c=P(j([v(e,r-1,n-0)])[0],j([v(e-1,r-1,n-0)])[0],f),d()),p&&(s=P(j([v(e-0,r,n-0)])[0],j([v(e-0,r-1,n-0)])[0],p),l=P(j([v(e-0,r,n-1)])[0],j([v(e-0,r-1,n-1)])[0],p),u=P(j([v(e-1,r,n-1)])[0],j([v(e-1,r-1,n-1)])[0],p),c=P(j([v(e-1,r,n-0)])[0],j([v(e-1,r-1,n-0)])[0],p),d()),m&&(s=P(j([v(e-0,r-0,n)])[0],j([v(e-0,r-0,n-1)])[0],m),l=P(j([v(e-0,r-1,n)])[0],j([v(e-0,r-1,n-1)])[0],m),u=P(j([v(e-1,r-1,n)])[0],j([v(e-1,r-1,n-1)])[0],m),c=P(j([v(e-1,r-0,n)])[0],j([v(e-1,r-0,n-1)])[0],m),d()),h}function q(t,e,r,n,a,i,o,l,u,c,h,d){var f=t;return d?(s&&"even"===t&&(f=null),U(f,e,r,n,a,i,o,l,u,c,h)):(s&&"odd"===t&&(f=null),U(f,u,l,o,i,a,n,r,e,c,h))}function Z(t,e,r,n,a){for(var i=[],o=0,s=0;s<e.length;s++)for(var l=e[s],u=1;u<y;u++)for(var c=1;c<g;c++)i.push(W(t,v(l,c-1,u-1),v(l,c-1,u),v(l,c,u-1),v(l,c,u),r,n,(l+c+u)%2,a&&a[o]?a[o]:[])),o++;return i}function X(t,e,r,n,a){for(var i=[],o=0,s=0;s<e.length;s++)for(var l=e[s],u=1;u<m;u++)for(var c=1;c<y;c++)i.push(W(t,v(u-1,l,c-1),v(u,l,c-1),v(u-1,l,c),v(u,l,c),r,n,(u+l+c)%2,a&&a[o]?a[o]:[])),o++;return i}function J(t,e,r,n,a){for(var i=[],o=0,s=0;s<e.length;s++)for(var l=e[s],u=1;u<g;u++)for(var c=1;c<m;c++)i.push(W(t,v(c-1,u-1,l),v(c-1,u,l),v(c,u-1,l),v(c,u,l),r,n,(c+u+l)%2,a&&a[o]?a[o]:[])),o++;return i}function K(t,e,r){for(var n=1;n<y;n++)for(var a=1;a<g;a++)for(var i=1;i<m;i++)q(t,v(i-1,a-1,n-1),v(i-1,a-1,n),v(i-1,a,n-1),v(i-1,a,n),v(i,a-1,n-1),v(i,a-1,n),v(i,a,n-1),v(i,a,n),e,r,(i+a+n)%2)}function $(t,e,r){s=!0,K(t,e,r),s=!1}function Q(t,e,r,n,a,i){for(var o=[],s=0,l=0;l<e.length;l++)for(var u=e[l],c=1;c<y;c++)for(var h=1;h<g;h++)o.push(G(t,u,h,c,r,n,a[l],i&&i[s]&&i[s])),s++;return o}function tt(t,e,r,n,a,i){for(var o=[],s=0,l=0;l<e.length;l++)for(var u=e[l],c=1;c<m;c++)for(var h=1;h<y;h++)o.push(G(t,c,u,h,r,n,a[l],i&&i[s]&&i[s])),s++;return o}function et(t,e,r,n,a,i){for(var o=[],s=0,l=0;l<e.length;l++)for(var u=e[l],c=1;c<g;c++)for(var h=1;h<m;h++)o.push(G(t,h,c,u,r,n,a[l],i&&i[s]&&i[s])),s++;return o}function rt(t,e){for(var r=[],n=t;n<e;n++)r.push(n);return r}return function(){if(C(),function(){for(var e=0;e<m;e++)for(var r=0;r<g;r++)for(var n=0;n<y;n++){var a=v(e,r,n);D(t.x[a],t.y[a],t.z[a],t.value[a])}}(),a&&o&&(O(o),l=!0,K(null,L,A),l=!1),n&&i){O(i);for(var e=t.surface.pattern,r=t.surface.count,s=0;s<r;s++){var u=1===r?.5:s/(r-1),M=(1-u)*L+u*A,S=Math.abs(M-k)>Math.abs(M-T)?[k,M]:[M,T];$(e,S[0],S[1])}}var E=[[Math.min(L,T),Math.max(L,T)],[Math.min(k,A),Math.max(k,A)]];["x","y","z"].forEach((function(e){for(var r=[],n=0;n<E.length;n++){var a=0,i=E[n][0],o=E[n][1],s=t.slices[e];if(s.show&&s.fill){O(s.fill);var l=[],u=[],h=[];if(s.locations.length)for(var v=0;v<s.locations.length;v++){var _=c(s.locations[v],"x"===e?d:"y"===e?f:p);0===_.distRatio?l.push(_.id):_.id>0&&(u.push(_.id),"x"===e?h.push([_.distRatio,0,0]):"y"===e?h.push([0,_.distRatio,0]):h.push([0,0,_.distRatio]))}else l=rt(1,"x"===e?m-1:"y"===e?g-1:y-1);u.length>0&&(r[a]="x"===e?Q(null,u,i,o,h,r[a]):"y"===e?tt(null,u,i,o,h,r[a]):et(null,u,i,o,h,r[a]),a++),l.length>0&&(r[a]="x"===e?Z(null,l,i,o,r[a]):"y"===e?X(null,l,i,o,r[a]):J(null,l,i,o,r[a]),a++)}var x=t.caps[e];x.show&&x.fill&&(O(x.fill),r[a]="x"===e?Z(null,[0,m-1],i,o,r[a]):"y"===e?X(null,[0,g-1],i,o,r[a]):J(null,[0,y-1],i,o,r[a]),a++)}})),0===h&&C(),t._x=_,t._y=x,t._z=b,t._intensity=w,t._Xs=d,t._Ys=f,t._Zs=p}(),t}d.handlePick=function(t){if(t.object===this.mesh){var e=t.data.index,r=this.data._x[e],n=this.data._y[e],a=this.data._z[e],i=this.data._Ys.length,o=this.data._Zs.length,s=c(r,this.data._Xs).id,l=c(n,this.data._Ys).id,u=c(a,this.data._Zs).id,h=t.index=u+o*l+o*i*s;t.traceCoordinate=[this.data._x[h],this.data._y[h],this.data._z[h],this.data.value[h]];var d=this.data.hovertext||this.data.text;return Array.isArray(d)&&void 0!==d[h]?t.textLabel=d[h]:d&&(t.textLabel=d),!0}},d.update=function(t){var e=this.scene,r=e.fullSceneLayout;function n(t,e,r,n){return e.map((function(e){return t.d2l(e,0,n)*r}))}this.data=f(t);var a={positions:l(n(r.xaxis,t._x,e.dataScale[0],t.xcalendar),n(r.yaxis,t._y,e.dataScale[1],t.ycalendar),n(r.zaxis,t._z,e.dataScale[2],t.zcalendar)),cells:l(t._i,t._j,t._k),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:o(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading},u=s(t);a.vertexIntensity=t._intensity,a.vertexIntensityBounds=[u.min,u.max],a.colormap=i(t),this.mesh.update(a)},d.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports={findNearestOnAxis:c,generateIsoMeshes:f,createIsosurfaceTrace:function(t,e){var r=t.glplot.gl,a=n({gl:r}),i=new h(t,a,e.uid);return a._trace=i,i.update(e),t.glplot.add(a),i}}},{"../../components/colorscale":605,"../../lib":719,"../../lib/gl_format_color":716,"../../lib/str2rgbarray":742,"../../plots/gl3d/zip3":818,"gl-mesh3d":280}],1051:[function(t,e,r){var n=t("../../lib"),a=t("../../registry"),i=t("./attributes"),o=t("../../components/colorscale/defaults");function s(t,e,r,n,i){var s=i("isomin"),l=i("isomax");null!=l&&null!=s&&s>l&&(e.isomin=null,e.isomax=null);var u=i("x"),c=i("y"),h=i("z"),d=i("value");u&&u.length&&c&&c.length&&h&&h.length&&d&&d.length?(a.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],n),["x","y","z"].forEach((function(t){var e="caps."+t;i(e+".show")&&i(e+".fill");var r="slices."+t;i(r+".show")&&(i(r+".fill"),i(r+".locations"))})),i("spaceframe.show")&&i("spaceframe.fill"),i("surface.show")&&(i("surface.count"),i("surface.fill"),i("surface.pattern")),i("contour.show")&&(i("contour.color"),i("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach((function(t){i(t)})),o(t,e,n,i,{prefix:"",cLetter:"c"}),e._length=null):e.visible=!1}e.exports={supplyDefaults:function(t,e,r,a){s(t,e,0,a,(function(r,a){return n.coerce(t,e,i,r,a)}))},supplyIsoDefaults:s}},{"../../components/colorscale/defaults":603,"../../lib":719,"../../registry":847,"./attributes":1048}],1052:[function(t,e,r){e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults").supplyDefaults,calc:t("./calc"),colorbar:{min:"cmin",max:"cmax"},plot:t("./convert").createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:t("../../plots/gl3d"),categories:["gl3d"],meta:{}}},{"../../plots/gl3d":807,"./attributes":1048,"./calc":1049,"./convert":1050,"./defaults":1051}],1053:[function(t,e,r){var n=t("../../components/colorscale/attributes"),a=t("../../components/fx/hovertemplate_attributes"),i=t("../surface/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat;e.exports=s({x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},i:{valType:"data_array",editType:"calc"},j:{valType:"data_array",editType:"calc"},k:{valType:"data_array",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:a({editType:"calc"}),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",editType:"calc"},color:{valType:"color",editType:"calc"},vertexcolor:{valType:"data_array",editType:"calc"},facecolor:{valType:"data_array",editType:"calc"},transforms:void 0},n("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:i.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:s({},i.contours.x.show,{}),color:i.contours.x.color,width:i.contours.x.width,editType:"calc"},lightposition:{x:s({},i.lightposition.x,{dflt:1e5}),y:s({},i.lightposition.y,{dflt:1e5}),z:s({},i.lightposition.z,{dflt:0}),editType:"calc"},lighting:s({vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12,editType:"calc"},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6,editType:"calc"},editType:"calc"},i.lighting),hoverinfo:s({},o.hoverinfo,{editType:"calc"})})},{"../../components/colorscale/attributes":600,"../../components/fx/hovertemplate_attributes":631,"../../lib/extend":710,"../../plots/attributes":764,"../surface/attributes":1224}],1054:[function(t,e,r){var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.intensity&&n(t,e,{vals:e.intensity,containerStr:"",cLetter:"c"})}},{"../../components/colorscale/calc":601}],1055:[function(t,e,r){var n=t("gl-mesh3d"),a=t("delaunay-triangulate"),i=t("alpha-shape"),o=t("convex-hull"),s=t("../../lib/gl_format_color").parseColorScale,l=t("../../lib/str2rgbarray"),u=t("../../components/colorscale").extractOpts,c=t("../../plots/gl3d/zip3");function h(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var d=h.prototype;function f(t){for(var e=[],r=t.length,n=0;n<r;n++)e[n]=l(t[n]);return e}function p(t,e,r,n){for(var a=[],i=e.length,o=0;o<i;o++)a[o]=t.d2l(e[o],0,n)*r;return a}function m(t){for(var e=[],r=t.length,n=0;n<r;n++)e[n]=Math.round(t[n]);return e}function g(t,e){for(var r=t.length,n=0;n<r;n++)if(t[n]<=-.5||t[n]>=e-.5)return!1;return!0}d.handlePick=function(t){if(t.object===this.mesh){var e=t.index=t.data.index;t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]];var r=this.data.hovertext||this.data.text;return Array.isArray(r)&&void 0!==r[e]?t.textLabel=r[e]:r&&(t.textLabel=r),!0}},d.update=function(t){var e=this.scene,r=e.fullSceneLayout;this.data=t;var n,h=t.x.length,d=c(p(r.xaxis,t.x,e.dataScale[0],t.xcalendar),p(r.yaxis,t.y,e.dataScale[1],t.ycalendar),p(r.zaxis,t.z,e.dataScale[2],t.zcalendar));if(t.i&&t.j&&t.k){if(t.i.length!==t.j.length||t.j.length!==t.k.length||!g(t.i,h)||!g(t.j,h)||!g(t.k,h))return;n=c(m(t.i),m(t.j),m(t.k))}else n=0===t.alphahull?o(d):t.alphahull>0?i(t.alphahull,d):function(t,e){for(var r=["x","y","z"].indexOf(t),n=[],i=e.length,o=0;o<i;o++)n[o]=[e[o][(r+1)%3],e[o][(r+2)%3]];return a(n)}(t.delaunayaxis,d);var y={positions:d,cells:n,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:l(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading};if(t.intensity){var v=u(t);this.color="#fff",y.vertexIntensity=t.intensity,y.vertexIntensityBounds=[v.min,v.max],y.colormap=s(t)}else t.vertexcolor?(this.color=t.vertexcolor[0],y.vertexColors=f(t.vertexcolor)):t.facecolor?(this.color=t.facecolor[0],y.cellColors=f(t.facecolor)):(this.color=t.color,y.meshColor=l(t.color));this.mesh.update(y)},d.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=function(t,e){var r=t.glplot.gl,a=n({gl:r}),i=new h(t,a,e.uid);return a._trace=i,i.update(e),t.glplot.add(a),i}},{"../../components/colorscale":605,"../../lib/gl_format_color":716,"../../lib/str2rgbarray":742,"../../plots/gl3d/zip3":818,"alpha-shape":64,"convex-hull":130,"delaunay-triangulate":165,"gl-mesh3d":280}],1056:[function(t,e,r){var n=t("../../registry"),a=t("../../lib"),i=t("../../components/colorscale/defaults"),o=t("./attributes");e.exports=function(t,e,r,s){function l(r,n){return a.coerce(t,e,o,r,n)}function u(t){var e=t.map((function(t){var e=l(t);return e&&a.isArrayOrTypedArray(e)?e:null}));return e.every((function(t){return t&&t.length===e[0].length}))&&e}u(["x","y","z"])?(u(["i","j","k"]),(!e.i||e.j&&e.k)&&(!e.j||e.k&&e.i)&&(!e.k||e.i&&e.j)?(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"),i(t,e,s,l,{prefix:"",cLetter:"c"})):(e.showscale=!1,"facecolor"in t?l("facecolor"):"vertexcolor"in t?l("vertexcolor"):l("color",r)),l("text"),l("hovertext"),l("hovertemplate"),e._length=null):e.visible=!1):e.visible=!1}},{"../../components/colorscale/defaults":603,"../../lib":719,"../../registry":847,"./attributes":1053}],1057:[function(t,e,r){e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),colorbar:{min:"cmin",max:"cmax"},plot:t("./convert"),moduleType:"trace",name:"mesh3d",basePlotModule:t("../../plots/gl3d"),categories:["gl3d"],meta:{}}},{"../../plots/gl3d":807,"./attributes":1053,"./calc":1054,"./convert":1055,"./defaults":1056}],1058:[function(t,e,r){var n=t("../../lib").extendFlat,a=t("../scatter/attributes"),i=t("../../components/drawing/attributes").dash,o=t("../../components/fx/attributes"),s=t("../../constants/delta.js"),l=s.INCREASING.COLOR,u=s.DECREASING.COLOR,c=a.line;function h(t){return{line:{color:n({},c.color,{dflt:t}),width:c.width,dash:i,editType:"style"},editType:"style"}}e.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes"},open:{valType:"data_array",editType:"calc"},high:{valType:"data_array",editType:"calc"},low:{valType:"data_array",editType:"calc"},close:{valType:"data_array",editType:"calc"},line:{width:n({},c.width,{}),dash:n({},i,{}),editType:"style"},increasing:h(l),decreasing:h(u),text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},tickwidth:{valType:"number",min:0,max:.5,dflt:.3,editType:"calc"},hoverlabel:n({},o.hoverlabel,{split:{valType:"boolean",dflt:!1,editType:"style"}})}},{"../../components/drawing/attributes":613,"../../components/fx/attributes":623,"../../constants/delta.js":689,"../../lib":719,"../scatter/attributes":1112}],1059:[function(t,e,r){var n=t("../../lib"),a=n._,i=t("../../plots/cartesian/axes"),o=t("../../constants/numerical").BADNUM;function s(t,e,r,n){return{o:t,h:e,l:r,c:n}}function l(t,e,r,s,l){for(var u=s.makeCalcdata(e,"open"),c=s.makeCalcdata(e,"high"),h=s.makeCalcdata(e,"low"),d=s.makeCalcdata(e,"close"),f=Array.isArray(e.text),p=Array.isArray(e.hovertext),m=!0,g=null,y=[],v=0;v<r.length;v++){var _=r[v],x=u[v],b=c[v],w=h[v],M=d[v];if(_!==o&&x!==o&&b!==o&&w!==o&&M!==o){M===x?null!==g&&M!==g&&(m=M>g):m=M>x,g=M;var k=l(x,b,w,M);k.pos=_,k.yc=(x+M)/2,k.i=v,k.dir=m?"increasing":"decreasing",k.x=k.pos,k.y=[w,b],f&&(k.tx=e.text[v]),p&&(k.htx=e.hovertext[v]),y.push(k)}else y.push({pos:_,empty:!0})}return e._extremes[s._id]=i.findExtremes(s,n.concat(h,c),{padded:!0}),y.length&&(y[0].t={labels:{open:a(t,"open:")+" ",high:a(t,"high:")+" ",low:a(t,"low:")+" ",close:a(t,"close:")+" "}}),y}e.exports={calc:function(t,e){var r=i.getFromId(t,e.xaxis),a=i.getFromId(t,e.yaxis),o=function(t,e,r){var a=r._minDiff;if(!a){var i,o=t._fullData,s=[];for(a=1/0,i=0;i<o.length;i++){var l=o[i];if("ohlc"===l.type&&!0===l.visible&&l.xaxis===e._id){s.push(l);var u=e.makeCalcdata(l,"x");l._xcalc=u;var c=n.distinctVals(u).minDiff;c&&isFinite(c)&&(a=Math.min(a,c))}}for(a===1/0&&(a=1),i=0;i<s.length;i++)s[i]._minDiff=a}return a*r.tickwidth}(t,r,e),u=e._minDiff;e._minDiff=null;var c=e._xcalc;e._xcalc=null;var h=l(t,e,c,a,s);return e._extremes[r._id]=i.findExtremes(r,c,{vpad:u/2}),h.length?(n.extendFlat(h[0].t,{wHover:u/2,tickLen:o}),h):[{t:{empty:!0}}]},calcCommon:l}},{"../../constants/numerical":695,"../../lib":719,"../../plots/cartesian/axes":767}],1060:[function(t,e,r){var n=t("../../lib"),a=t("./ohlc_defaults"),i=t("./attributes");function o(t,e,r,n){r(n+".line.color"),r(n+".line.width",e.line.width),r(n+".line.dash",e.line.dash)}e.exports=function(t,e,r,s){function l(r,a){return n.coerce(t,e,i,r,a)}a(t,e,l,s)?(l("line.width"),l("line.dash"),o(0,e,l,"increasing"),o(0,e,l,"decreasing"),l("text"),l("hovertext"),l("tickwidth"),s._requestRangeslider[e.xaxis]=!0):e.visible=!1}},{"../../lib":719,"./attributes":1058,"./ohlc_defaults":1063}],1061:[function(t,e,r){var n=t("../../plots/cartesian/axes"),a=t("../../lib"),i=t("../../components/fx"),o=t("../../components/color"),s=t("../../lib").fillText,l=t("../../constants/delta.js"),u={increasing:l.INCREASING.SYMBOL,decreasing:l.DECREASING.SYMBOL};function c(t,e,r,n){var a,s,l=t.cd,u=t.xa,c=l[0].trace,h=l[0].t,d=c.type,f="ohlc"===d?"l":"min",p="ohlc"===d?"h":"max",m=h.bPos||0,g=function(t){return t.pos+m-e},y=h.bdPos||h.tickLen,v=h.wHover,_=Math.min(1,y/Math.abs(u.r2c(u.range[1])-u.r2c(u.range[0])));function x(t){var e=g(t);return i.inbox(e-v,e+v,a)}function b(t){var e=t[f],n=t[p];return e===n||i.inbox(e-r,n-r,a)}function w(t){return(x(t)+b(t))/2}a=t.maxHoverDistance-_,s=t.maxSpikeDistance-_;var M=i.getDistanceFunction(n,x,b,w);if(i.getClosest(l,M,t),!1===t.index)return null;var k=l[t.index];if(k.empty)return null;var T=c[k.dir],L=T.line.color;return o.opacity(L)&&T.line.width?t.color=L:t.color=T.fillcolor,t.x0=u.c2p(k.pos+m-y,!0),t.x1=u.c2p(k.pos+m+y,!0),t.xLabelVal=k.pos,t.spikeDistance=w(k)*s/a,t.xSpike=u.c2p(k.pos,!0),t}function h(t,e,r,i){var o=t.cd,s=t.ya,l=o[0].trace,u=o[0].t,h=[],d=c(t,e,r,i);if(!d)return[];var f=o[d.index].hi||l.hoverinfo,p=f.split("+");if("all"!==f&&-1===p.indexOf("y"))return[];for(var m=["high","open","close","low"],g={},y=0;y<m.length;y++){var v,_=m[y],x=l[_][d.index],b=s.c2p(x,!0);x in g?(v=g[x]).yLabel+="<br>"+u.labels[_]+n.hoverLabelText(s,x):((v=a.extendFlat({},d)).y0=v.y1=b,v.yLabelVal=x,v.yLabel=u.labels[_]+n.hoverLabelText(s,x),v.name="",h.push(v),g[x]=v)}return h}function d(t,e,r,a){var i=t.cd,o=t.ya,l=i[0].trace,h=i[0].t,d=c(t,e,r,a);if(!d)return[];var f=i[d.index],p=d.index=f.i,m=f.dir;function g(t){return h.labels[t]+n.hoverLabelText(o,l[t][p])}var y=f.hi||l.hoverinfo,v=y.split("+"),_="all"===y,x=_||-1!==v.indexOf("y"),b=_||-1!==v.indexOf("text"),w=x?[g("open"),g("high"),g("low"),g("close")+" "+u[m]]:[];return b&&s(f,l,w),d.extraText=w.join("<br>"),d.y0=d.y1=o.c2p(f.yc,!0),[d]}e.exports={hoverPoints:function(t,e,r,n){return t.cd[0].trace.hoverlabel.split?h(t,e,r,n):d(t,e,r,n)},hoverSplit:h,hoverOnPoints:d}},{"../../components/color":593,"../../components/fx":632,"../../constants/delta.js":689,"../../lib":719,"../../plots/cartesian/axes":767}],1062:[function(t,e,r){e.exports={moduleType:"trace",name:"ohlc",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","showLegend"],meta:{},attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc").calc,plot:t("./plot"),style:t("./style"),hoverPoints:t("./hover").hoverPoints,selectPoints:t("./select")}},{"../../plots/cartesian":778,"./attributes":1058,"./calc":1059,"./defaults":1060,"./hover":1061,"./plot":1064,"./select":1065,"./style":1066}],1063:[function(t,e,r){var n=t("../../registry"),a=t("../../lib");e.exports=function(t,e,r,i){var o=r("x"),s=r("open"),l=r("high"),u=r("low"),c=r("close");if(r("hoverlabel.split"),n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x"],i),s&&l&&u&&c){var h=Math.min(s.length,l.length,u.length,c.length);return o&&(h=Math.min(h,a.minRowLength(o))),e._length=h,h}}},{"../../lib":719,"../../registry":847}],1064:[function(t,e,r){var n=t("d3"),a=t("../../lib");e.exports=function(t,e,r,i){var o=e.xaxis,s=e.yaxis;a.makeTraceGroups(i,r,"trace ohlc").each((function(t){var e=n.select(this),r=t[0],i=r.t;if(!0!==r.trace.visible||i.empty)e.remove();else{var l=i.tickLen,u=e.selectAll("path").data(a.identity);u.enter().append("path"),u.exit().remove(),u.attr("d",(function(t){if(t.empty)return"M0,0Z";var e=o.c2p(t.pos,!0),r=o.c2p(t.pos-l,!0),n=o.c2p(t.pos+l,!0);return"M"+r+","+s.c2p(t.o,!0)+"H"+e+"M"+e+","+s.c2p(t.h,!0)+"V"+s.c2p(t.l,!0)+"M"+n+","+s.c2p(t.c,!0)+"H"+e}))}}))}},{"../../lib":719,d3:163}],1065:[function(t,e,r){e.exports=function(t,e){var r,n=t.cd,a=t.xaxis,i=t.yaxis,o=[],s=n[0].t.bPos||0;if(!1===e)for(r=0;r<n.length;r++)n[r].selected=0;else for(r=0;r<n.length;r++){var l=n[r];e.contains([a.c2p(l.pos+s),i.c2p(l.yc)],null,l.i,t)?(o.push({pointNumber:l.i,x:a.c2d(l.pos),y:i.c2d(l.yc)}),l.selected=1):l.selected=0}return o}},{}],1066:[function(t,e,r){var n=t("d3"),a=t("../../components/drawing"),i=t("../../components/color");e.exports=function(t,e,r){var o=r||n.select(t).selectAll("g.ohlclayer").selectAll("g.trace");o.style("opacity",(function(t){return t[0].trace.opacity})),o.each((function(t){var e=t[0].trace;n.select(this).selectAll("path").each((function(t){if(!t.empty){var r=e[t.dir].line;n.select(this).style("fill","none").call(i.stroke,r.color).call(a.dashLine,r.dash,r.width).style("opacity",e.selectedpoints&&!t.selected?.3:1)}}))}))}},{"../../components/color":593,"../../components/drawing":614,d3:163}],1067:[function(t,e,r){var n=t("../../lib/extend").extendFlat,a=t("../../plots/attributes"),i=t("../../plots/font_attributes"),o=t("../../components/colorscale/attributes"),s=t("../../components/fx/hovertemplate_attributes"),l=t("../../plots/domain").attributes,u=n({editType:"calc"},o("line",{editTypeOverride:"calc"}),{shape:{valType:"enumerated",values:["linear","hspline"],dflt:"linear",editType:"plot"},hovertemplate:s({editType:"plot",arrayOk:!1},{keys:["count","probability"]})});e.exports={domain:l({name:"parcats",trace:!0,editType:"calc"}),hoverinfo:n({},a.hoverinfo,{flags:["count","probability"],editType:"plot",arrayOk:!1}),hoveron:{valType:"enumerated",values:["category","color","dimension"],dflt:"category",editType:"plot"},hovertemplate:s({editType:"plot",arrayOk:!1},{keys:["count","probability","category","categorycount","colorcount","bandcolorcount"]}),arrangement:{valType:"enumerated",values:["perpendicular","freeform","fixed"],dflt:"perpendicular",editType:"plot"},bundlecolors:{valType:"boolean",dflt:!0,editType:"plot"},sortpaths:{valType:"enumerated",values:["forward","backward"],dflt:"forward",editType:"plot"},labelfont:i({editType:"calc"}),tickfont:i({editType:"calc"}),dimensions:{_isLinkedToArray:"dimension",label:{valType:"string",editType:"calc"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},values:{valType:"data_array",dflt:[],editType:"calc"},displayindex:{valType:"integer",editType:"calc"},editType:"calc",visible:{valType:"boolean",dflt:!0,editType:"calc"}},line:u,counts:{valType:"number",min:0,dflt:1,arrayOk:!0,editType:"calc"},customdata:void 0,hoverlabel:void 0,ids:void 0,legendgroup:void 0,opacity:void 0,selectedpoints:void 0,showlegend:void 0}},{"../../components/colorscale/attributes":600,"../../components/fx/hovertemplate_attributes":631,"../../lib/extend":710,"../../plots/attributes":764,"../../plots/domain":792,"../../plots/font_attributes":793}],1068:[function(t,e,r){var n=t("../../plots/get_data").getModuleCalcData,a=t("./plot");r.name="parcats",r.plot=function(t,e,r,i){var o=n(t.calcdata,"parcats");if(o.length){var s=o[0];a(t,s,r,i)}},r.clean=function(t,e,r,n){var a=n._has&&n._has("parcats"),i=e._has&&e._has("parcats");a&&!i&&n._paperdiv.selectAll(".parcats").remove()}},{"../../plots/get_data":802,"./plot":1073}],1069:[function(t,e,r){var n=t("../../lib/gup").wrap,a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/calc"),o=t("../../lib/filter_unique.js"),s=t("../../components/drawing"),l=t("../../lib");function u(t,e,r){t.valueInds.push(e),t.count+=r}function c(t,e,r){t.valueInds.push(e),t.count+=r}e.exports=function(t,e){var r=l.filterVisible(e.dimensions);if(0===r.length)return[];var h,d,f,p=r.map((function(t){var e;return"trace"===t.categoryorder?e=null:"array"===t.categoryorder?e=t.categoryarray:(e=o(t.values).sort(),"category descending"===t.categoryorder&&(e=e.reverse())),function(t,e){e=null==e?[]:e.map((function(t){return t}));var r={},n={},a=[];e.forEach((function(t,e){r[t]=0,n[t]=e}));for(var i=0;i<t.length;i++){var o,s=t[i];void 0===r[s]?(r[s]=1,o=e.push(s)-1,n[s]=o):(r[s]++,o=n[s]),a.push(o)}var l=e.map((function(t){return r[t]}));return{uniqueValues:e,uniqueCounts:l,inds:a}}(t.values,e)}));h=l.isArrayOrTypedArray(e.counts)?e.counts:[e.counts],function(t){var e;if(function(t){for(var e=new Array(t.length),r=0;r<t.length;r++){if(t[r]<0||t[r]>=t.length)return!1;if(void 0!==e[t[r]])return!1;e[t[r]]=!0}return!0}(t.map((function(t){return t.displayindex}))))for(e=0;e<t.length;e++)t[e]._displayindex=t[e].displayindex;else for(e=0;e<t.length;e++)t[e]._displayindex=e}(r),r.forEach((function(t,e){!function(t,e){t._categoryarray=e.uniqueValues,null===t.ticktext||void 0===t.ticktext?t._ticktext=[]:t._ticktext=t.ticktext.slice();for(var r=t._ticktext.length;r<e.uniqueValues.length;r++)t._ticktext.push(e.uniqueValues[r])}(t,p[e])}));var m,g=e.line;g?(a(e,"line")&&i(t,e,{vals:e.line.color,containerStr:"line",cLetter:"c"}),m=s.tryColorscale(g)):m=l.identity;var y,v,_,x,b=r[0].values.length,w={},M=p.map((function(t){return t.inds}));for(f=0,y=0;y<b;y++){var k=[];for(v=0;v<M.length;v++)k.push(M[v][y]);d=h[y%h.length],f+=d;var T=(_=y,void 0,{color:m(x=l.isArrayOrTypedArray(g.color)?g.color[_%g.color.length]:g.color),rawColor:x}),L=k+"-"+T.rawColor;void 0===w[L]&&(w[L]={categoryInds:k,color:T.color,rawColor:T.rawColor,valueInds:[],count:0}),c(w[L],y,d)}var A,S=r.map((function(t,e){return{dimensionInd:e,containerInd:t._index,displayInd:t._displayindex,dimensionLabel:t.label,count:f,categories:[],dragX:null}}));for(y=0;y<b;y++)for(d=h[y%h.length],v=0;v<S.length;v++){var E=S[v].containerInd,C=p[v].inds[y],D=S[v].categories;if(void 0===D[C]){var P=e.dimensions[E]._categoryarray[C],O=e.dimensions[E]._ticktext[C];D[C]={dimensionInd:v,categoryInd:A=C,categoryValue:P,displayInd:A,categoryLabel:O,valueInds:[],count:0,dragY:null}}u(D[C],y,d)}return n(function(t,e,r){var n=t.map((function(t){return t.categories.length})).reduce((function(t,e){return Math.max(t,e)}));return{dimensions:t,paths:e,trace:void 0,maxCats:n,count:r}}(S,w,f))}},{"../../components/colorscale/calc":601,"../../components/colorscale/helpers":604,"../../components/drawing":614,"../../lib":719,"../../lib/filter_unique.js":711,"../../lib/gup":717}],1070:[function(t,e,r){var n=t("../../lib"),a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults"),o=t("../../plots/domain").defaults,s=t("../../plots/array_container_defaults"),l=t("./attributes"),u=t("../parcoords/merge_length");function c(t,e){function r(r,a){return n.coerce(t,e,l.dimensions,r,a)}var a=r("values"),i=r("visible");if(a&&a.length||(i=e.visible=!1),i){r("label"),r("displayindex",e._index);var o,s=t.categoryarray,u=Array.isArray(s)&&s.length>0;u&&(o="array");var c=r("categoryorder",o);"array"===c?(r("categoryarray"),r("ticktext")):(delete t.categoryarray,delete t.ticktext),u||"array"!==c||(e.categoryorder="trace")}}e.exports=function(t,e,r,h){function d(r,a){return n.coerce(t,e,l,r,a)}var f=s(t,e,{name:"dimensions",handleItemDefaults:c}),p=function(t,e,r,o,s){s("line.shape"),s("line.hovertemplate");var l=s("line.color",o.colorway[0]);if(a(t,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),i(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=r}return 1/0}(t,e,r,h,d);o(e,h,d),Array.isArray(f)&&f.length||(e.visible=!1),u(e,f,"values",p),d("hoveron"),d("hovertemplate"),d("arrangement"),d("bundlecolors"),d("sortpaths"),d("counts");var m={family:h.font.family,size:Math.round(h.font.size),color:h.font.color};n.coerceFont(d,"labelfont",m);var g={family:h.font.family,size:Math.round(h.font.size/1.2),color:h.font.color};n.coerceFont(d,"tickfont",g)}},{"../../components/colorscale/defaults":603,"../../components/colorscale/helpers":604,"../../lib":719,"../../plots/array_container_defaults":763,"../../plots/domain":792,"../parcoords/merge_length":1083,"./attributes":1067}],1071:[function(t,e,r){e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:t("./base_plot"),categories:["noOpacity"],meta:{}}},{"./attributes":1067,"./base_plot":1068,"./calc":1069,"./defaults":1070,"./plot":1073}],1072:[function(t,e,r){var n=t("d3"),a=t("../../plot_api/plot_api"),i=t("../../components/fx"),o=t("../../lib"),s=t("../../components/drawing"),l=t("tinycolor2"),u=t("../../lib/svg_text_utils");function c(t,e,r,a){var i=t.map(function(t,e,r){var n,a=r[0],i=e.margin||{l:80,r:80,t:100,b:80},o=a.trace,s=o.domain,l=e.width,u=e.height,c=Math.floor(l*(s.x[1]-s.x[0])),h=Math.floor(u*(s.y[1]-s.y[0])),d=s.x[0]*l+i.l,f=e.height-s.y[1]*e.height+i.t,p=o.line.shape;n="all"===o.hoverinfo?["count","probability"]:(o.hoverinfo||"").split("+");var m={trace:o,key:o.uid,model:a,x:d,y:f,width:c,height:h,hoveron:o.hoveron,hoverinfoItems:n,arrangement:o.arrangement,bundlecolors:o.bundlecolors,sortpaths:o.sortpaths,labelfont:o.labelfont,categorylabelfont:o.tickfont,pathShape:p,dragDimension:null,margin:i,paths:[],dimensions:[],graphDiv:t,traceSelection:null,pathSelection:null,dimensionSelection:null};return a.dimensions&&(R(m),I(m)),m}.bind(0,e,r)),l=a.selectAll("g.parcatslayer").data([null]);l.enter().append("g").attr("class","parcatslayer").style("pointer-events","all");var c=l.selectAll("g.trace.parcats").data(i,h),g=c.enter().append("g").attr("class","trace parcats");c.attr("transform",(function(t){return"translate("+t.x+", "+t.y+")"})),g.append("g").attr("class","paths");var _=c.select("g.paths").selectAll("path.path").data((function(t){return t.paths}),h);_.attr("fill",(function(t){return t.model.color}));var w=_.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",(function(t){return t.model.color})).attr("fill-opacity",0);v(w),_.attr("d",(function(t){return t.svgD})),w.empty()||_.sort(f),_.exit().remove(),_.on("mouseover",p).on("mouseout",m).on("click",y),g.append("g").attr("class","dimensions");var M=c.select("g.dimensions").selectAll("g.dimension").data((function(t){return t.dimensions}),h);M.enter().append("g").attr("class","dimension"),M.attr("transform",(function(t){return"translate("+t.x+", 0)"})),M.exit().remove();var k=M.selectAll("g.category").data((function(t){return t.categories}),h),T=k.enter().append("g").attr("class","category");k.attr("transform",(function(t){return"translate(0, "+t.y+")"})),T.append("rect").attr("class","catrect").attr("pointer-events","none"),k.select("rect.catrect").attr("fill","none").attr("width",(function(t){return t.width})).attr("height",(function(t){return t.height})),x(T);var D=k.selectAll("rect.bandrect").data((function(t){return t.bands}),h);D.each((function(){o.raiseToTop(this)})),D.attr("fill",(function(t){return t.color}));var P=D.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",(function(t){return t.color})).attr("fill-opacity",0);D.attr("fill",(function(t){return t.color})).attr("width",(function(t){return t.width})).attr("height",(function(t){return t.height})).attr("y",(function(t){return t.y})).attr("cursor",(function(t){return"fixed"===t.parcatsViewModel.arrangement?"default":"perpendicular"===t.parcatsViewModel.arrangement?"ns-resize":"move"})),b(P),D.exit().remove(),T.append("text").attr("class","catlabel").attr("pointer-events","none");var O=e._fullLayout.paper_bgcolor;k.select("text.catlabel").attr("text-anchor",(function(t){return d(t)?"start":"end"})).attr("alignment-baseline","middle").style("text-shadow",O+" -1px 1px 2px, "+O+" 1px 1px 2px, "+O+" 1px -1px 2px, "+O+" -1px -1px 2px").style("fill","rgb(0, 0, 0)").attr("x",(function(t){return d(t)?t.width+5:-5})).attr("y",(function(t){return t.height/2})).text((function(t){return t.model.categoryLabel})).each((function(t){s.font(n.select(this),t.parcatsViewModel.categorylabelfont),u.convertToTspans(n.select(this),e)})),T.append("text").attr("class","dimlabel"),k.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",(function(t){return"fixed"===t.parcatsViewModel.arrangement?"default":"ew-resize"})).attr("x",(function(t){return t.width/2})).attr("y",-5).text((function(t,e){return 0===e?t.parcatsViewModel.model.dimensions[t.model.dimensionInd].dimensionLabel:null})).each((function(t){s.font(n.select(this),t.parcatsViewModel.labelfont)})),k.selectAll("rect.bandrect").on("mouseover",L).on("mouseout",A),k.exit().remove(),M.call(n.behavior.drag().origin((function(t){return{x:t.x,y:0}})).on("dragstart",S).on("drag",E).on("dragend",C)),c.each((function(t){t.traceSelection=n.select(this),t.pathSelection=n.select(this).selectAll("g.paths").selectAll("path.path"),t.dimensionSelection=n.select(this).selectAll("g.dimensions").selectAll("g.dimension")})),c.exit().remove()}function h(t){return t.key}function d(t){var e=t.parcatsViewModel.dimensions.length,r=t.parcatsViewModel.dimensions[e-1].model.dimensionInd;return t.model.dimensionInd===r}function f(t,e){return t.model.rawColor>e.model.rawColor?1:t.model.rawColor<e.model.rawColor?-1:0}function p(t){if(!t.parcatsViewModel.dragDimension&&-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")){o.raiseToTop(this),_(n.select(this));var e=g(t);if(t.parcatsViewModel.graphDiv.emit("plotly_hover",{points:e,event:n.event}),-1===t.parcatsViewModel.hoverinfoItems.indexOf("none")){var r,a,s,u=n.mouse(this)[0],c=t.parcatsViewModel.graphDiv,h=t.parcatsViewModel.trace,d=c._fullLayout,f=d._paperdiv.node().getBoundingClientRect(),p=t.parcatsViewModel.graphDiv.getBoundingClientRect();for(s=0;s<t.leftXs.length-1;s++)if(t.leftXs[s]+t.dimWidths[s]-2<=u&&u<=t.leftXs[s+1]+2){var m=t.parcatsViewModel.dimensions[s],y=t.parcatsViewModel.dimensions[s+1];r=(m.x+m.width+y.x)/2,a=(t.topYs[s]+t.topYs[s+1]+t.height)/2;break}var v=t.parcatsViewModel.x+r,x=t.parcatsViewModel.y+a,b=l.mostReadable(t.model.color,["black","white"]),w=t.model.count,M=w/t.parcatsViewModel.model.count,k={countLabel:w,probabilityLabel:M.toFixed(3)},T=[];-1!==t.parcatsViewModel.hoverinfoItems.indexOf("count")&&T.push(["Count:",k.countLabel].join(" ")),-1!==t.parcatsViewModel.hoverinfoItems.indexOf("probability")&&T.push(["P:",k.probabilityLabel].join(" "));var L=T.join("<br>"),A=n.mouse(c)[0];i.loneHover({trace:h,x:v-f.left+p.left,y:x-f.top+p.top,text:L,color:t.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:b,idealAlign:A<v?"right":"left",hovertemplate:(h.line||{}).hovertemplate,hovertemplateLabels:k,eventData:[{data:h._input,fullData:h,count:w,probability:M}]},{container:d._hoverlayer.node(),outerContainer:d._paper.node(),gd:c})}}}function m(t){if(!t.parcatsViewModel.dragDimension&&(v(n.select(this)),i.loneUnhover(t.parcatsViewModel.graphDiv._fullLayout._hoverlayer.node()),t.parcatsViewModel.pathSelection.sort(f),-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip"))){var e=g(t);t.parcatsViewModel.graphDiv.emit("plotly_unhover",{points:e,event:n.event})}}function g(t){for(var e=[],r=D(t.parcatsViewModel),n=0;n<t.model.valueInds.length;n++){var a=t.model.valueInds[n];e.push({curveNumber:r,pointNumber:a})}return e}function y(t){if(-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")){var e=g(t);t.parcatsViewModel.graphDiv.emit("plotly_click",{points:e,event:n.event})}}function v(t){t.attr("fill",(function(t){return t.model.color})).attr("fill-opacity",.6).attr("stroke","lightgray").attr("stroke-width",.2).attr("stroke-opacity",1)}function _(t){t.attr("fill-opacity",.8).attr("stroke",(function(t){return l.mostReadable(t.model.color,["black","white"])})).attr("stroke-width",.3)}function x(t){t.select("rect.catrect").attr("stroke","black").attr("stroke-width",1).attr("stroke-opacity",1)}function b(t){t.attr("stroke","black").attr("stroke-width",.2).attr("stroke-opacity",1).attr("fill-opacity",1)}function w(t){var e=t.parcatsViewModel.pathSelection,r=t.categoryViewModel.model.dimensionInd,n=t.categoryViewModel.model.categoryInd;return e.filter((function(e){return e.model.categoryInds[r]===n&&e.model.color===t.color}))}function M(t,e,r){var a=n.select(t).datum().parcatsViewModel.graphDiv,i=n.select(t.parentNode).selectAll("rect.bandrect"),o=[];i.each((function(t){w(t).each((function(t){Array.prototype.push.apply(o,g(t))}))})),a.emit(e,{points:o,event:r})}function k(t,e,r){var a=n.select(t).datum(),i=a.parcatsViewModel.graphDiv,o=w(a),s=[];o.each((function(t){Array.prototype.push.apply(s,g(t))})),i.emit(e,{points:s,event:r})}function T(t,e){var r,a,i=n.select(e.parentNode).select("rect.catrect"),o=i.node().getBoundingClientRect(),s=i.datum(),l=s.parcatsViewModel,u=l.model.dimensions[s.model.dimensionInd],c=l.trace,h=o.top+o.height/2;l.dimensions.length>1&&u.displayInd===l.dimensions.length-1?(r=o.left,a="left"):(r=o.left+o.width,a="right");var d=s.model.count,f=s.model.categoryLabel,p=d/s.parcatsViewModel.model.count,m={countLabel:d,categoryLabel:f,probabilityLabel:p.toFixed(3)},g=[];-1!==s.parcatsViewModel.hoverinfoItems.indexOf("count")&&g.push(["Count:",m.countLabel].join(" ")),-1!==s.parcatsViewModel.hoverinfoItems.indexOf("probability")&&g.push(["P("+m.categoryLabel+"):",m.probabilityLabel].join(" "));var y=g.join("<br>");return{trace:c,x:r-t.left,y:h-t.top,text:y,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:a,hovertemplate:c.hovertemplate,hovertemplateLabels:m,eventData:[{data:c._input,fullData:c,count:d,category:f,probability:p}]}}function L(t){if(!t.parcatsViewModel.dragDimension&&-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")){if(n.mouse(this)[1]<-1)return;var e,r=t.parcatsViewModel.graphDiv,a=r._fullLayout,s=a._paperdiv.node().getBoundingClientRect(),u=t.parcatsViewModel.hoveron;"color"===u?(function(t){var e=n.select(t).datum(),r=w(e);_(r),r.each((function(){o.raiseToTop(this)})),n.select(t.parentNode).selectAll("rect.bandrect").filter((function(t){return t.color===e.color})).each((function(){o.raiseToTop(this),n.select(this).attr("stroke","black").attr("stroke-width",1.5)}))}(this),k(this,"plotly_hover",n.event)):(function(t){n.select(t.parentNode).selectAll("rect.bandrect").each((function(t){var e=w(t);_(e),e.each((function(){o.raiseToTop(this)}))})),n.select(t.parentNode).select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5)}(this),M(this,"plotly_hover",n.event)),-1===t.parcatsViewModel.hoverinfoItems.indexOf("none")&&("category"===u?e=T(s,this):"color"===u?e=function(t,e){var r,a,i=e.getBoundingClientRect(),o=n.select(e).datum(),s=o.categoryViewModel,u=s.parcatsViewModel,c=u.model.dimensions[s.model.dimensionInd],h=u.trace,d=i.y+i.height/2;u.dimensions.length>1&&c.displayInd===u.dimensions.length-1?(r=i.left,a="left"):(r=i.left+i.width,a="right");var f=s.model.categoryLabel,p=o.parcatsViewModel.model.count,m=0;o.categoryViewModel.bands.forEach((function(t){t.color===o.color&&(m+=t.count)}));var g=s.model.count,y=0;u.pathSelection.each((function(t){t.model.color===o.color&&(y+=t.model.count)}));var v=m/p,_=m/y,x=m/g,b={countLabel:p,categoryLabel:f,probabilityLabel:v.toFixed(3)},w=[];-1!==s.parcatsViewModel.hoverinfoItems.indexOf("count")&&w.push(["Count:",b.countLabel].join(" ")),-1!==s.parcatsViewModel.hoverinfoItems.indexOf("probability")&&(w.push("P(color ∩ "+f+"): "+b.probabilityLabel),w.push("P("+f+" | color): "+_.toFixed(3)),w.push("P(color | "+f+"): "+x.toFixed(3)));var M=w.join("<br>"),k=l.mostReadable(o.color,["black","white"]);return{trace:h,x:r-t.left,y:d-t.top,text:M,color:o.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:k,fontSize:10,idealAlign:a,hovertemplate:h.hovertemplate,hovertemplateLabels:b,eventData:[{data:h._input,fullData:h,category:f,count:p,probability:v,categorycount:g,colorcount:y,bandcolorcount:m}]}}(s,this):"dimension"===u&&(e=function(t,e){var r=[];return n.select(e.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each((function(){r.push(T(t,this))})),r}(s,this)),e&&i.loneHover(e,{container:a._hoverlayer.node(),outerContainer:a._paper.node(),gd:r}))}}function A(t){var e=t.parcatsViewModel;e.dragDimension||(v(e.pathSelection),x(e.dimensionSelection.selectAll("g.category")),b(e.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),i.loneUnhover(e.graphDiv._fullLayout._hoverlayer.node()),e.pathSelection.sort(f),-1!==e.hoverinfoItems.indexOf("skip"))||("color"===t.parcatsViewModel.hoveron?k(this,"plotly_unhover",n.event):M(this,"plotly_unhover",n.event))}function S(t){"fixed"!==t.parcatsViewModel.arrangement&&(t.dragDimensionDisplayInd=t.model.displayInd,t.initialDragDimensionDisplayInds=t.parcatsViewModel.model.dimensions.map((function(t){return t.displayInd})),t.dragHasMoved=!1,t.dragCategoryDisplayInd=null,n.select(this).selectAll("g.category").select("rect.catrect").each((function(e){var r=n.mouse(this)[0],a=n.mouse(this)[1];-2<=r&&r<=e.width+2&&-2<=a&&a<=e.height+2&&(t.dragCategoryDisplayInd=e.model.displayInd,t.initialDragCategoryDisplayInds=t.model.categories.map((function(t){return t.displayInd})),e.model.dragY=e.y,o.raiseToTop(this.parentNode),n.select(this.parentNode).selectAll("rect.bandrect").each((function(e){e.y<a&&a<=e.y+e.height&&(t.potentialClickBand=this)})))})),t.parcatsViewModel.dragDimension=t,i.loneUnhover(t.parcatsViewModel.graphDiv._fullLayout._hoverlayer.node()))}function E(t){if("fixed"!==t.parcatsViewModel.arrangement&&(t.dragHasMoved=!0,null!==t.dragDimensionDisplayInd)){var e=t.dragDimensionDisplayInd,r=e-1,a=e+1,i=t.parcatsViewModel.dimensions[e];if(null!==t.dragCategoryDisplayInd){var o=i.categories[t.dragCategoryDisplayInd];o.model.dragY+=n.event.dy;var s=o.model.dragY,l=o.model.displayInd,u=i.categories,c=u[l-1],h=u[l+1];void 0!==c&&s<c.y+c.height/2&&(o.model.displayInd=c.model.displayInd,c.model.displayInd=l),void 0!==h&&s+o.height>h.y+h.height/2&&(o.model.displayInd=h.model.displayInd,h.model.displayInd=l),t.dragCategoryDisplayInd=o.model.displayInd}if(null===t.dragCategoryDisplayInd||"freeform"===t.parcatsViewModel.arrangement){i.model.dragX=n.event.x;var d=t.parcatsViewModel.dimensions[r],f=t.parcatsViewModel.dimensions[a];void 0!==d&&i.model.dragX<d.x+d.width&&(i.model.displayInd=d.model.displayInd,d.model.displayInd=e),void 0!==f&&i.model.dragX+i.width>f.x&&(i.model.displayInd=f.model.displayInd,f.model.displayInd=t.dragDimensionDisplayInd),t.dragDimensionDisplayInd=i.model.displayInd}R(t.parcatsViewModel),I(t.parcatsViewModel),O(t.parcatsViewModel),P(t.parcatsViewModel)}}function C(t){if("fixed"!==t.parcatsViewModel.arrangement&&null!==t.dragDimensionDisplayInd){n.select(this).selectAll("text").attr("font-weight","normal");var e={},r=D(t.parcatsViewModel),i=t.parcatsViewModel.model.dimensions.map((function(t){return t.displayInd})),o=t.initialDragDimensionDisplayInds.some((function(t,e){return t!==i[e]}));o&&i.forEach((function(r,n){var a=t.parcatsViewModel.model.dimensions[n].containerInd;e["dimensions["+a+"].displayindex"]=r}));var s=!1;if(null!==t.dragCategoryDisplayInd){var l=t.model.categories.map((function(t){return t.displayInd}));if(s=t.initialDragCategoryDisplayInds.some((function(t,e){return t!==l[e]}))){var u=t.model.categories.slice().sort((function(t,e){return t.displayInd-e.displayInd})),c=u.map((function(t){return t.categoryValue})),h=u.map((function(t){return t.categoryLabel}));e["dimensions["+t.model.containerInd+"].categoryarray"]=[c],e["dimensions["+t.model.containerInd+"].ticktext"]=[h],e["dimensions["+t.model.containerInd+"].categoryorder"]="array"}}-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")&&!t.dragHasMoved&&t.potentialClickBand&&("color"===t.parcatsViewModel.hoveron?k(t.potentialClickBand,"plotly_click",n.event.sourceEvent):M(t.potentialClickBand,"plotly_click",n.event.sourceEvent)),t.model.dragX=null,null!==t.dragCategoryDisplayInd&&(t.parcatsViewModel.dimensions[t.dragDimensionDisplayInd].categories[t.dragCategoryDisplayInd].model.dragY=null,t.dragCategoryDisplayInd=null),t.dragDimensionDisplayInd=null,t.parcatsViewModel.dragDimension=null,t.dragHasMoved=null,t.potentialClickBand=null,R(t.parcatsViewModel),I(t.parcatsViewModel),n.transition().duration(300).ease("cubic-in-out").each((function(){O(t.parcatsViewModel,!0),P(t.parcatsViewModel,!0)})).each("end",(function(){(o||s)&&a.restyle(t.parcatsViewModel.graphDiv,e,[r])}))}}function D(t){for(var e,r=t.graphDiv._fullData,n=0;n<r.length;n++)if(t.key===r[n].uid){e=n;break}return e}function P(t,e){var r;void 0===e&&(e=!1),t.pathSelection.data((function(t){return t.paths}),h),(r=t.pathSelection,e?r.transition():r).attr("d",(function(t){return t.svgD}))}function O(t,e){function r(t){return e?t.transition():t}void 0===e&&(e=!1),t.dimensionSelection.data((function(t){return t.dimensions}),h);var a=t.dimensionSelection.selectAll("g.category").data((function(t){return t.categories}),h);r(t.dimensionSelection).attr("transform",(function(t){return"translate("+t.x+", 0)"})),r(a).attr("transform",(function(t){return"translate(0, "+t.y+")"})),a.select(".dimlabel").text((function(t,e){return 0===e?t.parcatsViewModel.model.dimensions[t.model.dimensionInd].dimensionLabel:null})),a.select(".catlabel").attr("text-anchor",(function(t){return d(t)?"start":"end"})).attr("x",(function(t){return d(t)?t.width+5:-5})).each((function(t){var e,r;d(t)?(e=t.width+5,r="start"):(e=-5,r="end"),n.select(this).selectAll("tspan").attr("x",e).attr("text-anchor",r)}));var i=a.selectAll("rect.bandrect").data((function(t){return t.bands}),h),s=i.enter().append("rect").attr("class","bandrect").attr("cursor","move").attr("stroke-opacity",0).attr("fill",(function(t){return t.color})).attr("fill-opacity",0);i.attr("fill",(function(t){return t.color})).attr("width",(function(t){return t.width})).attr("height",(function(t){return t.height})).attr("y",(function(t){return t.y})),b(s),i.each((function(){o.raiseToTop(this)})),i.exit().remove()}function z(t,e,r,a,i){var o,s,l=[],u=[];for(s=0;s<r.length-1;s++)o=n.interpolateNumber(r[s]+t[s],t[s+1]),l.push(o(i)),u.push(o(1-i));var c="M "+t[0]+","+e[0];for(c+="l"+r[0]+",0 ",s=1;s<r.length;s++)c+="C"+l[s-1]+","+e[s-1]+" "+u[s-1]+","+e[s]+" "+t[s]+","+e[s],c+="l"+r[s]+",0 ";for(c+="l0,"+a+" ",c+="l -"+r[r.length-1]+",0 ",s=r.length-2;s>=0;s--)c+="C"+u[s]+","+(e[s+1]+a)+" "+l[s]+","+(e[s]+a)+" "+(t[s]+r[s])+","+(e[s]+a),c+="l-"+r[s]+",0 ";return c+"Z"}function I(t){var e=t.dimensions,r=t.model,n=e.map((function(t){return t.categories.map((function(t){return t.y}))})),a=t.model.dimensions.map((function(t){return t.categories.map((function(t){return t.displayInd}))})),i=t.model.dimensions.map((function(t){return t.displayInd})),o=t.dimensions.map((function(t){return t.model.dimensionInd})),s=e.map((function(t){return t.x})),l=e.map((function(t){return t.width})),u=[];for(var c in r.paths)r.paths.hasOwnProperty(c)&&u.push(r.paths[c]);function h(t){var e=t.categoryInds.map((function(t,e){return a[e][t]}));return o.map((function(t){return e[t]}))}u.sort((function(e,r){var n=h(e),a=h(r);return"backward"===t.sortpaths&&(n.reverse(),a.reverse()),n.push(e.valueInds[0]),a.push(r.valueInds[0]),t.bundlecolors&&(n.unshift(e.rawColor),a.unshift(r.rawColor)),n<a?-1:n>a?1:0}));for(var d=new Array(u.length),f=e[0].model.count,p=e[0].categories.map((function(t){return t.height})).reduce((function(t,e){return t+e})),m=0;m<u.length;m++){var g,y=u[m];g=f>0?p*(y.count/f):0;for(var v,_=new Array(n.length),x=0;x<y.categoryInds.length;x++){var b=y.categoryInds[x],w=a[x][b],M=i[x];_[M]=n[M][w],n[M][w]+=g;var k=t.dimensions[M].categories[w],T=k.bands.length,L=k.bands[T-1];if(void 0===L||y.rawColor!==L.rawColor){var A=void 0===L?0:L.y+L.height;k.bands.push({key:A,color:y.color,rawColor:y.rawColor,height:g,width:k.width,count:y.count,y:A,categoryViewModel:k,parcatsViewModel:t})}else{var S=k.bands[T-1];S.height+=g,S.count+=y.count}}v="hspline"===t.pathShape?z(s,_,l,g,.5):z(s,_,l,g,0),d[m]={key:y.valueInds[0],model:y,height:g,leftXs:s,topYs:_,dimWidths:l,svgD:v,parcatsViewModel:t}}t.paths=d}function R(t){var e=t.model.dimensions.map((function(t){return{displayInd:t.displayInd,dimensionInd:t.dimensionInd}}));e.sort((function(t,e){return t.displayInd-e.displayInd}));var r=[];for(var n in e){var a=e[n].dimensionInd,i=t.model.dimensions[a];r.push(F(t,i))}t.dimensions=r}function F(t,e){var r,n=t.model.dimensions.length,a=e.displayInd;r=40+(n>1?(t.width-80-16)/(n-1):0)*a;var i,o,s,l,u,c=[],h=t.model.maxCats,d=e.categories.length,f=e.count,p=t.height-8*(h-1),m=8*(h-d)/2,g=e.categories.map((function(t){return{displayInd:t.displayInd,categoryInd:t.categoryInd}}));for(g.sort((function(t,e){return t.displayInd-e.displayInd})),u=0;u<d;u++)l=g[u].categoryInd,o=e.categories[l],i=f>0?o.count/f*p:0,s={key:o.valueInds[0],model:o,width:16,height:i,y:null!==o.dragY?o.dragY:m,bands:[],parcatsViewModel:t},m=m+i+8,c.push(s);return{key:e.dimensionInd,x:null!==e.dragX?e.dragX:r,y:0,width:16,model:e,categories:c,parcatsViewModel:t,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}e.exports=function(t,e,r,n){c(r,t,n,e)}},{"../../components/drawing":614,"../../components/fx":632,"../../lib":719,"../../lib/svg_text_utils":743,"../../plot_api/plot_api":754,d3:163,tinycolor2:537}],1073:[function(t,e,r){var n=t("./parcats");e.exports=function(t,e,r,a){var i=t._fullLayout,o=i._paper,s=i._size;n(t,o,e,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},r,a)}},{"./parcats":1072}],1074:[function(t,e,r){var n=t("../../components/colorscale/attributes"),a=t("../../plots/cartesian/layout_attributes"),i=t("../../plots/font_attributes"),o=t("../../plots/domain").attributes,s=t("../../lib/extend").extendFlat,l=t("../../plot_api/plot_template").templatedArray;e.exports={domain:o({name:"parcoords",trace:!0,editType:"plot"}),labelangle:{valType:"angle",dflt:0,editType:"plot"},labelside:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},labelfont:i({editType:"plot"}),tickfont:i({editType:"plot"}),rangefont:i({editType:"plot"}),dimensions:l("dimension",{label:{valType:"string",editType:"plot"},tickvals:s({},a.tickvals,{editType:"plot"}),ticktext:s({},a.ticktext,{editType:"plot"}),tickformat:s({},a.tickformat,{editType:"plot"}),visible:{valType:"boolean",dflt:!0,editType:"plot"},range:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},constraintrange:{valType:"info_array",freeLength:!0,dimensions:"1-2",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},multiselect:{valType:"boolean",dflt:!0,editType:"plot"},values:{valType:"data_array",editType:"calc"},editType:"calc"}),line:s({editType:"calc"},n("line",{colorscaleDflt:"Viridis",autoColorDflt:!1,editTypeOverride:"calc"}))}},{"../../components/colorscale/attributes":600,"../../lib/extend":710,"../../plot_api/plot_template":757,"../../plots/cartesian/layout_attributes":779,"../../plots/domain":792,"../../plots/font_attributes":793}],1075:[function(t,e,r){var n=t("./constants"),a=t("d3"),i=t("../../lib/gup").keyFun,o=t("../../lib/gup").repeat,s=t("../../lib").sorterAsc,l=n.bar.snapRatio;function u(t,e){return t*(1-l)+e*l}var c=n.bar.snapClose;function h(t,e){return t*(1-c)+e*c}function d(t,e,r,n){if(function(t,e){for(var r=0;r<e.length;r++)if(t>=e[r][0]&&t<=e[r][1])return!0;return!1}(r,n))return r;var a=t?-1:1,i=0,o=e.length-1;if(a<0){var s=i;i=o,o=s}for(var l=e[i],c=l,d=i;a*d<a*o;d+=a){var f=d+a,p=e[f];if(a*r<a*h(l,p))return u(l,c);if(a*r<a*p||f===o)return u(p,l);c=l,l=p}}function f(t){t.attr("x",-n.bar.captureWidth/2).attr("width",n.bar.captureWidth)}function p(t){t.attr("visibility","visible").style("visibility","visible").attr("fill","yellow").attr("opacity",0)}function m(t){if(!t.brush.filterSpecified)return"0,"+t.height;for(var e,r,n,a=g(t.brush.filter.getConsolidated(),t.height),i=[0],o=a.length?a[0][0]:null,s=0;s<a.length;s++)r=(e=a[s])[1]-e[0],i.push(o),i.push(r),(n=s+1)<a.length&&(o=a[n][0]-e[1]);return i.push(t.height),i}function g(t,e){return t.map((function(t){return t.map((function(t){return Math.max(0,t*e)})).sort(s)}))}function y(){a.select(document.body).style("cursor",null)}function v(t){t.attr("stroke-dasharray",m)}function _(t,e){var r=a.select(t).selectAll(".highlight, .highlight-shadow");v(e?r.transition().duration(n.bar.snapDuration).each("end",e):r)}function x(t,e){var r,a=t.brush,i=NaN,o={};if(a.filterSpecified){var s=t.height,l=a.filter.getConsolidated(),u=g(l,s),c=NaN,h=NaN,d=NaN;for(r=0;r<=u.length;r++){var f=u[r];if(f&&f[0]<=e&&e<=f[1]){c=r;break}if(h=r?r-1:NaN,f&&f[0]>e){d=r;break}}if(i=c,isNaN(i)&&(i=isNaN(h)||isNaN(d)?isNaN(h)?d:h:e-u[h][1]<u[d][0]-e?h:d),!isNaN(i)){var p=u[i],m=function(t,e){var r=n.bar.handleHeight;if(!(e>t[1]+r||e<t[0]-r))return e>=.9*t[1]+.1*t[0]?"n":e<=.9*t[0]+.1*t[1]?"s":"ns"}(p,e);m&&(o.interval=l[i],o.intervalPix=p,o.region=m)}}if(t.ordinal&&!o.region){var y=t.unitTickvals,v=t.unitToPaddedPx.invert(e);for(r=0;r<y.length;r++){var _=[.25*y[Math.max(r-1,0)]+.75*y[r],.25*y[Math.min(r+1,y.length-1)]+.75*y[r]];if(v>=_[0]&&v<=_[1]){o.clickableOrdinalRange=_;break}}}return o}function b(t,e){a.event.sourceEvent.stopPropagation();var r=e.height-a.mouse(t)[1]-2*n.verticalPadding,i=e.brush.svgBrush;i.wasDragged=!0,i._dragging=!0,i.grabbingBar?i.newExtent=[r-i.grabPoint,r+i.barLength-i.grabPoint].map(e.unitToPaddedPx.invert):i.newExtent=[i.startExtent,e.unitToPaddedPx.invert(r)].sort(s),e.brush.filterSpecified=!0,i.extent=i.stayingIntervals.concat([i.newExtent]),i.brushCallback(e),_(t.parentNode)}function w(t,e){var r=x(e,e.height-a.mouse(t)[1]-2*n.verticalPadding),i="crosshair";r.clickableOrdinalRange?i="pointer":r.region&&(i=r.region+"-resize"),a.select(document.body).style("cursor",i)}function M(t){t.on("mousemove",(function(t){a.event.preventDefault(),t.parent.inBrushDrag||w(this,t)})).on("mouseleave",(function(t){t.parent.inBrushDrag||y()})).call(a.behavior.drag().on("dragstart",(function(t){!function(t,e){a.event.sourceEvent.stopPropagation();var r=e.height-a.mouse(t)[1]-2*n.verticalPadding,i=e.unitToPaddedPx.invert(r),o=e.brush,s=x(e,r),l=s.interval,u=o.svgBrush;if(u.wasDragged=!1,u.grabbingBar="ns"===s.region,u.grabbingBar){var c=l.map(e.unitToPaddedPx);u.grabPoint=r-c[0]-n.verticalPadding,u.barLength=c[1]-c[0]}u.clickableOrdinalRange=s.clickableOrdinalRange,u.stayingIntervals=e.multiselect&&o.filterSpecified?o.filter.getConsolidated():[],l&&(u.stayingIntervals=u.stayingIntervals.filter((function(t){return t[0]!==l[0]&&t[1]!==l[1]}))),u.startExtent=s.region?l["s"===s.region?1:0]:i,e.parent.inBrushDrag=!0,u.brushStartCallback()}(this,t)})).on("drag",(function(t){b(this,t)})).on("dragend",(function(t){!function(t,e){var r=e.brush,n=r.filter,i=r.svgBrush;i._dragging||(w(t,e),b(t,e),e.brush.svgBrush.wasDragged=!1),i._dragging=!1,a.event.sourceEvent.stopPropagation();var o=i.grabbingBar;if(i.grabbingBar=!1,i.grabLocation=void 0,e.parent.inBrushDrag=!1,y(),!i.wasDragged)return i.wasDragged=void 0,i.clickableOrdinalRange?r.filterSpecified&&e.multiselect?i.extent.push(i.clickableOrdinalRange):(i.extent=[i.clickableOrdinalRange],r.filterSpecified=!0):o?(i.extent=i.stayingIntervals,0===i.extent.length&&T(r)):T(r),i.brushCallback(e),_(t.parentNode),void i.brushEndCallback(r.filterSpecified?n.getConsolidated():[]);var s=function(){n.set(n.getConsolidated())};if(e.ordinal){var l=e.unitTickvals;l[l.length-1]<l[0]&&l.reverse(),i.newExtent=[d(0,l,i.newExtent[0],i.stayingIntervals),d(1,l,i.newExtent[1],i.stayingIntervals)];var u=i.newExtent[1]>i.newExtent[0];i.extent=i.stayingIntervals.concat(u?[i.newExtent]:[]),i.extent.length||T(r),i.brushCallback(e),u?_(t.parentNode,s):(s(),_(t.parentNode))}else s();i.brushEndCallback(r.filterSpecified?n.getConsolidated():[])}(this,t)})))}function k(t,e){return t[0]-e[0]}function T(t){t.filterSpecified=!1,t.svgBrush.extent=[[-1/0,1/0]]}function L(t){for(var e,r=t.slice(),n=[],a=r.shift();a;){for(e=a.slice();(a=r.shift())&&a[0]<=e[1];)e[1]=Math.max(e[1],a[1]);n.push(e)}return n}e.exports={makeBrush:function(t,e,r,n,a,i){var o,l=function(){var t,e,r=[];return{set:function(n){1===(r=n.map((function(t){return t.slice().sort(s)})).sort(k)).length&&r[0][0]===-1/0&&r[0][1]===1/0&&(r=[[0,-1]]),t=L(r),e=r.reduce((function(t,e){return[Math.min(t[0],e[0]),Math.max(t[1],e[1])]}),[1/0,-1/0])},get:function(){return r.slice()},getConsolidated:function(){return t},getBounds:function(){return e}}}();return l.set(r),{filter:l,filterSpecified:e,svgBrush:{extent:[],brushStartCallback:n,brushCallback:(o=a,function(t){var e=t.brush,r=function(t){return t.svgBrush.extent.map((function(t){return t.slice()}))}(e).slice();e.filter.set(r),o()}),brushEndCallback:i}}},ensureAxisBrush:function(t){var e=t.selectAll("."+n.cn.axisBrush).data(o,i);e.enter().append("g").classed(n.cn.axisBrush,!0),function(t){var e=t.selectAll(".background").data(o);e.enter().append("rect").classed("background",!0).call(f).call(p).style("pointer-events","auto").attr("transform","translate(0 "+n.verticalPadding+")"),e.call(M).attr("height",(function(t){return t.height-n.verticalPadding}));var r=t.selectAll(".highlight-shadow").data(o);r.enter().append("line").classed("highlight-shadow",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width+n.bar.strokeWidth).attr("stroke",n.bar.strokeColor).attr("opacity",n.bar.strokeOpacity).attr("stroke-linecap","butt"),r.attr("y1",(function(t){return t.height})).call(v);var a=t.selectAll(".highlight").data(o);a.enter().append("line").classed("highlight",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width-n.bar.strokeWidth).attr("stroke",n.bar.fillColor).attr("opacity",n.bar.fillOpacity).attr("stroke-linecap","butt"),a.attr("y1",(function(t){return t.height})).call(v)}(e)},cleanRanges:function(t,e){if(Array.isArray(t[0])?(t=t.map((function(t){return t.sort(s)})),t=e.multiselect?L(t.sort(k)):[t[0]]):t=[t.sort(s)],e.tickvals){var r=e.tickvals.slice().sort(s);if(!(t=t.map((function(t){var e=[d(0,r,t[0],[]),d(1,r,t[1],[])];if(e[1]>e[0])return e})).filter((function(t){return t}))).length)return}return t.length>1?t:t[0]}}},{"../../lib":719,"../../lib/gup":717,"./constants":1078,d3:163}],1076:[function(t,e,r){var n=t("d3"),a=t("../../plots/get_data").getModuleCalcData,i=t("./plot"),o=t("../../constants/xmlns_namespaces");r.name="parcoords",r.plot=function(t){var e=a(t.calcdata,"parcoords")[0];e.length&&i(t,e)},r.clean=function(t,e,r,n){var a=n._has&&n._has("parcoords"),i=e._has&&e._has("parcoords");a&&!i&&(n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},r.toSVG=function(t){var e=t._fullLayout._glimages,r=n.select(t).selectAll(".svg-container");r.filter((function(t,e){return e===r.size()-1})).selectAll(".gl-canvas-context, .gl-canvas-focus").each((function(){var t=this.toDataURL("image/png");e.append("svg:image").attr({xmlns:o.svg,"xlink:href":t,preserveAspectRatio:"none",x:0,y:0,width:this.width,height:this.height})})),window.setTimeout((function(){n.selectAll("#filterBarPattern").attr("id","filterBarPattern")}),60)}},{"../../constants/xmlns_namespaces":696,"../../plots/get_data":802,"./plot":1085,d3:163}],1077:[function(t,e,r){var n=t("../../lib").isArrayOrTypedArray,a=t("../../components/colorscale"),i=t("../../lib/gup").wrap;e.exports=function(t,e){var r,o;return a.hasColorscale(e,"line")&&n(e.line.color)?(r=e.line.color,o=a.extractOpts(e.line).colorscale,a.calc(t,e,{vals:r,containerStr:"line",cLetter:"c"})):(r=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=.5;return e}(e._length),o=[[0,e.line.color],[1,e.line.color]]),i({lineColor:r,cscale:o})}},{"../../components/colorscale":605,"../../lib":719,"../../lib/gup":717}],1078:[function(t,e,r){e.exports={maxDimensionCount:60,overdrag:45,verticalPadding:2,tickDistance:50,canvasPixelRatio:1,blockLineCount:5e3,layers:["contextLineLayer","focusLineLayer","pickLineLayer"],axisTitleOffset:28,axisExtentOffset:10,deselectedLineColor:"#777",bar:{width:4,captureWidth:10,fillColor:"magenta",fillOpacity:1,snapDuration:150,snapRatio:.25,snapClose:.01,strokeColor:"white",strokeOpacity:1,strokeWidth:1,handleHeight:8,handleOpacity:1,handleOverlap:0},cn:{axisExtentText:"axis-extent-text",parcoordsLineLayers:"parcoords-line-layers",parcoordsLineLayer:"parcoords-lines",parcoords:"parcoords",parcoordsControlView:"parcoords-control-view",yAxis:"y-axis",axisOverlays:"axis-overlays",axis:"axis",axisHeading:"axis-heading",axisTitle:"axis-title",axisExtent:"axis-extent",axisExtentTop:"axis-extent-top",axisExtentTopText:"axis-extent-top-text",axisExtentBottom:"axis-extent-bottom",axisExtentBottomText:"axis-extent-bottom-text",axisBrush:"axis-brush"},id:{filterBarPattern:"filter-bar-pattern"}}},{}],1079:[function(t,e,r){var n=t("../../lib"),a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults"),o=t("../../plots/domain").defaults,s=t("../../plots/array_container_defaults"),l=t("../../plots/cartesian/axes"),u=t("./attributes"),c=t("./axisbrush"),h=t("./constants").maxDimensionCount,d=t("./merge_length");function f(t,e,r,a){function i(r,a){return n.coerce(t,e,u.dimensions,r,a)}var o=i("values"),s=i("visible");if(o&&o.length||(s=e.visible=!1),s){i("label"),i("tickvals"),i("ticktext"),i("tickformat");var h=i("range");e._ax={_id:"y",type:"linear",showexponent:"all",exponentformat:"B",range:h},l.setConvert(e._ax,a.layout),i("multiselect");var d=i("constraintrange");d&&(e.constraintrange=c.cleanRanges(d,e))}}e.exports=function(t,e,r,l){function c(r,a){return n.coerce(t,e,u,r,a)}var p=t.dimensions;Array.isArray(p)&&p.length>h&&(n.log("parcoords traces support up to "+h+" dimensions at the moment"),p.splice(h));var m=s(t,e,{name:"dimensions",layout:l,handleItemDefaults:f}),g=function(t,e,r,o,s){var l=s("line.color",r);if(a(t,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),i(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=r}return 1/0}(t,e,r,l,c);o(e,l,c),Array.isArray(m)&&m.length||(e.visible=!1),d(e,m,"values",g);var y={family:l.font.family,size:Math.round(l.font.size/1.2),color:l.font.color};n.coerceFont(c,"labelfont",y),n.coerceFont(c,"tickfont",y),n.coerceFont(c,"rangefont",y),c("labelangle"),c("labelside")}},{"../../components/colorscale/defaults":603,"../../components/colorscale/helpers":604,"../../lib":719,"../../plots/array_container_defaults":763,"../../plots/cartesian/axes":767,"../../plots/domain":792,"./attributes":1074,"./axisbrush":1075,"./constants":1078,"./merge_length":1083}],1080:[function(t,e,r){var n=t("../../lib").isTypedArray;r.convertTypedArray=function(t){return n(t)?Array.prototype.slice.call(t):t},r.isOrdinal=function(t){return!!t.tickvals},r.isVisible=function(t){return t.visible||!("visible"in t)}},{"../../lib":719}],1081:[function(t,e,r){e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:t("./base_plot"),categories:["gl","regl","noOpacity","noHover"],meta:{}}},{"./attributes":1074,"./base_plot":1076,"./calc":1077,"./defaults":1079,"./plot":1085}],1082:[function(t,e,r){var n=t("glslify"),a=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nattribute vec4 p01_04, p05_08, p09_12, p13_16,\n p17_20, p21_24, p25_28, p29_32,\n p33_36, p37_40, p41_44, p45_48,\n p49_52, p53_56, p57_60, colors;\n\nuniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution, viewBoxPos, viewBoxSize;\nuniform sampler2D mask, palette;\nuniform float maskHeight;\nuniform float drwLayer; // 0: context, 1: focus, 2: pick\nuniform vec4 contextColor;\n\nbool isPick = (drwLayer > 1.5);\nbool isContext = (drwLayer < 0.5);\n\nconst vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);\nconst vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * UNITS, UNITS);\n}\n\nfloat axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {\n float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);\n float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);\n return y1 * (1.0 - ratio) + y2 * ratio;\n}\n\nint iMod(int a, int b) {\n return a - b * (a / b);\n}\n\nbool fOutside(float p, float lo, float hi) {\n return (lo < hi) && (lo > p || p > hi);\n}\n\nbool vOutside(vec4 p, vec4 lo, vec4 hi) {\n return (\n fOutside(p[0], lo[0], hi[0]) ||\n fOutside(p[1], lo[1], hi[1]) ||\n fOutside(p[2], lo[2], hi[2]) ||\n fOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool mOutside(mat4 p, mat4 lo, mat4 hi) {\n return (\n vOutside(p[0], lo[0], hi[0]) ||\n vOutside(p[1], lo[1], hi[1]) ||\n vOutside(p[2], lo[2], hi[2]) ||\n vOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {\n return mOutside(A, loA, hiA) ||\n mOutside(B, loB, hiB) ||\n mOutside(C, loC, hiC) ||\n mOutside(D, loD, hiD);\n}\n\nbool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {\n mat4 pnts[4];\n pnts[0] = A;\n pnts[1] = B;\n pnts[2] = C;\n pnts[3] = D;\n\n for(int i = 0; i < 4; ++i) {\n for(int j = 0; j < 4; ++j) {\n for(int k = 0; k < 4; ++k) {\n if(0 == iMod(\n int(255.0 * texture2D(mask,\n vec2(\n (float(i * 2 + j / 2) + 0.5) / 8.0,\n (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight\n ))[3]\n ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),\n 2\n )) return true;\n }\n }\n }\n return false;\n}\n\nvec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {\n float x = 0.5 * sign(v) + 0.5;\n float y = axisY(x, A, B, C, D);\n float z = 1.0 - abs(v);\n\n z += isContext ? 0.0 : 2.0 * float(\n outsideBoundingBox(A, B, C, D) ||\n outsideRasterMask(A, B, C, D)\n );\n\n return vec4(\n 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,\n z,\n 1.0\n );\n}\n\nvoid main() {\n mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);\n mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);\n mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);\n mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);\n\n float v = colors[3];\n\n gl_Position = position(isContext, v, A, B, C, D);\n\n fragColor =\n isContext ? vec4(contextColor) :\n isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));\n}\n"]),i=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}\n"]),o=t("./constants").maxDimensionCount,s=t("../../lib"),l=1e-6,u=2048,c=new Uint8Array(4),h=new Uint8Array(4),d={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function f(t,e,r,n,a){var i=t._gl;i.enable(i.SCISSOR_TEST),i.scissor(e,r,n,a),t.clear({color:[0,0,0,0],depth:1})}function p(t,e,r,n,a,i){var o=i.key;r.drawCompleted||(function(t){t.read({x:0,y:0,width:1,height:1,data:c})}(t),r.drawCompleted=!0),function s(l){var u=Math.min(n,a-l*n);0===l&&(window.cancelAnimationFrame(r.currentRafs[o]),delete r.currentRafs[o],f(t,i.scissorX,i.scissorY,i.scissorWidth,i.viewBoxSize[1])),r.clearOnly||(i.count=2*u,i.offset=2*l*n,e(i),l*n+u<a&&(r.currentRafs[o]=window.requestAnimationFrame((function(){s(l+1)}))),r.drawCompleted=!1)}(0)}function m(t,e){return(t>>>8*e)%256/255}function g(t,e,r){for(var n=new Array(8*e),a=0,i=0;i<e;i++)for(var o=0;o<2;o++)for(var s=0;s<4;s++){var l=4*t+s,u=r[64*i+l];63===l&&0===o&&(u*=-1),n[a++]=u}return n}function y(t){var e="0"+t;return e.substr(e.length-2)}function v(t){return t<o?"p"+y(t+1)+"_"+y(t+4):"colors"}function _(t,e,r,n,a,i,o,l,u,c,h,d,f){for(var p=[[],[]],m=0;m<64;m++)p[0][m]=m===a?1:0,p[1][m]=m===i?1:0;var g=t.lines.canvasOverdrag,y=t.domain,v=t.canvasWidth,_=t.canvasHeight,x=t.deselectedLines.color;return s.extendFlat({key:h,resolution:[v,_],viewBoxPos:[o+g,l],viewBoxSize:[u,c],i0:a,i1:i,dim0A:p[0].slice(0,16),dim0B:p[0].slice(16,32),dim0C:p[0].slice(32,48),dim0D:p[0].slice(48,64),dim1A:p[1].slice(0,16),dim1B:p[1].slice(16,32),dim1C:p[1].slice(32,48),dim1D:p[1].slice(48,64),drwLayer:d,contextColor:[x[0]/255,x[1]/255,x[2]/255,x[3]<1?x[3]:Math.max(1/255,Math.pow(1/t.lines.color.length,1/3))],scissorX:(n===e?0:o+g)+(t.pad.l-g)+t.layoutWidth*y.x[0],scissorWidth:(n===r?v-o+g:u+.5)+(n===e?o+g:0),scissorY:l+t.pad.b+t.layoutHeight*y.y[0],scissorHeight:c,viewportX:t.pad.l-g+t.layoutWidth*y.x[0],viewportY:t.pad.b+t.layoutHeight*y.y[0],viewportWidth:v,viewportHeight:_},f)}function x(t){var e=u-1,r=Math.max(0,Math.floor(t[0]*e),0),n=Math.min(e,Math.ceil(t[1]*e),e);return[Math.min(r,n),Math.max(r,n)]}e.exports=function(t,e){var r,n,c,y,b,w=e.context,M=e.pick,k=e.regl,T={currentRafs:{},drawCompleted:!0,clearOnly:!1},L=function(t){for(var e={},r=0;r<=o;r+=4)e[v(r)]=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)});return e}(k),A=k.texture(d),S=[];C(e);var E=k({profile:!1,blend:{enable:w,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:!w,mask:!0,func:"less",range:[0,1]},cull:{enable:!0,face:"back"},scissor:{enable:!0,box:{x:k.prop("scissorX"),y:k.prop("scissorY"),width:k.prop("scissorWidth"),height:k.prop("scissorHeight")}},viewport:{x:k.prop("viewportX"),y:k.prop("viewportY"),width:k.prop("viewportWidth"),height:k.prop("viewportHeight")},dither:!1,vert:a,frag:i,primitive:"lines",lineWidth:1,attributes:L,uniforms:{resolution:k.prop("resolution"),viewBoxPos:k.prop("viewBoxPos"),viewBoxSize:k.prop("viewBoxSize"),dim0A:k.prop("dim0A"),dim1A:k.prop("dim1A"),dim0B:k.prop("dim0B"),dim1B:k.prop("dim1B"),dim0C:k.prop("dim0C"),dim1C:k.prop("dim1C"),dim0D:k.prop("dim0D"),dim1D:k.prop("dim1D"),loA:k.prop("loA"),hiA:k.prop("hiA"),loB:k.prop("loB"),hiB:k.prop("hiB"),loC:k.prop("loC"),hiC:k.prop("hiC"),loD:k.prop("loD"),hiD:k.prop("hiD"),palette:A,contextColor:k.prop("contextColor"),mask:k.prop("maskTexture"),drwLayer:k.prop("drwLayer"),maskHeight:k.prop("maskHeight")},offset:k.prop("offset"),count:k.prop("count")});function C(t){r=t.model,n=t.viewModel,c=n.dimensions.slice(),y=c[0]?c[0].values.length:0;var e=r.lines,a=M?e.color.map((function(t,r){return r/e.color.length})):e.color,i=function(t,e,r){for(var n,a=new Array(t*(o+4)),i=0,s=0;s<t;s++){for(var u=0;u<o;u++)a[i++]=u<e.length?e[u].paddedUnitValues[s]:.5;a[i++]=m(s,2),a[i++]=m(s,1),a[i++]=m(s,0),a[i++]=(n=r[s],Math.max(l,Math.min(1-l,n)))}return a}(y,c,a);!function(t,e,r){for(var n=0;n<=o;n+=4)t[v(n)](g(n/4,e,r))}(L,y,i),w||M||(A=k.texture(s.extendFlat({data:function(t,e){for(var r=new Array(256),n=0;n<256;n++)r[n]=t(n/255).concat(255);return r}(r.unitToColor)},d)))}return{render:function(t,e,n){var a,i,o,s=t.length,l=1/0,h=-1/0;for(a=0;a<s;a++)t[a].dim0.canvasX<l&&(l=t[a].dim0.canvasX,i=a),t[a].dim1.canvasX>h&&(h=t[a].dim1.canvasX,o=a);0===s&&f(k,0,0,r.canvasWidth,r.canvasHeight);var d=function(t){var e,r,n,a=[[],[]];for(n=0;n<64;n++){var i=!t&&n<c.length?c[n].brush.filter.getBounds():[-1/0,1/0];a[0][n]=i[0],a[1][n]=i[1]}var o=new Array(16384);for(e=0;e<16384;e++)o[e]=255;if(!t)for(e=0;e<c.length;e++){var s=e%8,l=(e-s)/8,h=Math.pow(2,s),d=c[e].brush.filter.get();if(!(d.length<2)){var f=x(d[0])[1];for(r=1;r<d.length;r++){var p=x(d[r]);for(n=f+1;n<p[0];n++)o[8*n+l]&=~h;f=Math.max(f,p[1])}}}var m={shape:[8,u],format:"alpha",type:"uint8",mag:"nearest",min:"nearest",data:o};return b?b(m):b=k.texture(m),{maskTexture:b,maskHeight:u,loA:a[0].slice(0,16),loB:a[0].slice(16,32),loC:a[0].slice(32,48),loD:a[0].slice(48,64),hiA:a[1].slice(0,16),hiB:a[1].slice(16,32),hiC:a[1].slice(32,48),hiD:a[1].slice(48,64)}}(w);for(a=0;a<s;a++){var m=t[a],g=m.dim0.crossfilterDimensionIndex,v=m.dim1.crossfilterDimensionIndex,L=m.canvasX,A=m.canvasY,C=L+m.panelSizeX;if(e||!S[g]||S[g][0]!==L||S[g][1]!==C){S[g]=[L,C];var D=_(r,i,o,a,g,v,L,A,m.panelSizeX,m.panelSizeY,m.dim0.crossfilterDimensionIndex,w?0:M?2:1,d);T.clearOnly=n;var P=e?r.lines.blockLineCount:y;p(k,E,T,P,y,D)}}},readPixel:function(t,e){return k.read({x:t,y:e,width:1,height:1,data:h}),h},readPixels:function(t,e,r,n){var a=new Uint8Array(4*r*n);return k.read({x:t,y:e,width:r,height:n,data:a}),a},destroy:function(){for(var e in t.style["pointer-events"]="none",A.destroy(),b&&b.destroy(),L)L[e].destroy()},update:C}}},{"../../lib":719,"./constants":1078,glslify:409}],1083:[function(t,e,r){e.exports=function(t,e,r,n){var a,i;for(n||(n=1/0),a=0;a<e.length;a++)(i=e[a]).visible&&(n=Math.min(n,i[r].length));for(n===1/0&&(n=0),t._length=n,a=0;a<e.length;a++)(i=e[a]).visible&&(i._length=n);return n}},{}],1084:[function(t,e,r){var n=t("d3"),a=t("color-rgba"),i=t("../../plots/cartesian/axes"),o=t("../../lib"),s=t("../../lib/svg_text_utils"),l=t("../../components/drawing"),u=t("../../components/colorscale"),c=t("../../lib/gup"),h=c.keyFun,d=c.repeat,f=c.unwrap,p=t("./helpers"),m=t("./constants"),g=t("./axisbrush"),y=t("./lines");function v(t,e,r){return o.aggNums(t,null,e,r)}function _(t,e){return b(v(Math.min,t,e),v(Math.max,t,e))}function x(t){var e=t.range;return e?b(e[0],e[1]):_(t.values,t._length)}function b(t,e){return!isNaN(t)&&isFinite(t)||(t=0),!isNaN(e)&&isFinite(e)||(e=0),t===e&&(0===t?(t-=1,e+=1):(t*=.9,e*=1.1)),[t,e]}function w(t){return t.dimensions.some((function(t){return t.brush.filterSpecified}))}function M(t,e,r){var i=f(e),s=i.trace,l=p.convertTypedArray(i.lineColor),c=s.line,h={color:a(m.deselectedLineColor)},d=u.extractOpts(c),g=d.reversescale?u.flipScale(i.cscale):i.cscale,y=s.domain,v=s.dimensions,_=t.width,b=s.labelangle,w=s.labelside,M=s.labelfont,k=s.tickfont,T=s.rangefont,L=o.extendDeepNoArrays({},c,{color:l.map(n.scale.linear().domain(x({values:l,range:[d.min,d.max],_length:s._length}))),blockLineCount:m.blockLineCount,canvasOverdrag:m.overdrag*m.canvasPixelRatio}),A=Math.floor(_*(y.x[1]-y.x[0])),S=Math.floor(t.height*(y.y[1]-y.y[0])),E=t.margin||{l:80,r:80,t:100,b:80},C=A,D=S;return{key:r,colCount:v.filter(p.isVisible).length,dimensions:v,tickDistance:m.tickDistance,unitToColor:function(t){var e=t.map((function(t){return t[0]})),r=t.map((function(t){var e=a(t[1]);return n.rgb("rgb("+e[0]+","+e[1]+","+e[2]+")")})),i="rgb".split("").map((function(t){return n.scale.linear().clamp(!0).domain(e).range(r.map((a=t,function(t){return t[a]})));var a}));return function(t){return i.map((function(e){return e(t)}))}}(g),lines:L,deselectedLines:h,labelAngle:b,labelSide:w,labelFont:M,tickFont:k,rangeFont:T,layoutWidth:_,layoutHeight:t.height,domain:y,translateX:y.x[0]*_,translateY:t.height-y.y[1]*t.height,pad:E,canvasWidth:C*m.canvasPixelRatio+2*L.canvasOverdrag,canvasHeight:D*m.canvasPixelRatio,width:C,height:D,canvasPixelRatio:m.canvasPixelRatio}}function k(t,e,r){var a=r.width,i=r.height,s=r.dimensions,l=r.canvasPixelRatio,u=function(t){return a*t/Math.max(1,r.colCount-1)},c=m.verticalPadding/i,h=function(t,e){return n.scale.linear().range([e,t-e])}(i,m.verticalPadding),d={key:r.key,xScale:u,model:r,inBrushDrag:!1},f={};return d.dimensions=s.filter(p.isVisible).map((function(a,s){var y=function(t,e){return n.scale.linear().domain(x(t)).range([e,1-e])}(a,c),v=f[a.label];f[a.label]=(v||0)+1;var _=a.label+(v?"__"+v:""),b=a.constraintrange,M=b&&b.length;M&&!Array.isArray(b[0])&&(b=[b]);var k=M?b.map((function(t){return t.map(y)})):[[-1/0,1/0]],T=a.values;T.length>a._length&&(T=T.slice(0,a._length));var L,A=a.tickvals;function S(t,e){return{val:t,text:L[e]}}function E(t,e){return t.val-e.val}if(Array.isArray(A)&&A.length){L=a.ticktext,Array.isArray(L)&&L.length?L.length>A.length?L=L.slice(0,A.length):A.length>L.length&&(A=A.slice(0,L.length)):L=A.map(n.format(a.tickformat));for(var C=1;C<A.length;C++)if(A[C]<A[C-1]){for(var D=A.map(S).sort(E),P=0;P<A.length;P++)A[P]=D[P].val,L[P]=D[P].text;break}}else A=void 0;return T=p.convertTypedArray(T),T=p.convertTypedArray(T),{key:_,label:a.label,tickFormat:a.tickformat,tickvals:A,ticktext:L,ordinal:p.isOrdinal(a),multiselect:a.multiselect,xIndex:s,crossfilterDimensionIndex:s,visibleIndex:a._index,height:i,values:T,paddedUnitValues:T.map(y),unitTickvals:A&&A.map(y),xScale:u,x:u(s),canvasX:u(s)*l,unitToPaddedPx:h,domainScale:function(t,e,r,a,i){var o,s,l=x(r);return a?n.scale.ordinal().domain(a.map((o=n.format(r.tickformat),s=i,s?function(t,e){var r=s[e];return null==r?o(t):r}:o))).range(a.map((function(r){var n=(r-l[0])/(l[1]-l[0]);return t-e+n*(2*e-t)}))):n.scale.linear().domain(l).range([t-e,e])}(i,m.verticalPadding,a,A,L),ordinalScale:function(t){if(t.tickvals){var e=x(t);return n.scale.ordinal().domain(t.tickvals).range(t.tickvals.map((function(t){return(t-e[0])/(e[1]-e[0])})))}}(a),parent:d,model:r,brush:g.makeBrush(t,M,k,(function(){t.linePickActive(!1)}),(function(){var e=d;e.focusLayer&&e.focusLayer.render(e.panels,!0);var r=w(e);!t.contextShown()&&r?(e.contextLayer&&e.contextLayer.render(e.panels,!0),t.contextShown(!0)):t.contextShown()&&!r&&(e.contextLayer&&e.contextLayer.render(e.panels,!0,!0),t.contextShown(!1))}),(function(r){if(d.focusLayer.render(d.panels,!0),d.pickLayer&&d.pickLayer.render(d.panels,!0),t.linePickActive(!0),e&&e.filterChanged){var n=y.invert,i=r.map((function(t){return t.map(n).sort(o.sorterAsc)})).sort((function(t,e){return t[0]-e[0]}));e.filterChanged(d.key,a._index,i)}}))}})),d}function T(t){t.classed(m.cn.axisExtentText,!0).attr("text-anchor","middle").style("cursor","default").style("user-select","none")}function L(t,e){var r="top"===e?1:-1,n=t*Math.PI/180;return{dir:r,dx:Math.sin(n),dy:Math.cos(n),degrees:t}}function A(t,e){for(var r=e.panels||(e.panels=[]),n=t.data(),a=0;a<n.length-1;a++){var i=r[a]||(r[a]={}),o=n[a],s=n[a+1];i.dim0=o,i.dim1=s,i.canvasX=o.canvasX,i.panelSizeX=s.canvasX-o.canvasX,i.panelSizeY=e.model.canvasHeight,i.y=0,i.canvasY=0}}function S(t,e){return i.tickText(t._ax,e,!1).text}function E(t,e){if(t.ordinal)return"";var r=t.domainScale.domain(),n=r[e?r.length-1:0];return S(t.model.dimensions[t.visibleIndex],n)}e.exports=function(t,e,r,a){var u=t._fullLayout,c=u._toppaper,v=u._glcontainer;!function(t){for(var e=0;e<t.length;e++)for(var r=0;r<t[e].length;r++)for(var n=t[e][r].trace,a=n.dimensions,o=0;o<a.length;o++){var s=a[o].values,l=a[o]._ax;l&&(l.range?l.range=b(l.range[0],l.range[1]):l.range=_(s,n._length),l.dtick||(l.dtick=.01*(Math.abs(l.range[1]-l.range[0])||1)),l.tickformat=a[o].tickformat,i.calcTicks(l),l.cleanRange())}}(e);var x,C,D=(x=!0,C=!1,{linePickActive:function(t){return arguments.length?x=!!t:x},contextShown:function(t){return arguments.length?C=!!t:C}}),P=e.filter((function(t){return f(t).trace.visible})).map(M.bind(0,r)).map(k.bind(0,D,a));v.each((function(t,e){return o.extendFlat(t,P[e])}));var O=v.selectAll(".gl-canvas").each((function(t){t.viewModel=P[0],t.model=t.viewModel?t.viewModel.model:null})),z=null;O.filter((function(t){return t.pick})).style("pointer-events","auto").on("mousemove",(function(t){if(D.linePickActive()&&t.lineLayer&&a&&a.hover){var e=n.event,r=this.width,i=this.height,o=n.mouse(this),s=o[0],l=o[1];if(s<0||l<0||s>=r||l>=i)return;var u=t.lineLayer.readPixel(s,i-1-l),c=0!==u[3],h=c?u[2]+256*(u[1]+256*u[0]):null,d={x:s,y:l,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:h};h!==z&&(c?a.hover(d):a.unhover&&a.unhover(d),z=h)}})),O.style("opacity",(function(t){return t.pick?0:1})),c.style("background","rgba(255, 255, 255, 0)");var I=c.selectAll("."+m.cn.parcoords).data(P,h);I.exit().remove(),I.enter().append("g").classed(m.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),I.attr("transform",(function(t){return"translate("+t.model.translateX+","+t.model.translateY+")"}));var R=I.selectAll("."+m.cn.parcoordsControlView).data(d,h);R.enter().append("g").classed(m.cn.parcoordsControlView,!0),R.attr("transform",(function(t){return"translate("+t.model.pad.l+","+t.model.pad.t+")"}));var F=R.selectAll("."+m.cn.yAxis).data((function(t){return t.dimensions}),h);F.enter().append("g").classed(m.cn.yAxis,!0),R.each((function(t){A(F,t)})),O.each((function(t){if(t.viewModel){!t.lineLayer||a?t.lineLayer=y(this,t):t.lineLayer.update(t),(t.key||0===t.key)&&(t.viewModel[t.key]=t.lineLayer);var e=!t.context||a;t.lineLayer.render(t.viewModel.panels,e)}})),F.attr("transform",(function(t){return"translate("+t.xScale(t.xIndex)+", 0)"})),F.call(n.behavior.drag().origin((function(t){return t})).on("drag",(function(t){var e=t.parent;D.linePickActive(!1),t.x=Math.max(-m.overdrag,Math.min(t.model.width+m.overdrag,n.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,F.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})),A(F,e),F.filter((function(e){return 0!==Math.abs(t.xIndex-e.xIndex)})).attr("transform",(function(t){return"translate("+t.xScale(t.xIndex)+", 0)"})),n.select(this).attr("transform","translate("+t.x+", 0)"),F.each((function(r,n,a){a===t.parent.key&&(e.dimensions[n]=r)})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!w(e)),e.focusLayer.render&&e.focusLayer.render(e.panels)})).on("dragend",(function(t){var e=t.parent;t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,A(F,e),n.select(this).attr("transform",(function(t){return"translate("+t.x+", 0)"})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!w(e)),e.focusLayer&&e.focusLayer.render(e.panels),e.pickLayer&&e.pickLayer.render(e.panels,!0),D.linePickActive(!0),a&&a.axesMoved&&a.axesMoved(e.key,e.dimensions.map((function(t){return t.crossfilterDimensionIndex})))}))),F.exit().remove();var N=F.selectAll("."+m.cn.axisOverlays).data(d,h);N.enter().append("g").classed(m.cn.axisOverlays,!0),N.selectAll("."+m.cn.axis).remove();var Y=N.selectAll("."+m.cn.axis).data(d,h);Y.enter().append("g").classed(m.cn.axis,!0),Y.each((function(t){var e=t.model.height/t.model.tickDistance,r=t.domainScale,a=r.domain();n.select(this).call(n.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?a:null).tickFormat((function(e){return p.isOrdinal(t)?e:S(t.model.dimensions[t.visibleIndex],e)})).scale(r)),l.font(Y.selectAll("text"),t.model.tickFont)})),Y.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),Y.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 j=N.selectAll("."+m.cn.axisHeading).data(d,h);j.enter().append("g").classed(m.cn.axisHeading,!0);var B=j.selectAll("."+m.cn.axisTitle).data(d,h);B.enter().append("text").classed(m.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("user-select","none").style("pointer-events","auto"),B.text((function(t){return t.label})).each((function(e){var r=n.select(this);l.font(r,e.model.labelFont),s.convertToTspans(r,t)})).attr("transform",(function(t){var e=L(t.model.labelAngle,t.model.labelSide),r=m.axisTitleOffset;return(e.dir>0?"":"translate(0,"+(2*r+t.model.height)+")")+"rotate("+e.degrees+")translate("+-r*e.dx+","+-r*e.dy+")"})).attr("text-anchor",(function(t){var e=L(t.model.labelAngle,t.model.labelSide);return 2*Math.abs(e.dx)>Math.abs(e.dy)?e.dir*e.dx<0?"start":"end":"middle"}));var H=N.selectAll("."+m.cn.axisExtent).data(d,h);H.enter().append("g").classed(m.cn.axisExtent,!0);var U=H.selectAll("."+m.cn.axisExtentTop).data(d,h);U.enter().append("g").classed(m.cn.axisExtentTop,!0),U.attr("transform","translate(0,"+-m.axisExtentOffset+")");var V=U.selectAll("."+m.cn.axisExtentTopText).data(d,h);V.enter().append("text").classed(m.cn.axisExtentTopText,!0).call(T),V.text((function(t){return E(t,!0)})).each((function(t){l.font(n.select(this),t.model.rangeFont)}));var W=H.selectAll("."+m.cn.axisExtentBottom).data(d,h);W.enter().append("g").classed(m.cn.axisExtentBottom,!0),W.attr("transform",(function(t){return"translate(0,"+(t.model.height+m.axisExtentOffset)+")"}));var G=W.selectAll("."+m.cn.axisExtentBottomText).data(d,h);G.enter().append("text").classed(m.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(T),G.text((function(t){return E(t,!1)})).each((function(t){l.font(n.select(this),t.model.rangeFont)})),g.ensureAxisBrush(N)}},{"../../components/colorscale":605,"../../components/drawing":614,"../../lib":719,"../../lib/gup":717,"../../lib/svg_text_utils":743,"../../plots/cartesian/axes":767,"./axisbrush":1075,"./constants":1078,"./helpers":1080,"./lines":1082,"color-rgba":122,d3:163}],1085:[function(t,e,r){var n=t("./parcoords"),a=t("../../lib/prepare_regl"),i=t("./helpers").isVisible;function o(t,e,r){var n=e.indexOf(r),a=t.indexOf(n);return-1===a&&(a+=e.length),a}e.exports=function(t,e){var r=t._fullLayout;if(a(t)){var s={},l={},u={},c={},h=r._size;e.forEach((function(e,r){var n=e[0].trace;u[r]=n.index;var a=c[r]=n._fullInput.index;s[r]=t.data[a].dimensions,l[r]=t.data[a].dimensions.slice()})),n(t,e,{width:h.w,height:h.h,margin:{t:h.t,r:h.r,b:h.b,l:h.l}},{filterChanged:function(e,n,a){var i=l[e][n],o=a.map((function(t){return t.slice()})),s="dimensions["+n+"].constraintrange",h=r._tracePreGUI[t._fullData[u[e]]._fullInput.uid];if(void 0===h[s]){var d=i.constraintrange;h[s]=d||null}var f=t._fullData[u[e]].dimensions[n];o.length?(1===o.length&&(o=o[0]),i.constraintrange=o,f.constraintrange=o.slice(),o=[o]):(delete i.constraintrange,delete f.constraintrange,o=null);var p={};p[s]=o,t.emit("plotly_restyle",[p,[c[e]]])},hover:function(e){t.emit("plotly_hover",e)},unhover:function(e){t.emit("plotly_unhover",e)},axesMoved:function(e,r){var n=function(t,e){return function(r,n){return o(t,e,r)-o(t,e,n)}}(r,l[e].filter(i));s[e].sort(n),l[e].filter((function(t){return!i(t)})).sort((function(t){return l[e].indexOf(t)})).forEach((function(t){s[e].splice(s[e].indexOf(t),1),s[e].splice(l[e].indexOf(t),0,t)})),t.emit("plotly_restyle",[{dimensions:[s[e]]},[c[e]]])}})}}},{"../../lib/prepare_regl":732,"./helpers":1080,"./parcoords":1084}],1086:[function(t,e,r){var n=t("../../plots/attributes"),a=t("../../plots/domain").attributes,i=t("../../plots/font_attributes"),o=t("../../components/color/attributes"),s=t("../../components/fx/hovertemplate_attributes"),l=t("../../lib/extend").extendFlat,u=i({editType:"plot",arrayOk:!0,colorEditType:"plot"});e.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:o.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},editType:"calc"},text:{valType:"data_array",editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:l({},n.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:s({},{keys:["label","color","value","percent","text"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:l({},u,{}),insidetextfont:l({},u,{}),outsidetextfont:l({},u,{}),title:{text:{valType:"string",dflt:"",editType:"plot"},font:l({},u,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:a({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"number",min:-360,max:360,dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"},_deprecated:{title:{valType:"string",dflt:"",editType:"calc"},titlefont:l({},u,{}),titleposition:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"calc"}}}},{"../../components/color/attributes":592,"../../components/fx/hovertemplate_attributes":631,"../../lib/extend":710,"../../plots/attributes":764,"../../plots/domain":792,"../../plots/font_attributes":793}],1087:[function(t,e,r){var n=t("../../registry"),a=t("../../plots/get_data").getModuleCalcData;r.name="pie",r.plot=function(t){var e=n.getModule("pie"),r=a(t.calcdata,e)[0];e.plot(t,r)},r.clean=function(t,e,r,n){var a=n._has&&n._has("pie"),i=e._has&&e._has("pie");a&&!i&&n._pielayer.selectAll("g.trace").remove()}},{"../../plots/get_data":802,"../../registry":847}],1088:[function(t,e,r){var n=t("fast-isnumeric"),a=t("../../lib").isArrayOrTypedArray,i=t("tinycolor2"),o=t("../../components/color"),s=t("./helpers"),l=t("../../lib").isValidTextValue,u={};function c(t){return function(e,r){return!!e&&!!(e=i(e)).isValid()&&(e=o.addOpacity(e,e.getAlpha()),t[r]||(t[r]=e),e)}}function h(t,e){var r,n=JSON.stringify(t),a=e[n];if(!a){for(a=t.slice(),r=0;r<t.length;r++)a.push(i(t[r]).lighten(20).toHexString());for(r=0;r<t.length;r++)a.push(i(t[r]).darken(20).toHexString());e[n]=a}return a}e.exports={calc:function(t,e){var r,i,o=[],u=t._fullLayout,h=u.hiddenlabels||[],d=e.labels,f=e.marker.colors||[],p=e.values,m=a(p)&&p.length;if(e.dlabel)for(d=new Array(p.length),r=0;r<p.length;r++)d[r]=String(e.label0+r*e.dlabel);var g={},y=c(u["_"+e.type+"colormap"]),v=(m?p:d).length,_=0,x=!1;for(r=0;r<v;r++){var b,w,M;if(m){if(b=p[r],!n(b))continue;if((b=+b)<0)continue}else b=1;void 0!==(w=d[r])&&""!==w||(w=r);var k=g[w=String(w)];void 0===k?(g[w]=o.length,(M=-1!==h.indexOf(w))||(_+=b),o.push({v:b,label:w,color:y(f[r],w),i:r,pts:[r],hidden:M})):(x=!0,(i=o[k]).v+=b,i.pts.push(r),i.hidden||(_+=b),!1===i.color&&f[r]&&(i.color=y(f[r],w)))}("funnelarea"===e.type?x:e.sort)&&o.sort((function(t,e){return e.v-t.v})),o[0]&&(o[0].vTotal=_);var T=e.textinfo;if(T&&"none"!==T){var L,A=T.split("+"),S=function(t){return-1!==A.indexOf(t)},E=S("label"),C=S("text"),D=S("value"),P=S("percent"),O=u.separators;for(r=0;r<o.length;r++){if(i=o[r],L=E?[i.label]:[],C){var z=s.getFirstFilled(e.text,i.pts);l(z)&&L.push(z)}D&&L.push(s.formatPieValue(i.v,O)),P&&L.push(s.formatPiePercent(i.v/_,O)),i.text=L.join("<br>")}}return o},crossTraceCalc:function(t,e){var r=(e||{}).type;r||(r="pie");var n=t._fullLayout,a=t.calcdata,i=n[r+"colorway"],o=n["_"+r+"colormap"];n["extend"+r+"colors"]&&(i=h(i,u));for(var s=0,l=0;l<a.length;l++){var c=a[l];if(c[0].trace.type===r)for(var d=0;d<c.length;d++){var f=c[d];!1===f.color&&(o[f.label]?f.color=o[f.label]:(o[f.label]=f.color=i[s%i.length],s++))}}},makePullColorFn:c,generateExtendedColors:h}},{"../../components/color":593,"../../lib":719,"./helpers":1091,"fast-isnumeric":225,tinycolor2:537}],1089:[function(t,e,r){var n=t("../../lib"),a=t("./attributes"),i=t("../../plots/domain").defaults,o=t("../bar/defaults").handleText;e.exports=function(t,e,r,s){function l(r,i){return n.coerce(t,e,a,r,i)}var u,c=l("values"),h=n.isArrayOrTypedArray(c),d=l("labels");if(Array.isArray(d)?(u=d.length,h&&(u=Math.min(u,c.length))):h&&(u=c.length,l("label0"),l("dlabel")),u){e._length=u,l("marker.line.width")&&l("marker.line.color"),l("marker.colors"),l("scalegroup");var f=l("text"),p=l("textinfo",Array.isArray(f)?"text+percent":"percent");if(l("hovertext"),l("hovertemplate"),p&&"none"!==p){var m=l("textposition");o(t,e,s,l,m,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}i(e,s,l);var g=l("hole");if(l("title.text")){var y=l("title.position",g?"middle center":"top center");g||"middle center"!==y||(e.title.position="top center"),n.coerceFont(l,"title.font",s.font)}l("sort"),l("direction"),l("rotation"),l("pull")}else e.visible=!1}},{"../../lib":719,"../../plots/domain":792,"../bar/defaults":861,"./attributes":1086}],1090:[function(t,e,r){var n=t("../../components/fx/helpers").appendArrayMultiPointValues;e.exports=function(t,e){var r={curveNumber:e.index,pointNumbers:t.pts,data:e._input,fullData:e,label:t.label,color:t.color,value:t.v,percent:t.percent,text:t.text,v:t.v};return 1===t.pts.length&&(r.pointNumber=r.i=t.pts[0]),n(r,e,t.pts),"funnelarea"===e.type&&(delete r.v,delete r.i),r}},{"../../components/fx/helpers":628}],1091:[function(t,e,r){var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;r<e.length;r++){var n=t[e[r]];if(n||0===n)return n}},r.castOption=function(t,e){return Array.isArray(t)?r.getFirstFilled(t,e):t||void 0}},{"../../lib":719}],1092:[function(t,e,r){e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),layoutAttributes:t("./layout_attributes"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot").plot,style:t("./style"),styleOne:t("./style_one"),moduleType:"trace",name:"pie",basePlotModule:t("./base_plot"),categories:["pie-like","pie","showLegend"],meta:{}}},{"./attributes":1086,"./base_plot":1087,"./calc":1088,"./defaults":1089,"./layout_attributes":1093,"./layout_defaults":1094,"./plot":1095,"./style":1096,"./style_one":1097}],1093:[function(t,e,r){e.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{}],1094:[function(t,e,r){var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){function r(r,i){return n.coerce(t,e,a,r,i)}r("hiddenlabels"),r("piecolorway",e.colorway),r("extendpiecolors")}},{"../../lib":719,"./layout_attributes":1093}],1095:[function(t,e,r){var n=t("d3"),a=t("../../components/fx"),i=t("../../components/color"),o=t("../../components/drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("./helpers"),c=t("./event_data");function h(t,e,r){var i=r[0],o=i.trace,l=i.cx,h=i.cy;"_hasHoverLabel"in o||(o._hasHoverLabel=!1),"_hasHoverEvent"in o||(o._hasHoverEvent=!1),t.on("mouseover",(function(t){var r=e._fullLayout,d=e._fullData[o.index];if(!e._dragging&&!1!==r.hovermode){var f=d.hoverinfo;if(Array.isArray(f)&&(f=a.castHoverinfo({hoverinfo:[u.castOption(f,t.pts)],_module:o._module},r,0)),"all"===f&&(f="label+text+value+percent+name"),d.hovertemplate||"none"!==f&&"skip"!==f&&f){var p=t.rInscribed||0,m=l+t.pxmid[0]*(1-p),g=h+t.pxmid[1]*(1-p),y=r.separators,v=[];if(f&&-1!==f.indexOf("label")&&v.push(t.label),t.text=u.castOption(d.hovertext||d.text,t.pts),f&&-1!==f.indexOf("text")){var _=t.text;s.isValidTextValue(_)&&v.push(_)}t.value=t.v,t.valueLabel=u.formatPieValue(t.v,y),f&&-1!==f.indexOf("value")&&v.push(t.valueLabel),t.percent=t.v/i.vTotal,t.percentLabel=u.formatPiePercent(t.percent,y),f&&-1!==f.indexOf("percent")&&v.push(t.percentLabel);var x=d.hoverlabel,b=x.font;a.loneHover({trace:o,x0:m-p*i.r,x1:m+p*i.r,y:g,text:v.join("<br>"),name:d.hovertemplate||-1!==f.indexOf("name")?d.name:void 0,idealAlign:t.pxmid[0]<0?"left":"right",color:u.castOption(x.bgcolor,t.pts)||t.color,borderColor:u.castOption(x.bordercolor,t.pts),fontFamily:u.castOption(b.family,t.pts),fontSize:u.castOption(b.size,t.pts),fontColor:u.castOption(b.color,t.pts),nameLength:u.castOption(x.namelength,t.pts),textAlign:u.castOption(x.align,t.pts),hovertemplate:u.castOption(d.hovertemplate,t.pts),hovertemplateLabels:t,eventData:[c(t,d)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:e}),o._hasHoverLabel=!0}o._hasHoverEvent=!0,e.emit("plotly_hover",{points:[c(t,d)],event:n.event})}})),t.on("mouseout",(function(t){var r=e._fullLayout,i=e._fullData[o.index],s=n.select(this).datum();o._hasHoverEvent&&(t.originalEvent=n.event,e.emit("plotly_unhover",{points:[c(s,i)],event:n.event}),o._hasHoverEvent=!1),o._hasHoverLabel&&(a.loneUnhover(r._hoverlayer.node()),o._hasHoverLabel=!1)})),t.on("click",(function(t){var r=e._fullLayout,i=e._fullData[o.index];e._dragging||!1===r.hovermode||(e._hoverdata=[c(t,i)],a.click(e,n.event))}))}function d(t,e,r){var n=u.castOption(t.insidetextfont.color,e.pts);!n&&t._input.textfont&&(n=u.castOption(t._input.textfont.color,e.pts));var a=u.castOption(t.insidetextfont.family,e.pts)||u.castOption(t.textfont.family,e.pts)||r.family,o=u.castOption(t.insidetextfont.size,e.pts)||u.castOption(t.textfont.size,e.pts)||r.size;return{color:n||i.contrast(e.color),family:a,size:o}}function f(t,e){for(var r,n,a=0;a<t.length;a++)if((n=(r=t[a][0]).trace).title.text){var i=n.title.text;n._meta&&(i=s.templateString(i,n._meta));var u=o.tester.append("text").attr("data-notex",1).text(i).call(o.font,n.title.font).call(l.convertToTspans,e),c=o.bBox(u.node(),!0);r.titleBox={width:c.width,height:c.height},u.remove()}}function p(t,e,r){var n=Math.sqrt(t.width*t.width+t.height*t.height),a=t.width/t.height,i=e.halfangle,o=e.ring,s=e.rInscribed,l=r.r||e.rpx1,u={scale:s*l*2/n,rCenter:1-s,rotate:0};if(u.scale>=1)return u;var c=a+1/(2*Math.tan(i)),h=l*Math.min(1/(Math.sqrt(c*c+.5)+c),o/(Math.sqrt(a*a+o/2)+a)),d={scale:2*h/t.height,rCenter:Math.cos(h/l)-h*a/l,rotate:(180/Math.PI*e.midangle+720)%180-90},f=1/a,p=f+1/(2*Math.tan(i)),m=l*Math.min(1/(Math.sqrt(p*p+.5)+p),o/(Math.sqrt(f*f+o/2)+f)),g={scale:2*m/t.width,rCenter:Math.cos(m/l)-m/a/l,rotate:(180/Math.PI*e.midangle+810)%180-90},y=g.scale>d.scale?g:d;return u.scale<1&&y.scale>u.scale?y:u}function m(t,e){return t.v!==e.vTotal||e.trace.hole?Math.min(1/(1+1/Math.sin(t.halfangle)),t.ring/2):1}function g(t,e){var r=e.pxmid[0],n=e.pxmid[1],a=t.width/2,i=t.height/2;return r<0&&(a*=-1),n<0&&(i*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(i)*(a>0?1:-1)/2,y:i/(1+r*r/(n*n)),outside:!0}}function y(t,e){var r,n,a,i=t.trace,o={x:t.cx,y:t.cy},s={tx:0,ty:0};s.ty+=i.title.font.size,a=_(i),-1!==i.title.position.indexOf("top")?(o.y-=(1+a)*t.r,s.ty-=t.titleBox.height):-1!==i.title.position.indexOf("bottom")&&(o.y+=(1+a)*t.r);var l,u=t.r/(void 0===(l=t.trace.aspectratio)?1:l),c=e.w*(i.domain.x[1]-i.domain.x[0])/2;return-1!==i.title.position.indexOf("left")?(c+=u,o.x-=(1+a)*u,s.tx+=t.titleBox.width/2):-1!==i.title.position.indexOf("center")?c*=2:-1!==i.title.position.indexOf("right")&&(c+=u,o.x+=(1+a)*u,s.tx-=t.titleBox.width/2),r=c/t.titleBox.width,n=v(t,e)/t.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:s.tx,ty:s.ty}}function v(t,e){var r=t.trace,n=e.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(t.titleBox.height,n/2)}function _(t){var e,r=t.pull;if(!r)return 0;if(Array.isArray(r))for(r=0,e=0;e<t.pull.length;e++)t.pull[e]>r&&(r=t.pull[e]);return r}function x(t,e){for(var r=[],n=0;n<t.length;n++){var a=t[n][0],i=a.trace,o=i.domain,s=e.w*(o.x[1]-o.x[0]),l=e.h*(o.y[1]-o.y[0]);i.title.text&&"middle center"!==i.title.position&&(l-=v(a,e));var u=s/2,c=l/2;"funnelarea"!==i.type||i.scalegroup||(c/=i.aspectratio),a.r=Math.min(u,c)/(1+_(i)),a.cx=e.l+e.w*(i.domain.x[1]+i.domain.x[0])/2,a.cy=e.t+e.h*(1-i.domain.y[0])-l/2,i.title.text&&-1!==i.title.position.indexOf("bottom")&&(a.cy-=v(a,e)),i.scalegroup&&-1===r.indexOf(i.scalegroup)&&r.push(i.scalegroup)}!function(t,e){for(var r,n,a,i=0;i<e.length;i++){var o=1/0,s=e[i];for(n=0;n<t.length;n++)if((a=(r=t[n][0]).trace).scalegroup===s){var l;if("pie"===a.type)l=r.r*r.r;else if("funnelarea"===a.type){var u,c;a.aspectratio>1?c=(u=r.r)/a.aspectratio:u=(c=r.r)*a.aspectratio,l=(u*=(1+a.baseratio)/2)*c}o=Math.min(o,l/r.vTotal)}for(n=0;n<t.length;n++)if((a=(r=t[n][0]).trace).scalegroup===s){var h=o*r.vTotal;"funnelarea"===a.type&&(h/=(1+a.baseratio)/2,h/=a.aspectratio),r.r=Math.sqrt(h)}}}(t,r)}e.exports={plot:function(t,e){var r=t._fullLayout;f(e,t),x(e,r._size);var a=s.makeTraceGroups(r._pielayer,e,"trace").each((function(e){var a=n.select(this),c=e[0],f=c.trace;!function(t){var e,r,n,a=t[0],i=a.trace,o=i.rotation*Math.PI/180,s=2*Math.PI/a.vTotal,l="px0",u="px1";if("counterclockwise"===i.direction){for(e=0;e<t.length&&t[e].hidden;e++);if(e===t.length)return;o+=s*t[e].v,s*=-1,l="px1",u="px0"}function c(t){return[a.r*Math.sin(t),-a.r*Math.cos(t)]}for(n=c(o),e=0;e<t.length;e++)(r=t[e]).hidden||(r[l]=n,o+=s*r.v/2,r.pxmid=c(o),r.midangle=o,n=c(o+=s*r.v/2),r[u]=n,r.largeArc=r.v>a.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/a.vTotal,.5),r.ring=1-i.hole,r.rInscribed=m(r,a))}(e),a.attr("stroke-linejoin","round"),a.each((function(){var a=n.select(this).selectAll("g.slice").data(e);a.enter().append("g").classed("slice",!0),a.exit().remove();var m=[[[],[]],[[],[]]],v=!1;a.each((function(r){if(r.hidden)n.select(this).selectAll("path,g").remove();else{r.pointNumber=r.i,r.curveNumber=f.index,m[r.pxmid[1]<0?0:1][r.pxmid[0]<0?0:1].push(r);var a=c.cx,i=c.cy,y=n.select(this),_=y.selectAll("path.surface").data([r]);if(_.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),y.call(h,t,e),f.pull){var x=+u.castOption(f.pull,r.pts)||0;x>0&&(a+=x*r.pxmid[0],i+=x*r.pxmid[1])}r.cxFinal=a,r.cyFinal=i;var b=f.hole;if(r.v===c.vTotal){var w="M"+(a+r.px0[0])+","+(i+r.px0[1])+A(r.px0,r.pxmid,!0,1)+A(r.pxmid,r.px0,!0,1)+"Z";b?_.attr("d","M"+(a+b*r.px0[0])+","+(i+b*r.px0[1])+A(r.px0,r.pxmid,!1,b)+A(r.pxmid,r.px0,!1,b)+"Z"+w):_.attr("d",w)}else{var M=A(r.px0,r.px1,!0,1);if(b){var k=1-b;_.attr("d","M"+(a+b*r.px1[0])+","+(i+b*r.px1[1])+A(r.px1,r.px0,!1,b)+"l"+k*r.px0[0]+","+k*r.px0[1]+M+"Z")}else _.attr("d","M"+a+","+i+"l"+r.px0[0]+","+r.px0[1]+M+"Z")}var T=u.castOption(f.textposition,r.pts),L=y.selectAll("g.slicetext").data(r.text&&"none"!==T?[0]:[]);L.enter().append("g").classed("slicetext",!0),L.exit().remove(),L.each((function(){var e=s.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)}));e.text(r.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(o.font,"outside"===T?function(t,e,r){return{color:u.castOption(t.outsidetextfont.color,e.pts)||u.castOption(t.textfont.color,e.pts)||r.color,family:u.castOption(t.outsidetextfont.family,e.pts)||u.castOption(t.textfont.family,e.pts)||r.family,size:u.castOption(t.outsidetextfont.size,e.pts)||u.castOption(t.textfont.size,e.pts)||r.size}}(f,r,t._fullLayout.font):d(f,r,t._fullLayout.font)).call(l.convertToTspans,t);var h,m=o.bBox(e.node());"outside"===T?h=g(m,r):(h=p(m,r,c),"auto"===T&&h.scale<1&&(e.call(o.font,f.outsidetextfont),f.outsidetextfont.family===f.insidetextfont.family&&f.outsidetextfont.size===f.insidetextfont.size||(m=o.bBox(e.node())),h=g(m,r)));var y=a+r.pxmid[0]*h.rCenter+(h.x||0),_=i+r.pxmid[1]*h.rCenter+(h.y||0);h.outside&&(r.yLabelMin=_-m.height/2,r.yLabelMid=_,r.yLabelMax=_+m.height/2,r.labelExtraX=0,r.labelExtraY=0,v=!0),e.attr("transform","translate("+y+","+_+")"+(h.scale<1?"scale("+h.scale+")":"")+(h.rotate?"rotate("+h.rotate+")":"")+"translate("+-(m.left+m.right)/2+","+-(m.top+m.bottom)/2+")")}))}function A(t,e,n,a){var i=a*(e[0]-t[0]),o=a*(e[1]-t[1]);return"a"+a*c.r+","+a*c.r+" 0 "+r.largeArc+(n?" 1 ":" 0 ")+i+","+o}}));var _=n.select(this).selectAll("g.titletext").data(f.title.text?[0]:[]);_.enter().append("g").classed("titletext",!0),_.exit().remove(),_.each((function(){var e,a=s.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),i=f.title.text;f._meta&&(i=s.templateString(i,f._meta)),a.text(i).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(o.font,f.title.font).call(l.convertToTspans,t),e="middle center"===f.title.position?function(t){var e=Math.sqrt(t.titleBox.width*t.titleBox.width+t.titleBox.height*t.titleBox.height);return{x:t.cx,y:t.cy,scale:t.trace.hole*t.r*2/e,tx:0,ty:-t.titleBox.height/2+t.trace.title.font.size}}(c):y(c,r._size),a.attr("transform","translate("+e.x+","+e.y+")"+(e.scale<1?"scale("+e.scale+")":"")+"translate("+e.tx+","+e.ty+")")})),v&&function(t,e){var r,n,a,i,o,s,l,c,h,d,f,p,m;function g(t,e){return t.pxmid[1]-e.pxmid[1]}function y(t,e){return e.pxmid[1]-t.pxmid[1]}function v(t,r){r||(r={});var a,c,h,f,p=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),m=n?t.yLabelMin:t.yLabelMax,g=n?t.yLabelMax:t.yLabelMin,y=t.cyFinal+o(t.px0[1],t.px1[1]),v=p-m;if(v*l>0&&(t.labelExtraY=v),Array.isArray(e.pull))for(c=0;c<d.length;c++)(h=d[c])===t||(u.castOption(e.pull,t.pts)||0)>=(u.castOption(e.pull,h.pts)||0)||((t.pxmid[1]-h.pxmid[1])*l>0?(v=h.cyFinal+o(h.px0[1],h.px1[1])-m-t.labelExtraY)*l>0&&(t.labelExtraY+=v):(g+t.labelExtraY-y)*l>0&&(a=3*s*Math.abs(c-d.indexOf(t)),(f=h.cxFinal+i(h.px0[0],h.px1[0])+a-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*s>0&&(t.labelExtraX+=f)))}for(n=0;n<2;n++)for(a=n?g:y,o=n?Math.max:Math.min,l=n?1:-1,r=0;r<2;r++){for(i=r?Math.max:Math.min,s=r?1:-1,(c=t[n][r]).sort(a),h=t[1-n][r],d=h.concat(c),p=[],f=0;f<c.length;f++)void 0!==c[f].yLabelMid&&p.push(c[f]);for(m=!1,f=0;n&&f<h.length;f++)if(void 0!==h[f].yLabelMid){m=h[f];break}for(f=0;f<p.length;f++){var _=f&&p[f-1];m&&!f&&(_=m),v(p[f],_)}}}(m,f),function(t,e){t.each((function(t){var r=n.select(this);if(t.labelExtraX||t.labelExtraY){var a=r.select("g.slicetext text");a.attr("transform","translate("+t.labelExtraX+","+t.labelExtraY+")"+a.attr("transform"));var o=t.cxFinal+t.pxmid[0],l="M"+o+","+(t.cyFinal+t.pxmid[1]),u=(t.yLabelMax-t.yLabelMin)*(t.pxmid[0]<0?-1:1)/4;if(t.labelExtraX){var c=t.labelExtraX*t.pxmid[1]/t.pxmid[0],h=t.yLabelMid+t.labelExtraY-(t.cyFinal+t.pxmid[1]);Math.abs(c)>Math.abs(h)?l+="l"+h*t.pxmid[0]/t.pxmid[1]+","+h+"H"+(o+t.labelExtraX+u):l+="l"+t.labelExtraX+","+c+"v"+(h-c)+"h"+u}else l+="V"+(t.yLabelMid+t.labelExtraY)+"h"+u;s.ensureSingle(r,"path","textline").call(i.stroke,e.outsidetextfont.color).attr({"stroke-width":Math.min(2,e.outsidetextfont.size/8),d:l,fill:"none"})}else r.select("path.textline").remove()}))}(a,f)}))}));setTimeout((function(){a.selectAll("tspan").each((function(){var t=n.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))}))}),0)},transformInsideText:p,determineInsideTextFont:d,positionTitleOutside:y,prerenderTitles:f,layoutAreas:x,attachFxHandlers:h}},{"../../components/color":593,"../../components/drawing":614,"../../components/fx":632,"../../lib":719,"../../lib/svg_text_utils":743,"./event_data":1090,"./helpers":1091,d3:163}],1096:[function(t,e,r){var n=t("d3"),a=t("./style_one");e.exports=function(t){t._fullLayout._pielayer.selectAll(".trace").each((function(t){var e=t[0].trace,r=n.select(this);r.style({opacity:e.opacity}),r.selectAll("path.surface").each((function(t){n.select(this).call(a,t,e)}))}))}},{"./style_one":1097,d3:163}],1097:[function(t,e,r){var n=t("../../components/color"),a=t("./helpers").castOption;e.exports=function(t,e,r){var i=r.marker.line,o=a(i.color,e.pts)||n.defaultLine,s=a(i.width,e.pts)||0;t.style("stroke-width",s).call(n.fill,e.color).call(n.stroke,o)}},{"../../components/color":593,"./helpers":1091}],1098:[function(t,e,r){var n=t("../scatter/attributes");e.exports={x:n.x,y:n.y,xy:{valType:"data_array",editType:"calc"},indices:{valType:"data_array",editType:"calc"},xbounds:{valType:"data_array",editType:"calc"},ybounds:{valType:"data_array",editType:"calc"},text:n.text,marker:{color:{valType:"color",arrayOk:!1,editType:"calc"},opacity:{valType:"number",min:0,max:1,dflt:1,arrayOk:!1,editType:"calc"},blend:{valType:"boolean",dflt:null,editType:"calc"},sizemin:{valType:"number",min:.1,max:2,dflt:.5,editType:"calc"},sizemax:{valType:"number",min:.1,dflt:20,editType:"calc"},border:{color:{valType:"color",arrayOk:!1,editType:"calc"},arearatio:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},editType:"calc"},editType:"calc"},transforms:void 0}},{"../scatter/attributes":1112}],1099:[function(t,e,r){var n=t("gl-pointcloud2d"),a=t("../../lib/str2rgbarray"),i=t("../../plots/cartesian/autorange").findExtremes,o=t("../scatter/get_trace_color");function s(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=n(t.glplot,this.pointcloudOptions),this.pointcloud._trace=this}var l=s.prototype;l.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}},l.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=o(t,{})},l.updateFast=function(t){var e,r,n,o,s,l,u=this.xData=this.pickXData=t.x,c=this.yData=this.pickYData=t.y,h=this.pickXYData=t.xy,d=t.xbounds&&t.ybounds,f=t.indices,p=this.bounds;if(h){if(n=h,e=h.length>>>1,d)p[0]=t.xbounds[0],p[2]=t.xbounds[1],p[1]=t.ybounds[0],p[3]=t.ybounds[1];else for(l=0;l<e;l++)o=n[2*l],s=n[2*l+1],o<p[0]&&(p[0]=o),o>p[2]&&(p[2]=o),s<p[1]&&(p[1]=s),s>p[3]&&(p[3]=s);if(f)r=f;else for(r=new Int32Array(e),l=0;l<e;l++)r[l]=l}else for(e=u.length,n=new Float32Array(2*e),r=new Int32Array(e),l=0;l<e;l++)o=u[l],s=c[l],r[l]=l,n[2*l]=o,n[2*l+1]=s,o<p[0]&&(p[0]=o),o>p[2]&&(p[2]=o),s<p[1]&&(p[1]=s),s>p[3]&&(p[3]=s);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var m=a(t.marker.color),g=a(t.marker.border.color),y=t.opacity*t.marker.opacity;m[3]*=y,this.pointcloudOptions.color=m;var v=t.marker.blend;null===v&&(v=u.length<100||c.length<100),this.pointcloudOptions.blend=v,g[3]*=y,this.pointcloudOptions.borderColor=g;var _=t.marker.sizemin,x=Math.max(t.marker.sizemax,t.marker.sizemin);this.pointcloudOptions.sizeMin=_,this.pointcloudOptions.sizeMax=x,this.pointcloudOptions.areaRatio=t.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions);var b=this.scene.xaxis,w=this.scene.yaxis,M=x/2||.5;t._extremes[b._id]=i(b,[p[0],p[2]],{ppad:M}),t._extremes[w._id]=i(w,[p[1],p[3]],{ppad:M})},l.dispose=function(){this.pointcloud.dispose()},e.exports=function(t,e){var r=new s(t,e.uid);return r.update(e),r}},{"../../lib/str2rgbarray":742,"../../plots/cartesian/autorange":766,"../scatter/get_trace_color":1121,"gl-pointcloud2d":292}],1100:[function(t,e,r){var n=t("../../lib"),a=t("./attributes");e.exports=function(t,e,r){function i(r,i){return n.coerce(t,e,a,r,i)}i("x"),i("y"),i("xbounds"),i("ybounds"),t.xy&&t.xy instanceof Float32Array&&(e.xy=t.xy),t.indices&&t.indices instanceof Int32Array&&(e.indices=t.indices),i("text"),i("marker.color",r),i("marker.opacity"),i("marker.blend"),i("marker.sizemin"),i("marker.sizemax"),i("marker.border.color",r),i("marker.border.arearatio"),e._length=null}},{"../../lib":719,"./attributes":1098}],1101:[function(t,e,r){e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("../scatter3d/calc"),plot:t("./convert"),moduleType:"trace",name:"pointcloud",basePlotModule:t("../../plots/gl2d"),categories:["gl","gl2d","showLegend"],meta:{}}},{"../../plots/gl2d":805,"../scatter3d/calc":1139,"./attributes":1098,"./convert":1099,"./defaults":1100}],1102:[function(t,e,r){var n=t("../../plots/font_attributes"),a=t("../../plots/attributes"),i=t("../../components/color/attributes"),o=t("../../components/fx/attributes"),s=t("../../plots/domain").attributes,l=t("../../components/fx/hovertemplate_attributes"),u=t("../../components/colorscale/attributes"),c=t("../../plot_api/plot_template").templatedArray,h=t("../../lib/extend").extendFlat,d=t("../../plot_api/edit_types").overrideAll;t("../../constants/docs").FORMAT_LINK,(e.exports=d({hoverinfo:h({},a.hoverinfo,{flags:[],arrayOk:!1}),hoverlabel:o.hoverlabel,domain:s({name:"sankey",trace:!0}),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:n({}),node:{label:{valType:"data_array",dflt:[]},groups:{valType:"info_array",impliedEdits:{x:[],y:[]},dimensions:2,freeLength:!0,dflt:[],items:{valType:"number",editType:"calc"}},x:{valType:"data_array",dflt:[]},y:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},line:{color:{valType:"color",dflt:i.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},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:o.hoverlabel,hovertemplate:l({},{keys:["value","label"]})},link:{label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},line:{color:{valType:"color",dflt:i.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:[]},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:o.hoverlabel,hovertemplate:l({},{keys:["value","label"]}),colorscales:c("concentrationscales",{editType:"calc",label:{valType:"string",editType:"calc",dflt:""},cmax:{valType:"number",editType:"calc",dflt:1},cmin:{valType:"number",editType:"calc",dflt:0},colorscale:h(u().colorscale,{dflt:[[0,"white"],[1,"black"]]})})}},"calc","nested")).transforms=void 0},{"../../components/color/attributes":592,"../../components/colorscale/attributes":600,"../../components/fx/attributes":623,"../../components/fx/hovertemplate_attributes":631,"../../constants/docs":690,"../../lib/extend":710,"../../plot_api/edit_types":750,"../../plot_api/plot_template":757,"../../plots/attributes":764,"../../plots/domain":792,"../../plots/font_attributes":793}],1103:[function(t,e,r){var n=t("../../plot_api/edit_types").overrideAll,a=t("../../plots/get_data").getModuleCalcData,i=t("./plot"),o=t("../../components/fx/layout_attributes"),s=t("../../lib/setcursor"),l=t("../../components/dragelement"),u=t("../../plots/cartesian/select").prepSelect,c=t("../../lib"),h=t("../../registry");function d(t,e){var r=t._fullData[e],n=t._fullLayout,a=n.dragmode,i="pan"===n.dragmode?"move":"crosshair",o=r._bgRect;if("pan"!==a&&"zoom"!==a){s(o,i);var d={_id:"x",c2p:c.identity,_offset:r._sankey.translateX,_length:r._sankey.width},f={_id:"y",c2p:c.identity,_offset:r._sankey.translateY,_length:r._sankey.height},p={gd:t,element:o.node(),plotinfo:{id:e,xaxis:d,yaxis:f,fillRangeItems:c.noop},subplot:e,xaxes:[d],yaxes:[f],doneFnCompleted:function(r){var n,a=t._fullData[e],i=a.node.groups.slice(),o=[];function s(t){for(var e=a._sankey.graph.nodes,r=0;r<e.length;r++)if(e[r].pointNumber===t)return e[r]}for(var l=0;l<r.length;l++){var u=s(r[l].pointNumber);if(u)if(u.group){for(var c=0;c<u.childrenNodes.length;c++)o.push(u.childrenNodes[c].pointNumber);i[u.pointNumber-a.node._count]=!1}else o.push(u.pointNumber)}n=i.filter(Boolean).concat([o]),h.call("_guiRestyle",t,{"node.groups":[n]},e)},prepFn:function(t,e,r){u(t,e,r,p,a)}};l.init(p)}}r.name="sankey",r.baseLayoutAttrOverrides=n({hoverlabel:o.hoverlabel},"plot","nested"),r.plot=function(t){var e=a(t.calcdata,"sankey")[0];i(t,e),r.updateFx(t)},r.clean=function(t,e,r,n){var a=n._has&&n._has("sankey"),i=e._has&&e._has("sankey");a&&!i&&(n._paperdiv.selectAll(".sankey").remove(),n._paperdiv.selectAll(".bgsankey").remove())},r.updateFx=function(t){for(var e=0;e<t._fullData.length;e++)d(t,e)}},{"../../components/dragelement":611,"../../components/fx/layout_attributes":633,"../../lib":719,"../../lib/setcursor":739,"../../plot_api/edit_types":750,"../../plots/cartesian/select":784,"../../plots/get_data":802,"../../registry":847,"./plot":1108}],1104:[function(t,e,r){var n=t("strongly-connected-components"),a=t("../../lib"),i=t("../../lib/gup").wrap,o=a.isArrayOrTypedArray,s=a.isIndex,l=t("../../components/colorscale");e.exports=function(t,e){var r=function(t){var e,r=t.node,i=t.link,u=[],c=o(i.color),h={},d={},f=i.colorscales.length;for(e=0;e<f;e++){var p=i.colorscales[e],m=l.extractScale(p,{cLetter:"c"}),g=l.makeColorScaleFunc(m);d[p.label]=g}var y=0;for(e=0;e<i.value.length;e++)i.source[e]>y&&(y=i.source[e]),i.target[e]>y&&(y=i.target[e]);var v,_=y+1;t.node._count=_;var x=t.node.groups,b={};for(e=0;e<x.length;e++){var w=x[e];for(v=0;v<w.length;v++){var M=w[v],k=_+e;b.hasOwnProperty(M)?a.warn("Node "+M+" is already part of a group."):b[M]=k}}var T={source:[],target:[]};for(e=0;e<i.value.length;e++){var L=i.value[e],A=i.source[e],S=i.target[e];if(L>0&&s(A,_)&&s(S,_)&&(!b.hasOwnProperty(A)||!b.hasOwnProperty(S)||b[A]!==b[S])){b.hasOwnProperty(S)&&(S=b[S]),b.hasOwnProperty(A)&&(A=b[A]),S=+S,h[A=+A]=h[S]=!0;var E="";i.label&&i.label[e]&&(E=i.label[e]);var C=null;E&&d.hasOwnProperty(E)&&(C=d[E]),u.push({pointNumber:e,label:E,color:c?i.color[e]:i.color,concentrationscale:C,source:A,target:S,value:+L}),T.source.push(A),T.target.push(S)}}var D=_+x.length,P=o(r.color),O=[];for(e=0;e<D;e++)if(h[e]){var z=r.label[e];O.push({group:e>_-1,childrenNodes:[],pointNumber:e,label:z,color:P?r.color[e]:r.color})}var I=!1;return function(t,e,r){for(var i=a.init2dArray(t,0),o=0;o<Math.min(e.length,r.length);o++)if(a.isIndex(e[o],t)&&a.isIndex(r[o],t)){if(e[o]===r[o])return!0;i[e[o]].push(r[o])}return n(i).components.some((function(t){return t.length>1}))}(D,T.source,T.target)&&(I=!0),{circular:I,links:u,nodes:O,groups:x,groupLookup:b}}(e);return i({circular:r.circular,_nodes:r.nodes,_links:r.links,_groups:r.groups,_groupLookup:r.groupLookup})}},{"../../components/colorscale":605,"../../lib":719,"../../lib/gup":717,"strongly-connected-components":530}],1105:[function(t,e,r){e.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeCapture:"node-capture",nodeCentered:"node-entered",nodeLabelGuide:"node-label-guide",nodeLabel:"node-label",nodeLabelTextPath:"node-label-text-path"}}},{}],1106:[function(t,e,r){var n=t("../../lib"),a=t("./attributes"),i=t("../../components/color"),o=t("tinycolor2"),s=t("../../plots/domain").defaults,l=t("../../components/fx/hoverlabel_defaults"),u=t("../../plot_api/plot_template"),c=t("../../plots/array_container_defaults");function h(t,e){function r(r,i){return n.coerce(t,e,a.link.colorscales,r,i)}r("label"),r("cmin"),r("cmax"),r("colorscale")}e.exports=function(t,e,r,d){function f(r,i){return n.coerce(t,e,a,r,i)}var p=n.extendDeep(d.hoverlabel,t.hoverlabel),m=t.node,g=u.newContainer(e,"node");function y(t,e){return n.coerce(m,g,a.node,t,e)}y("label"),y("groups"),y("x"),y("y"),y("pad"),y("thickness"),y("line.color"),y("line.width"),y("hoverinfo",t.hoverinfo),l(m,g,y,p),y("hovertemplate");var v=d.colorway;y("color",g.label.map((function(t,e){return i.addOpacity(function(t){return v[t%v.length]}(e),.8)})));var _=t.link||{},x=u.newContainer(e,"link");function b(t,e){return n.coerce(_,x,a.link,t,e)}b("label"),b("source"),b("target"),b("value"),b("line.color"),b("line.width"),b("hoverinfo",t.hoverinfo),l(_,x,b,p),b("hovertemplate");var w,M=o(d.paper_bgcolor).getLuminance()<.333?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)";b("color",n.repeat(M,x.value.length)),c(_,x,{name:"colorscales",handleItemDefaults:h}),s(e,d,f),f("orientation"),f("valueformat"),f("valuesuffix"),g.x.length&&g.y.length&&(w="freeform"),f("arrangement",w),n.coerceFont(f,"textfont",n.extendFlat({},d.font)),e._length=null}},{"../../components/color":593,"../../components/fx/hoverlabel_defaults":630,"../../lib":719,"../../plot_api/plot_template":757,"../../plots/array_container_defaults":763,"../../plots/domain":792,"./attributes":1102,tinycolor2:537}],1107:[function(t,e,r){e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),moduleType:"trace",name:"sankey",basePlotModule:t("./base_plot"),selectPoints:t("./select.js"),categories:["noOpacity"],meta:{}}},{"./attributes":1102,"./base_plot":1103,"./calc":1104,"./defaults":1106,"./plot":1108,"./select.js":1110}],1108:[function(t,e,r){var n=t("d3"),a=t("./render"),i=t("../../components/fx"),o=t("../../components/color"),s=t("../../lib"),l=t("./constants").cn,u=s._;function c(t){return""!==t}function h(t,e){return t.filter((function(t){return t.key===e.traceId}))}function d(t,e){n.select(t).select("path").style("fill-opacity",e),n.select(t).select("rect").style("fill-opacity",e)}function f(t){n.select(t).select("text.name").style("fill","black")}function p(t){return function(e){return-1!==t.node.sourceLinks.indexOf(e.link)||-1!==t.node.targetLinks.indexOf(e.link)}}function m(t){return function(e){return-1!==e.node.sourceLinks.indexOf(t.link)||-1!==e.node.targetLinks.indexOf(t.link)}}function g(t,e,r){e&&r&&h(r,e).selectAll("."+l.sankeyLink).filter(p(e)).call(v.bind(0,e,r,!1))}function y(t,e,r){e&&r&&h(r,e).selectAll("."+l.sankeyLink).filter(p(e)).call(_.bind(0,e,r,!1))}function v(t,e,r,n){var a=n.datum().link.label;n.style("fill-opacity",(function(t){if(!t.link.concentrationscale)return.4})),a&&h(e,t).selectAll("."+l.sankeyLink).filter((function(t){return t.link.label===a})).style("fill-opacity",(function(t){if(!t.link.concentrationscale)return.4})),r&&h(e,t).selectAll("."+l.sankeyNode).filter(m(t)).call(g)}function _(t,e,r,n){var a=n.datum().link.label;n.style("fill-opacity",(function(t){return t.tinyColorAlpha})),a&&h(e,t).selectAll("."+l.sankeyLink).filter((function(t){return t.link.label===a})).style("fill-opacity",(function(t){return t.tinyColorAlpha})),r&&h(e,t).selectAll(l.sankeyNode).filter(m(t)).call(y)}function x(t,e){var r=t.hoverlabel||{},n=s.nestedProperty(r,e).get();return!Array.isArray(n)&&n}e.exports=function(t,e){for(var r=t._fullLayout,s=r._paper,h=r._size,p=0;p<t._fullData.length;p++)if(t._fullData[p].type===l.sankey&&!t._fullData[p]._viewInitial){var m=t._fullData[p].node;t._fullData[p]._viewInitial={node:{groups:m.groups.slice(),x:m.x.slice(),y:m.y.slice()}}}var b=u(t,"source:")+" ",w=u(t,"target:")+" ",M=u(t,"concentration:")+" ",k=u(t,"incoming flow count:")+" ",T=u(t,"outgoing flow count:")+" ";a(t,s,e,{width:h.w,height:h.h,margin:{t:h.t,r:h.r,b:h.b,l:h.l}},{linkEvents:{hover:function(e,r,a){!1!==t._fullLayout.hovermode&&(n.select(e).call(v.bind(0,r,a,!0)),"skip"!==r.link.trace.link.hoverinfo&&(r.link.fullData=r.link.trace,t.emit("plotly_hover",{event:n.event,points:[r.link]})))},follow:function(e,a){if(!1!==t._fullLayout.hovermode){var s=a.link.trace.link;if("none"!==s.hoverinfo&&"skip"!==s.hoverinfo){for(var l=[],u=0,h=0;h<a.flow.links.length;h++){var p=a.flow.links[h];if("closest"!==t._fullLayout.hovermode||a.link.pointNumber===p.pointNumber){a.link.pointNumber===p.pointNumber&&(u=h),p.fullData=p.trace,s=a.link.trace.link;var m=y(p),g={valueLabel:n.format(a.valueFormat)(p.value)+a.valueSuffix};l.push({x:m[0],y:m[1],name:g.valueLabel,text:[p.label||"",b+p.source.label,w+p.target.label,p.concentrationscale?M+n.format("%0.2f")(p.flow.labelConcentration):""].filter(c).join("<br>"),color:x(s,"bgcolor")||o.addOpacity(p.color,1),borderColor:x(s,"bordercolor"),fontFamily:x(s,"font.family"),fontSize:x(s,"font.size"),fontColor:x(s,"font.color"),nameLength:x(s,"namelength"),textAlign:x(s,"align"),idealAlign:n.event.x<m[0]?"right":"left",hovertemplate:s.hovertemplate,hovertemplateLabels:g,eventData:[p]})}}i.loneHover(l,{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t,anchorIndex:u}).each((function(){a.link.concentrationscale||d(this,.65),f(this)}))}}function y(t){var e,r;return t.circular?(e=(t.circularPathData.leftInnerExtent+t.circularPathData.rightInnerExtent)/2+a.parent.translateX,r=t.circularPathData.verticalFullExtent+a.parent.translateY):(e=(t.source.x1+t.target.x0)/2+a.parent.translateX,r=(t.y0+t.y1)/2+a.parent.translateY),[e,r]}},unhover:function(e,a,o){!1!==t._fullLayout.hovermode&&(n.select(e).call(_.bind(0,a,o,!0)),"skip"!==a.link.trace.link.hoverinfo&&(a.link.fullData=a.link.trace,t.emit("plotly_unhover",{event:n.event,points:[a.link]})),i.loneUnhover(r._hoverlayer.node()))},select:function(e,r){var a=r.link;a.originalEvent=n.event,t._hoverdata=[a],i.click(t,{target:!0})}},nodeEvents:{hover:function(e,r,a){!1!==t._fullLayout.hovermode&&(n.select(e).call(g,r,a),"skip"!==r.node.trace.node.hoverinfo&&(r.node.fullData=r.node.trace,t.emit("plotly_hover",{event:n.event,points:[r.node]})))},follow:function(e,a){if(!1!==t._fullLayout.hovermode){var o=a.node.trace.node;if("none"!==o.hoverinfo&&"skip"!==o.hoverinfo){var s=n.select(e).select("."+l.nodeRect),u=t._fullLayout._paperdiv.node().getBoundingClientRect(),h=s.node().getBoundingClientRect(),p=h.left-2-u.left,m=h.right+2-u.left,g=h.top+h.height/4-u.top,y={valueLabel:n.format(a.valueFormat)(a.node.value)+a.valueSuffix};a.node.fullData=a.node.trace;var v=i.loneHover({x0:p,x1:m,y:g,name:n.format(a.valueFormat)(a.node.value)+a.valueSuffix,text:[a.node.label,k+a.node.targetLinks.length,T+a.node.sourceLinks.length].filter(c).join("<br>"),color:x(o,"bgcolor")||a.tinyColorHue,borderColor:x(o,"bordercolor"),fontFamily:x(o,"font.family"),fontSize:x(o,"font.size"),fontColor:x(o,"font.color"),nameLength:x(o,"namelength"),textAlign:x(o,"align"),idealAlign:"left",hovertemplate:o.hovertemplate,hovertemplateLabels:y,eventData:[a.node]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t});d(v,.85),f(v)}}},unhover:function(e,a,o){!1!==t._fullLayout.hovermode&&(n.select(e).call(y,a,o),"skip"!==a.node.trace.node.hoverinfo&&(a.node.fullData=a.node.trace,t.emit("plotly_unhover",{event:n.event,points:[a.node]})),i.loneUnhover(r._hoverlayer.node()))},select:function(e,r,a){var o=r.node;o.originalEvent=n.event,t._hoverdata=[o],n.select(e).call(y,r,a),i.click(t,{target:!0})}}})}},{"../../components/color":593,"../../components/fx":632,"../../lib":719,"./constants":1105,"./render":1109,d3:163}],1109:[function(t,e,r){var n=t("./constants"),a=t("d3"),i=t("tinycolor2"),o=t("../../components/color"),s=t("../../components/drawing"),l=t("@plotly/d3-sankey"),u=t("@plotly/d3-sankey-circular"),c=t("d3-force"),h=t("../../lib"),d=t("../../lib/gup"),f=d.keyFun,p=d.repeat,m=d.unwrap,g=t("d3-interpolate").interpolateNumber,y=t("../../registry");function v(){return function(t){if(t.link.circular)return r=(e=t.link).width/2,n=e.circularPathData,"top"===e.circularLinkType?"M "+n.targetX+" "+(n.targetY+r)+" L"+n.rightInnerExtent+" "+(n.targetY+r)+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightSmallArcRadius+r)+" 0 0 1 "+(n.rightFullExtent-r)+" "+(n.targetY-n.rightSmallArcRadius)+"L"+(n.rightFullExtent-r)+" "+n.verticalRightInnerExtent+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightLargeArcRadius+r)+" 0 0 1 "+n.rightInnerExtent+" "+(n.verticalFullExtent-r)+"L"+n.leftInnerExtent+" "+(n.verticalFullExtent-r)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftLargeArcRadius+r)+" 0 0 1 "+(n.leftFullExtent+r)+" "+n.verticalLeftInnerExtent+"L"+(n.leftFullExtent+r)+" "+(n.sourceY-n.leftSmallArcRadius)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftSmallArcRadius+r)+" 0 0 1 "+n.leftInnerExtent+" "+(n.sourceY+r)+"L"+n.sourceX+" "+(n.sourceY+r)+"L"+n.sourceX+" "+(n.sourceY-r)+"L"+n.leftInnerExtent+" "+(n.sourceY-r)+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftSmallArcRadius-r)+" 0 0 0 "+(n.leftFullExtent-r)+" "+(n.sourceY-n.leftSmallArcRadius)+"L"+(n.leftFullExtent-r)+" "+n.verticalLeftInnerExtent+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftLargeArcRadius-r)+" 0 0 0 "+n.leftInnerExtent+" "+(n.verticalFullExtent+r)+"L"+n.rightInnerExtent+" "+(n.verticalFullExtent+r)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightLargeArcRadius-r)+" 0 0 0 "+(n.rightFullExtent+r)+" "+n.verticalRightInnerExtent+"L"+(n.rightFullExtent+r)+" "+(n.targetY-n.rightSmallArcRadius)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightSmallArcRadius-r)+" 0 0 0 "+n.rightInnerExtent+" "+(n.targetY-r)+"L"+n.targetX+" "+(n.targetY-r)+"Z":"M "+n.targetX+" "+(n.targetY-r)+" L"+n.rightInnerExtent+" "+(n.targetY-r)+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightSmallArcRadius+r)+" 0 0 0 "+(n.rightFullExtent-r)+" "+(n.targetY+n.rightSmallArcRadius)+"L"+(n.rightFullExtent-r)+" "+n.verticalRightInnerExtent+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightLargeArcRadius+r)+" 0 0 0 "+n.rightInnerExtent+" "+(n.verticalFullExtent+r)+"L"+n.leftInnerExtent+" "+(n.verticalFullExtent+r)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftLargeArcRadius+r)+" 0 0 0 "+(n.leftFullExtent+r)+" "+n.verticalLeftInnerExtent+"L"+(n.leftFullExtent+r)+" "+(n.sourceY+n.leftSmallArcRadius)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftSmallArcRadius+r)+" 0 0 0 "+n.leftInnerExtent+" "+(n.sourceY-r)+"L"+n.sourceX+" "+(n.sourceY-r)+"L"+n.sourceX+" "+(n.sourceY+r)+"L"+n.leftInnerExtent+" "+(n.sourceY+r)+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftSmallArcRadius-r)+" 0 0 1 "+(n.leftFullExtent-r)+" "+(n.sourceY+n.leftSmallArcRadius)+"L"+(n.leftFullExtent-r)+" "+n.verticalLeftInnerExtent+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftLargeArcRadius-r)+" 0 0 1 "+n.leftInnerExtent+" "+(n.verticalFullExtent-r)+"L"+n.rightInnerExtent+" "+(n.verticalFullExtent-r)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightLargeArcRadius-r)+" 0 0 1 "+(n.rightFullExtent+r)+" "+n.verticalRightInnerExtent+"L"+(n.rightFullExtent+r)+" "+(n.targetY+n.rightSmallArcRadius)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightSmallArcRadius-r)+" 0 0 1 "+n.rightInnerExtent+" "+(n.targetY+r)+"L"+n.targetX+" "+(n.targetY+r)+"Z";var e,r,n,a=t.link.source.x1,i=t.link.target.x0,o=g(a,i),s=o(.5),l=o(.5),u=t.link.y0-t.link.width/2,c=t.link.y0+t.link.width/2,h=t.link.y1-t.link.width/2,d=t.link.y1+t.link.width/2;return"M"+a+","+u+"C"+s+","+u+" "+l+","+h+" "+i+","+h+"L"+i+","+d+"C"+l+","+d+" "+s+","+c+" "+a+","+c+"Z"}}function _(t){t.attr("transform",(function(t){return"translate("+t.node.x0.toFixed(3)+", "+t.node.y0.toFixed(3)+")"}))}function x(t){t.call(_)}function b(t,e){t.call(x),e.attr("d",v())}function w(t){t.attr("width",(function(t){return t.node.x1-t.node.x0})).attr("height",(function(t){return t.visibleHeight}))}function M(t){return t.link.width>1||t.linkLineWidth>0}function k(t){return"translate("+t.translateX+","+t.translateY+")"+(t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function T(t){return"translate("+(t.horizontal?0:t.labelY)+" "+(t.horizontal?t.labelY:0)+")"}function L(t){return a.svg.line()([[t.horizontal?t.left?-t.sizeAcross:t.visibleWidth+n.nodeTextOffsetHorizontal:n.nodeTextOffsetHorizontal,0],[t.horizontal?t.left?-n.nodeTextOffsetHorizontal:t.sizeAcross:t.visibleHeight-n.nodeTextOffsetHorizontal,0]])}function A(t){return t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)"}function S(t){return t.horizontal?"scale(1 1)":"scale(-1 1)"}function E(t){return t.darkBackground&&!t.horizontal?"rgb(255,255,255)":"rgb(0,0,0)"}function C(t){return t.horizontal&&t.left?"100%":"0%"}function D(t,e,r){t.on(".basic",null).on("mouseover.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.hover(this,t,e),t.interactionState.hovered=[this,t])})).on("mousemove.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.follow(this,t),t.interactionState.hovered=[this,t])})).on("mouseout.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(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||t.partOfGroup||r.select(this,t,e)}))}function P(t,e,r,i){var o=a.behavior.drag().origin((function(t){return{x:t.node.x0+t.visibleWidth/2,y:t.node.y0+t.visibleHeight/2}})).on("dragstart",(function(a){if("fixed"!==a.arrangement&&(h.ensureSingle(i._fullLayout._infolayer,"g","dragcover",(function(t){i._fullLayout._dragCover=t})),h.raiseToTop(this),a.interactionState.dragInProgress=a.node,z(a.node),a.interactionState.hovered&&(r.nodeEvents.unhover.apply(0,a.interactionState.hovered),a.interactionState.hovered=!1),"snap"===a.arrangement)){var o=a.traceId+"|"+a.key;a.forceLayouts[o]?a.forceLayouts[o].alpha(1):function(t,e,r,a){!function(t){for(var e=0;e<t.length;e++)t[e].y=(t[e].y0+t[e].y1)/2,t[e].x=(t[e].x0+t[e].x1)/2}(r.graph.nodes);var i=r.graph.nodes.filter((function(t){return t.originalX===r.node.originalX})).filter((function(t){return!t.partOfGroup}));r.forceLayouts[e]=c.forceSimulation(i).alphaDecay(0).force("collide",c.forceCollide().radius((function(t){return t.dy/2+r.nodePad/2})).strength(1).iterations(n.forceIterations)).force("constrain",function(t,e,r,a){return function(){for(var t=0,i=0;i<r.length;i++){var o=r[i];o===a.interactionState.dragInProgress?(o.x=o.lastDraggedX,o.y=o.lastDraggedY):(o.vx=(o.originalX-o.x)/n.forceTicksPerFrame,o.y=Math.min(a.size-o.dy/2,Math.max(o.dy/2,o.y))),t=Math.max(t,Math.abs(o.vx),Math.abs(o.vy))}!a.interactionState.dragInProgress&&t<.1&&a.forceLayouts[e].alpha()>0&&a.forceLayouts[e].alpha(0)}}(0,e,i,r)).stop()}(0,o,a),function(t,e,r,a,i){window.requestAnimationFrame((function o(){var s;for(s=0;s<n.forceTicksPerFrame;s++)r.forceLayouts[a].tick();if(function(t){for(var e=0;e<t.length;e++)t[e].y0=t[e].y-t[e].dy/2,t[e].y1=t[e].y0+t[e].dy,t[e].x0=t[e].x-t[e].dx/2,t[e].x1=t[e].x0+t[e].dx}(r.graph.nodes),r.sankey.update(r.graph),b(t.filter(I(r)),e),r.forceLayouts[a].alpha()>0)window.requestAnimationFrame(o);else{var l=r.node.originalX;r.node.x0=l-r.visibleWidth/2,r.node.x1=l+r.visibleWidth/2,O(r,i)}}))}(t,e,a,o,i)}})).on("drag",(function(r){if("fixed"!==r.arrangement){var n=a.event.x,i=a.event.y;"snap"===r.arrangement?(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2,r.node.y0=i-r.visibleHeight/2,r.node.y1=i+r.visibleHeight/2):("freeform"===r.arrangement&&(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2),i=Math.max(0,Math.min(r.size-r.visibleHeight/2,i)),r.node.y0=i-r.visibleHeight/2,r.node.y1=i+r.visibleHeight/2),z(r.node),"snap"!==r.arrangement&&(r.sankey.update(r.graph),b(t.filter(I(r)),e))}})).on("dragend",(function(t){if("fixed"!==t.arrangement){t.interactionState.dragInProgress=!1;for(var e=0;e<t.node.childrenNodes.length;e++)t.node.childrenNodes[e].x=t.node.x,t.node.childrenNodes[e].y=t.node.y;"snap"!==t.arrangement&&O(t,i)}}));t.on(".drag",null).call(o)}function O(t,e){for(var r=[],n=[],a=0;a<t.graph.nodes.length;a++){var i=(t.graph.nodes[a].x0+t.graph.nodes[a].x1)/2,o=(t.graph.nodes[a].y0+t.graph.nodes[a].y1)/2;r.push(i/t.figure.width),n.push(o/t.figure.height)}y.call("_guiRestyle",e,{"node.x":[r],"node.y":[n]},t.trace.index).then((function(){e._fullLayout._dragCover&&e._fullLayout._dragCover.remove()}))}function z(t){t.lastDraggedX=t.x0+t.dx/2,t.lastDraggedY=t.y0+t.dy/2}function I(t){return function(e){return e.node.originalX===t.node.originalX}}e.exports=function(t,e,r,c,d){var g=!1;h.ensureSingle(t._fullLayout._infolayer,"g","first-render",(function(){g=!0}));var y=t._fullLayout._dragCover,x=r.filter((function(t){return m(t).trace.visible})).map(function(t,e,r){var a,o=m(e),s=o.trace,c=s.domain,d="h"===s.orientation,f=s.node.pad,p=s.node.thickness,g=t.width*(c.x[1]-c.x[0]),y=t.height*(c.y[1]-c.y[0]),v=o._nodes,_=o._links,x=o.circular;(a=x?u.sankeyCircular().circularLinkGap(0):l.sankey()).iterations(n.sankeyIterations).size(d?[g,y]:[y,g]).nodeWidth(p).nodePadding(f).nodeId((function(t){return t.pointNumber})).nodes(v).links(_);var b,w,M,k=a();for(var T in a.nodePadding()<f&&h.warn("node.pad was reduced to ",a.nodePadding()," to fit within the figure."),o._groupLookup){var L,A=parseInt(o._groupLookup[T]);for(b=0;b<k.nodes.length;b++)if(k.nodes[b].pointNumber===A){L=k.nodes[b];break}if(L){var S={pointNumber:parseInt(T),x0:L.x0,x1:L.x1,y0:L.y0,y1:L.y1,partOfGroup:!0,sourceLinks:[],targetLinks:[]};k.nodes.unshift(S),L.childrenNodes.unshift(S)}}if(function(){for(b=0;b<k.nodes.length;b++){var t,e,r=k.nodes[b],n={};for(w=0;w<r.targetLinks.length;w++)t=(e=r.targetLinks[w]).source.pointNumber+":"+e.target.pointNumber,n.hasOwnProperty(t)||(n[t]=[]),n[t].push(e);var a=Object.keys(n);for(w=0;w<a.length;w++){var o=n[t=a[w]],s=0,l={};for(M=0;M<o.length;M++)l[(e=o[M]).label]||(l[e.label]=0),l[e.label]+=e.value,s+=e.value;for(M=0;M<o.length;M++)(e=o[M]).flow={value:s,labelConcentration:l[e.label]/s,concentration:e.value/s,links:o},e.concentrationscale&&(e.color=i(e.concentrationscale(e.flow.labelConcentration)))}var u=0;for(w=0;w<r.sourceLinks.length;w++)u+=r.sourceLinks[w].value;for(w=0;w<r.sourceLinks.length;w++)(e=r.sourceLinks[w]).concentrationOut=e.value/u;var c=0;for(w=0;w<r.targetLinks.length;w++)c+=r.targetLinks[w].value;for(w=0;w<r.targetLinks.length;w++)(e=r.targetLinks[w]).concenrationIn=e.value/c}}(),s.node.x.length&&s.node.y.length){for(b=0;b<Math.min(s.node.x.length,s.node.y.length,k.nodes.length);b++)if(s.node.x[b]&&s.node.y[b]){var E=[s.node.x[b]*g,s.node.y[b]*y];k.nodes[b].x0=E[0]-p/2,k.nodes[b].x1=E[0]+p/2;var C=k.nodes[b].y1-k.nodes[b].y0;k.nodes[b].y0=E[1]-C/2,k.nodes[b].y1=E[1]+C/2}"snap"===s.arrangement&&function(t){t.forEach((function(t){var e,r,n,a=0,i=t.length;for(t.sort((function(t,e){return t.y0-e.y0})),n=0;n<i;++n)(e=t[n]).y0>=a||(r=a-e.y0)>1e-6&&(e.y0+=r,e.y1+=r),a=e.y1+f}))}(function(t){var e,r,n=t.map((function(t,e){return{x0:t.x0,index:e}})).sort((function(t,e){return t.x0-e.x0})),a=[],i=-1,o=-1/0;for(b=0;b<n.length;b++){var s=t[n[b].index];s.x0>o+p&&(i+=1,e=s.x0),o=s.x0,a[i]||(a[i]=[]),a[i].push(s),r=e-s.x0,s.x0+=r,s.x1+=r}return a}(v=k.nodes)),a.update(k)}return{circular:x,key:r,trace:s,guid:h.randstr(),horizontal:d,width:g,height:y,nodePad:s.node.pad,nodeLineColor:s.node.line.color,nodeLineWidth:s.node.line.width,linkLineColor:s.link.line.color,linkLineWidth:s.link.line.width,valueFormat:s.valueformat,valueSuffix:s.valuesuffix,textFont:s.textfont,translateX:c.x[0]*t.width+t.margin.l,translateY:t.height-c.y[1]*t.height+t.margin.t,dragParallel:d?y:g,dragPerpendicular:d?g:y,arrangement:s.arrangement,sankey:a,graph:k,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}.bind(null,c)),b=e.selectAll("."+n.cn.sankey).data(x,f);b.exit().remove(),b.enter().append("g").classed(n.cn.sankey,!0).style("box-sizing","content-box").style("position","absolute").style("left",0).style("shape-rendering","geometricPrecision").style("pointer-events","auto").attr("transform",k),b.each((function(e,r){t._fullData[r]._sankey=e;var n="bgsankey-"+e.trace.uid+"-"+r;h.ensureSingle(t._fullLayout._draggers,"rect",n),t._fullData[r]._bgRect=a.select("."+n),t._fullData[r]._bgRect.style("pointer-events","all").attr("width",e.width).attr("height",e.height).attr("x",e.translateX).attr("y",e.translateY).classed("bgsankey",!0).style({fill:"transparent","stroke-width":0})})),b.transition().ease(n.ease).duration(n.duration).attr("transform",k);var O=b.selectAll("."+n.cn.sankeyLinks).data(p,f);O.enter().append("g").classed(n.cn.sankeyLinks,!0).style("fill","none");var z=O.selectAll("."+n.cn.sankeyLink).data((function(t){return t.graph.links.filter((function(t){return t.value})).map(function(t,e,r){var n=i(e.color),a=e.source.label+"|"+e.target.label+"__"+r;return e.trace=t.trace,e.curveNumber=t.trace.index,{circular:t.circular,key:a,traceId:t.key,pointNumber:e.pointNumber,link:e,tinyColorHue:o.tinyRGB(n),tinyColorAlpha:n.getAlpha(),linkPath:v,linkLineColor:t.linkLineColor,linkLineWidth:t.linkLineWidth,valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,parent:t,interactionState:t.interactionState,flow:e.flow}}.bind(null,t))}),f);z.enter().append("path").classed(n.cn.sankeyLink,!0).call(D,b,d.linkEvents),z.style("stroke",(function(t){return M(t)?o.tinyRGB(i(t.linkLineColor)):t.tinyColorHue})).style("stroke-opacity",(function(t){return M(t)?o.opacity(t.linkLineColor):t.tinyColorAlpha})).style("fill",(function(t){return t.tinyColorHue})).style("fill-opacity",(function(t){return t.tinyColorAlpha})).style("stroke-width",(function(t){return M(t)?t.linkLineWidth:1})).attr("d",v()),z.style("opacity",(function(){return t._context.staticPlot||g||y?1:0})).transition().ease(n.ease).duration(n.duration).style("opacity",1),z.exit().transition().ease(n.ease).duration(n.duration).style("opacity",0).remove();var I=b.selectAll("."+n.cn.sankeyNodeSet).data(p,f);I.enter().append("g").classed(n.cn.sankeyNodeSet,!0),I.style("cursor",(function(t){switch(t.arrangement){case"fixed":return"default";case"perpendicular":return"ns-resize";default:return"move"}}));var R=I.selectAll("."+n.cn.sankeyNode).data((function(t){var e=t.graph.nodes;return function(t){var e,r=[];for(e=0;e<t.length;e++)t[e].originalX=(t[e].x0+t[e].x1)/2,t[e].originalY=(t[e].y0+t[e].y1)/2,-1===r.indexOf(t[e].originalX)&&r.push(t[e].originalX);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)}(e),e.map(function(t,e){var r=i(e.color),a=n.nodePadAcross,s=t.nodePad/2;e.dx=e.x1-e.x0,e.dy=e.y1-e.y0;var l=e.dx,u=Math.max(.5,e.dy),c="node_"+e.pointNumber;return e.group&&(c=h.randstr()),e.trace=t.trace,e.curveNumber=t.trace.index,{index:e.pointNumber,key:c,partOfGroup:e.partOfGroup||!1,group:e.group,traceId:t.key,trace:t.trace,node:e,nodePad:t.nodePad,nodeLineColor:t.nodeLineColor,nodeLineWidth:t.nodeLineWidth,textFont:t.textFont,size:t.horizontal?t.height:t.width,visibleWidth:Math.ceil(l),visibleHeight:u,zoneX:-a,zoneY:-s,zoneWidth:l+2*a,zoneHeight:u+2*s,labelY:t.horizontal?e.dy/2+1:e.dx/2+1,left:1===e.originalLayer,sizeAcross:t.width,forceLayouts:t.forceLayouts,horizontal:t.horizontal,darkBackground:r.getBrightness()<=128,tinyColorHue:o.tinyRGB(r),tinyColorAlpha:r.getAlpha(),valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,graph:t.graph,arrangement:t.arrangement,uniqueNodeLabelPathId:[t.guid,t.key,c].join("_"),interactionState:t.interactionState,figure:t}}.bind(null,t))}),f);R.enter().append("g").classed(n.cn.sankeyNode,!0).call(_).style("opacity",(function(e){return!t._context.staticPlot&&!g||e.partOfGroup?0:1})),R.call(D,b,d.nodeEvents).call(P,z,d,t),R.transition().ease(n.ease).duration(n.duration).call(_).style("opacity",(function(t){return t.partOfGroup?0:1})),R.exit().transition().ease(n.ease).duration(n.duration).style("opacity",0).remove();var F=R.selectAll("."+n.cn.nodeRect).data(p);F.enter().append("rect").classed(n.cn.nodeRect,!0).call(w),F.style("stroke-width",(function(t){return t.nodeLineWidth})).style("stroke",(function(t){return o.tinyRGB(i(t.nodeLineColor))})).style("stroke-opacity",(function(t){return o.opacity(t.nodeLineColor)})).style("fill",(function(t){return t.tinyColorHue})).style("fill-opacity",(function(t){return t.tinyColorAlpha})),F.transition().ease(n.ease).duration(n.duration).call(w);var N=R.selectAll("."+n.cn.nodeCapture).data(p);N.enter().append("rect").classed(n.cn.nodeCapture,!0).style("fill-opacity",0),N.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 Y=R.selectAll("."+n.cn.nodeCentered).data(p);Y.enter().append("g").classed(n.cn.nodeCentered,!0).attr("transform",T),Y.transition().ease(n.ease).duration(n.duration).attr("transform",T);var j=Y.selectAll("."+n.cn.nodeLabelGuide).data(p);j.enter().append("path").classed(n.cn.nodeLabelGuide,!0).attr("id",(function(t){return t.uniqueNodeLabelPathId})).attr("d",L).attr("transform",A),j.transition().ease(n.ease).duration(n.duration).attr("d",L).attr("transform",A);var B=Y.selectAll("."+n.cn.nodeLabel).data(p);B.enter().append("text").classed(n.cn.nodeLabel,!0).attr("transform",S).style("user-select","none").style("cursor","default").style("fill","black"),B.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){s.font(B,t.textFont)})),B.transition().ease(n.ease).duration(n.duration).attr("transform",S);var H=B.selectAll("."+n.cn.nodeLabelTextPath).data(p);H.enter().append("textPath").classed(n.cn.nodeLabelTextPath,!0).attr("alignment-baseline","middle").attr("xlink:href",(function(t){return"#"+t.uniqueNodeLabelPathId})).attr("startOffset",C).style("fill",E),H.text((function(t){return t.horizontal||t.node.dy>5?t.node.label:""})).attr("text-anchor",(function(t){return t.horizontal&&t.left?"end":"start"})),H.transition().ease(n.ease).duration(n.duration).attr("startOffset",C).style("fill",E)}},{"../../components/color":593,"../../components/drawing":614,"../../lib":719,"../../lib/gup":717,"../../registry":847,"./constants":1105,"@plotly/d3-sankey":54,"@plotly/d3-sankey-circular":53,d3:163,"d3-force":156,"d3-interpolate":158,tinycolor2:537}],1110:[function(t,e,r){e.exports=function(t,e){for(var r=[],n=t.cd[0].trace,a=n._sankey.graph.nodes,i=0;i<a.length;i++){var o=a[i];if(!o.partOfGroup){var s=[(o.x0+o.x1)/2,(o.y0+o.y1)/2];"v"===n.orientation&&s.reverse(),e&&e.contains(s,!1,i,t)&&r.push({pointNumber:o.pointNumber})}}return r}},{}],1111:[function(t,e,r){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.mergeArrayCastPositive(e.textfont.size,t,"ts"),n.mergeArray(e.textfont.color,t,"tc"),n.mergeArray(e.textfont.family,t,"tf"));var a=e.marker;if(a){n.mergeArrayCastPositive(a.size,t,"ms"),n.mergeArrayCastPositive(a.opacity,t,"mo"),n.mergeArray(a.symbol,t,"mx"),n.mergeArray(a.color,t,"mc");var i=a.line;a.line&&(n.mergeArray(i.color,t,"mlc"),n.mergeArrayCastPositive(i.width,t,"mlw"));var o=a.gradient;o&&"none"!==o.type&&(n.mergeArray(o.type,t,"mgt"),n.mergeArray(o.color,t,"mgc"))}}},{"../../lib":719}],1112:[function(t,e,r){var n=t("../../components/fx/hovertemplate_attributes"),a=t("../../components/colorscale/attributes"),i=t("../../plots/font_attributes"),o=t("../../components/drawing/attributes").dash,s=t("../../components/drawing"),l=t("./constants"),u=t("../../lib/extend").extendFlat;e.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dx:{valType:"number",dflt:1,editType:"calc",anim:!0},y:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dy:{valType:"number",dflt:1,editType:"calc",anim:!0},stackgroup:{valType:"string",dflt:"",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc"},groupnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},stackgaps:{valType:"enumerated",values:["infer zero","interpolate"],dflt:"infer zero",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"],editType:"calc"},hoveron:{valType:"flaglist",flags:["points","fills"],editType:"style"},hovertemplate:n({},{keys:l.eventDataKeys}),line:{color:{valType:"color",editType:"style",anim:!0},width:{valType:"number",min:0,dflt:2,editType:"style",anim:!0},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},smoothing:{valType:"number",min:0,max:1.3,dflt:1,editType:"plot"},dash:u({},o,{editType:"style"}),simplify:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},cliponaxis:{valType:"boolean",dflt:!0,editType:"plot"},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],editType:"calc"},fillcolor:{valType:"color",editType:"style",anim:!0},marker:u({symbol:{valType:"enumerated",values:s.symbolList,dflt:"circle",arrayOk:!0,editType:"style"},opacity:{valType:"number",min:0,max:1,arrayOk:!0,editType:"style",anim:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0,editType:"calc",anim:!0},maxdisplayed:{valType:"number",min:0,dflt:0,editType:"plot"},sizeref:{valType:"number",dflt:1,editType:"calc"},sizemin:{valType:"number",min:0,dflt:0,editType:"calc"},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter",editType:"calc"},line:u({width:{valType:"number",min:0,arrayOk:!0,editType:"style",anim:!0},editType:"calc"},a("marker.line",{anim:!0})),gradient:{type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],arrayOk:!0,dflt:"none",editType:"calc"},color:{valType:"color",arrayOk:!0,editType:"calc"},editType:"calc"},editType:"calc"},a("marker",{anim:!0})),selected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},unselected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0,editType:"calc"},textfont:i({editType:"calc",colorEditType:"style",arrayOk:!0}),r:{valType:"data_array",editType:"calc"},t:{valType:"data_array",editType:"calc"}}},{"../../components/colorscale/attributes":600,"../../components/drawing":614,"../../components/drawing/attributes":613,"../../components/fx/hovertemplate_attributes":631,"../../lib/extend":710,"../../plots/font_attributes":793,"./constants":1116}],1113:[function(t,e,r){var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../plots/cartesian/axes"),o=t("../../constants/numerical").BADNUM,s=t("./subtypes"),l=t("./colorscale_calc"),u=t("./arrays_to_calcdata"),c=t("./calc_selection");function h(t,e,r,n,a,o,l){var u=e._length,c=t._fullLayout,h=r._id,d=n._id,f=c._firstScatter[p(e)]===e.uid,g=(m(e,c,r,n)||{}).orientation,y=e.fill;r._minDtick=0,n._minDtick=0;var v={padded:!0},_={padded:!0};l&&(v.ppad=_.ppad=l);var x=u<2||a[0]!==a[u-1]||o[0]!==o[u-1];x&&("tozerox"===y||"tonextx"===y&&(f||"h"===g))?v.tozero=!0:(e.error_y||{}).visible||"tonexty"!==y&&"tozeroy"!==y&&(s.hasMarkers(e)||s.hasText(e))||(v.padded=!1,v.ppad=0),x&&("tozeroy"===y||"tonexty"===y&&(f||"v"===g))?_.tozero=!0:"tonextx"!==y&&"tozerox"!==y||(_.padded=!1),h&&(e._extremes[h]=i.findExtremes(r,a,v)),d&&(e._extremes[d]=i.findExtremes(n,o,_))}function d(t,e){if(s.hasMarkers(t)){var r,n=t.marker,o=1.6*(t.marker.sizeref||1);if(r="area"===t.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/o),3)}:function(t){return Math.max((t||0)/o,3)},a.isArrayOrTypedArray(n.size)){var l={type:"linear"};i.setConvert(l);for(var u=l.makeCalcdata(t.marker,"size"),c=new Array(e),h=0;h<e;h++)c[h]=r(u[h]);return c}return r(n.size)}}function f(t,e){var r=p(e),n=t._firstScatter;n[r]||(n[r]=e.uid)}function p(t){var e=t.stackgroup;return t.xaxis+t.yaxis+t.type+(e?"-"+e:"")}function m(t,e,r,n){var a=t.stackgroup;if(a){var i=e._scatterStackOpts[r._id+n._id][a],o="v"===i.orientation?n:r;return"linear"===o.type||"log"===o.type?i:void 0}}e.exports={calc:function(t,e){var r,s,p,g,y,v,_=t._fullLayout,x=i.getFromId(t,e.xaxis||"x"),b=i.getFromId(t,e.yaxis||"y"),w=x.makeCalcdata(e,"x"),M=b.makeCalcdata(e,"y"),k=e._length,T=new Array(k),L=e.ids,A=m(e,_,x,b),S=!1;f(_,e);var E,C="x",D="y";for(A?(a.pushUnique(A.traceIndices,e._expandedIndex),(r="v"===A.orientation)?(D="s",E="x"):(C="s",E="y"),y="interpolate"===A.stackgaps):h(t,e,x,b,w,M,d(e,k)),s=0;s<k;s++){var P=T[s]={},O=n(w[s]),z=n(M[s]);O&&z?(P[C]=w[s],P[D]=M[s]):A&&(r?O:z)?(P[E]=r?w[s]:M[s],P.gap=!0,y?(P.s=o,S=!0):P.s=0):P[C]=P[D]=o,L&&(P.id=String(L[s]))}if(u(T,e),l(t,e),c(T,e),A){for(s=0;s<T.length;)T[s][E]===o?T.splice(s,1):s++;if(a.sort(T,(function(t,e){return t[E]-e[E]||t.i-e.i})),S){for(s=0;s<T.length-1&&T[s].gap;)s++;for((v=T[s].s)||(v=T[s].s=0),p=0;p<s;p++)T[p].s=v;for(g=T.length-1;g>s&&T[g].gap;)g--;for(v=T[g].s,p=T.length-1;p>g;p--)T[p].s=v;for(;s<g;)if(T[++s].gap){for(p=s+1;T[p].gap;)p++;for(var I=T[s-1][E],R=T[s-1].s,F=(T[p].s-R)/(T[p][E]-I);s<p;)T[s].s=R+(T[s][E]-I)*F,s++}}}return T},calcMarkerSize:d,calcAxisExpansion:h,setFirstScatter:f,getStackOpts:m}},{"../../constants/numerical":695,"../../lib":719,"../../plots/cartesian/axes":767,"./arrays_to_calcdata":1111,"./calc_selection":1114,"./colorscale_calc":1115,"./subtypes":1135,"fast-isnumeric":225}],1114:[function(t,e,r){var n=t("../../lib");e.exports=function(t,e){n.isArrayOrTypedArray(e.selectedpoints)&&n.tagSelected(t,e)}},{"../../lib":719}],1115:[function(t,e,r){var n=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/calc"),i=t("./subtypes");e.exports=function(t,e){i.hasLines(e)&&n(e,"line")&&a(t,e,{vals:e.line.color,containerStr:"line",cLetter:"c"}),i.hasMarkers(e)&&(n(e,"marker")&&a(t,e,{vals:e.marker.color,containerStr:"marker",cLetter:"c"}),n(e,"marker.line")&&a(t,e,{vals:e.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}},{"../../components/colorscale/calc":601,"../../components/colorscale/helpers":604,"./subtypes":1135}],1116:[function(t,e,r){e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20,eventDataKeys:[]}},{}],1117:[function(t,e,r){var n=t("./calc");function a(t,e,r,n,a,i,o){a[n]=!0;var s={i:null,gap:!0,s:0};if(s[o]=r,t.splice(e,0,s),e&&r===t[e-1][o]){var l=t[e-1];s.s=l.s,s.i=l.i,s.gap=l.gap}else i&&(s.s=function(t,e,r,n){var a=t[e-1],i=t[e+1];return i?a?a.s+(i.s-a.s)*(r-a[n])/(i[n]-a[n]):i.s:a.s}(t,e,r,o));e||(t[0].t=t[1].t,t[0].trace=t[1].trace,delete t[1].t,delete t[1].trace)}e.exports=function(t,e){var r=e.xaxis,i=e.yaxis,o=r._id+i._id,s=t._fullLayout._scatterStackOpts[o];if(s){var l,u,c,h,d,f,p,m,g,y,v,_,x,b,w,M=t.calcdata;for(var k in s){var T=(y=s[k]).traceIndices;if(T.length){for(v="interpolate"===y.stackgaps,_=y.groupnorm,"v"===y.orientation?(x="x",b="y"):(x="y",b="x"),w=new Array(T.length),l=0;l<w.length;l++)w[l]=!1;f=M[T[0]];var L=new Array(f.length);for(l=0;l<f.length;l++)L[l]=f[l][x];for(l=1;l<T.length;l++){for(d=M[T[l]],u=c=0;u<d.length;u++){for(p=d[u][x];p>L[c]&&c<L.length;c++)a(d,u,L[c],l,w,v,x),u++;if(p!==L[c]){for(h=0;h<l;h++)a(M[T[h]],c,p,h,w,v,x);L.splice(c,0,p)}c++}for(;c<L.length;c++)a(d,u,L[c],l,w,v,x),u++}var A=L.length;for(u=0;u<f.length;u++){for(m=f[u][b]=f[u].s,l=1;l<T.length;l++)(d=M[T[l]])[0].trace._rawLength=d[0].trace._length,d[0].trace._length=A,m+=d[u].s,d[u][b]=m;if(_)for(g=("fraction"===_?m:m/100)||1,l=0;l<T.length;l++){var S=M[T[l]][u];S[b]/=g,S.sNorm=S.s/g}}for(l=0;l<T.length;l++){var E=(d=M[T[l]])[0].trace,C=n.calcMarkerSize(E,E._rawLength),D=Array.isArray(C);if(C&&w[l]||D){var P=C;for(C=new Array(A),u=0;u<A;u++)C[u]=d[u].gap?0:D?P[d[u].i]:P}var O=new Array(A),z=new Array(A);for(u=0;u<A;u++)O[u]=d[u].x,z[u]=d[u].y;n.calcAxisExpansion(t,E,r,i,O,z,C),d[0].t.orientation=y.orientation}}}}}},{"./calc":1113}],1118:[function(t,e,r){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 a=e-1;a>=0;a--){var i=t[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],1119:[function(t,e,r){var n=t("../../lib"),a=t("../../registry"),i=t("./attributes"),o=t("./constants"),s=t("./subtypes"),l=t("./xy_defaults"),u=t("./stack_defaults"),c=t("./marker_defaults"),h=t("./line_defaults"),d=t("./line_shape_defaults"),f=t("./text_defaults"),p=t("./fillcolor_defaults");e.exports=function(t,e,r,m){function g(r,a){return n.coerce(t,e,i,r,a)}var y=l(t,e,m,g);if(y||(e.visible=!1),e.visible){var v=u(t,e,m,g),_=!v&&y<o.PTS_LINESONLY?"lines+markers":"lines";g("text"),g("hovertext"),g("mode",_),s.hasLines(e)&&(h(t,e,r,m,g),d(t,e,g),g("connectgaps"),g("line.simplify")),s.hasMarkers(e)&&c(t,e,r,m,g,{gradient:!0}),s.hasText(e)&&f(t,e,m,g);var x=[];(s.hasMarkers(e)||s.hasText(e))&&(g("cliponaxis"),g("marker.maxdisplayed"),x.push("points")),g("fill",v?v.fillDflt:"none"),"none"!==e.fill&&(p(t,e,r,g),s.hasLines(e)||d(t,e,g));var b=(e.line||{}).color,w=(e.marker||{}).color;"tonext"!==e.fill&&"toself"!==e.fill||x.push("fills"),g("hoveron",x.join("+")||"points"),"fills"!==e.hoveron&&g("hovertemplate");var M=a.getComponentMethod("errorbars","supplyDefaults");M(t,e,b||w||r,{axis:"y"}),M(t,e,b||w||r,{axis:"x",inherit:"y"}),n.coerceSelectionMarkerOpacity(e,g)}}},{"../../lib":719,"../../registry":847,"./attributes":1112,"./constants":1116,"./fillcolor_defaults":1120,"./line_defaults":1124,"./line_shape_defaults":1126,"./marker_defaults":1130,"./stack_defaults":1133,"./subtypes":1135,"./text_defaults":1136,"./xy_defaults":1137}],1120:[function(t,e,r){var n=t("../../components/color"),a=t("../../lib").isArrayOrTypedArray;e.exports=function(t,e,r,i){var o=!1;if(e.marker){var s=e.marker.color,l=(e.marker.line||{}).color;s&&!a(s)?o=s:l&&!a(l)&&(o=l)}i("fillcolor",n.addOpacity((e.line||{}).color||o||r,.5))}},{"../../components/color":593,"../../lib":719}],1121:[function(t,e,r){var n=t("../../components/color"),a=t("./subtypes");e.exports=function(t,e){var r,i;if("lines"===t.mode)return(r=t.line.color)&&n.opacity(r)?r:t.fillcolor;if("none"===t.mode)return t.fill?t.fillcolor:"";var o=e.mcc||(t.marker||{}).color,s=e.mlcc||((t.marker||{}).line||{}).color;return(i=o&&n.opacity(o)?o:s&&n.opacity(s)&&(e.mlw||((t.marker||{}).line||{}).width)?s:"")?n.opacity(i)<.3?n.addOpacity(i,.3):i:(r=(t.line||{}).color)&&n.opacity(r)&&a.hasLines(t)&&t.line.width?r:t.fillcolor}},{"../../components/color":593,"./subtypes":1135}],1122:[function(t,e,r){var n=t("../../lib"),a=t("../../components/fx"),i=t("../../registry"),o=t("./get_trace_color"),s=t("../../components/color"),l=n.fillText;e.exports=function(t,e,r,u){var c=t.cd,h=c[0].trace,d=t.xa,f=t.ya,p=d.c2p(e),m=f.c2p(r),g=[p,m],y=h.hoveron||"",v=-1!==h.mode.indexOf("markers")?3:.5;if(-1!==y.indexOf("points")){var _=function(t){var e=Math.max(v,t.mrc||0),r=d.c2p(t.x)-p,n=f.c2p(t.y)-m;return Math.max(Math.sqrt(r*r+n*n)-e,1-v/e)},x=a.getDistanceFunction(u,(function(t){var e=Math.max(3,t.mrc||0),r=1-1/e,n=Math.abs(d.c2p(t.x)-p);return n<e?r*n/e:n-e+r}),(function(t){var e=Math.max(3,t.mrc||0),r=1-1/e,n=Math.abs(f.c2p(t.y)-m);return n<e?r*n/e:n-e+r}),_);if(a.getClosest(c,x,t),!1!==t.index){var b=c[t.index],w=d.c2p(b.x,!0),M=f.c2p(b.y,!0),k=b.mrc||1;t.index=b.i;var T=c[0].t.orientation,L=T&&(b.sNorm||b.s),A="h"===T?L:b.x,S="v"===T?L:b.y;return n.extendFlat(t,{color:o(h,b),x0:w-k,x1:w+k,xLabelVal:A,y0:M-k,y1:M+k,yLabelVal:S,spikeDistance:_(b),hovertemplate:h.hovertemplate}),l(b,h,t),i.getComponentMethod("errorbars","hoverInfo")(b,h,t),[t]}}if(-1!==y.indexOf("fills")&&h._polygons){var E,C,D,P,O,z,I,R,F,N=h._polygons,Y=[],j=!1,B=1/0,H=-1/0,U=1/0,V=-1/0;for(E=0;E<N.length;E++)(D=N[E]).contains(g)&&(j=!j,Y.push(D),U=Math.min(U,D.ymin),V=Math.max(V,D.ymax));if(j){var W=((U=Math.max(U,0))+(V=Math.min(V,f._length)))/2;for(E=0;E<Y.length;E++)for(P=Y[E].pts,C=1;C<P.length;C++)(R=P[C-1][1])>W!=(F=P[C][1])>=W&&(z=P[C-1][0],I=P[C][0],F-R&&(O=z+(I-z)*(W-R)/(F-R),B=Math.min(B,O),H=Math.max(H,O)));B=Math.max(B,0),H=Math.min(H,d._length);var G=s.defaultLine;return s.opacity(h.fillcolor)?G=h.fillcolor:s.opacity((h.line||{}).color)&&(G=h.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:B,x1:H,y0:W,y1:W,color:G,hovertemplate:!1}),delete t.index,h.text&&!Array.isArray(h.text)?t.text=String(h.text):t.text=h.name,[t]}}}},{"../../components/color":593,"../../components/fx":632,"../../lib":719,"../../registry":847,"./get_trace_color":1121}],1123:[function(t,e,r){var n=t("./subtypes");e.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:t("./attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("./cross_trace_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./cross_trace_calc"),arraysToCalcdata:t("./arrays_to_calcdata"),plot:t("./plot"),colorbar:t("./marker_colorbar"),style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":778,"./arrays_to_calcdata":1111,"./attributes":1112,"./calc":1113,"./cross_trace_calc":1117,"./cross_trace_defaults":1118,"./defaults":1119,"./hover":1122,"./marker_colorbar":1129,"./plot":1131,"./select":1132,"./style":1134,"./subtypes":1135}],1124:[function(t,e,r){var n=t("../../lib").isArrayOrTypedArray,a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s,l){var u=(t.marker||{}).color;s("line.color",r),a(t,"line")?i(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(u)&&u||r),s("line.width"),(l||{}).noDash||s("line.dash")}},{"../../components/colorscale/defaults":603,"../../components/colorscale/helpers":604,"../../lib":719}],1125:[function(t,e,r){var n=t("../../constants/numerical"),a=n.BADNUM,i=n.LOG_CLIP,o=i+.5,s=i-.5,l=t("../../lib"),u=l.segmentsIntersect,c=l.constrain,h=t("./constants");e.exports=function(t,e){var r,n,i,d,f,p,m,g,y,v,_,x,b,w,M,k,T,L,A=e.xaxis,S=e.yaxis,E="log"===A.type,C="log"===S.type,D=A._length,P=S._length,O=e.connectGaps,z=e.baseTolerance,I=e.shape,R="linear"===I,F=e.fill&&"none"!==e.fill,N=[],Y=h.minTolerance,j=t.length,B=new Array(j),H=0;function U(e){var r=t[e];if(!r)return!1;var n=A.c2p(r.x),i=S.c2p(r.y);if(n===a){if(E&&(n=A.c2p(r.x,!0)),n===a)return!1;C&&i===a&&(n*=Math.abs(A._m*P*(A._m>0?o:s)/(S._m*D*(S._m>0?o:s)))),n*=1e3}if(i===a){if(C&&(i=S.c2p(r.y,!0)),i===a)return!1;i*=1e3}return[n,i]}function V(t,e,r,n){var a=r-t,i=n-e,o=.5-t,s=.5-e,l=a*a+i*i,u=a*o+i*s;if(u>0&&u<l){var c=o*i-s*a;if(c*c<l)return!0}}function W(t,e){var r=t[0]/D,n=t[1]/P,a=Math.max(0,-r,r-1,-n,n-1);return a&&void 0!==T&&V(r,n,T,L)&&(a=0),a&&e&&V(r,n,e[0]/D,e[1]/P)&&(a=0),(1+h.toleranceGrowth*a)*z}function G(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}var q,Z,X,J,K,$,Q,tt=h.maxScreensAway,et=-D*tt,rt=D*(1+tt),nt=-P*tt,at=P*(1+tt),it=[[et,nt,rt,nt],[rt,nt,rt,at],[rt,at,et,at],[et,at,et,nt]];function ot(t){if(t[0]<et||t[0]>rt||t[1]<nt||t[1]>at)return[c(t[0],et,rt),c(t[1],nt,at)]}function st(t,e){return t[0]===e[0]&&(t[0]===et||t[0]===rt)||t[1]===e[1]&&(t[1]===nt||t[1]===at)||void 0}function lt(t,e,r){return function(n,a){var i=ot(n),o=ot(a),s=[];if(i&&o&&st(i,o))return s;i&&s.push(i),o&&s.push(o);var u=2*l.constrain((n[t]+a[t])/2,e,r)-((i||n)[t]+(o||a)[t]);return u&&((i&&o?u>0==i[t]>o[t]?i:o:i||o)[t]+=u),s}}function ut(t){var e=t[0],r=t[1],n=e===B[H-1][0],a=r===B[H-1][1];if(!n||!a)if(H>1){var i=e===B[H-2][0],o=r===B[H-2][1];n&&(e===et||e===rt)&&i?o?H--:B[H-1]=t:a&&(r===nt||r===at)&&o?i?H--:B[H-1]=t:B[H++]=t}else B[H++]=t}function ct(t){B[H-1][0]!==t[0]&&B[H-1][1]!==t[1]&&ut([X,J]),ut(t),K=null,X=J=0}function ht(t){if(T=t[0]/D,L=t[1]/P,q=t[0]<et?et:t[0]>rt?rt:0,Z=t[1]<nt?nt:t[1]>at?at:0,q||Z){if(H)if(K){var e=Q(K,t);e.length>1&&(ct(e[0]),B[H++]=e[1])}else $=Q(B[H-1],t)[0],B[H++]=$;else B[H++]=[q||t[0],Z||t[1]];var r=B[H-1];q&&Z&&(r[0]!==q||r[1]!==Z)?(K&&(X!==q&&J!==Z?ut(X&&J?(n=K,i=(a=t)[0]-n[0],o=(a[1]-n[1])/i,(n[1]*a[0]-a[1]*n[0])/i>0?[o>0?et:rt,at]:[o>0?rt:et,nt]):[X||q,J||Z]):X&&J&&ut([X,J])),ut([q,Z])):X-q&&J-Z&&ut([q||X,Z||J]),K=t,X=q,J=Z}else K&&ct(Q(K,t)[0]),B[H++]=t;var n,a,i,o}for("linear"===I||"spline"===I?Q=function(t,e){for(var r=[],n=0,a=0;a<4;a++){var i=it[a],o=u(t[0],t[1],e[0],e[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&G(o,t)<G(r[0],t)?r.unshift(o):r.push(o),n++)}return r}:"hv"===I||"vh"===I?Q=function(t,e){var r=[],n=ot(t),a=ot(e);return n&&a&&st(n,a)||(n&&r.push(n),a&&r.push(a)),r}:"hvh"===I?Q=lt(0,et,rt):"vhv"===I&&(Q=lt(1,nt,at)),r=0;r<j;r++)if(n=U(r)){for(H=0,K=null,ht(n),r++;r<j;r++){if(!(d=U(r))){if(O)continue;break}if(R&&e.simplify){var dt=U(r+1);if(v=G(d,n),F&&(0===H||H===j-1)||!(v<W(d,dt)*Y)){for(g=[(d[0]-n[0])/v,(d[1]-n[1])/v],f=n,_=v,x=w=M=0,m=!1,i=d,r++;r<t.length;r++){if(p=dt,dt=U(r+1),!p){if(O)continue;break}if(k=(y=[p[0]-n[0],p[1]-n[1]])[0]*g[1]-y[1]*g[0],w=Math.min(w,k),(M=Math.max(M,k))-w>W(p,dt))break;i=p,(b=y[0]*g[0]+y[1]*g[1])>_?(_=b,d=p,m=!1):b<x&&(x=b,f=p,m=!0)}if(m?(ht(d),i!==f&&ht(f)):(f!==n&&ht(f),i!==d&&ht(d)),ht(i),r>=t.length||!p)break;ht(p),n=p}}else ht(d)}K&&ut([X||K[0],J||K[1]]),N.push(B.slice(0,H))}return N}},{"../../constants/numerical":695,"../../lib":719,"./constants":1116}],1126:[function(t,e,r){e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],1127:[function(t,e,r){var n={tonextx:1,tonexty:1,tonext:1};e.exports=function(t,e,r){var a,i,o,s,l,u={},c=!1,h=-1,d=0,f=-1;for(i=0;i<r.length;i++)(o=(a=r[i][0].trace).stackgroup||"")?o in u?l=u[o]:(l=u[o]=d,d++):a.fill in n&&f>=0?l=f:(l=f=d,d++),l<h&&(c=!0),a._groupIndex=h=l;var p=r.slice();c&&p.sort((function(t,e){var r=t[0].trace,n=e[0].trace;return r._groupIndex-n._groupIndex||r.index-n.index}));var m={};for(i=0;i<p.length;i++)o=(a=p[i][0].trace).stackgroup||"",!0===a.visible?(a._nexttrace=null,a.fill in n&&(s=m[o],a._prevtrace=s||null,s&&(s._nexttrace=a)),a._ownfill=a.fill&&("tozero"===a.fill.substr(0,6)||"toself"===a.fill||"to"===a.fill.substr(0,2)&&!a._prevtrace),m[o]=a):a._prevtrace=a._nexttrace=a._ownfill=null;return p}},{}],1128:[function(t,e,r){var n=t("fast-isnumeric");e.exports=function(t){var e=t.marker,r=e.sizeref||1,a=e.sizemin||0,i="area"===e.sizemode?function(t){return Math.sqrt(t/r)}:function(t){return t/r};return function(t){var e=i(t/2);return n(e)&&e>0?Math.max(e,a):0}}},{"fast-isnumeric":225}],1129:[function(t,e,r){e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],1130:[function(t,e,r){var n=t("../../components/color"),a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,u){var c=o.isBubble(t),h=(t.line||{}).color;u=u||{},h&&(r=h),l("marker.symbol"),l("marker.opacity",c?.7:1),l("marker.size"),l("marker.color",r),a(t,"marker")&&i(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),u.noLine||(l("marker.line.color",h&&!Array.isArray(h)&&e.marker.color!==h?h:c?n.background:n.defaultLine),a(t,"marker.line")&&i(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",c?1:0)),c&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),u.gradient&&"none"!==l("marker.gradient.type")&&l("marker.gradient.color")}},{"../../components/color":593,"../../components/colorscale/defaults":603,"../../components/colorscale/helpers":604,"./subtypes":1135}],1131:[function(t,e,r){var n=t("d3"),a=t("../../registry"),i=t("../../lib"),o=i.ensureSingle,s=i.identity,l=t("../../components/drawing"),u=t("./subtypes"),c=t("./line_points"),h=t("./link_traces"),d=t("../../lib/polygon").tester;function f(t,e,r,h,f,p,m){var g;!function(t,e,r,a,o){var s=r.xaxis,l=r.yaxis,c=n.extent(i.simpleMap(s.range,s.r2c)),h=n.extent(i.simpleMap(l.range,l.r2c)),d=a[0].trace;if(u.hasMarkers(d)){var f=d.marker.maxdisplayed;if(0!==f){var p=a.filter((function(t){return t.x>=c[0]&&t.x<=c[1]&&t.y>=h[0]&&t.y<=h[1]})),m=Math.ceil(p.length/f),g=0;o.forEach((function(t,r){var n=t[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&r<e&&g++}));var y=Math.round(g*m/3+Math.floor(g/3)*m/7.1);a.forEach((function(t){delete t.vis})),p.forEach((function(t,e){0===Math.round((e+y)%m)&&(t.vis=!0)}))}}}(0,e,r,h,f);var y=!!m&&m.duration>0;function v(t){return y?t.transition():t}var _=r.xaxis,x=r.yaxis,b=h[0].trace,w=b.line,M=n.select(p),k=o(M,"g","errorbars"),T=o(M,"g","lines"),L=o(M,"g","points"),A=o(M,"g","text");if(a.getComponentMethod("errorbars","plot")(t,k,r,m),!0===b.visible){var S,E;v(M).style("opacity",b.opacity);var C=b.fill.charAt(b.fill.length-1);"x"!==C&&"y"!==C&&(C=""),h[0][r.isRangePlot?"nodeRangePlot3":"node3"]=M;var D,P,O="",z=[],I=b._prevtrace;I&&(O=I._prevRevpath||"",E=I._nextFill,z=I._polygons);var R,F,N,Y,j,B,H,U="",V="",W=[],G=i.noop;if(S=b._ownFill,u.hasLines(b)||"none"!==b.fill){for(E&&E.datum(h),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(R=l.steps(w.shape),F=l.steps(w.shape.split("").reverse().join(""))):R=F="spline"===w.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),w.smoothing):l.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},N=function(t){return F(t.reverse())},W=c(h,{xaxis:_,yaxis:x,connectGaps:b.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:b.fill}),H=b._polygons=new Array(W.length),g=0;g<W.length;g++)b._polygons[g]=d(W[g]);W.length&&(Y=W[0][0],B=(j=W[W.length-1])[j.length-1]),G=function(t){return function(e){if(D=R(e),P=N(e),U?C?(U+="L"+D.substr(1),V=P+"L"+V.substr(1)):(U+="Z"+D,V=P+"Z"+V):(U=D,V=P),u.hasLines(b)&&e.length>1){var r=n.select(this);if(r.datum(h),t)v(r.style("opacity",0).attr("d",D).call(l.lineGroupStyle)).style("opacity",1);else{var a=v(r);a.attr("d",D),l.singleLineStyle(h,a)}}}}}var q=T.selectAll(".js-line").data(W);v(q.exit()).style("opacity",0).remove(),q.each(G(!1)),q.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(G(!0)),l.setClipUrl(q,r.layerClipId,t),W.length?(S?(S.datum(h),Y&&B&&(C?("y"===C?Y[1]=B[1]=x.c2p(0,!0):"x"===C&&(Y[0]=B[0]=_.c2p(0,!0)),v(S).attr("d","M"+B+"L"+Y+"L"+U.substr(1)).call(l.singleFillStyle)):v(S).attr("d",U+"Z").call(l.singleFillStyle))):E&&("tonext"===b.fill.substr(0,6)&&U&&O?("tonext"===b.fill?v(E).attr("d",U+"Z"+O+"Z").call(l.singleFillStyle):v(E).attr("d",U+"L"+O.substr(1)+"Z").call(l.singleFillStyle),b._polygons=b._polygons.concat(z)):(X(E),b._polygons=null)),b._prevRevpath=V,b._prevPolygons=H):(S?X(S):E&&X(E),b._polygons=b._prevRevpath=b._prevPolygons=null),L.datum(h),A.datum(h),function(e,a,i){var o,c=i[0].trace,h=u.hasMarkers(c),d=u.hasText(c),f=function(t){if(t.ids)return Q}(c),p=tt,m=tt;if(h||d){var g=s,b=c.stackgroup,w=b&&"infer zero"===t._fullLayout._scatterStackOpts[_._id+x._id][b].stackgaps;c.marker.maxdisplayed||c._needsCull?g=w?K:J:b&&!w&&(g=$),h&&(p=g),d&&(m=g)}var M,k=(o=e.selectAll("path.point").data(p,f)).enter().append("path").classed("point",!0);y&&k.call(l.pointStyle,c,t).call(l.translatePoints,_,x).style("opacity",0).transition().style("opacity",1),o.order(),h&&(M=l.makePointStyleFns(c)),o.each((function(e){var a=n.select(this),i=v(a);l.translatePoint(e,i,_,x)?(l.singlePointStyle(e,i,c,M,t),r.layerClipId&&l.hideOutsideRangePoint(e,i,_,x,c.xcalendar,c.ycalendar),c.customdata&&a.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):i.remove()})),y?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(m,f)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(t){var e=n.select(this),a=v(e.select("text"));l.translatePoint(t,a,_,x)?r.layerClipId&&l.hideOutsideRangePoint(t,e,_,x,c.xcalendar,c.ycalendar):e.remove()})),o.selectAll("text").call(l.textPointStyle,c,t).each((function(t){var e=_.c2p(t.x),r=x.c2p(t.y);n.select(this).selectAll("tspan.line").each((function(){v(n.select(this)).attr({x:e,y:r})}))})),o.exit().remove()}(L,A,h);var Z=!1===b.cliponaxis?null:r.layerClipId;l.setClipUrl(L,Z,t),l.setClipUrl(A,Z,t)}function X(t){v(t).attr("d","M0,0Z")}function J(t){return t.filter((function(t){return!t.gap&&t.vis}))}function K(t){return t.filter((function(t){return t.vis}))}function $(t){return t.filter((function(t){return!t.gap}))}function Q(t){return t.id}function tt(){return!1}}e.exports=function(t,e,r,a,i,u){var c,d,p=!i,m=!!i&&i.duration>0,g=h(t,e,r);(c=a.selectAll("g.trace").data(g,(function(t){return t[0].trace.uid}))).enter().append("g").attr("class",(function(t){return"trace scatter trace"+t[0].trace.uid})).style("stroke-miterlimit",2),c.order(),function(t,e,r){e.each((function(e){var a=o(n.select(this),"g","fills");l.setClipUrl(a,r.layerClipId,t);var i=e[0].trace,u=[];i._ownfill&&u.push("_ownFill"),i._nexttrace&&u.push("_nextFill");var c=a.selectAll("g").data(u,s);c.enter().append("g"),c.exit().each((function(t){i[t]=null})).remove(),c.order().each((function(t){i[t]=o(n.select(this),"path","js-fill")}))}))}(t,c,e),m?(u&&(d=u()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){d&&d()})).each("interrupt",(function(){d&&d()})).each((function(){a.selectAll("g.trace").each((function(r,n){f(t,n,e,r,g,this,i)}))}))):c.each((function(r,n){f(t,n,e,r,g,this,i)})),p&&c.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":614,"../../lib":719,"../../lib/polygon":731,"../../registry":847,"./line_points":1125,"./link_traces":1127,"./subtypes":1135,d3:163}],1132:[function(t,e,r){var n=t("./subtypes");e.exports=function(t,e){var r,a,i,o,s=t.cd,l=t.xaxis,u=t.yaxis,c=[],h=s[0].trace;if(!n.hasMarkers(h)&&!n.hasText(h))return[];if(!1===e)for(r=0;r<s.length;r++)s[r].selected=0;else for(r=0;r<s.length;r++)a=s[r],i=l.c2p(a.x),o=u.c2p(a.y),null!==a.i&&e.contains([i,o],!1,r,t)?(c.push({pointNumber:a.i,x:l.c2d(a.x),y:u.c2d(a.y)}),a.selected=1):a.selected=0;return c}},{"./subtypes":1135}],1133:[function(t,e,r){var n=["orientation","groupnorm","stackgaps"];e.exports=function(t,e,r,a){var i=r._scatterStackOpts,o=a("stackgroup");if(o){var s=e.xaxis+e.yaxis,l=i[s];l||(l=i[s]={});var u=l[o],c=!1;u?u.traces.push(e):(u=l[o]={traceIndices:[],traces:[e]},c=!0);for(var h={orientation:e.x&&!e.y?"h":"v"},d=0;d<n.length;d++){var f=n[d],p=f+"Found";if(!u[p]){var m=void 0!==t[f],g="orientation"===f;if((m||c)&&(u[f]=a(f,h[f]),g&&(u.fillDflt="h"===u[f]?"tonextx":"tonexty"),m&&(u[p]=!0,!c&&(delete u.traces[0][f],g))))for(var y=0;y<u.traces.length-1;y++){var v=u.traces[y];v._input.fill!==v.fill&&(v.fill=u.fillDflt)}}}return u}}},{}],1134:[function(t,e,r){var n=t("d3"),a=t("../../components/drawing"),i=t("../../registry");function o(t,e,r){a.pointStyle(t.selectAll("path.point"),e,r)}function s(t,e,r){a.textPointStyle(t.selectAll("text"),e,r)}e.exports={style:function(t){var e=n.select(t).selectAll("g.trace.scatter");e.style("opacity",(function(t){return t[0].trace.opacity})),e.selectAll("g.points").each((function(e){o(n.select(this),e.trace||e[0].trace,t)})),e.selectAll("g.text").each((function(e){s(n.select(this),e.trace||e[0].trace,t)})),e.selectAll("g.trace path.js-line").call(a.lineGroupStyle),e.selectAll("g.trace path.js-fill").call(a.fillGroupStyle),i.getComponentMethod("errorbars","style")(e)},stylePoints:o,styleText:s,styleOnSelect:function(t,e,r){var n=e[0].trace;n.selectedpoints?(a.selectedPointStyle(r.selectAll("path.point"),n),a.selectedTextStyle(r.selectAll("text"),n)):(o(r,n,t),s(r,n,t))}}},{"../../components/drawing":614,"../../registry":847,d3:163}],1135:[function(t,e,r){var n=t("../../lib");e.exports={hasLines:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("lines")},hasMarkers:function(t){return t.visible&&(t.mode&&-1!==t.mode.indexOf("markers")||"splom"===t.type)},hasText:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("text")},isBubble:function(t){return n.isPlainObject(t.marker)&&n.isArrayOrTypedArray(t.marker.size)}}},{"../../lib":719}],1136:[function(t,e,r){var n=t("../../lib");e.exports=function(t,e,r,a,i){i=i||{},a("textposition"),n.coerceFont(a,"textfont",r.font),i.noSelect||(a("selected.textfont.color"),a("unselected.textfont.color"))}},{"../../lib":719}],1137:[function(t,e,r){var n=t("../../lib"),a=t("../../registry");e.exports=function(t,e,r,i){var o,s=i("x"),l=i("y");if(a.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],r),s){var u=n.minRowLength(s);l?o=Math.min(u,n.minRowLength(l)):(o=u,i("y0"),i("dy"))}else{if(!l)return 0;o=n.minRowLength(l),i("x0"),i("dx")}return e._length=o,o}},{"../../lib":719,"../../registry":847}],1138:[function(t,e,r){var n=t("../scatter/attributes"),a=t("../../components/colorscale/attributes"),i=t("../../components/fx/hovertemplate_attributes"),o=t("../../plots/attributes"),s=t("../../constants/gl3d_dashes"),l=t("../../constants/gl3d_markers"),u=t("../../lib/extend").extendFlat,c=t("../../plot_api/edit_types").overrideAll,h=n.line,d=n.marker,f=d.line,p=u({width:h.width,dash:{valType:"enumerated",values:Object.keys(s),dflt:"solid"}},a("line")),m=e.exports=c({x:n.x,y:n.y,z:{valType:"data_array"},text:u({},n.text,{}),hovertext:u({},n.hovertext,{}),hovertemplate:i(),mode:u({},n.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}},y:{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}},z:{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}}},connectgaps:n.connectgaps,line:p,marker:u({symbol:{valType:"enumerated",values:Object.keys(l),dflt:"circle",arrayOk:!0},size:u({},d.size,{dflt:8}),sizeref:d.sizeref,sizemin:d.sizemin,sizemode:d.sizemode,opacity:u({},d.opacity,{arrayOk:!1}),colorbar:d.colorbar,line:u({width:u({},f.width,{arrayOk:!1})},a("marker.line"))},a("marker")),textposition:u({},n.textposition,{dflt:"top center"}),textfont:{color:n.textfont.color,size:n.textfont.size,family:u({},n.textfont.family,{arrayOk:!1})},hoverinfo:u({},o.hoverinfo)},"calc","nested");m.x.editType=m.y.editType=m.z.editType="calc+clearAxisTypes"},{"../../components/colorscale/attributes":600,"../../components/fx/hovertemplate_attributes":631,"../../constants/gl3d_dashes":692,"../../constants/gl3d_markers":693,"../../lib/extend":710,"../../plot_api/edit_types":750,"../../plots/attributes":764,"../scatter/attributes":1112}],1139:[function(t,e,r){var n=t("../scatter/arrays_to_calcdata"),a=t("../scatter/colorscale_calc");e.exports=function(t,e){var r=[{x:!1,y:!1,trace:e,t:{}}];return n(r,e),a(t,e),r}},{"../scatter/arrays_to_calcdata":1111,"../scatter/colorscale_calc":1115}],1140:[function(t,e,r){var n=t("../../registry");function a(t,e,r,a){if(!e||!e.visible)return null;for(var i=n.getComponentMethod("errorbars","makeComputeError")(e),o=new Array(t.length),s=0;s<t.length;s++){var l=i(+t[s],s);if("log"===a.type){var u=a.c2l(t[s]),c=t[s]-l[0],h=t[s]+l[1];if(o[s]=[(a.c2l(c,!0)-u)*r,(a.c2l(h,!0)-u)*r],c>0){var d=a.c2l(c);a._lowerLogErrorBound||(a._lowerLogErrorBound=d),a._lowerErrorBound=Math.min(a._lowerLogErrorBound,d)}}else o[s]=[-l[0]*r,l[1]*r]}return o}e.exports=function(t,e,r){var n=[a(t.x,t.error_x,e[0],r.xaxis),a(t.y,t.error_y,e[1],r.yaxis),a(t.z,t.error_z,e[2],r.zaxis)],i=function(t){for(var e=0;e<t.length;e++)if(t[e])return t[e].length;return 0}(n);if(0===i)return null;for(var o=new Array(i),s=0;s<i;s++){for(var l=[[0,0,0],[0,0,0]],u=0;u<3;u++)if(n[u])for(var c=0;c<2;c++)l[c][u]=n[u][s][c];o[s]=l}return o}},{"../../registry":847}],1141:[function(t,e,r){var n=t("gl-line3d"),a=t("gl-scatter3d"),i=t("gl-error3d"),o=t("gl-mesh3d"),s=t("delaunay-triangulate"),l=t("../../lib"),u=t("../../lib/str2rgbarray"),c=t("../../lib/gl_format_color").formatColor,h=t("../scatter/make_bubble_size_func"),d=t("../../constants/gl3d_dashes"),f=t("../../constants/gl3d_markers"),p=t("./calc_errors");function m(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}var g=m.prototype;function y(t){return null==t?0:t.indexOf("left")>-1?-1:t.indexOf("right")>-1?1:0}function v(t){return null==t?0:t.indexOf("top")>-1?-1:t.indexOf("bottom")>-1?1:0}function _(t,e){return e(4*t)}function x(t){return f[t]}function b(t,e,r,n,a){var i=null;if(l.isArrayOrTypedArray(t)){i=[];for(var o=0;o<e;o++)void 0===t[o]?i[o]=n:i[o]=r(t[o],a)}else i=r(t,l.identity);return i}function w(t,e){var r,n,a,i,o,s,d=[],f=t.fullSceneLayout,m=t.dataScale,g=f.xaxis,w=f.yaxis,M=f.zaxis,k=e.marker,T=e.line,L=e.x||[],A=e.y||[],S=e.z||[],E=L.length,C=e.xcalendar,D=e.ycalendar,P=e.zcalendar;for(o=0;o<E;o++)r=g.d2l(L[o],0,C)*m[0],n=w.d2l(A[o],0,D)*m[1],a=M.d2l(S[o],0,P)*m[2],d[o]=[r,n,a];if(Array.isArray(e.text))s=e.text;else if(void 0!==e.text)for(s=new Array(E),o=0;o<E;o++)s[o]=e.text;if(i={position:d,mode:e.mode,text:s},"line"in e&&(i.lineColor=c(T,1,E),i.lineWidth=T.width,i.lineDashes=T.dash),"marker"in e){var O=h(e);i.scatterColor=c(k,1,E),i.scatterSize=b(k.size,E,_,20,O),i.scatterMarker=b(k.symbol,E,x,"●"),i.scatterLineWidth=k.line.width,i.scatterLineColor=c(k.line,1,E),i.scatterAngle=0}"textposition"in e&&(i.textOffset=function(t){var e=[0,0];if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=[0,0],t[r]&&(e[r][0]=y(t[r]),e[r][1]=v(t[r]));else e[0]=y(t),e[1]=v(t);return e}(e.textposition),i.textColor=c(e.textfont,1,E),i.textSize=b(e.textfont.size,E,l.identity,12),i.textFont=e.textfont.family,i.textAngle=0);var z=["x","y","z"];for(i.project=[!1,!1,!1],i.projectScale=[1,1,1],i.projectOpacity=[1,1,1],o=0;o<3;++o){var I=e.projection[z[o]];(i.project[o]=I.show)&&(i.projectOpacity[o]=I.opacity,i.projectScale[o]=I.scale)}i.errorBounds=p(e,m,f);var R=function(t){for(var e=[0,0,0],r=[[0,0,0],[0,0,0],[0,0,0]],n=[1,1,1],a=0;a<3;a++){var i=t[a];i&&!1!==i.copy_zstyle&&!1!==t[2].visible&&(i=t[2]),i&&i.visible&&(e[a]=i.width/2,r[a]=u(i.color),n[a]=i.thickness)}return{capSize:e,color:r,lineWidth:n}}([e.error_x,e.error_y,e.error_z]);return i.errorColor=R.color,i.errorLineWidth=R.lineWidth,i.errorCapSize=R.capSize,i.delaunayAxis=e.surfaceaxis,i.delaunayColor=u(e.surfacecolor),i}function M(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}g.handlePick=function(t){if(t.object&&(t.object===this.linePlot||t.object===this.delaunayMesh||t.object===this.textMarkers||t.object===this.scatterPlot)){var e=t.index=t.data.index;return t.object.highlight&&t.object.highlight(null),this.scatterPlot&&(t.object=this.scatterPlot,this.scatterPlot.highlight(t.data)),t.textLabel="",this.textLabels&&(Array.isArray(this.textLabels)?(this.textLabels[e]||0===this.textLabels[e])&&(t.textLabel=this.textLabels[e]):t.textLabel=this.textLabels),t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]],!0}},g.update=function(t){var e,r,l,u,c=this.scene.glplot.gl,h=d.solid;this.data=t;var f=w(this.scene,t);"mode"in f&&(this.mode=f.mode),"lineDashes"in f&&f.lineDashes in d&&(h=d[f.lineDashes]),this.color=M(f.scatterColor)||M(f.lineColor),this.dataPoints=f.position,e={gl:this.scene.glplot.gl,position:f.position,color:f.lineColor,lineWidth:f.lineWidth||1,dashes:h[0],dashScale:h[1],opacity:t.opacity,connectGaps:t.connectgaps},-1!==this.mode.indexOf("lines")?this.linePlot?this.linePlot.update(e):(this.linePlot=n(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 p=t.opacity;if(t.marker&&t.marker.opacity&&(p*=t.marker.opacity),r={gl:this.scene.glplot.gl,position:f.position,color:f.scatterColor,size:f.scatterSize,glyph:f.scatterMarker,opacity:p,orthographic:!0,lineWidth:f.scatterLineWidth,lineColor:f.scatterLineColor,project:f.project,projectScale:f.projectScale,projectOpacity:f.projectOpacity},-1!==this.mode.indexOf("markers")?this.scatterPlot?this.scatterPlot.update(r):(this.scatterPlot=a(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),u={gl:this.scene.glplot.gl,position:f.position,glyph:f.text,color:f.textColor,size:f.textSize,angle:f.textAngle,alignment:f.textOffset,font:f.textFont,orthographic:!0,lineWidth:0,project:!1,opacity:t.opacity},this.textLabels=t.hovertext||t.text,-1!==this.mode.indexOf("text")?this.textMarkers?this.textMarkers.update(u):(this.textMarkers=a(u),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),l={gl:this.scene.glplot.gl,position:f.position,color:f.errorColor,error:f.errorBounds,lineWidth:f.errorLineWidth,capSize:f.errorCapSize,opacity:t.opacity},this.errorBars?f.errorBounds?this.errorBars.update(l):(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose(),this.errorBars=null):f.errorBounds&&(this.errorBars=i(l),this.errorBars._trace=this,this.scene.glplot.add(this.errorBars)),f.delaunayAxis>=0){var m=function(t,e,r){var n,a=(r+1)%3,i=(r+2)%3,o=[],l=[];for(n=0;n<t.length;++n){var u=t[n];!isNaN(u[a])&&isFinite(u[a])&&!isNaN(u[i])&&isFinite(u[i])&&(o.push([u[a],u[i]]),l.push(n))}var c=s(o);for(n=0;n<c.length;++n)for(var h=c[n],d=0;d<h.length;++d)h[d]=l[h[d]];return{positions:t,cells:c,meshColor:e}}(f.position,f.delaunayColor,f.delaunayAxis);m.opacity=t.opacity,this.delaunayMesh?this.delaunayMesh.update(m):(m.gl=c,this.delaunayMesh=o(m),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)},g.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=function(t,e){var r=new m(t,e.uid);return r.update(e),r}},{"../../constants/gl3d_dashes":692,"../../constants/gl3d_markers":693,"../../lib":719,"../../lib/gl_format_color":716,"../../lib/str2rgbarray":742,"../scatter/make_bubble_size_func":1128,"./calc_errors":1140,"delaunay-triangulate":165,"gl-error3d":247,"gl-line3d":255,"gl-mesh3d":280,"gl-scatter3d":297}],1142:[function(t,e,r){var n=t("../../registry"),a=t("../../lib"),i=t("../scatter/subtypes"),o=t("../scatter/marker_defaults"),s=t("../scatter/line_defaults"),l=t("../scatter/text_defaults"),u=t("./attributes");e.exports=function(t,e,r,c){function h(r,n){return a.coerce(t,e,u,r,n)}if(function(t,e,r,a){var i=0,o=r("x"),s=r("y"),l=r("z");return n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],a),o&&s&&l&&(i=Math.min(o.length,s.length,l.length),e._length=e._xlength=e._ylength=e._zlength=i),i}(t,e,h,c)){h("text"),h("hovertext"),h("hovertemplate"),h("mode"),i.hasLines(e)&&(h("connectgaps"),s(t,e,r,c,h)),i.hasMarkers(e)&&o(t,e,r,c,h,{noSelect:!0}),i.hasText(e)&&l(t,e,c,h,{noSelect:!0});var d=(e.line||{}).color,f=(e.marker||{}).color;h("surfaceaxis")>=0&&h("surfacecolor",d||f);for(var p=["x","y","z"],m=0;m<3;++m){var g="projection."+p[m];h(g+".show")&&(h(g+".opacity"),h(g+".scale"))}var y=n.getComponentMethod("errorbars","supplyDefaults");y(t,e,d||f||r,{axis:"z"}),y(t,e,d||f||r,{axis:"y",inherit:"z"}),y(t,e,d||f||r,{axis:"x",inherit:"z"})}else e.visible=!1}},{"../../lib":719,"../../registry":847,"../scatter/line_defaults":1124,"../scatter/marker_defaults":1130,"../scatter/subtypes":1135,"../scatter/text_defaults":1136,"./attributes":1138}],1143:[function(t,e,r){e.exports={plot:t("./convert"),attributes:t("./attributes"),markerSymbols:t("../../constants/gl3d_markers"),supplyDefaults:t("./defaults"),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:t("./calc"),moduleType:"trace",name:"scatter3d",basePlotModule:t("../../plots/gl3d"),categories:["gl3d","symbols","showLegend"],meta:{}}},{"../../constants/gl3d_markers":693,"../../plots/gl3d":807,"./attributes":1138,"./calc":1139,"./convert":1141,"./defaults":1142}],1144:[function(t,e,r){var n=t("../scatter/attributes"),a=t("../../plots/attributes"),i=t("../../components/fx/hovertemplate_attributes"),o=t("../../components/colorscale/attributes"),s=t("../../lib/extend").extendFlat,l=n.marker,u=n.line,c=l.line;e.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:s({},n.mode,{dflt:"markers"}),text:s({},n.text,{}),hovertext:s({},n.hovertext,{}),line:{color:u.color,width:u.width,dash:u.dash,shape:s({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing,editType:"calc"},connectgaps:n.connectgaps,fill:s({},n.fill,{values:["none","toself","tonext"],dflt:"none"}),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,editType:"calc"},o("marker.line")),gradient:l.gradient,editType:"calc"},o("marker")),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:s({},a.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron,hovertemplate:i()}},{"../../components/colorscale/attributes":600,"../../components/fx/hovertemplate_attributes":631,"../../lib/extend":710,"../../plots/attributes":764,"../scatter/attributes":1112}],1145:[function(t,e,r){var n=t("fast-isnumeric"),a=t("../scatter/colorscale_calc"),i=t("../scatter/arrays_to_calcdata"),o=t("../scatter/calc_selection"),s=t("../scatter/calc").calcMarkerSize,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,d=e._length,f=new Array(d),p=!1;for(u=0;u<d;u++)if(c=e.a[u],h=e.b[u],n(c)&&n(h)){var m=r.ab2xy(+c,+h,!0),g=r.isVisible(+c,+h);g||(p=!0),f[u]={x:m[0],y:m[1],a:c,b:h,vis:g}}else f[u]={x:!1,y:!1};return e._needsCull=p,f[0].carpet=r,f[0].trace=e,s(e,d),a(t,e),i(f,e),o(f,e),f}}},{"../carpet/lookup_carpetid":915,"../scatter/arrays_to_calcdata":1111,"../scatter/calc":1113,"../scatter/calc_selection":1114,"../scatter/colorscale_calc":1115,"fast-isnumeric":225}],1146:[function(t,e,r){var n=t("../../lib"),a=t("../scatter/constants"),i=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,d){function f(r,a){return n.coerce(t,e,h,r,a)}f("carpet"),e.xaxis="x",e.yaxis="y";var p=f("a"),m=f("b"),g=Math.min(p.length,m.length);if(g){e._length=g,f("text"),f("hovertext"),f("mode",g<a.PTS_LINESONLY?"lines+markers":"lines"),i.hasLines(e)&&(s(t,e,r,d,f),l(t,e,f),f("connectgaps")),i.hasMarkers(e)&&o(t,e,r,d,f,{gradient:!0}),i.hasText(e)&&u(t,e,d,f);var y=[];(i.hasMarkers(e)||i.hasText(e))&&(f("marker.maxdisplayed"),y.push("points")),f("fill"),"none"!==e.fill&&(c(t,e,r,f),i.hasLines(e)||l(t,e,f)),"tonext"!==e.fill&&"toself"!==e.fill||y.push("fills"),"fills"!==f("hoveron",y.join("+")||"points")&&f("hovertemplate"),n.coerceSelectionMarkerOpacity(e,f)}else e.visible=!1}},{"../../lib":719,"../scatter/constants":1116,"../scatter/fillcolor_defaults":1120,"../scatter/line_defaults":1124,"../scatter/line_shape_defaults":1126,"../scatter/marker_defaults":1130,"../scatter/subtypes":1135,"../scatter/text_defaults":1136,"./attributes":1144}],1147:[function(t,e,r){e.exports=function(t,e,r,n,a){var i=n[a];return t.a=i.a,t.b=i.b,t.y=i.y,t}},{}],1148:[function(t,e,r){var n=t("../scatter/hover"),a=t("../../lib").fillText;e.exports=function(t,e,r,i){var o=n(t,e,r,i);if(o&&!1!==o[0].index){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 d=s.cd[s.index];s.a=d.a,s.b=d.b,s.xLabelVal=void 0,s.yLabelVal=void 0;var f=s.trace,p=f._carpet,m=p.ab2ij([d.a,d.b]),g=Math.floor(m[0]),y=m[0]-g,v=Math.floor(m[1]),_=m[1]-v,x=p.evalxy([],g,v,y,_);s.yLabel=x[1].toFixed(3),delete s.text;var b=[];if(!f.hovertemplate){var w=(d.hi||f.hoverinfo).split("+");-1!==w.indexOf("all")&&(w=["a","b","text"]),-1!==w.indexOf("a")&&M(p.aaxis,d.a),-1!==w.indexOf("b")&&M(p.baxis,d.b),b.push("y: "+s.yLabel),-1!==w.indexOf("text")&&a(d,f,b),s.extraText=b.join("<br>")}return o}function M(t,e){var r;r=t.labelprefix&&t.labelprefix.length>0?t.labelprefix.replace(/ = $/,""):t._hovertitle,b.push(r+": "+e.toFixed(3)+t.labelsuffix)}}},{"../../lib":719,"../scatter/hover":1122}],1149:[function(t,e,r){e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),calc:t("./calc"),plot:t("./plot"),style:t("../scatter/style").style,styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../scatter/select"),eventData:t("./event_data"),moduleType:"trace",name:"scattercarpet",basePlotModule:t("../../plots/cartesian"),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}},{"../../plots/cartesian":778,"../scatter/marker_colorbar":1129,"../scatter/select":1132,"../scatter/style":1134,"./attributes":1144,"./calc":1145,"./defaults":1146,"./event_data":1147,"./hover":1148,"./plot":1150}],1150:[function(t,e,r){var n=t("../scatter/plot"),a=t("../../plots/cartesian/axes"),i=t("../../components/drawing");e.exports=function(t,e,r,o){var s,l,u,c=r[0][0].carpet,h={xaxis:a.getFromId(t,c.xaxis||"x"),yaxis:a.getFromId(t,c.yaxis||"y"),plot:e.plot};for(n(t,h,r,o),s=0;s<r.length;s++)l=r[s][0].trace,u=o.selectAll("g.trace"+l.uid+" .js-line"),i.setClipUrl(u,r[s][0].carpet._clipPathId,t)}},{"../../components/drawing":614,"../../plots/cartesian/axes":767,"../scatter/plot":1131}],1151:[function(t,e,r){var n=t("../../components/fx/hovertemplate_attributes"),a=t("../scatter/attributes"),i=t("../../plots/attributes"),o=t("../../components/colorscale/attributes"),s=t("../../components/drawing/attributes").dash,l=t("../../lib/extend").extendFlat,u=t("../../plot_api/edit_types").overrideAll,c=a.marker,h=a.line,d=c.line;e.exports=u({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:l({},a.mode,{dflt:"markers"}),text:l({},a.text,{}),hovertext:l({},a.hovertext,{}),textfont:a.textfont,textposition:a.textposition,line:{color:h.color,width:h.width,dash:s},connectgaps:a.connectgaps,marker:l({symbol:c.symbol,opacity:c.opacity,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,colorbar:c.colorbar,line:l({width:d.width},o("marker.line")),gradient:c.gradient},o("marker")),fill:{valType:"enumerated",values:["none","toself"],dflt:"none"},fillcolor:a.fillcolor,selected:a.selected,unselected:a.unselected,hoverinfo:l({},i.hoverinfo,{flags:["lon","lat","location","text","name"]}),hovertemplate:n()},"calc","nested")},{"../../components/colorscale/attributes":600,"../../components/drawing/attributes":613,"../../components/fx/hovertemplate_attributes":631,"../../lib/extend":710,"../../plot_api/edit_types":750,"../../plots/attributes":764,"../scatter/attributes":1112}],1152:[function(t,e,r){var n=t("fast-isnumeric"),a=t("../../constants/numerical").BADNUM,i=t("../scatter/colorscale_calc"),o=t("../scatter/arrays_to_calcdata"),s=t("../scatter/calc_selection"),l=t("../../lib")._;e.exports=function(t,e){for(var r=Array.isArray(e.locations),u=r?e.locations.length:e._length,c=new Array(u),h=0;h<u;h++){var d=c[h]={};if(r){var f=e.locations[h];d.loc="string"==typeof f?f:null}else{var p=e.lon[h],m=e.lat[h];n(p)&&n(m)?d.lonlat=[+p,+m]:d.lonlat=[a,a]}}return o(c,e),i(t,e),s(c,e),u&&(c[0].t={labels:{lat:l(t,"lat:")+" ",lon:l(t,"lon:")+" "}}),c}},{"../../constants/numerical":695,"../../lib":719,"../scatter/arrays_to_calcdata":1111,"../scatter/calc_selection":1114,"../scatter/colorscale_calc":1115,"fast-isnumeric":225}],1153:[function(t,e,r){var n=t("../../lib"),a=t("../scatter/subtypes"),i=t("../scatter/marker_defaults"),o=t("../scatter/line_defaults"),s=t("../scatter/text_defaults"),l=t("../scatter/fillcolor_defaults"),u=t("./attributes");e.exports=function(t,e,r,c){function h(r,a){return n.coerce(t,e,u,r,a)}!function(t,e,r){var n,a,i=0,o=r("locations");return o?(r("locationmode"),o.length):(n=r("lon")||[],a=r("lat")||[],i=Math.min(n.length,a.length),e._length=i,i)}(0,e,h)?e.visible=!1:(h("text"),h("hovertext"),h("hovertemplate"),h("mode"),a.hasLines(e)&&(o(t,e,r,c,h),h("connectgaps")),a.hasMarkers(e)&&i(t,e,r,c,h,{gradient:!0}),a.hasText(e)&&s(t,e,c,h),h("fill"),"none"!==e.fill&&l(t,e,r,h),n.coerceSelectionMarkerOpacity(e,h))}},{"../../lib":719,"../scatter/fillcolor_defaults":1120,"../scatter/line_defaults":1124,"../scatter/marker_defaults":1130,"../scatter/subtypes":1135,"../scatter/text_defaults":1136,"./attributes":1151}],1154:[function(t,e,r){e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t.location=e.loc?e.loc:null,t}},{}],1155:[function(t,e,r){var n=t("../../components/fx"),a=t("../../plots/cartesian/axes"),i=t("../../constants/numerical").BADNUM,o=t("../scatter/get_trace_color"),s=t("../../lib").fillText,l=t("./attributes");e.exports=function(t,e,r){var u=t.cd,c=u[0].trace,h=t.xa,d=t.ya,f=t.subplot,p=f.projection.isLonLatOverEdges,m=f.project;if(n.getClosest(u,(function(t){var n=t.lonlat;if(n[0]===i)return 1/0;if(p(n))return 1/0;var a=m(n),o=m([e,r]),s=Math.abs(a[0]-o[0]),l=Math.abs(a[1]-o[1]),u=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(s*s+l*l)-u,1-3/u)}),t),!1!==t.index){var g=u[t.index],y=g.lonlat,v=[h.c2p(y),d.c2p(y)],_=g.mrc||1;t.x0=v[0]-_,t.x1=v[0]+_,t.y0=v[1]-_,t.y1=v[1]+_,t.loc=g.loc,t.lon=y[0],t.lat=y[1];var x=f.mockAxis;return t.lonLabel=a.tickText(x,x.c2l(t.lon),"hover").text,t.latLabel=a.tickText(x,x.c2l(t.lat),"hover").text,t.color=o(c,g),t.extraText=function(t,e,r,n){if(!t.hovertemplate){var a=e.hi||t.hoverinfo,i="all"===a?l.hoverinfo.flags:a.split("+"),o=-1!==i.indexOf("location")&&Array.isArray(t.locations),u=-1!==i.indexOf("lon"),c=-1!==i.indexOf("lat"),h=-1!==i.indexOf("text"),d=[];return o?d.push(e.loc):u&&c?d.push("("+f(r.lonLabel)+", "+f(r.latLabel)+")"):u?d.push(n.lon+f(r.lonLabel)):c&&d.push(n.lat+f(r.latLabel)),h&&s(e,t,d),d.join("<br>")}function f(t){return t+"°"}}(c,g,t,u[0].t.labels),t.hovertemplate=c.hovertemplate,[t]}}},{"../../components/fx":632,"../../constants/numerical":695,"../../lib":719,"../../plots/cartesian/axes":767,"../scatter/get_trace_color":1121,"./attributes":1151}],1156:[function(t,e,r){e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),calc:t("./calc"),plot:t("./plot"),style:t("./style"),styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("./select"),moduleType:"trace",name:"scattergeo",basePlotModule:t("../../plots/geo"),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/geo":797,"../scatter/marker_colorbar":1129,"../scatter/style":1134,"./attributes":1151,"./calc":1152,"./defaults":1153,"./event_data":1154,"./hover":1155,"./plot":1157,"./select":1158,"./style":1159}],1157:[function(t,e,r){var n=t("d3"),a=t("../../lib"),i=t("../../constants/numerical").BADNUM,o=t("../../lib/topojson_utils").getTopojsonFeatures,s=t("../../lib/geo_location_utils").locationToFeature,l=t("../../lib/geojson_utils"),u=t("../scatter/subtypes"),c=t("./style");function h(t,e){var r=t[0].trace;if(Array.isArray(r.locations))for(var n=o(r,e),a=r.locationmode,l=0;l<t.length;l++){var u=t[l],c=s(a,u.loc,n);u.lonlat=c?c.properties.ct:[i,i]}}e.exports=function(t,e,r){for(var o=0;o<r.length;o++)h(r[o],e.topojson);function s(t,e){t.lonlat[0]===i&&n.select(e).remove()}var d=e.layers.frontplot.select(".scatterlayer"),f=a.makeTraceGroups(d,r,"trace scattergeo");f.selectAll("*").remove(),f.each((function(e){var r=n.select(this),i=e[0].trace;if(u.hasLines(i)||"none"!==i.fill){var o=l.calcTraceToLineCoords(e),h="none"!==i.fill?l.makePolygon(o):l.makeLine(o);r.selectAll("path.js-line").data([{geojson:h,trace:i}]).enter().append("path").classed("js-line",!0).style("stroke-miterlimit",2)}u.hasMarkers(i)&&r.selectAll("path.point").data(a.identity).enter().append("path").classed("point",!0).each((function(t){s(t,this)})),u.hasText(i)&&r.selectAll("g").data(a.identity).enter().append("g").append("text").each((function(t){s(t,this)})),c(t,e)}))}},{"../../constants/numerical":695,"../../lib":719,"../../lib/geo_location_utils":713,"../../lib/geojson_utils":714,"../../lib/topojson_utils":746,"../scatter/subtypes":1135,"./style":1159,d3:163}],1158:[function(t,e,r){var n=t("../scatter/subtypes"),a=t("../../constants/numerical").BADNUM;e.exports=function(t,e){var r,i,o,s,l,u=t.cd,c=t.xaxis,h=t.yaxis,d=[],f=u[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===e)for(l=0;l<u.length;l++)u[l].selected=0;else for(l=0;l<u.length;l++)(i=(r=u[l]).lonlat)[0]!==a&&(o=c.c2p(i),s=h.c2p(i),e.contains([o,s],null,l,t)?(d.push({pointNumber:l,lon:i[0],lat:i[1]}),r.selected=1):r.selected=0);return d}},{"../../constants/numerical":695,"../scatter/subtypes":1135}],1159:[function(t,e,r){var n=t("d3"),a=t("../../components/drawing"),i=t("../../components/color"),o=t("../scatter/style"),s=o.stylePoints,l=o.styleText;e.exports=function(t,e){e&&function(t,e){var r=e[0].trace,o=e[0].node3;o.style("opacity",e[0].trace.opacity),s(o,r,t),l(o,r,t),o.selectAll("path.js-line").style("fill","none").each((function(t){var e=n.select(this),r=t.trace,o=r.line||{};e.call(i.stroke,o.color).call(a.dashLine,o.dash||"",o.width||0),"none"!==r.fill&&e.call(i.fill,r.fillcolor)}))}(t,e)}},{"../../components/color":593,"../../components/drawing":614,"../scatter/style":1134,d3:163}],1160:[function(t,e,r){var n=t("../../plots/attributes"),a=t("../scatter/attributes"),i=t("../../components/colorscale/attributes"),o=t("../../lib/extend").extendFlat,s=t("../../plot_api/edit_types").overrideAll,l=t("./constants").DASHES,u=a.line,c=a.marker,h=c.line,d=e.exports=s({x:a.x,x0:a.x0,dx:a.dx,y:a.y,y0:a.y0,dy:a.dy,text:a.text,hovertext:a.hovertext,textposition:a.textposition,textfont:a.textfont,mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"]},line:{color:u.color,width:u.width,shape:{valType:"enumerated",values:["linear","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},dash:{valType:"enumerated",values:Object.keys(l),dflt:"solid"}},marker:o({},i("marker"),{symbol:c.symbol,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,opacity:c.opacity,colorbar:c.colorbar,line:o({},i("marker.line"),{width:h.width})}),connectgaps:a.connectgaps,fill:o({},a.fill,{dflt:"none"}),fillcolor:a.fillcolor,selected:{marker:a.selected.marker,textfont:a.selected.textfont},unselected:{marker:a.unselected.marker,textfont:a.unselected.textfont},opacity:n.opacity},"calc","nested");d.x.editType=d.y.editType=d.x0.editType=d.y0.editType="calc+clearAxisTypes",d.hovertemplate=a.hovertemplate},{"../../components/colorscale/attributes":600,"../../lib/extend":710,"../../plot_api/edit_types":750,"../../plots/attributes":764,"../scatter/attributes":1112,"./constants":1162}],1161:[function(t,e,r){var n=t("point-cluster"),a=t("../../lib"),i=t("../../plots/cartesian/axis_ids"),o=t("../../plots/cartesian/autorange").findExtremes,s=t("../scatter/calc"),l=s.calcMarkerSize,u=s.calcAxisExpansion,c=s.setFirstScatter,h=t("../scatter/colorscale_calc"),d=t("./convert"),f=t("./scene_update"),p=t("../../constants/numerical").BADNUM,m=t("./constants").TOO_MANY_POINTS;function g(t,e,r){var n=t._extremes[e._id],a=o(e,r._bnds,{padded:!0});n.min=n.min.concat(a.min),n.max=n.max.concat(a.max)}e.exports=function(t,e){var r,o,s,y=t._fullLayout,v=i.getFromId(t,e.xaxis),_=i.getFromId(t,e.yaxis),x=y._plots[e.xaxis+e.yaxis],b=e._length,w=b>=m,M=2*b,k={},T=v.makeCalcdata(e,"x"),L=_.makeCalcdata(e,"y"),A=new Array(M);for(r=0;r<b;r++)o=T[r],s=L[r],A[2*r]=o===p?NaN:o,A[2*r+1]=s===p?NaN:s;if("log"===v.type)for(r=0;r<M;r+=2)A[r]=v.c2l(A[r]);if("log"===_.type)for(r=1;r<M;r+=2)A[r]=_.c2l(A[r]);if(w&&"log"!==v.type&&"log"!==_.type)k.tree=n(A);else{var S=k.ids=new Array(b);for(r=0;r<b;r++)S[r]=r}h(t,e);var E,C=function(t,e,r,n,i,o){var s=d.style(t,r);if(s.marker&&(s.marker.positions=n),s.line&&n.length>1&&a.extendFlat(s.line,d.linePositions(t,r,n)),s.errorX||s.errorY){var l=d.errorBarPositions(t,r,n,i,o);s.errorX&&a.extendFlat(s.errorX,l.x),s.errorY&&a.extendFlat(s.errorY,l.y)}return s.text&&(a.extendFlat(s.text,{positions:n},d.textPosition(t,r,s.text,s.marker)),a.extendFlat(s.textSel,{positions:n},d.textPosition(t,r,s.text,s.markerSel)),a.extendFlat(s.textUnsel,{positions:n},d.textPosition(t,r,s.text,s.markerUnsel))),s}(t,0,e,A,T,L),D=f(t,x);return c(y,e),w?C.marker&&(E=2*(C.marker.sizeAvg||Math.max(C.marker.size,3))):E=l(e,b),u(t,e,v,_,T,L,E),C.errorX&&g(e,v,C.errorX),C.errorY&&g(e,_,C.errorY),C.fill&&!D.fill2d&&(D.fill2d=!0),C.marker&&!D.scatter2d&&(D.scatter2d=!0),C.line&&!D.line2d&&(D.line2d=!0),!C.errorX&&!C.errorY||D.error2d||(D.error2d=!0),C.text&&!D.glText&&(D.glText=!0),C.marker&&(C.marker.snap=k.tree||m),D.lineOptions.push(C.line),D.errorXOptions.push(C.errorX),D.errorYOptions.push(C.errorY),D.fillOptions.push(C.fill),D.markerOptions.push(C.marker),D.markerSelectedOptions.push(C.markerSel),D.markerUnselectedOptions.push(C.markerUnsel),D.textOptions.push(C.text),D.textSelectedOptions.push(C.textSel),D.textUnselectedOptions.push(C.textUnsel),D.selectBatch.push([]),D.unselectBatch.push([]),k._scene=D,k.index=D.count,k.x=T,k.y=L,k.positions=A,D.count++,[{x:!1,y:!1,t:k,trace:e}]}},{"../../constants/numerical":695,"../../lib":719,"../../plots/cartesian/autorange":766,"../../plots/cartesian/axis_ids":770,"../scatter/calc":1113,"../scatter/colorscale_calc":1115,"./constants":1162,"./convert":1163,"./scene_update":1169,"point-cluster":469}],1162:[function(t,e,r){e.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:20,SYMBOL_STROKE:1,DOT_RE:/-dot/,OPEN_RE:/-open/,DASHES:{solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}}},{}],1163:[function(t,e,r){var n=t("fast-isnumeric"),a=t("svg-path-sdf"),i=t("color-normalize"),o=t("../../registry"),s=t("../../lib"),l=t("../../components/drawing"),u=t("../../plots/cartesian/axis_ids"),c=t("../../lib/gl_format_color").formatColor,h=t("../scatter/subtypes"),d=t("../scatter/make_bubble_size_func"),f=t("./constants"),p=t("../../constants/interactions").DESELECTDIM,m={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1};function g(t){var e,r=t._length,a=t.textfont,i=t.textposition,o=Array.isArray(i)?i:[i],s=a.color,l=a.size,u=a.family,c={};for(c.text=t.text,c.opacity=t.opacity,c.font={},c.align=[],c.baseline=[],e=0;e<o.length;e++){var h=o[e].split(/\s+/);switch(h[1]){case"left":c.align.push("right");break;case"right":c.align.push("left");break;default:c.align.push(h[1])}switch(h[0]){case"top":c.baseline.push("bottom");break;case"bottom":c.baseline.push("top");break;default:c.baseline.push(h[0])}}if(Array.isArray(s))for(c.color=new Array(r),e=0;e<r;e++)c.color[e]=s[e];else c.color=s;if(Array.isArray(l)||Array.isArray(u))for(c.font=new Array(r),e=0;e<r;e++){var d=c.font[e]={};d.size=Array.isArray(l)?n(l[e])?l[e]:0:l,d.family=Array.isArray(u)?u[e]:u}else c.font={size:l,family:u};return c}function y(t){var e,r,n=t._length,a=t.marker,o={},l=Array.isArray(a.symbol),u=s.isArrayOrTypedArray(a.color),h=s.isArrayOrTypedArray(a.line.color),p=s.isArrayOrTypedArray(a.opacity),m=s.isArrayOrTypedArray(a.size),g=s.isArrayOrTypedArray(a.line.width);if(l||(r=f.OPEN_RE.test(a.symbol)),l||u||h||p){o.colors=new Array(n),o.borderColors=new Array(n);var y=c(a,a.opacity,n),v=c(a.line,a.opacity,n);if(!Array.isArray(v[0])){var _=v;for(v=Array(n),e=0;e<n;e++)v[e]=_}if(!Array.isArray(y[0])){var x=y;for(y=Array(n),e=0;e<n;e++)y[e]=x}for(o.colors=y,o.borderColors=v,e=0;e<n;e++){if(l){var b=a.symbol[e];r=f.OPEN_RE.test(b)}r&&(v[e]=y[e].slice(),y[e]=y[e].slice(),y[e][3]=0)}o.opacity=t.opacity}else r?(o.color=i(a.color,"uint8"),o.color[3]=0,o.borderColor=i(a.color,"uint8")):(o.color=i(a.color,"uint8"),o.borderColor=i(a.line.color,"uint8")),o.opacity=t.opacity*a.opacity;if(l)for(o.markers=new Array(n),e=0;e<n;e++)o.markers[e]=L(a.symbol[e]);else o.marker=L(a.symbol);var w,M=d(t);if(m||g){var k,T=o.sizes=new Array(n),A=o.borderSizes=new Array(n),S=0;if(m){for(e=0;e<n;e++)T[e]=M(a.size[e]),S+=T[e];k=S/n}else for(w=M(a.size),e=0;e<n;e++)T[e]=w;if(g)for(e=0;e<n;e++)A[e]=a.line.width[e]/2;else for(w=a.line.width/2,e=0;e<n;e++)A[e]=w;o.sizeAvg=k}else o.size=M(a&&a.size||10),o.borderSizes=M(a.line.width);return o}function v(t,e){var r=t.marker,n={};return e?(e.marker&&e.marker.symbol?n=y(s.extendFlat({},r,e.marker)):e.marker&&(e.marker.size&&(n.size=e.marker.size/2),e.marker.color&&(n.colors=e.marker.color),void 0!==e.marker.opacity&&(n.opacity=e.marker.opacity)),n):n}function _(t,e){var r={};if(!e)return r;if(e.textfont){var n={opacity:1,text:t.text,textposition:t.textposition,textfont:s.extendFlat({},t.textfont)};e.textfont&&s.extendFlat(n.textfont,e.textfont),r=g(n)}return r}function x(t,e){var r={capSize:2*e.width,lineWidth:e.thickness,color:e.color};return e.copy_ystyle&&(r=t.error_y),r}var b=f.SYMBOL_SDF_SIZE,w=f.SYMBOL_SIZE,M=f.SYMBOL_STROKE,k={},T=l.symbolFuncs[0](.05*w);function L(t){if("circle"===t)return null;var e,r,n=l.symbolNumber(t),i=l.symbolFuncs[n%100],o=!!l.symbolNoDot[n%100],s=!!l.symbolNoFill[n%100],u=f.DOT_RE.test(t);return k[t]?k[t]:(e=u&&!o?i(1.1*w)+T:i(w),r=a(e,{w:b,h:b,viewBox:[-w,-w,w,w],stroke:s?M:-M}),k[t]=r,r||null)}e.exports={style:function(t,e){var r,n={marker:void 0,markerSel:void 0,markerUnsel:void 0,line:void 0,fill:void 0,errorX:void 0,errorY:void 0,text:void 0,textSel:void 0,textUnsel:void 0};if(!0!==e.visible)return n;if(h.hasText(e)&&(n.text=g(e),n.textSel=_(e,e.selected),n.textUnsel=_(e,e.unselected)),h.hasMarkers(e)&&(n.marker=y(e),n.markerSel=v(e,e.selected),n.markerUnsel=v(e,e.unselected),!e.unselected&&Array.isArray(e.marker.opacity))){var a=e.marker.opacity;for(n.markerUnsel.opacity=new Array(a.length),r=0;r<a.length;r++)n.markerUnsel.opacity[r]=p*a[r]}if(h.hasLines(e)){n.line={overlay:!0,thickness:e.line.width,color:e.line.color,opacity:e.opacity};var i=(f.DASHES[e.line.dash]||[1]).slice();for(r=0;r<i.length;++r)i[r]*=e.line.width;n.line.dashes=i}return e.error_x&&e.error_x.visible&&(n.errorX=x(e,e.error_x)),e.error_y&&e.error_y.visible&&(n.errorY=x(e,e.error_y)),e.fill&&"none"!==e.fill&&(n.fill={closed:!0,fill:e.fillcolor,thickness:0}),n},markerStyle:y,markerSelection:v,linePositions:function(t,e,r){var n,a,i=r.length,o=i/2;if(h.hasLines(e)&&o)if("hv"===e.line.shape){for(n=[],a=0;a<o-1;a++)isNaN(r[2*a])||isNaN(r[2*a+1])?n.push(NaN,NaN,NaN,NaN):(n.push(r[2*a],r[2*a+1]),isNaN(r[2*a+2])||isNaN(r[2*a+3])?n.push(NaN,NaN):n.push(r[2*a+2],r[2*a+1]));n.push(r[i-2],r[i-1])}else if("hvh"===e.line.shape){for(n=[],a=0;a<o-1;a++)if(isNaN(r[2*a])||isNaN(r[2*a+1])||isNaN(r[2*a+2])||isNaN(r[2*a+3]))isNaN(r[2*a])||isNaN(r[2*a+1])?n.push(NaN,NaN):n.push(r[2*a],r[2*a+1]),n.push(NaN,NaN);else{var s=(r[2*a]+r[2*a+2])/2;n.push(r[2*a],r[2*a+1],s,r[2*a+1],s,r[2*a+3])}n.push(r[i-2],r[i-1])}else if("vhv"===e.line.shape){for(n=[],a=0;a<o-1;a++)if(isNaN(r[2*a])||isNaN(r[2*a+1])||isNaN(r[2*a+2])||isNaN(r[2*a+3]))isNaN(r[2*a])||isNaN(r[2*a+1])?n.push(NaN,NaN):n.push(r[2*a],r[2*a+1]),n.push(NaN,NaN);else{var l=(r[2*a+1]+r[2*a+3])/2;n.push(r[2*a],r[2*a+1],r[2*a],l,r[2*a+2],l)}n.push(r[i-2],r[i-1])}else if("vh"===e.line.shape){for(n=[],a=0;a<o-1;a++)isNaN(r[2*a])||isNaN(r[2*a+1])?n.push(NaN,NaN,NaN,NaN):(n.push(r[2*a],r[2*a+1]),isNaN(r[2*a+2])||isNaN(r[2*a+3])?n.push(NaN,NaN):n.push(r[2*a],r[2*a+3]));n.push(r[i-2],r[i-1])}else n=r;var u=!1;for(a=0;a<n.length;a++)if(isNaN(n[a])){u=!0;break}var c=u||n.length>f.TOO_MANY_POINTS||h.hasMarkers(e)?"rect":"round";if(u&&e.connectgaps){var d=n[0],p=n[1];for(a=0;a<n.length;a+=2)isNaN(n[a])||isNaN(n[a+1])?(n[a]=d,n[a+1]=p):(d=n[a],p=n[a+1])}return{join:c,positions:n}},errorBarPositions:function(t,e,r,a,i){var s=o.getComponentMethod("errorbars","makeComputeError"),l=u.getFromId(t,e.xaxis),c=u.getFromId(t,e.yaxis),h=r.length/2,d={};function f(t,a){var i=a._id.charAt(0),o=e["error_"+i];if(o&&o.visible&&("linear"===a.type||"log"===a.type)){for(var l=s(o),u={x:0,y:1}[i],c={x:[0,1,2,3],y:[2,3,0,1]}[i],f=new Float64Array(4*h),p=1/0,m=-1/0,g=0,y=0;g<h;g++,y+=4){var v=t[g];if(n(v)){var _=r[2*g+u],x=l(v,g),b=x[0],w=x[1];if(n(b)&&n(w)){var M=v-b,k=v+w;f[y+c[0]]=_-a.c2l(M),f[y+c[1]]=a.c2l(k)-_,f[y+c[2]]=0,f[y+c[3]]=0,p=Math.min(p,v-b),m=Math.max(m,v+w)}}}d[i]={positions:r,errors:f,_bnds:[p,m]}}}return f(a,l),f(i,c),d},textPosition:function(t,e,r,n){var a,i=e._length,o={};if(h.hasMarkers(e)){var s=r.font,l=r.align,u=r.baseline;for(o.offset=new Array(i),a=0;a<i;a++){var c=n.sizes?n.sizes[a]:n.size,d=Array.isArray(s)?s[a].size:s.size,f=Array.isArray(l)?l.length>1?l[a]:l[0]:l,p=Array.isArray(u)?u.length>1?u[a]:u[0]:u,g=m[f],y=m[p],v=c?c/.8+1:0,_=-y*v-.5*y;o.offset[a]=[g*v/d,_/d]}}return o}}},{"../../components/drawing":614,"../../constants/interactions":694,"../../lib":719,"../../lib/gl_format_color":716,"../../plots/cartesian/axis_ids":770,"../../registry":847,"../scatter/make_bubble_size_func":1128,"../scatter/subtypes":1135,"./constants":1162,"color-normalize":120,"fast-isnumeric":225,"svg-path-sdf":535}],1164:[function(t,e,r){var n=t("../../lib"),a=t("../../registry"),i=t("./attributes"),o=t("../scatter/constants"),s=t("../scatter/subtypes"),l=t("../scatter/xy_defaults"),u=t("../scatter/marker_defaults"),c=t("../scatter/line_defaults"),h=t("../scatter/fillcolor_defaults"),d=t("../scatter/text_defaults");e.exports=function(t,e,r,f){function p(r,a){return n.coerce(t,e,i,r,a)}var m=!!t.marker&&/-open/.test(t.marker.symbol),g=s.isBubble(t),y=l(t,e,f,p);if(y){var v=y<o.PTS_LINESONLY?"lines+markers":"lines";p("text"),p("hovertext"),p("hovertemplate"),p("mode",v),s.hasLines(e)&&(p("connectgaps"),c(t,e,r,f,p),p("line.shape")),s.hasMarkers(e)&&(u(t,e,r,f,p),p("marker.line.width",m||g?1:0)),s.hasText(e)&&d(t,e,f,p);var _=(e.line||{}).color,x=(e.marker||{}).color;p("fill"),"none"!==e.fill&&h(t,e,r,p);var b=a.getComponentMethod("errorbars","supplyDefaults");b(t,e,_||x||r,{axis:"y"}),b(t,e,_||x||r,{axis:"x",inherit:"y"}),n.coerceSelectionMarkerOpacity(e,p)}else e.visible=!1}},{"../../lib":719,"../../registry":847,"../scatter/constants":1116,"../scatter/fillcolor_defaults":1120,"../scatter/line_defaults":1124,"../scatter/marker_defaults":1130,"../scatter/subtypes":1135,"../scatter/text_defaults":1136,"../scatter/xy_defaults":1137,"./attributes":1160}],1165:[function(t,e,r){var n=t("../../lib"),a=t("../../components/color"),i=t("../../constants/interactions").DESELECTDIM;e.exports={styleTextSelection:function(t){var e,r,o=t[0],s=o.trace,l=o.t,u=l._scene,c=l.index,h=u.selectBatch[c],d=u.unselectBatch[c],f=u.textOptions[c],p=u.textSelectedOptions[c]||{},m=u.textUnselectedOptions[c]||{},g=n.extendFlat({},f);if(h.length||d.length){var y=p.color,v=m.color,_=f.color,x=Array.isArray(_);for(g.color=new Array(s._length),e=0;e<h.length;e++)r=h[e],g.color[r]=y||(x?_[r]:_);for(e=0;e<d.length;e++){r=d[e];var b=x?_[r]:_;g.color[r]=v||(y?b:a.addOpacity(b,i))}}u.glText[c].update(g)}}},{"../../components/color":593,"../../constants/interactions":694,"../../lib":719}],1166:[function(t,e,r){var n=t("../../registry"),a=t("../../lib"),i=t("../scatter/get_trace_color");function o(t,e,r,o){var s=t.xa,l=t.ya,u=t.distance,c=t.dxy,h=t.index,d={pointNumber:h,x:e[h],y:r[h]};d.tx=Array.isArray(o.text)?o.text[h]:o.text,d.htx=Array.isArray(o.hovertext)?o.hovertext[h]:o.hovertext,d.data=Array.isArray(o.customdata)?o.customdata[h]:o.customdata,d.tp=Array.isArray(o.textposition)?o.textposition[h]:o.textposition;var f=o.textfont;f&&(d.ts=Array.isArray(f.size)?f.size[h]:f.size,d.tc=Array.isArray(f.color)?f.color[h]:f.color,d.tf=Array.isArray(f.family)?f.family[h]:f.family);var p=o.marker;p&&(d.ms=a.isArrayOrTypedArray(p.size)?p.size[h]:p.size,d.mo=a.isArrayOrTypedArray(p.opacity)?p.opacity[h]:p.opacity,d.mx=Array.isArray(p.symbol)?p.symbol[h]:p.symbol,d.mc=a.isArrayOrTypedArray(p.color)?p.color[h]:p.color);var m=p&&p.line;m&&(d.mlc=Array.isArray(m.color)?m.color[h]:m.color,d.mlw=a.isArrayOrTypedArray(m.width)?m.width[h]:m.width);var g=p&&p.gradient;g&&"none"!==g.type&&(d.mgt=Array.isArray(g.type)?g.type[h]:g.type,d.mgc=Array.isArray(g.color)?g.color[h]:g.color);var y=s.c2p(d.x,!0),v=l.c2p(d.y,!0),_=d.mrc||1,x=o.hoverlabel;x&&(d.hbg=Array.isArray(x.bgcolor)?x.bgcolor[h]:x.bgcolor,d.hbc=Array.isArray(x.bordercolor)?x.bordercolor[h]:x.bordercolor,d.hts=Array.isArray(x.font.size)?x.font.size[h]:x.font.size,d.htc=Array.isArray(x.font.color)?x.font.color[h]:x.font.color,d.htf=Array.isArray(x.font.family)?x.font.family[h]:x.font.family,d.hnl=Array.isArray(x.namelength)?x.namelength[h]:x.namelength);var b=o.hoverinfo;b&&(d.hi=Array.isArray(b)?b[h]:b);var w=o.hovertemplate;w&&(d.ht=Array.isArray(w)?w[h]:w);var M={};return M[t.index]=d,a.extendFlat(t,{color:i(o,d),x0:y-_,x1:y+_,xLabelVal:d.x,y0:v-_,y1:v+_,yLabelVal:d.y,cd:M,distance:u,spikeDistance:c,hovertemplate:d.ht}),d.htx?t.text=d.htx:d.tx?t.text=d.tx:o.text&&(t.text=o.text),a.fillText(d,o,t),n.getComponentMethod("errorbars","hoverInfo")(d,o,t),t}e.exports={hoverPoints:function(t,e,r,n){var a,i,s,l,u,c,h,d,f,p=t.cd,m=p[0].t,g=p[0].trace,y=t.xa,v=t.ya,_=m.x,x=m.y,b=y.c2p(e),w=v.c2p(r),M=t.distance;if(m.tree){var k=y.p2c(b-M),T=y.p2c(b+M),L=v.p2c(w-M),A=v.p2c(w+M);a="x"===n?m.tree.range(Math.min(k,T),Math.min(v._rl[0],v._rl[1]),Math.max(k,T),Math.max(v._rl[0],v._rl[1])):m.tree.range(Math.min(k,T),Math.min(L,A),Math.max(k,T),Math.max(L,A))}else{if(!m.ids)return[t];a=m.ids}var S=M;if("x"===n)for(u=0;u<a.length;u++)s=_[a[u]],(c=Math.abs(y.c2p(s)-b))<S&&(S=c,h=v.c2p(x[a[u]])-w,f=Math.sqrt(c*c+h*h),i=a[u]);else for(u=a.length-1;u>-1;u--)s=_[a[u]],l=x[a[u]],c=y.c2p(s)-b,h=v.c2p(l)-w,(d=Math.sqrt(c*c+h*h))<S&&(S=f=d,i=a[u]);return t.index=i,t.distance=S,t.dxy=f,void 0===i||o(t,_,x,g),[t]},calcHover:o}},{"../../lib":719,"../../registry":847,"../scatter/get_trace_color":1121}],1167:[function(t,e,r){var n=t("./hover");e.exports={moduleType:"trace",name:"scattergl",basePlotModule:t("../../plots/cartesian"),categories:["gl","regl","cartesian","symbols","errorBarsOK","showLegend","scatter-like"],attributes:t("./attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("../scatter/cross_trace_defaults"),colorbar:t("../scatter/marker_colorbar"),calc:t("./calc"),plot:t("./plot"),hoverPoints:n.hoverPoints,selectPoints:t("./select"),meta:{}}},{"../../plots/cartesian":778,"../scatter/cross_trace_defaults":1118,"../scatter/marker_colorbar":1129,"./attributes":1160,"./calc":1161,"./defaults":1164,"./hover":1166,"./plot":1168,"./select":1170}],1168:[function(t,e,r){var n=t("regl-scatter2d"),a=t("regl-line2d"),i=t("regl-error2d"),o=t("gl-text"),s=t("../../lib"),l=t("../../lib/prepare_regl"),u=t("../scatter/subtypes"),c=t("../scatter/link_traces"),h=t("./edit_style").styleTextSelection;e.exports=function(t,e,r){if(r.length){var d,f,p=t._fullLayout,m=e._scene,g=e.xaxis,y=e.yaxis;if(m)if(l(t,["ANGLE_instanced_arrays","OES_element_index_uint"])){var v=m.count,_=p._glcanvas.data()[0].regl;if(c(t,e,r),m.dirty){if(!0===m.error2d&&(m.error2d=i(_)),!0===m.line2d&&(m.line2d=a(_)),!0===m.scatter2d&&(m.scatter2d=n(_)),!0===m.fill2d&&(m.fill2d=a(_)),!0===m.glText)for(m.glText=new Array(v),d=0;d<v;d++)m.glText[d]=new o(_);if(m.glText){if(v>m.glText.length){var x=v-m.glText.length;for(d=0;d<x;d++)m.glText.push(new o(_))}else if(v<m.glText.length){var b=m.glText.length-v;m.glText.splice(v,b).forEach((function(t){t.destroy()}))}for(d=0;d<v;d++)m.glText[d].update(m.textOptions[d])}if(m.line2d&&(m.line2d.update(m.lineOptions),m.lineOptions=m.lineOptions.map((function(t){if(t&&t.positions){for(var e=t.positions,r=0;r<e.length&&(isNaN(e[r])||isNaN(e[r+1]));)r+=2;for(var n=e.length-2;n>r&&(isNaN(e[n])||isNaN(e[n+1]));)n-=2;t.positions=e.slice(r,n+2)}return t})),m.line2d.update(m.lineOptions)),m.error2d){var w=(m.errorXOptions||[]).concat(m.errorYOptions||[]);m.error2d.update(w)}m.scatter2d&&m.scatter2d.update(m.markerOptions),m.fillOrder=s.repeat(null,v),m.fill2d&&(m.fillOptions=m.fillOptions.map((function(t,e){var n=r[e];if(t&&n&&n[0]&&n[0].trace){var a,i,o=n[0],s=o.trace,l=o.t,u=m.lineOptions[e],c=[];s._ownfill&&c.push(e),s._nexttrace&&c.push(e+1),c.length&&(m.fillOrder[e]=c);var h,d,f=[],p=u&&u.positions||l.positions;if("tozeroy"===s.fill){for(h=0;h<p.length&&isNaN(p[h+1]);)h+=2;for(d=p.length-2;d>h&&isNaN(p[d+1]);)d-=2;0!==p[h+1]&&(f=[p[h],0]),f=f.concat(p.slice(h,d+2)),0!==p[d+1]&&(f=f.concat([p[d],0]))}else if("tozerox"===s.fill){for(h=0;h<p.length&&isNaN(p[h]);)h+=2;for(d=p.length-2;d>h&&isNaN(p[d]);)d-=2;0!==p[h]&&(f=[0,p[h+1]]),f=f.concat(p.slice(h,d+2)),0!==p[d]&&(f=f.concat([0,p[d+1]]))}else if("toself"===s.fill||"tonext"===s.fill){for(f=[],a=0,i=0;i<p.length;i+=2)(isNaN(p[i])||isNaN(p[i+1]))&&((f=f.concat(p.slice(a,i))).push(p[a],p[a+1]),a=i+2);f=f.concat(p.slice(a)),a&&f.push(p[a],p[a+1])}else{var g=s._nexttrace;if(g){var y=m.lineOptions[e+1];if(y){var v=y.positions;if("tonexty"===s.fill){for(f=p.slice(),e=Math.floor(v.length/2);e--;){var _=v[2*e],x=v[2*e+1];isNaN(_)||isNaN(x)||f.push(_,x)}t.fill=g.fillcolor}}}}if(s._prevtrace&&"tonext"===s._prevtrace.fill){var b=m.lineOptions[e-1].positions,w=f.length/2,M=[a=w];for(i=0;i<b.length;i+=2)(isNaN(b[i])||isNaN(b[i+1]))&&(M.push(i/2+w+1),a=i+2);f=f.concat(b),t.hole=M}return t.fillmode=s.fill,t.opacity=s.opacity,t.positions=f,t}})),m.fill2d.update(m.fillOptions))}var M=p.dragmode,k="lasso"===M||"select"===M,T=p.clickmode.indexOf("select")>-1;for(d=0;d<v;d++){var L=r[d][0],A=L.trace,S=L.t,E=S.index,C=A._length,D=S.x,P=S.y;if(A.selectedpoints||k||T){if(k||(k=!0),A.selectedpoints){var O=m.selectBatch[E]=s.selIndices2selPoints(A),z={};for(f=0;f<O.length;f++)z[O[f]]=1;var I=[];for(f=0;f<C;f++)z[f]||I.push(f);m.unselectBatch[E]=I}var R=S.xpx=new Array(C),F=S.ypx=new Array(C);for(f=0;f<C;f++)R[f]=g.c2p(D[f]),F[f]=y.c2p(P[f])}else S.xpx=S.ypx=null}if(k){if(m.select2d||(m.select2d=n(p._glcanvas.data()[1].regl)),m.scatter2d){var N=new Array(v);for(d=0;d<v;d++)N[d]=m.selectBatch[d].length||m.unselectBatch[d].length?m.markerUnselectedOptions[d]:{};m.scatter2d.update(N)}m.select2d&&(m.select2d.update(m.markerOptions),m.select2d.update(m.markerSelectedOptions)),m.glText&&r.forEach((function(t){var e=((t||[])[0]||{}).trace||{};u.hasText(e)&&h(t)}))}else m.scatter2d&&m.scatter2d.update(m.markerOptions);var Y={viewport:function(t,e,r){var n=t._size,a=t.width,i=t.height;return[n.l+e.domain[0]*n.w,n.b+r.domain[0]*n.h,a-n.r-(1-e.domain[1])*n.w,i-n.t-(1-r.domain[1])*n.h]}(p,g,y),range:[(g._rl||g.range)[0],(y._rl||y.range)[0],(g._rl||g.range)[1],(y._rl||y.range)[1]]},j=s.repeat(Y,m.count);m.fill2d&&m.fill2d.update(j),m.line2d&&m.line2d.update(j),m.error2d&&m.error2d.update(j.concat(j)),m.scatter2d&&m.scatter2d.update(j),m.select2d&&m.select2d.update(j),m.glText&&m.glText.forEach((function(t){t.update(Y)}))}else m.init()}}},{"../../lib":719,"../../lib/prepare_regl":732,"../scatter/link_traces":1127,"../scatter/subtypes":1135,"./edit_style":1165,"gl-text":317,"regl-error2d":490,"regl-line2d":491,"regl-scatter2d":497}],1169:[function(t,e,r){var n=t("../../lib");e.exports=function(t,e){var r=e._scene,a={count:0,dirty:!0,lineOptions:[],fillOptions:[],markerOptions:[],markerSelectedOptions:[],markerUnselectedOptions:[],errorXOptions:[],errorYOptions:[],textOptions:[],textSelectedOptions:[],textUnselectedOptions:[],selectBatch:[],unselectBatch:[]},i={fill2d:!1,scatter2d:!1,error2d:!1,line2d:!1,glText:!1,select2d:!1};return e._scene||((r=e._scene={}).init=function(){n.extendFlat(r,i,a)},r.init(),r.update=function(t){var e=n.repeat(t,r.count);if(r.fill2d&&r.fill2d.update(e),r.scatter2d&&r.scatter2d.update(e),r.line2d&&r.line2d.update(e),r.error2d&&r.error2d.update(e.concat(e)),r.select2d&&r.select2d.update(e),r.glText)for(var a=0;a<r.count;a++)r.glText[a].update(t)},r.draw=function(){for(var t=r.count,e=r.fill2d,a=r.error2d,i=r.line2d,o=r.scatter2d,s=r.glText,l=r.select2d,u=r.selectBatch,c=r.unselectBatch,h=0;h<t;h++){if(e&&r.fillOrder[h]&&e.draw(r.fillOrder[h]),i&&r.lineOptions[h]&&i.draw(h),a&&(r.errorXOptions[h]&&a.draw(h),r.errorYOptions[h]&&a.draw(h+t)),o&&r.markerOptions[h])if(c[h].length){var d=n.repeat([],r.count);d[h]=c[h],o.draw(d)}else u[h].length||o.draw(h);s[h]&&r.textOptions[h]&&s[h].render()}l&&l.draw(u),r.dirty=!1},r.destroy=function(){r.fill2d&&r.fill2d.destroy&&r.fill2d.destroy(),r.scatter2d&&r.scatter2d.destroy&&r.scatter2d.destroy(),r.error2d&&r.error2d.destroy&&r.error2d.destroy(),r.line2d&&r.line2d.destroy&&r.line2d.destroy(),r.select2d&&r.select2d.destroy&&r.select2d.destroy(),r.glText&&r.glText.forEach((function(t){t.destroy&&t.destroy()})),r.lineOptions=null,r.fillOptions=null,r.markerOptions=null,r.markerSelectedOptions=null,r.markerUnselectedOptions=null,r.errorXOptions=null,r.errorYOptions=null,r.textOptions=null,r.textSelectedOptions=null,r.textUnselectedOptions=null,r.selectBatch=null,r.unselectBatch=null,e._scene=null}),r.dirty||n.extendFlat(r,a),r}},{"../../lib":719}],1170:[function(t,e,r){var n=t("../scatter/subtypes"),a=t("./edit_style").styleTextSelection;e.exports=function(t,e){var r=t.cd,i=[],o=r[0].trace,s=r[0].t,l=o._length,u=s.x,c=s.y,h=s._scene,d=s.index;if(!h)return i;var f=n.hasText(o),p=n.hasMarkers(o),m=!p&&!f;if(!0!==o.visible||m)return i;var g=[],y=[];if(!1!==e&&!e.degenerate)for(var v=0;v<l;v++)e.contains([s.xpx[v],s.ypx[v]],!1,v,t)?(g.push(v),i.push({pointNumber:v,x:u[v],y:c[v]})):y.push(v);if(p){var _=h.scatter2d;if(g.length||y.length){if(!h.selectBatch[d].length&&!h.unselectBatch[d].length){var x=new Array(h.count);x[d]=h.markerUnselectedOptions[d],_.update.apply(_,x)}}else{var b=new Array(h.count);b[d]=h.markerOptions[d],_.update.apply(_,b)}}return h.selectBatch[d]=g,h.unselectBatch[d]=y,f&&a(r),i}},{"../scatter/subtypes":1135,"./edit_style":1165}],1171:[function(t,e,r){var n=t("../../components/fx/hovertemplate_attributes"),a=t("../scattergeo/attributes"),i=t("../scatter/attributes"),o=t("../../plots/mapbox/layout_attributes"),s=t("../../plots/attributes"),l=t("../../components/colorscale/attributes"),u=t("../../lib/extend").extendFlat,c=t("../../plot_api/edit_types").overrideAll,h=a.line,d=a.marker;e.exports=c({lon:a.lon,lat:a.lat,mode:u({},i.mode,{dflt:"markers"}),text:u({},i.text,{}),hovertext:u({},i.hovertext,{}),line:{color:h.color,width:h.width},connectgaps:i.connectgaps,marker:u({symbol:{valType:"string",dflt:"circle",arrayOk:!0},opacity:d.opacity,size:d.size,sizeref:d.sizeref,sizemin:d.sizemin,sizemode:d.sizemode},l("marker")),fill:a.fill,fillcolor:i.fillcolor,textfont:o.layers.symbol.textfont,textposition:o.layers.symbol.textposition,below:{valType:"string"},selected:{marker:i.selected.marker},unselected:{marker:i.unselected.marker},hoverinfo:u({},s.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:n()},"calc","nested")},{"../../components/colorscale/attributes":600,"../../components/fx/hovertemplate_attributes":631,"../../lib/extend":710,"../../plot_api/edit_types":750,"../../plots/attributes":764,"../../plots/mapbox/layout_attributes":824,"../scatter/attributes":1112,"../scattergeo/attributes":1151}],1172:[function(t,e,r){var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../constants/numerical").BADNUM,o=t("../../lib/geojson_utils"),s=t("../../components/colorscale"),l=t("../../components/drawing"),u=t("../scatter/make_bubble_size_func"),c=t("../scatter/subtypes"),h=t("../../plots/mapbox/convert_text_opts");function d(){return{geojson:o.makeBlank(),layout:{visibility:"none"},paint:{}}}function f(t){return a.isArrayOrTypedArray(t)?function(t){return t}:t?function(){return t}:p}function p(){return""}function m(t){return t[0]===i}e.exports=function(t){var e,r=t[0].trace,i=!0===r.visible&&0!==r._length,g="none"!==r.fill,y=c.hasLines(r),v=c.hasMarkers(r),_=c.hasText(r),x=v&&"circle"===r.marker.symbol,b=v&&"circle"!==r.marker.symbol,w=d(),M=d(),k=d(),T=d(),L={fill:w,line:M,circle:k,symbol:T};if(!i)return L;if((g||y)&&(e=o.calcTraceToLineCoords(t)),g&&(w.geojson=o.makePolygon(e),w.layout.visibility="visible",a.extendFlat(w.paint,{"fill-color":r.fillcolor})),y&&(M.geojson=o.makeLine(e),M.layout.visibility="visible",a.extendFlat(M.paint,{"line-width":r.line.width,"line-color":r.line.color,"line-opacity":r.opacity})),x){var A=function(t){var e,r,i,o,c=t[0].trace,h=c.marker,d=c.selectedpoints,f=a.isArrayOrTypedArray(h.color),p=a.isArrayOrTypedArray(h.size),g=a.isArrayOrTypedArray(h.opacity);function y(t){return c.opacity*t}f&&(r=s.hasColorscale(c,"marker")?s.makeColorScaleFuncFromTrace(h):a.identity),p&&(i=u(c)),g&&(o=function(t){return y(n(t)?+a.constrain(t,0,1):0)});var v,_,x=[];for(e=0;e<t.length;e++){var b=t[e],w=b.lonlat;if(!m(w)){var M={};r&&(M.mcc=b.mcc=r(b.mc)),i&&(M.mrc=b.mrc=i(b.ms)),o&&(M.mo=o(b.mo)),d&&(M.selected=b.selected||0),x.push({type:"Feature",geometry:{type:"Point",coordinates:w},properties:M})}}if(d)for(v=l.makeSelectedPointStyleFns(c),e=0;e<x.length;e++){var k=x[e].properties;v.selectedOpacityFn&&(k.mo=y(v.selectedOpacityFn(k))),v.selectedColorFn&&(k.mcc=v.selectedColorFn(k)),v.selectedSizeFn&&(k.mrc=v.selectedSizeFn(k))}return{geojson:{type:"FeatureCollection",features:x},mcc:f||v&&v.selectedColorFn?{type:"identity",property:"mcc"}:h.color,mrc:p||v&&v.selectedSizeFn?{type:"identity",property:"mrc"}:(_=h.size,_/2),mo:g||v&&v.selectedOpacityFn?{type:"identity",property:"mo"}:y(h.opacity)}}(t);k.geojson=A.geojson,k.layout.visibility="visible",a.extendFlat(k.paint,{"circle-color":A.mcc,"circle-radius":A.mrc,"circle-opacity":A.mo})}if((b||_)&&(T.geojson=function(t){for(var e=t[0].trace,r=(e.marker||{}).symbol,n=e.text,a="circle"!==r?f(r):p,i=c.hasText(e)?f(n):p,o=[],s=0;s<t.length;s++){var l=t[s];m(l.lonlat)||o.push({type:"Feature",geometry:{type:"Point",coordinates:l.lonlat},properties:{symbol:a(l.mx),text:i(l.tx)}})}return{type:"FeatureCollection",features:o}}(t),a.extendFlat(T.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),b&&(a.extendFlat(T.layout,{"icon-size":r.marker.size/10}),a.extendFlat(T.paint,{"icon-opacity":r.opacity*r.marker.opacity,"icon-color":r.marker.color})),_)){var S=(r.marker||{}).size,E=h(r.textposition,S);a.extendFlat(T.layout,{"text-size":r.textfont.size,"text-anchor":E.anchor,"text-offset":E.offset}),a.extendFlat(T.paint,{"text-color":r.textfont.color,"text-opacity":r.opacity})}return L}},{"../../components/colorscale":605,"../../components/drawing":614,"../../constants/numerical":695,"../../lib":719,"../../lib/geojson_utils":714,"../../plots/mapbox/convert_text_opts":821,"../scatter/make_bubble_size_func":1128,"../scatter/subtypes":1135,"fast-isnumeric":225}],1173:[function(t,e,r){var n=t("../../lib"),a=t("../scatter/subtypes"),i=t("../scatter/marker_defaults"),o=t("../scatter/line_defaults"),s=t("../scatter/text_defaults"),l=t("../scatter/fillcolor_defaults"),u=t("./attributes");e.exports=function(t,e,r,c){function h(r,a){return n.coerce(t,e,u,r,a)}if(function(t,e,r){var n=r("lon")||[],a=r("lat")||[],i=Math.min(n.length,a.length);return e._length=i,i}(0,e,h)){if(h("text"),h("hovertext"),h("hovertemplate"),h("mode"),h("below"),a.hasLines(e)&&(o(t,e,r,c,h,{noDash:!0}),h("connectgaps")),a.hasMarkers(e)){i(t,e,r,c,h,{noLine:!0});var d=e.marker;"circle"!==d.symbol&&(n.isArrayOrTypedArray(d.size)&&(d.size=d.size[0]),n.isArrayOrTypedArray(d.color)&&(d.color=d.color[0]))}a.hasText(e)&&s(t,e,c,h,{noSelect:!0}),h("fill"),"none"!==e.fill&&l(t,e,r,h),n.coerceSelectionMarkerOpacity(e,h)}else e.visible=!1}},{"../../lib":719,"../scatter/fillcolor_defaults":1120,"../scatter/line_defaults":1124,"../scatter/marker_defaults":1130,"../scatter/subtypes":1135,"../scatter/text_defaults":1136,"./attributes":1171}],1174:[function(t,e,r){e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t}},{}],1175:[function(t,e,r){var n=t("../../components/fx"),a=t("../../lib"),i=t("../scatter/get_trace_color"),o=a.fillText,s=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r){var l=t.cd,u=l[0].trace,c=t.xa,h=t.ya,d=t.subplot,f=360*(e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),p=e-f;if(n.getClosest(l,(function(t){var e=t.lonlat;if(e[0]===s)return 1/0;var n=a.modHalf(e[0],360),i=e[1],o=d.project([n,i]),l=o.x-c.c2p([p,i]),u=o.y-h.c2p([n,r]),f=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(l*l+u*u)-f,1-3/f)}),t),!1!==t.index){var m=l[t.index],g=m.lonlat,y=[a.modHalf(g[0],360)+f,g[1]],v=c.c2p(y),_=h.c2p(y),x=m.mrc||1;return t.x0=v-x,t.x1=v+x,t.y0=_-x,t.y1=_+x,t.color=i(u,m),t.extraText=function(t,e,r){if(!t.hovertemplate){var n=(e.hi||t.hoverinfo).split("+"),a=-1!==n.indexOf("all"),i=-1!==n.indexOf("lon"),s=-1!==n.indexOf("lat"),l=e.lonlat,u=[];return a||i&&s?u.push("("+c(l[0])+", "+c(l[1])+")"):i?u.push(r.lon+c(l[0])):s&&u.push(r.lat+c(l[1])),(a||-1!==n.indexOf("text"))&&o(e,t,u),u.join("<br>")}function c(t){return t+"°"}}(u,m,l[0].t.labels),t.hovertemplate=u.hovertemplate,[t]}}},{"../../components/fx":632,"../../constants/numerical":695,"../../lib":719,"../scatter/get_trace_color":1121}],1176:[function(t,e,r){e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),calc:t("../scattergeo/calc"),plot:t("./plot"),hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("./select"),styleOnSelect:function(t,e){e&&e[0].trace._glTrace.update(e)},moduleType:"trace",name:"scattermapbox",basePlotModule:t("../../plots/mapbox"),categories:["mapbox","gl","symbols","showLegend","scatterlike"],meta:{}}},{"../../plots/mapbox":822,"../scatter/marker_colorbar":1129,"../scattergeo/calc":1152,"./attributes":1171,"./defaults":1173,"./event_data":1174,"./hover":1175,"./plot":1177,"./select":1178}],1177:[function(t,e,r){var n=t("./convert"),a=t("../../plots/mapbox/constants").traceLayerPrefix,i=["fill","line","circle","symbol"];function o(t,e){this.subplot=t,this.uid=e,this.sourceIds={fill:"source-"+e+"-fill",line:"source-"+e+"-line",circle:"source-"+e+"-circle",symbol:"source-"+e+"-symbol"},this.layerIds={fill:a+e+"-fill",line:a+e+"-line",circle:a+e+"-circle",symbol:a+e+"-symbol"},this.below=null}var s=o.prototype;s.addSource=function(t,e){this.subplot.map.addSource(this.sourceIds[t],{type:"geojson",data:e.geojson})},s.setSourceData=function(t,e){this.subplot.map.getSource(this.sourceIds[t]).setData(e.geojson)},s.addLayer=function(t,e,r){this.subplot.addLayer({type:t,id:this.layerIds[t],source:this.sourceIds[t],layout:e.layout,paint:e.paint},r)},s.update=function(t){var e,r,a,o=this.subplot,s=o.map,l=n(t),u=o.belowLookup["trace-"+this.uid];if(u!==this.below){for(e=i.length-1;e>=0;e--)r=i[e],s.removeLayer(this.layerIds[r]);for(e=0;e<i.length;e++)a=l[r=i[e]],this.addLayer(r,a,u);this.below=u}for(e=0;e<i.length;e++)a=l[r=i[e]],o.setOptions(this.layerIds[r],"setLayoutProperty",a.layout),"visible"===a.layout.visibility&&(this.setSourceData(r,a),o.setOptions(this.layerIds[r],"setPaintProperty",a.paint));t[0].trace._glTrace=this},s.dispose=function(){for(var t=this.subplot.map,e=i.length-1;e>=0;e--){var r=i[e];t.removeLayer(this.layerIds[r]),t.removeSource(this.sourceIds[r])}},e.exports=function(t,e){for(var r=e[0].trace,a=new o(t,r.uid),s=n(e),l=a.below=t.belowLookup["trace-"+r.uid],u=0;u<i.length;u++){var c=i[u],h=s[c];a.addSource(c,h),a.addLayer(c,h,l)}return e[0].trace._glTrace=a,a}},{"../../plots/mapbox/constants":820,"./convert":1172}],1178:[function(t,e,r){var n=t("../../lib"),a=t("../scatter/subtypes"),i=t("../../constants/numerical").BADNUM;e.exports=function(t,e){var r,o=t.cd,s=t.xaxis,l=t.yaxis,u=[],c=o[0].trace;if(!a.hasMarkers(c))return[];if(!1===e)for(r=0;r<o.length;r++)o[r].selected=0;else for(r=0;r<o.length;r++){var h=o[r],d=h.lonlat;if(d[0]!==i){var f=[n.modHalf(d[0],360),d[1]],p=[s.c2p(f),l.c2p(f)];e.contains(p,null,r,t)?(u.push({pointNumber:r,lon:d[0],lat:d[1]}),h.selected=1):h.selected=0}}return u}},{"../../constants/numerical":695,"../../lib":719,"../scatter/subtypes":1135}],1179:[function(t,e,r){var n=t("../../components/fx/hovertemplate_attributes"),a=t("../../lib/extend").extendFlat,i=t("../scatter/attributes"),o=t("../../plots/attributes"),s=i.line;e.exports={mode:i.mode,r:{valType:"data_array",editType:"calc+clearAxisTypes"},theta:{valType:"data_array",editType:"calc+clearAxisTypes"},r0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dr:{valType:"number",dflt:1,editType:"calc"},theta0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dtheta:{valType:"number",editType:"calc"},thetaunit:{valType:"enumerated",values:["radians","degrees","gradians"],dflt:"degrees",editType:"calc+clearAxisTypes"},text:i.text,hovertext:i.hovertext,line:{color:s.color,width:s.width,dash:s.dash,shape:a({},s.shape,{values:["linear","spline"]}),smoothing:s.smoothing,editType:"calc"},connectgaps:i.connectgaps,marker:i.marker,cliponaxis:a({},i.cliponaxis,{dflt:!1}),textposition:i.textposition,textfont:i.textfont,fill:a({},i.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:i.fillcolor,hoverinfo:a({},o.hoverinfo,{flags:["r","theta","text","name"]}),hoveron:i.hoveron,hovertemplate:n(),selected:i.selected,unselected:i.unselected}},{"../../components/fx/hovertemplate_attributes":631,"../../lib/extend":710,"../../plots/attributes":764,"../scatter/attributes":1112}],1180:[function(t,e,r){var n=t("fast-isnumeric"),a=t("../../constants/numerical").BADNUM,i=t("../../plots/cartesian/axes"),o=t("../scatter/colorscale_calc"),s=t("../scatter/arrays_to_calcdata"),l=t("../scatter/calc_selection"),u=t("../scatter/calc").calcMarkerSize;e.exports=function(t,e){for(var r=t._fullLayout,c=e.subplot,h=r[c].radialaxis,d=r[c].angularaxis,f=h.makeCalcdata(e,"r"),p=d.makeCalcdata(e,"theta"),m=e._length,g=new Array(m),y=0;y<m;y++){var v=f[y],_=p[y],x=g[y]={};n(v)&&n(_)?(x.r=v,x.theta=_):x.r=a}var b=u(e,m);return e._extremes.x=i.findExtremes(h,f,{ppad:b}),o(t,e),s(g,e),l(g,e),g}},{"../../constants/numerical":695,"../../plots/cartesian/axes":767,"../scatter/arrays_to_calcdata":1111,"../scatter/calc":1113,"../scatter/calc_selection":1114,"../scatter/colorscale_calc":1115,"fast-isnumeric":225}],1181:[function(t,e,r){var n=t("../../lib"),a=t("../scatter/subtypes"),i=t("../scatter/marker_defaults"),o=t("../scatter/line_defaults"),s=t("../scatter/line_shape_defaults"),l=t("../scatter/text_defaults"),u=t("../scatter/fillcolor_defaults"),c=t("../scatter/constants").PTS_LINESONLY,h=t("./attributes");function d(t,e,r,n){var a,i=n("r"),o=n("theta");if(i)o?a=Math.min(i.length,o.length):(a=i.length,n("theta0"),n("dtheta"));else{if(!o)return 0;a=e.theta.length,n("r0"),n("dr")}return e._length=a,a}e.exports={handleRThetaDefaults:d,supplyDefaults:function(t,e,r,f){function p(r,a){return n.coerce(t,e,h,r,a)}var m=d(0,e,0,p);if(m){p("thetaunit"),p("mode",m<c?"lines+markers":"lines"),p("text"),p("hovertext"),"fills"!==e.hoveron&&p("hovertemplate"),a.hasLines(e)&&(o(t,e,r,f,p),s(t,e,p),p("connectgaps")),a.hasMarkers(e)&&i(t,e,r,f,p,{gradient:!0}),a.hasText(e)&&l(t,e,f,p);var g=[];(a.hasMarkers(e)||a.hasText(e))&&(p("cliponaxis"),p("marker.maxdisplayed"),g.push("points")),p("fill"),"none"!==e.fill&&(u(t,e,r,p),a.hasLines(e)||s(t,e,p)),"tonext"!==e.fill&&"toself"!==e.fill||g.push("fills"),p("hoveron",g.join("+")||"points"),n.coerceSelectionMarkerOpacity(e,p)}else e.visible=!1}}},{"../../lib":719,"../scatter/constants":1116,"../scatter/fillcolor_defaults":1120,"../scatter/line_defaults":1124,"../scatter/line_shape_defaults":1126,"../scatter/marker_defaults":1130,"../scatter/subtypes":1135,"../scatter/text_defaults":1136,"./attributes":1179}],1182:[function(t,e,r){var n=t("../scatter/hover"),a=t("../../plots/cartesian/axes"),i=t("../../lib");function o(t,e,r,n){var o=r.radialAxis,s=r.angularAxis;o._hovertitle="r",s._hovertitle="θ";var l=o.c2l(t.r);n.rLabel=a.tickText(o,l,"hover").text;var u="degrees"===s.thetaunit?i.rad2deg(t.theta):t.theta;n.thetaLabel=a.tickText(s,u,"hover").text;var c=t.hi||e.hoverinfo,h=[];function d(t,e){h.push(t._hovertitle+": "+e)}if(!e.hovertemplate){var f=c.split("+");-1!==f.indexOf("all")&&(f=["r","theta","text"]),-1!==f.indexOf("r")&&d(o,n.rLabel),-1!==f.indexOf("theta")&&d(s,n.thetaLabel),-1!==f.indexOf("text")&&n.text&&(h.push(n.text),delete n.text),n.extraText=h.join("<br>")}}e.exports={hoverPoints:function(t,e,r,a){var i=n(t,e,r,a);if(i&&!1!==i[0].index){var s=i[0];if(void 0===s.index)return i;var l=t.subplot,u=s.cd[s.index],c=s.trace;if(l.isPtInside(u))return s.xLabelVal=void 0,s.yLabelVal=void 0,o(u,c,l,s),s.hovertemplate=c.hovertemplate,i}},makeHoverPointText:o}},{"../../lib":719,"../../plots/cartesian/axes":767,"../scatter/hover":1122}],1183:[function(t,e,r){e.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:t("../../plots/polar"),categories:["polar","symbols","showLegend","scatter-like"],attributes:t("./attributes"),supplyDefaults:t("./defaults").supplyDefaults,colorbar:t("../scatter/marker_colorbar"),calc:t("./calc"),plot:t("./plot"),style:t("../scatter/style").style,styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover").hoverPoints,selectPoints:t("../scatter/select"),meta:{}}},{"../../plots/polar":831,"../scatter/marker_colorbar":1129,"../scatter/select":1132,"../scatter/style":1134,"./attributes":1179,"./calc":1180,"./defaults":1181,"./hover":1182,"./plot":1184}],1184:[function(t,e,r){var n=t("../scatter/plot"),a=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r){for(var i=e.layers.frontplot.select("g.scatterlayer"),o={xaxis:e.xaxis,yaxis:e.yaxis,plot:e.framework,layerClipId:e._hasClipOnAxisFalse?e.clipIds.forTraces:null},s=e.radialAxis,l=e.angularAxis,u=0;u<r.length;u++)for(var c=r[u],h=0;h<c.length;h++){var d=c[h],f=d.r;if(f===a)d.x=d.y=a;else{var p=s.c2g(f),m=l.c2g(d.theta);d.x=p*Math.cos(m),d.y=p*Math.sin(m)}}n(t,o,r,i)}},{"../../constants/numerical":695,"../scatter/plot":1131}],1185:[function(t,e,r){var n=t("../scatterpolar/attributes"),a=t("../scattergl/attributes");e.exports={mode:n.mode,r:n.r,theta:n.theta,r0:n.r0,dr:n.dr,theta0:n.theta0,dtheta:n.dtheta,thetaunit:n.thetaunit,text:n.text,hovertext:n.hovertext,hovertemplate:n.hovertemplate,line:a.line,connectgaps:a.connectgaps,marker:a.marker,fill:a.fill,fillcolor:a.fillcolor,textposition:a.textposition,textfont:a.textfont,hoverinfo:n.hoverinfo,selected:n.selected,unselected:n.unselected}},{"../scattergl/attributes":1160,"../scatterpolar/attributes":1179}],1186:[function(t,e,r){var n=t("../scatter/colorscale_calc"),a=t("../scatter/calc").calcMarkerSize,i=t("../scattergl/convert"),o=t("../../plots/cartesian/axes"),s=t("../scattergl/constants").TOO_MANY_POINTS;e.exports=function(t,e){var r=t._fullLayout,l=e.subplot,u=r[l].radialaxis,c=r[l].angularaxis,h=u.makeCalcdata(e,"r"),d=c.makeCalcdata(e,"theta"),f=e._length,p={};f<h.length&&(h=h.slice(0,f)),f<d.length&&(d=d.slice(0,f)),p.r=h,p.theta=d,n(t,e);var m,g=p.opts=i.style(t,e);return f<s?m=a(e,f):g.marker&&(m=2*(g.marker.sizeAvg||Math.max(g.marker.size,3))),e._extremes.x=o.findExtremes(u,h,{ppad:m}),[{x:!1,y:!1,t:p,trace:e}]}},{"../../plots/cartesian/axes":767,"../scatter/calc":1113,"../scatter/colorscale_calc":1115,"../scattergl/constants":1162,"../scattergl/convert":1163}],1187:[function(t,e,r){var n=t("../../lib"),a=t("../scatter/subtypes"),i=t("../scatterpolar/defaults").handleRThetaDefaults,o=t("../scatter/marker_defaults"),s=t("../scatter/line_defaults"),l=t("../scatter/text_defaults"),u=t("../scatter/fillcolor_defaults"),c=t("../scatter/constants").PTS_LINESONLY,h=t("./attributes");e.exports=function(t,e,r,d){function f(r,a){return n.coerce(t,e,h,r,a)}var p=i(t,e,d,f);p?(f("thetaunit"),f("mode",p<c?"lines+markers":"lines"),f("text"),f("hovertext"),"fills"!==e.hoveron&&f("hovertemplate"),a.hasLines(e)&&(s(t,e,r,d,f),f("connectgaps")),a.hasMarkers(e)&&o(t,e,r,d,f),a.hasText(e)&&l(t,e,d,f),f("fill"),"none"!==e.fill&&u(t,e,r,f),n.coerceSelectionMarkerOpacity(e,f)):e.visible=!1}},{"../../lib":719,"../scatter/constants":1116,"../scatter/fillcolor_defaults":1120,"../scatter/line_defaults":1124,"../scatter/marker_defaults":1130,"../scatter/subtypes":1135,"../scatter/text_defaults":1136,"../scatterpolar/defaults":1181,"./attributes":1185}],1188:[function(t,e,r){var n=t("../scattergl/hover"),a=t("../scatterpolar/hover").makeHoverPointText;e.exports={hoverPoints:function(t,e,r,i){var o=t.cd[0].t,s=o.r,l=o.theta,u=n.hoverPoints(t,e,r,i);if(u&&!1!==u[0].index){var c=u[0];if(void 0===c.index)return u;var h=t.subplot,d=c.cd[c.index],f=c.trace;if(d.r=s[c.index],d.theta=l[c.index],h.isPtInside(d))return c.xLabelVal=void 0,c.yLabelVal=void 0,a(d,f,h,c),u}}}},{"../scattergl/hover":1166,"../scatterpolar/hover":1182}],1189:[function(t,e,r){e.exports={moduleType:"trace",name:"scatterpolargl",basePlotModule:t("../../plots/polar"),categories:["gl","regl","polar","symbols","showLegend","scatter-like"],attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),calc:t("./calc"),plot:t("./plot"),hoverPoints:t("./hover").hoverPoints,selectPoints:t("../scattergl/select"),meta:{}}},{"../../plots/polar":831,"../scatter/marker_colorbar":1129,"../scattergl/select":1170,"./attributes":1185,"./calc":1186,"./defaults":1187,"./hover":1188,"./plot":1190}],1190:[function(t,e,r){var n=t("point-cluster"),a=t("fast-isnumeric"),i=t("../scattergl/plot"),o=t("../scattergl/scene_update"),s=t("../scattergl/convert"),l=t("../../lib"),u=t("../scattergl/constants").TOO_MANY_POINTS;e.exports=function(t,e,r){if(r.length){var c=e.radialAxis,h=e.angularAxis,d=o(t,e);return r.forEach((function(r){if(r&&r[0]&&r[0].trace){var i,o=r[0],f=o.trace,p=o.t,m=f._length,g=p.r,y=p.theta,v=p.opts,_=g.slice(),x=y.slice();for(i=0;i<g.length;i++)e.isPtInside({r:g[i],theta:y[i]})||(_[i]=NaN,x[i]=NaN);var b=new Array(2*m),w=Array(m),M=Array(m);for(i=0;i<m;i++){var k,T,L=_[i];if(a(L)){var A=c.c2g(L),S=h.c2g(x[i],f.thetaunit);k=A*Math.cos(S),T=A*Math.sin(S)}else k=T=NaN;w[i]=b[2*i]=k,M[i]=b[2*i+1]=T}p.tree=n(b),v.marker&&m>=u&&(v.marker.cluster=p.tree),v.marker&&(v.markerSel.positions=v.markerUnsel.positions=v.marker.positions=b),v.line&&b.length>1&&l.extendFlat(v.line,s.linePositions(t,f,b)),v.text&&(l.extendFlat(v.text,{positions:b},s.textPosition(t,f,v.text,v.marker)),l.extendFlat(v.textSel,{positions:b},s.textPosition(t,f,v.text,v.markerSel)),l.extendFlat(v.textUnsel,{positions:b},s.textPosition(t,f,v.text,v.markerUnsel))),v.fill&&!d.fill2d&&(d.fill2d=!0),v.marker&&!d.scatter2d&&(d.scatter2d=!0),v.line&&!d.line2d&&(d.line2d=!0),v.text&&!d.glText&&(d.glText=!0),d.lineOptions.push(v.line),d.fillOptions.push(v.fill),d.markerOptions.push(v.marker),d.markerSelectedOptions.push(v.markerSel),d.markerUnselectedOptions.push(v.markerUnsel),d.textOptions.push(v.text),d.textSelectedOptions.push(v.textSel),d.textUnselectedOptions.push(v.textUnsel),d.selectBatch.push([]),d.unselectBatch.push([]),p.x=w,p.y=M,p.rawx=w,p.rawy=M,p.r=g,p.theta=y,p.positions=b,p._scene=d,p.index=d.count,d.count++}})),i(t,e,r)}}},{"../../lib":719,"../scattergl/constants":1162,"../scattergl/convert":1163,"../scattergl/plot":1168,"../scattergl/scene_update":1169,"fast-isnumeric":225,"point-cluster":469}],1191:[function(t,e,r){var n=t("../../components/fx/hovertemplate_attributes"),a=t("../scatter/attributes"),i=t("../../plots/attributes"),o=t("../../components/colorscale/attributes"),s=t("../../components/drawing/attributes").dash,l=t("../../lib/extend").extendFlat,u=a.marker,c=a.line,h=u.line;e.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:l({},a.mode,{dflt:"markers"}),text:l({},a.text,{}),hovertext:l({},a.hovertext,{}),line:{color:c.color,width:c.width,dash:s,shape:l({},c.shape,{values:["linear","spline"]}),smoothing:c.smoothing,editType:"calc"},connectgaps:a.connectgaps,cliponaxis:a.cliponaxis,fill:l({},a.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:a.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,editType:"calc"},o("marker.line")),gradient:u.gradient,editType:"calc"},o("marker")),textfont:a.textfont,textposition:a.textposition,selected:a.selected,unselected:a.unselected,hoverinfo:l({},i.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:a.hoveron,hovertemplate:n()}},{"../../components/colorscale/attributes":600,"../../components/drawing/attributes":613,"../../components/fx/hovertemplate_attributes":631,"../../lib/extend":710,"../../plots/attributes":764,"../scatter/attributes":1112}],1192:[function(t,e,r){var n=t("fast-isnumeric"),a=t("../scatter/colorscale_calc"),i=t("../scatter/arrays_to_calcdata"),o=t("../scatter/calc_selection"),s=t("../scatter/calc").calcMarkerSize,l=["a","b","c"],u={a:["b","c"],b:["a","c"],c:["a","b"]};e.exports=function(t,e){var r,c,h,d,f,p,m=t._fullLayout[e.subplot].sum,g=e.sum||m,y={a:e.a,b:e.b,c:e.c};for(r=0;r<l.length;r++)if(!y[h=l[r]]){for(f=y[u[h][0]],p=y[u[h][1]],d=new Array(f.length),c=0;c<f.length;c++)d[c]=g-f[c]-p[c];y[h]=d}var v,_,x,b,w,M,k=e._length,T=new Array(k);for(r=0;r<k;r++)v=y.a[r],_=y.b[r],x=y.c[r],n(v)&&n(_)&&n(x)?(1!=(b=m/((v=+v)+(_=+_)+(x=+x)))&&(v*=b,_*=b,x*=b),M=v,w=x-_,T[r]={x:w,y:M,a:v,b:_,c:x}):T[r]={x:!1,y:!1};return s(e,k),a(t,e),i(T,e),o(T,e),T}},{"../scatter/arrays_to_calcdata":1111,"../scatter/calc":1113,"../scatter/calc_selection":1114,"../scatter/colorscale_calc":1115,"fast-isnumeric":225}],1193:[function(t,e,r){var n=t("../../lib"),a=t("../scatter/constants"),i=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,d){function f(r,a){return n.coerce(t,e,h,r,a)}var p,m=f("a"),g=f("b"),y=f("c");if(m?(p=m.length,g?(p=Math.min(p,g.length),y&&(p=Math.min(p,y.length))):p=y?Math.min(p,y.length):0):g&&y&&(p=Math.min(g.length,y.length)),p){e._length=p,f("sum"),f("text"),f("hovertext"),"fills"!==e.hoveron&&f("hovertemplate"),f("mode",p<a.PTS_LINESONLY?"lines+markers":"lines"),i.hasLines(e)&&(s(t,e,r,d,f),l(t,e,f),f("connectgaps")),i.hasMarkers(e)&&o(t,e,r,d,f,{gradient:!0}),i.hasText(e)&&u(t,e,d,f);var v=[];(i.hasMarkers(e)||i.hasText(e))&&(f("cliponaxis"),f("marker.maxdisplayed"),v.push("points")),f("fill"),"none"!==e.fill&&(c(t,e,r,f),i.hasLines(e)||l(t,e,f)),"tonext"!==e.fill&&"toself"!==e.fill||v.push("fills"),f("hoveron",v.join("+")||"points"),n.coerceSelectionMarkerOpacity(e,f)}else e.visible=!1}},{"../../lib":719,"../scatter/constants":1116,"../scatter/fillcolor_defaults":1120,"../scatter/line_defaults":1124,"../scatter/line_shape_defaults":1126,"../scatter/marker_defaults":1130,"../scatter/subtypes":1135,"../scatter/text_defaults":1136,"./attributes":1191}],1194:[function(t,e,r){e.exports=function(t,e,r,n,a){if(e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),n[a]){var i=n[a];t.a=i.a,t.b=i.b,t.c=i.c}else t.a=e.a,t.b=e.b,t.c=e.c;return t}},{}],1195:[function(t,e,r){var n=t("../scatter/hover"),a=t("../../plots/cartesian/axes");e.exports=function(t,e,r,i){var o=n(t,e,r,i);if(o&&!1!==o[0].index){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 d=s.cd[s.index];s.a=d.a,s.b=d.b,s.c=d.c,s.xLabelVal=void 0,s.yLabelVal=void 0;var f=s.subplot;s.aLabel=a.tickText(f.aaxis,d.a,"hover").text,s.bLabel=a.tickText(f.baxis,d.b,"hover").text,s.cLabel=a.tickText(f.caxis,d.c,"hover").text;var p=s.trace,m=d.hi||p.hoverinfo,g=[];if(!p.hovertemplate){var y=m.split("+");-1!==y.indexOf("all")&&(y=["a","b","c"]),-1!==y.indexOf("a")&&v(f.aaxis,s.aLabel),-1!==y.indexOf("b")&&v(f.baxis,s.bLabel),-1!==y.indexOf("c")&&v(f.caxis,s.cLabel)}return s.extraText=g.join("<br>"),s.hovertemplate=p.hovertemplate,o}function v(t,e){g.push(t._hovertitle+": "+e)}}},{"../../plots/cartesian/axes":767,"../scatter/hover":1122}],1196:[function(t,e,r){e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),calc:t("./calc"),plot:t("./plot"),style:t("../scatter/style").style,styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../scatter/select"),eventData:t("./event_data"),moduleType:"trace",name:"scatterternary",basePlotModule:t("../../plots/ternary"),categories:["ternary","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/ternary":843,"../scatter/marker_colorbar":1129,"../scatter/select":1132,"../scatter/style":1134,"./attributes":1191,"./calc":1192,"./defaults":1193,"./event_data":1194,"./hover":1195,"./plot":1197}],1197:[function(t,e,r){var n=t("../scatter/plot");e.exports=function(t,e,r){var a=e.plotContainer;a.select(".scatterlayer").selectAll("*").remove();var i={xaxis:e.xaxis,yaxis:e.yaxis,plot:a,layerClipId:e._hasClipOnAxisFalse?e.clipIdRelative:null},o=e.layers.frontplot.select("g.scatterlayer");n(t,i,r,o)}},{"../scatter/plot":1131}],1198:[function(t,e,r){var n=t("../scatter/attributes"),a=t("../../components/colorscale/attributes"),i=t("../../components/fx/hovertemplate_attributes"),o=t("../scattergl/attributes"),s=t("../../plots/cartesian/constants").idRegex,l=t("../../plot_api/plot_template").templatedArray,u=t("../../lib/extend").extendFlat,c=n.marker,h=c.line,d=u(a("marker.line",{editTypeOverride:"calc"}),{width:u({},h.width,{editType:"calc"}),editType:"calc"}),f=u(a("marker"),{symbol:c.symbol,size:u({},c.size,{editType:"markerSize"}),sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,opacity:c.opacity,colorbar:c.colorbar,line:d,editType:"calc"});function p(t){return{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"subplotid",regex:s[t],editType:"plot"}}}f.color.editType=f.cmin.editType=f.cmax.editType="style",e.exports={dimensions:l("dimension",{visible:{valType:"boolean",dflt:!0,editType:"calc"},label:{valType:"string",editType:"calc"},values:{valType:"data_array",editType:"calc+clearAxisTypes"},axis:{type:{valType:"enumerated",values:["linear","log","date","category"],editType:"calc+clearAxisTypes"},matches:{valType:"boolean",dflt:!1,editType:"calc"},editType:"calc+clearAxisTypes"},editType:"calc+clearAxisTypes"}),text:u({},o.text,{}),hovertext:u({},o.hovertext,{}),hovertemplate:i(),marker:f,xaxes:p("x"),yaxes:p("y"),diagonal:{visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},showupperhalf:{valType:"boolean",dflt:!0,editType:"calc"},showlowerhalf:{valType:"boolean",dflt:!0,editType:"calc"},selected:{marker:o.selected.marker,editType:"calc"},unselected:{marker:o.unselected.marker,editType:"calc"},opacity:o.opacity}},{"../../components/colorscale/attributes":600,"../../components/fx/hovertemplate_attributes":631,"../../lib/extend":710,"../../plot_api/plot_template":757,"../../plots/cartesian/constants":773,"../scatter/attributes":1112,"../scattergl/attributes":1160}],1199:[function(t,e,r){var n=t("regl-line2d"),a=t("../../registry"),i=t("../../lib/prepare_regl"),o=t("../../plots/get_data").getModuleCalcData,s=t("../../plots/cartesian"),l=t("../../plots/cartesian/axis_ids").getFromId,u=t("../../plots/cartesian/axes").shouldShowZeroLine,c="splom";function h(t,e,r){for(var n=r.matrixOptions.data.length,a=e._visibleDims,i=r.viewOpts.ranges=new Array(n),o=0;o<a.length;o++){var s=a[o],u=i[o]=new Array(4),c=l(t,e._diag[s][0]);c&&(u[0]=c.r2l(c.range[0]),u[2]=c.r2l(c.range[1]));var h=l(t,e._diag[s][1]);h&&(u[1]=h.r2l(h.range[0]),u[3]=h.r2l(h.range[1]))}r.selectBatch.length||r.unselectBatch.length?r.matrix.update({ranges:i},{ranges:i}):r.matrix.update({ranges:i})}function d(t){var e=t._fullLayout,r=e._glcanvas.data()[0].regl,a=e._splomGrid;a||(a=e._splomGrid=n(r)),a.update(function(t){var e,r=t._fullLayout,n=r._size,a=[0,0,r.width,r.height],i={};function o(t,e,r,n,o,s){var l=e[t+"color"],u=e[t+"width"],c=String(l+u);c in i?i[c].data.push(NaN,NaN,r,n,o,s):i[c]={data:[r,n,o,s],join:"rect",thickness:u,color:l,viewport:a,range:a,overlay:!1}}for(e in r._splomSubplots){var s,l,c=r._plots[e],h=c.xaxis,d=c.yaxis,f=h._vals,p=d._vals,m=n.b+d.domain[0]*n.h,g=-d._m,y=-g*d.r2l(d.range[0],d.calendar);if(h.showgrid)for(e=0;e<f.length;e++)s=h._offset+h.l2p(f[e].x),o("grid",h,s,m,s,m+d._length);if(d.showgrid)for(e=0;e<p.length;e++)l=m+y+g*p[e].x,o("grid",d,h._offset,l,h._offset+h._length,l);u(t,h,d)&&(s=h._offset+h.l2p(0),o("zeroline",h,s,m,s,m+d._length)),u(t,d,h)&&(l=m+y+0,o("zeroline",d,h._offset,l,h._offset+h._length,l))}var v=[];for(e in i)v.push(i[e]);return v}(t))}e.exports={name:c,attr:s.attr,attrRegex:s.attrRegex,layoutAttributes:s.layoutAttributes,supplyLayoutDefaults:s.supplyLayoutDefaults,drawFramework:s.drawFramework,plot:function(t){var e=t._fullLayout,r=a.getModule(c),n=o(t.calcdata,r)[0];i(t,["ANGLE_instanced_arrays","OES_element_index_uint"])&&(e._hasOnlyLargeSploms&&d(t),r.plot(t,{},n))},drag:function(t){var e=t.calcdata,r=t._fullLayout;r._hasOnlyLargeSploms&&d(t);for(var n=0;n<e.length;n++){var a=e[n][0].trace,i=r._splomScenes[a.uid];"splom"===a.type&&i&&i.matrix&&h(t,a,i)}},updateGrid:d,clean:function(t,e,r,n){var a,i={};if(n._splomScenes){for(a=0;a<t.length;a++){var o=t[a];"splom"===o.type&&(i[o.uid]=1)}for(a=0;a<r.length;a++){var l=r[a];if(!i[l.uid]){var u=n._splomScenes[l.uid];u&&u.destroy&&u.destroy(),n._splomScenes[l.uid]=null,delete n._splomScenes[l.uid]}}}0===Object.keys(n._splomScenes||{}).length&&delete n._splomScenes,n._splomGrid&&!e._hasOnlyLargeSploms&&n._hasOnlyLargeSploms&&(n._splomGrid.destroy(),n._splomGrid=null,delete n._splomGrid),s.clean(t,e,r,n)},updateFx:s.updateFx,toSVG:s.toSVG}},{"../../lib/prepare_regl":732,"../../plots/cartesian":778,"../../plots/cartesian/axes":767,"../../plots/cartesian/axis_ids":770,"../../plots/get_data":802,"../../registry":847,"regl-line2d":491}],1200:[function(t,e,r){var n=t("../../lib"),a=t("../../plots/cartesian/axis_ids"),i=t("../scatter/calc").calcMarkerSize,o=t("../scatter/calc").calcAxisExpansion,s=t("../scatter/colorscale_calc"),l=t("../scattergl/convert").markerSelection,u=t("../scattergl/convert").markerStyle,c=t("./scene_update"),h=t("../../constants/numerical").BADNUM,d=t("../scattergl/constants").TOO_MANY_POINTS;e.exports=function(t,e){var r,f,p,m,g,y,v=e.dimensions,_=e._length,x={},b=x.cdata=[],w=x.data=[],M=e._visibleDims=[];function k(t,r){for(var a=t.makeCalcdata({v:r.values,vcalendar:e.calendar},"v"),i=0;i<a.length;i++)a[i]=a[i]===h?NaN:a[i];b.push(a),w.push("log"===t.type?n.simpleMap(a,t.c2l):a)}for(r=0;r<v.length;r++)if((p=v[r]).visible){if(m=a.getFromId(t,e._diag[r][0]),g=a.getFromId(t,e._diag[r][1]),m&&g&&m.type!==g.type){n.log("Skipping splom dimension "+r+" with conflicting axis types");continue}m?(k(m,p),g&&"category"===g.type&&(g._categories=m._categories.slice())):k(g,p),M.push(r)}for(s(t,e),n.extendFlat(x,u(e)),y=b.length*_>d?2*(x.sizeAvg||Math.max(x.size,3)):i(e,_),f=0;f<M.length;f++)p=v[r=M[f]],m=a.getFromId(t,e._diag[r][0])||{},g=a.getFromId(t,e._diag[r][1])||{},o(t,e,m,g,b[f],b[f],y);var T=c(t,e);return T.matrix||(T.matrix=!0),T.matrixOptions=x,T.selectedOptions=l(e,e.selected),T.unselectedOptions=l(e,e.unselected),[{x:!1,y:!1,t:{},trace:e}]}},{"../../constants/numerical":695,"../../lib":719,"../../plots/cartesian/axis_ids":770,"../scatter/calc":1113,"../scatter/colorscale_calc":1115,"../scattergl/constants":1162,"../scattergl/convert":1163,"./scene_update":1207}],1201:[function(t,e,r){var n=t("../../lib"),a=t("../../plots/array_container_defaults"),i=t("./attributes"),o=t("../scatter/subtypes"),s=t("../scatter/marker_defaults"),l=t("../parcoords/merge_length"),u=/-open/;function c(t,e){function r(r,a){return n.coerce(t,e,i.dimensions,r,a)}r("label");var a=r("values");a&&a.length?r("visible"):e.visible=!1,r("axis.type"),r("axis.matches")}e.exports=function(t,e,r,h){function d(r,a){return n.coerce(t,e,i,r,a)}var f=a(t,e,{name:"dimensions",handleItemDefaults:c}),p=d("diagonal.visible"),m=d("showupperhalf"),g=d("showlowerhalf");if(l(e,f,"values")&&(p||m||g)){d("text"),d("hovertext"),d("hovertemplate"),s(t,e,r,h,d);var y=u.test(e.marker.symbol),v=o.isBubble(e);d("marker.line.width",y||v?1:0),function(t,e,r,n){var a,i,o=e.dimensions,s=o.length,l=e.showupperhalf,u=e.showlowerhalf,c=e.diagonal.visible,h=new Array(s),d=new Array(s);for(a=0;a<s;a++){var f=a?a+1:"";h[a]="x"+f,d[a]="y"+f}var p=n("xaxes",h),m=n("yaxes",d),g=e._diag=new Array(s);e._xaxes={},e._yaxes={};var y=[],v=[];function _(t,n,a,i){if(t){var o=t.charAt(0),s=r._splomAxes[o];if(e["_"+o+"axes"][t]=1,i.push(t),!(t in s)){var l=s[t]={};a&&(l.label=a.label||"",a.visible&&a.axis&&(a.axis.type&&(l.type=a.axis.type),a.axis.matches&&(l.matches=n)))}}}var x=!c&&!u,b=!c&&!l;for(e._axesDim={},a=0;a<s;a++){var w=o[a],M=0===a,k=a===s-1,T=M&&x||k&&b?void 0:p[a],L=M&&b||k&&x?void 0:m[a];_(T,L,w,y),_(L,T,w,v),g[a]=[T,L],e._axesDim[T]=a,e._axesDim[L]=a}for(a=0;a<y.length;a++)for(i=0;i<v.length;i++){var A=y[a]+v[i];a>i&&l||a<i&&u?r._splomSubplots[A]=1:a!==i||!c&&u&&l||(r._splomSubplots[A]=1)}(!u||!c&&l&&u)&&(r._splomGridDflt.xside="bottom",r._splomGridDflt.yside="left")}(0,e,h,d),n.coerceSelectionMarkerOpacity(e,d)}else e.visible=!1}},{"../../lib":719,"../../plots/array_container_defaults":763,"../parcoords/merge_length":1083,"../scatter/marker_defaults":1130,"../scatter/subtypes":1135,"./attributes":1198}],1202:[function(t,e,r){var n=t("../../lib"),a=t("../scatter/colorscale_calc"),i=t("../scattergl/convert").markerStyle;e.exports=function(t,e){var r=e.trace,o=t._fullLayout._splomScenes[r.uid];if(o){a(t,r),n.extendFlat(o.matrixOptions,i(r));var s=n.extendFlat({},o.matrixOptions,o.viewOpts);o.matrix.update(s,null)}}},{"../../lib":719,"../scatter/colorscale_calc":1115,"../scattergl/convert":1163}],1203:[function(t,e,r){r.getDimIndex=function(t,e){for(var r=e._id,n={x:0,y:1}[r.charAt(0)],a=t._visibleDims,i=0;i<a.length;i++){var o=a[i];if(t._diag[o][n]===r)return i}return!1}},{}],1204:[function(t,e,r){var n=t("./helpers"),a=t("../scattergl/hover").calcHover;e.exports={hoverPoints:function(t,e,r){var i=t.cd[0].trace,o=t.scene.matrixOptions.cdata,s=t.xa,l=t.ya,u=s.c2p(e),c=l.c2p(r),h=t.distance,d=n.getDimIndex(i,s),f=n.getDimIndex(i,l);if(!1===d||!1===f)return[t];for(var p,m,g=o[d],y=o[f],v=h,_=0;_<g.length;_++){var x=g[_],b=y[_],w=s.c2p(x)-u,M=l.c2p(b)-c,k=Math.sqrt(w*w+M*M);k<v&&(v=m=k,p=_)}return t.index=p,t.distance=v,t.dxy=m,void 0===p||a(t,g,y,i),[t]}}},{"../scattergl/hover":1166,"./helpers":1203}],1205:[function(t,e,r){var n=t("../../registry"),a=t("../../components/grid");e.exports={moduleType:"trace",name:"splom",basePlotModule:t("./base_plot"),categories:["gl","regl","cartesian","symbols","showLegend","scatter-like"],attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),calc:t("./calc"),plot:t("./plot"),hoverPoints:t("./hover").hoverPoints,selectPoints:t("./select"),editStyle:t("./edit_style"),meta:{}},n.register(a)},{"../../components/grid":636,"../../registry":847,"../scatter/marker_colorbar":1129,"./attributes":1198,"./base_plot":1199,"./calc":1200,"./defaults":1201,"./edit_style":1202,"./hover":1204,"./plot":1206,"./select":1208}],1206:[function(t,e,r){var n=t("regl-splom"),a=t("../../lib"),i=t("../../plots/cartesian/axis_ids");function o(t,e){var r,o,s,l,u,c=t._fullLayout,h=c._size,d=e.trace,f=e.t,p=c._splomScenes[d.uid],m=p.matrixOptions,g=m.cdata,y=c._glcanvas.data()[0].regl,v=c.dragmode;if(0!==g.length){m.lower=d.showupperhalf,m.upper=d.showlowerhalf,m.diagonal=d.diagonal.visible;var _=d._visibleDims,x=g.length,b=p.viewOpts={};for(b.ranges=new Array(x),b.domains=new Array(x),u=0;u<_.length;u++){s=_[u];var w=b.ranges[u]=new Array(4),M=b.domains[u]=new Array(4);(r=i.getFromId(t,d._diag[s][0]))&&(w[0]=r._rl[0],w[2]=r._rl[1],M[0]=r.domain[0],M[2]=r.domain[1]),(o=i.getFromId(t,d._diag[s][1]))&&(w[1]=o._rl[0],w[3]=o._rl[1],M[1]=o.domain[0],M[3]=o.domain[1])}b.viewport=[h.l,h.b,h.w+h.l,h.h+h.b],!0===p.matrix&&(p.matrix=n(y));var k=c.clickmode.indexOf("select")>-1,T=!0;if("lasso"===v||"select"===v||d.selectedpoints||k){var L=d._length;if(d.selectedpoints){p.selectBatch=d.selectedpoints;var A=d.selectedpoints,S={};for(s=0;s<A.length;s++)S[A[s]]=!0;var E=[];for(s=0;s<L;s++)S[s]||E.push(s);p.unselectBatch=E}var C=f.xpx=new Array(x),D=f.ypx=new Array(x);for(u=0;u<_.length;u++){if(s=_[u],r=i.getFromId(t,d._diag[s][0]))for(C[u]=new Array(L),l=0;l<L;l++)C[u][l]=r.c2p(g[u][l]);if(o=i.getFromId(t,d._diag[s][1]))for(D[u]=new Array(L),l=0;l<L;l++)D[u][l]=o.c2p(g[u][l])}if(p.selectBatch.length||p.unselectBatch.length){var P=a.extendFlat({},m,p.unselectedOptions,b),O=a.extendFlat({},m,p.selectedOptions,b);p.matrix.update(P,O),T=!1}}else f.xpx=f.ypx=null;if(T){var z=a.extendFlat({},m,b);p.matrix.update(z,null)}}}e.exports=function(t,e,r){if(r.length)for(var n=0;n<r.length;n++)o(t,r[n][0])}},{"../../lib":719,"../../plots/cartesian/axis_ids":770,"regl-splom":501}],1207:[function(t,e,r){var n=t("../../lib");e.exports=function(t,e){var r=t._fullLayout,a=e.uid,i=r._splomScenes;i||(i=r._splomScenes={});var o={dirty:!0},s=i[e.uid];return s||((s=i[a]=n.extendFlat({},o,{matrix:!1,selectBatch:[],unselectBatch:[]})).draw=function(){s.matrix&&s.matrix.draw&&(s.selectBatch.length||s.unselectBatch.length?s.matrix.draw(s.unselectBatch,s.selectBatch):s.matrix.draw()),s.dirty=!1},s.destroy=function(){s.matrix&&s.matrix.destroy&&s.matrix.destroy(),s.matrixOptions=null,s.selectBatch=null,s.unselectBatch=null,s=null}),s.dirty||n.extendFlat(s,o),s}},{"../../lib":719}],1208:[function(t,e,r){var n=t("../../lib"),a=t("../scatter/subtypes"),i=t("./helpers");e.exports=function(t,e){var r=t.cd,o=r[0].trace,s=r[0].t,l=t.scene,u=l.matrixOptions.cdata,c=t.xaxis,h=t.yaxis,d=[];if(!l)return d;var f=!a.hasMarkers(o)&&!a.hasText(o);if(!0!==o.visible||f)return d;var p=i.getDimIndex(o,c),m=i.getDimIndex(o,h);if(!1===p||!1===m)return d;var g=s.xpx[p],y=s.ypx[m],v=u[p],_=u[m],x=[],b=[];if(!1!==e&&!e.degenerate)for(var w=0;w<v.length;w++)e.contains([g[w],y[w]],null,w,t)?(x.push(w),d.push({pointNumber:w,x:v[w],y:_[w]})):b.push(w);var M=l.matrixOptions;return x.length||b.length?l.selectBatch.length||l.unselectBatch.length||l.matrix.update(l.unselectedOptions,n.extendFlat({},M,l.selectedOptions,l.viewOpts)):l.matrix.update(M,null),l.selectBatch=x,l.unselectBatch=b,d}},{"../../lib":719,"../scatter/subtypes":1135,"./helpers":1203}],1209:[function(t,e,r){var n=t("../../components/colorscale/attributes"),a=t("../../components/fx/hovertemplate_attributes"),i=t("../mesh3d/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat,l={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},starts:{x:{valType:"data_array",editType:"calc"},y:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},editType:"calc"},maxdisplayed:{valType:"integer",min:0,dflt:1e3,editType:"calc"},sizeref:{valType:"number",editType:"calc",min:0,dflt:1},text:{valType:"string",dflt:"",editType:"calc"},hovertext:{valType:"string",dflt:"",editType:"calc"},hovertemplate:a({editType:"calc"},{keys:["tubex","tubey","tubez","tubeu","tubev","tubew","norm","divergence"]})};s(l,n("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"})),["opacity","lightposition","lighting"].forEach((function(t){l[t]=i[t]})),l.hoverinfo=s({},o.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","divergence","text","name"],dflt:"x+y+z+norm+text+name"}),l.transforms=void 0,e.exports=l},{"../../components/colorscale/attributes":600,"../../components/fx/hovertemplate_attributes":631,"../../lib/extend":710,"../../plots/attributes":764,"../mesh3d/attributes":1053}],1210:[function(t,e,r){var n=t("../../components/colorscale/calc");e.exports=function(t,e){var r,a,i,o,s=e.u,l=e.v,u=e.w,c=e.x,h=e.y,d=e.z,f=Math.min(c.length,h.length,d.length,s.length,l.length,u.length),p=0;e.starts&&(a=e.starts.x||[],i=e.starts.y||[],o=e.starts.z||[],p=Math.min(a.length,i.length,o.length));var m=0,g=1/0;for(r=0;r<f;r++){var y=s[r],v=l[r],_=u[r],x=Math.sqrt(y*y+v*v+_*_);m=Math.max(m,x),g=Math.min(g,x)}n(t,e,{vals:[g,m],containerStr:"",cLetter:"c"});var b=-1/0,w=1/0,M=-1/0,k=1/0,T=-1/0,L=1/0;for(r=0;r<f;r++){var A=c[r];b=Math.max(b,A),w=Math.min(w,A);var S=h[r];M=Math.max(M,S),k=Math.min(k,S);var E=d[r];T=Math.max(T,E),L=Math.min(L,E)}for(r=0;r<p;r++){var C=a[r];b=Math.max(b,C),w=Math.min(w,C);var D=i[r];M=Math.max(M,D),k=Math.min(k,D);var P=o[r];T=Math.max(T,P),L=Math.min(L,P)}e._len=f,e._slen=p,e._normMax=m,e._xbnds=[w,b],e._ybnds=[k,M],e._zbnds=[L,T]}},{"../../components/colorscale/calc":601}],1211:[function(t,e,r){var n=t("gl-streamtube3d"),a=n.createTubeMesh,i=t("../../lib"),o=t("../../lib/gl_format_color").parseColorScale,s=t("../../components/colorscale").extractOpts,l=t("../../plots/gl3d/zip3"),u={xaxis:0,yaxis:1,zaxis:2};function c(t,e){this.scene=t,this.uid=e,this.mesh=null,this.data=null}var h=c.prototype;function d(t){return i.distinctVals(t).vals}function f(t){var e=t.length;return e>2?t.slice(1,e-1):2===e?[(t[0]+t[1])/2]:t}function p(t){var e=t.length;return 1===e?[.5,.5]:[t[1]-t[0],t[e-1]-t[e-2]]}function m(t,e){var r=t.fullSceneLayout,a=t.dataScale,c=e._len,h={};function m(t,e){var n=r[e],o=a[u[e]];return i.simpleMap(t,(function(t){return n.d2l(t)*o}))}h.vectors=l(m(e.u,"xaxis"),m(e.v,"yaxis"),m(e.w,"zaxis"),c);var g=d(e.x.slice(0,c)),y=d(e.y.slice(0,c)),v=d(e.z.slice(0,c));if(g.length*y.length*v.length>c)return{positions:[],cells:[]};var _=m(g,"xaxis"),x=m(y,"yaxis"),b=m(v,"zaxis");if(h.meshgrid=[_,x,b],e.starts){var w=e._slen;h.startingPositions=l(m(e.starts.x.slice(0,w),"xaxis"),m(e.starts.y.slice(0,w),"yaxis"),m(e.starts.z.slice(0,w),"zaxis"))}else{for(var M=x[0],k=f(_),T=f(b),L=new Array(k.length*T.length),A=0,S=0;S<k.length;S++)for(var E=0;E<T.length;E++)L[A++]=[k[S],M,T[E]];h.startingPositions=L}h.colormap=o(e),h.tubeSize=e.sizeref,h.maxLength=e.maxdisplayed;var C=m(e._xbnds,"xaxis"),D=m(e._ybnds,"yaxis"),P=m(e._zbnds,"zaxis"),O=p(_),z=p(x),I=p(b),R=[[C[0]-O[0],D[0]-z[0],P[0]-I[0]],[C[1]+O[1],D[1]+z[1],P[1]+I[1]]],F=n(h,R),N=s(e);F.vertexIntensityBounds=[N.min/e._normMax,N.max/e._normMax];var Y=e.lightposition;return F.lightPosition=[Y.x,Y.y,Y.z],F.ambient=e.lighting.ambient,F.diffuse=e.lighting.diffuse,F.specular=e.lighting.specular,F.roughness=e.lighting.roughness,F.fresnel=e.lighting.fresnel,F.opacity=e.opacity,e._pad=F.tubeScale*e.sizeref*2,F}h.handlePick=function(t){var e=this.scene.fullSceneLayout,r=this.scene.dataScale;function n(t,n){var a=e[n],i=r[u[n]];return a.l2c(t)/i}if(t.object===this.mesh){var a=t.data.position,i=t.data.velocity;return t.traceCoordinate=[n(a[0],"xaxis"),n(a[1],"yaxis"),n(a[2],"zaxis"),n(i[0],"xaxis"),n(i[1],"yaxis"),n(i[2],"zaxis"),t.data.intensity*this.data._normMax,t.data.divergence],t.textLabel=this.data.hovertext||this.data.text,!0}},h.update=function(t){this.data=t;var e=m(this.scene,t);this.mesh.update(e)},h.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=function(t,e){var r=t.glplot.gl,n=m(t,e),i=a(r,n),o=new c(t,e.uid);return o.mesh=i,o.data=e,i._trace=o,t.glplot.add(i),o}},{"../../components/colorscale":605,"../../lib":719,"../../lib/gl_format_color":716,"../../plots/gl3d/zip3":818,"gl-streamtube3d":313}],1212:[function(t,e,r){var n=t("../../lib"),a=t("../../components/colorscale/defaults"),i=t("./attributes");e.exports=function(t,e,r,o){function s(r,a){return n.coerce(t,e,i,r,a)}var l=s("u"),u=s("v"),c=s("w"),h=s("x"),d=s("y"),f=s("z");l&&l.length&&u&&u.length&&c&&c.length&&h&&h.length&&d&&d.length&&f&&f.length?(s("starts.x"),s("starts.y"),s("starts.z"),s("maxdisplayed"),s("sizeref"),s("lighting.ambient"),s("lighting.diffuse"),s("lighting.specular"),s("lighting.roughness"),s("lighting.fresnel"),s("lightposition.x"),s("lightposition.y"),s("lightposition.z"),a(t,e,o,s,{prefix:"",cLetter:"c"}),s("text"),s("hovertext"),s("hovertemplate"),e._length=null):e.visible=!1}},{"../../components/colorscale/defaults":603,"../../lib":719,"./attributes":1209}],1213:[function(t,e,r){e.exports={moduleType:"trace",name:"streamtube",basePlotModule:t("../../plots/gl3d"),categories:["gl3d"],attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:{min:"cmin",max:"cmax"},calc:t("./calc"),plot:t("./convert"),eventData:function(t,e){return t.tubex=t.x,t.tubey=t.y,t.tubez=t.z,t.tubeu=e.traceCoordinate[3],t.tubev=e.traceCoordinate[4],t.tubew=e.traceCoordinate[5],t.norm=e.traceCoordinate[6],t.divergence=e.traceCoordinate[7],delete t.x,delete t.y,delete t.z,t},meta:{}}},{"../../plots/gl3d":807,"./attributes":1209,"./calc":1210,"./convert":1211,"./defaults":1212}],1214:[function(t,e,r){var n=t("../../plots/attributes"),a=t("../../components/fx/hovertemplate_attributes"),i=t("../../plots/domain").attributes,o=t("../pie/attributes"),s=t("../../lib/extend").extendFlat;e.exports={labels:{valType:"data_array",editType:"calc"},parents:{valType:"data_array",editType:"calc"},values:{valType:"data_array",editType:"calc"},branchvalues:{valType:"enumerated",values:["remainder","total"],dflt:"remainder",editType:"calc"},level:{valType:"any",editType:"plot",anim:!0},maxdepth:{valType:"integer",editType:"plot",dflt:-1},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:s({},o.marker.line.color,{dflt:null}),width:s({},o.marker.line.width,{dflt:1}),editType:"calc"},editType:"calc"},leaf:{opacity:{valType:"number",editType:"style",min:0,max:1,dflt:.7},editType:"plot"},text:o.text,textinfo:s({},o.textinfo,{editType:"plot",flags:["label","text","value"]}),textfont:o.textfont,hovertext:o.hovertext,hoverinfo:s({},n.hoverinfo,{flags:["label","text","value","name"]}),hovertemplate:a(),insidetextfont:o.insidetextfont,outsidetextfont:o.outsidetextfont,domain:i({name:"sunburst",trace:!0,editType:"calc"})}},{"../../components/fx/hovertemplate_attributes":631,"../../lib/extend":710,"../../plots/attributes":764,"../../plots/domain":792,"../pie/attributes":1086}],1215:[function(t,e,r){var n=t("../../registry"),a=t("../../plots/get_data").getModuleCalcData,i=r.name="sunburst";r.plot=function(t,e,r,o){var s=n.getModule(i),l=a(t.calcdata,s)[0];s.plot(t,l,r,o)},r.clean=function(t,e,r,n){var a=n._has&&n._has(i),o=e._has&&e._has(i);a&&!o&&n._sunburstlayer.selectAll("g.trace").remove()}},{"../../plots/get_data":802,"../../registry":847}],1216:[function(t,e,r){var n=t("d3-hierarchy"),a=t("fast-isnumeric"),i=t("../../lib"),o=t("../pie/calc").makePullColorFn,s=t("../pie/calc").generateExtendedColors,l=i.isArrayOrTypedArray,u={};r.calc=function(t,e){var r,s,u,c,h,d,f=t._fullLayout,p=e.ids,m=l(p),g=e.labels,y=e.parents,v=e.values,_=l(v),x=[],b={},w={},M=function(t){return t||"number"==typeof t},k=function(t){return!_||a(v[t])&&v[t]>=0};m?(r=Math.min(p.length,y.length),s=function(t){return M(p[t])&&k(t)},u=function(t){return String(p[t])}):(r=Math.min(g.length,y.length),s=function(t){return M(g[t])&&k(t)},u=function(t){return String(g[t])}),_&&(r=Math.min(r,v.length));for(var T=0;T<r;T++)if(s(T)){var L=u(T),A=M(y[T])?String(y[T]):"",S={i:T,id:L,pid:A,label:M(g[T])?String(g[T]):""};_&&(S.v=+v[T]),x.push(S),h=L,b[c=A]?b[c].push(h):b[c]=[h],w[h]=1}if(b[""]){if(b[""].length>1){for(var E=i.randstr(),C=0;C<x.length;C++)""===x[C].pid&&(x[C].pid=E);x.unshift({hasMultipleRoots:!0,id:E,pid:""})}}else{var D,P=[];for(D in b)w[D]||P.push(D);if(1!==P.length)return i.warn("Multiple implied roots, cannot build sunburst hierarchy.");D=P[0],x.unshift({id:D,pid:"",label:D})}try{d=n.stratify().id((function(t){return t.id})).parentId((function(t){return t.pid}))(x)}catch(t){return i.warn("Failed to build sunburst hierarchy. Error: "+t.message)}var O=n.hierarchy(d),z=!1;if(_)switch(e.branchvalues){case"remainder":O.sum((function(t){return t.data.v}));break;case"total":O.each((function(t){var e=t.data.data.v;if(t.children&&e<t.children.reduce((function(t,e){return t+e.data.data.v}),0))return z=!0,i.warn(["Total value for node",t.data.data.id,"is smaller than the sum of its children."].join(" "));t.value=e}))}else O.count();if(!z){O.sort((function(t,e){return e.value-t.value}));var I=e.marker.colors||[],R=o(f._sunburstcolormap);return O.each((function(t){var e=t.data.data,r=e.id;e.color=R(I[e.i],r)})),x[0].hierarchy=O,x}},r.crossTraceCalc=function(t){var e=t._fullLayout,r=t.calcdata,n=e.sunburstcolorway,a=e._sunburstcolormap;e.extendsunburstcolors&&(n=s(n,u));var i=0;function o(t){var e=t.data.data,r=e.id;!1===e.color&&(a[r]?e.color=a[r]:t.parent?t.parent.parent?e.color=t.parent.data.data.color:(a[r]=e.color=n[i%n.length],i++):e.color="rgba(0,0,0,0)")}for(var l=0;l<r.length;l++){var c=r[l][0];"sunburst"===c.trace.type&&c.hierarchy&&c.hierarchy.each(o)}}},{"../../lib":719,"../pie/calc":1088,"d3-hierarchy":157,"fast-isnumeric":225}],1217:[function(t,e,r){e.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear"}},{}],1218:[function(t,e,r){var n=t("../../lib"),a=t("./attributes"),i=t("../../plots/domain").defaults,o=t("../bar/defaults").handleText;e.exports=function(t,e,r,s){function l(r,i){return n.coerce(t,e,a,r,i)}var u=l("labels"),c=l("parents");if(u&&u.length&&c&&c.length){var h=l("values");h&&h.length&&l("branchvalues"),l("level"),l("maxdepth"),l("marker.line.width")&&l("marker.line.color",s.paper_bgcolor),l("marker.colors"),l("leaf.opacity");var d=l("text");l("textinfo",Array.isArray(d)?"text+label":"label"),l("hovertext"),l("hovertemplate"),o(t,e,s,l,"auto",{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),i(e,s,l),e._length=null}else e.visible=!1}},{"../../lib":719,"../../plots/domain":792,"../bar/defaults":861,"./attributes":1214}],1219:[function(t,e,r){e.exports={moduleType:"trace",name:"sunburst",basePlotModule:t("./base_plot"),categories:[],animatable:!0,attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot"),style:t("./style").style,meta:{}}},{"./attributes":1214,"./base_plot":1215,"./calc":1216,"./defaults":1218,"./layout_attributes":1220,"./layout_defaults":1221,"./plot":1222,"./style":1223}],1220:[function(t,e,r){e.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{}],1221:[function(t,e,r){var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){function r(r,i){return n.coerce(t,e,a,r,i)}r("sunburstcolorway",e.colorway),r("extendsunburstcolors")}},{"../../lib":719,"./layout_attributes":1220}],1222:[function(t,e,r){var n=t("d3"),a=t("d3-hierarchy"),i=t("../../registry"),o=t("../../components/fx"),s=t("../../components/color"),l=t("../../components/drawing"),u=t("../../lib"),c=t("../../lib/events"),h=t("../../lib/svg_text_utils"),d=t("../../lib/setcursor"),f=t("../../components/fx/helpers").appendArrayPointValue,p=t("../pie/plot").transformInsideText,m=t("../pie/helpers").formatPieValue,g=t("./style").styleOne,y=t("./constants");function v(t,e,r,i){var o=t._fullLayout,c=i&&i.duration>0,d=n.select(r).selectAll("g.slice"),f=e[0],y=f.trace,v=_(f.hierarchy,y.level),w=y.maxdepth>=0?y.maxdepth:1/0,L=o._size,A=y.domain,S=L.w*(A.x[1]-A.x[0]),E=L.h*(A.y[1]-A.y[0]),C=.5*Math.min(S,E),D=f.cx=L.l+L.w*(A.x[1]+A.x[0])/2,P=f.cy=L.t+L.h*(1-A.y[0])-E/2;if(!v)return d.remove();var O=null,z={};c&&d.each((function(t){z[M(t)]={rpx0:t.rpx0,rpx1:t.rpx1,x0:t.x0,x1:t.x1,transform:t.transform},!O&&b(t)&&(O=t)}));var I=function(t){return a.partition().size([2*Math.PI,t.height+1])(t)}(v).descendants(),R=v.height+1,F=0,N=w;f.hasMultipleRoots&&x(v)&&(I=I.slice(1),R-=1,F=1,N+=1),I=I.filter((function(t){return t.y1<=N}));var Y=Math.min(R,w),j=function(t){return(t-F)/Y*C},B=function(t,e){return[t*Math.cos(e),-t*Math.sin(e)]},H=function(t){return u.pathAnnulus(t.rpx0,t.rpx1,t.x0,t.x1,D,P)},U=function(t){return D+t.pxmid[0]*t.transform.rCenter+(t.transform.x||0)},V=function(t){return P+t.pxmid[1]*t.transform.rCenter+(t.transform.y||0)};(d=d.data(I,(function(t){return M(t)}))).enter().append("g").classed("slice",!0),c?d.exit().transition().each((function(){var t=n.select(this);t.select("path.surface").transition().attrTween("d",(function(t){var e=function(t){var e,r=M(t),a=z[r],i=z[M(v)];if(i){var o=t.x1>i.x1?2*Math.PI:0;e=t.rpx1<i.rpx1?{rpx0:0,rpx1:0}:{x0:o,x1:o}}else{var s,l=M(t.parent);d.each((function(t){if(M(t)===l)return s=t}));var u,c=s.children;c.forEach((function(t,e){if(M(t)===r)return u=e}));var h=c.length,f=n.interpolate(s.x0,s.x1);e={rpx0:C,rpx1:C,x0:f(u/h),x1:f((u+1)/h)}}return n.interpolate(a,e)}(t);return function(t){return H(e(t))}})),t.select("g.slicetext").attr("opacity",0)})).remove():d.exit().remove(),d.order();var W=null;if(c&&O){var G=M(O);d.each((function(t){null===W&&M(t)===G&&(W=t.x1)}))}var q=d;function Z(t){var e=t.parent,r=z[M(e)],a={};if(r){var i=e.children,o=i.indexOf(t),s=i.length,l=n.interpolate(r.x0,r.x1);a.x0=l(o/s),a.x1=l(o/s)}else a.x0=a.x1=0;return a}c&&(q=q.transition().each("end",(function(){k(n.select(this),0,{isTransitioning:!1})}))),q.each((function(r){var a=n.select(this),i=u.ensureSingle(a,"path","surface",(function(t){t.style("pointer-events","all")}));r.rpx0=j(r.y0),r.rpx1=j(r.y1),r.xmid=(r.x0+r.x1)/2,r.pxmid=B(r.rpx1,r.xmid),r.midangle=-(r.xmid-Math.PI/2),r.halfangle=.5*Math.min(u.angleDelta(r.x0,r.x1)||Math.PI,Math.PI),r.ring=1-r.rpx0/r.rpx1,r.rInscribed=function(t){return 0===t.rpx0&&u.isFullCircle([t.x0,t.x1])?1:Math.max(0,Math.min(1/(1+1/Math.sin(t.halfangle)),t.ring/2))}(r),c?i.transition().attrTween("d",(function(t){var e=function(t){var e,r=z[M(t)],a={x0:t.x0,x1:t.x1,rpx0:t.rpx0,rpx1:t.rpx1};if(r)e=r;else if(O)if(t.parent)if(W){var i=t.x1>W?2*Math.PI:0;e={x0:i,x1:i}}else e={rpx0:C,rpx1:C},u.extendFlat(e,Z(t));else e={rpx0:0,rpx1:0};else e={x0:0,x1:0};return n.interpolate(e,a)}(t);return function(t){return H(e(t))}})):i.attr("d",H),a.call(T,t,e).call(k,t,{isTransitioning:t._transitioning}),i.call(g,r,y);var d=u.ensureSingle(a,"g","slicetext"),v=u.ensureSingle(d,"text","",(function(t){t.attr("data-notex",1)}));v.text(function(t,e,r){var n=e.textinfo;if(!n||"none"===n)return"";var a=t.data.data,i=r.separators,o=n.split("+"),s=function(t){return-1!==o.indexOf(t)},l=[];if(s("label")&&a.label&&l.push(a.label),a.hasOwnProperty("v")&&s("value")&&l.push(m(a.v,i)),s("text")){var c=u.castOption(e,a.i,"text");u.isValidTextValue(c)&&l.push(c)}return l.join("<br>")}(r,y,o)).classed("slicetext",!0).attr("text-anchor","middle").call(l.font,x(r)?function(t,e,r){var n=e.data.data.i;return{color:u.castOption(t,n,"outsidetextfont.color")||u.castOption(t,n,"textfont.color")||r.color,family:u.castOption(t,n,"outsidetextfont.family")||u.castOption(t,n,"textfont.family")||r.family,size:u.castOption(t,n,"outsidetextfont.size")||u.castOption(t,n,"textfont.size")||r.size}}(y,r,o.font):function(t,e,r){var n=e.data.data,a=n.i,i=u.castOption(t,a,"insidetextfont.color");!i&&t._input.textfont&&(i=u.castOption(t._input,a,"textfont.color"));var o=u.castOption(t,a,"insidetextfont.family")||u.castOption(t,a,"textfont.family")||r.family,l=u.castOption(t,a,"insidetextfont.size")||u.castOption(t,a,"textfont.size")||r.size;return{color:i||s.contrast(n.color),family:o,size:l}}(y,r,o.font)).call(h.convertToTspans,t);var _=l.bBox(v.node());r.transform=p(_,r,f),r.translateX=U(r),r.translateY=V(r);var b=function(t,e){return"translate("+t.translateX+","+t.translateY+")"+(t.transform.scale<1?"scale("+t.transform.scale+")":"")+(t.transform.rotate?"rotate("+t.transform.rotate+")":"")+"translate("+-(e.left+e.right)/2+","+-(e.top+e.bottom)/2+")"};c?v.transition().attrTween("transform",(function(t){var e=function(t){var e,r=z[M(t)],a=t.transform;if(r)e=r;else if(e={rpx1:t.rpx1,transform:{scale:0,rotate:a.rotate,rCenter:a.rCenter,x:a.x,y:a.y}},O)if(t.parent)if(W){var i=t.x1>W?2*Math.PI:0;e.x0=e.x1=i}else u.extendFlat(e,Z(t));else e.x0=e.x1=0;else e.x0=e.x1=0;var o=n.interpolate(e.rpx1,t.rpx1),s=n.interpolate(e.x0,t.x0),l=n.interpolate(e.x1,t.x1),c=n.interpolate(e.transform.scale,a.scale),h=n.interpolate(e.transform.rotate,a.rotate),d=0===a.rCenter?3:0===e.transform.rCenter?1/3:1,f=n.interpolate(e.transform.rCenter,a.rCenter);return function(t){var e=o(t),r=s(t),n=l(t),i=function(t){return f(Math.pow(t,d))}(t),u={pxmid:B(e,(r+n)/2),transform:{rCenter:i,x:a.x,y:a.y}};return{rpx1:o(t),translateX:U(u),translateY:V(u),transform:{scale:c(t),rotate:h(t),rCenter:i}}}}(t);return function(t){return b(e(t),_)}})):v.attr("transform",b(r,_))}))}function _(t,e){var r;return e&&t.eachAfter((function(t){if(M(t)===e)return r=t.copy()})),r||t}function x(t){return""===t.data.data.pid}function b(t){return!t.parent}function w(t){return!t.children}function M(t){return t.data.data.id}function k(t,e,r){var n=t.datum(),a=(r||{}).isTransitioning;d(t,a||w(n)||x(n)?null:"pointer")}function T(t,e,r){var a=r[0],s=a.trace;"_hasHoverLabel"in s||(s._hasHoverLabel=!1),"_hasHoverEvent"in s||(s._hasHoverEvent=!1),t.on("mouseover",(function(t){var r=e._fullLayout;if(!e._dragging&&!1!==r.hovermode){var i=e._fullData[s.index],l=t.data.data,c=l.i,h=function(t){return u.castOption(i,c,t)},d=h("hovertemplate"),f=o.castHoverinfo(i,r,c),p=r.separators;if(d||f&&"none"!==f&&"skip"!==f){var g=t.rInscribed,y=a.cx+t.pxmid[0]*(1-g),v=a.cy+t.pxmid[1]*(1-g),_={},x=[],b=[],w=function(t){return-1!==x.indexOf(t)};if(f&&(x="all"===f?i._module.attributes.hoverinfo.flags:f.split("+")),_.label=l.label,w("label")&&_.label&&b.push(_.label),l.hasOwnProperty("v")&&(_.value=l.v,_.valueLabel=m(_.value,p),w("value")&&b.push(_.valueLabel)),_.text=h("hovertext")||h("text"),w("text")){var M=_.text;u.isValidTextValue(M)&&b.push(M)}o.loneHover({trace:i,x0:y-g*t.rpx1,x1:y+g*t.rpx1,y:v,idealAlign:t.pxmid[0]<0?"left":"right",text:b.join("<br>"),name:d||w("name")?i.name:void 0,color:h("hoverlabel.bgcolor")||l.color,borderColor:h("hoverlabel.bordercolor"),fontFamily:h("hoverlabel.font.family"),fontSize:h("hoverlabel.font.size"),fontColor:h("hoverlabel.font.color"),nameLength:h("hoverlabel.namelength"),textAlign:h("hoverlabel.align"),hovertemplate:d,hovertemplateLabels:_,eventData:[L(t,i)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:e}),s._hasHoverLabel=!0}s._hasHoverEvent=!0,e.emit("plotly_hover",{points:[L(t,i)],event:n.event})}})),t.on("mouseout",(function(t){var r=e._fullLayout,a=e._fullData[s.index],i=n.select(this).datum();s._hasHoverEvent&&(t.originalEvent=n.event,e.emit("plotly_unhover",{points:[L(i,a)],event:n.event}),s._hasHoverEvent=!1),s._hasHoverLabel&&(o.loneUnhover(r._hoverlayer.node()),s._hasHoverLabel=!1)})),t.on("click",(function(t){var r=e._fullLayout,l=e._fullData[s.index];if(!1===c.triggerHandler(e,"plotly_sunburstclick",{points:[L(t,l)],event:n.event})||w(t)||x(t))r.hovermode&&(e._hoverdata=[L(t,l)],o.click(e,n.event));else if(!e._dragging&&!e._transitioning){i.call("_storeDirectGUIEdit",l,r._tracePreGUI[l.uid],{level:l.level});var u=a.hierarchy,h=M(t),d=b(t)?function(t,e){var r;return t.eachAfter((function(t){for(var n=t.children||[],a=0;a<n.length;a++)if(M(n[a])===e)return r=t.copy()})),r||t}(u,h):_(u,h),f={data:[{level:M(d)}],traces:[s.index]},p={frame:{redraw:!1,duration:y.CLICK_TRANSITION_TIME},transition:{duration:y.CLICK_TRANSITION_TIME,easing:y.CLICK_TRANSITION_EASING},mode:"immediate",fromcurrent:!0};o.loneUnhover(r._hoverlayer.node()),i.call("animate",e,f,p)}}))}function L(t,e){var r=t.data.data,n={curveNumber:e.index,pointNumber:r.i,data:e._input,fullData:e};return f(n,e,r.i),n}e.exports=function(t,e,r,a){var i,o,s=t._fullLayout._sunburstlayer,l=!r,u=r&&r.duration>0;(i=s.selectAll("g.trace.sunburst").data(e,(function(t){return t[0].trace.uid}))).enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),i.order(),u?(a&&(o=a()),n.transition().duration(r.duration).ease(r.easing).each("end",(function(){o&&o()})).each("interrupt",(function(){o&&o()})).each((function(){s.selectAll("g.trace").each((function(e){v(t,e,this,r)}))}))):i.each((function(e){v(t,e,this,r)})),l&&i.exit().remove()}},{"../../components/color":593,"../../components/drawing":614,"../../components/fx":632,"../../components/fx/helpers":628,"../../lib":719,"../../lib/events":709,"../../lib/setcursor":739,"../../lib/svg_text_utils":743,"../../registry":847,"../pie/helpers":1091,"../pie/plot":1095,"./constants":1217,"./style":1223,d3:163,"d3-hierarchy":157}],1223:[function(t,e,r){var n=t("d3"),a=t("../../components/color"),i=t("../../lib");function o(t,e,r){var n=e.data.data,o=!e.children,s=n.i,l=i.castOption(r,s,"marker.line.color")||a.defaultLine,u=i.castOption(r,s,"marker.line.width")||0;t.style("stroke-width",u).call(a.fill,n.color).call(a.stroke,l).style("opacity",o?r.leaf.opacity:null)}e.exports={style:function(t){t._fullLayout._sunburstlayer.selectAll(".trace").each((function(t){var e=n.select(this),r=t[0].trace;e.style("opacity",r.opacity),e.selectAll("path.surface").each((function(t){n.select(this).call(o,t,r)}))}))},styleOne:o}},{"../../components/color":593,"../../lib":719,d3:163}],1224:[function(t,e,r){var n=t("../../components/color"),a=t("../../components/colorscale/attributes"),i=t("../../components/fx/hovertemplate_attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat,l=t("../../plot_api/edit_types").overrideAll;function u(t){return{show:{valType:"boolean",dflt:!1},start:{valType:"number",dflt:null,editType:"plot"},end:{valType:"number",dflt:null,editType:"plot"},size:{valType:"number",dflt:null,min:0,editType:"plot"},project:{x:{valType:"boolean",dflt:!1},y:{valType:"boolean",dflt:!1},z:{valType:"boolean",dflt:!1}},color:{valType:"color",dflt:n.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:n.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var c=e.exports=l(s({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:i(),connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},surfacecolor:{valType:"data_array"}},a("",{colorAttr:"z or surfacecolor",showScaleDflt:!0,autoColorDflt:!1,editTypeOverride:"calc"}),{contours:{x:u(),y:u(),z:u()},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:s({},a.zauto,{}),zmin:s({},a.zmin,{}),zmax:s({},a.zmax,{})},hoverinfo:s({},o.hoverinfo)}),"calc","nested");c.x.editType=c.y.editType=c.z.editType="calc+clearAxisTypes",c.transforms=void 0},{"../../components/color":593,"../../components/colorscale/attributes":600,"../../components/fx/hovertemplate_attributes":631,"../../lib/extend":710,"../../plot_api/edit_types":750,"../../plots/attributes":764}],1225:[function(t,e,r){var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.surfacecolor?n(t,e,{vals:e.surfacecolor,containerStr:"",cLetter:"c"}):n(t,e,{vals:e.z,containerStr:"",cLetter:"c"})}},{"../../components/colorscale/calc":601}],1226:[function(t,e,r){var n=t("gl-surface3d"),a=t("ndarray"),i=t("ndarray-homography"),o=t("ndarray-fill"),s=t("../../lib").isArrayOrTypedArray,l=t("../../lib/gl_format_color").parseColorScale,u=t("../../lib/str2rgbarray"),c=t("../../components/colorscale").extractOpts,h=t("../heatmap/interp2d"),d=t("../heatmap/find_empties");function f(t,e,r){this.scene=t,this.uid=r,this.surface=e,this.data=null,this.showContour=[!1,!1,!1],this.contourStart=[null,null,null],this.contourEnd=[null,null,null],this.contourSize=[0,0,0],this.minValues=[1/0,1/0,1/0],this.maxValues=[-1/0,-1/0,-1/0],this.dataScaleX=1,this.dataScaleY=1,this.refineData=!0,this.objectOffset=[0,0,0]}var p=f.prototype;p.getXat=function(t,e,r,n){var a=s(this.data.x)?s(this.data.x[0])?this.data.x[e][t]:this.data.x[t]:t;return void 0===r?a:n.d2l(a,0,r)},p.getYat=function(t,e,r,n){var a=s(this.data.y)?s(this.data.y[0])?this.data.y[e][t]:this.data.y[e]:e;return void 0===r?a:n.d2l(a,0,r)},p.getZat=function(t,e,r,n){var a=this.data.z[e][t];return null===a&&this.data.connectgaps&&this.data._interpolatedZ&&(a=this.data._interpolatedZ[e][t]),void 0===r?a:n.d2l(a,0,r)},p.handlePick=function(t){if(t.object===this.surface){var e=(t.data.index[0]-1)/this.dataScaleX-1,r=(t.data.index[1]-1)/this.dataScaleY-1,n=Math.max(Math.min(Math.round(e),this.data.z[0].length-1),0),a=Math.max(Math.min(Math.round(r),this.data._ylength-1),0);t.index=[n,a],t.traceCoordinate=[this.getXat(n,a),this.getYat(n,a),this.getZat(n,a)],t.dataCoordinate=[this.getXat(n,a,this.data.xcalendar,this.scene.fullSceneLayout.xaxis),this.getYat(n,a,this.data.ycalendar,this.scene.fullSceneLayout.yaxis),this.getZat(n,a,this.data.zcalendar,this.scene.fullSceneLayout.zaxis)];for(var i=0;i<3;i++)null!=t.dataCoordinate[i]&&(t.dataCoordinate[i]*=this.scene.dataScale[i]);var o=this.data.hovertext||this.data.text;return Array.isArray(o)&&o[a]&&void 0!==o[a][n]?t.textLabel=o[a][n]:t.textLabel=o||"",t.data.dataCoordinate=t.dataCoordinate.slice(),this.surface.highlight(t.data),this.scene.glplot.spikes.position=t.dataCoordinate,!0}};var m=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499,1511,1523,1531,1543,1549,1553,1559,1567,1571,1579,1583,1597,1601,1607,1609,1613,1619,1621,1627,1637,1657,1663,1667,1669,1693,1697,1699,1709,1721,1723,1733,1741,1747,1753,1759,1777,1783,1787,1789,1801,1811,1823,1831,1847,1861,1867,1871,1873,1877,1879,1889,1901,1907,1913,1931,1933,1949,1951,1973,1979,1987,1993,1997,1999,2003,2011,2017,2027,2029,2039,2053,2063,2069,2081,2083,2087,2089,2099,2111,2113,2129,2131,2137,2141,2143,2153,2161,2179,2203,2207,2213,2221,2237,2239,2243,2251,2267,2269,2273,2281,2287,2293,2297,2309,2311,2333,2339,2341,2347,2351,2357,2371,2377,2381,2383,2389,2393,2399,2411,2417,2423,2437,2441,2447,2459,2467,2473,2477,2503,2521,2531,2539,2543,2549,2551,2557,2579,2591,2593,2609,2617,2621,2633,2647,2657,2659,2663,2671,2677,2683,2687,2689,2693,2699,2707,2711,2713,2719,2729,2731,2741,2749,2753,2767,2777,2789,2791,2797,2801,2803,2819,2833,2837,2843,2851,2857,2861,2879,2887,2897,2903,2909,2917,2927,2939,2953,2957,2963,2969,2971,2999];function g(t,e){if(t<e)return 0;for(var r=0;0===Math.floor(t%e);)t/=e,r++;return r}function y(t){for(var e=[],r=0;r<m.length;r++){var n=m[r];e.push(g(t,n))}return e}function v(t){for(var e=y(t),r=t,n=0;n<m.length;n++)if(e[n]>0){r=m[n];break}return r}function _(t,e){if(!(t<1||e<1)){for(var r=y(t),n=y(e),a=1,i=0;i<m.length;i++)a*=Math.pow(m[i],Math.max(r[i],n[i]));return a}}p.calcXnums=function(t){var e,r=[];for(e=1;e<t;e++){var n=this.getXat(e-1,0),a=this.getXat(e,0);r[e-1]=a!==n&&null!=n&&null!=a?Math.abs(a-n):0}var i=0;for(e=1;e<t;e++)i+=r[e-1];for(e=1;e<t;e++)0===r[e-1]?r[e-1]=1:r[e-1]=Math.round(i/r[e-1]);return r},p.calcYnums=function(t){var e,r=[];for(e=1;e<t;e++){var n=this.getYat(0,e-1),a=this.getYat(0,e);r[e-1]=a!==n&&null!=n&&null!=a?Math.abs(a-n):0}var i=0;for(e=1;e<t;e++)i+=r[e-1];for(e=1;e<t;e++)0===r[e-1]?r[e-1]=1:r[e-1]=Math.round(i/r[e-1]);return r};var x=[1,2,4,6,12,24,36,48,60,120,180,240,360,720,840,1260],b=x[9],w=x[13];function M(t,e){for(var r=!1,n=0;n<t.length;n++)if(e===t[n]){r=!0;break}!1===r&&t.push(e)}p.estimateScale=function(t,e){for(var r=1+function(t){if(0!==t.length){for(var e=1,r=0;r<t.length;r++)e=_(e,t[r]);return e}}(0===e?this.calcXnums(t):this.calcYnums(t));r<b;)r*=2;for(;r>w;)r--,r/=v(r),++r<b&&(r=w);var n=Math.round(r/t);return n>1?n:1},p.refineCoords=function(t){for(var e=this.dataScaleX,r=this.dataScaleY,n=t[0].shape[0],o=t[0].shape[1],s=0|Math.floor(t[0].shape[0]*e+1),l=0|Math.floor(t[0].shape[1]*r+1),u=1+n+1,c=1+o+1,h=a(new Float32Array(u*c),[u,c]),d=0;d<t.length;++d){this.surface.padField(h,t[d]);var f=a(new Float32Array(s*l),[s,l]);i(f,h,[e,0,0,0,r,0,0,0,1]),t[d]=f}},p.setContourLevels=function(){var t,e,r,n=[[],[],[]],a=[!1,!1,!1],i=!1;for(t=0;t<3;++t)if(this.showContour[t]&&(i=!0,this.contourSize[t]>0&&null!==this.contourStart[t]&&null!==this.contourEnd[t]&&this.contourEnd[t]>this.contourStart[t]))for(a[t]=!0,e=this.contourStart[t];e<this.contourEnd[t];e+=this.contourSize[t])r=e*this.scene.dataScale[t],M(n[t],r);if(i){var o=[[],[],[]];for(t=0;t<3;++t)this.showContour[t]&&(o[t]=a[t]?n[t]:this.scene.contourLevels[t]);this.surface.update({levels:o})}},p.update=function(t){var e,r,n,i,s=this.scene,f=s.fullSceneLayout,p=this.surface,m=t.opacity,g=l(t,m),y=s.dataScale,v=t.z[0].length,_=t._ylength,x=s.contourLevels;this.data=t;var b=[];for(e=0;e<3;e++)for(b[e]=[],r=0;r<v;r++)b[e][r]=[];for(r=0;r<v;r++)for(n=0;n<_;n++)b[0][r][n]=this.getXat(r,n,t.xcalendar,f.xaxis),b[1][r][n]=this.getYat(r,n,t.ycalendar,f.yaxis),b[2][r][n]=this.getZat(r,n,t.zcalendar,f.zaxis);if(t.connectgaps)for(t._emptypoints=d(b[2]),h(b[2],t._emptypoints),t._interpolatedZ=[],r=0;r<v;r++)for(t._interpolatedZ[r]=[],n=0;n<_;n++)t._interpolatedZ[r][n]=b[2][r][n];for(e=0;e<3;e++)for(r=0;r<v;r++)for(n=0;n<_;n++)null==(i=b[e][r][n])?b[e][r][n]=NaN:i=b[e][r][n]*=y[e];for(e=0;e<3;e++)for(r=0;r<v;r++)for(n=0;n<_;n++)null!=(i=b[e][r][n])&&(this.minValues[e]>i&&(this.minValues[e]=i),this.maxValues[e]<i&&(this.maxValues[e]=i));for(e=0;e<3;e++)this.objectOffset[e]=.5*(this.minValues[e]+this.maxValues[e]);for(e=0;e<3;e++)for(r=0;r<v;r++)for(n=0;n<_;n++)null!=(i=b[e][r][n])&&(b[e][r][n]-=this.objectOffset[e]);var M=[a(new Float32Array(v*_),[v,_]),a(new Float32Array(v*_),[v,_]),a(new Float32Array(v*_),[v,_])];o(M[0],(function(t,e){return b[0][t][e]})),o(M[1],(function(t,e){return b[1][t][e]})),o(M[2],(function(t,e){return b[2][t][e]})),b=[];var k={colormap:g,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},T=c(t);if(k.intensityBounds=[T.min,T.max],t.surfacecolor){var L=a(new Float32Array(v*_),[v,_]);o(L,(function(e,r){return t.surfacecolor[r][e]})),M.push(L)}else k.intensityBounds[0]*=y[2],k.intensityBounds[1]*=y[2];(w<M[0].shape[0]||w<M[0].shape[1])&&(this.refineData=!1),!0===this.refineData&&(this.dataScaleX=this.estimateScale(M[0].shape[0],0),this.dataScaleY=this.estimateScale(M[0].shape[1],1),1===this.dataScaleX&&1===this.dataScaleY||this.refineCoords(M)),t.surfacecolor&&(k.intensity=M.pop());var A=[!0,!0,!0],S=["x","y","z"];for(e=0;e<3;++e){var E=t.contours[S[e]];A[e]=E.highlight,k.showContour[e]=E.show||E.highlight,k.showContour[e]&&(k.contourProject[e]=[E.project.x,E.project.y,E.project.z],E.show?(this.showContour[e]=!0,k.levels[e]=x[e],p.highlightColor[e]=k.contourColor[e]=u(E.color),E.usecolormap?p.highlightTint[e]=k.contourTint[e]=0:p.highlightTint[e]=k.contourTint[e]=1,k.contourWidth[e]=E.width,this.contourStart[e]=E.start,this.contourEnd[e]=E.end,this.contourSize[e]=E.size):(this.showContour[e]=!1,this.contourStart[e]=null,this.contourEnd[e]=null,this.contourSize[e]=0),E.highlight&&(k.dynamicColor[e]=u(E.highlightcolor),k.dynamicWidth[e]=E.highlightwidth))}(function(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]})(g)&&(k.vertexColor=!0),k.objectOffset=this.objectOffset,k.coords=M,p.update(k),p.visible=t.visible,p.enableDynamic=A,p.enableHighlight=A,p.snapToData=!0,"lighting"in t&&(p.ambientLight=t.lighting.ambient,p.diffuseLight=t.lighting.diffuse,p.specularLight=t.lighting.specular,p.roughness=t.lighting.roughness,p.fresnel=t.lighting.fresnel),"lightposition"in t&&(p.lightPosition=[t.lightposition.x,t.lightposition.y,t.lightposition.z]),m&&m<1&&(p.supportsTransparency=!0)},p.dispose=function(){this.scene.glplot.remove(this.surface),this.surface.dispose()},e.exports=function(t,e){var r=t.glplot.gl,a=n({gl:r}),i=new f(t,a,e.uid);return a._trace=i,i.update(e),t.glplot.add(a),i}},{"../../components/colorscale":605,"../../lib":719,"../../lib/gl_format_color":716,"../../lib/str2rgbarray":742,"../heatmap/find_empties":1007,"../heatmap/interp2d":1010,"gl-surface3d":316,ndarray:450,"ndarray-fill":440,"ndarray-homography":442}],1227:[function(t,e,r){var n=t("../../registry"),a=t("../../lib"),i=t("../../components/colorscale/defaults"),o=t("./attributes");function s(t,e,r){e in t&&!(r in t)&&(t[r]=t[e])}e.exports=function(t,e,r,l){var u,c;function h(r,n){return a.coerce(t,e,o,r,n)}var d=h("x"),f=h("y"),p=h("z");if(!p||!p.length||d&&d.length<1||f&&f.length<1)e.visible=!1;else{e._xlength=Array.isArray(d)&&a.isArrayOrTypedArray(d[0])?p.length:p[0].length,e._ylength=p.length,n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],l),h("text"),h("hovertext"),h("hovertemplate"),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lightposition.x","lightposition.y","lightposition.z","hidesurface","connectgaps","opacity"].forEach((function(t){h(t)}));var m=h("surfacecolor"),g=["x","y","z"];for(u=0;u<3;++u){var y="contours."+g[u],v=h(y+".show"),_=h(y+".highlight");if(v||_)for(c=0;c<3;++c)h(y+".project."+g[c]);v&&(h(y+".color"),h(y+".width"),h(y+".usecolormap")),_&&(h(y+".highlightcolor"),h(y+".highlightwidth")),h(y+".start"),h(y+".end"),h(y+".size")}m||(s(t,"zmin","cmin"),s(t,"zmax","cmax"),s(t,"zauto","cauto")),i(t,e,l,h,{prefix:"",cLetter:"c"}),e._length=null}}},{"../../components/colorscale/defaults":603,"../../lib":719,"../../registry":847,"./attributes":1224}],1228:[function(t,e,r){e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:{min:"cmin",max:"cmax"},calc:t("./calc"),plot:t("./convert"),moduleType:"trace",name:"surface",basePlotModule:t("../../plots/gl3d"),categories:["gl3d","2dMap","noOpacity"],meta:{}}},{"../../plots/gl3d":807,"./attributes":1224,"./calc":1225,"./convert":1226,"./defaults":1227}],1229:[function(t,e,r){var n=t("../../components/annotations/attributes"),a=t("../../lib/extend").extendFlat,i=t("../../plot_api/edit_types").overrideAll,o=t("../../plots/font_attributes"),s=t("../../plots/domain").attributes;t("../../constants/docs").FORMAT_LINK,(e.exports=i({domain:s({name:"table",trace:!0}),columnwidth:{valType:"number",arrayOk:!0,dflt:null},columnorder:{valType:"data_array"},header:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[]},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:28},align:a({},n.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:a({},o({arrayOk:!0}))},cells:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[]},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:20},align:a({},n.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:a({},o({arrayOk:!0}))}},"calc","from-root")).transforms=void 0},{"../../components/annotations/attributes":576,"../../constants/docs":690,"../../lib/extend":710,"../../plot_api/edit_types":750,"../../plots/domain":792,"../../plots/font_attributes":793}],1230:[function(t,e,r){var n=t("../../plots/get_data").getModuleCalcData,a=t("./plot");r.name="table",r.plot=function(t){var e=n(t.calcdata,"table")[0];e.length&&a(t,e)},r.clean=function(t,e,r,n){var a=n._has&&n._has("table"),i=e._has&&e._has("table");a&&!i&&n._paperdiv.selectAll(".table").remove()}},{"../../plots/get_data":802,"./plot":1237}],1231:[function(t,e,r){var n=t("../../lib/gup").wrap;e.exports=function(){return n({})}},{"../../lib/gup":717}],1232:[function(t,e,r){e.exports={cellPad:8,columnExtentOffset:10,columnTitleOffset:28,emptyHeaderHeight:16,latexCheck:/^\$.*\$$/,goldenRatio:1.618,lineBreaker:"<br>",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}},{}],1233:[function(t,e,r){var n=t("./constants"),a=t("../../lib/extend").extendFlat,i=t("fast-isnumeric");function o(t){if(Array.isArray(t)){for(var e=0,r=0;r<t.length;r++)e=Math.max(e,o(t[r]));return e}return t}function s(t,e){return t+e}function l(t){var e,r=t.slice(),n=1/0,a=0;for(e=0;e<r.length;e++)Array.isArray(r[e])||(r[e]=[r[e]]),n=Math.min(n,r[e].length),a=Math.max(a,r[e].length);if(n!==a)for(e=0;e<r.length;e++){var i=a-r[e].length;i&&(r[e]=r[e].concat(u(i)))}return r}function u(t){for(var e=new Array(t),r=0;r<t;r++)e[r]="";return e}function c(t){return t.calcdata.columns.reduce((function(e,r){return r.xIndex<t.xIndex?e+r.columnWidth:e}),0)}function h(t,e){return Object.keys(t).map((function(r){return a({},t[r],{auxiliaryBlocks:e})}))}function d(t,e){for(var r,n={},a=0,i=0,o={firstRowIndex:null,lastRowIndex:null,rows:[]},s=0,l=0,u=0;u<t.length;u++)r=t[u],o.rows.push({rowIndex:u,rowHeight:r}),((i+=r)>=e||u===t.length-1)&&(n[a]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=u,o={firstRowIndex:null,lastRowIndex:null,rows:[]},a+=i,s=u+1,i=0);return n}e.exports=function(t,e){var r=l(e.cells.values),f=function(t){return t.slice(e.header.values.length,t.length)},p=l(e.header.values);p.length&&!p[0].length&&(p[0]=[""],p=l(p));var m=p.concat(f(r).map((function(){return u((p[0]||[""]).length)}))),g=e.domain,y=Math.floor(t._fullLayout._size.w*(g.x[1]-g.x[0])),v=Math.floor(t._fullLayout._size.h*(g.y[1]-g.y[0])),_=e.header.values.length?m[0].map((function(){return e.header.height})):[n.emptyHeaderHeight],x=r.length?r[0].map((function(){return e.cells.height})):[],b=_.reduce(s,0),w=d(x,v-b+n.uplift),M=h(d(_,b),[]),k=h(w,M),T={},L=e._fullInput.columnorder.concat(f(r.map((function(t,e){return e})))),A=m.map((function(t,r){var n=Array.isArray(e.columnwidth)?e.columnwidth[Math.min(r,e.columnwidth.length-1)]:e.columnwidth;return i(n)?Number(n):1})),S=A.reduce(s,0);A=A.map((function(t){return t/S*y}));var E=Math.max(o(e.header.line.width),o(e.cells.line.width)),C={key:e.uid+t._context.staticPlot,translateX:g.x[0]*t._fullLayout._size.w,translateY:t._fullLayout._size.h*(1-g.y[1]),size:t._fullLayout._size,width:y,maxLineWidth:E,height:v,columnOrder:L,groupHeight:v,rowBlocks:k,headerRowBlocks:M,scrollY:0,cells:a({},e.cells,{values:r}),headerCells:a({},e.header,{values:m}),gdColumns:m.map((function(t){return t[0]})),gdColumnsOriginalOrder:m.map((function(t){return t[0]})),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:m.map((function(t,e){var r=T[t];return T[t]=(r||0)+1,{key:t+"__"+T[t],label:t,specIndex:e,xIndex:L[e],xScale:c,x:void 0,calcdata:void 0,columnWidth:A[e]}}))};return C.columns.forEach((function(t){t.calcdata=C,t.x=c(t)})),C}},{"../../lib/extend":710,"./constants":1232,"fast-isnumeric":225}],1234:[function(t,e,r){var n=t("../../lib/extend").extendFlat;r.splitToPanels=function(t){var e=[0,0],r=n({},t,{key:"header",type:"header",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!0,values:t.calcdata.headerCells.values[t.specIndex],rowBlocks:t.calcdata.headerRowBlocks,calcdata:n({},t.calcdata,{cells:t.calcdata.headerCells})});return[n({},t,{key:"cells1",type:"cells",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),n({},t,{key:"cells2",type:"cells",page:1,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),r]},r.splitToCells=function(t){var e=function(t){var e=t.rowBlocks[t.page],r=e?e.rows[0].rowIndex:0;return[r,e?r+e.rows.length:0]}(t);return(t.values||[]).slice(e[0],e[1]).map((function(r,n){return{keyWithinBlock:n+("string"==typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:e[0]+n,column:t,calcdata:t.calcdata,page:t.page,rowBlocks:t.rowBlocks,value:r}}))}},{"../../lib/extend":710}],1235:[function(t,e,r){var n=t("../../lib"),a=t("./attributes"),i=t("../../plots/domain").defaults;e.exports=function(t,e,r,o){function s(r,i){return n.coerce(t,e,a,r,i)}i(e,o,s),s("columnwidth"),s("header.values"),s("header.format"),s("header.align"),s("header.prefix"),s("header.suffix"),s("header.height"),s("header.line.width"),s("header.line.color"),s("header.fill.color"),n.coerceFont(s,"header.font",n.extendFlat({},o.font)),function(t,e){for(var r=t.columnorder||[],n=t.header.values.length,a=r.slice(0,n),i=a.slice().sort((function(t,e){return t-e})),o=a.map((function(t){return i.indexOf(t)})),s=o.length;s<n;s++)o.push(s);e("columnorder",o)}(e,s),s("cells.values"),s("cells.format"),s("cells.align"),s("cells.prefix"),s("cells.suffix"),s("cells.height"),s("cells.line.width"),s("cells.line.color"),s("cells.fill.color"),n.coerceFont(s,"cells.font",n.extendFlat({},o.font)),e._length=null}},{"../../lib":719,"../../plots/domain":792,"./attributes":1229}],1236:[function(t,e,r){e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),moduleType:"trace",name:"table",basePlotModule:t("./base_plot"),categories:["noOpacity"],meta:{}}},{"./attributes":1229,"./base_plot":1230,"./calc":1231,"./defaults":1235,"./plot":1237}],1237:[function(t,e,r){var n=t("./constants"),a=t("d3"),i=t("../../lib/gup"),o=t("../../components/drawing"),s=t("../../lib/svg_text_utils"),l=t("../../lib").raiseToTop,u=t("../../lib").cancelTransition,c=t("./data_preparation_helper"),h=t("./data_split_helpers"),d=t("../../components/color");function f(t){return Math.ceil(t.calcdata.maxLineWidth/2)}function p(t,e){return"clip"+t._fullLayout._uid+"_scrollAreaBottomClip_"+e.key}function m(t,e){return"clip"+t._fullLayout._uid+"_columnBoundaryClippath_"+e.calcdata.key+"_"+e.specIndex}function g(t){return[].concat.apply([],t.map((function(t){return t}))).map((function(t){return t.__data__}))}function y(t,e,r){var o=t.selectAll("."+n.cn.scrollbarKit).data(i.repeat,i.keyFun);o.enter().append("g").classed(n.cn.scrollbarKit,!0).style("shape-rendering","geometricPrecision"),o.each((function(t){var e=t.scrollbarState;e.totalHeight=function(t){var e=t.rowBlocks;return O(e,e.length-1)+(e.length?z(e[e.length-1],1/0):1)}(t),e.scrollableAreaHeight=t.groupHeight-T(t),e.currentlyVisibleHeight=Math.min(e.totalHeight,e.scrollableAreaHeight),e.ratio=e.currentlyVisibleHeight/e.totalHeight,e.barLength=Math.max(e.ratio*e.currentlyVisibleHeight,n.goldenRatio*n.scrollbarWidth),e.barWiggleRoom=e.currentlyVisibleHeight-e.barLength,e.wiggleRoom=Math.max(0,e.totalHeight-e.scrollableAreaHeight),e.topY=0===e.barWiggleRoom?0:t.scrollY/e.wiggleRoom*e.barWiggleRoom,e.bottomY=e.topY+e.barLength,e.dragMultiplier=e.wiggleRoom/e.barWiggleRoom})).attr("transform",(function(t){return"translate("+(t.width+n.scrollbarWidth/2+n.scrollbarOffset)+" "+T(t)+")"}));var s=o.selectAll("."+n.cn.scrollbar).data(i.repeat,i.keyFun);s.enter().append("g").classed(n.cn.scrollbar,!0);var l=s.selectAll("."+n.cn.scrollbarSlider).data(i.repeat,i.keyFun);l.enter().append("g").classed(n.cn.scrollbarSlider,!0),l.attr("transform",(function(t){return"translate(0 "+(t.scrollbarState.topY||0)+")"}));var u=l.selectAll("."+n.cn.scrollbarGlyph).data(i.repeat,i.keyFun);u.enter().append("line").classed(n.cn.scrollbarGlyph,!0).attr("stroke","black").attr("stroke-width",n.scrollbarWidth).attr("stroke-linecap","round").attr("y1",n.scrollbarWidth/2),u.attr("y2",(function(t){return t.scrollbarState.barLength-n.scrollbarWidth/2})).attr("stroke-opacity",(function(t){return t.columnDragInProgress||!t.scrollbarState.barWiggleRoom||r?0:.4})),u.transition().delay(0).duration(0),u.transition().delay(n.scrollbarHideDelay).duration(n.scrollbarHideDuration).attr("stroke-opacity",0);var c=s.selectAll("."+n.cn.scrollbarCaptureZone).data(i.repeat,i.keyFun);c.enter().append("line").classed(n.cn.scrollbarCaptureZone,!0).attr("stroke","white").attr("stroke-opacity",.01).attr("stroke-width",n.scrollbarCaptureWidth).attr("stroke-linecap","butt").attr("y1",0).on("mousedown",(function(r){var n=a.event.y,i=this.getBoundingClientRect(),o=r.scrollbarState,s=n-i.top,l=a.scale.linear().domain([0,o.scrollableAreaHeight]).range([0,o.totalHeight]).clamp(!0);o.topY<=s&&s<=o.bottomY||A(e,t,null,l(s-o.barLength/2))(r)})).call(a.behavior.drag().origin((function(t){return a.event.stopPropagation(),t.scrollbarState.scrollbarScrollInProgress=!0,t})).on("drag",A(e,t)).on("dragend",(function(){}))),c.attr("y2",(function(t){return t.scrollbarState.scrollableAreaHeight})),e._context.staticPlot&&(u.remove(),c.remove())}function v(t,e,r,s){var l=function(t){var e=t.selectAll("."+n.cn.columnCell).data(h.splitToCells,(function(t){return t.keyWithinBlock}));return e.enter().append("g").classed(n.cn.columnCell,!0),e.exit().remove(),e}(function(t){var e=t.selectAll("."+n.cn.columnCells).data(i.repeat,i.keyFun);return e.enter().append("g").classed(n.cn.columnCells,!0),e.exit().remove(),e}(r));!function(t){t.each((function(t,e){var r=t.calcdata.cells.font,n=t.column.specIndex,a={size:b(r.size,n,e),color:b(r.color,n,e),family:b(r.family,n,e)};t.rowNumber=t.key,t.align=b(t.calcdata.cells.align,n,e),t.cellBorderWidth=b(t.calcdata.cells.line.width,n,e),t.font=a}))}(l),function(t){t.attr("width",(function(t){return t.column.columnWidth})).attr("stroke-width",(function(t){return t.cellBorderWidth})).each((function(t){var e=a.select(this);d.stroke(e,b(t.calcdata.cells.line.color,t.column.specIndex,t.rowNumber)),d.fill(e,b(t.calcdata.cells.fill.color,t.column.specIndex,t.rowNumber))}))}(function(t){var e=t.selectAll("."+n.cn.cellRect).data(i.repeat,(function(t){return t.keyWithinBlock}));return e.enter().append("rect").classed(n.cn.cellRect,!0),e}(l));var u=function(t){var e=t.selectAll("."+n.cn.cellText).data(i.repeat,(function(t){return t.keyWithinBlock}));return e.enter().append("text").classed(n.cn.cellText,!0).style("cursor",(function(){return"auto"})).on("mousedown",(function(){a.event.stopPropagation()})),e}(function(t){var e=t.selectAll("."+n.cn.cellTextHolder).data(i.repeat,(function(t){return t.keyWithinBlock}));return e.enter().append("g").classed(n.cn.cellTextHolder,!0).style("shape-rendering","geometricPrecision"),e}(l));!function(t){t.each((function(t){o.font(a.select(this),t.font)}))}(u),_(u,e,s,t),P(l)}function _(t,e,r,i){t.text((function(t){var e=t.column.specIndex,r=t.rowNumber,i=t.value,o="string"==typeof i,s=o&&i.match(/<br>/i),l=!o||s;t.mayHaveMarkup=o&&i.match(/[<&>]/);var u,c="string"==typeof(u=i)&&u.match(n.latexCheck);t.latex=c;var h,d,f=c?"":b(t.calcdata.cells.prefix,e,r)||"",p=c?"":b(t.calcdata.cells.suffix,e,r)||"",m=c?null:b(t.calcdata.cells.format,e,r)||null,g=f+(m?a.format(m)(t.value):t.value)+p;if(t.wrappingNeeded=!t.wrapped&&!l&&!c&&(h=x(g)),t.cellHeightMayIncrease=s||c||t.mayHaveMarkup||(void 0===h?x(g):h),t.needsConvertToTspans=t.mayHaveMarkup||t.wrappingNeeded||t.latex,t.wrappingNeeded){var y=(" "===n.wrapSplitCharacter?g.replace(/<a href=/gi,"<a_href="):g).split(n.wrapSplitCharacter),v=" "===n.wrapSplitCharacter?y.map((function(t){return t.replace(/<a_href=/gi,"<a href=")})):y;t.fragments=v.map((function(t){return{text:t,width:null}})),t.fragments.push({fragment:n.wrapSpacer,width:null}),d=v.join(n.lineBreaker)+n.lineBreaker+n.wrapSpacer}else delete t.fragments,d=g;return d})).attr("dy",(function(t){return t.needsConvertToTspans?0:"0.75em"})).each((function(t){var o=a.select(this),l=t.wrappingNeeded?E:C;t.needsConvertToTspans?s.convertToTspans(o,i,l(r,this,e,i,t)):a.select(this.parentNode).attr("transform",(function(t){return"translate("+D(t)+" "+n.cellPad+")"})).attr("text-anchor",(function(t){return{left:"start",center:"middle",right:"end"}[t.align]}))}))}function x(t){return-1!==t.indexOf(n.wrapSplitCharacter)}function b(t,e,r){if(Array.isArray(t)){var n=t[Math.min(e,t.length-1)];return Array.isArray(n)?n[Math.min(r,n.length-1)]:n}return t}function w(t,e,r){t.transition().ease(n.releaseTransitionEase).duration(n.releaseTransitionDuration).attr("transform","translate("+e.x+" "+r+")")}function M(t){return"cells"===t.type}function k(t){return"header"===t.type}function T(t){return(t.rowBlocks.length?t.rowBlocks[0].auxiliaryBlocks:[]).reduce((function(t,e){return t+z(e,1/0)}),0)}function L(t,e,r){var n=g(e)[0];if(void 0!==n){var a=n.rowBlocks,i=n.calcdata,o=O(a,a.length),s=n.calcdata.groupHeight-T(n),l=i.scrollY=Math.max(0,Math.min(o-s,i.scrollY)),u=function(t,e,r){for(var n=[],a=0,i=0;i<t.length;i++){for(var o=t[i],s=o.rows,l=0,u=0;u<s.length;u++)l+=s[u].rowHeight;o.allRowsHeight=l,e<a+l&&e+r>a&&n.push(i),a+=l}return n}(a,l,s);1===u.length&&(u[0]===a.length-1?u.unshift(u[0]-1):u.push(u[0]+1)),u[0]%2&&u.reverse(),e.each((function(t,e){t.page=u[e],t.scrollY=l})),e.attr("transform",(function(t){return"translate(0 "+(O(t.rowBlocks,t.page)-t.scrollY)+")"})),t&&(S(t,r,e,u,n.prevPages,n,0),S(t,r,e,u,n.prevPages,n,1),y(r,t))}}function A(t,e,r,i){return function(o){var s=o.calcdata?o.calcdata:o,l=e.filter((function(t){return s.key===t.key})),u=r||s.scrollbarState.dragMultiplier,c=s.scrollY;s.scrollY=void 0===i?s.scrollY+u*a.event.dy:i;var h=l.selectAll("."+n.cn.yColumn).selectAll("."+n.cn.columnBlock).filter(M);return L(t,h,l),s.scrollY===c}}function S(t,e,r,n,a,i,o){n[o]!==a[o]&&(clearTimeout(i.currentRepaint[o]),i.currentRepaint[o]=setTimeout((function(){var i=r.filter((function(t,e){return e===o&&n[e]!==a[e]}));v(t,e,i,r),a[o]=n[o]})))}function E(t,e,r,i){return function(){var o=a.select(e.parentNode);o.each((function(t){var e=t.fragments;o.selectAll("tspan.line").each((function(t,r){e[r].width=this.getComputedTextLength()}));var r,a,i=e[e.length-1].width,s=e.slice(0,-1),l=[],u=0,c=t.column.columnWidth-2*n.cellPad;for(t.value="";s.length;)u+(a=(r=s.shift()).width+i)>c&&(t.value+=l.join(n.wrapSpacer)+n.lineBreaker,l=[],u=0),l.push(r.text),u+=a;u&&(t.value+=l.join(n.wrapSpacer)),t.wrapped=!0})),o.selectAll("tspan.line").remove(),_(o.select("."+n.cn.cellText),r,t,i),a.select(e.parentNode.parentNode).call(P)}}function C(t,e,r,i,o){return function(){if(!o.settledY){var s=a.select(e.parentNode),l=R(o),u=o.key-l.firstRowIndex,c=l.rows[u].rowHeight,h=o.cellHeightMayIncrease?e.parentNode.getBoundingClientRect().height+2*n.cellPad:c,d=Math.max(h,c);d-l.rows[u].rowHeight&&(l.rows[u].rowHeight=d,t.selectAll("."+n.cn.columnCell).call(P),L(null,t.filter(M),0),y(r,i,!0)),s.attr("transform",(function(){var t=this.parentNode.getBoundingClientRect(),e=a.select(this.parentNode).select("."+n.cn.cellRect).node().getBoundingClientRect(),r=this.transform.baseVal.consolidate(),i=e.top-t.top+(r?r.matrix.f:n.cellPad);return"translate("+D(o,a.select(this.parentNode).select("."+n.cn.cellTextHolder).node().getBoundingClientRect().width)+" "+i+")"})),o.settledY=!0}}}function D(t,e){switch(t.align){case"left":default:return n.cellPad;case"right":return t.column.columnWidth-(e||0)-n.cellPad;case"center":return(t.column.columnWidth-(e||0))/2}}function P(t){t.attr("transform",(function(t){var e=t.rowBlocks[0].auxiliaryBlocks.reduce((function(t,e){return t+z(e,1/0)}),0);return"translate(0 "+(z(R(t),t.key)+e)+")"})).selectAll("."+n.cn.cellRect).attr("height",(function(t){return(e=R(t),r=t.key,e.rows[r-e.firstRowIndex]).rowHeight;var e,r}))}function O(t,e){for(var r=0,n=e-1;n>=0;n--)r+=I(t[n]);return r}function z(t,e){for(var r=0,n=0;n<t.rows.length&&t.rows[n].rowIndex<e;n++)r+=t.rows[n].rowHeight;return r}function I(t){var e=t.allRowsHeight;if(void 0!==e)return e;for(var r=0,n=0;n<t.rows.length;n++)r+=t.rows[n].rowHeight;return t.allRowsHeight=r,r}function R(t){return t.rowBlocks[t.page]}e.exports=function(t,e){var r=!t._context.staticPlot,s=t._fullLayout._paper.selectAll("."+n.cn.table).data(e.map((function(e){var r=i.unwrap(e).trace;return c(t,r)})),i.keyFun);s.exit().remove(),s.enter().append("g").classed(n.cn.table,!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","all"),s.attr("width",(function(t){return t.width+t.size.l+t.size.r})).attr("height",(function(t){return t.height+t.size.t+t.size.b})).attr("transform",(function(t){return"translate("+t.translateX+","+t.translateY+")"}));var d=s.selectAll("."+n.cn.tableControlView).data(i.repeat,i.keyFun),_=d.enter().append("g").classed(n.cn.tableControlView,!0).style("box-sizing","content-box");r&&_.on("mousemove",(function(e){d.filter((function(t){return e===t})).call(y,t)})).on("mousewheel",(function(e){if(!e.scrollbarState.wheeling){e.scrollbarState.wheeling=!0;var r=e.scrollY+a.event.deltaY;A(t,d,null,r)(e)||(a.event.stopPropagation(),a.event.preventDefault()),e.scrollbarState.wheeling=!1}})).call(y,t,!0),d.attr("transform",(function(t){return"translate("+t.size.l+" "+t.size.t+")"}));var x=d.selectAll("."+n.cn.scrollBackground).data(i.repeat,i.keyFun);x.enter().append("rect").classed(n.cn.scrollBackground,!0).attr("fill","none"),x.attr("width",(function(t){return t.width})).attr("height",(function(t){return t.height})),d.each((function(e){o.setClipUrl(a.select(this),p(t,e),t)}));var b=d.selectAll("."+n.cn.yColumn).data((function(t){return t.columns}),i.keyFun);b.enter().append("g").classed(n.cn.yColumn,!0),b.exit().remove(),b.attr("transform",(function(t){return"translate("+t.x+" 0)"})),r&&b.call(a.behavior.drag().origin((function(e){return w(a.select(this),e,-n.uplift),l(this),e.calcdata.columnDragInProgress=!0,y(d.filter((function(t){return e.calcdata.key===t.key})),t),e})).on("drag",(function(t){var e=a.select(this),r=function(e){return(t===e?a.event.x:e.x)+e.columnWidth/2};t.x=Math.max(-n.overdrag,Math.min(t.calcdata.width+n.overdrag-t.columnWidth,a.event.x)),g(b).filter((function(e){return e.calcdata.key===t.calcdata.key})).sort((function(t,e){return r(t)-r(e)})).forEach((function(e,r){e.xIndex=r,e.x=t===e?e.x:e.xScale(e)})),b.filter((function(e){return t!==e})).transition().ease(n.transitionEase).duration(n.transitionDuration).attr("transform",(function(t){return"translate("+t.x+" 0)"})),e.call(u).attr("transform","translate("+t.x+" -"+n.uplift+" )")})).on("dragend",(function(e){var r=a.select(this),n=e.calcdata;e.x=e.xScale(e),e.calcdata.columnDragInProgress=!1,w(r,e,0),function(t,e,r){var n=e.gdColumnsOriginalOrder;e.gdColumns.sort((function(t,e){return r[n.indexOf(t)]-r[n.indexOf(e)]})),e.columnorder=r,t.emit("plotly_restyle")}(t,n,n.columns.map((function(t){return t.xIndex})))}))),b.each((function(e){o.setClipUrl(a.select(this),m(t,e),t)}));var T=b.selectAll("."+n.cn.columnBlock).data(h.splitToPanels,i.keyFun);T.enter().append("g").classed(n.cn.columnBlock,!0).attr("id",(function(t){return t.key})),T.style("cursor",(function(t){return t.dragHandle?"ew-resize":t.calcdata.scrollbarState.barWiggleRoom?"ns-resize":"default"}));var S=T.filter(k),E=T.filter(M);r&&E.call(a.behavior.drag().origin((function(t){return a.event.stopPropagation(),t})).on("drag",A(t,d,-1)).on("dragend",(function(){}))),v(t,d,S,T),v(t,d,E,T);var C=d.selectAll("."+n.cn.scrollAreaClip).data(i.repeat,i.keyFun);C.enter().append("clipPath").classed(n.cn.scrollAreaClip,!0).attr("id",(function(e){return p(t,e)}));var D=C.selectAll("."+n.cn.scrollAreaClipRect).data(i.repeat,i.keyFun);D.enter().append("rect").classed(n.cn.scrollAreaClipRect,!0).attr("x",-n.overdrag).attr("y",-n.uplift).attr("fill","none"),D.attr("width",(function(t){return t.width+2*n.overdrag})).attr("height",(function(t){return t.height+n.uplift})),b.selectAll("."+n.cn.columnBoundary).data(i.repeat,i.keyFun).enter().append("g").classed(n.cn.columnBoundary,!0);var P=b.selectAll("."+n.cn.columnBoundaryClippath).data(i.repeat,i.keyFun);P.enter().append("clipPath").classed(n.cn.columnBoundaryClippath,!0),P.attr("id",(function(e){return m(t,e)}));var O=P.selectAll("."+n.cn.columnBoundaryRect).data(i.repeat,i.keyFun);O.enter().append("rect").classed(n.cn.columnBoundaryRect,!0).attr("fill","none"),O.attr("width",(function(t){return t.columnWidth+2*f(t)})).attr("height",(function(t){return t.calcdata.height+2*f(t)+n.uplift})).attr("x",(function(t){return-f(t)})).attr("y",(function(t){return-f(t)})),L(null,E,d)}},{"../../components/color":593,"../../components/drawing":614,"../../lib":719,"../../lib/gup":717,"../../lib/svg_text_utils":743,"./constants":1232,"./data_preparation_helper":1233,"./data_split_helpers":1234,d3:163}],1238:[function(t,e,r){var n=t("../box/attributes"),a=t("../../lib/extend").extendFlat;e.exports={y:n.y,x:n.x,x0:n.x0,y0:n.y0,name:a({},n.name,{}),orientation:a({},n.orientation,{}),bandwidth:{valType:"number",min:0,editType:"calc"},scalegroup:{valType:"string",dflt:"",editType:"calc"},scalemode:{valType:"enumerated",values:["width","count"],dflt:"width",editType:"calc"},spanmode:{valType:"enumerated",values:["soft","hard","manual"],dflt:"soft",editType:"calc"},span:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor,points:a({},n.boxpoints,{}),jitter:a({},n.jitter,{}),pointpos:a({},n.pointpos,{}),width:a({},n.width,{}),marker:n.marker,text:n.text,hovertext:n.hovertext,hovertemplate:n.hovertemplate,box:{visible:{valType:"boolean",dflt:!1,editType:"plot"},width:{valType:"number",min:0,max:1,dflt:.25,editType:"plot"},fillcolor:{valType:"color",editType:"style"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"style"},editType:"plot"},meanline:{visible:{valType:"boolean",dflt:!1,editType:"plot"},color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"plot"},side:{valType:"enumerated",values:["both","positive","negative"],dflt:"both",editType:"calc"},offsetgroup:n.offsetgroup,alignmentgroup:n.alignmentgroup,selected:n.selected,unselected:n.unselected,hoveron:{valType:"flaglist",flags:["violins","points","kde"],dflt:"violins+points+kde",extras:["all"],editType:"style"}}},{"../../lib/extend":710,"../box/attributes":880}],1239:[function(t,e,r){var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../box/calc"),o=t("./helpers"),s=t("../../constants/numerical").BADNUM;function l(t,e,r){var a=e.max-e.min;if(!a)return t.bandwidth?t.bandwidth:0;if(t.bandwidth)return Math.max(t.bandwidth,a/1e4);var i=r.length,o=n.stdev(r,i-1,e.mean);return Math.max(function(t,e,r){return 1.059*Math.min(e,r/1.349)*Math.pow(t,-.2)}(i,o,e.q3-e.q1),a/100)}function u(t,e,r,n){var i,o=t.spanmode,l=t.span||[],u=[e.min,e.max],c=[e.min-2*n,e.max+2*n];function h(n){var a=l[n],i="multicategory"===r.type?r.r2c(a):r.d2c(a,0,t[e.valLetter+"calendar"]);return i===s?c[n]:i}var d={type:"linear",range:i="soft"===o?c:"hard"===o?u:[h(0),h(1)]};return a.setConvert(d),d.cleanRange(),i}e.exports=function(t,e){var r=i(t,e);if(r[0].t.empty)return r;for(var s=t._fullLayout,c=a.getFromId(t,e["h"===e.orientation?"xaxis":"yaxis"]),h=1/0,d=-1/0,f=0,p=0,m=0;m<r.length;m++){var g=r[m],y=g.pts.map(o.extractVal),v=g.bandwidth=l(e,g,y),_=g.span=u(e,g,c,v);if(g.min===g.max&&0===v)_=g.span=[g.min,g.max],g.density=[{v:1,t:_[0]}],g.bandwidth=v,f=Math.max(f,1);else{var x=_[1]-_[0],b=Math.ceil(x/(v/3)),w=x/b;if(!isFinite(w)||!isFinite(b))return n.error("Something went wrong with computing the violin span"),r[0].t.empty=!0,r;var M=o.makeKDE(g,e,y);g.density=new Array(b);for(var k=0,T=_[0];T<_[1]+w/2;k++,T+=w){var L=M(T);g.density[k]={v:L,t:T},f=Math.max(f,L)}}p=Math.max(p,y.length),h=Math.min(h,_[0]),d=Math.max(d,_[1])}var A=a.findExtremes(c,[h,d],{padded:!0});if(e._extremes[c._id]=A,e.width)r[0].t.maxKDE=f;else{var S=s._violinScaleGroupStats,E=e.scalegroup,C=S[E];C?(C.maxKDE=Math.max(C.maxKDE,f),C.maxCount=Math.max(C.maxCount,p)):S[E]={maxKDE:f,maxCount:p}}return r[0].t.labels.kde=n._(t,"kde:"),r}},{"../../constants/numerical":695,"../../lib":719,"../../plots/cartesian/axes":767,"../box/calc":881,"./helpers":1242}],1240:[function(t,e,r){var n=t("../box/cross_trace_calc").setPositionOffset,a=["v","h"];e.exports=function(t,e){for(var r=t.calcdata,i=e.xaxis,o=e.yaxis,s=0;s<a.length;s++){for(var l=a[s],u="h"===l?o:i,c=[],h=0;h<r.length;h++){var d=r[h],f=d[0].t,p=d[0].trace;!0!==p.visible||"violin"!==p.type||f.empty||p.orientation!==l||p.xaxis!==i._id||p.yaxis!==o._id||c.push(h)}n("violin",t,c,u)}}},{"../box/cross_trace_calc":882}],1241:[function(t,e,r){var n=t("../../lib"),a=t("../../components/color"),i=t("../box/defaults"),o=t("./attributes");e.exports=function(t,e,r,s){function l(r,a){return n.coerce(t,e,o,r,a)}function u(r,a){return n.coerce2(t,e,o,r,a)}if(i.handleSampleDefaults(t,e,l,s),!1!==e.visible){l("bandwidth"),l("side"),l("width")||(l("scalegroup",e.name),l("scalemode"));var c,h=l("span");Array.isArray(h)&&(c="manual"),l("spanmode",c);var d=l("line.color",(t.marker||{}).color||r),f=l("line.width"),p=l("fillcolor",a.addOpacity(e.line.color,.5));i.handlePointsDefaults(t,e,l,{prefix:""});var m=u("box.width"),g=u("box.fillcolor",p),y=u("box.line.color",d),v=u("box.line.width",f);l("box.visible",Boolean(m||g||y||v))||(e.box={visible:!1});var _=u("meanline.color",d),x=u("meanline.width",f);l("meanline.visible",Boolean(_||x))||(e.meanline={visible:!1})}}},{"../../components/color":593,"../../lib":719,"../box/defaults":883,"./attributes":1238}],1242:[function(t,e,r){var n=t("../../lib"),a=function(t){return 1/Math.sqrt(2*Math.PI)*Math.exp(-.5*t*t)};r.makeKDE=function(t,e,r){var n=r.length,i=a,o=t.bandwidth,s=1/(n*o);return function(t){for(var e=0,a=0;a<n;a++)e+=i((t-r[a])/o);return s*e}},r.getPositionOnKdePath=function(t,e,r){var a,i;"h"===e.orientation?(a="y",i="x"):(a="x",i="y");var o=n.findPointOnPath(t.path,r,i,{pathLength:t.pathLength}),s=t.posCenterPx,l=o[a];return[l,"both"===e.side?2*s-l:s]},r.getKdeValue=function(t,e,n){var a=t.pts.map(r.extractVal);return r.makeKDE(t,e,a)(n)/t.posDensityScale},r.extractVal=function(t){return t.v}},{"../../lib":719}],1243:[function(t,e,r){var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../box/hover"),o=t("./helpers");e.exports=function(t,e,r,s,l){var u,c,h=t.cd,d=h[0].trace,f=d.hoveron,p=-1!==f.indexOf("violins"),m=-1!==f.indexOf("kde"),g=[];if(p||m){var y=i.hoverOnBoxes(t,e,r,s);if(m&&y.length>0){var v,_,x,b,w,M=t.xa,k=t.ya;"h"===d.orientation?(w=e,v="y",x=k,_="x",b=M):(w=r,v="x",x=M,_="y",b=k);var T=h[t.index];if(w>=T.span[0]&&w<=T.span[1]){var L=n.extendFlat({},t),A=b.c2p(w,!0),S=o.getKdeValue(T,d,w),E=o.getPositionOnKdePath(T,d,A),C=x._offset,D=x._length;L[v+"0"]=E[0],L[v+"1"]=E[1],L[_+"0"]=L[_+"1"]=A,L[_+"Label"]=_+": "+a.hoverLabelText(b,w)+", "+h[0].t.labels.kde+" "+S.toFixed(3),L.spikeDistance=y[0].spikeDistance;var P=v+"Spike";L[P]=y[0][P],y[0].spikeDistance=void 0,y[0][P]=void 0,L.hovertemplate=!1,g.push(L),(c={stroke:t.color})[v+"1"]=n.constrain(C+E[0],C,C+D),c[v+"2"]=n.constrain(C+E[1],C,C+D),c[_+"1"]=c[_+"2"]=b._offset+A}}p&&(g=g.concat(y))}-1!==f.indexOf("points")&&(u=i.hoverOnPoints(t,e,r));var O=l.selectAll(".violinline-"+d.uid).data(c?[0]:[]);return O.enter().append("line").classed("violinline-"+d.uid,!0).attr("stroke-width",1.5),O.exit().remove(),O.attr(c),"closest"===s?u?[u]:g:u?(g.push(u),g):g}},{"../../lib":719,"../../plots/cartesian/axes":767,"../box/hover":885,"./helpers":1242}],1244:[function(t,e,r){e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("../box/defaults").crossTraceDefaults,supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),crossTraceCalc:t("./cross_trace_calc"),plot:t("./plot"),style:t("./style"),styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../box/select"),moduleType:"trace",name:"violin",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","violinLayout","zoomScale"],meta:{}}},{"../../plots/cartesian":778,"../box/defaults":883,"../box/select":890,"../scatter/style":1134,"./attributes":1238,"./calc":1239,"./cross_trace_calc":1240,"./defaults":1241,"./hover":1243,"./layout_attributes":1245,"./layout_defaults":1246,"./plot":1247,"./style":1248}],1245:[function(t,e,r){var n=t("../box/layout_attributes"),a=t("../../lib").extendFlat;e.exports={violinmode:a({},n.boxmode,{}),violingap:a({},n.boxgap,{}),violingroupgap:a({},n.boxgroupgap,{})}},{"../../lib":719,"../box/layout_attributes":887}],1246:[function(t,e,r){var n=t("../../lib"),a=t("./layout_attributes"),i=t("../box/layout_defaults");e.exports=function(t,e,r){i._supply(t,e,r,(function(r,i){return n.coerce(t,e,a,r,i)}),"violin")}},{"../../lib":719,"../box/layout_defaults":888,"./layout_attributes":1245}],1247:[function(t,e,r){var n=t("d3"),a=t("../../lib"),i=t("../../components/drawing"),o=t("../box/plot"),s=t("../scatter/line_points"),l=t("./helpers");e.exports=function(t,e,r,u){var c=t._fullLayout,h=e.xaxis,d=e.yaxis;function f(t){var e=s(t,{xaxis:h,yaxis:d,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0});return i.smoothopen(e[0],1)}a.makeTraceGroups(u,r,"trace violins").each((function(t){var r=n.select(this),i=t[0],s=i.t,u=i.trace;if(!0!==u.visible||s.empty)r.remove();else{var p=s.bPos,m=s.bdPos,g=e[s.valLetter+"axis"],y=e[s.posLetter+"axis"],v="both"===u.side,_=v||"positive"===u.side,x=v||"negative"===u.side,b=r.selectAll("path.violin").data(a.identity);b.enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","violin"),b.exit().remove(),b.each((function(t){var e,r,a,i,o,l,h,d,b=n.select(this),w=t.density,M=w.length,k=t.pos+p,T=y.c2p(k);if(u.width)e=s.maxKDE/m;else{var L=c._violinScaleGroupStats[u.scalegroup];e="count"===u.scalemode?L.maxKDE/m*(L.maxCount/t.pts.length):L.maxKDE/m}if(_){for(h=new Array(M),o=0;o<M;o++)(d=h[o]={})[s.posLetter]=k+w[o].v/e,d[s.valLetter]=w[o].t;r=f(h)}if(x){for(h=new Array(M),l=0,o=M-1;l<M;l++,o--)(d=h[l]={})[s.posLetter]=k-w[o].v/e,d[s.valLetter]=w[o].t;a=f(h)}if(v)i=r+"L"+a.substr(1)+"Z";else{var A=[T,g.c2p(w[0].t)],S=[T,g.c2p(w[M-1].t)];"h"===u.orientation&&(A.reverse(),S.reverse()),i=_?"M"+A+"L"+r.substr(1)+"L"+S:"M"+S+"L"+a.substr(1)+"L"+A}b.attr("d",i),t.posCenterPx=T,t.posDensityScale=e*m,t.path=b.node(),t.pathLength=t.path.getTotalLength()/(v?2:1)}));var w,M,k,T=u.box,L=T.width,A=(T.line||{}).width;v?(w=m*L,M=0):_?(w=[0,m*L/2],M=-A):(w=[m*L/2,0],M=A),o.plotBoxAndWhiskers(r,{pos:y,val:g},u,{bPos:p,bdPos:w,bPosPxOffset:M}),o.plotBoxMean(r,{pos:y,val:g},u,{bPos:p,bdPos:w,bPosPxOffset:M}),!u.box.visible&&u.meanline.visible&&(k=a.identity);var S=r.selectAll("path.meanline").data(k||[]);S.enter().append("path").attr("class","meanline").style("fill","none").style("vector-effect","non-scaling-stroke"),S.exit().remove(),S.each((function(t){var e=g.c2p(t.mean,!0),r=l.getPositionOnKdePath(t,u,e);n.select(this).attr("d","h"===u.orientation?"M"+e+","+r[0]+"V"+r[1]:"M"+r[0]+","+e+"H"+r[1])})),o.plotPoints(r,{x:h,y:d},u,s)}}))}},{"../../components/drawing":614,"../../lib":719,"../box/plot":889,"../scatter/line_points":1125,"./helpers":1242,d3:163}],1248:[function(t,e,r){var n=t("d3"),a=t("../../components/color"),i=t("../scatter/style").stylePoints;e.exports=function(t){var e=n.select(t).selectAll("g.trace.violins");e.style("opacity",(function(t){return t[0].trace.opacity})),e.each((function(e){var r=e[0].trace,o=n.select(this),s=r.box||{},l=s.line||{},u=r.meanline||{},c=u.width;o.selectAll("path.violin").style("stroke-width",r.line.width+"px").call(a.stroke,r.line.color).call(a.fill,r.fillcolor),o.selectAll("path.box").style("stroke-width",l.width+"px").call(a.stroke,l.color).call(a.fill,s.fillcolor);var h={"stroke-width":c+"px","stroke-dasharray":2*c+"px,"+c+"px"};o.selectAll("path.mean").style(h).call(a.stroke,u.color),o.selectAll("path.meanline").style(h).call(a.stroke,u.color),i(o,r,t)}))}},{"../../components/color":593,"../scatter/style":1134,d3:163}],1249:[function(t,e,r){var n=t("../../components/colorscale/attributes"),a=t("../isosurface/attributes"),i=t("../../plots/attributes"),o=t("../../lib/extend").extendFlat,s=t("../../plot_api/edit_types").overrideAll,l=e.exports=s(o({x:a.x,y:a.y,z:a.z,value:a.value,isomin:a.isomin,isomax:a.isomax,surface:a.surface,spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:1}},slices:a.slices,caps:a.caps,text:a.text,hovertext:a.hovertext,hovertemplate:a.hovertemplate},n("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{colorbar:a.colorbar,opacity:a.opacity,opacityscale:{valType:"any",editType:"calc"},lightposition:a.lightposition,lighting:a.lighting,flatshading:a.flatshading,contour:a.contour,hoverinfo:o({},i.hoverinfo)}),"calc","nested");l.x.editType=l.y.editType=l.z.editType=l.value.editType="calc+clearAxisTypes",l.transforms=void 0},{"../../components/colorscale/attributes":600,"../../lib/extend":710,"../../plot_api/edit_types":750,"../../plots/attributes":764,"../isosurface/attributes":1048}],1250:[function(t,e,r){var n=t("gl-mesh3d"),a=t("../../lib/gl_format_color").parseColorScale,i=t("../../lib/str2rgbarray"),o=t("../../components/colorscale").extractOpts,s=t("../../plots/gl3d/zip3"),l=t("../isosurface/convert").findNearestOnAxis,u=t("../isosurface/convert").generateIsoMeshes;function c(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.data=null,this.showContour=!1}var h=c.prototype;h.handlePick=function(t){if(t.object===this.mesh){var e=t.data.index,r=this.data._x[e],n=this.data._y[e],a=this.data._z[e],i=this.data._Ys.length,o=this.data._Zs.length,s=l(r,this.data._Xs).id,u=l(n,this.data._Ys).id,c=l(a,this.data._Zs).id,h=t.index=c+o*u+o*i*s;t.traceCoordinate=[this.data._x[h],this.data._y[h],this.data._z[h],this.data.value[h]];var d=this.data.hovertext||this.data.text;return Array.isArray(d)&&void 0!==d[h]?t.textLabel=d[h]:d&&(t.textLabel=d),!0}},h.update=function(t){var e=this.scene,r=e.fullSceneLayout;function n(t,e,r,n){return e.map((function(e){return t.d2l(e,0,n)*r}))}this.data=u(t);var l={positions:s(n(r.xaxis,t._x,e.dataScale[0],t.xcalendar),n(r.yaxis,t._y,e.dataScale[1],t.ycalendar),n(r.zaxis,t._z,e.dataScale[2],t.zcalendar)),cells:s(t._i,t._j,t._k),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,opacityscale:t.opacityscale,contourEnable:t.contour.show,contourColor:i(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading},c=o(t);l.vertexIntensity=t._intensity,l.vertexIntensityBounds=[c.min,c.max],l.colormap=a(t),this.mesh.update(l)},h.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=function(t,e){var r=t.glplot.gl,a=n({gl:r}),i=new c(t,a,e.uid);return a._trace=i,i.update(e),t.glplot.add(a),i}},{"../../components/colorscale":605,"../../lib/gl_format_color":716,"../../lib/str2rgbarray":742,"../../plots/gl3d/zip3":818,"../isosurface/convert":1050,"gl-mesh3d":280}],1251:[function(t,e,r){var n=t("../../lib"),a=t("./attributes"),i=t("../isosurface/defaults").supplyIsoDefaults;e.exports=function(t,e,r,o){function s(r,i){return n.coerce(t,e,a,r,i)}i(t,e,r,o,s);var l=s("opacityscale");"max"===l?e.opacityscale=[[0,.1],[1,1]]:"min"===l?e.opacityscale=[[0,1],[1,.1]]:"extremes"===l?e.opacityscale=function(t,e){for(var r=[],n=0;n<32;n++){var a=n/31,i=.1+.9*(1-Math.pow(Math.sin(1*a*Math.PI),2));r.push([a,Math.max(1,Math.min(0,i))])}return r}():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 n=t[r];if(2!==n.length||+n[0]<e)return!1;e=+n[0]}return!0}(l)||(e.opacityscale=void 0)}},{"../../lib":719,"../isosurface/defaults":1051,"./attributes":1249}],1252:[function(t,e,r){e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("../isosurface/calc"),colorbar:{min:"cmin",max:"cmax"},plot:t("./convert"),moduleType:"trace",name:"volume",basePlotModule:t("../../plots/gl3d"),categories:["gl3d"],meta:{}}},{"../../plots/gl3d":807,"../isosurface/calc":1049,"./attributes":1249,"./convert":1250,"./defaults":1251}],1253:[function(t,e,r){var n=t("../bar/attributes"),a=t("../scatter/attributes").line,i=t("../../plots/attributes"),o=t("../../components/fx/hovertemplate_attributes"),s=t("./constants"),l=t("../../lib/extend").extendFlat,u=t("../../components/color");function c(t){return{marker:{color:l({},n.marker.color,{arrayOk:!1,editType:"style"}),line:{color:l({},n.marker.line.color,{arrayOk:!1,editType:"style"}),width:l({},n.marker.line.width,{arrayOk:!1,editType:"style"}),editType:"style"},editType:"style"},editType:"style"}}e.exports={measure:{valType:"data_array",dflt:[],editType:"calc"},base:{valType:"number",dflt:null,arrayOk:!1,editType:"calc"},x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,hovertext:n.hovertext,hovertemplate:o({},{keys:s.eventDataKeys}),hoverinfo:l({},i.hoverinfo,{flags:["name","x","y","text","initial","delta","final"]}),textinfo:{valType:"flaglist",flags:["label","text","initial","delta","final"],extras:["none"],editType:"plot",arrayOk:!1},text:n.text,textposition:n.textposition,insidetextanchor:n.insidetextanchor,textangle:n.textangle,textfont:n.textfont,insidetextfont:n.insidetextfont,outsidetextfont:n.outsidetextfont,constraintext:n.constraintext,cliponaxis:n.cliponaxis,orientation:n.orientation,offset:n.offset,width:n.width,increasing:c(),decreasing:c(),totals:c(),connector:{line:{color:l({},a.color,{dflt:u.defaultLine}),width:l({},a.width,{editType:"plot"}),dash:a.dash,editType:"plot"},mode:{valType:"enumerated",values:["spanning","between"],dflt:"between",editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:n.offsetgroup,alignmentgroup:n.alignmentgroup}},{"../../components/color":593,"../../components/fx/hovertemplate_attributes":631,"../../lib/extend":710,"../../plots/attributes":764,"../bar/attributes":857,"../scatter/attributes":1112,"./constants":1255}],1254:[function(t,e,r){var n=t("../../plots/cartesian/axes"),a=t("../../lib").mergeArray,i=t("../scatter/calc_selection"),o=t("../../constants/numerical").BADNUM;function s(t){return"a"===t||"absolute"===t}function l(t){return"t"===t||"total"===t}e.exports=function(t,e){var r,u,c=n.getFromId(t,e.xaxis||"x"),h=n.getFromId(t,e.yaxis||"y");"h"===e.orientation?(r=c.makeCalcdata(e,"x"),u=h.makeCalcdata(e,"y")):(r=h.makeCalcdata(e,"y"),u=c.makeCalcdata(e,"x"));for(var d,f=Math.min(u.length,r.length),p=new Array(f),m=0,g=!1,y=0;y<f;y++){var v=r[y]||0,_=!1;(r[y]!==o||l(e.measure[y])||s(e.measure[y]))&&y+1<f&&(r[y+1]!==o||l(e.measure[y+1])||s(e.measure[y+1]))&&(_=!0);var x=p[y]={i:y,p:u[y],s:v,rawS:v,cNext:_};s(e.measure[y])?(m=x.s,x.isSum=!0,x.dir="totals",x.s=m):l(e.measure[y])?(x.isSum=!0,x.dir="totals",x.s=m):(x.isSum=!1,x.dir=x.rawS<0?"decreasing":"increasing",d=x.s,x.s=m+d,m+=d),"totals"===x.dir&&(g=!0),e.ids&&(x.id=String(e.ids[y])),x.v=(e.base||0)+m}return p.length&&(p[0].hasTotals=g),a(e.text,p,"tx"),a(e.hovertext,p,"htx"),i(p,e),p}},{"../../constants/numerical":695,"../../lib":719,"../../plots/cartesian/axes":767,"../scatter/calc_selection":1114}],1255:[function(t,e,r){e.exports={eventDataKeys:["initial","delta","final"]}},{}],1256:[function(t,e,r){var n=t("../bar/cross_trace_calc").setGroupPositions;e.exports=function(t,e){var r,a,i=t._fullLayout,o=t._fullData,s=t.calcdata,l=e.xaxis,u=e.yaxis,c=[],h=[],d=[];for(a=0;a<o.length;a++){var f=o[a];!0===f.visible&&f.xaxis===l._id&&f.yaxis===u._id&&"waterfall"===f.type&&(r=s[a],"h"===f.orientation?d.push(r):h.push(r),c.push(r))}var p={mode:i.waterfallmode,norm:i.waterfallnorm,gap:i.waterfallgap,groupgap:i.waterfallgroupgap};for(n(t,l,u,h,p),n(t,u,l,d,p),a=0;a<c.length;a++){r=c[a];for(var m=0;m<r.length;m++){var g=r[m];!1===g.isSum&&(g.s0+=0===m?0:r[m-1].s),m+1<r.length&&(r[m].nextP0=r[m+1].p0,r[m].nextS0=r[m+1].s0)}}}},{"../bar/cross_trace_calc":860}],1257:[function(t,e,r){var n=t("../../lib"),a=t("../bar/defaults").handleGroupingDefaults,i=t("../bar/defaults").handleText,o=t("../scatter/xy_defaults"),s=t("./attributes"),l=t("../../components/color"),u=t("../../constants/delta.js"),c=u.INCREASING.COLOR,h=u.DECREASING.COLOR;function d(t,e,r){t(e+".marker.color",r),t(e+".marker.line.color",l.defaultLine),t(e+".marker.line.width")}e.exports={supplyDefaults:function(t,e,r,a){function l(r,a){return n.coerce(t,e,s,r,a)}if(o(t,e,a,l)){l("measure"),l("orientation",e.x&&!e.y?"h":"v"),l("base"),l("offset"),l("width"),l("text"),l("hovertext"),l("hovertemplate");var u=l("textposition");i(t,e,a,l,u,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),"none"!==e.textposition&&l("textinfo"),d(l,"increasing",c),d(l,"decreasing",h),d(l,"totals","#4499FF"),l("connector.visible")&&(l("connector.mode"),l("connector.line.width")&&(l("connector.line.color"),l("connector.line.dash")))}else e.visible=!1},crossTraceDefaults:function(t,e){var r,i;function o(t){return n.coerce(i._input,i,s,t)}if("group"===e.waterfallmode)for(var l=0;l<t.length;l++)r=(i=t[l])._input,a(r,i,e,o)}}},{"../../components/color":593,"../../constants/delta.js":689,"../../lib":719,"../bar/defaults":861,"../scatter/xy_defaults":1137,"./attributes":1253}],1258:[function(t,e,r){e.exports=function(t,e){return t.x="xVal"in e?e.xVal:e.x,t.y="yVal"in e?e.yVal:e.y,"initial"in e&&(t.initial=e.initial),"delta"in e&&(t.delta=e.delta),"final"in e&&(t.final=e.final),e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),t}},{}],1259:[function(t,e,r){var n=t("../../plots/cartesian/axes").hoverLabelText,a=t("../../components/color").opacity,i=t("../bar/hover").hoverOnBars,o=t("../../constants/delta.js"),s=o.INCREASING.SYMBOL,l=o.DECREASING.SYMBOL;e.exports=function(t,e,r,o){var u=i(t,e,r,o);if(u){var c=u.cd,h=c[0].trace,d="h"===h.orientation,f=d?t.xa:t.ya,p=c[u.index],m=p.isSum?p.b+p.s:p.rawS;if(!p.isSum){u.initial=p.b+p.s-m,u.delta=m,u.final=u.initial+u.delta;var g=w(Math.abs(u.delta));u.deltaLabel=m<0?"("+g+")":g,u.finalLabel=w(u.final),u.initialLabel=w(u.initial)}var y=p.hi||h.hoverinfo,v=[];if(y&&"none"!==y&&"skip"!==y){var _="all"===y,x=y.split("+"),b=function(t){return _||-1!==x.indexOf(t)};p.isSum||(!b("final")||b(d?"x":"y")||v.push(u.finalLabel),b("delta")&&(m<0?v.push(u.deltaLabel+" "+l):v.push(u.deltaLabel+" "+s)),b("initial")&&v.push("Initial: "+u.initialLabel))}return v.length&&(u.extraText=v.join("<br>")),u.color=function(t,e){var r=t[e.dir].marker,n=r.color,i=r.line.color,o=r.line.width;return a(n)?n:a(i)&&o?i:void 0}(h,p),[u]}function w(t){return n(f,t)}}},{"../../components/color":593,"../../constants/delta.js":689,"../../plots/cartesian/axes":767,"../bar/hover":863}],1260:[function(t,e,r){e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults").supplyDefaults,crossTraceDefaults:t("./defaults").crossTraceDefaults,supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),crossTraceCalc:t("./cross_trace_calc"),plot:t("./plot"),style:t("./style").style,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("../bar/select"),moduleType:"trace",name:"waterfall",basePlotModule:t("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":778,"../bar/select":868,"./attributes":1253,"./calc":1254,"./cross_trace_calc":1256,"./defaults":1257,"./event_data":1258,"./hover":1259,"./layout_attributes":1261,"./layout_defaults":1262,"./plot":1263,"./style":1264}],1261:[function(t,e,r){e.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],1262:[function(t,e,r){var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r){var i=!1;function o(r,i){return n.coerce(t,e,a,r,i)}for(var s=0;s<r.length;s++){var l=r[s];if(l.visible&&"waterfall"===l.type){i=!0;break}}i&&(o("waterfallmode"),o("waterfallgap",.2),o("waterfallgroupgap"))}},{"../../lib":719,"./layout_attributes":1261}],1263:[function(t,e,r){var n=t("d3"),a=t("../../lib"),i=t("../../components/drawing"),o=t("../bar/plot").plot;e.exports=function(t,e,r,s){var l=t._fullLayout;o(t,e,r,s,{mode:l.waterfallmode,norm:l.waterfallmode,gap:l.waterfallgap,groupgap:l.waterfallgroupgap}),function(t,e,r,o){var s=e.xaxis,l=e.yaxis;a.makeTraceGroups(o,r,"trace bars").each((function(r){var o=n.select(this),u=r[0].trace,c=a.ensureSingle(o,"g","lines");if(u.connector&&u.connector.visible){var h="h"===u.orientation,d=u.connector.mode,f=c.selectAll("g.line").data(a.identity);f.enter().append("g").classed("line",!0),f.exit().remove();var p=f.size();f.each((function(r,o){if(o===p-1||r.cNext){var u=function(t,e,r,n){var a=[],i=[],o=n?e:r,s=n?r:e;return a[0]=o.c2p(t.s0,!0),i[0]=s.c2p(t.p0,!0),a[1]=o.c2p(t.s1,!0),i[1]=s.c2p(t.p1,!0),a[2]=o.c2p(t.nextS0,!0),i[2]=s.c2p(t.nextP0,!0),n?[a,i]:[i,a]}(r,s,l,h),c=u[0],f=u[1],m="";"spanning"===d&&!r.isSum&&o>0&&(m+=h?"M"+c[0]+","+f[1]+"V"+f[0]:"M"+c[1]+","+f[0]+"H"+c[0]),"between"!==d&&(r.isSum||o<p-1)&&(m+=h?"M"+c[1]+","+f[0]+"V"+f[1]:"M"+c[0]+","+f[1]+"H"+c[1]),void 0!==c[2]&&void 0!==f[2]&&(m+=h?"M"+c[1]+","+f[1]+"V"+f[2]:"M"+c[1]+","+f[1]+"H"+c[2]),""===m&&(m="M0,0Z"),a.ensureSingle(n.select(this),"path").attr("d",m).call(i.setClipUrl,e.layerClipId,t)}}))}else c.remove()}))}(t,e,r,s)}},{"../../components/drawing":614,"../../lib":719,"../bar/plot":867,d3:163}],1264:[function(t,e,r){var n=t("d3"),a=t("../../components/drawing"),i=t("../../components/color"),o=t("../../constants/interactions").DESELECTDIM,s=t("../bar/style").styleTextPoints;e.exports={style:function(t,e,r){var l=r||n.select(t).selectAll("g.waterfalllayer").selectAll("g.trace");l.style("opacity",(function(t){return t[0].trace.opacity})),l.each((function(e){var r=n.select(this),l=e[0].trace;r.selectAll(".point > path").each((function(t){if(!t.isBlank){var e=l[t.dir].marker;n.select(this).call(i.fill,e.color).call(i.stroke,e.line.color).call(a.dashLine,e.line.dash,e.line.width).style("opacity",l.selectedpoints&&!t.selected?o:1)}})),s(r,l,t),r.selectAll(".lines").each((function(){var t=l.connector.line;a.lineGroupStyle(n.select(this).selectAll("path"),t.width,t.color,t.dash)}))}))}}},{"../../components/color":593,"../../components/drawing":614,"../../constants/interactions":694,"../bar/style":870,d3:163}],1265:[function(t,e,r){var n=t("../plots/cartesian/axes"),a=t("../lib"),i=t("../plot_api/plot_schema"),o=t("./helpers").pointsAccessorFunction,s=t("../constants/numerical").BADNUM;r.moduleType="transform",r.name="aggregate";var l=r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},groups:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},aggregations:{_isLinkedToArray:"aggregation",target:{valType:"string",editType:"calc"},func:{valType:"enumerated",values:["count","sum","avg","median","mode","rms","stddev","min","max","first","last","change","range"],dflt:"first",editType:"calc"},funcmode:{valType:"enumerated",values:["sample","population"],dflt:"sample",editType:"calc"},enabled:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},editType:"calc"},u=l.aggregations;function c(t,e,r,i){if(i.enabled){for(var o=i.target,l=a.nestedProperty(e,o),u=l.get(),c=function(t,e){var r=t.func,n=e.d2c,a=e.c2d;switch(r){case"count":return h;case"first":return d;case"last":return f;case"sum":return function(t,e){for(var r=0,i=0;i<e.length;i++){var o=n(t[e[i]]);o!==s&&(r+=o)}return a(r)};case"avg":return function(t,e){for(var r=0,i=0,o=0;o<e.length;o++){var l=n(t[e[o]]);l!==s&&(r+=l,i++)}return i?a(r/i):s};case"min":return function(t,e){for(var r=1/0,i=0;i<e.length;i++){var o=n(t[e[i]]);o!==s&&(r=Math.min(r,o))}return r===1/0?s:a(r)};case"max":return function(t,e){for(var r=-1/0,i=0;i<e.length;i++){var o=n(t[e[i]]);o!==s&&(r=Math.max(r,o))}return r===-1/0?s:a(r)};case"range":return function(t,e){for(var r=1/0,i=-1/0,o=0;o<e.length;o++){var l=n(t[e[o]]);l!==s&&(r=Math.min(r,l),i=Math.max(i,l))}return i===-1/0||r===1/0?s:a(i-r)};case"change":return function(t,e){var r=n(t[e[0]]),i=n(t[e[e.length-1]]);return r===s||i===s?s:a(i-r)};case"median":return function(t,e){for(var r=[],i=0;i<e.length;i++){var o=n(t[e[i]]);o!==s&&r.push(o)}if(!r.length)return s;r.sort();var l=(r.length-1)/2;return a((r[Math.floor(l)]+r[Math.ceil(l)])/2)};case"mode":return function(t,e){for(var r={},i=0,o=s,l=0;l<e.length;l++){var u=n(t[e[l]]);if(u!==s){var c=r[u]=(r[u]||0)+1;c>i&&(i=c,o=u)}}return i?a(o):s};case"rms":return function(t,e){for(var r=0,i=0,o=0;o<e.length;o++){var l=n(t[e[o]]);l!==s&&(r+=l*l,i++)}return i?a(Math.sqrt(r/i)):s};case"stddev":return function(e,r){var a,i=0,o=0,l=1,u=s;for(a=0;a<r.length&&u===s;a++)u=n(e[r[a]]);if(u===s)return s;for(;a<r.length;a++){var c=n(e[r[a]]);if(c!==s){var h=c-u;i+=h,o+=h*h,l++}}var d="sample"===t.funcmode?l-1:l;return d?Math.sqrt((o-i*i/l)/d):0}}}(i,n.getDataConversions(t,e,o,u)),p=new Array(r.length),m=0;m<r.length;m++)p[m]=c(u,r[m]);l.set(p),"count"===i.func&&a.pushUnique(e._arrayAttrs,o)}}function h(t,e){return e.length}function d(t,e){return t[e[0]]}function f(t,e){return t[e[e.length-1]]}r.supplyDefaults=function(t,e){var r,n={};function o(e,r){return a.coerce(t,n,l,e,r)}if(!o("enabled"))return n;var s=i.findArrayAttributes(e),c={};for(r=0;r<s.length;r++)c[s[r]]=1;var h=o("groups");if(!Array.isArray(h)){if(!c[h])return n.enabled=!1,n;c[h]=0}var d,f=t.aggregations||[],p=n.aggregations=new Array(f.length);function m(t,e){return a.coerce(f[r],d,u,t,e)}for(r=0;r<f.length;r++){d={_index:r};var g=m("target"),y=m("func");m("enabled")&&g&&(c[g]||"count"===y&&void 0===c[g])?("stddev"===y&&m("funcmode"),c[g]=0,p[r]=d):p[r]={enabled:!1,_index:r}}for(r=0;r<s.length;r++)c[s[r]]&&p.push({target:s[r],func:u.func.dflt,enabled:!0,_index:-1});return n},r.calcTransform=function(t,e,r){if(r.enabled){var n=r.groups,i=a.getTargetArray(e,{target:n});if(i){var s,l,u,h,d={},f={},p=[],m=o(e.transforms,r),g=i.length;for(e._length&&(g=Math.min(g,e._length)),s=0;s<g;s++)void 0===(u=d[l=i[s]])?(d[l]=p.length,h=[s],p.push(h),f[d[l]]=m(s)):(p[u].push(s),f[d[l]]=(f[d[l]]||[]).concat(m(s)));r._indexToPoints=f;var y=r.aggregations;for(s=0;s<y.length;s++)c(t,e,p,y[s]);"string"==typeof n&&c(t,e,p,{target:n,func:"first",enabled:!0}),e._length=p.length}}}},{"../constants/numerical":695,"../lib":719,"../plot_api/plot_schema":756,"../plots/cartesian/axes":767,"./helpers":1268}],1266:[function(t,e,r){var n=t("../lib"),a=t("../registry"),i=t("../plots/cartesian/axes"),o=t("./helpers").pointsAccessorFunction,s=t("../constants/filter_ops"),l=s.COMPARISON_OPS,u=s.INTERVAL_OPS,c=s.SET_OPS;r.moduleType="transform",r.name="filter",r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},target:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},operation:{valType:"enumerated",values:[].concat(l).concat(u).concat(c),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},preservegaps:{valType:"boolean",dflt:!1,editType:"calc"},editType:"calc"},r.supplyDefaults=function(t){var e={};function i(a,i){return n.coerce(t,e,r.attributes,a,i)}if(i("enabled")){var o=i("target");if(n.isArrayOrTypedArray(o)&&0===o.length)return e.enabled=!1,e;i("preservegaps"),i("operation"),i("value");var s=a.getComponentMethod("calendars","handleDefaults");s(t,e,"valuecalendar",null),s(t,e,"targetcalendar",null)}return e},r.calcTransform=function(t,e,r){if(r.enabled){var a=n.getTargetArray(e,r);if(a){var s=r.target,h=a.length;e._length&&(h=Math.min(h,e._length));var d=r.targetcalendar,f=e._arrayAttrs,p=r.preservegaps;if("string"==typeof s){var m=n.nestedProperty(e,s+"calendar").get();m&&(d=m)}var g,y,v=function(t,e,r){var n=t.operation,a=t.value,i=Array.isArray(a);function o(t){return-1!==t.indexOf(n)}var s,h=function(r){return e(r,0,t.valuecalendar)},d=function(t){return e(t,0,r)};switch(o(l)?s=h(i?a[0]:a):o(u)?s=i?[h(a[0]),h(a[1])]:[h(a),h(a)]:o(c)&&(s=i?a.map(h):[h(a)]),n){case"=":return function(t){return d(t)===s};case"!=":return function(t){return d(t)!==s};case"<":return function(t){return d(t)<s};case"<=":return function(t){return d(t)<=s};case">":return function(t){return d(t)>s};case">=":return function(t){return d(t)>=s};case"[]":return function(t){var e=d(t);return e>=s[0]&&e<=s[1]};case"()":return function(t){var e=d(t);return e>s[0]&&e<s[1]};case"[)":return function(t){var e=d(t);return e>=s[0]&&e<s[1]};case"(]":return function(t){var e=d(t);return e>s[0]&&e<=s[1]};case"][":return function(t){var e=d(t);return e<=s[0]||e>=s[1]};case")(":return function(t){var e=d(t);return e<s[0]||e>s[1]};case"](":return function(t){var e=d(t);return e<=s[0]||e>s[1]};case")[":return function(t){var e=d(t);return e<s[0]||e>=s[1]};case"{}":return function(t){return-1!==s.indexOf(d(t))};case"}{":return function(t){return-1===s.indexOf(d(t))}}}(r,i.getDataToCoordFunc(t,e,s,a),d),_={},x={},b=0;p?(g=function(t){_[t.astr]=n.extendDeep([],t.get()),t.set(new Array(h))},y=function(t,e){var r=_[t.astr][e];t.get()[e]=r}):(g=function(t){_[t.astr]=n.extendDeep([],t.get()),t.set([])},y=function(t,e){var r=_[t.astr][e];t.get().push(r)}),k(g);for(var w=o(e.transforms,r),M=0;M<h;M++)v(a[M])?(k(y,M),x[b++]=w(M)):p&&b++;r._indexToPoints=x,e._length=b}}function k(t,r){for(var a=0;a<f.length;a++)t(n.nestedProperty(e,f[a]),r)}}},{"../constants/filter_ops":691,"../lib":719,"../plots/cartesian/axes":767,"../registry":847,"./helpers":1268}],1267:[function(t,e,r){var n=t("../lib"),a=t("../plot_api/plot_schema"),i=t("../plots/plots"),o=t("./helpers").pointsAccessorFunction;function s(t,e){var r,s,l,u,c,h,d,f,p,m,g=e.transform,y=e.transformIndex,v=t.transforms[y].groups,_=o(t.transforms,g);if(!Array.isArray(v)||0===v.length)return[t];var x=n.filterUnique(v),b=new Array(x.length),w=v.length,M=a.findArrayAttributes(t),k=g.styles||[],T={};for(r=0;r<k.length;r++)T[k[r].target]=k[r].value;g.styles&&(m=n.keyedContainer(g,"styles","target","value.name"));var L={},A={};for(r=0;r<x.length;r++){L[h=x[r]]=r,A[h]=0,(d=b[r]=n.extendDeepNoArrays({},t))._group=h,d.transforms[y]._indexToPoints={};var S=null;for(m&&(S=m.get(h)),d.name=S||""===S?S:n.templateString(g.nameformat,{trace:t.name,group:h}),f=d.transforms,d.transforms=[],s=0;s<f.length;s++)d.transforms[s]=n.extendDeepNoArrays({},f[s]);for(s=0;s<M.length;s++)n.nestedProperty(d,M[s]).set([])}for(l=0;l<M.length;l++){for(u=M[l],s=0,p=[];s<x.length;s++)p[s]=n.nestedProperty(b[s],u).get();for(c=n.nestedProperty(t,u).get(),s=0;s<w;s++)p[L[v[s]]].push(c[s])}for(s=0;s<w;s++)(d=b[L[v[s]]]).transforms[y]._indexToPoints[A[v[s]]]=_(s),A[v[s]]++;for(r=0;r<x.length;r++)h=x[r],d=b[r],i.clearExpandedTraceDefaultColors(d),d=n.extendDeepNoArrays(d,T[h]||{});return b}r.moduleType="transform",r.name="groupby",r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},groups:{valType:"data_array",dflt:[],editType:"calc"},nameformat:{valType:"string",editType:"calc"},styles:{_isLinkedToArray:"style",target:{valType:"string",editType:"calc"},value:{valType:"any",dflt:{},editType:"calc",_compareAsJSON:!0},editType:"calc"},editType:"calc"},r.supplyDefaults=function(t,e,a){var i,o={};function s(e,a){return n.coerce(t,o,r.attributes,e,a)}if(!s("enabled"))return o;s("groups"),s("nameformat",a._dataLength>1?"%{group} (%{trace})":"%{group}");var l=t.styles,u=o.styles=[];if(l)for(i=0;i<l.length;i++){var c=u[i]={};n.coerce(l[i],u[i],r.attributes.styles,"target");var h=n.coerce(l[i],u[i],r.attributes.styles,"value");n.isPlainObject(h)?c.value=n.extendDeep({},h):h&&delete c.value}return o},r.transform=function(t,e){var r,n,a,i=[];for(n=0;n<t.length;n++)for(r=s(t[n],e),a=0;a<r.length;a++)i.push(r[a]);return i}},{"../lib":719,"../plot_api/plot_schema":756,"../plots/plots":828,"./helpers":1268}],1268:[function(t,e,r){r.pointsAccessorFunction=function(t,e){for(var r,n,a=0;a<t.length&&(r=t[a])!==e;a++)r._indexToPoints&&!1!==r.enabled&&(n=r._indexToPoints);return n?function(t){return n[t]}:function(t){return[t]}}},{}],1269:[function(t,e,r){var n=t("../lib"),a=t("../plots/cartesian/axes"),i=t("./helpers").pointsAccessorFunction;r.moduleType="transform",r.name="sort",r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},target:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},order:{valType:"enumerated",values:["ascending","descending"],dflt:"ascending",editType:"calc"},editType:"calc"},r.supplyDefaults=function(t){var e={};function a(a,i){return n.coerce(t,e,r.attributes,a,i)}return a("enabled")&&(a("target"),a("order")),e},r.calcTransform=function(t,e,r){if(r.enabled){var o=n.getTargetArray(e,r);if(o){var s=r.target,l=o.length;e._length&&(l=Math.min(l,e._length));var u,c,h=e._arrayAttrs,d=function(t,e,r,n){var a,i=new Array(n),o=new Array(n);for(a=0;a<n;a++)i[a]={v:e[a],i:a};for(i.sort(function(t,e){switch(t.order){case"ascending":return function(t,r){return e(t.v)-e(r.v)};case"descending":return function(t,r){return e(r.v)-e(t.v)}}}(t,r)),a=0;a<n;a++)o[a]=i[a].i;return o}(r,o,a.getDataToCoordFunc(t,e,s,o),l),f=i(e.transforms,r),p={};for(u=0;u<h.length;u++){var m=n.nestedProperty(e,h[u]),g=m.get(),y=new Array(l);for(c=0;c<l;c++)y[c]=g[d[c]];m.set(y)}for(c=0;c<l;c++)p[c]=f(d[c]);r._indexToPoints=p,e._length=l}}}},{"../lib":719,"../plots/cartesian/axes":767,"./helpers":1268}]},{},[25])(25)},23934:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ERROR="tableschema.error"},12820:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IconButton=void 0;var n=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},i="src/index.js",o=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(r(67294)),s=c(r(31603)),l=c(r(56960)),u=r(58148);function c(t){return t&&t.__esModule?t:{default:t}}function h(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function d(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function f(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var p=function(t){var e=t.data,r=e.data,n=e.schema,a=t.theme,l=t.expanded,u=t.height;return o.createElement(s.default,{data:r,schema:n,theme:a,expanded:l,height:u,__source:{fileName:i,lineNumber:32}})},m={grid:{},line:{},bar:{type:"bar"},scatter:{mode:"markers"}},g=Object.keys(m),y=function(t){var e=t.data,r=e.data,n=e.schema,s=t.type,u={data:[]},c=m[s];return n.fields.forEach((function(t,e){var r=t.name;u.data[e]=a({name:r,y:[]},c)})),r.forEach((function(t,e){n.fields.forEach((function(r,n){var a=r.name;u.data[n].y[e]=t[a]}))})),o.createElement(l.default,{data:u,__source:{fileName:i,lineNumber:71}})},v=function(t){var e=t.metadata,r=e&&e.sampled?o.createElement("span",{__source:{fileName:i,lineNumber:77}},o.createElement("b",{__source:{fileName:i,lineNumber:78}},"NOTE:")," This data is sampled"):null;return o.createElement("div",{style:{fontFamily:"Source Sans Pro, Helvetica Neue, Helvetica, Arial, sans-serif"},__source:{fileName:i,lineNumber:83}},o.createElement("div",{style:{backgroundColor:"#cec",color:"#111",padding:"10px",paddingLeft:"20px"},__source:{fileName:i,lineNumber:89}},"This interactive data explorer is in the works."," ",o.createElement("a",{href:"https://github.com/nteract/nteract/issues/new",style:{color:"#333"},__source:{fileName:i,lineNumber:98}},"Help us improve it!"),o.createElement(u.Beaker,{style:{color:"#111",verticalAlign:"center",textAlign:"center",paddingLeft:"10px"},__source:{fileName:i,lineNumber:106}})),r?o.createElement("div",{style:{backgroundColor:"#cce",padding:"10px",paddingLeft:"20px"},__source:{fileName:i,lineNumber:116}},r):null)},_=function(t){function e(){var t,r,n;h(this,e);for(var a=arguments.length,i=Array(a),o=0;o<a;o++)i[o]=arguments[o];return r=n=d(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(i))),n.state={view:"grid"},n.setGrid=function(){n.setState({view:"grid"})},n.setLine=function(){n.setState({view:"line"})},n.setBar=function(){n.setState({view:"bar"})},n.setScatter=function(){n.setState({view:"scatter"})},d(n,r)}return f(e,t),n(e,[{key:"shouldComponentUpdate",value:function(){return!0}},{key:"render",value:function(){var t=this.state.view,e=null;return"grid"===t?e=o.createElement(p,a({},this.props,{__source:{fileName:i,lineNumber:165}})):g.includes(t)&&(e=o.createElement(y,a({},this.props,{type:t,__source:{fileName:i,lineNumber:167}}))),o.createElement("div",{__source:{fileName:i,lineNumber:171}},o.createElement(v,{metadata:this.props.metadata,__source:{fileName:i,lineNumber:172}}),o.createElement("div",{style:{display:"flex",flexFlow:"row nowrap",width:"100%",height:this.props.height},__source:{fileName:i,lineNumber:173}},o.createElement("div",{style:{flex:"1"},__source:{fileName:i,lineNumber:181}},e),o.createElement("div",{style:{display:"flex",flexFlow:"column nowrap"},__source:{fileName:i,lineNumber:188}},o.createElement(x,{onClick:this.setGrid,message:"Data Table",__source:{fileName:i,lineNumber:194}},o.createElement(u.DatabaseOcticon,{__source:{fileName:i,lineNumber:195}})),o.createElement(x,{onClick:this.setLine,message:"Line Graph",__source:{fileName:i,lineNumber:197}},o.createElement(u.PulseOcticon,{__source:{fileName:i,lineNumber:198}})),o.createElement(x,{onClick:this.setBar,message:"Bar Graph",__source:{fileName:i,lineNumber:200}},o.createElement(u.GraphOcticon,{__source:{fileName:i,lineNumber:201}})),o.createElement(x,{onClick:this.setScatter,message:"Scatter Plot",__source:{fileName:i,lineNumber:203}},o.createElement(u.TelescopeOcticon,{__source:{fileName:i,lineNumber:204}})))))}}]),e}(o.Component);_.MIMETYPE="application/vnd.dataresource+json",_.defaultProps={metadata:{}};var x=e.IconButton=function(t){function e(){return h(this,e),d(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return f(e,t),n(e,[{key:"render",value:function(){var t=this.props,e=t.message,r=t.onClick,n=t.children;return o.createElement("button",{onClick:r,key:e,title:e,style:{width:"32px",height:"32px"},__source:{fileName:i,lineNumber:223}},n)}}]),e}(o.Component);e.default=_},45865:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});var n=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=[],n=!0,a=!1,i=void 0;try{for(var o,s=t[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!e||r.length!==e);n=!0);}catch(t){a=!0,i=t}finally{try{!n&&s.return&&s.return()}finally{if(a)throw i}}return r}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")};e.infer=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i.default.extend({rowLimit:null,explicit:!1,primaryKey:null,cast:{}},r),a={fields:[]};return n.primaryKey&&(i.default.isString(n.primaryKey)&&(n.primaryKey=[n.primaryKey]),a.primaryKey=n.primaryKey),a.fields=t.map((function(t){var e={},r={name:t,title:"",description:""};return n.explicit&&(e.required=!0),i.default.includes(n.primaryKey,t)&&(e.unique=!0),i.default.isEmpty(e)||(r.constraints=e),r})),t.forEach((function(t,r){var o=i.default.map(e,(function(t){return t[r]})),s=a.fields[r];n.rowLimit&&(o=i.default.take(o,n.rowLimit)),s.type=u(o),n.cast&&n.cast.hasOwnProperty.call(n.cast,s.type)&&(s.format=n.cast[s.type].format),s.format||(s.format="default")})),a};var a,i=(a=r(96486))&&a.__esModule?a:{default:a},o=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(r(61730)),s=r(23934),l=["duration","geojson","geopoint","object","array","datetime","time","date","integer","number","boolean","string","any"];function u(t){var e=[],r=!0,a=!1,u=void 0;try{for(var c,h=t[Symbol.iterator]();!(r=(c=h.next()).done);r=!0){var d=c.value,f=!0,p=!1,m=void 0;try{for(var g,y=l[Symbol.iterator]();!(f=(g=y.next()).done);f=!0){var v=g.value;if((0,o["cast"+i.default.upperFirst(v)])("default",d)!==s.ERROR){e.push(v);break}}}catch(t){p=!0,m=t}finally{try{!f&&y.return&&y.return()}finally{if(p)throw m}}}}catch(t){a=!0,u=t}finally{try{!r&&h.return&&h.return()}finally{if(a)throw u}}var _="any",x=0,b=!0,w=!1,M=void 0;try{for(var k,T=i.default.toPairs(i.default.countBy(e))[Symbol.iterator]();!(b=(k=T.next()).done);b=!0){var L=k.value,A=n(L,2),S=A[0],E=A[1];E>x&&(_=S,x=E)}}catch(t){w=!0,M=t}finally{try{!b&&T.return&&T.return()}finally{if(w)throw M}}return _}},34896:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.castAny=function(t,e){return e}},56160:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.castArray=function(t,e){if(!a.default.isArray(e)){if(!a.default.isString(e))return i.ERROR;try{e=JSON.parse(e)}catch(t){return i.ERROR}if(!a.default.isArray(e))return i.ERROR}return e};var n,a=(n=r(96486))&&n.__esModule?n:{default:n},i=r(23934)},99166:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.castBoolean=function(t,e){if(!a.default.isBoolean(e)){if(!a.default.isString(e))return i.ERROR;if(e=e.trim().toLowerCase(),o.includes(e))e=!0;else{if(!s.includes(e))return i.ERROR;e=!1}}return e};var n,a=(n=r(96486))&&n.__esModule?n:{default:n},i=r(23934),o=["yes","y","true","t","1"],s=["no","n","false","f","0"]},20978:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.castDate=function(t,e){if(!n.default.isDate(e)){if(!n.default.isString(e))return o.ERROR;try{if("default"===t?e=(0,a.default)((0,i.timeParse)(l)(e)):"any"===t?e=(0,a.default)(e):(t.startsWith("fmt:")&&(console.warn('Format "fmt:<PATTERN>" is deprecated.\n Please use "<PATTERN>" without "fmt:" prefix.'),t=t.replace("fmt:","")),e=(0,a.default)((0,i.timeParse)(t)(e))),!e.isValid())return o.ERROR;e=e.toDate()}catch(t){return o.ERROR}}return e};var n=s(r(96486)),a=s(r(5582)),i=r(14660),o=r(23934);function s(t){return t&&t.__esModule?t:{default:t}}var l="%Y-%m-%d"},26899:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.castDatetime=function(t,e){if(!n.default.isDate(e)){if(!n.default.isString(e))return o.ERROR;try{if("default"===t?e=(0,a.default)((0,i.timeParse)(l)(e)):"any"===t?e=(0,a.default)(e):(t.startsWith("fmt:")&&(console.warn('Format "fmt:<PATTERN>" is deprecated.\n Please use "<PATTERN>" without "fmt:" prefix.'),t=t.replace("fmt:","")),e=(0,a.default)((0,i.timeParse)(t)(e))),!e.isValid())return o.ERROR;e=e.toDate()}catch(t){return o.ERROR}}return e};var n=s(r(96486)),a=s(r(5582)),i=r(14660),o=r(23934);function s(t){return t&&t.__esModule?t:{default:t}}var l="%Y-%m-%dT%H:%M:%SZ"},8825:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.castDuration=function(t,e){if(!a.default.isDuration(e)){if(!n.default.isString(e))return i.ERROR;try{if(!(e=a.default.duration(e)).as("milliseconds"))return i.ERROR}catch(t){return i.ERROR}}return e};var n=o(r(96486)),a=o(r(5582)),i=r(23934);function o(t){return t&&t.__esModule?t:{default:t}}},94691:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.castGeojson=function(t,e){if(!a.default.isObject(e)){if(!a.default.isString(e))return i.ERROR;try{e=JSON.parse(e)}catch(t){return i.ERROR}}if("default"===t)try{if(!n.default.validate(e,o.default))return i.ERROR}catch(t){return i.ERROR}else if("topojson"===t&&!a.default.isPlainObject(e))return i.ERROR;return e};var n=s(r(99018)),a=s(r(96486)),i=r(23934),o=s(r(90344));function s(t){return t&&t.__esModule?t:{default:t}}},66781:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});var n=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=[],n=!0,a=!1,i=void 0;try{for(var o,s=t[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!e||r.length!==e);n=!0);}catch(t){a=!0,i=t}finally{try{!n&&s.return&&s.return()}finally{if(a)throw i}}return r}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")};e.castGeopoint=function(t,e){var r=void 0,a=void 0;try{if("default"===t){if(i.default.isString(e)){var s=e.split(","),l=n(s,2);r=l[0],a=l[1],r=r.trim(),a=a.trim()}else if(i.default.isArray(e)){var u=n(e,2);r=u[0],a=u[1]}}else if("array"===t){i.default.isString(e)&&(e=JSON.parse(e));var c=n(e,2);r=c[0],a=c[1]}else"object"===t&&(i.default.isString(e)&&(e=JSON.parse(e)),r=e.lon,a=e.lat);r=i.default.toNumber(r),a=i.default.toNumber(a)}catch(t){return o.ERROR}return i.default.isNaN(r)||r>180||r<-180||i.default.isNaN(a)||a>90||a<-90?o.ERROR:[r,a]};var a,i=(a=r(96486))&&a.__esModule?a:{default:a},o=r(23934)},61730:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});var n=r(34896);Object.defineProperty(e,"castAny",{enumerable:!0,get:function(){return n.castAny}});var a=r(56160);Object.defineProperty(e,"castArray",{enumerable:!0,get:function(){return a.castArray}});var i=r(99166);Object.defineProperty(e,"castBoolean",{enumerable:!0,get:function(){return i.castBoolean}});var o=r(20978);Object.defineProperty(e,"castDate",{enumerable:!0,get:function(){return o.castDate}});var s=r(26899);Object.defineProperty(e,"castDatetime",{enumerable:!0,get:function(){return s.castDatetime}});var l=r(8825);Object.defineProperty(e,"castDuration",{enumerable:!0,get:function(){return l.castDuration}});var u=r(94691);Object.defineProperty(e,"castGeojson",{enumerable:!0,get:function(){return u.castGeojson}});var c=r(66781);Object.defineProperty(e,"castGeopoint",{enumerable:!0,get:function(){return c.castGeopoint}});var h=r(69134);Object.defineProperty(e,"castInteger",{enumerable:!0,get:function(){return h.castInteger}});var d=r(73564);Object.defineProperty(e,"castNumber",{enumerable:!0,get:function(){return d.castNumber}});var f=r(53725);Object.defineProperty(e,"castObject",{enumerable:!0,get:function(){return f.castObject}});var p=r(22827);Object.defineProperty(e,"castString",{enumerable:!0,get:function(){return p.castString}});var m=r(89671);Object.defineProperty(e,"castTime",{enumerable:!0,get:function(){return m.castTime}});var g=r(39473);Object.defineProperty(e,"castYear",{enumerable:!0,get:function(){return g.castYear}});var y=r(739);Object.defineProperty(e,"castYearmonth",{enumerable:!0,get:function(){return y.castYearmonth}})},69134:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.castInteger=function(t,e){if(!a.default.isInteger(e)){if(!a.default.isString(e))return i.ERROR;try{var r=parseInt(e,10);if(a.default.isNaN(r)||r.toString()!==e)return i.ERROR;e=r}catch(t){return i.ERROR}}return e};var n,a=(n=r(96486))&&n.__esModule?n:{default:n},i=r(23934)},73564:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.castNumber=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=!1,c=r.currency||!1,h=r.decimalChar||o,d=r.groupChar||s;if(!a.default.isNumber(e)){if(!a.default.isString(e))return i.ERROR;if(!e.length)return i.ERROR;e=(e=(e=e.replace(new RegExp("\\s","g"),"")).replace(new RegExp("["+h+"]","g"),".")).replace(new RegExp("["+d+"]","g"),""),c&&(e=e.replace(new RegExp("["+u+"]","g"),""));var f=e.replace(new RegExp("["+l+"]","g"),"");e!==f&&(n=!0,e=f);try{e=a.default.toNumber(e)}catch(t){return i.ERROR}}return a.default.isNaN(e)?i.ERROR:(n&&(e/=100),e)};var n,a=(n=r(96486))&&n.__esModule?n:{default:n},i=r(23934),o=".",s="",l="%‰‱%﹪٪",u="$£€"},53725:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.castObject=function(t,e){if(!a.default.isObject(e)){if(!a.default.isString(e))return i.ERROR;try{e=JSON.parse(e)}catch(t){return i.ERROR}if(!a.default.isPlainObject(e))return i.ERROR}return e};var n,a=(n=r(96486))&&n.__esModule?n:{default:n},i=r(23934)},22827:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.castString=function(t,e){if(!a.default.isString(e))return i.ERROR;if("uri"===t){if(!o.exec(e))return i.ERROR}else if("email"===t&&!s.exec(e))return i.ERROR;return e};var n,a=(n=r(96486))&&n.__esModule?n:{default:n},i=r(23934),o=new RegExp("^http[s]?://"),s=new RegExp("[^@]+@[^@]+\\.[^@]+")},89671:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.castTime=function(t,e){if(!n.default.isDate(e)){if(!n.default.isString(e))return o.ERROR;try{if("default"===t?e=(0,a.default)((0,i.timeParse)(l)(e)):"any"===t?e=(0,a.default)(e):(t.startsWith("fmt:")&&(console.warn('Format "fmt:<PATTERN>" is deprecated.\n Please use "<PATTERN>" without "fmt:" prefix.'),t=t.replace("fmt:","")),e=(0,a.default)((0,i.timeParse)(t)(e))),!e.isValid())return o.ERROR;e=e.toDate()}catch(t){return o.ERROR}}return e};var n=s(r(96486)),a=s(r(5582)),i=r(14660),o=r(23934);function s(t){return t&&t.__esModule?t:{default:t}}var l="%H:%M:%S"},39473:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.castYear=function(t,e){if(!a.default.isInteger(e)){if(!a.default.isString(e))return i.ERROR;if(4!==e.length)return i.ERROR;try{var r=parseInt(e,10);if(a.default.isNaN(r)||r.toString()!==e)return i.ERROR;e=r}catch(t){return i.ERROR}}return e<0||e>9999?i.ERROR:e};var n,a=(n=r(96486))&&n.__esModule?n:{default:n},i=r(23934)},739:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});e.castYearmonth=function(t,e){if(a.default.isArray(e)){if(2!==e.length)return i.ERROR}else{if(!a.default.isString(e))return i.ERROR;try{var r=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=[],n=!0,a=!1,i=void 0;try{for(var o,s=t[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!e||r.length!==e);n=!0);}catch(t){a=!0,i=t}finally{try{!n&&s.return&&s.return()}finally{if(a)throw i}}return r}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(e.split("-"),2),n=r[0],o=r[1];if(n=parseInt(n,10),o=parseInt(o,10),!n||!o)return i.ERROR;if(o<1||o>12)return i.ERROR;e=[n,o]}catch(t){return i.ERROR}}return e};var n,a=(n=r(96486))&&n.__esModule?n:{default:n},i=r(23934)},31603:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});var n,a="src/virtualized-grid.js",i=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},s=(n=r(67294))&&n.__esModule?n:{default:n},l=r(70158),u=r(45865);function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function h(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function d(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}function f(t){var e=t.data,r=t.schema||function(t,e){var r=function(t,e){return Array.from({length:e},(function(){var e=Math.floor(Math.random()*t.length);return t[e]}))}(t,e),n=Array.from(r.reduce((function(t,e){return new Set([].concat(d(Array.from(t)),d(Object.keys(e))))}),new Set)),a=r.map((function(t){return Object.values(t)}));return(0,u.infer)(n,a)}(e,t.sampleSize),n=r.fields.map((function(t){return t.name})).reduce((function(t,e){return o({},t,function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}({},e,e))}),{});return{data:[n].concat(d(e)),schema:r}}var p=function(t){function e(){var t,r,n;c(this,e);for(var i=arguments.length,o=Array(i),l=0;l<i;l++)o[l]=arguments[l];return r=n=h(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(o))),n.state={data:[],schema:{fields:[]}},n.cellRenderer=function(t){var e=t.columnIndex,r=t.key,i=(t.parent,t.rowIndex),o=t.style,l=n.state.schema.fields[e],u=l.name,c=l.type,h=n.state.data[i][u];return s.default.createElement("div",{key:r,style:m.cell({columnIndex:e,rowIndex:i,style:o,type:c,theme:n.props.theme}),__source:{fileName:a,lineNumber:101}},h)},h(n,r)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),i(e,[{key:"componentWillMount",value:function(){var t=f(this.props);this.setState(t)}},{key:"componentWillReceiveProps",value:function(t){var e=f(t);this.setState(e)}},{key:"render",value:function(){var t=this,e=this.state.data.length,r=this.props,n=r.rowHeight,i=r.maxRows,o=e*n>i*n?i*n:e*n;return s.default.createElement(l.AutoSizer,{disableHeight:!0,__source:{fileName:a,lineNumber:124}},(function(r){var i=r.width;return s.default.createElement(l.ColumnSizer,{columnMaxWidth:t.props.columnMaxWidth,columnMinWidth:t.props.columnMinWidth,columnCount:t.state.schema.fields.length,width:i,__source:{fileName:a,lineNumber:126}},(function(r){var i=r.adjustedWidth,u=r.getColumnWidth,c=r.registerChild;return s.default.createElement(l.MultiGrid,{ref:c,cellRenderer:t.cellRenderer,columnCount:t.state.schema.fields.length,columnWidth:u,fixedColumnCount:1,fixedRowCount:1,height:t.props.height||o,overscanColumnCount:15,overscanRowCount:150,rowCount:e,rowHeight:n,width:t.props.width||i,__source:{fileName:a,lineNumber:133}})}))}))}}]),e}(s.default.Component);p.defaultProps={theme:"light",rowHeight:36,maxRows:10,columnMinWidth:100,columnMaxWidth:300,sampleSize:10},e.default=p;var m={cell:function(t){var e=t.columnIndex,r=t.rowIndex,n=t.style,a=t.type,i=t.theme;return o({},n,{boxSizing:"border-box",padding:"0.5em 1em",border:"nteract"===i?"1px solid #495F7D":"1px solid #ddd",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},0!==r?{borderTop:"none"}:{},0!==e?{borderLeft:"none"}:{},r%2==0&&0!==r&&0!==e?"nteract"===i?{background:"rgba(255,255,255,0.075)"}:{background:"rgba(0, 0, 0, 0.03)"}:{},0===r||0===e?"nteract"===i?{background:"rgba(0,0,0,0.25)",fontWeight:"bold"}:{background:"rgba(0, 0, 0, 0.06)",fontWeight:"bold"}:{},0===r||0===e||"number"!==a&&"integer"!==a?{textAlign:"left"}:{textAlign:"right"})}}},56960:(t,e,r)=>{var n=r(82569);Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.PlotlyNullTransform=e.PlotlyTransform=void 0;var a=n(r(25550)),i=n(r(16508)),o=n(r(54998)),s=n(r(47136)),l=n(r(54959)),u=n(r(83174)),c=n(r(89653)),h=n(r(36861)),d=n(r(67294)),f=r(96486),p=function(){return null};e.PlotlyNullTransform=p,p.MIMETYPE="text/vnd.plotly.v1+html";var m=function(t){function e(){var t,r;(0,i.default)(this,e);for(var n=arguments.length,o=new Array(n),u=0;u<n;u++)o[u]=arguments[u];return r=(0,s.default)(this,(t=(0,l.default)(e)).call.apply(t,[this].concat(o))),(0,h.default)((0,c.default)((0,c.default)(r)),"plotDivRef",(function(t){r.plotDiv=t})),(0,h.default)((0,c.default)((0,c.default)(r)),"getFigure",(function(){var t=r.props.data;if("string"==typeof t)return JSON.parse(t);if((0,a.default)(t))return(0,f.cloneDeep)(t);var e=t.data,n=void 0===e?{}:e,i=t.layout;return{data:n,layout:void 0===i?{}:i}})),r}return(0,u.default)(e,t),(0,o.default)(e,[{key:"componentDidMount",value:function(){var t=this.getFigure();this.Plotly=r(26867),this.Plotly.newPlot(this.plotDiv,t.data,t.layout)}},{key:"shouldComponentUpdate",value:function(t){return this.props.data!==t.data}},{key:"componentDidUpdate",value:function(){var t=this.getFigure();this.plotDiv&&(this.plotDiv.data=t.data,this.plotDiv.layout=t.layout,this.Plotly.redraw(this.plotDiv))}},{key:"render",value:function(){var t=this.getFigure().layout,e={};return t&&t.height&&!t.autosize&&(e.height=t.height),d.default.createElement("div",{ref:this.plotDivRef,style:e})}}]),e}(d.default.Component);e.PlotlyTransform=m,(0,h.default)(m,"MIMETYPE","application/vnd.plotly.v1+json");var g=m;e.default=g},26378:(t,e,r)=>{t.exports={default:r(3597),__esModule:!0}},40863:(t,e,r)=>{t.exports={default:r(21035),__esModule:!0}},52945:(t,e,r)=>{t.exports={default:r(56981),__esModule:!0}},85861:(t,e,r)=>{t.exports={default:r(45627),__esModule:!0}},32242:(t,e,r)=>{t.exports={default:r(33391),__esModule:!0}},8177:(t,e,r)=>{t.exports={default:r(67036),__esModule:!0}},85105:(t,e,r)=>{t.exports={default:r(30381),__esModule:!0}},88902:(t,e,r)=>{t.exports={default:r(98613),__esModule:!0}},85345:(t,e,r)=>{t.exports={default:r(70433),__esModule:!0}},93516:(t,e,r)=>{t.exports={default:r(80025),__esModule:!0}},64275:(t,e,r)=>{t.exports={default:r(52392),__esModule:!0}},99663:(t,e)=>{e.__esModule=!0,e.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},22600:(t,e,r)=>{var n,a=(n=r(32242))&&n.__esModule?n:{default:n};e.Z=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),(0,a.default)(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}()},88239:(t,e,r)=>{e.__esModule=!0;var n,a=(n=r(52945))&&n.__esModule?n:{default:n};e.default=a.default||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}},93196:(t,e,r)=>{e.__esModule=!0;var n=o(r(85345)),a=o(r(85861)),i=o(r(72444));function o(t){return t&&t.__esModule?t:{default:t}}e.default=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(void 0===e?"undefined":(0,i.default)(e)));t.prototype=(0,a.default)(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(n.default?(0,n.default)(t,e):t.__proto__=e)}},42723:(t,e)=>{e.__esModule=!0,e.default=function(t,e){var r={};for(var n in t)e.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return r}},49135:(t,e,r)=>{e.__esModule=!0;var n,a=(n=r(72444))&&n.__esModule?n:{default:n};e.default=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==(void 0===e?"undefined":(0,a.default)(e))&&"function"!=typeof e?t:e}},12424:(t,e,r)=>{e.__esModule=!0;var n=i(r(40863)),a=i(r(26378));function i(t){return t&&t.__esModule?t:{default:t}}e.default=function(t,e){if(Array.isArray(t))return t;if((0,n.default)(Object(t)))return function(t,e){var r=[],n=!0,i=!1,o=void 0;try{for(var s,l=(0,a.default)(t);!(n=(s=l.next()).done)&&(r.push(s.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{!n&&l.return&&l.return()}finally{if(i)throw o}}return r}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}},72444:(t,e,r)=>{e.__esModule=!0;var n=o(r(64275)),a=o(r(93516)),i="function"==typeof a.default&&"symbol"==typeof n.default?function(t){return typeof t}:function(t){return t&&"function"==typeof a.default&&t.constructor===a.default&&t!==a.default.prototype?"symbol":typeof t};function o(t){return t&&t.__esModule?t:{default:t}}e.default="function"==typeof a.default&&"symbol"===i(n.default)?function(t){return void 0===t?"undefined":i(t)}:function(t){return t&&"function"==typeof a.default&&t.constructor===a.default&&t!==a.default.prototype?"symbol":void 0===t?"undefined":i(t)}},94184:(t,e)=>{var r;!function(){var n={}.hasOwnProperty;function a(){for(var t=[],e=0;e<arguments.length;e++){var r=arguments[e];if(r){var i=typeof r;if("string"===i||"number"===i)t.push(r);else if(Array.isArray(r)){if(r.length){var o=a.apply(null,r);o&&t.push(o)}}else if("object"===i)if(r.toString===Object.prototype.toString)for(var s in r)n.call(r,s)&&r[s]&&t.push(s);else t.push(r.toString())}}return t.join(" ")}t.exports?(a.default=a,t.exports=a):void 0===(r=function(){return a}.apply(e,[]))||(t.exports=r)}()},3597:(t,e,r)=>{r(73871),r(91867),t.exports=r(46459)},21035:(t,e,r)=>{r(73871),r(91867),t.exports=r(89553)},56981:(t,e,r)=>{r(72699),t.exports=r(34579).Object.assign},99785:(t,e,r)=>{r(7008),t.exports=r(34579).Object.isFrozen},98613:(t,e,r)=>{r(40961),t.exports=r(34579).Object.keys},46459:(t,e,r)=>{var n=r(12159),a=r(83728);t.exports=r(34579).getIterator=function(t){var e=a(t);if("function"!=typeof e)throw TypeError(t+" is not iterable!");return n(e.call(t))}},89553:(t,e,r)=>{var n=r(14677),a=r(22939)("iterator"),i=r(15449);t.exports=r(34579).isIterable=function(t){var e=Object(t);return void 0!==e[a]||"@@iterator"in e||i.hasOwnProperty(n(e))}},72699:(t,e,r)=>{var n=r(83856);n(n.S+n.F,"Object",{assign:r(88082)})},7008:(t,e,r)=>{var n=r(36727);r(12584)("isFrozen",(function(t){return function(e){return!n(e)||!!t&&t(e)}}))},40961:(t,e,r)=>{var n=r(66530),a=r(46162);r(12584)("keys",(function(){return function(t){return a(n(t))}}))},14660:(t,e,r)=>{r.r(e),r.d(e,{isoFormat:()=>oe,isoParse:()=>se,timeFormat:()=>F,timeFormatDefaultLocale:()=>ae,timeFormatLocale:()=>I,timeParse:()=>N,utcFormat:()=>Y,utcParse:()=>j});var n=new Date,a=new Date;function i(t,e,r,o){function s(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return s.floor=function(e){return t(e=new Date(+e)),e},s.ceil=function(r){return t(r=new Date(r-1)),e(r,1),t(r),r},s.round=function(t){var e=s(t),r=s.ceil(t);return t-e<r-t?e:r},s.offset=function(t,r){return e(t=new Date(+t),null==r?1:Math.floor(r)),t},s.range=function(r,n,a){var i,o=[];if(r=s.ceil(r),a=null==a?1:Math.floor(a),!(r<n&&a>0))return o;do{o.push(i=new Date(+r)),e(r,a),t(r)}while(i<r&&r<n);return o},s.filter=function(r){return i((function(e){if(e>=e)for(;t(e),!r(e);)e.setTime(e-1)}),(function(t,n){if(t>=t)if(n<0)for(;++n<=0;)for(;e(t,-1),!r(t););else for(;--n>=0;)for(;e(t,1),!r(t););}))},r&&(s.count=function(e,i){return n.setTime(+e),a.setTime(+i),t(n),t(a),Math.floor(r(n,a))},s.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?s.filter(o?function(e){return o(e)%t==0}:function(e){return s.count(0,e)%t==0}):s:null}),s}var o=864e5,s=6048e5;function l(t){return i((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/s}))}var u=l(0),c=l(1),h=l(2),d=l(3),f=l(4),p=l(5),m=l(6),g=(u.range,c.range,h.range,d.range,f.range,p.range,m.range,i((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/o}),(function(t){return t.getUTCDate()-1})));const y=g;function v(t){return i((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/s}))}g.range;var _=v(0),x=v(1),b=v(2),w=v(3),M=v(4),k=v(5),T=v(6),L=(_.range,x.range,b.range,w.range,M.range,k.range,T.range,i((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/o}),(function(t){return t.getDate()-1})));const A=L;L.range;var S=i((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));S.every=function(t){return isFinite(t=Math.floor(t))&&t>0?i((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,r){e.setFullYear(e.getFullYear()+r*t)})):null};const E=S;S.range;var C=i((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));C.every=function(t){return isFinite(t=Math.floor(t))&&t>0?i((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,r){e.setUTCFullYear(e.getUTCFullYear()+r*t)})):null};const D=C;function P(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function O(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function z(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function I(t){var e=t.dateTime,r=t.date,n=t.time,a=t.periods,i=t.days,o=t.shortDays,s=t.months,l=t.shortMonths,u=q(a),h=Z(a),d=q(i),f=Z(i),p=q(o),m=Z(o),g=q(s),v=Z(s),_=q(l),b=Z(l),w={a:function(t){return o[t.getDay()]},A:function(t){return i[t.getDay()]},b:function(t){return l[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:null,d:mt,e:mt,f:xt,g:Dt,G:Ot,H:gt,I:yt,j:vt,L:_t,m:bt,M:wt,p:function(t){return a[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:re,s:ne,S:Mt,u:kt,U:Tt,V:At,w:St,W:Et,x:null,X:null,y:Ct,Y:Pt,Z:zt,"%":ee},M={a:function(t){return o[t.getUTCDay()]},A:function(t){return i[t.getUTCDay()]},b:function(t){return l[t.getUTCMonth()]},B:function(t){return s[t.getUTCMonth()]},c:null,d:It,e:It,f:jt,g:Kt,G:Qt,H:Rt,I:Ft,j:Nt,L:Yt,m:Bt,M:Ht,p:function(t){return a[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:re,s:ne,S:Ut,u:Vt,U:Wt,V:qt,w:Zt,W:Xt,x:null,X:null,y:Jt,Y:$t,Z:te,"%":ee},k={a:function(t,e,r){var n=p.exec(e.slice(r));return n?(t.w=m[n[0].toLowerCase()],r+n[0].length):-1},A:function(t,e,r){var n=d.exec(e.slice(r));return n?(t.w=f[n[0].toLowerCase()],r+n[0].length):-1},b:function(t,e,r){var n=_.exec(e.slice(r));return n?(t.m=b[n[0].toLowerCase()],r+n[0].length):-1},B:function(t,e,r){var n=g.exec(e.slice(r));return n?(t.m=v[n[0].toLowerCase()],r+n[0].length):-1},c:function(t,r,n){return S(t,e,r,n)},d:it,e:it,f:ht,g:et,G:tt,H:st,I:st,j:ot,L:ct,m:at,M:lt,p:function(t,e,r){var n=u.exec(e.slice(r));return n?(t.p=h[n[0].toLowerCase()],r+n[0].length):-1},q:nt,Q:ft,s:pt,S:ut,u:J,U:K,V:$,w:X,W:Q,x:function(t,e,n){return S(t,r,e,n)},X:function(t,e,r){return S(t,n,e,r)},y:et,Y:tt,Z:rt,"%":dt};function T(t,e){return function(r){var n,a,i,o=[],s=-1,l=0,u=t.length;for(r instanceof Date||(r=new Date(+r));++s<u;)37===t.charCodeAt(s)&&(o.push(t.slice(l,s)),null!=(a=B[n=t.charAt(++s)])?n=t.charAt(++s):a="e"===n?" ":"0",(i=e[n])&&(n=i(r,a)),o.push(n),l=s+1);return o.push(t.slice(l,s)),o.join("")}}function L(t,e){return function(r){var n,a,i=z(1900,void 0,1);if(S(i,t,r+="",0)!=r.length)return null;if("Q"in i)return new Date(i.Q);if("s"in i)return new Date(1e3*i.s+("L"in i?i.L:0));if(e&&!("Z"in i)&&(i.Z=0),"p"in i&&(i.H=i.H%12+12*i.p),void 0===i.m&&(i.m="q"in i?i.q:0),"V"in i){if(i.V<1||i.V>53)return null;"w"in i||(i.w=1),"Z"in i?(a=(n=O(z(i.y,0,1))).getUTCDay(),n=a>4||0===a?c.ceil(n):c(n),n=y.offset(n,7*(i.V-1)),i.y=n.getUTCFullYear(),i.m=n.getUTCMonth(),i.d=n.getUTCDate()+(i.w+6)%7):(a=(n=P(z(i.y,0,1))).getDay(),n=a>4||0===a?x.ceil(n):x(n),n=A.offset(n,7*(i.V-1)),i.y=n.getFullYear(),i.m=n.getMonth(),i.d=n.getDate()+(i.w+6)%7)}else("W"in i||"U"in i)&&("w"in i||(i.w="u"in i?i.u%7:"W"in i?1:0),a="Z"in i?O(z(i.y,0,1)).getUTCDay():P(z(i.y,0,1)).getDay(),i.m=0,i.d="W"in i?(i.w+6)%7+7*i.W-(a+5)%7:i.w+7*i.U-(a+6)%7);return"Z"in i?(i.H+=i.Z/100|0,i.M+=i.Z%100,O(i)):P(i)}}function S(t,e,r,n){for(var a,i,o=0,s=e.length,l=r.length;o<s;){if(n>=l)return-1;if(37===(a=e.charCodeAt(o++))){if(a=e.charAt(o++),!(i=k[a in B?e.charAt(o++):a])||(n=i(t,r,n))<0)return-1}else if(a!=r.charCodeAt(n++))return-1}return n}return w.x=T(r,w),w.X=T(n,w),w.c=T(e,w),M.x=T(r,M),M.X=T(n,M),M.c=T(e,M),{format:function(t){var e=T(t+="",w);return e.toString=function(){return t},e},parse:function(t){var e=L(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=T(t+="",M);return e.toString=function(){return t},e},utcParse:function(t){var e=L(t+="",!0);return e.toString=function(){return t},e}}}C.range;var R,F,N,Y,j,B={"-":"",_:" ",0:"0"},H=/^\s*\d+/,U=/^%/,V=/[\\^$*+?|[\]().{}]/g;function W(t,e,r){var n=t<0?"-":"",a=(n?-t:t)+"",i=a.length;return n+(i<r?new Array(r-i+1).join(e)+a:a)}function G(t){return t.replace(V,"\\$&")}function q(t){return new RegExp("^(?:"+t.map(G).join("|")+")","i")}function Z(t){for(var e={},r=-1,n=t.length;++r<n;)e[t[r].toLowerCase()]=r;return e}function X(t,e,r){var n=H.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function J(t,e,r){var n=H.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function K(t,e,r){var n=H.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function $(t,e,r){var n=H.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function Q(t,e,r){var n=H.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function tt(t,e,r){var n=H.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function et(t,e,r){var n=H.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function rt(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function nt(t,e,r){var n=H.exec(e.slice(r,r+1));return n?(t.q=3*n[0]-3,r+n[0].length):-1}function at(t,e,r){var n=H.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function it(t,e,r){var n=H.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function ot(t,e,r){var n=H.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function st(t,e,r){var n=H.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function lt(t,e,r){var n=H.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function ut(t,e,r){var n=H.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function ct(t,e,r){var n=H.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function ht(t,e,r){var n=H.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function dt(t,e,r){var n=U.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function ft(t,e,r){var n=H.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function pt(t,e,r){var n=H.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function mt(t,e){return W(t.getDate(),e,2)}function gt(t,e){return W(t.getHours(),e,2)}function yt(t,e){return W(t.getHours()%12||12,e,2)}function vt(t,e){return W(1+A.count(E(t),t),e,3)}function _t(t,e){return W(t.getMilliseconds(),e,3)}function xt(t,e){return _t(t,e)+"000"}function bt(t,e){return W(t.getMonth()+1,e,2)}function wt(t,e){return W(t.getMinutes(),e,2)}function Mt(t,e){return W(t.getSeconds(),e,2)}function kt(t){var e=t.getDay();return 0===e?7:e}function Tt(t,e){return W(_.count(E(t)-1,t),e,2)}function Lt(t){var e=t.getDay();return e>=4||0===e?M(t):M.ceil(t)}function At(t,e){return t=Lt(t),W(M.count(E(t),t)+(4===E(t).getDay()),e,2)}function St(t){return t.getDay()}function Et(t,e){return W(x.count(E(t)-1,t),e,2)}function Ct(t,e){return W(t.getFullYear()%100,e,2)}function Dt(t,e){return W((t=Lt(t)).getFullYear()%100,e,2)}function Pt(t,e){return W(t.getFullYear()%1e4,e,4)}function Ot(t,e){var r=t.getDay();return W((t=r>=4||0===r?M(t):M.ceil(t)).getFullYear()%1e4,e,4)}function zt(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+W(e/60|0,"0",2)+W(e%60,"0",2)}function It(t,e){return W(t.getUTCDate(),e,2)}function Rt(t,e){return W(t.getUTCHours(),e,2)}function Ft(t,e){return W(t.getUTCHours()%12||12,e,2)}function Nt(t,e){return W(1+y.count(D(t),t),e,3)}function Yt(t,e){return W(t.getUTCMilliseconds(),e,3)}function jt(t,e){return Yt(t,e)+"000"}function Bt(t,e){return W(t.getUTCMonth()+1,e,2)}function Ht(t,e){return W(t.getUTCMinutes(),e,2)}function Ut(t,e){return W(t.getUTCSeconds(),e,2)}function Vt(t){var e=t.getUTCDay();return 0===e?7:e}function Wt(t,e){return W(u.count(D(t)-1,t),e,2)}function Gt(t){var e=t.getUTCDay();return e>=4||0===e?f(t):f.ceil(t)}function qt(t,e){return t=Gt(t),W(f.count(D(t),t)+(4===D(t).getUTCDay()),e,2)}function Zt(t){return t.getUTCDay()}function Xt(t,e){return W(c.count(D(t)-1,t),e,2)}function Jt(t,e){return W(t.getUTCFullYear()%100,e,2)}function Kt(t,e){return W((t=Gt(t)).getUTCFullYear()%100,e,2)}function $t(t,e){return W(t.getUTCFullYear()%1e4,e,4)}function Qt(t,e){var r=t.getUTCDay();return W((t=r>=4||0===r?f(t):f.ceil(t)).getUTCFullYear()%1e4,e,4)}function te(){return"+0000"}function ee(){return"%"}function re(t){return+t}function ne(t){return Math.floor(+t/1e3)}function ae(t){return R=I(t),F=R.format,N=R.parse,Y=R.utcFormat,j=R.utcParse,R}ae({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",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"]});var ie="%Y-%m-%dT%H:%M:%S.%LZ";const oe=Date.prototype.toISOString?function(t){return t.toISOString()}:Y(ie),se=+new Date("2000-01-01T00:00:00.000Z")?function(t){var e=new Date(t);return isNaN(e)?null:e}:j(ie)},50139:(t,e)=>{e.__esModule=!0,e.default=void 0;var r=!("undefined"==typeof window||!window.document||!window.document.createElement);e.default=r,t.exports=e.default},44825:(t,e,r)=>{var n=r(64836);e.__esModule=!0,e.default=function(t){if((!a&&0!==a||t)&&i.default){var e=document.createElement("div");e.style.position="absolute",e.style.top="-9999px",e.style.width="50px",e.style.height="50px",e.style.overflow="scroll",document.body.appendChild(e),a=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return a};var a,i=n(r(50139));t.exports=e.default},42786:function(t,e,r){r(5582).defineLocale("af",{months:"Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des".split("_"),weekdays:"Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag".split("_"),weekdaysShort:"Son_Maa_Din_Woe_Don_Vry_Sat".split("_"),weekdaysMin:"So_Ma_Di_Wo_Do_Vr_Sa".split("_"),meridiemParse:/vm|nm/i,isPM:function(t){return/^nm$/i.test(t)},meridiem:function(t,e,r){return t<12?r?"vm":"VM":r?"nm":"NM"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Vandag om] LT",nextDay:"[Môre om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gister om] LT",lastWeek:"[Laas] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oor %s",past:"%s gelede",s:"'n paar sekondes",ss:"%d sekondes",m:"'n minuut",mm:"%d minute",h:"'n uur",hh:"%d ure",d:"'n dag",dd:"%d dae",M:"'n maand",MM:"%d maande",y:"'n jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(t){return t+(1===t||8===t||t>=20?"ste":"de")},week:{dow:1,doy:4}})},14130:function(t,e,r){var n,a,i,o,s;n=r(5582),a=function(t){return 0===t?0:1===t?1:2===t?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5},i={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},o=function(t){return function(e,r,n,o){var s=a(e),l=i[t][a(e)];return 2===s&&(l=l[r?0:1]),l.replace(/%d/i,e)}},s=["جانفي","فيفري","مارس","أفريل","ماي","جوان","جويلية","أوت","سبتمبر","أكتوبر","نوفمبر","ديسمبر"],n.defineLocale("ar-dz",{months:s,monthsShort:s,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(t){return"م"===t},meridiem:function(t,e,r){return t<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:o("s"),ss:o("s"),m:o("m"),mm:o("m"),h:o("h"),hh:o("h"),d:o("d"),dd:o("d"),M:o("M"),MM:o("M"),y:o("y"),yy:o("y")},postformat:function(t){return t.replace(/,/g,"،")},week:{dow:0,doy:4}})},96135:function(t,e,r){r(5582).defineLocale("ar-kw",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:0,doy:12}})},56440:function(t,e,r){var n,a,i,o,s,l;n=r(5582),a={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",0:"0"},i=function(t){return 0===t?0:1===t?1:2===t?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5},o={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},s=function(t){return function(e,r,n,a){var s=i(e),l=o[t][i(e)];return 2===s&&(l=l[r?0:1]),l.replace(/%d/i,e)}},l=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"],n.defineLocale("ar-ly",{months:l,monthsShort:l,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(t){return"م"===t},meridiem:function(t,e,r){return t<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:s("s"),ss:s("s"),m:s("m"),mm:s("m"),h:s("h"),hh:s("h"),d:s("d"),dd:s("d"),M:s("M"),MM:s("M"),y:s("y"),yy:s("y")},preparse:function(t){return t.replace(/،/g,",")},postformat:function(t){return t.replace(/\d/g,(function(t){return a[t]})).replace(/,/g,"،")},week:{dow:6,doy:12}})},47702:function(t,e,r){r(5582).defineLocale("ar-ma",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})},16040:function(t,e,r){var n,a,i;n=r(5582),a={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},i={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},n.defineLocale("ar-sa",{months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(t){return"م"===t},meridiem:function(t,e,r){return t<12?"ص":"م"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},preparse:function(t){return t.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(t){return i[t]})).replace(/،/g,",")},postformat:function(t){return t.replace(/\d/g,(function(t){return a[t]})).replace(/,/g,"،")},week:{dow:0,doy:6}})},37100:function(t,e,r){r(5582).defineLocale("ar-tn",{months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})},30867:function(t,e,r){var n,a,i,o,s,l,u;n=r(5582),a={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},i={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},o=function(t){return 0===t?0:1===t?1:2===t?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5},s={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},l=function(t){return function(e,r,n,a){var i=o(e),l=s[t][o(e)];return 2===i&&(l=l[r?0:1]),l.replace(/%d/i,e)}},u=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"],n.defineLocale("ar",{months:u,monthsShort:u,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(t){return"م"===t},meridiem:function(t,e,r){return t<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:l("s"),ss:l("s"),m:l("m"),mm:l("m"),h:l("h"),hh:l("h"),d:l("d"),dd:l("d"),M:l("M"),MM:l("M"),y:l("y"),yy:l("y")},preparse:function(t){return t.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(t){return i[t]})).replace(/،/g,",")},postformat:function(t){return t.replace(/\d/g,(function(t){return a[t]})).replace(/,/g,"،")},week:{dow:6,doy:12}})},31083:function(t,e,r){var n,a;n=r(5582),a={1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-üncü",4:"-üncü",100:"-üncü",6:"-ncı",9:"-uncu",10:"-uncu",30:"-uncu",60:"-ıncı",90:"-ıncı"},n.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[gələn həftə] dddd [saat] LT",lastDay:"[dünən] LT",lastWeek:"[keçən həftə] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"bir neçə saniyə",ss:"%d saniyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gecə|səhər|gündüz|axşam/,isPM:function(t){return/^(gündüz|axşam)$/.test(t)},meridiem:function(t,e,r){return t<4?"gecə":t<12?"səhər":t<17?"gündüz":"axşam"},dayOfMonthOrdinalParse:/\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,ordinal:function(t){if(0===t)return t+"-ıncı";var e=t%10;return t+(a[e]||a[t%100-e]||a[t>=100?100:null])},week:{dow:1,doy:7}})},9808:function(t,e,r){!function(t){function e(t,e,r){return"m"===r?e?"хвіліна":"хвіліну":"h"===r?e?"гадзіна":"гадзіну":t+" "+(n=+t,a={ss:e?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:e?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:e?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"}[r].split("_"),n%10==1&&n%100!=11?a[0]:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?a[1]:a[2]);var n,a}t.defineLocale("be",{months:{format:"студзеня_лютага_сакавікарасавікараўня_чэрвеня_ліпеня_жніўня_верасня_кастрычнікаістапада_снежня".split("_"),standalone:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_")},monthsShort:"студ_лют_сак_красрав_чэрв_ліп_жнів_вераст_ліст_снеж".split("_"),weekdays:{format:"нядзелю_панядзелак_аўторак_серадуацвер_пятніцу_суботу".split("_"),standalone:"нядзеля_панядзелак_аўторак_серадаацвер_пятніца_субота".split("_"),isFormat:/\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/},weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:e,mm:e,h:e,hh:e,d:"дзень",dd:e,M:"месяц",MM:e,y:"год",yy:e},meridiemParse:/ночы|раніцы|дня|вечара/,isPM:function(t){return/^(дня|вечара)$/.test(t)},meridiem:function(t,e,r){return t<4?"ночы":t<12?"раніцы":t<17?"дня":"вечара"},dayOfMonthOrdinalParse:/\d{1,2}-(і|ы|га)/,ordinal:function(t,e){switch(e){case"M":case"d":case"DDD":case"w":case"W":return t%10!=2&&t%10!=3||t%100==12||t%100==13?t+"-ы":t+"-і";case"D":return t+"-га";default:return t}},week:{dow:1,doy:7}})}(r(5582))},68338:function(t,e,r){r(5582).defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"януев_мар_апрай_юни_юли_авг_сеп_окт_ноеек".split("_"),weekdays:"неделя_понеделник_вторник_срядаетвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Миналата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[Миналия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",ss:"%d секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",w:"седмица",ww:"%d седмици",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(t){var e=t%10,r=t%100;return 0===t?t+"-ев":0===r?t+"-ен":r>10&&r<20?t+"-ти":1===e?t+"-ви":2===e?t+"-ри":7===e||8===e?t+"-ми":t+"-ти"},week:{dow:1,doy:7}})},67438:function(t,e,r){r(5582).defineLocale("bm",{months:"Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo".split("_"),monthsShort:"Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des".split("_"),weekdays:"Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri".split("_"),weekdaysShort:"Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib".split("_"),weekdaysMin:"Ka_Nt_Ta_Ar_Al_Ju_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"MMMM [tile] D [san] YYYY",LLL:"MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm",LLLL:"dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm"},calendar:{sameDay:"[Bi lɛrɛ] LT",nextDay:"[Sini lɛrɛ] LT",nextWeek:"dddd [don lɛrɛ] LT",lastDay:"[Kunu lɛrɛ] LT",lastWeek:"dddd [tɛmɛnen lɛrɛ] LT",sameElse:"L"},relativeTime:{future:"%s kɔnɔ",past:"a bɛ %s bɔ",s:"sanga dama dama",ss:"sekondi %d",m:"miniti kelen",mm:"miniti %d",h:"lɛrɛ kelen",hh:"lɛrɛ %d",d:"tile kelen",dd:"tile %d",M:"kalo kelen",MM:"kalo %d",y:"san kelen",yy:"san %d"},week:{dow:1,doy:4}})},76225:function(t,e,r){var n,a,i;n=r(5582),a={1:"১",2:"২",3:"৩",4:"",5:"৫",6:"৬",7:"",8:"৮",9:"৯",0:""},i={"১":"1","২":"2","৩":"3","":"4","৫":"5","৬":"6","":"7","৮":"8","৯":"9","":"0"},n.defineLocale("bn-bd",{months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(t){return t.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(t){return i[t]}))},postformat:function(t){return t.replace(/\d/g,(function(t){return a[t]}))},meridiemParse:/রাত|ভোর|সকাল|দুপুর|বিকাল|সন্ধ্যা|রাত/,meridiemHour:function(t,e){return 12===t&&(t=0),"রাত"===e?t<4?t:t+12:"ভোর"===e||"সকাল"===e?t:"দুপুর"===e?t>=3?t:t+12:"বিকাল"===e||"সন্ধ্যা"===e?t+12:void 0},meridiem:function(t,e,r){return t<4?"রাত":t<6?"ভোর":t<12?"সকাল":t<15?"দুপুর":t<18?"বিকাল":t<20?"সন্ধ্যা":"রাত"},week:{dow:0,doy:6}})},8905:function(t,e,r){var n,a,i;n=r(5582),a={1:"১",2:"২",3:"৩",4:"",5:"৫",6:"৬",7:"",8:"৮",9:"৯",0:""},i={"১":"1","২":"2","৩":"3","":"4","৫":"5","৬":"6","":"7","৮":"8","৯":"9","":"0"},n.defineLocale("bn",{months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(t){return t.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(t){return i[t]}))},postformat:function(t){return t.replace(/\d/g,(function(t){return a[t]}))},meridiemParse:/রাত|সকাল|দুপুর|বিকাল|রাত/,meridiemHour:function(t,e){return 12===t&&(t=0),"রাত"===e&&t>=4||"দুপুর"===e&&t<5||"বিকাল"===e?t+12:t},meridiem:function(t,e,r){return t<4?"রাত":t<10?"সকাল":t<17?"দুপুর":t<20?"বিকাল":"রাত"},week:{dow:0,doy:6}})},11560:function(t,e,r){var n,a,i;n=r(5582),a={1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"},i={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"},n.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་1_ཟླ་2_ཟླ་3_ཟླ་4_ཟླ་5_ཟླ་6_ཟླ་7_ཟླ་8_ཟླ་9_ཟླ་10_ཟླ་11_ཟླ་12".split("_"),monthsShortRegex:/^(ཟླ་\d{1,2})/,monthsParseExact:!0,weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི_ཟླ_མིག_ལྷག_ཕུར_སངས_སྤེན".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",ss:"%d སྐར་ཆ།",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(t){return t.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,(function(t){return i[t]}))},postformat:function(t){return t.replace(/\d/g,(function(t){return a[t]}))},meridiemParse:/མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,meridiemHour:function(t,e){return 12===t&&(t=0),"མཚན་མོ"===e&&t>=4||"ཉིན་གུང"===e&&t<5||"དགོང་དག"===e?t+12:t},meridiem:function(t,e,r){return t<4?"མཚན་མོ":t<10?"ཞོགས་ཀས":t<17?"ཉིན་གུང":t<20?"དགོང་དག":"མཚན་མོ"},week:{dow:0,doy:6}})},1278:function(t,e,r){!function(t){function e(t,e,r){return t+" "+function(t,e){return 2===e?function(t){var e={m:"v",b:"v",d:"z"};return void 0===e[t.charAt(0)]?t:e[t.charAt(0)]+t.substring(1)}(t):t}({mm:"munutenn",MM:"miz",dd:"devezh"}[r],t)}function r(t){return t>9?r(t%10):t}var n=[/^gen/i,/^c[ʼ\']hwe/i,/^meu/i,/^ebr/i,/^mae/i,/^(mez|eve)/i,/^gou/i,/^eos/i,/^gwe/i,/^her/i,/^du/i,/^ker/i],a=/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu|gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,i=[/^Su/i,/^Lu/i,/^Me([^r]|$)/i,/^Mer/i,/^Ya/i,/^Gw/i,/^Sa/i];t.defineLocale("br",{months:"Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),weekdaysParse:i,fullWeekdaysParse:[/^sul/i,/^lun/i,/^meurzh/i,/^merc[ʼ\']her/i,/^yaou/i,/^gwener/i,/^sadorn/i],shortWeekdaysParse:[/^Sul/i,/^Lun/i,/^Meu/i,/^Mer/i,/^Yao/i,/^Gwe/i,/^Sad/i],minWeekdaysParse:i,monthsRegex:a,monthsShortRegex:a,monthsStrictRegex:/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu)/i,monthsShortStrictRegex:/^(gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,monthsParse:n,longMonthsParse:n,shortMonthsParse:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY HH:mm",LLLL:"dddd, D [a viz] MMMM YYYY HH:mm"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warcʼhoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Decʼh da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s ʼzo",s:"un nebeud segondennoù",ss:"%d eilenn",m:"ur vunutenn",mm:e,h:"un eur",hh:"%d eur",d:"un devezh",dd:e,M:"ur miz",MM:e,y:"ur bloaz",yy:function(t){switch(r(t)){case 1:case 3:case 4:case 5:case 9:return t+" bloaz";default:return t+" vloaz"}}},dayOfMonthOrdinalParse:/\d{1,2}(añ|vet)/,ordinal:function(t){return t+(1===t?"añ":"vet")},week:{dow:1,doy:4},meridiemParse:/a.m.|g.m./,isPM:function(t){return"g.m."===t},meridiem:function(t,e,r){return t<12?"a.m.":"g.m."}})}(r(5582))},80622:function(t,e,r){!function(t){function e(t,e,r){var n=t+" ";switch(r){case"ss":return n+(1===t?"sekunda":2===t||3===t||4===t?"sekunde":"sekundi");case"m":return e?"jedna minuta":"jedne minute";case"mm":return n+(1===t?"minuta":2===t||3===t||4===t?"minute":"minuta");case"h":return e?"jedan sat":"jednog sata";case"hh":return n+(1===t?"sat":2===t||3===t||4===t?"sata":"sati");case"dd":return n+(1===t?"dan":"dana");case"MM":return n+(1===t?"mjesec":2===t||3===t||4===t?"mjeseca":"mjeseci");case"yy":return n+(1===t?"godina":2===t||3===t||4===t?"godine":"godina")}}t.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:e,m:e,mm:e,h:e,hh:e,d:"dan",dd:e,M:"mjesec",MM:e,y:"godinu",yy:e},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(r(5582))},2468:function(t,e,r){r(5582).defineLocale("ca",{months:{standalone:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),format:"de gener_de febrer_de març_d'abril_de maig_de juny_de juliol_d'agost_de setembre_d'octubre_de novembre_de desembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.".split("_"),monthsParseExact:!0,weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dt_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a les] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a les] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"uns segons",ss:"%d segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(t,e){var r=1===t?"r":2===t?"n":3===t?"r":4===t?"t":"è";return"w"!==e&&"W"!==e||(r="a"),t+r},week:{dow:1,doy:4}})},5822:function(t,e,r){!function(t){var e={format:"leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"),standalone:"ledna_února_března_dubna_května_června_července_srpna_září_října_listopadu_prosince".split("_")},r="led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"),n=[/^led/i,/^úno/i,/^bře/i,/^dub/i,/^kvě/i,/^(čvn|červen$|června)/i,/^(čvc|červenec|července)/i,/^srp/i,/^zář/i,/^říj/i,/^lis/i,/^pro/i],a=/^(leden|únor|březen|duben|květen|červenec|července|červen|června|srpen|září|říjen|listopad|prosinec|led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i;function i(t){return t>1&&t<5&&1!=~~(t/10)}function o(t,e,r,n){var a=t+" ";switch(r){case"s":return e||n?"pár sekund":"pár sekundami";case"ss":return e||n?a+(i(t)?"sekundy":"sekund"):a+"sekundami";case"m":return e?"minuta":n?"minutu":"minutou";case"mm":return e||n?a+(i(t)?"minuty":"minut"):a+"minutami";case"h":return e?"hodina":n?"hodinu":"hodinou";case"hh":return e||n?a+(i(t)?"hodiny":"hodin"):a+"hodinami";case"d":return e||n?"den":"dnem";case"dd":return e||n?a+(i(t)?"dny":"dní"):a+"dny";case"M":return e||n?"měsíc":"měsícem";case"MM":return e||n?a+(i(t)?"měsíce":"měsíců"):a+"měsíci";case"y":return e||n?"rok":"rokem";case"yy":return e||n?a+(i(t)?"roky":"let"):a+"lety"}}t.defineLocale("cs",{months:e,monthsShort:r,monthsRegex:a,monthsShortRegex:a,monthsStrictRegex:/^(leden|ledna|února|únor|březen|března|duben|dubna|květen|května|červenec|července|červen|června|srpen|srpna|září|říjen|října|listopadu|listopad|prosinec|prosince)/i,monthsShortStrictRegex:/^(led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i,monthsParse:n,longMonthsParse:n,shortMonthsParse:n,weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zítra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(r(5582))},50877:function(t,e,r){r(5582).defineLocale("cv",{months:"кӑрлач_нарӑс_пуш_акаай_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),monthsShort:"кӑрар_пуш_акаай_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),weekdaysShort:"вырун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"},calendar:{sameDay:"[Паян] LT [сехетре]",nextDay:"[Ыран] LT [сехетре]",lastDay:"[Ӗнер] LT [сехетре]",nextWeek:"[Ҫитес] dddd LT [сехетре]",lastWeek:"[Иртнӗ] dddd LT [сехетре]",sameElse:"L"},relativeTime:{future:function(t){return t+(/сехет$/i.exec(t)?"рен":/ҫул$/i.exec(t)?"тан":"ран")},past:"%s каялла",s:"пӗр-ик ҫеккунт",ss:"%d ҫеккунт",m:"пӗр минут",mm:"%d минут",h:"пӗр сехет",hh:"%d сехет",d:"пӗр кун",dd:"%d кун",M:"пӗр уйӑх",MM:"%d уйӑх",y:"пӗр ҫул",yy:"%d ҫул"},dayOfMonthOrdinalParse:/\d{1,2}-мӗш/,ordinal:"%d-мӗш",week:{dow:1,doy:7}})},47373:function(t,e,r){r(5582).defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",ss:"%d eiliad",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},dayOfMonthOrdinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(t){var e="";return t>20?e=40===t||50===t||60===t||80===t||100===t?"fed":"ain":t>0&&(e=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"][t]),t+e},week:{dow:1,doy:4}})},24780:function(t,e,r){r(5582).defineLocale("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"på dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[i] dddd[s kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",ss:"%d sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})},60217:function(t,e,r){!function(t){function e(t,e,r,n){var a={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[t+" Tage",t+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[t+" Monate",t+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[t+" Jahre",t+" Jahren"]};return e?a[r][0]:a[r][1]}t.defineLocale("de-at",{months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:e,mm:"%d Minuten",h:e,hh:"%d Stunden",d:e,dd:e,w:e,ww:"%d Wochen",M:e,MM:e,y:e,yy:e},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(r(5582))},60894:function(t,e,r){!function(t){function e(t,e,r,n){var a={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[t+" Tage",t+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[t+" Monate",t+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[t+" Jahre",t+" Jahren"]};return e?a[r][0]:a[r][1]}t.defineLocale("de-ch",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:e,mm:"%d Minuten",h:e,hh:"%d Stunden",d:e,dd:e,w:e,ww:"%d Wochen",M:e,MM:e,y:e,yy:e},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(r(5582))},59740:function(t,e,r){!function(t){function e(t,e,r,n){var a={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[t+" Tage",t+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[t+" Monate",t+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[t+" Jahre",t+" Jahren"]};return e?a[r][0]:a[r][1]}t.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:e,mm:"%d Minuten",h:e,hh:"%d Stunden",d:e,dd:e,w:e,ww:"%d Wochen",M:e,MM:e,y:e,yy:e},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(r(5582))},5300:function(t,e,r){var n,a;n=["ޖެނުއަރީ","ފެބްރުއަރީ","މާރިޗު","އޭޕްރީލު","މޭ","ޖޫން","ޖުލައި","އޯގަސްޓު","ސެޕްޓެމްބަރު","އޮކްޓޯބަރު","ނޮވެމްބަރު","ޑިސެމްބަރު"],a=["އާދިއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"],r(5582).defineLocale("dv",{months:n,monthsShort:n,weekdays:a,weekdaysShort:a,weekdaysMin:"އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/މކ|މފ/,isPM:function(t){return"މފ"===t},meridiem:function(t,e,r){return t<12?"މކ":"މފ"},calendar:{sameDay:"[މިއަދު] LT",nextDay:"[މާދަމާ] LT",nextWeek:"dddd LT",lastDay:"[އިއްޔެ] LT",lastWeek:"[ފާއިތުވި] dddd LT",sameElse:"L"},relativeTime:{future:"ތެރޭގައި %s",past:"ކުރިން %s",s:"ސިކުންތުކޮޅެއް",ss:"d% ސިކުންތު",m:"މިނިޓެއް",mm:"މިނިޓު %d",h:"ގަޑިއިރެއް",hh:"ގަޑިއިރު %d",d:"ދުވަހެއް",dd:"ދުވަސް %d",M:"މަހެއް",MM:"މަސް %d",y:"އަހަރެއް",yy:"އަހަރު %d"},preparse:function(t){return t.replace(/،/g,",")},postformat:function(t){return t.replace(/,/g,"،")},week:{dow:7,doy:12}})},50837:function(t,e,r){r(5582).defineLocale("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(t,e){return t?"string"==typeof e&&/D/.test(e.substring(0,e.indexOf("MMMM")))?this._monthsGenitiveEl[t.month()]:this._monthsNominativeEl[t.month()]:this._monthsNominativeEl},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παραβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Παα".split("_"),meridiem:function(t,e,r){return t>11?r?"μμ":"ΜΜ":r?"πμ":"ΠΜ"},isPM:function(t){return"μ"===(t+"").toLowerCase()[0]},meridiemParse:/[ΠΜ]\.?Μ?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:function(){return 6===this.day()?"[το προηγούμενο] dddd [{}] LT":"[την προηγούμενη] dddd [{}] LT"},sameElse:"L"},calendar:function(t,e){var r,n=this._calendarEl[t],a=e&&e.hours();return r=n,("undefined"!=typeof Function&&r instanceof Function||"[object Function]"===Object.prototype.toString.call(r))&&(n=n.apply(e)),n.replace("{}",a%12==1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"λίγα δευτερόλεπτα",ss:"%d δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},dayOfMonthOrdinalParse:/\d{1,2}η/,ordinal:"%dη",week:{dow:1,doy:4}})},78348:function(t,e,r){r(5582).defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(t){var e=t%10;return t+(1==~~(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")},week:{dow:0,doy:4}})},77925:function(t,e,r){r(5582).defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(t){var e=t%10;return t+(1==~~(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}})},22243:function(t,e,r){r(5582).defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(t){var e=t%10;return t+(1==~~(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")},week:{dow:1,doy:4}})},46436:function(t,e,r){r(5582).defineLocale("en-ie",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(t){var e=t%10;return t+(1==~~(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")},week:{dow:1,doy:4}})},47207:function(t,e,r){r(5582).defineLocale("en-il",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(t){var e=t%10;return t+(1==~~(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}})},44175:function(t,e,r){r(5582).defineLocale("en-in",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(t){var e=t%10;return t+(1==~~(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")},week:{dow:0,doy:6}})},76319:function(t,e,r){r(5582).defineLocale("en-nz",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(t){var e=t%10;return t+(1==~~(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")},week:{dow:1,doy:4}})},31662:function(t,e,r){r(5582).defineLocale("en-sg",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(t){var e=t%10;return t+(1==~~(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")},week:{dow:1,doy:4}})},92915:function(t,e,r){r(5582).defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mart_apr_maj_jun_jul_aŭg_sept_okt_nov_dec".split("_"),weekdays:"dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato".split("_"),weekdaysShort:"dim_lun_mard_merk_ĵaŭ_ven_sab".split("_"),weekdaysMin:"di_lu_ma_me_ĵa_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"[la] D[-an de] MMMM, YYYY",LLL:"[la] D[-an de] MMMM, YYYY HH:mm",LLLL:"dddd[n], [la] D[-an de] MMMM, YYYY HH:mm",llll:"ddd, [la] D[-an de] MMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(t){return"p"===t.charAt(0).toLowerCase()},meridiem:function(t,e,r){return t>11?r?"p.t.m.":"P.T.M.":r?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd[n je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasintan] dddd[n je] LT",sameElse:"L"},relativeTime:{future:"post %s",past:"antaŭ %s",s:"kelkaj sekundoj",ss:"%d sekundoj",m:"unu minuto",mm:"%d minutoj",h:"unu horo",hh:"%d horoj",d:"unu tago",dd:"%d tagoj",M:"unu monato",MM:"%d monatoj",y:"unu jaro",yy:"%d jaroj"},dayOfMonthOrdinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}})},55251:function(t,e,r){var n,a,i,o,s;n=r(5582),a="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),i="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],s=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,n.defineLocale("es-do",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(t,e){return t?/-MMM-/.test(e)?i[t.month()]:a[t.month()]:a},monthsRegex:s,monthsShortRegex:s,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})},96112:function(t,e,r){var n,a,i,o,s;n=r(5582),a="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),i="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],s=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,n.defineLocale("es-mx",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(t,e){return t?/-MMM-/.test(e)?i[t.month()]:a[t.month()]:a},monthsRegex:s,monthsShortRegex:s,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:4},invalidDate:"Fecha inválida"})},71146:function(t,e,r){var n,a,i,o,s;n=r(5582),a="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),i="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],s=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,n.defineLocale("es-us",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(t,e){return t?/-MMM-/.test(e)?i[t.month()]:a[t.month()]:a},monthsRegex:s,monthsShortRegex:s,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:6}})},55655:function(t,e,r){var n,a,i,o,s;n=r(5582),a="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),i="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],s=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,n.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(t,e){return t?/-MMM-/.test(e)?i[t.month()]:a[t.month()]:a},monthsRegex:s,monthsShortRegex:s,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4},invalidDate:"Fecha inválida"})},5603:function(t,e,r){!function(t){function e(t,e,r,n){var a={s:["mõne sekundi","mõni sekund","paar sekundit"],ss:[t+"sekundi",t+"sekundit"],m:["ühe minuti","üks minut"],mm:[t+" minuti",t+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[t+" tunni",t+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[t+" kuu",t+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[t+" aasta",t+" aastat"]};return e?a[r][2]?a[r][2]:a[r][1]:n?a[r][0]:a[r][1]}t.defineLocale("et",{months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:e,ss:e,m:e,mm:e,h:e,hh:e,d:e,dd:"%d päeva",M:e,MM:e,y:e,yy:e},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(r(5582))},77763:function(t,e,r){r(5582).defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),monthsParseExact:!0,weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",ss:"%d segundo",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})},76959:function(t,e,r){var n,a,i;n=r(5582),a={1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"},i={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"},n.defineLocale("fa",{months:"ژانویه_فوریهارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریهارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یکشنبه_دوشنبههشنبههارشنبه_پنجشنبه_جمعه_شنبه".split("_"),weekdaysShort:"یکشنبه_دوشنبههشنبههارشنبه_پنجشنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/قبل از ظهر|بعد از ظهر/,isPM:function(t){return/بعد از ظهر/.test(t)},meridiem:function(t,e,r){return t<12?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",ss:"%d ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(t){return t.replace(/[۰-۹]/g,(function(t){return i[t]})).replace(/،/g,",")},postformat:function(t){return t.replace(/\d/g,(function(t){return a[t]})).replace(/,/g,"،")},dayOfMonthOrdinalParse:/\d{1,2}م/,ordinal:"%dم",week:{dow:6,doy:12}})},11897:function(t,e,r){!function(t){var e="nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" "),r=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",e[7],e[8],e[9]];function n(t,n,a,i){var o="";switch(a){case"s":return i?"muutaman sekunnin":"muutama sekunti";case"ss":o=i?"sekunnin":"sekuntia";break;case"m":return i?"minuutin":"minuutti";case"mm":o=i?"minuutin":"minuuttia";break;case"h":return i?"tunnin":"tunti";case"hh":o=i?"tunnin":"tuntia";break;case"d":return i?"päivän":"päivä";case"dd":o=i?"päivän":"päivää";break;case"M":return i?"kuukauden":"kuukausi";case"MM":o=i?"kuukauden":"kuukautta";break;case"y":return i?"vuoden":"vuosi";case"yy":o=i?"vuoden":"vuotta"}return function(t,n){return t<10?n?r[t]:e[t]:t}(t,i)+" "+o}t.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:n,ss:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(r(5582))},42549:function(t,e,r){r(5582).defineLocale("fil",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(t){return t},week:{dow:1,doy:4}})},94694:function(t,e,r){r(5582).defineLocale("fo",{months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},calendar:{sameDay:"[Í dag kl.] LT",nextDay:"[Í morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[Í gjár kl.] LT",lastWeek:"[síðstu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",ss:"%d sekundir",m:"ein minuttur",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaður",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})},63049:function(t,e,r){r(5582).defineLocale("fr-ca",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourdhui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(t,e){switch(e){default:case"M":case"Q":case"D":case"DDD":case"d":return t+(1===t?"er":"e");case"w":case"W":return t+(1===t?"re":"e")}}})},52330:function(t,e,r){r(5582).defineLocale("fr-ch",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourdhui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(t,e){switch(e){default:case"M":case"Q":case"D":case"DDD":case"d":return t+(1===t?"er":"e");case"w":case"W":return t+(1===t?"re":"e")}},week:{dow:1,doy:4}})},94470:function(t,e,r){var n,a,i,o;n=/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,a=/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?)/i,i=/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?|janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,o=[/^janv/i,/^févr/i,/^mars/i,/^avr/i,/^mai/i,/^juin/i,/^juil/i,/^août/i,/^sept/i,/^oct/i,/^nov/i,/^déc/i],r(5582).defineLocale("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsRegex:i,monthsShortRegex:i,monthsStrictRegex:n,monthsShortStrictRegex:a,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourdhui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",w:"une semaine",ww:"%d semaines",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|)/,ordinal:function(t,e){switch(e){case"D":return t+(1===t?"er":"");default:case"M":case"Q":case"DDD":case"d":return t+(1===t?"er":"e");case"w":case"W":return t+(1===t?"re":"e")}},week:{dow:1,doy:4}})},5044:function(t,e,r){var n,a,i;n=r(5582),a="jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_"),i="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),n.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(t,e){return t?/-MMM-/.test(e)?i[t.month()]:a[t.month()]:a},monthsParseExact:!0,weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[ôfrûne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",ss:"%d sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(t){return t+(1===t||8===t||t>=20?"ste":"de")},week:{dow:1,doy:4}})},29295:function(t,e,r){var n,a,i,o,s;n=["Eanáir","Feabhra","Márta","Aibreán","Bealtaine","Meitheamh","Iúil","Lúnasa","Meán Fómhair","Deireadh Fómhair","Samhain","Nollaig"],a=["Ean","Feabh","Márt","Aib","Beal","Meith","Iúil","Lún","M.F.","D.F.","Samh","Noll"],i=["Dé Domhnaigh","Dé Luain","Dé Máirt","Dé Céadaoin","Déardaoin","Dé hAoine","Dé Sathairn"],o=["Domh","Luan","Máirt","Céad","Déar","Aoine","Sath"],s=["Do","Lu","Má","Cé","Dé","A","Sa"],r(5582).defineLocale("ga",{months:n,monthsShort:a,monthsParseExact:!0,weekdays:i,weekdaysShort:o,weekdaysMin:s,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Inniu ag] LT",nextDay:"[Amárach ag] LT",nextWeek:"dddd [ag] LT",lastDay:"[Inné ag] LT",lastWeek:"dddd [seo caite] [ag] LT",sameElse:"L"},relativeTime:{future:"i %s",past:"%s ó shin",s:"cúpla soicind",ss:"%d soicind",m:"nóiméad",mm:"%d nóiméad",h:"uair an chloig",hh:"%d uair an chloig",d:"lá",dd:"%d lá",M:"mí",MM:"%d míonna",y:"bliain",yy:"%d bliain"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(t){return t+(1===t?"d":t%10==2?"na":"mh")},week:{dow:1,doy:4}})},2101:function(t,e,r){var n,a,i,o,s;n=["Am Faoilleach","An Gearran","Am Màrt","An Giblean","An Cèitean","An t-Ògmhios","An t-Iuchar","An Lùnastal","An t-Sultain","An Dàmhair","An t-Samhain","An Dùbhlachd"],a=["Faoi","Gear","Màrt","Gibl","Cèit","Ògmh","Iuch","Lùn","Sult","Dàmh","Samh","Dùbh"],i=["Didòmhnaich","Diluain","Dimàirt","Diciadain","Diardaoin","Dihaoine","Disathairne"],o=["Did","Dil","Dim","Dic","Dia","Dih","Dis"],s=["Dò","Lu","Mà","Ci","Ar","Ha","Sa"],r(5582).defineLocale("gd",{months:n,monthsShort:a,monthsParseExact:!0,weekdays:i,weekdaysShort:o,weekdaysMin:s,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[An-diugh aig] LT",nextDay:"[A-màireach aig] LT",nextWeek:"dddd [aig] LT",lastDay:"[An-dè aig] LT",lastWeek:"dddd [seo chaidh] [aig] LT",sameElse:"L"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",ss:"%d diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"mìos",MM:"%d mìosan",y:"bliadhna",yy:"%d bliadhna"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(t){return t+(1===t?"d":t%10==2?"na":"mh")},week:{dow:1,doy:4}})},38794:function(t,e,r){r(5582).defineLocale("gl",{months:"xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro".split("_"),monthsShort:"xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"domingo_luns_martes_mércores_xoves_venres_sábado".split("_"),weekdaysShort:"dom._lun._mar._mér._xov._ven._sáb.".split("_"),weekdaysMin:"do_lu_ma_mé_xo_ve_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"ás":"á")+"] LT"},nextDay:function(){return"[mañá "+(1!==this.hours()?"ás":"á")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"ás":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(t){return 0===t.indexOf("un")?"n"+t:"en "+t},past:"hai %s",s:"uns segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})},27884:function(t,e,r){!function(t){function e(t,e,r,n){var a={s:["थोडया सॅकंडांनी","थोडे सॅकंड"],ss:[t+" सॅकंडांनी",t+" सॅकंड"],m:["एका मिणटान","एक मिनूट"],mm:[t+" मिणटांनी",t+" मिणटां"],h:["एका वरान","एक वर"],hh:[t+" वरांनी",t+" वरां"],d:["एका दिसान","एक दीस"],dd:[t+" दिसांनी",t+" दीस"],M:["एका म्हयन्यान","एक म्हयनो"],MM:[t+" म्हयन्यानी",t+" म्हयने"],y:["एका वर्सान","एक वर्स"],yy:[t+" वर्सांनी",t+" वर्सां"]};return n?a[r][0]:a[r][1]}t.defineLocale("gom-deva",{months:{standalone:"जानेवारी_फेब्रुवारी_मार्च_एप्रील_मे_जून_जुलय_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),format:"जानेवारीच्या_फेब्रुवारीच्या_मार्चाच्या_एप्रीलाच्या_मेयाच्या_जूनाच्या_जुलयाच्या_ऑगस्टाच्या_सप्टेंबराच्या_ऑक्टोबराच्या_नोव्हेंबराच्या_डिसेंबराच्या".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"जाने._फेब्रु._मार्च_एप्री._मे_जून_जुल._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"आयतार_सोमार_मंगळार_बुधवार_बिरेस्तार_सुक्रार_शेनवार".split("_"),weekdaysShort:"आयत._सोम._मंगळ._बुध._ब्रेस्त._सुक्र._शेन.".split("_"),weekdaysMin:"आ_सो_मं_बु_ब्रे_सु_शे".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [वाजतां]",LTS:"A h:mm:ss [वाजतां]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [वाजतां]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [वाजतां]",llll:"ddd, D MMM YYYY, A h:mm [वाजतां]"},calendar:{sameDay:"[आयज] LT",nextDay:"[फाल्यां] LT",nextWeek:"[फुडलो] dddd[,] LT",lastDay:"[काल] LT",lastWeek:"[फाटलो] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s आदीं",s:e,ss:e,m:e,mm:e,h:e,hh:e,d:e,dd:e,M:e,MM:e,y:e,yy:e},dayOfMonthOrdinalParse:/\d{1,2}(वेर)/,ordinal:function(t,e){return"D"===e?t+"वेर":t},week:{dow:0,doy:3},meridiemParse:/राती|सकाळीं|दनपारां|सांजे/,meridiemHour:function(t,e){return 12===t&&(t=0),"राती"===e?t<4?t:t+12:"सकाळीं"===e?t:"दनपारां"===e?t>12?t:t+12:"सांजे"===e?t+12:void 0},meridiem:function(t,e,r){return t<4?"राती":t<12?"सकाळीं":t<16?"दनपारां":t<20?"सांजे":"राती"}})}(r(5582))},23168:function(t,e,r){!function(t){function e(t,e,r,n){var a={s:["thoddea sekondamni","thodde sekond"],ss:[t+" sekondamni",t+" sekond"],m:["eka mintan","ek minut"],mm:[t+" mintamni",t+" mintam"],h:["eka voran","ek vor"],hh:[t+" voramni",t+" voram"],d:["eka disan","ek dis"],dd:[t+" disamni",t+" dis"],M:["eka mhoinean","ek mhoino"],MM:[t+" mhoineamni",t+" mhoine"],y:["eka vorsan","ek voros"],yy:[t+" vorsamni",t+" vorsam"]};return n?a[r][0]:a[r][1]}t.defineLocale("gom-latn",{months:{standalone:"Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr".split("_"),format:"Janerachea_Febrerachea_Marsachea_Abrilachea_Maiachea_Junachea_Julaiachea_Agostachea_Setembrachea_Otubrachea_Novembrachea_Dezembrachea".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Aitar_Somar_Mongllar_Budhvar_Birestar_Sukrar_Son'var".split("_"),weekdaysShort:"Ait._Som._Mon._Bud._Bre._Suk._Son.".split("_"),weekdaysMin:"Ai_Sm_Mo_Bu_Br_Su_Sn".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [vazta]",LTS:"A h:mm:ss [vazta]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [vazta]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [vazta]",llll:"ddd, D MMM YYYY, A h:mm [vazta]"},calendar:{sameDay:"[Aiz] LT",nextDay:"[Faleam] LT",nextWeek:"[Fuddlo] dddd[,] LT",lastDay:"[Kal] LT",lastWeek:"[Fattlo] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s adim",s:e,ss:e,m:e,mm:e,h:e,hh:e,d:e,dd:e,M:e,MM:e,y:e,yy:e},dayOfMonthOrdinalParse:/\d{1,2}(er)/,ordinal:function(t,e){return"D"===e?t+"er":t},week:{dow:0,doy:3},meridiemParse:/rati|sokallim|donparam|sanje/,meridiemHour:function(t,e){return 12===t&&(t=0),"rati"===e?t<4?t:t+12:"sokallim"===e?t:"donparam"===e?t>12?t:t+12:"sanje"===e?t+12:void 0},meridiem:function(t,e,r){return t<4?"rati":t<12?"sokallim":t<16?"donparam":t<20?"sanje":"rati"}})}(r(5582))},95349:function(t,e,r){var n,a,i;n=r(5582),a={1:"૧",2:"૨",3:"૩",4:"૪",5:"૫",6:"૬",7:"૭",8:"૮",9:"૯",0:""},i={"૧":"1","૨":"2","૩":"3","૪":"4","૫":"5","૬":"6","૭":"7","૮":"8","૯":"9","":"0"},n.defineLocale("gu",{months:"જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર".split("_"),monthsShort:"જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.".split("_"),monthsParseExact:!0,weekdays:"રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર".split("_"),weekdaysShort:"રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ".split("_"),weekdaysMin:"ર_સો_મં_બુ_ગુ_શુ_શ".split("_"),longDateFormat:{LT:"A h:mm વાગ્યે",LTS:"A h:mm:ss વાગ્યે",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm વાગ્યે",LLLL:"dddd, D MMMM YYYY, A h:mm વાગ્યે"},calendar:{sameDay:"[આજ] LT",nextDay:"[કાલે] LT",nextWeek:"dddd, LT",lastDay:"[ગઇકાલે] LT",lastWeek:"[પાછલા] dddd, LT",sameElse:"L"},relativeTime:{future:"%s મા",past:"%s પહેલા",s:"અમુક પળો",ss:"%d સેકંડ",m:"એક મિનિટ",mm:"%d મિનિટ",h:"એક કલાક",hh:"%d કલાક",d:"એક દિવસ",dd:"%d દિવસ",M:"એક મહિનો",MM:"%d મહિનો",y:"એક વર્ષ",yy:"%d વર્ષ"},preparse:function(t){return t.replace(/[૧૨૩૪૫૬૭૮૯૦]/g,(function(t){return i[t]}))},postformat:function(t){return t.replace(/\d/g,(function(t){return a[t]}))},meridiemParse:/રાત|બપોર|સવાર|સાંજ/,meridiemHour:function(t,e){return 12===t&&(t=0),"રાત"===e?t<4?t:t+12:"સવાર"===e?t:"બપોર"===e?t>=10?t:t+12:"સાંજ"===e?t+12:void 0},meridiem:function(t,e,r){return t<4?"રાત":t<10?"સવાર":t<17?"બપોર":t<20?"સાંજ":"રાત"},week:{dow:0,doy:6}})},24206:function(t,e,r){r(5582).defineLocale("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יוליוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יוליוג׳_ספט׳וק׳וב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישיישי_שבת".split("_"),weekdaysShort:"א׳׳׳׳׳_ו׳׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",ss:"%d שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(t){return 2===t?"שעתיים":t+" שעות"},d:"יום",dd:function(t){return 2===t?"יומיים":t+" ימים"},M:"חודש",MM:function(t){return 2===t?"חודשיים":t+" חודשים"},y:"שנה",yy:function(t){return 2===t?"שנתיים":t%10==0&&10!==t?t+" שנה":t+" שנים"}},meridiemParse:/אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,isPM:function(t){return/^(אחה"צ|אחרי הצהריים|בערב)$/.test(t)},meridiem:function(t,e,r){return t<5?"לפנות בוקר":t<10?"בבוקר":t<12?r?'לפנה"צ':"לפני הצהריים":t<18?r?'אחה"צ':"אחרי הצהריים":"בערב"}})},30094:function(t,e,r){var n,a,i,o,s;n=r(5582),a={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:""},i={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","":"0"},o=[/^जन/i,/^फ़र|फर/i,/^मार्च/i,/^अप्रै/i,/^मई/i,/^जून/i,/^जुल/i,/^अग/i,/^सितं|सित/i,/^अक्टू/i,/^नव|नवं/i,/^दिसं|दिस/i],s=[/^जन/i,/^फ़र/i,/^मार्च/i,/^अप्रै/i,/^मई/i,/^जून/i,/^जुल/i,/^अग/i,/^सित/i,/^अक्टू/i,/^नव/i,/^दिस/i],n.defineLocale("hi",{months:{format:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),standalone:"जनवरी_फरवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितंबर_अक्टूबर_नवंबर_दिसंबर".split("_")},monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},monthsParse:o,longMonthsParse:o,shortMonthsParse:s,monthsRegex:/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,monthsShortRegex:/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,monthsStrictRegex:/^(जनवरी?|फ़रवरी|फरवरी?|मार्च?|अप्रैल?|मई?|जून?|जुलाई?|अगस्त?|सितम्बर|सितंबर|सित?\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर?|दिसम्बर|दिसंबर?)/i,monthsShortStrictRegex:/^(जन\.?|फ़र\.?|मार्च?|अप्रै\.?|मई?|जून?|जुल\.?|अग\.?|सित\.?|अक्टू\.?|नव\.?|दिस\.?)/i,calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",ss:"%d सेकंड",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(t){return t.replace(/[१२३४५६७८९०]/g,(function(t){return i[t]}))},postformat:function(t){return t.replace(/\d/g,(function(t){return a[t]}))},meridiemParse:/रात|सुबह|दोपहर|शाम/,meridiemHour:function(t,e){return 12===t&&(t=0),"रात"===e?t<4?t:t+12:"सुबह"===e?t:"दोपहर"===e?t>=10?t:t+12:"शाम"===e?t+12:void 0},meridiem:function(t,e,r){return t<4?"रात":t<10?"सुबह":t<17?"दोपहर":t<20?"शाम":"रात"},week:{dow:0,doy:6}})},30316:function(t,e,r){!function(t){function e(t,e,r){var n=t+" ";switch(r){case"ss":return n+(1===t?"sekunda":2===t||3===t||4===t?"sekunde":"sekundi");case"m":return e?"jedna minuta":"jedne minute";case"mm":return n+(1===t?"minuta":2===t||3===t||4===t?"minute":"minuta");case"h":return e?"jedan sat":"jednog sata";case"hh":return n+(1===t?"sat":2===t||3===t||4===t?"sata":"sati");case"dd":return n+(1===t?"dan":"dana");case"MM":return n+(1===t?"mjesec":2===t||3===t||4===t?"mjeseca":"mjeseci");case"yy":return n+(1===t?"godina":2===t||3===t||4===t?"godine":"godina")}}t.defineLocale("hr",{months:{format:"siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),standalone:"siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_")},monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"Do MMMM YYYY",LLL:"Do MMMM YYYY H:mm",LLLL:"dddd, Do MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:return"[prošlu] [nedjelju] [u] LT";case 3:return"[prošlu] [srijedu] [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:e,m:e,mm:e,h:e,hh:e,d:"dan",dd:e,M:"mjesec",MM:e,y:"godinu",yy:e},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(r(5582))},22138:function(t,e,r){!function(t){var e="vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ");function r(t,e,r,n){var a=t;switch(r){case"s":return n||e?"néhány másodperc":"néhány másodperce";case"ss":return a+(n||e)?" másodperc":" másodperce";case"m":return"egy"+(n||e?" perc":" perce");case"mm":return a+(n||e?" perc":" perce");case"h":return"egy"+(n||e?" óra":" órája");case"hh":return a+(n||e?" óra":" órája");case"d":return"egy"+(n||e?" nap":" napja");case"dd":return a+(n||e?" nap":" napja");case"M":return"egy"+(n||e?" hónap":" hónapja");case"MM":return a+(n||e?" hónap":" hónapja");case"y":return"egy"+(n||e?" év":" éve");case"yy":return a+(n||e?" év":" éve")}return""}function n(t){return(t?"":"[múlt] ")+"["+e[this.day()]+"] LT[-kor]"}t.defineLocale("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan._feb._márc._ápr._máj._jún._júl._aug._szept._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(t){return"u"===t.charAt(1).toLowerCase()},meridiem:function(t,e,r){return t<12?!0===r?"de":"DE":!0===r?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return n.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return n.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:r,ss:r,m:r,mm:r,h:r,hh:r,d:r,dd:r,M:r,MM:r,y:r,yy:r},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(r(5582))},11423:function(t,e,r){r(5582).defineLocale("hy-am",{months:{format:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_"),standalone:"հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր".split("_")},monthsShort:"հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_"),weekdays:"կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_"),weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},calendar:{sameDay:"[այսօր] LT",nextDay:"[վաղը] LT",lastDay:"[երեկ] LT",nextWeek:function(){return"dddd [օրը ժամը] LT"},lastWeek:function(){return"[անցած] dddd [օրը ժամը] LT"},sameElse:"L"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",ss:"%d վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"},meridiemParse:/գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,isPM:function(t){return/^(ցերեկվա|երեկոյան)$/.test(t)},meridiem:function(t){return t<4?"գիշերվա":t<12?"առավոտվա":t<17?"ցերեկվա":"երեկոյան"},dayOfMonthOrdinalParse:/\d{1,2}|\d{1,2}-(ին|րդ)/,ordinal:function(t,e){switch(e){case"DDD":case"w":case"W":case"DDDo":return 1===t?t+"-ին":t+"-րդ";default:return t}},week:{dow:1,doy:7}})},29218:function(t,e,r){r(5582).defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(t,e){return 12===t&&(t=0),"pagi"===e?t:"siang"===e?t>=11?t:t+12:"sore"===e||"malam"===e?t+12:void 0},meridiem:function(t,e,r){return t<11?"pagi":t<15?"siang":t<19?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",ss:"%d detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:0,doy:6}})},90135:function(t,e,r){!function(t){function e(t){return t%100==11||t%10!=1}function r(t,r,n,a){var i=t+" ";switch(n){case"s":return r||a?"nokkrar sekúndur":"nokkrum sekúndum";case"ss":return e(t)?i+(r||a?"sekúndur":"sekúndum"):i+"sekúnda";case"m":return r?"mínúta":"mínútu";case"mm":return e(t)?i+(r||a?"mínútur":"mínútum"):r?i+"mínúta":i+"mínútu";case"hh":return e(t)?i+(r||a?"klukkustundir":"klukkustundum"):i+"klukkustund";case"d":return r?"dagur":a?"dag":"degi";case"dd":return e(t)?r?i+"dagar":i+(a?"daga":"dögum"):r?i+"dagur":i+(a?"dag":"degi");case"M":return r?"mánuður":a?"mánuð":"mánuði";case"MM":return e(t)?r?i+"mánuðir":i+(a?"mánuði":"mánuðum"):r?i+"mánuður":i+(a?"mánuð":"mánuði");case"y":return r||a?"ár":"ári";case"yy":return e(t)?i+(r||a?"ár":"árum"):i+(r||a?"ár":"ári")}}t.defineLocale("is",{months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:r,ss:r,m:r,mm:r,h:"klukkustund",hh:r,d:r,dd:r,M:r,MM:r,y:r,yy:r},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(r(5582))},10150:function(t,e,r){r(5582).defineLocale("it-ch",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){return 0===this.day()?"[la scorsa] dddd [alle] LT":"[lo scorso] dddd [alle] LT"},sameElse:"L"},relativeTime:{future:function(t){return(/^[0-9].+$/.test(t)?"tra":"in")+" "+t},past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})},90626:function(t,e,r){r(5582).defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:function(){return"[Oggi a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextDay:function(){return"[Domani a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextWeek:function(){return"dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastDay:function(){return"[Ieri a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastWeek:function(){return 0===this.day()?"[La scorsa] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT":"[Lo scorso] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},sameElse:"L"},relativeTime:{future:"tra %s",past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",w:"una settimana",ww:"%d settimane",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})},39183:function(t,e,r){r(5582).defineLocale("ja",{eras:[{since:"2019-05-01",offset:1,name:"令和",narrow:"㋿",abbr:"R"},{since:"1989-01-08",until:"2019-04-30",offset:1,name:"平成",narrow:"㍻",abbr:"H"},{since:"1926-12-25",until:"1989-01-07",offset:1,name:"昭和",narrow:"㍼",abbr:"S"},{since:"1912-07-30",until:"1926-12-24",offset:1,name:"大正",narrow:"㍽",abbr:"T"},{since:"1873-01-01",until:"1912-07-29",offset:6,name:"明治",narrow:"㍾",abbr:"M"},{since:"0001-01-01",until:"1873-12-31",offset:1,name:"西暦",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"紀元前",narrow:"BC",abbr:"BC"}],eraYearOrdinalRegex:/(元|\d+)年/,eraYearOrdinalParse:function(t,e){return"元"===e[1]?1:parseInt(e[1]||t,10)},months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiemParse:/午前|午後/i,isPM:function(t){return"午後"===t},meridiem:function(t,e,r){return t<12?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:function(t){return t.week()!==this.week()?"[来週]dddd LT":"dddd LT"},lastDay:"[昨日] LT",lastWeek:function(t){return this.week()!==t.week()?"[先週]dddd LT":"dddd LT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}日/,ordinal:function(t,e){switch(e){case"y":return 1===t?"元年":t+"年";case"d":case"D":case"DDD":return t+"日";default:return t}},relativeTime:{future:"%s後",past:"%s前",s:"数秒",ss:"%d秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}})},24286:function(t,e,r){r(5582).defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(t,e){return 12===t&&(t=0),"enjing"===e?t:"siyang"===e?t>=11?t:t+12:"sonten"===e||"ndalu"===e?t+12:void 0},meridiem:function(t,e,r){return t<11?"enjing":t<15?"siyang":t<19?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",ss:"%d detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}})},12105:function(t,e,r){r(5582).defineLocale("ka",{months:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekdays:{standalone:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),format:"კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს".split("_"),isFormat:/(წინა|შემდეგ)/},weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[დღეს] LT[-ზე]",nextDay:"[ხვალ] LT[-ზე]",lastDay:"[გუშინ] LT[-ზე]",nextWeek:"[შემდეგ] dddd LT[-ზე]",lastWeek:"[წინა] dddd LT-ზე",sameElse:"L"},relativeTime:{future:function(t){return t.replace(/(წამ|წუთ|საათ|წელ|დღ|თვ)(ი|ე)/,(function(t,e,r){return"ი"===r?e+"ში":e+r+"ში"}))},past:function(t){return/(წამი|წუთი|საათი|დღე|თვე)/.test(t)?t.replace(/(ი|ე)$/,"ის წინ"):/წელი/.test(t)?t.replace(/წელი$/,"წლის წინ"):t},s:"რამდენიმე წამი",ss:"%d წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათი",d:"დღე",dd:"%d დღე",M:"თვე",MM:"%d თვე",y:"წელი",yy:"%d წელი"},dayOfMonthOrdinalParse:/0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,ordinal:function(t){return 0===t?t:1===t?t+"-ლი":t<20||t<=100&&t%20==0||t%100==0?"მე-"+t:t+"-ე"},week:{dow:1,doy:7}})},47772:function(t,e,r){var n,a;n=r(5582),a={0:"-ші",1:"-ші",2:"-ші",3:"-ші",4:"-ші",5:"-ші",6:"-шы",7:"-ші",8:"-ші",9:"-шы",10:"-шы",20:"-шы",30:"-шы",40:"-шы",50:"-ші",60:"-шы",70:"-ші",80:"-ші",90:"-шы",100:"-ші"},n.defineLocale("kk",{months:"қаңтар_ақпан_наурыз_сәуірамыраусым_шілдеамыз_қыркүйек_қазан_қарашаелтоқсан".split("_"),monthsShort:"қаң_ақп_нау_сәуам_мауіл_там_қыраз_қарел".split("_"),weekdays:"жексенбіүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі".split("_"),weekdaysShort:"жек_дүй_сей_сәр_бей_жұм_сен".split("_"),weekdaysMin:"жк_дй_сй_ср_бй_жм_сн".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгін сағат] LT",nextDay:"[Ертең сағат] LT",nextWeek:"dddd [сағат] LT",lastDay:"[Кеше сағат] LT",lastWeek:"[Өткен аптаның] dddd [сағат] LT",sameElse:"L"},relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",ss:"%d секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(ші|шы)/,ordinal:function(t){return t+(a[t]||a[t%10]||a[t>=100?100:null])},week:{dow:1,doy:7}})},18758:function(t,e,r){var n,a,i;n=r(5582),a={1:"១",2:"២",3:"៣",4:"៤",5:"៥",6:"៦",7:"៧",8:"៨",9:"៩",0:"០"},i={"១":"1","២":"2","៣":"3","៤":"4","៥":"5","៦":"6","៧":"7","៨":"8","៩":"9","០":"0"},n.defineLocale("km",{months:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),monthsShort:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysShort:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysMin:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ព្រឹក|ល្ងាច/,isPM:function(t){return"ល្ងាច"===t},meridiem:function(t,e,r){return t<12?"ព្រឹក":"ល្ងាច"},calendar:{sameDay:"[ថ្ងៃនេះ ម៉ោង] LT",nextDay:"[ស្អែក ម៉ោង] LT",nextWeek:"dddd [ម៉ោង] LT",lastDay:"[ម្សិលមិញ ម៉ោង] LT",lastWeek:"dddd [សប្តាហ៍មុន] [ម៉ោង] LT",sameElse:"L"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",ss:"%d វិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"},dayOfMonthOrdinalParse:/ទី\d{1,2}/,ordinal:"ទី%d",preparse:function(t){return t.replace(/[១២៣៤៥៦៧៨៩០]/g,(function(t){return i[t]}))},postformat:function(t){return t.replace(/\d/g,(function(t){return a[t]}))},week:{dow:1,doy:4}})},79282:function(t,e,r){var n,a,i;n=r(5582),a={1:"೧",2:"೨",3:"೩",4:"೪",5:"೫",6:"೬",7:"೭",8:"೮",9:"೯",0:""},i={"೧":"1","೨":"2","೩":"3","೪":"4","೫":"5","೬":"6","೭":"7","೮":"8","೯":"9","":"0"},n.defineLocale("kn",{months:"ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಬರ್_ಡಿಸೆಬರ್".split("_"),monthsShort:"ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆ_ಅಕ್ಟೋ_ನವೆ_ಡಿಸೆ".split("_"),monthsParseExact:!0,weekdays:"ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ".split("_"),weekdaysShort:"ಭಾನು_ಸೋಮ_ಮಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ".split("_"),weekdaysMin:"ಭಾ_ಸೋ_ಮ_ಬು_ಗು_ಶು_ಶ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[ಇಂದು] LT",nextDay:"[ನಾಳೆ] LT",nextWeek:"dddd, LT",lastDay:"[ನಿನ್ನೆ] LT",lastWeek:"[ಕೊನೆಯ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ನಂತರ",past:"%s ಹಿಂದೆ",s:"ಕೆಲವು ಕ್ಷಣಗಳು",ss:"%d ಸೆಕೆಂಡುಗಳು",m:"ಒಂದು ನಿಮಿಷ",mm:"%d ನಿಮಿಷ",h:"ಒಂದು ಗಂಟೆ",hh:"%d ಗಂಟೆ",d:"ಒಂದು ದಿನ",dd:"%d ದಿನ",M:"ಒಂದು ತಿಂಗಳು",MM:"%d ತಿಂಗಳು",y:"ಒಂದು ವರ್ಷ",yy:"%d ವರ್ಷ"},preparse:function(t){return t.replace(/[೧೨೩೪೫೬೭೮೯೦]/g,(function(t){return i[t]}))},postformat:function(t){return t.replace(/\d/g,(function(t){return a[t]}))},meridiemParse:/ರಾತ್ರಿ|ಬೆಳಿಗ್ಗೆ|ಮಧ್ಯಾಹ್ನ|ಸಂಜೆ/,meridiemHour:function(t,e){return 12===t&&(t=0),"ರಾತ್ರಿ"===e?t<4?t:t+12:"ಬೆಳಿಗ್ಗೆ"===e?t:"ಮಧ್ಯಾಹ್ನ"===e?t>=10?t:t+12:"ಸಂಜೆ"===e?t+12:void 0},meridiem:function(t,e,r){return t<4?"ರಾತ್ರಿ":t<10?"ಬೆಳಿಗ್ಗೆ":t<17?"ಮಧ್ಯಾಹ್ನ":t<20?"ಸಂಜೆ":"ರಾತ್ರಿ"},dayOfMonthOrdinalParse:/\d{1,2}(ನೇ)/,ordinal:function(t){return t+"ನೇ"},week:{dow:0,doy:6}})},33730:function(t,e,r){r(5582).defineLocale("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h:mm",LLLL:"YYYY년 MMMM D일 dddd A h:mm",l:"YYYY.MM.DD.",ll:"YYYY년 MMMM D일",lll:"YYYY년 MMMM D일 A h:mm",llll:"YYYY년 MMMM D일 dddd A h:mm"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇 초",ss:"%d초",m:"1분",mm:"%d분",h:"한 시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한 달",MM:"%d달",y:"일 년",yy:"%d년"},dayOfMonthOrdinalParse:/\d{1,2}(일|월|주)/,ordinal:function(t,e){switch(e){case"d":case"D":case"DDD":return t+"일";case"M":return t+"월";case"w":case"W":return t+"주";default:return t}},meridiemParse:/오전|오후/,isPM:function(t){return"오후"===t},meridiem:function(t,e,r){return t<12?"오전":"오후"}})},1408:function(t,e,r){var n,a,i,o;n=r(5582),a={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},i={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},o=["کانونی دووەم","شوبات","ئازار","نیسان","ئایار","حوزەیران","تەمموز","ئاب","ئەیلوول","تشرینی یەكەم","تشرینی دووەم","كانونی یەکەم"],n.defineLocale("ku",{months:o,monthsShort:o,weekdays:"یهكشهممه_دووشهممه_سێشهممه_چوارشهممه_پێنجشهممه_ههینی_شهممه".split("_"),weekdaysShort:"یهكشهم_دووشهم_سێشهم_چوارشهم_پێنجشهم_ههینی_شهممه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ه_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ئێواره‌|به‌یانی/,isPM:function(t){return/ئێواره‌/.test(t)},meridiem:function(t,e,r){return t<12?"به‌یانی":"ئێواره‌"},calendar:{sameDay:"[ئه‌مرۆ كاتژمێر] LT",nextDay:"[به‌یانی كاتژمێر] LT",nextWeek:"dddd [كاتژمێر] LT",lastDay:"[دوێنێ كاتژمێر] LT",lastWeek:"dddd [كاتژمێر] LT",sameElse:"L"},relativeTime:{future:"له‌ %s",past:"%s",s:"چه‌ند چركه‌یه‌ك",ss:"چركه‌ %d",m:"یه‌ك خوله‌ك",mm:"%d خوله‌ك",h:"یه‌ك كاتژمێر",hh:"%d كاتژمێر",d:"یه‌ك ڕۆژ",dd:"%d ڕۆژ",M:"یه‌ك مانگ",MM:"%d مانگ",y:"یه‌ك ساڵ",yy:"%d ساڵ"},preparse:function(t){return t.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(t){return i[t]})).replace(/،/g,",")},postformat:function(t){return t.replace(/\d/g,(function(t){return a[t]})).replace(/,/g,"،")},week:{dow:6,doy:12}})},33291:function(t,e,r){var n,a;n=r(5582),a={0:"-чү",1:"-чи",2:"-чи",3:"-чү",4:"-чү",5:"-чи",6:"-чы",7:"-чи",8:"-чи",9:"-чу",10:"-чу",20:"-чы",30:"-чу",40:"-чы",50:"-чү",60:"-чы",70:"-чи",80:"-чи",90:"-чу",100:"-чү"},n.defineLocale("ky",{months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_март_апрай_июнь_июль_авг_сен_окт_ноя_дек".split("_"),weekdays:"Жекшемби_Дүйшөмбүейшемби_Шаршемби_Бейшемби_Жума_Ишемби".split("_"),weekdaysShort:"Жек_Дүй_Шей_Шарей_Жум_Ише".split("_"),weekdaysMin:"Жк_Дй_Шй_Шр_Бй_Жм_Иш".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгүн саат] LT",nextDay:"[Эртең саат] LT",nextWeek:"dddd [саат] LT",lastDay:"[Кечээ саат] LT",lastWeek:"[Өткөн аптанын] dddd [күнү] [саат] LT",sameElse:"L"},relativeTime:{future:"%s ичинде",past:"%s мурун",s:"бирнече секунд",ss:"%d секунд",m:"бир мүнөт",mm:"%d мүнөт",h:"бир саат",hh:"%d саат",d:"бир күн",dd:"%d күн",M:"бир ай",MM:"%d ай",y:"бир жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(чи|чы|чү|чу)/,ordinal:function(t){return t+(a[t]||a[t%10]||a[t>=100?100:null])},week:{dow:1,doy:7}})},36841:function(t,e,r){!function(t){function e(t,e,r,n){var a={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return e?a[r][0]:a[r][1]}function r(t){if(t=parseInt(t,10),isNaN(t))return!1;if(t<0)return!0;if(t<10)return 4<=t&&t<=7;if(t<100){var e=t%10;return r(0===e?t/10:e)}if(t<1e4){for(;t>=10;)t/=10;return r(t)}return r(t/=1e3)}t.defineLocale("lb",{months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gëschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:function(t){return r(t.substr(0,t.indexOf(" ")))?"a "+t:"an "+t},past:function(t){return r(t.substr(0,t.indexOf(" ")))?"viru "+t:"virun "+t},s:"e puer Sekonnen",ss:"%d Sekonnen",m:e,mm:"%d Minutten",h:e,hh:"%d Stonnen",d:e,dd:"%d Deeg",M:e,MM:"%d Méint",y:e,yy:"%d Joer"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(r(5582))},55466:function(t,e,r){r(5582).defineLocale("lo",{months:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),monthsShort:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdays:"ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysShort:"ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysMin:"ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"ວັນdddd D MMMM YYYY HH:mm"},meridiemParse:/ຕອນເຊົ້າ|ຕອນແລງ/,isPM:function(t){return"ຕອນແລງ"===t},meridiem:function(t,e,r){return t<12?"ຕອນເຊົ້າ":"ຕອນແລງ"},calendar:{sameDay:"[ມື້ນີ້ເວລາ] LT",nextDay:"[ມື້ອື່ນເວລາ] LT",nextWeek:"[ວັນ]dddd[ໜ້າເວລາ] LT",lastDay:"[ມື້ວານນີ້ເວລາ] LT",lastWeek:"[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT",sameElse:"L"},relativeTime:{future:"ອີກ %s",past:"%sຜ່ານມາ",s:"ບໍ່ເທົ່າໃດວິນາທີ",ss:"%d ວິນາທີ",m:"1 ນາທີ",mm:"%d ນາທີ",h:"1 ຊົ່ວໂມງ",hh:"%d ຊົ່ວໂມງ",d:"1 ມື້",dd:"%d ມື້",M:"1 ເດືອນ",MM:"%d ເດືອນ",y:"1 ປີ",yy:"%d ປີ"},dayOfMonthOrdinalParse:/(ທີ່)\d{1,2}/,ordinal:function(t){return"ທີ່"+t}})},57010:function(t,e,r){!function(t){var e={ss:"sekundė_sekundžių_sekundes",m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"};function r(t,e,r,n){return e?a(r)[0]:n?a(r)[1]:a(r)[2]}function n(t){return t%10==0||t>10&&t<20}function a(t){return e[t].split("_")}function i(t,e,i,o){var s=t+" ";return 1===t?s+r(0,e,i[0],o):e?s+(n(t)?a(i)[1]:a(i)[0]):o?s+a(i)[1]:s+(n(t)?a(i)[1]:a(i)[2])}t.defineLocale("lt",{months:{format:"sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),standalone:"sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_"),isFormat:/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/},monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:{format:"sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį".split("_"),standalone:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),isFormat:/dddd HH:mm/},weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:function(t,e,r,n){return e?"kelios sekundės":n?"kelių sekundžių":"kelias sekundes"},ss:i,m:r,mm:i,h:r,hh:i,d:r,dd:i,M:r,MM:i,y:r,yy:i},dayOfMonthOrdinalParse:/\d{1,2}-oji/,ordinal:function(t){return t+"-oji"},week:{dow:1,doy:4}})}(r(5582))},37595:function(t,e,r){!function(t){var e={ss:"sekundes_sekundēm_sekunde_sekundes".split("_"),m:"minūtes_minūtēm_minūte_minūtes".split("_"),mm:"minūtes_minūtēm_minūte_minūtes".split("_"),h:"stundas_stundām_stunda_stundas".split("_"),hh:"stundas_stundām_stunda_stundas".split("_"),d:"dienas_dienām_diena_dienas".split("_"),dd:"dienas_dienām_diena_dienas".split("_"),M:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),MM:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")};function r(t,e,r){return r?e%10==1&&e%100!=11?t[2]:t[3]:e%10==1&&e%100!=11?t[0]:t[1]}function n(t,n,a){return t+" "+r(e[a],t,n)}function a(t,n,a){return r(e[a],t,n)}t.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"pēc %s",past:"pirms %s",s:function(t,e){return e?"dažas sekundes":"dažām sekundēm"},ss:n,m:a,mm:n,h:a,hh:n,d:a,dd:n,M:a,MM:n,y:a,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(r(5582))},39861:function(t,e,r){var n,a;n=r(5582),a={words:{ss:["sekund","sekunda","sekundi"],m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mjesec","mjeseca","mjeseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(t,e){return 1===t?e[0]:t>=2&&t<=4?e[1]:e[2]},translate:function(t,e,r){var n=a.words[r];return 1===r.length?e?n[0]:n[1]:t+" "+a.correctGrammaticalCase(t,n)}},n.defineLocale("me",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedjelje] [u] LT","[prošlog] [ponedjeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srijede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",ss:a.translate,m:a.translate,mm:a.translate,h:a.translate,hh:a.translate,d:"dan",dd:a.translate,M:"mjesec",MM:a.translate,y:"godinu",yy:a.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})},35493:function(t,e,r){r(5582).defineLocale("mi",{months:"Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea".split("_"),monthsShort:"Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki".split("_"),monthsRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i,weekdays:"Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei".split("_"),weekdaysShort:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),weekdaysMin:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [i] HH:mm",LLLL:"dddd, D MMMM YYYY [i] HH:mm"},calendar:{sameDay:"[i teie mahana, i] LT",nextDay:"[apopo i] LT",nextWeek:"dddd [i] LT",lastDay:"[inanahi i] LT",lastWeek:"dddd [whakamutunga i] LT",sameElse:"L"},relativeTime:{future:"i roto i %s",past:"%s i mua",s:"te hēkona ruarua",ss:"%d hēkona",m:"he meneti",mm:"%d meneti",h:"te haora",hh:"%d haora",d:"he ra",dd:"%d ra",M:"he marama",MM:"%d marama",y:"he tau",yy:"%d tau"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})},95966:function(t,e,r){r(5582).defineLocale("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апрај_јун_јул_авг_сеп_окт_ноеек".split("_"),weekdays:"недела_понеделник_вторник_средаетврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_среет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_сре_пе_сa".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"[Во] dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"за %s",past:"пред %s",s:"неколку секунди",ss:"%d секунди",m:"една минута",mm:"%d минути",h:"еден час",hh:"%d часа",d:"еден ден",dd:"%d дена",M:"еден месец",MM:"%d месеци",y:"една година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(t){var e=t%10,r=t%100;return 0===t?t+"-ев":0===r?t+"-ен":r>10&&r<20?t+"-ти":1===e?t+"-ви":2===e?t+"-ри":7===e||8===e?t+"-ми":t+"-ти"},week:{dow:1,doy:7}})},87341:function(t,e,r){r(5582).defineLocale("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റബർ_ഒക്ടോബർ_നവബർ_ഡിസബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവ._ഡിസ.".split("_"),monthsParseExact:!0,weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴ_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",ss:"%d സെക്കൻഡ്",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiemParse:/രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,meridiemHour:function(t,e){return 12===t&&(t=0),"രാത്രി"===e&&t>=4||"ഉച്ച കഴിഞ്ഞ്"===e||"വൈകുന്നേരം"===e?t+12:t},meridiem:function(t,e,r){return t<4?"രാത്രി":t<12?"രാവിലെ":t<17?"ഉച്ച കഴിഞ്ഞ്":t<20?"വൈകുന്നേരം":"രാത്രി"}})},5115:function(t,e,r){!function(t){function e(t,e,r,n){switch(r){case"s":return e?"хэдхэн секунд":"хэдхэн секундын";case"ss":return t+(e?" секунд":" секундын");case"m":case"mm":return t+(e?" минут":" минутын");case"h":case"hh":return t+(e?" цаг":" цагийн");case"d":case"dd":return t+(e?" өдөр":" өдрийн");case"M":case"MM":return t+(e?" сар":" сарын");case"y":case"yy":return t+(e?" жил":" жилийн");default:return t}}t.defineLocale("mn",{months:"Нэгдүгээр сар_Хоёрдугаар саруравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар саролдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар".split("_"),monthsShort:"1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар".split("_"),monthsParseExact:!0,weekdays:"Ням_Даваа_Мягмархагваүрэв_Баасан_Бямба".split("_"),weekdaysShort:"Ням_Дав_Мягхаүраа_Бям".split("_"),weekdaysMin:"Ня_Да_Мя_Лхүа_Бя".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY оны MMMMын D",LLL:"YYYY оны MMMMын D HH:mm",LLLL:"dddd, YYYY оны MMMMын D HH:mm"},meridiemParse:/ҮӨ|ҮХ/i,isPM:function(t){return"ҮХ"===t},meridiem:function(t,e,r){return t<12?"ҮӨ":"ҮХ"},calendar:{sameDay:"[Өнөөдөр] LT",nextDay:"[Маргааш] LT",nextWeek:"[Ирэх] dddd LT",lastDay:"[Өчигдөр] LT",lastWeek:"[Өнгөрсөн] dddd LT",sameElse:"L"},relativeTime:{future:"%s дараа",past:"%s өмнө",s:e,ss:e,m:e,mm:e,h:e,hh:e,d:e,dd:e,M:e,MM:e,y:e,yy:e},dayOfMonthOrdinalParse:/\d{1,2} өдөр/,ordinal:function(t,e){switch(e){case"d":case"D":case"DDD":return t+" өдөр";default:return t}}})}(r(5582))},10370:function(t,e,r){!function(t){var e={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:""},r={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","":"0"};function n(t,e,r,n){var a="";if(e)switch(r){case"s":a="काही सेकंद";break;case"ss":a="%d सेकंद";break;case"m":a="एक मिनिट";break;case"mm":a="%d मिनिटे";break;case"h":a="एक तास";break;case"hh":a="%d तास";break;case"d":a="एक दिवस";break;case"dd":a="%d दिवस";break;case"M":a="एक महिना";break;case"MM":a="%d महिने";break;case"y":a="एक वर्ष";break;case"yy":a="%d वर्षे"}else switch(r){case"s":a="काही सेकंदां";break;case"ss":a="%d सेकंदां";break;case"m":a="एका मिनिटा";break;case"mm":a="%d मिनिटां";break;case"h":a="एका तासा";break;case"hh":a="%d तासां";break;case"d":a="एका दिवसा";break;case"dd":a="%d दिवसां";break;case"M":a="एका महिन्या";break;case"MM":a="%d महिन्यां";break;case"y":a="एका वर्षा";break;case"yy":a="%d वर्षां"}return a.replace(/%d/i,t)}t.defineLocale("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%sमध्ये",past:"%sपूर्वी",s:n,ss:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},preparse:function(t){return t.replace(/[१२३४५६७८९०]/g,(function(t){return r[t]}))},postformat:function(t){return t.replace(/\d/g,(function(t){return e[t]}))},meridiemParse:/पहाटे|सकाळी|दुपारी|सायंकाळी|रात्री/,meridiemHour:function(t,e){return 12===t&&(t=0),"पहाटे"===e||"सकाळी"===e?t:"दुपारी"===e||"सायंकाळी"===e||"रात्री"===e?t>=12?t:t+12:void 0},meridiem:function(t,e,r){return t>=0&&t<6?"पहाटे":t<12?"सकाळी":t<17?"दुपारी":t<20?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}})}(r(5582))},41237:function(t,e,r){r(5582).defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(t,e){return 12===t&&(t=0),"pagi"===e?t:"tengahari"===e?t>=11?t:t+12:"petang"===e||"malam"===e?t+12:void 0},meridiem:function(t,e,r){return t<11?"pagi":t<15?"tengahari":t<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})},9847:function(t,e,r){r(5582).defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(t,e){return 12===t&&(t=0),"pagi"===e?t:"tengahari"===e?t>=11?t:t+12:"petang"===e||"malam"===e?t+12:void 0},meridiem:function(t,e,r){return t<11?"pagi":t<15?"tengahari":t<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})},72126:function(t,e,r){r(5582).defineLocale("mt",{months:"Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru".split("_"),monthsShort:"Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ".split("_"),weekdays:"Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt".split("_"),weekdaysShort:"Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib".split("_"),weekdaysMin:"Ħa_Tn_Tl_Er_Ħa_Ġi_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Illum fil-]LT",nextDay:"[Għada fil-]LT",nextWeek:"dddd [fil-]LT",lastDay:"[Il-bieraħ fil-]LT",lastWeek:"dddd [li għadda] [fil-]LT",sameElse:"L"},relativeTime:{future:"f %s",past:"%s ilu",s:"ftit sekondi",ss:"%d sekondi",m:"minuta",mm:"%d minuti",h:"siegħa",hh:"%d siegħat",d:"ġurnata",dd:"%d ġranet",M:"xahar",MM:"%d xhur",y:"sena",yy:"%d sni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})},56165:function(t,e,r){var n,a,i;n=r(5582),a={1:"၁",2:"၂",3:"၃",4:"၄",5:"၅",6:"၆",7:"၇",8:"၈",9:"၉",0:""},i={"၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","":"0"},n.defineLocale("my",{months:"ဇန်နါရီ_ဖေဖော်ါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုင်ဘာ_ဒီဇင်ဘာ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ယနေ.] LT [မှာ]",nextDay:"[မနက်ဖြန်] LT [မှာ]",nextWeek:"dddd LT [မှာ]",lastDay:"[မနေ.က] LT [မှာ]",lastWeek:"[ပြီးခဲ့သော] dddd LT [မှာ]",sameElse:"L"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",ss:"%d စက္ကန့်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"},preparse:function(t){return t.replace(/[၁၂၃၄၅၆၇၈၉၀]/g,(function(t){return i[t]}))},postformat:function(t){return t.replace(/\d/g,(function(t){return a[t]}))},week:{dow:1,doy:4}})},64924:function(t,e,r){r(5582).defineLocale("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"sø._ma._ti._on._to._fr._lø.".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"noen sekunder",ss:"%d sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",w:"en uke",ww:"%d uker",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})},16744:function(t,e,r){var n,a,i;n=r(5582),a={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:""},i={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","":"0"},n.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),monthsParseExact:!0,weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"},preparse:function(t){return t.replace(/[१२३४५६७८९०]/g,(function(t){return i[t]}))},postformat:function(t){return t.replace(/\d/g,(function(t){return a[t]}))},meridiemParse:/राति|बिहान|दिउँसो|साँझ/,meridiemHour:function(t,e){return 12===t&&(t=0),"राति"===e?t<4?t:t+12:"बिहान"===e?t:"दिउँसो"===e?t>=10?t:t+12:"साँझ"===e?t+12:void 0},meridiem:function(t,e,r){return t<3?"राति":t<12?"बिहान":t<16?"दिउँसो":t<20?"साँझ":"राति"},calendar:{sameDay:"[आज] LT",nextDay:"[भोलि] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडि",s:"केही क्षण",ss:"%d सेकेण्ड",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:0,doy:6}})},59814:function(t,e,r){var n,a,i,o,s;n=r(5582),a="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),i="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),o=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],s=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,n.defineLocale("nl-be",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(t,e){return t?/-MMM-/.test(e)?i[t.month()]:a[t.month()]:a},monthsRegex:s,monthsShortRegex:s,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(t){return t+(1===t||8===t||t>=20?"ste":"de")},week:{dow:1,doy:4}})},93901:function(t,e,r){var n,a,i,o,s;n=r(5582),a="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),i="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),o=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],s=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,n.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(t,e){return t?/-MMM-/.test(e)?i[t.month()]:a[t.month()]:a},monthsRegex:s,monthsShortRegex:s,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",w:"één week",ww:"%d weken",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(t){return t+(1===t||8===t||t>=20?"ste":"de")},week:{dow:1,doy:4}})},83877:function(t,e,r){r(5582).defineLocale("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"su._må._ty._on._to._fr._lau.".split("_"),weekdaysMin:"su_må_ty_on_to_fr_la".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I går klokka] LT",lastWeek:"[Føregåande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s sidan",s:"nokre sekund",ss:"%d sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",w:"ei veke",ww:"%d veker",M:"ein månad",MM:"%d månader",y:"eit år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})},92135:function(t,e,r){r(5582).defineLocale("oc-lnc",{months:{standalone:"genièr_febrièr_març_abril_mai_junh_julhet_agost_setembre_octòbre_novembre_decembre".split("_"),format:"de genièr_de febrièr_de març_d'abril_de mai_de junh_de julhet_d'agost_de setembre_d'octòbre_de novembre_de decembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._mai_junh_julh._ago._set._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"dimenge_diluns_dimars_dimècres_dijòus_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dm._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dm_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:"[uèi a] LT",nextDay:"[deman a] LT",nextWeek:"dddd [a] LT",lastDay:"[ièr a] LT",lastWeek:"dddd [passat a] LT",sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"unas segondas",ss:"%d segondas",m:"una minuta",mm:"%d minutas",h:"una ora",hh:"%d oras",d:"un jorn",dd:"%d jorns",M:"un mes",MM:"%d meses",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(t,e){var r=1===t?"r":2===t?"n":3===t?"r":4===t?"t":"è";return"w"!==e&&"W"!==e||(r="a"),t+r},week:{dow:1,doy:4}})},15858:function(t,e,r){var n,a,i;n=r(5582),a={1:"",2:"੨",3:"੩",4:"",5:"੫",6:"੬",7:"੭",8:"੮",9:"੯",0:""},i={"":"1","੨":"2","੩":"3","":"4","੫":"5","੬":"6","੭":"7","੮":"8","੯":"9","":"0"},n.defineLocale("pa-in",{months:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),monthsShort:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdays:"ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ".split("_"),weekdaysShort:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),weekdaysMin:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),longDateFormat:{LT:"A h:mm ਵਜੇ",LTS:"A h:mm:ss ਵਜੇ",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm ਵਜੇ",LLLL:"dddd, D MMMM YYYY, A h:mm ਵਜੇ"},calendar:{sameDay:"[ਅਜ] LT",nextDay:"[ਕਲ] LT",nextWeek:"[ਅਗਲਾ] dddd, LT",lastDay:"[ਕਲ] LT",lastWeek:"[ਪਿਛਲੇ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ਵਿੱਚ",past:"%s ਪਿਛਲੇ",s:"ਕੁਝ ਸਕਿੰਟ",ss:"%d ਸਕਿੰਟ",m:"ਇਕ ਮਿੰਟ",mm:"%d ਮਿੰਟ",h:"ਇੱਕ ਘੰਟਾ",hh:"%d ਘੰਟੇ",d:"ਇੱਕ ਦਿਨ",dd:"%d ਦਿਨ",M:"ਇੱਕ ਮਹੀਨਾ",MM:"%d ਮਹੀਨੇ",y:"ਇੱਕ ਸਾਲ",yy:"%d ਸਾਲ"},preparse:function(t){return t.replace(/[੧੨੩੪੫੬੭੮੯੦]/g,(function(t){return i[t]}))},postformat:function(t){return t.replace(/\d/g,(function(t){return a[t]}))},meridiemParse:/ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,meridiemHour:function(t,e){return 12===t&&(t=0),"ਰਾਤ"===e?t<4?t:t+12:"ਸਵੇਰ"===e?t:"ਦੁਪਹਿਰ"===e?t>=10?t:t+12:"ਸ਼ਾਮ"===e?t+12:void 0},meridiem:function(t,e,r){return t<4?"ਰਾਤ":t<10?"ਸਵੇਰ":t<17?"ਦੁਪਹਿਰ":t<20?"ਸ਼ਾਮ":"ਰਾਤ"},week:{dow:0,doy:6}})},64495:function(t,e,r){!function(t){var e="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),r="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"),n=[/^sty/i,/^lut/i,/^mar/i,/^kwi/i,/^maj/i,/^cze/i,/^lip/i,/^sie/i,/^wrz/i,/^paź/i,/^lis/i,/^gru/i];function a(t){return t%10<5&&t%10>1&&~~(t/10)%10!=1}function i(t,e,r){var n=t+" ";switch(r){case"ss":return n+(a(t)?"sekundy":"sekund");case"m":return e?"minuta":"minutę";case"mm":return n+(a(t)?"minuty":"minut");case"h":return e?"godzina":"godzinę";case"hh":return n+(a(t)?"godziny":"godzin");case"ww":return n+(a(t)?"tygodnie":"tygodni");case"MM":return n+(a(t)?"miesiące":"miesięcy");case"yy":return n+(a(t)?"lata":"lat")}}t.defineLocale("pl",{months:function(t,n){return t?/D MMMM/.test(n)?r[t.month()]:e[t.month()]:e},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),monthsParse:n,longMonthsParse:n,shortMonthsParse:n,weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"ndz_pon_wt_śr_czw_pt_sob".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:function(){switch(this.day()){case 0:return"[W niedzielę o] LT";case 2:return"[We wtorek o] LT";case 3:return"[W środę o] LT";case 6:return"[W sobotę o] LT";default:return"[W] dddd [o] LT"}},lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",ss:i,m:i,mm:i,h:i,hh:i,d:"1 dzień",dd:"%d dni",w:"tydzień",ww:i,M:"miesiąc",MM:i,y:"rok",yy:i},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(r(5582))},57971:function(t,e,r){r(5582).defineLocale("pt-br",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sáb".split("_"),weekdaysMin:"do_2ª_3ª_4ª_5ª_6ª_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"poucos segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",invalidDate:"Data inválida"})},89520:function(t,e,r){r(5582).defineLocale("pt",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",w:"uma semana",ww:"%d semanas",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})},96459:function(t,e,r){!function(t){function e(t,e,r){var n=" ";return(t%100>=20||t>=100&&t%100==0)&&(n=" de "),t+n+{ss:"secunde",mm:"minute",hh:"ore",dd:"zile",ww:"săptămâni",MM:"luni",yy:"ani"}[r]}t.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._feb._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",ss:e,m:"un minut",mm:e,h:"o oră",hh:e,d:"o zi",dd:e,w:"o săptămână",ww:e,M:"o lună",MM:e,y:"un an",yy:e},week:{dow:1,doy:7}})}(r(5582))},21793:function(t,e,r){!function(t){function e(t,e,r){return"m"===r?e?"минута":"минуту":t+" "+(n=+t,a={ss:e?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:e?"минута_минуты_минут":"минуту_минуты_минут",hh:"часасаасов",dd:"день_дня_дней",ww:"неделя_недели_недель",MM:"месяц_месяцаесяцев",yy:"год_годает"}[r].split("_"),n%10==1&&n%100!=11?a[0]:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?a[1]:a[2]);var n,a}var r=[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[йя]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i];t.defineLocale("ru",{months:{format:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),standalone:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_")},monthsShort:{format:"янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),standalone:"янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_")},weekdays:{standalone:"воскресенье_понедельник_вторник_средаетверг_пятница_суббота".split("_"),format:"воскресенье_понедельник_вторник_средуетверг_пятницу_субботу".split("_"),isFormat:/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?] ?dddd/},weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:r,longMonthsParse:r,shortMonthsParse:r,monthsRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsShortRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsStrictRegex:/^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,monthsShortStrictRegex:/^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},calendar:{sameDay:"[Сегодня, в] LT",nextDay:"[Завтра, в] LT",lastDay:"[Вчера, в] LT",nextWeek:function(t){if(t.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В следующее] dddd, [в] LT";case 1:case 2:case 4:return"[В следующий] dddd, [в] LT";case 3:case 5:case 6:return"[В следующую] dddd, [в] LT"}},lastWeek:function(t){if(t.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd, [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd, [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd, [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",ss:e,m:e,mm:e,h:"час",hh:e,d:"день",dd:e,w:"неделя",ww:e,M:"месяц",MM:e,y:"год",yy:e},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(t){return/^(дня|вечера)$/.test(t)},meridiem:function(t,e,r){return t<4?"ночи":t<12?"утра":t<17?"дня":"вечера"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(t,e){switch(e){case"M":case"d":case"DDD":return t+"-й";case"D":return t+"-го";case"w":case"W":return t+"-я";default:return t}},week:{dow:1,doy:4}})}(r(5582))},40950:function(t,e,r){var n,a;n=["جنوري","فيبروري","مارچ","اپريل","مئي","جون","جولاءِ","آگسٽ","سيپٽمبر","آڪٽوبر","نومبر","ڊسمبر"],a=["آچر","سومر","اڱارو","اربع","خميس","جمع","ڇنڇر"],r(5582).defineLocale("sd",{months:n,monthsShort:n,weekdays:a,weekdaysShort:a,weekdaysMin:a,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(t){return"شام"===t},meridiem:function(t,e,r){return t<12?"صبح":"شام"},calendar:{sameDay:"[اڄ] LT",nextDay:"[سڀاڻي] LT",nextWeek:"dddd [اڳين هفتي تي] LT",lastDay:"[ڪالهه] LT",lastWeek:"[گزريل هفتي] dddd [تي] LT",sameElse:"L"},relativeTime:{future:"%s پوء",past:"%s اڳ",s:"چند سيڪنڊ",ss:"%d سيڪنڊ",m:"هڪ منٽ",mm:"%d منٽ",h:"هڪ ڪلاڪ",hh:"%d ڪلاڪ",d:"هڪ ڏينهن",dd:"%d ڏينهن",M:"هڪ مهينو",MM:"%d مهينا",y:"هڪ سال",yy:"%d سال"},preparse:function(t){return t.replace(/،/g,",")},postformat:function(t){return t.replace(/,/g,"،")},week:{dow:1,doy:4}})},10490:function(t,e,r){r(5582).defineLocale("se",{months:"ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu".split("_"),monthsShort:"ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov".split("_"),weekdays:"sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat".split("_"),weekdaysShort:"sotn_vuos_maŋ_gask_duor_bear_láv".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},calendar:{sameDay:"[otne ti] LT",nextDay:"[ihttin ti] LT",nextWeek:"dddd [ti] LT",lastDay:"[ikte ti] LT",lastWeek:"[ovddit] dddd [ti] LT",sameElse:"L"},relativeTime:{future:"%s geažes",past:"maŋit %s",s:"moadde sekunddat",ss:"%d sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta mánnu",MM:"%d mánut",y:"okta jahki",yy:"%d jagit"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})},90124:function(t,e,r){r(5582).defineLocale("si",{months:"ජනවාරි_පෙබරවාරි_මාර්තු_අප්රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"),monthsShort:"ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"),weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්රහ_සිකු_සෙන".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්ර_සි_සෙ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},calendar:{sameDay:"[අද] LT[ට]",nextDay:"[හෙට] LT[ට]",nextWeek:"dddd LT[ට]",lastDay:"[ඊයේ] LT[ට]",lastWeek:"[පසුගිය] dddd LT[ට]",sameElse:"L"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",ss:"තත්පර %d",m:"මිනිත්තුව",mm:"මිනිත්තු %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"},dayOfMonthOrdinalParse:/\d{1,2} වැනි/,ordinal:function(t){return t+" වැනි"},meridiemParse:/පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,isPM:function(t){return"ප.ව."===t||"පස් වරු"===t},meridiem:function(t,e,r){return t>11?r?"ප.ව.":"පස් වරු":r?"පෙ.ව.":"පෙර වරු"}})},64249:function(t,e,r){!function(t){var e="január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"),r="jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_");function n(t){return t>1&&t<5}function a(t,e,r,a){var i=t+" ";switch(r){case"s":return e||a?"pár sekúnd":"pár sekundami";case"ss":return e||a?i+(n(t)?"sekundy":"sekúnd"):i+"sekundami";case"m":return e?"minúta":a?"minútu":"minútou";case"mm":return e||a?i+(n(t)?"minúty":"minút"):i+"minútami";case"h":return e?"hodina":a?"hodinu":"hodinou";case"hh":return e||a?i+(n(t)?"hodiny":"hodín"):i+"hodinami";case"d":return e||a?"deň":"dňom";case"dd":return e||a?i+(n(t)?"dni":"dní"):i+"dňami";case"M":return e||a?"mesiac":"mesiacom";case"MM":return e||a?i+(n(t)?"mesiace":"mesiacov"):i+"mesiacmi";case"y":return e||a?"rok":"rokom";case"yy":return e||a?i+(n(t)?"roky":"rokov"):i+"rokmi"}}t.defineLocale("sk",{months:e,monthsShort:r,weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:case 4:case 5:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:a,ss:a,m:a,mm:a,h:a,hh:a,d:a,dd:a,M:a,MM:a,y:a,yy:a},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(r(5582))},14985:function(t,e,r){!function(t){function e(t,e,r,n){var a=t+" ";switch(r){case"s":return e||n?"nekaj sekund":"nekaj sekundami";case"ss":return a+(1===t?e?"sekundo":"sekundi":2===t?e||n?"sekundi":"sekundah":t<5?e||n?"sekunde":"sekundah":"sekund");case"m":return e?"ena minuta":"eno minuto";case"mm":return a+(1===t?e?"minuta":"minuto":2===t?e||n?"minuti":"minutama":t<5?e||n?"minute":"minutami":e||n?"minut":"minutami");case"h":return e?"ena ura":"eno uro";case"hh":return a+(1===t?e?"ura":"uro":2===t?e||n?"uri":"urama":t<5?e||n?"ure":"urami":e||n?"ur":"urami");case"d":return e||n?"en dan":"enim dnem";case"dd":return a+(1===t?e||n?"dan":"dnem":2===t?e||n?"dni":"dnevoma":e||n?"dni":"dnevi");case"M":return e||n?"en mesec":"enim mesecem";case"MM":return a+(1===t?e||n?"mesec":"mesecem":2===t?e||n?"meseca":"mesecema":t<5?e||n?"mesece":"meseci":e||n?"mesecev":"meseci");case"y":return e||n?"eno leto":"enim letom";case"yy":return a+(1===t?e||n?"leto":"letom":2===t?e||n?"leti":"letoma":t<5?e||n?"leta":"leti":e||n?"let":"leti")}}t.defineLocale("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[včeraj ob] LT",lastWeek:function(){switch(this.day()){case 0:return"[prejšnjo] [nedeljo] [ob] LT";case 3:return"[prejšnjo] [sredo] [ob] LT";case 6:return"[prejšnjo] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[prejšnji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"čez %s",past:"pred %s",s:e,ss:e,m:e,mm:e,h:e,hh:e,d:e,dd:e,M:e,MM:e,y:e,yy:e},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(r(5582))},51104:function(t,e,r){r(5582).defineLocale("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),weekdaysParseExact:!0,meridiemParse:/PD|MD/,isPM:function(t){return"M"===t.charAt(0)},meridiem:function(t,e,r){return t<12?"PD":"MD"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Sot në] LT",nextDay:"[Nesër në] LT",nextWeek:"dddd [në] LT",lastDay:"[Dje në] LT",lastWeek:"dddd [e kaluar në] LT",sameElse:"L"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",ss:"%d sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})},79915:function(t,e,r){var n,a;n=r(5582),a={words:{ss:["секунда","секунде","секунди"],m:["један минут","једног минута"],mm:["минут","минута","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],d:["један дан","једног дана"],dd:["дан","дана","дана"],M:["један месец","једног месеца"],MM:["месец","месеца","месеци"],y:["једну годину","једне године"],yy:["годину","године","година"]},correctGrammaticalCase:function(t,e){return t%10>=1&&t%10<=4&&(t%100<10||t%100>=20)?t%10==1?e[0]:e[1]:e[2]},translate:function(t,e,r,n){var i,o=a.words[r];return 1===r.length?"y"===r&&e?"једна година":n||e?o[0]:o[1]:(i=a.correctGrammaticalCase(t,o),"yy"===r&&e&&"годину"===i?t+" година":t+" "+i)}},n.defineLocale("sr-cyrl",{months:"јануаребруарарт_април_мај_јун_јул_август_септембар_октобаровембарецембар".split("_"),monthsShort:"јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.".split("_"),monthsParseExact:!0,weekdays:"недеља_понедељак_уторак_средаетвртак_петак_субота".split("_"),weekdaysShort:"нед._пон._уто._сре._чет._пет._суб.".split("_"),weekdaysMin:"не_по_ут_сре_пе_су".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){return["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",ss:a.translate,m:a.translate,mm:a.translate,h:a.translate,hh:a.translate,d:a.translate,dd:a.translate,M:a.translate,MM:a.translate,y:a.translate,yy:a.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})},49131:function(t,e,r){var n,a;n=r(5582),a={words:{ss:["sekunda","sekunde","sekundi"],m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],d:["jedan dan","jednog dana"],dd:["dan","dana","dana"],M:["jedan mesec","jednog meseca"],MM:["mesec","meseca","meseci"],y:["jednu godinu","jedne godine"],yy:["godinu","godine","godina"]},correctGrammaticalCase:function(t,e){return t%10>=1&&t%10<=4&&(t%100<10||t%100>=20)?t%10==1?e[0]:e[1]:e[2]},translate:function(t,e,r,n){var i,o=a.words[r];return 1===r.length?"y"===r&&e?"jedna godina":n||e?o[0]:o[1]:(i=a.correctGrammaticalCase(t,o),"yy"===r&&e&&"godinu"===i?t+" godina":t+" "+i)}},n.defineLocale("sr",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sre._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",ss:a.translate,m:a.translate,mm:a.translate,h:a.translate,hh:a.translate,d:a.translate,dd:a.translate,M:a.translate,MM:a.translate,y:a.translate,yy:a.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})},85893:function(t,e,r){r(5582).defineLocale("ss",{months:"Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split("_"),monthsShort:"Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo".split("_"),weekdays:"Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo".split("_"),weekdaysShort:"Lis_Umb_Lsb_Les_Lsi_Lsh_Umg".split("_"),weekdaysMin:"Li_Us_Lb_Lt_Ls_Lh_Ug".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Namuhla nga] LT",nextDay:"[Kusasa nga] LT",nextWeek:"dddd [nga] LT",lastDay:"[Itolo nga] LT",lastWeek:"dddd [leliphelile] [nga] LT",sameElse:"L"},relativeTime:{future:"nga %s",past:"wenteka nga %s",s:"emizuzwana lomcane",ss:"%d mzuzwana",m:"umzuzu",mm:"%d emizuzu",h:"lihora",hh:"%d emahora",d:"lilanga",dd:"%d emalanga",M:"inyanga",MM:"%d tinyanga",y:"umnyaka",yy:"%d iminyaka"},meridiemParse:/ekuseni|emini|entsambama|ebusuku/,meridiem:function(t,e,r){return t<11?"ekuseni":t<15?"emini":t<19?"entsambama":"ebusuku"},meridiemHour:function(t,e){return 12===t&&(t=0),"ekuseni"===e?t:"emini"===e?t>=11?t:t+12:"entsambama"===e||"ebusuku"===e?0===t?0:t+12:void 0},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:"%d",week:{dow:1,doy:4}})},98760:function(t,e,r){r(5582).defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"[På] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",ss:"%d sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}(\:e|\:a)/,ordinal:function(t){var e=t%10;return t+(1==~~(t%100/10)?":e":1===e||2===e?":a":":e")},week:{dow:1,doy:4}})},91172:function(t,e,r){r(5582).defineLocale("sw",{months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"hh:mm A",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[leo saa] LT",nextDay:"[kesho saa] LT",nextWeek:"[wiki ijayo] dddd [saat] LT",lastDay:"[jana] LT",lastWeek:"[wiki iliyopita] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",ss:"sekunde %d",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"siku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},week:{dow:1,doy:7}})},27333:function(t,e,r){var n,a,i;n=r(5582),a={1:"௧",2:"௨",3:"௩",4:"௪",5:"௫",6:"௬",7:"௭",8:"௮",9:"௯",0:""},i={"௧":"1","௨":"2","௩":"3","௪":"4","௫":"5","௬":"6","௭":"7","௮":"8","௯":"9","":"0"},n.defineLocale("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",ss:"%d விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},dayOfMonthOrdinalParse:/\d{1,2}வது/,ordinal:function(t){return t+"வது"},preparse:function(t){return t.replace(/[௧௨௩௪௫௬௭௮௯௦]/g,(function(t){return i[t]}))},postformat:function(t){return t.replace(/\d/g,(function(t){return a[t]}))},meridiemParse:/யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,meridiem:function(t,e,r){return t<2?" யாமம்":t<6?" வைகறை":t<10?" காலை":t<14?" நண்பகல்":t<18?" எற்பாடு":t<22?" மாலை":" யாமம்"},meridiemHour:function(t,e){return 12===t&&(t=0),"யாமம்"===e?t<2?t:t+12:"வைகறை"===e||"காலை"===e||"நண்பகல்"===e&&t>=10?t:t+12},week:{dow:0,doy:6}})},23110:function(t,e,r){r(5582).defineLocale("te",{months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెబర్_అక్టోబర్_నవబర్_డిసెబర్".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),monthsParseExact:!0,weekdays:"ఆదివార_సోమవార_మగళవార_బుధవార_గురువార_శుక్రవార_శనివార".split("_"),weekdaysShort:"ఆది_సోమ_మగళ_బుధ_గురు_శుక్ర_శని".split("_"),weekdaysMin:"ఆ_సో_మ_బు_గు_శు_శ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[నేడు] LT",nextDay:"[రేపు] LT",nextWeek:"dddd, LT",lastDay:"[నిన్న] LT",lastWeek:"[గత] dddd, LT",sameElse:"L"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",ss:"%d సెకన్లు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"},dayOfMonthOrdinalParse:/\d{1,2}వ/,ordinal:"%dవ",meridiemParse:/రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,meridiemHour:function(t,e){return 12===t&&(t=0),"రాత్రి"===e?t<4?t:t+12:"ఉదయం"===e?t:"మధ్యాహ్నం"===e?t>=10?t:t+12:"సాయంత్రం"===e?t+12:void 0},meridiem:function(t,e,r){return t<4?"రాత్రి":t<10?"ఉదయం":t<17?"మధ్యాహ్నం":t<20?"సాయంత్రం":"రాత్రి"},week:{dow:0,doy:6}})},52095:function(t,e,r){r(5582).defineLocale("tet",{months:"Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu".split("_"),weekdaysShort:"Dom_Seg_Ters_Kua_Kint_Sest_Sab".split("_"),weekdaysMin:"Do_Seg_Te_Ku_Ki_Ses_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Ohin iha] LT",nextDay:"[Aban iha] LT",nextWeek:"dddd [iha] LT",lastDay:"[Horiseik iha] LT",lastWeek:"dddd [semana kotuk] [iha] LT",sameElse:"L"},relativeTime:{future:"iha %s",past:"%s liuba",s:"segundu balun",ss:"segundu %d",m:"minutu ida",mm:"minutu %d",h:"oras ida",hh:"oras %d",d:"loron ida",dd:"loron %d",M:"fulan ida",MM:"fulan %d",y:"tinan ida",yy:"tinan %d"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(t){var e=t%10;return t+(1==~~(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")},week:{dow:1,doy:4}})},27321:function(t,e,r){var n,a;n=r(5582),a={0:"-ум",1:"-ум",2:"-юм",3:"-юм",4:"-ум",5:"-ум",6:"-ум",7:"-ум",8:"-ум",9:"-ум",10:"-ум",12:"-ум",13:"-ум",20:"-ум",30:"-юм",40:"-ум",50:"-ум",60:"-ум",70:"-ум",80:"-ум",90:"-ум",100:"-ум"},n.defineLocale("tg",{months:{format:"январи_феврали_марти_апрели_майи_июни_июли_августи_сентябри_октябри_ноябри_декабри".split("_"),standalone:"январеврал_март_апрел_май_июн_июл_август_сентябр_октяброябрекабр".split("_")},monthsShort:"янв_фев_мар_апрай_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"якшанбеушанбе_сешанбеоршанбе_панҷшанбеумъаанбе".split("_"),weekdaysShort:"яшб_дшб_сшб_чшб_пшбум_шнб".split("_"),weekdaysMin:"яш_дш_сш_чш_пш_ҷм_шб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Имрӯз соати] LT",nextDay:"[Фардо соати] LT",lastDay:"[Дирӯз соати] LT",nextWeek:"dddd[и] [ҳафтаи оянда соати] LT",lastWeek:"dddd[и] [ҳафтаи гузашта соати] LT",sameElse:"L"},relativeTime:{future:"баъди %s",past:"%s пеш",s:"якчанд сония",m:"як дақиқа",mm:"%d дақиқа",h:"як соат",hh:"%d соат",d:"як рӯз",dd:"%d рӯз",M:"як моҳ",MM:"%d моҳ",y:"як сол",yy:"%d сол"},meridiemParse:/шаб|субҳ|рӯз|бегоҳ/,meridiemHour:function(t,e){return 12===t&&(t=0),"шаб"===e?t<4?t:t+12:"субҳ"===e?t:"рӯз"===e?t>=11?t:t+12:"бегоҳ"===e?t+12:void 0},meridiem:function(t,e,r){return t<4?"шаб":t<11?"субҳ":t<16?"рӯз":t<19?"бегоҳ":"шаб"},dayOfMonthOrdinalParse:/\d{1,2}-(ум|юм)/,ordinal:function(t){return t+(a[t]||a[t%10]||a[t>=100?100:null])},week:{dow:1,doy:7}})},9041:function(t,e,r){r(5582).defineLocale("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.".split("_"),monthsParseExact:!0,weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H:mm",LLLL:"วันddddที่ D MMMM YYYY เวลา H:mm"},meridiemParse:/ก่อนเที่ยง|หลังเที่ยง/,isPM:function(t){return"หลังเที่ยง"===t},meridiem:function(t,e,r){return t<12?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",ss:"%d วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",w:"1 สัปดาห์",ww:"%d สัปดาห์",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}})},19005:function(t,e,r){var n,a;n=r(5582),a={1:"'inji",5:"'inji",8:"'inji",70:"'inji",80:"'inji",2:"'nji",7:"'nji",20:"'nji",50:"'nji",3:"'ünji",4:"'ünji",100:"'ünji",6:"'njy",9:"'unjy",10:"'unjy",30:"'unjy",60:"'ynjy",90:"'ynjy"},n.defineLocale("tk",{months:"Ýanwar_Fewral_Mart_Aprel_Maý_Iýun_Iýul_Awgust_Sentýabr_Oktýabr_Noýabr_Dekabr".split("_"),monthsShort:"Ýan_Few_Mar_Apr_Maý_Iýn_Iýl_Awg_Sen_Okt_Noý_Dek".split("_"),weekdays:"Ýekşenbe_Duşenbe_Sişenbe_Çarşenbe_Penşenbe_Anna_Şenbe".split("_"),weekdaysShort:"Ýek_Duş_Siş_Çar_Pen_Ann_Şen".split("_"),weekdaysMin:"Ýk_Dş_Sş_Çr_Pn_An_Şn".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün sagat] LT",nextDay:"[ertir sagat] LT",nextWeek:"[indiki] dddd [sagat] LT",lastDay:"[düýn] LT",lastWeek:"[geçen] dddd [sagat] LT",sameElse:"L"},relativeTime:{future:"%s soň",past:"%s öň",s:"birnäçe sekunt",m:"bir minut",mm:"%d minut",h:"bir sagat",hh:"%d sagat",d:"bir gün",dd:"%d gün",M:"bir aý",MM:"%d aý",y:"bir ýyl",yy:"%d ýyl"},ordinal:function(t,e){switch(e){case"d":case"D":case"Do":case"DD":return t;default:if(0===t)return t+"'unjy";var r=t%10;return t+(a[r]||a[t%100-r]||a[t>=100?100:null])}},week:{dow:1,doy:7}})},75768:function(t,e,r){r(5582).defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(t){return t},week:{dow:1,doy:4}})},89444:function(t,e,r){!function(t){var e="pagh_wa_cha_wej_loS_vagh_jav_Soch_chorgh_Hut".split("_");function r(t,r,n,a){var i=function(t){var r=Math.floor(t%1e3/100),n=Math.floor(t%100/10),a=t%10,i="";return r>0&&(i+=e[r]+"vatlh"),n>0&&(i+=(""!==i?" ":"")+e[n]+"maH"),a>0&&(i+=(""!==i?" ":"")+e[a]),""===i?"pagh":i}(t);switch(n){case"ss":return i+" lup";case"mm":return i+" tup";case"hh":return i+" rep";case"dd":return i+" jaj";case"MM":return i+" jar";case"yy":return i+" DIS"}}t.defineLocale("tlh",{months:"tera jar wa_tera jar cha_tera jar wej_tera jar loS_tera jar vagh_tera jar jav_tera jar Soch_tera jar chorgh_tera jar Hut_tera jar wamaH_tera jar wamaH wa_tera jar wamaH cha".split("_"),monthsShort:"jar wa_jar cha_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wamaH_jar wamaH wa_jar wamaH cha".split("_"),monthsParseExact:!0,weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[DaHjaj] LT",nextDay:"[waleS] LT",nextWeek:"LLL",lastDay:"[waHu] LT",lastWeek:"LLL",sameElse:"L"},relativeTime:{future:function(t){var e=t;return-1!==t.indexOf("jaj")?e.slice(0,-3)+"leS":-1!==t.indexOf("jar")?e.slice(0,-3)+"waQ":-1!==t.indexOf("DIS")?e.slice(0,-3)+"nem":e+" pIq"},past:function(t){var e=t;return-1!==t.indexOf("jaj")?e.slice(0,-3)+"Hu":-1!==t.indexOf("jar")?e.slice(0,-3)+"wen":-1!==t.indexOf("DIS")?e.slice(0,-3)+"ben":e+" ret"},s:"puS lup",ss:r,m:"wa tup",mm:r,h:"wa rep",hh:r,d:"wa jaj",dd:r,M:"wa jar",MM:r,y:"wa DIS",yy:r},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(r(5582))},72397:function(t,e,r){var n,a;n=r(5582),a={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"},n.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pzt_Sal_Çar_Per_Cum_Cmt".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),meridiem:function(t,e,r){return t<12?r?"öö":"ÖÖ":r?"ös":"ÖS"},meridiemParse:/öö|ÖÖ|ös|ÖS/,isPM:function(t){return"ös"===t||"ÖS"===t},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[gelecek] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",ss:"%d saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",w:"bir hafta",ww:"%d hafta",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(t,e){switch(e){case"d":case"D":case"Do":case"DD":return t;default:if(0===t)return t+"'ıncı";var r=t%10;return t+(a[r]||a[t%100-r]||a[t>=100?100:null])}},week:{dow:1,doy:7}})},28254:function(t,e,r){!function(t){function e(t,e,r,n){var a={s:["viensas secunds","'iensas secunds"],ss:[t+" secunds",t+" secunds"],m:["'n míut","'iens míut"],mm:[t+" míuts",t+" míuts"],h:["'n þora","'iensa þora"],hh:[t+" þoras",t+" þoras"],d:["'n ziua","'iensa ziua"],dd:[t+" ziuas",t+" ziuas"],M:["'n mes","'iens mes"],MM:[t+" mesen",t+" mesen"],y:["'n ar","'iens ar"],yy:[t+" ars",t+" ars"]};return n||e?a[r][0]:a[r][1]}t.defineLocale("tzl",{months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"},meridiemParse:/d\'o|d\'a/i,isPM:function(t){return"d'o"===t.toLowerCase()},meridiem:function(t,e,r){return t>11?r?"d'o":"D'O":r?"d'a":"D'A"},calendar:{sameDay:"[oxhi à] LT",nextDay:"[demà à] LT",nextWeek:"dddd [à] LT",lastDay:"[ieiri à] LT",lastWeek:"[sür el] dddd [lasteu à] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:e,ss:e,m:e,mm:e,h:e,hh:e,d:e,dd:e,M:e,MM:e,y:e,yy:e},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(r(5582))},30699:function(t,e,r){r(5582).defineLocale("tzm-latn",{months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",ss:"%d imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}})},51106:function(t,e,r){r(5582).defineLocale("tzm",{months:"ⵉⴰⵢ_ⴱⴰⵢ_ⵎⴰⵚ_ⵉⴱ_ⵎⴰⵢⵢⵓ_ⵢⵓⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⴱⵉ_ⴽⵟⵓⴱ_ⵓⵡⴰⴱⵉ_ⴷⵓⵊⴱⵉ".split("_"),monthsShort:"ⵉⴰⵢ_ⴱⴰⵢ_ⵎⴰⵚ_ⵉⴱ_ⵎⴰⵢⵢⵓ_ⵢⵓⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⴱⵉ_ⴽⵟⵓⴱ_ⵓⵡⴰⴱⵉ_ⴷⵓⵊⴱⵉ".split("_"),weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⴰⵙ_ⴰⵙⵉⴰⵙ_ⴰⴽⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⵢⴰⵙ".split("_"),weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⴰⵙ_ⴰⵙⵉⴰⵙ_ⴰⴽⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⵢⴰⵙ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⴰⵙ_ⴰⵙⵉⴰⵙ_ⴰⴽⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⵢⴰⵙ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ⴰⵙⴷⵅ ⴴ] LT",nextDay:"[ⴰⵙⴽⴰ ⴴ] LT",nextWeek:"dddd [ⴴ] LT",lastDay:"[ⴰⵚⴰⵏⵜ ⴴ] LT",lastWeek:"dddd [ⴴ] LT",sameElse:"L"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",ss:"%d ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰ",M:"ⴰⵢoⵓ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"},week:{dow:6,doy:12}})},9288:function(t,e,r){r(5582).defineLocale("ug-cn",{months:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),monthsShort:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),weekdays:"يەكشەنبە_دۈشەنبەەيشەنبەارشەنبەەيشەنبە_جۈمەەنبە".split("_"),weekdaysShort:"يە_دۈ_سەاە_جۈ_شە".split("_"),weekdaysMin:"يە_دۈ_سەاە_جۈ_شە".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY-يىلىM-ئاينىڭD-كۈنى",LLL:"YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm",LLLL:"dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm"},meridiemParse:/يېرىم كېچە|سەھەر|چۈشتىن بۇرۇن|چۈش|چۈشتىن كېيىن|كەچ/,meridiemHour:function(t,e){return 12===t&&(t=0),"يېرىم كېچە"===e||"سەھەر"===e||"چۈشتىن بۇرۇن"===e?t:"چۈشتىن كېيىن"===e||"كەچ"===e?t+12:t>=11?t:t+12},meridiem:function(t,e,r){var n=100*t+e;return n<600?"يېرىم كېچە":n<900?"سەھەر":n<1130?"چۈشتىن بۇرۇن":n<1230?"چۈش":n<1800?"چۈشتىن كېيىن":"كەچ"},calendar:{sameDay:"[بۈگۈن سائەت] LT",nextDay:"[ئەتە سائەت] LT",nextWeek:"[كېلەركى] dddd [سائەت] LT",lastDay:"[تۆنۈگۈن] LT",lastWeek:"[ئالدىنقى] dddd [سائەت] LT",sameElse:"L"},relativeTime:{future:"%s كېيىن",past:"%s بۇرۇن",s:"نەچچە سېكونت",ss:"%d سېكونت",m:"بىر مىنۇت",mm:"%d مىنۇت",h:"بىر سائەت",hh:"%d سائەت",d:"بىر كۈن",dd:"%d كۈن",M:"بىر ئاي",MM:"%d ئاي",y:"بىر يىل",yy:"%d يىل"},dayOfMonthOrdinalParse:/\d{1,2}(-كۈنى|-ئاي|-ھەپتە)/,ordinal:function(t,e){switch(e){case"d":case"D":case"DDD":return t+"-كۈنى";case"w":case"W":return t+"-ھەپتە";default:return t}},preparse:function(t){return t.replace(/،/g,",")},postformat:function(t){return t.replace(/,/g,"،")},week:{dow:1,doy:7}})},67691:function(t,e,r){!function(t){function e(t,e,r){return"m"===r?e?"хвилина":"хвилину":"h"===r?e?"година":"годину":t+" "+(n=+t,a={ss:e?"секунда_секунди_секунд":"секунду_секунди_секунд",mm:e?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:e?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяціісяців",yy:"рік_роки_років"}[r].split("_"),n%10==1&&n%100!=11?a[0]:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?a[1]:a[2]);var n,a}function r(t){return function(){return t+"о"+(11===this.hours()?"б":"")+"] LT"}}t.defineLocale("uk",{months:{format:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),standalone:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_")},monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_веровт_лист_груд".split("_"),weekdays:function(t,e){var r={nominative:"неділя_понеділок_вівторок_середаетвер_пятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середуетвер_пятницю_суботу".split("_"),genitive:"неділі_понеділкаівторка_середи_четверга_пятниці_суботи".split("_")};return!0===t?r.nominative.slice(1,7).concat(r.nominative.slice(0,1)):t?r[/(\[[ВвУу]\]) ?dddd/.test(e)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(e)?"genitive":"nominative"][t.day()]:r.nominative},weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:r("[Сьогодні "),nextDay:r("[Завтра "),lastDay:r("[Вчора "),nextWeek:r("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return r("[Минулої] dddd [").call(this);case 1:case 2:case 4:return r("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",ss:e,m:e,mm:e,h:"годину",hh:e,d:"день",dd:e,M:"місяць",MM:e,y:"рік",yy:e},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(t){return/^(дня|вечора)$/.test(t)},meridiem:function(t,e,r){return t<4?"ночі":t<12?"ранку":t<17?"дня":"вечора"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го)/,ordinal:function(t,e){switch(e){case"M":case"d":case"DDD":case"w":case"W":return t+"-й";case"D":return t+"-го";default:return t}},week:{dow:1,doy:7}})}(r(5582))},13795:function(t,e,r){var n,a;n=["جنوری","فروری","مارچ","اپریل","مئی","جون","جولائی","اگست","ستمبر","اکتوبر","نومبر","دسمبر"],a=["اتوار","پیر","منگل","بدھ","جمعرات","جمعہ","ہفتہ"],r(5582).defineLocale("ur",{months:n,monthsShort:n,weekdays:a,weekdaysShort:a,weekdaysMin:a,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(t){return"شام"===t},meridiem:function(t,e,r){return t<12?"صبح":"شام"},calendar:{sameDay:"[آج بوقت] LT",nextDay:"[کل بوقت] LT",nextWeek:"dddd [بوقت] LT",lastDay:"[گذشتہ روز بوقت] LT",lastWeek:"[گذشتہ] dddd [بوقت] LT",sameElse:"L"},relativeTime:{future:"%s بعد",past:"%s قبل",s:"چند سیکنڈ",ss:"%d سیکنڈ",m:"ایک منٹ",mm:"%d منٹ",h:"ایک گھنٹہ",hh:"%d گھنٹے",d:"ایک دن",dd:"%d دن",M:"ایک ماہ",MM:"%d ماہ",y:"ایک سال",yy:"%d سال"},preparse:function(t){return t.replace(/،/g,",")},postformat:function(t){return t.replace(/,/g,"،")},week:{dow:1,doy:4}})},60588:function(t,e,r){r(5582).defineLocale("uz-latn",{months:"Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr".split("_"),monthsShort:"Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek".split("_"),weekdays:"Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba".split("_"),weekdaysShort:"Yak_Dush_Sesh_Chor_Pay_Jum_Shan".split("_"),weekdaysMin:"Ya_Du_Se_Cho_Pa_Ju_Sha".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Bugun soat] LT [da]",nextDay:"[Ertaga] LT [da]",nextWeek:"dddd [kuni soat] LT [da]",lastDay:"[Kecha soat] LT [da]",lastWeek:"[O'tgan] dddd [kuni soat] LT [da]",sameElse:"L"},relativeTime:{future:"Yaqin %s ichida",past:"Bir necha %s oldin",s:"soniya",ss:"%d soniya",m:"bir daqiqa",mm:"%d daqiqa",h:"bir soat",hh:"%d soat",d:"bir kun",dd:"%d kun",M:"bir oy",MM:"%d oy",y:"bir yil",yy:"%d yil"},week:{dow:1,doy:7}})},6791:function(t,e,r){r(5582).defineLocale("uz",{months:"январеврал_март_апрел_май_июн_июл_август_сентябр_октяброябрекабр".split("_"),monthsShort:"янв_фев_мар_апрай_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"Якшанбаушанба_Сешанбаоршанбаайшанбаумаанба".split("_"),weekdaysShort:"Якш_Душ_Сеш_Чорай_Жум_Шан".split("_"),weekdaysMin:"Як_Ду_Сеоауа".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Бугун соат] LT [да]",nextDay:"[Эртага] LT [да]",nextWeek:"dddd [куни соат] LT [да]",lastDay:"[Кеча соат] LT [да]",lastWeek:"[Утган] dddd [куни соат] LT [да]",sameElse:"L"},relativeTime:{future:"Якин %s ичида",past:"Бир неча %s олдин",s:"фурсат",ss:"%d фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"},week:{dow:1,doy:7}})},65666:function(t,e,r){r(5582).defineLocale("vi",{months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),monthsShort:"Thg 01_Thg 02_Thg 03_Thg 04_Thg 05_Thg 06_Thg 07_Thg 08_Thg 09_Thg 10_Thg 11_Thg 12".split("_"),monthsParseExact:!0,weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysParseExact:!0,meridiemParse:/sa|ch/i,isPM:function(t){return/^ch$/i.test(t)},meridiem:function(t,e,r){return t<12?r?"sa":"SA":r?"ch":"CH"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[Hôm nay lúc] LT",nextDay:"[Ngày mai lúc] LT",nextWeek:"dddd [tuần tới lúc] LT",lastDay:"[Hôm qua lúc] LT",lastWeek:"dddd [tuần trước lúc] LT",sameElse:"L"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",ss:"%d giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",w:"một tuần",ww:"%d tuần",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(t){return t},week:{dow:1,doy:4}})},14378:function(t,e,r){r(5582).defineLocale("x-pseudo",{months:"J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér".split("_"),monthsShort:"J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc".split("_"),monthsParseExact:!0,weekdays:"S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý".split("_"),weekdaysShort:"S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát".split("_"),weekdaysMin:"S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[T~ódá~ý át] LT",nextDay:"[T~ómó~rró~w át] LT",nextWeek:"dddd [át] LT",lastDay:"[Ý~ést~érdá~ý át] LT",lastWeek:"[L~ást] dddd [át] LT",sameElse:"L"},relativeTime:{future:"í~ñ %s",past:"%s á~gó",s:"á ~féw ~sécó~ñds",ss:"%d s~écóñ~ds",m:"á ~míñ~úté",mm:"%d m~íñú~tés",h:"á~ñ hó~úr",hh:"%d h~óúrs",d:"á ~dáý",dd:"%d d~áýs",M:"á ~móñ~th",MM:"%d m~óñt~hs",y:"á ~ýéár",yy:"%d ý~éárs"},dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1==~~(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")},week:{dow:1,doy:4}})},75805:function(t,e,r){r(5582).defineLocale("yo",{months:"Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀".split("_"),monthsShort:"Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀".split("_"),weekdays:"Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta".split("_"),weekdaysShort:"Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá".split("_"),weekdaysMin:"Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Ònì ni] LT",nextDay:"[Ọ̀la ni] LT",nextWeek:"dddd [Ọsẹ̀ tón'bọ] [ni] LT",lastDay:"[Àna ni] LT",lastWeek:"dddd [Ọsẹ̀ tólọ́] [ni] LT",sameElse:"L"},relativeTime:{future:"ní %s",past:"%s kọjá",s:"ìsẹjú aayá die",ss:"aayá %d",m:"ìsẹjú kan",mm:"ìsẹjú %d",h:"wákati kan",hh:"wákati %d",d:"ọjọ́ kan",dd:"ọjọ́ %d",M:"osù kan",MM:"osù %d",y:"ọdún kan",yy:"ọdún %d"},dayOfMonthOrdinalParse:/ọjọ́\s\d{1,2}/,ordinal:"ọjọ́ %d",week:{dow:1,doy:4}})},83839:function(t,e,r){r(5582).defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(t,e){return 12===t&&(t=0),"凌晨"===e||"早上"===e||"上午"===e?t:"下午"===e||"晚上"===e?t+12:t>=11?t:t+12},meridiem:function(t,e,r){var n=100*t+e;return n<600?"凌晨":n<900?"早上":n<1130?"上午":n<1230?"中午":n<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:function(t){return t.week()!==this.week()?"[下]dddLT":"[本]dddLT"},lastDay:"[昨天]LT",lastWeek:function(t){return this.week()!==t.week()?"[上]dddLT":"[本]dddLT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|周)/,ordinal:function(t,e){switch(e){case"d":case"D":case"DDD":return t+"日";case"M":return t+"月";case"w":case"W":return t+"周";default:return t}},relativeTime:{future:"%s后",past:"%s前",s:"几秒",ss:"%d 秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",w:"1 周",ww:"%d 周",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},week:{dow:1,doy:4}})},55726:function(t,e,r){r(5582).defineLocale("zh-hk",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(t,e){return 12===t&&(t=0),"凌晨"===e||"早上"===e||"上午"===e?t:"中午"===e?t>=11?t:t+12:"下午"===e||"晚上"===e?t+12:void 0},meridiem:function(t,e,r){var n=100*t+e;return n<600?"凌晨":n<900?"早上":n<1200?"上午":1200===n?"中午":n<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(t,e){switch(e){case"d":case"D":case"DDD":return t+"日";case"M":return t+"月";case"w":case"W":return t+"週";default:return t}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})},99807:function(t,e,r){r(5582).defineLocale("zh-mo",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"D/M/YYYY",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(t,e){return 12===t&&(t=0),"凌晨"===e||"早上"===e||"上午"===e?t:"中午"===e?t>=11?t:t+12:"下午"===e||"晚上"===e?t+12:void 0},meridiem:function(t,e,r){var n=100*t+e;return n<600?"凌晨":n<900?"早上":n<1130?"上午":n<1230?"中午":n<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(t,e){switch(e){case"d":case"D":case"DDD":return t+"日";case"M":return t+"月";case"w":case"W":return t+"週";default:return t}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})},74152:function(t,e,r){r(5582).defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(t,e){return 12===t&&(t=0),"凌晨"===e||"早上"===e||"上午"===e?t:"中午"===e?t>=11?t:t+12:"下午"===e||"晚上"===e?t+12:void 0},meridiem:function(t,e,r){var n=100*t+e;return n<600?"凌晨":n<900?"早上":n<1130?"上午":n<1230?"中午":n<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(t,e){switch(e){case"d":case"D":case"DDD":return t+"日";case"M":return t+"月";case"w":case"W":return t+"週";default:return t}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})},5582:function(t,e,r){(t=r.nmd(t)).exports=function(){var e,n;function a(){return e.apply(null,arguments)}function i(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function o(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function s(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function l(t){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(t).length;var e;for(e in t)if(s(t,e))return!1;return!0}function u(t){return void 0===t}function c(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function h(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function d(t,e){var r,n=[],a=t.length;for(r=0;r<a;++r)n.push(e(t[r],r));return n}function f(t,e){for(var r in e)s(e,r)&&(t[r]=e[r]);return s(e,"toString")&&(t.toString=e.toString),s(e,"valueOf")&&(t.valueOf=e.valueOf),t}function p(t,e,r,n){return Te(t,e,r,n,!0).utc()}function m(t){return null==t._pf&&(t._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}),t._pf}function g(t){if(null==t._isValid){var e=m(t),r=n.call(e.parsedDateParts,(function(t){return null!=t})),a=!isNaN(t._d.getTime())&&e.overflow<0&&!e.empty&&!e.invalidEra&&!e.invalidMonth&&!e.invalidWeekday&&!e.weekdayMismatch&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&r);if(t._strict&&(a=a&&0===e.charsLeftOver&&0===e.unusedTokens.length&&void 0===e.bigHour),null!=Object.isFrozen&&Object.isFrozen(t))return a;t._isValid=a}return t._isValid}function y(t){var e=p(NaN);return null!=t?f(m(e),t):m(e).userInvalidated=!0,e}n=Array.prototype.some?Array.prototype.some:function(t){var e,r=Object(this),n=r.length>>>0;for(e=0;e<n;e++)if(e in r&&t.call(this,r[e],e,r))return!0;return!1};var v=a.momentProperties=[],_=!1;function x(t,e){var r,n,a,i=v.length;if(u(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),u(e._i)||(t._i=e._i),u(e._f)||(t._f=e._f),u(e._l)||(t._l=e._l),u(e._strict)||(t._strict=e._strict),u(e._tzm)||(t._tzm=e._tzm),u(e._isUTC)||(t._isUTC=e._isUTC),u(e._offset)||(t._offset=e._offset),u(e._pf)||(t._pf=m(e)),u(e._locale)||(t._locale=e._locale),i>0)for(r=0;r<i;r++)u(a=e[n=v[r]])||(t[n]=a);return t}function b(t){x(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===_&&(_=!0,a.updateOffset(this),_=!1)}function w(t){return t instanceof b||null!=t&&null!=t._isAMomentObject}function M(t){!1===a.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function k(t,e){var r=!0;return f((function(){if(null!=a.deprecationHandler&&a.deprecationHandler(null,t),r){var n,i,o,l=[],u=arguments.length;for(i=0;i<u;i++){if(n="","object"==typeof arguments[i]){for(o in n+="\n["+i+"] ",arguments[0])s(arguments[0],o)&&(n+=o+": "+arguments[0][o]+", ");n=n.slice(0,-2)}else n=arguments[i];l.push(n)}M(t+"\nArguments: "+Array.prototype.slice.call(l).join("")+"\n"+(new Error).stack),r=!1}return e.apply(this,arguments)}),e)}var T,L={};function A(t,e){null!=a.deprecationHandler&&a.deprecationHandler(t,e),L[t]||(M(e),L[t]=!0)}function S(t){return"undefined"!=typeof Function&&t instanceof Function||"[object Function]"===Object.prototype.toString.call(t)}function E(t,e){var r,n=f({},t);for(r in e)s(e,r)&&(o(t[r])&&o(e[r])?(n[r]={},f(n[r],t[r]),f(n[r],e[r])):null!=e[r]?n[r]=e[r]:delete n[r]);for(r in t)s(t,r)&&!s(e,r)&&o(t[r])&&(n[r]=f({},n[r]));return n}function C(t){null!=t&&this.set(t)}a.suppressDeprecationWarnings=!1,a.deprecationHandler=null,T=Object.keys?Object.keys:function(t){var e,r=[];for(e in t)s(t,e)&&r.push(e);return r};function D(t,e,r){var n=""+Math.abs(t),a=e-n.length;return(t>=0?r?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+n}var P=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,O=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,z={},I={};function R(t,e,r,n){var a=n;"string"==typeof n&&(a=function(){return this[n]()}),t&&(I[t]=a),e&&(I[e[0]]=function(){return D(a.apply(this,arguments),e[1],e[2])}),r&&(I[r]=function(){return this.localeData().ordinal(a.apply(this,arguments),t)})}function F(t,e){return t.isValid()?(e=N(e,t.localeData()),z[e]=z[e]||function(t){var e,r,n,a=t.match(P);for(e=0,r=a.length;e<r;e++)I[a[e]]?a[e]=I[a[e]]:a[e]=(n=a[e]).match(/\[[\s\S]/)?n.replace(/^\[|\]$/g,""):n.replace(/\\/g,"");return function(e){var n,i="";for(n=0;n<r;n++)i+=S(a[n])?a[n].call(e,t):a[n];return i}}(e),z[e](t)):t.localeData().invalidDate()}function N(t,e){var r=5;function n(t){return e.longDateFormat(t)||t}for(O.lastIndex=0;r>=0&&O.test(t);)t=t.replace(O,n),O.lastIndex=0,r-=1;return t}var Y={};function j(t,e){var r=t.toLowerCase();Y[r]=Y[r+"s"]=Y[e]=t}function B(t){return"string"==typeof t?Y[t]||Y[t.toLowerCase()]:void 0}function H(t){var e,r,n={};for(r in t)s(t,r)&&(e=B(r))&&(n[e]=t[r]);return n}var U={};function V(t,e){U[t]=e}function W(t){return t%4==0&&t%100!=0||t%400==0}function G(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function q(t){var e=+t,r=0;return 0!==e&&isFinite(e)&&(r=G(e)),r}function Z(t,e){return function(r){return null!=r?(J(this,t,r),a.updateOffset(this,e),this):X(this,t)}}function X(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function J(t,e,r){t.isValid()&&!isNaN(r)&&("FullYear"===e&&W(t.year())&&1===t.month()&&29===t.date()?(r=q(r),t._d["set"+(t._isUTC?"UTC":"")+e](r,t.month(),wt(r,t.month()))):t._d["set"+(t._isUTC?"UTC":"")+e](r))}var K,$=/\d/,Q=/\d\d/,tt=/\d{3}/,et=/\d{4}/,rt=/[+-]?\d{6}/,nt=/\d\d?/,at=/\d\d\d\d?/,it=/\d\d\d\d\d\d?/,ot=/\d{1,3}/,st=/\d{1,4}/,lt=/[+-]?\d{1,6}/,ut=/\d+/,ct=/[+-]?\d+/,ht=/Z|[+-]\d\d:?\d\d/gi,dt=/Z|[+-]\d\d(?::?\d\d)?/gi,ft=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;function pt(t,e,r){K[t]=S(e)?e:function(t,n){return t&&r?r:e}}function mt(t,e){return s(K,t)?K[t](e._strict,e._locale):new RegExp(gt(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(t,e,r,n,a){return e||r||n||a}))))}function gt(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}K={};var yt={};function vt(t,e){var r,n,a=e;for("string"==typeof t&&(t=[t]),c(e)&&(a=function(t,r){r[e]=q(t)}),n=t.length,r=0;r<n;r++)yt[t[r]]=a}function _t(t,e){vt(t,(function(t,r,n,a){n._w=n._w||{},e(t,n._w,n,a)}))}function xt(t,e,r){null!=e&&s(yt,t)&&yt[t](e,r._a,r,t)}var bt;function wt(t,e){if(isNaN(t)||isNaN(e))return NaN;var r,n=(e%(r=12)+r)%r;return t+=(e-n)/12,1===n?W(t)?29:28:31-n%7%2}bt=Array.prototype.indexOf?Array.prototype.indexOf:function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1},R("M",["MM",2],"Mo",(function(){return this.month()+1})),R("MMM",0,0,(function(t){return this.localeData().monthsShort(this,t)})),R("MMMM",0,0,(function(t){return this.localeData().months(this,t)})),j("month","M"),V("month",8),pt("M",nt),pt("MM",nt,Q),pt("MMM",(function(t,e){return e.monthsShortRegex(t)})),pt("MMMM",(function(t,e){return e.monthsRegex(t)})),vt(["M","MM"],(function(t,e){e[1]=q(t)-1})),vt(["MMM","MMMM"],(function(t,e,r,n){var a=r._locale.monthsParse(t,n,r._strict);null!=a?e[1]=a:m(r).invalidMonth=t}));var Mt="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),kt="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Tt=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Lt=ft,At=ft;function St(t,e,r){var n,a,i,o=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)i=p([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(i,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(i,"").toLocaleLowerCase();return r?"MMM"===e?-1!==(a=bt.call(this._shortMonthsParse,o))?a:null:-1!==(a=bt.call(this._longMonthsParse,o))?a:null:"MMM"===e?-1!==(a=bt.call(this._shortMonthsParse,o))||-1!==(a=bt.call(this._longMonthsParse,o))?a:null:-1!==(a=bt.call(this._longMonthsParse,o))||-1!==(a=bt.call(this._shortMonthsParse,o))?a:null}function Et(t,e){var r;if(!t.isValid())return t;if("string"==typeof e)if(/^\d+$/.test(e))e=q(e);else if(!c(e=t.localeData().monthsParse(e)))return t;return r=Math.min(t.date(),wt(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,r),t}function Ct(t){return null!=t?(Et(this,t),a.updateOffset(this,!0),this):X(this,"Month")}function Dt(){function t(t,e){return e.length-t.length}var e,r,n=[],a=[],i=[];for(e=0;e<12;e++)r=p([2e3,e]),n.push(this.monthsShort(r,"")),a.push(this.months(r,"")),i.push(this.months(r,"")),i.push(this.monthsShort(r,""));for(n.sort(t),a.sort(t),i.sort(t),e=0;e<12;e++)n[e]=gt(n[e]),a[e]=gt(a[e]);for(e=0;e<24;e++)i[e]=gt(i[e]);this._monthsRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+n.join("|")+")","i")}function Pt(t){return W(t)?366:365}R("Y",0,0,(function(){var t=this.year();return t<=9999?D(t,4):"+"+t})),R(0,["YY",2],0,(function(){return this.year()%100})),R(0,["YYYY",4],0,"year"),R(0,["YYYYY",5],0,"year"),R(0,["YYYYYY",6,!0],0,"year"),j("year","y"),V("year",1),pt("Y",ct),pt("YY",nt,Q),pt("YYYY",st,et),pt("YYYYY",lt,rt),pt("YYYYYY",lt,rt),vt(["YYYYY","YYYYYY"],0),vt("YYYY",(function(t,e){e[0]=2===t.length?a.parseTwoDigitYear(t):q(t)})),vt("YY",(function(t,e){e[0]=a.parseTwoDigitYear(t)})),vt("Y",(function(t,e){e[0]=parseInt(t,10)})),a.parseTwoDigitYear=function(t){return q(t)+(q(t)>68?1900:2e3)};var Ot=Z("FullYear",!0);function zt(t,e,r,n,a,i,o){var s;return t<100&&t>=0?(s=new Date(t+400,e,r,n,a,i,o),isFinite(s.getFullYear())&&s.setFullYear(t)):s=new Date(t,e,r,n,a,i,o),s}function It(t){var e,r;return t<100&&t>=0?((r=Array.prototype.slice.call(arguments))[0]=t+400,e=new Date(Date.UTC.apply(null,r)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)):e=new Date(Date.UTC.apply(null,arguments)),e}function Rt(t,e,r){var n=7+e-r;return-(7+It(t,0,n).getUTCDay()-e)%7+n-1}function Ft(t,e,r,n,a){var i,o,s=1+7*(e-1)+(7+r-n)%7+Rt(t,n,a);return s<=0?o=Pt(i=t-1)+s:s>Pt(t)?(i=t+1,o=s-Pt(t)):(i=t,o=s),{year:i,dayOfYear:o}}function Nt(t,e,r){var n,a,i=Rt(t.year(),e,r),o=Math.floor((t.dayOfYear()-i-1)/7)+1;return o<1?n=o+Yt(a=t.year()-1,e,r):o>Yt(t.year(),e,r)?(n=o-Yt(t.year(),e,r),a=t.year()+1):(a=t.year(),n=o),{week:n,year:a}}function Yt(t,e,r){var n=Rt(t,e,r),a=Rt(t+1,e,r);return(Pt(t)-n+a)/7}R("w",["ww",2],"wo","week"),R("W",["WW",2],"Wo","isoWeek"),j("week","w"),j("isoWeek","W"),V("week",5),V("isoWeek",5),pt("w",nt),pt("ww",nt,Q),pt("W",nt),pt("WW",nt,Q),_t(["w","ww","W","WW"],(function(t,e,r,n){e[n.substr(0,1)]=q(t)}));function jt(t,e){return t.slice(e,7).concat(t.slice(0,e))}R("d",0,"do","day"),R("dd",0,0,(function(t){return this.localeData().weekdaysMin(this,t)})),R("ddd",0,0,(function(t){return this.localeData().weekdaysShort(this,t)})),R("dddd",0,0,(function(t){return this.localeData().weekdays(this,t)})),R("e",0,0,"weekday"),R("E",0,0,"isoWeekday"),j("day","d"),j("weekday","e"),j("isoWeekday","E"),V("day",11),V("weekday",11),V("isoWeekday",11),pt("d",nt),pt("e",nt),pt("E",nt),pt("dd",(function(t,e){return e.weekdaysMinRegex(t)})),pt("ddd",(function(t,e){return e.weekdaysShortRegex(t)})),pt("dddd",(function(t,e){return e.weekdaysRegex(t)})),_t(["dd","ddd","dddd"],(function(t,e,r,n){var a=r._locale.weekdaysParse(t,n,r._strict);null!=a?e.d=a:m(r).invalidWeekday=t})),_t(["d","e","E"],(function(t,e,r,n){e[n]=q(t)}));var Bt="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ht="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ut="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Vt=ft,Wt=ft,Gt=ft;function qt(t,e,r){var n,a,i,o=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)i=p([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(i,"").toLocaleLowerCase();return r?"dddd"===e?-1!==(a=bt.call(this._weekdaysParse,o))?a:null:"ddd"===e?-1!==(a=bt.call(this._shortWeekdaysParse,o))?a:null:-1!==(a=bt.call(this._minWeekdaysParse,o))?a:null:"dddd"===e?-1!==(a=bt.call(this._weekdaysParse,o))||-1!==(a=bt.call(this._shortWeekdaysParse,o))||-1!==(a=bt.call(this._minWeekdaysParse,o))?a:null:"ddd"===e?-1!==(a=bt.call(this._shortWeekdaysParse,o))||-1!==(a=bt.call(this._weekdaysParse,o))||-1!==(a=bt.call(this._minWeekdaysParse,o))?a:null:-1!==(a=bt.call(this._minWeekdaysParse,o))||-1!==(a=bt.call(this._weekdaysParse,o))||-1!==(a=bt.call(this._shortWeekdaysParse,o))?a:null}function Zt(){function t(t,e){return e.length-t.length}var e,r,n,a,i,o=[],s=[],l=[],u=[];for(e=0;e<7;e++)r=p([2e3,1]).day(e),n=gt(this.weekdaysMin(r,"")),a=gt(this.weekdaysShort(r,"")),i=gt(this.weekdays(r,"")),o.push(n),s.push(a),l.push(i),u.push(n),u.push(a),u.push(i);o.sort(t),s.sort(t),l.sort(t),u.sort(t),this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function Xt(){return this.hours()%12||12}function Jt(t,e){R(t,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)}))}function Kt(t,e){return e._meridiemParse}R("H",["HH",2],0,"hour"),R("h",["hh",2],0,Xt),R("k",["kk",2],0,(function(){return this.hours()||24})),R("hmm",0,0,(function(){return""+Xt.apply(this)+D(this.minutes(),2)})),R("hmmss",0,0,(function(){return""+Xt.apply(this)+D(this.minutes(),2)+D(this.seconds(),2)})),R("Hmm",0,0,(function(){return""+this.hours()+D(this.minutes(),2)})),R("Hmmss",0,0,(function(){return""+this.hours()+D(this.minutes(),2)+D(this.seconds(),2)})),Jt("a",!0),Jt("A",!1),j("hour","h"),V("hour",13),pt("a",Kt),pt("A",Kt),pt("H",nt),pt("h",nt),pt("k",nt),pt("HH",nt,Q),pt("hh",nt,Q),pt("kk",nt,Q),pt("hmm",at),pt("hmmss",it),pt("Hmm",at),pt("Hmmss",it),vt(["H","HH"],3),vt(["k","kk"],(function(t,e,r){var n=q(t);e[3]=24===n?0:n})),vt(["a","A"],(function(t,e,r){r._isPm=r._locale.isPM(t),r._meridiem=t})),vt(["h","hh"],(function(t,e,r){e[3]=q(t),m(r).bigHour=!0})),vt("hmm",(function(t,e,r){var n=t.length-2;e[3]=q(t.substr(0,n)),e[4]=q(t.substr(n)),m(r).bigHour=!0})),vt("hmmss",(function(t,e,r){var n=t.length-4,a=t.length-2;e[3]=q(t.substr(0,n)),e[4]=q(t.substr(n,2)),e[5]=q(t.substr(a)),m(r).bigHour=!0})),vt("Hmm",(function(t,e,r){var n=t.length-2;e[3]=q(t.substr(0,n)),e[4]=q(t.substr(n))})),vt("Hmmss",(function(t,e,r){var n=t.length-4,a=t.length-2;e[3]=q(t.substr(0,n)),e[4]=q(t.substr(n,2)),e[5]=q(t.substr(a))}));var $t=Z("Hours",!0);var Qt,te={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Mt,monthsShort:kt,week:{dow:0,doy:6},weekdays:Bt,weekdaysMin:Ut,weekdaysShort:Ht,meridiemParse:/[ap]\.?m?\.?/i},ee={},re={};function ne(t,e){var r,n=Math.min(t.length,e.length);for(r=0;r<n;r+=1)if(t[r]!==e[r])return r;return n}function ae(t){return t?t.toLowerCase().replace("_","-"):t}function ie(e){var n=null;if(void 0===ee[e]&&t&&t.exports&&function(t){return null!=t.match("^[^/\\\\]*$")}(e))try{n=Qt._abbr,r(46700)("./"+e),oe(n)}catch(t){ee[e]=null}return ee[e]}function oe(t,e){var r;return t&&((r=u(e)?le(t):se(t,e))?Qt=r:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),Qt._abbr}function se(t,e){if(null!==e){var r,n=te;if(e.abbr=t,null!=ee[t])A("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=ee[t]._config;else if(null!=e.parentLocale)if(null!=ee[e.parentLocale])n=ee[e.parentLocale]._config;else{if(null==(r=ie(e.parentLocale)))return re[e.parentLocale]||(re[e.parentLocale]=[]),re[e.parentLocale].push({name:t,config:e}),null;n=r._config}return ee[t]=new C(E(n,e)),re[t]&&re[t].forEach((function(t){se(t.name,t.config)})),oe(t),ee[t]}return delete ee[t],null}function le(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Qt;if(!i(t)){if(e=ie(t))return e;t=[t]}return function(t){for(var e,r,n,a,i=0;i<t.length;){for(e=(a=ae(t[i]).split("-")).length,r=(r=ae(t[i+1]))?r.split("-"):null;e>0;){if(n=ie(a.slice(0,e).join("-")))return n;if(r&&r.length>=e&&ne(a,r)>=e-1)break;e--}i++}return Qt}(t)}function ue(t){var e,r=t._a;return r&&-2===m(t).overflow&&(e=r[1]<0||r[1]>11?1:r[2]<1||r[2]>wt(r[0],r[1])?2:r[3]<0||r[3]>24||24===r[3]&&(0!==r[4]||0!==r[5]||0!==r[6])?3:r[4]<0||r[4]>59?4:r[5]<0||r[5]>59?5:r[6]<0||r[6]>999?6:-1,m(t)._overflowDayOfYear&&(e<0||e>2)&&(e=2),m(t)._overflowWeeks&&-1===e&&(e=7),m(t)._overflowWeekday&&-1===e&&(e=8),m(t).overflow=e),t}var ce=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,he=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,de=/Z|[+-]\d\d(?::?\d\d)?/,fe=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],pe=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],me=/^\/?Date\((-?\d+)/i,ge=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,ye={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function ve(t){var e,r,n,a,i,o,s=t._i,l=ce.exec(s)||he.exec(s),u=fe.length,c=pe.length;if(l){for(m(t).iso=!0,e=0,r=u;e<r;e++)if(fe[e][1].exec(l[1])){a=fe[e][0],n=!1!==fe[e][2];break}if(null==a)return void(t._isValid=!1);if(l[3]){for(e=0,r=c;e<r;e++)if(pe[e][1].exec(l[3])){i=(l[2]||" ")+pe[e][0];break}if(null==i)return void(t._isValid=!1)}if(!n&&null!=i)return void(t._isValid=!1);if(l[4]){if(!de.exec(l[4]))return void(t._isValid=!1);o="Z"}t._f=a+(i||"")+(o||""),Me(t)}else t._isValid=!1}function _e(t){var e=parseInt(t,10);return e<=49?2e3+e:e<=999?1900+e:e}function xe(t){var e,r,n,a,i,o,s,l,u=ge.exec(t._i.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(u){if(r=u[4],n=u[3],a=u[2],i=u[5],o=u[6],s=u[7],l=[_e(r),kt.indexOf(n),parseInt(a,10),parseInt(i,10),parseInt(o,10)],s&&l.push(parseInt(s,10)),e=l,!function(t,e,r){return!t||Ht.indexOf(t)===new Date(e[0],e[1],e[2]).getDay()||(m(r).weekdayMismatch=!0,r._isValid=!1,!1)}(u[1],e,t))return;t._a=e,t._tzm=function(t,e,r){if(t)return ye[t];if(e)return 0;var n=parseInt(r,10),a=n%100;return(n-a)/100*60+a}(u[8],u[9],u[10]),t._d=It.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),m(t).rfc2822=!0}else t._isValid=!1}function be(t,e,r){return null!=t?t:null!=e?e:r}function we(t){var e,r,n,i,o,s=[];if(!t._d){for(n=function(t){var e=new Date(a.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}(t),t._w&&null==t._a[2]&&null==t._a[1]&&function(t){var e,r,n,a,i,o,s,l,u;null!=(e=t._w).GG||null!=e.W||null!=e.E?(i=1,o=4,r=be(e.GG,t._a[0],Nt(Le(),1,4).year),n=be(e.W,1),((a=be(e.E,1))<1||a>7)&&(l=!0)):(i=t._locale._week.dow,o=t._locale._week.doy,u=Nt(Le(),i,o),r=be(e.gg,t._a[0],u.year),n=be(e.w,u.week),null!=e.d?((a=e.d)<0||a>6)&&(l=!0):null!=e.e?(a=e.e+i,(e.e<0||e.e>6)&&(l=!0)):a=i),n<1||n>Yt(r,i,o)?m(t)._overflowWeeks=!0:null!=l?m(t)._overflowWeekday=!0:(s=Ft(r,n,a,i,o),t._a[0]=s.year,t._dayOfYear=s.dayOfYear)}(t),null!=t._dayOfYear&&(o=be(t._a[0],n[0]),(t._dayOfYear>Pt(o)||0===t._dayOfYear)&&(m(t)._overflowDayOfYear=!0),r=It(o,0,t._dayOfYear),t._a[1]=r.getUTCMonth(),t._a[2]=r.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=s[e]=n[e];for(;e<7;e++)t._a[e]=s[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[3]&&0===t._a[4]&&0===t._a[5]&&0===t._a[6]&&(t._nextDay=!0,t._a[3]=0),t._d=(t._useUTC?It:zt).apply(null,s),i=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[3]=24),t._w&&void 0!==t._w.d&&t._w.d!==i&&(m(t).weekdayMismatch=!0)}}function Me(t){if(t._f!==a.ISO_8601)if(t._f!==a.RFC_2822){t._a=[],m(t).empty=!0;var e,r,n,i,o,s,l,u=""+t._i,c=u.length,h=0;for(l=(n=N(t._f,t._locale).match(P)||[]).length,e=0;e<l;e++)i=n[e],(r=(u.match(mt(i,t))||[])[0])&&((o=u.substr(0,u.indexOf(r))).length>0&&m(t).unusedInput.push(o),u=u.slice(u.indexOf(r)+r.length),h+=r.length),I[i]?(r?m(t).empty=!1:m(t).unusedTokens.push(i),xt(i,r,t)):t._strict&&!r&&m(t).unusedTokens.push(i);m(t).charsLeftOver=c-h,u.length>0&&m(t).unusedInput.push(u),t._a[3]<=12&&!0===m(t).bigHour&&t._a[3]>0&&(m(t).bigHour=void 0),m(t).parsedDateParts=t._a.slice(0),m(t).meridiem=t._meridiem,t._a[3]=function(t,e,r){var n;return null==r?e:null!=t.meridiemHour?t.meridiemHour(e,r):null!=t.isPM?((n=t.isPM(r))&&e<12&&(e+=12),n||12!==e||(e=0),e):e}(t._locale,t._a[3],t._meridiem),null!==(s=m(t).era)&&(t._a[0]=t._locale.erasConvertYear(s,t._a[0])),we(t),ue(t)}else xe(t);else ve(t)}function ke(t){var e=t._i,r=t._f;return t._locale=t._locale||le(t._l),null===e||void 0===r&&""===e?y({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),w(e)?new b(ue(e)):(h(e)?t._d=e:i(r)?function(t){var e,r,n,a,i,o,s=!1,l=t._f.length;if(0===l)return m(t).invalidFormat=!0,void(t._d=new Date(NaN));for(a=0;a<l;a++)i=0,o=!1,e=x({},t),null!=t._useUTC&&(e._useUTC=t._useUTC),e._f=t._f[a],Me(e),g(e)&&(o=!0),i+=m(e).charsLeftOver,i+=10*m(e).unusedTokens.length,m(e).score=i,s?i<n&&(n=i,r=e):(null==n||i<n||o)&&(n=i,r=e,o&&(s=!0));f(t,r||e)}(t):r?Me(t):function(t){var e=t._i;u(e)?t._d=new Date(a.now()):h(e)?t._d=new Date(e.valueOf()):"string"==typeof e?function(t){var e=me.exec(t._i);null===e?(ve(t),!1===t._isValid&&(delete t._isValid,xe(t),!1===t._isValid&&(delete t._isValid,t._strict?t._isValid=!1:a.createFromInputFallback(t)))):t._d=new Date(+e[1])}(t):i(e)?(t._a=d(e.slice(0),(function(t){return parseInt(t,10)})),we(t)):o(e)?function(t){if(!t._d){var e=H(t._i),r=void 0===e.day?e.date:e.day;t._a=d([e.year,e.month,r,e.hour,e.minute,e.second,e.millisecond],(function(t){return t&&parseInt(t,10)})),we(t)}}(t):c(e)?t._d=new Date(e):a.createFromInputFallback(t)}(t),g(t)||(t._d=null),t))}function Te(t,e,r,n,a){var s,u={};return!0!==e&&!1!==e||(n=e,e=void 0),!0!==r&&!1!==r||(n=r,r=void 0),(o(t)&&l(t)||i(t)&&0===t.length)&&(t=void 0),u._isAMomentObject=!0,u._useUTC=u._isUTC=a,u._l=r,u._i=t,u._f=e,u._strict=n,(s=new b(ue(ke(u))))._nextDay&&(s.add(1,"d"),s._nextDay=void 0),s}function Le(t,e,r,n){return Te(t,e,r,n,!1)}a.createFromInputFallback=k("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",(function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))})),a.ISO_8601=function(){},a.RFC_2822=function(){};var Ae=k("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var t=Le.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:y()})),Se=k("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var t=Le.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:y()}));function Ee(t,e){var r,n;if(1===e.length&&i(e[0])&&(e=e[0]),!e.length)return Le();for(r=e[0],n=1;n<e.length;++n)e[n].isValid()&&!e[n][t](r)||(r=e[n]);return r}var Ce=["year","quarter","month","week","day","hour","minute","second","millisecond"];function De(t){var e=H(t),r=e.year||0,n=e.quarter||0,a=e.month||0,i=e.week||e.isoWeek||0,o=e.day||0,l=e.hour||0,u=e.minute||0,c=e.second||0,h=e.millisecond||0;this._isValid=function(t){var e,r,n=!1,a=Ce.length;for(e in t)if(s(t,e)&&(-1===bt.call(Ce,e)||null!=t[e]&&isNaN(t[e])))return!1;for(r=0;r<a;++r)if(t[Ce[r]]){if(n)return!1;parseFloat(t[Ce[r]])!==q(t[Ce[r]])&&(n=!0)}return!0}(e),this._milliseconds=+h+1e3*c+6e4*u+1e3*l*60*60,this._days=+o+7*i,this._months=+a+3*n+12*r,this._data={},this._locale=le(),this._bubble()}function Pe(t){return t instanceof De}function Oe(t){return t<0?-1*Math.round(-1*t):Math.round(t)}function ze(t,e){R(t,0,0,(function(){var t=this.utcOffset(),r="+";return t<0&&(t=-t,r="-"),r+D(~~(t/60),2)+e+D(~~t%60,2)}))}ze("Z",":"),ze("ZZ",""),pt("Z",dt),pt("ZZ",dt),vt(["Z","ZZ"],(function(t,e,r){r._useUTC=!0,r._tzm=Re(dt,t)}));var Ie=/([\+\-]|\d\d)/gi;function Re(t,e){var r,n,a=(e||"").match(t);return null===a?null:0===(n=60*(r=((a[a.length-1]||[])+"").match(Ie)||["-",0,0])[1]+q(r[2]))?0:"+"===r[0]?n:-n}function Fe(t,e){var r,n;return e._isUTC?(r=e.clone(),n=(w(t)||h(t)?t.valueOf():Le(t).valueOf())-r.valueOf(),r._d.setTime(r._d.valueOf()+n),a.updateOffset(r,!1),r):Le(t).local()}function Ne(t){return-Math.round(t._d.getTimezoneOffset())}function Ye(){return!!this.isValid()&&this._isUTC&&0===this._offset}a.updateOffset=function(){};var je=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Be=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function He(t,e){var r,n,a,i,o,l,u=t,h=null;return Pe(t)?u={ms:t._milliseconds,d:t._days,M:t._months}:c(t)||!isNaN(+t)?(u={},e?u[e]=+t:u.milliseconds=+t):(h=je.exec(t))?(r="-"===h[1]?-1:1,u={y:0,d:q(h[2])*r,h:q(h[3])*r,m:q(h[4])*r,s:q(h[5])*r,ms:q(Oe(1e3*h[6]))*r}):(h=Be.exec(t))?(r="-"===h[1]?-1:1,u={y:Ue(h[2],r),M:Ue(h[3],r),w:Ue(h[4],r),d:Ue(h[5],r),h:Ue(h[6],r),m:Ue(h[7],r),s:Ue(h[8],r)}):null==u?u={}:"object"==typeof u&&("from"in u||"to"in u)&&(i=Le(u.from),o=Le(u.to),a=i.isValid()&&o.isValid()?(o=Fe(o,i),i.isBefore(o)?l=Ve(i,o):((l=Ve(o,i)).milliseconds=-l.milliseconds,l.months=-l.months),l):{milliseconds:0,months:0},(u={}).ms=a.milliseconds,u.M=a.months),n=new De(u),Pe(t)&&s(t,"_locale")&&(n._locale=t._locale),Pe(t)&&s(t,"_isValid")&&(n._isValid=t._isValid),n}function Ue(t,e){var r=t&&parseFloat(t.replace(",","."));return(isNaN(r)?0:r)*e}function Ve(t,e){var r={};return r.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(r.months,"M").isAfter(e)&&--r.months,r.milliseconds=+e-+t.clone().add(r.months,"M"),r}function We(t,e){return function(r,n){var a;return null===n||isNaN(+n)||(A(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),a=r,r=n,n=a),Ge(this,He(r,n),t),this}}function Ge(t,e,r,n){var i=e._milliseconds,o=Oe(e._days),s=Oe(e._months);t.isValid()&&(n=null==n||n,s&&Et(t,X(t,"Month")+s*r),o&&J(t,"Date",X(t,"Date")+o*r),i&&t._d.setTime(t._d.valueOf()+i*r),n&&a.updateOffset(t,o||s))}He.fn=De.prototype,He.invalid=function(){return He(NaN)};var qe=We(1,"add"),Ze=We(-1,"subtract");function Xe(t){return"string"==typeof t||t instanceof String}function Je(t){return w(t)||h(t)||Xe(t)||c(t)||function(t){var e=i(t),r=!1;return e&&(r=0===t.filter((function(e){return!c(e)&&Xe(t)})).length),e&&r}(t)||function(t){var e,r,n=o(t)&&!l(t),a=!1,i=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],u=i.length;for(e=0;e<u;e+=1)r=i[e],a=a||s(t,r);return n&&a}(t)||null==t}function Ke(t){var e,r=o(t)&&!l(t),n=!1,a=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"];for(e=0;e<a.length;e+=1)n=n||s(t,a[e]);return r&&n}function $e(t,e){if(t.date()<e.date())return-$e(e,t);var r=12*(e.year()-t.year())+(e.month()-t.month()),n=t.clone().add(r,"months");return-(r+(e-n<0?(e-n)/(n-t.clone().add(r-1,"months")):(e-n)/(t.clone().add(r+1,"months")-n)))||0}function Qe(t){var e;return void 0===t?this._locale._abbr:(null!=(e=le(t))&&(this._locale=e),this)}a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",a.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var tr=k("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(t){return void 0===t?this.localeData():this.locale(t)}));function er(){return this._locale}var rr=1e3,nr=6e4,ar=36e5,ir=126227808e5;function or(t,e){return(t%e+e)%e}function sr(t,e,r){return t<100&&t>=0?new Date(t+400,e,r)-ir:new Date(t,e,r).valueOf()}function lr(t,e,r){return t<100&&t>=0?Date.UTC(t+400,e,r)-ir:Date.UTC(t,e,r)}function ur(t,e){return e.erasAbbrRegex(t)}function cr(){var t,e,r=[],n=[],a=[],i=[],o=this.eras();for(t=0,e=o.length;t<e;++t)n.push(gt(o[t].name)),r.push(gt(o[t].abbr)),a.push(gt(o[t].narrow)),i.push(gt(o[t].name)),i.push(gt(o[t].abbr)),i.push(gt(o[t].narrow));this._erasRegex=new RegExp("^("+i.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+n.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+a.join("|")+")","i")}function hr(t,e){R(0,[t,t.length],0,e)}function dr(t,e,r,n,a){var i;return null==t?Nt(this,n,a).year:(e>(i=Yt(t,n,a))&&(e=i),fr.call(this,t,e,r,n,a))}function fr(t,e,r,n,a){var i=Ft(t,e,r,n,a),o=It(i.year,0,i.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}R("N",0,0,"eraAbbr"),R("NN",0,0,"eraAbbr"),R("NNN",0,0,"eraAbbr"),R("NNNN",0,0,"eraName"),R("NNNNN",0,0,"eraNarrow"),R("y",["y",1],"yo","eraYear"),R("y",["yy",2],0,"eraYear"),R("y",["yyy",3],0,"eraYear"),R("y",["yyyy",4],0,"eraYear"),pt("N",ur),pt("NN",ur),pt("NNN",ur),pt("NNNN",(function(t,e){return e.erasNameRegex(t)})),pt("NNNNN",(function(t,e){return e.erasNarrowRegex(t)})),vt(["N","NN","NNN","NNNN","NNNNN"],(function(t,e,r,n){var a=r._locale.erasParse(t,n,r._strict);a?m(r).era=a:m(r).invalidEra=t})),pt("y",ut),pt("yy",ut),pt("yyy",ut),pt("yyyy",ut),pt("yo",(function(t,e){return e._eraYearOrdinalRegex||ut})),vt(["y","yy","yyy","yyyy"],0),vt(["yo"],(function(t,e,r,n){var a;r._locale._eraYearOrdinalRegex&&(a=t.match(r._locale._eraYearOrdinalRegex)),r._locale.eraYearOrdinalParse?e[0]=r._locale.eraYearOrdinalParse(t,a):e[0]=parseInt(t,10)})),R(0,["gg",2],0,(function(){return this.weekYear()%100})),R(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),hr("gggg","weekYear"),hr("ggggg","weekYear"),hr("GGGG","isoWeekYear"),hr("GGGGG","isoWeekYear"),j("weekYear","gg"),j("isoWeekYear","GG"),V("weekYear",1),V("isoWeekYear",1),pt("G",ct),pt("g",ct),pt("GG",nt,Q),pt("gg",nt,Q),pt("GGGG",st,et),pt("gggg",st,et),pt("GGGGG",lt,rt),pt("ggggg",lt,rt),_t(["gggg","ggggg","GGGG","GGGGG"],(function(t,e,r,n){e[n.substr(0,2)]=q(t)})),_t(["gg","GG"],(function(t,e,r,n){e[n]=a.parseTwoDigitYear(t)})),R("Q",0,"Qo","quarter"),j("quarter","Q"),V("quarter",7),pt("Q",$),vt("Q",(function(t,e){e[1]=3*(q(t)-1)})),R("D",["DD",2],"Do","date"),j("date","D"),V("date",9),pt("D",nt),pt("DD",nt,Q),pt("Do",(function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient})),vt(["D","DD"],2),vt("Do",(function(t,e){e[2]=q(t.match(nt)[0])}));var pr=Z("Date",!0);R("DDD",["DDDD",3],"DDDo","dayOfYear"),j("dayOfYear","DDD"),V("dayOfYear",4),pt("DDD",ot),pt("DDDD",tt),vt(["DDD","DDDD"],(function(t,e,r){r._dayOfYear=q(t)})),R("m",["mm",2],0,"minute"),j("minute","m"),V("minute",14),pt("m",nt),pt("mm",nt,Q),vt(["m","mm"],4);var mr=Z("Minutes",!1);R("s",["ss",2],0,"second"),j("second","s"),V("second",15),pt("s",nt),pt("ss",nt,Q),vt(["s","ss"],5);var gr,yr,vr=Z("Seconds",!1);for(R("S",0,0,(function(){return~~(this.millisecond()/100)})),R(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),R(0,["SSS",3],0,"millisecond"),R(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),R(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),R(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),R(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),R(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),R(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),j("millisecond","ms"),V("millisecond",16),pt("S",ot,$),pt("SS",ot,Q),pt("SSS",ot,tt),gr="SSSS";gr.length<=9;gr+="S")pt(gr,ut);function _r(t,e){e[6]=q(1e3*("0."+t))}for(gr="S";gr.length<=9;gr+="S")vt(gr,_r);yr=Z("Milliseconds",!1),R("z",0,0,"zoneAbbr"),R("zz",0,0,"zoneName");var xr=b.prototype;function br(t){return t}xr.add=qe,xr.calendar=function(t,e){1===arguments.length&&(arguments[0]?Je(arguments[0])?(t=arguments[0],e=void 0):Ke(arguments[0])&&(e=arguments[0],t=void 0):(t=void 0,e=void 0));var r=t||Le(),n=Fe(r,this).startOf("day"),i=a.calendarFormat(this,n)||"sameElse",o=e&&(S(e[i])?e[i].call(this,r):e[i]);return this.format(o||this.localeData().calendar(i,this,Le(r)))},xr.clone=function(){return new b(this)},xr.diff=function(t,e,r){var n,a,i;if(!this.isValid())return NaN;if(!(n=Fe(t,this)).isValid())return NaN;switch(a=6e4*(n.utcOffset()-this.utcOffset()),e=B(e)){case"year":i=$e(this,n)/12;break;case"month":i=$e(this,n);break;case"quarter":i=$e(this,n)/3;break;case"second":i=(this-n)/1e3;break;case"minute":i=(this-n)/6e4;break;case"hour":i=(this-n)/36e5;break;case"day":i=(this-n-a)/864e5;break;case"week":i=(this-n-a)/6048e5;break;default:i=this-n}return r?i:G(i)},xr.endOf=function(t){var e,r;if(void 0===(t=B(t))||"millisecond"===t||!this.isValid())return this;switch(r=this._isUTC?lr:sr,t){case"year":e=r(this.year()+1,0,1)-1;break;case"quarter":e=r(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=r(this.year(),this.month()+1,1)-1;break;case"week":e=r(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=r(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=ar-or(e+(this._isUTC?0:this.utcOffset()*nr),ar)-1;break;case"minute":e=this._d.valueOf(),e+=nr-or(e,nr)-1;break;case"second":e=this._d.valueOf(),e+=rr-or(e,rr)-1}return this._d.setTime(e),a.updateOffset(this,!0),this},xr.format=function(t){t||(t=this.isUtc()?a.defaultFormatUtc:a.defaultFormat);var e=F(this,t);return this.localeData().postformat(e)},xr.from=function(t,e){return this.isValid()&&(w(t)&&t.isValid()||Le(t).isValid())?He({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},xr.fromNow=function(t){return this.from(Le(),t)},xr.to=function(t,e){return this.isValid()&&(w(t)&&t.isValid()||Le(t).isValid())?He({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},xr.toNow=function(t){return this.to(Le(),t)},xr.get=function(t){return S(this[t=B(t)])?this[t]():this},xr.invalidAt=function(){return m(this).overflow},xr.isAfter=function(t,e){var r=w(t)?t:Le(t);return!(!this.isValid()||!r.isValid())&&("millisecond"===(e=B(e)||"millisecond")?this.valueOf()>r.valueOf():r.valueOf()<this.clone().startOf(e).valueOf())},xr.isBefore=function(t,e){var r=w(t)?t:Le(t);return!(!this.isValid()||!r.isValid())&&("millisecond"===(e=B(e)||"millisecond")?this.valueOf()<r.valueOf():this.clone().endOf(e).valueOf()<r.valueOf())},xr.isBetween=function(t,e,r,n){var a=w(t)?t:Le(t),i=w(e)?e:Le(e);return!!(this.isValid()&&a.isValid()&&i.isValid())&&("("===(n=n||"()")[0]?this.isAfter(a,r):!this.isBefore(a,r))&&(")"===n[1]?this.isBefore(i,r):!this.isAfter(i,r))},xr.isSame=function(t,e){var r,n=w(t)?t:Le(t);return!(!this.isValid()||!n.isValid())&&("millisecond"===(e=B(e)||"millisecond")?this.valueOf()===n.valueOf():(r=n.valueOf(),this.clone().startOf(e).valueOf()<=r&&r<=this.clone().endOf(e).valueOf()))},xr.isSameOrAfter=function(t,e){return this.isSame(t,e)||this.isAfter(t,e)},xr.isSameOrBefore=function(t,e){return this.isSame(t,e)||this.isBefore(t,e)},xr.isValid=function(){return g(this)},xr.lang=tr,xr.locale=Qe,xr.localeData=er,xr.max=Se,xr.min=Ae,xr.parsingFlags=function(){return f({},m(this))},xr.set=function(t,e){if("object"==typeof t){var r,n=function(t){var e,r=[];for(e in t)s(t,e)&&r.push({unit:e,priority:U[e]});return r.sort((function(t,e){return t.priority-e.priority})),r}(t=H(t)),a=n.length;for(r=0;r<a;r++)this[n[r].unit](t[n[r].unit])}else if(S(this[t=B(t)]))return this[t](e);return this},xr.startOf=function(t){var e,r;if(void 0===(t=B(t))||"millisecond"===t||!this.isValid())return this;switch(r=this._isUTC?lr:sr,t){case"year":e=r(this.year(),0,1);break;case"quarter":e=r(this.year(),this.month()-this.month()%3,1);break;case"month":e=r(this.year(),this.month(),1);break;case"week":e=r(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=r(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=or(e+(this._isUTC?0:this.utcOffset()*nr),ar);break;case"minute":e=this._d.valueOf(),e-=or(e,nr);break;case"second":e=this._d.valueOf(),e-=or(e,rr)}return this._d.setTime(e),a.updateOffset(this,!0),this},xr.subtract=Ze,xr.toArray=function(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]},xr.toObject=function(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}},xr.toDate=function(){return new Date(this.valueOf())},xr.toISOString=function(t){if(!this.isValid())return null;var e=!0!==t,r=e?this.clone().utc():this;return r.year()<0||r.year()>9999?F(r,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):S(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",F(r,"Z")):F(r,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},xr.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t,e,r,n="moment",a="";return this.isLocal()||(n=0===this.utcOffset()?"moment.utc":"moment.parseZone",a="Z"),t="["+n+'("]',e=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY","-MM-DD[T]HH:mm:ss.SSS",r=a+'[")]',this.format(t+e+"-MM-DD[T]HH:mm:ss.SSS"+r)},"undefined"!=typeof Symbol&&null!=Symbol.for&&(xr[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),xr.toJSON=function(){return this.isValid()?this.toISOString():null},xr.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},xr.unix=function(){return Math.floor(this.valueOf()/1e3)},xr.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},xr.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},xr.eraName=function(){var t,e,r,n=this.localeData().eras();for(t=0,e=n.length;t<e;++t){if(r=this.clone().startOf("day").valueOf(),n[t].since<=r&&r<=n[t].until)return n[t].name;if(n[t].until<=r&&r<=n[t].since)return n[t].name}return""},xr.eraNarrow=function(){var t,e,r,n=this.localeData().eras();for(t=0,e=n.length;t<e;++t){if(r=this.clone().startOf("day").valueOf(),n[t].since<=r&&r<=n[t].until)return n[t].narrow;if(n[t].until<=r&&r<=n[t].since)return n[t].narrow}return""},xr.eraAbbr=function(){var t,e,r,n=this.localeData().eras();for(t=0,e=n.length;t<e;++t){if(r=this.clone().startOf("day").valueOf(),n[t].since<=r&&r<=n[t].until)return n[t].abbr;if(n[t].until<=r&&r<=n[t].since)return n[t].abbr}return""},xr.eraYear=function(){var t,e,r,n,i=this.localeData().eras();for(t=0,e=i.length;t<e;++t)if(r=i[t].since<=i[t].until?1:-1,n=this.clone().startOf("day").valueOf(),i[t].since<=n&&n<=i[t].until||i[t].until<=n&&n<=i[t].since)return(this.year()-a(i[t].since).year())*r+i[t].offset;return this.year()},xr.year=Ot,xr.isLeapYear=function(){return W(this.year())},xr.weekYear=function(t){return dr.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},xr.isoWeekYear=function(t){return dr.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)},xr.quarter=xr.quarters=function(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)},xr.month=Ct,xr.daysInMonth=function(){return wt(this.year(),this.month())},xr.week=xr.weeks=function(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")},xr.isoWeek=xr.isoWeeks=function(t){var e=Nt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")},xr.weeksInYear=function(){var t=this.localeData()._week;return Yt(this.year(),t.dow,t.doy)},xr.weeksInWeekYear=function(){var t=this.localeData()._week;return Yt(this.weekYear(),t.dow,t.doy)},xr.isoWeeksInYear=function(){return Yt(this.year(),1,4)},xr.isoWeeksInISOWeekYear=function(){return Yt(this.isoWeekYear(),1,4)},xr.date=pr,xr.day=xr.days=function(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=function(t,e){return"string"!=typeof t?t:isNaN(t)?"number"==typeof(t=e.weekdaysParse(t))?t:null:parseInt(t,10)}(t,this.localeData()),this.add(t-e,"d")):e},xr.weekday=function(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")},xr.isoWeekday=function(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=function(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7},xr.dayOfYear=function(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")},xr.hour=xr.hours=$t,xr.minute=xr.minutes=mr,xr.second=xr.seconds=vr,xr.millisecond=xr.milliseconds=yr,xr.utcOffset=function(t,e,r){var n,i=this._offset||0;if(!this.isValid())return null!=t?this:NaN;if(null!=t){if("string"==typeof t){if(null===(t=Re(dt,t)))return this}else Math.abs(t)<16&&!r&&(t*=60);return!this._isUTC&&e&&(n=Ne(this)),this._offset=t,this._isUTC=!0,null!=n&&this.add(n,"m"),i!==t&&(!e||this._changeInProgress?Ge(this,He(t-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?i:Ne(this)},xr.utc=function(t){return this.utcOffset(0,t)},xr.local=function(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Ne(this),"m")),this},xr.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var t=Re(ht,this._i);null!=t?this.utcOffset(t):this.utcOffset(0,!0)}return this},xr.hasAlignedHourOffset=function(t){return!!this.isValid()&&(t=t?Le(t).utcOffset():0,(this.utcOffset()-t)%60==0)},xr.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},xr.isLocal=function(){return!!this.isValid()&&!this._isUTC},xr.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},xr.isUtc=Ye,xr.isUTC=Ye,xr.zoneAbbr=function(){return this._isUTC?"UTC":""},xr.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},xr.dates=k("dates accessor is deprecated. Use date instead.",pr),xr.months=k("months accessor is deprecated. Use month instead",Ct),xr.years=k("years accessor is deprecated. Use year instead",Ot),xr.zone=k("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()})),xr.isDSTShifted=k("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!u(this._isDSTShifted))return this._isDSTShifted;var t,e={};return x(e,this),(e=ke(e))._a?(t=e._isUTC?p(e._a):Le(e._a),this._isDSTShifted=this.isValid()&&function(t,e,r){var n,a=Math.min(t.length,e.length),i=Math.abs(t.length-e.length),o=0;for(n=0;n<a;n++)(r&&t[n]!==e[n]||!r&&q(t[n])!==q(e[n]))&&o++;return o+i}(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}));var wr=C.prototype;function Mr(t,e,r,n){var a=le(),i=p().set(n,e);return a[r](i,t)}function kr(t,e,r){if(c(t)&&(e=t,t=void 0),t=t||"",null!=e)return Mr(t,e,r,"month");var n,a=[];for(n=0;n<12;n++)a[n]=Mr(t,n,r,"month");return a}function Tr(t,e,r,n){"boolean"==typeof t?(c(e)&&(r=e,e=void 0),e=e||""):(r=e=t,t=!1,c(e)&&(r=e,e=void 0),e=e||"");var a,i=le(),o=t?i._week.dow:0,s=[];if(null!=r)return Mr(e,(r+o)%7,n,"day");for(a=0;a<7;a++)s[a]=Mr(e,(a+o)%7,n,"day");return s}wr.calendar=function(t,e,r){var n=this._calendar[t]||this._calendar.sameElse;return S(n)?n.call(e,r):n},wr.longDateFormat=function(t){var e=this._longDateFormat[t],r=this._longDateFormat[t.toUpperCase()];return e||!r?e:(this._longDateFormat[t]=r.match(P).map((function(t){return"MMMM"===t||"MM"===t||"DD"===t||"dddd"===t?t.slice(1):t})).join(""),this._longDateFormat[t])},wr.invalidDate=function(){return this._invalidDate},wr.ordinal=function(t){return this._ordinal.replace("%d",t)},wr.preparse=br,wr.postformat=br,wr.relativeTime=function(t,e,r,n){var a=this._relativeTime[r];return S(a)?a(t,e,r,n):a.replace(/%d/i,t)},wr.pastFuture=function(t,e){var r=this._relativeTime[t>0?"future":"past"];return S(r)?r(e):r.replace(/%s/i,e)},wr.set=function(t){var e,r;for(r in t)s(t,r)&&(S(e=t[r])?this[r]=e:this["_"+r]=e);this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},wr.eras=function(t,e){var r,n,i,o=this._eras||le("en")._eras;for(r=0,n=o.length;r<n;++r)switch("string"==typeof o[r].since&&(i=a(o[r].since).startOf("day"),o[r].since=i.valueOf()),typeof o[r].until){case"undefined":o[r].until=1/0;break;case"string":i=a(o[r].until).startOf("day").valueOf(),o[r].until=i.valueOf()}return o},wr.erasParse=function(t,e,r){var n,a,i,o,s,l=this.eras();for(t=t.toUpperCase(),n=0,a=l.length;n<a;++n)if(i=l[n].name.toUpperCase(),o=l[n].abbr.toUpperCase(),s=l[n].narrow.toUpperCase(),r)switch(e){case"N":case"NN":case"NNN":if(o===t)return l[n];break;case"NNNN":if(i===t)return l[n];break;case"NNNNN":if(s===t)return l[n]}else if([i,o,s].indexOf(t)>=0)return l[n]},wr.erasConvertYear=function(t,e){var r=t.since<=t.until?1:-1;return void 0===e?a(t.since).year():a(t.since).year()+(e-t.offset)*r},wr.erasAbbrRegex=function(t){return s(this,"_erasAbbrRegex")||cr.call(this),t?this._erasAbbrRegex:this._erasRegex},wr.erasNameRegex=function(t){return s(this,"_erasNameRegex")||cr.call(this),t?this._erasNameRegex:this._erasRegex},wr.erasNarrowRegex=function(t){return s(this,"_erasNarrowRegex")||cr.call(this),t?this._erasNarrowRegex:this._erasRegex},wr.months=function(t,e){return t?i(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||Tt).test(e)?"format":"standalone"][t.month()]:i(this._months)?this._months:this._months.standalone},wr.monthsShort=function(t,e){return t?i(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[Tt.test(e)?"format":"standalone"][t.month()]:i(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},wr.monthsParse=function(t,e,r){var n,a,i;if(this._monthsParseExact)return St.call(this,t,e,r);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(a=p([2e3,n]),r&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),r||this._monthsParse[n]||(i="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[n]=new RegExp(i.replace(".",""),"i")),r&&"MMMM"===e&&this._longMonthsParse[n].test(t))return n;if(r&&"MMM"===e&&this._shortMonthsParse[n].test(t))return n;if(!r&&this._monthsParse[n].test(t))return n}},wr.monthsRegex=function(t){return this._monthsParseExact?(s(this,"_monthsRegex")||Dt.call(this),t?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=At),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)},wr.monthsShortRegex=function(t){return this._monthsParseExact?(s(this,"_monthsRegex")||Dt.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=Lt),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)},wr.week=function(t){return Nt(t,this._week.dow,this._week.doy).week},wr.firstDayOfYear=function(){return this._week.doy},wr.firstDayOfWeek=function(){return this._week.dow},wr.weekdays=function(t,e){var r=i(this._weekdays)?this._weekdays:this._weekdays[t&&!0!==t&&this._weekdays.isFormat.test(e)?"format":"standalone"];return!0===t?jt(r,this._week.dow):t?r[t.day()]:r},wr.weekdaysMin=function(t){return!0===t?jt(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin},wr.weekdaysShort=function(t){return!0===t?jt(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort},wr.weekdaysParse=function(t,e,r){var n,a,i;if(this._weekdaysParseExact)return qt.call(this,t,e,r);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(a=p([2e3,1]).day(n),r&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(a,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(a,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(a,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(i="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[n]=new RegExp(i.replace(".",""),"i")),r&&"dddd"===e&&this._fullWeekdaysParse[n].test(t))return n;if(r&&"ddd"===e&&this._shortWeekdaysParse[n].test(t))return n;if(r&&"dd"===e&&this._minWeekdaysParse[n].test(t))return n;if(!r&&this._weekdaysParse[n].test(t))return n}},wr.weekdaysRegex=function(t){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Zt.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=Vt),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)},wr.weekdaysShortRegex=function(t){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Zt.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Wt),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},wr.weekdaysMinRegex=function(t){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Zt.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Gt),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},wr.isPM=function(t){return"p"===(t+"").toLowerCase().charAt(0)},wr.meridiem=function(t,e,r){return t>11?r?"pm":"PM":r?"am":"AM"},oe("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1===q(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}}),a.lang=k("moment.lang is deprecated. Use moment.locale instead.",oe),a.langData=k("moment.langData is deprecated. Use moment.localeData instead.",le);var Lr=Math.abs;function Ar(t,e,r,n){var a=He(e,r);return t._milliseconds+=n*a._milliseconds,t._days+=n*a._days,t._months+=n*a._months,t._bubble()}function Sr(t){return t<0?Math.floor(t):Math.ceil(t)}function Er(t){return 4800*t/146097}function Cr(t){return 146097*t/4800}function Dr(t){return function(){return this.as(t)}}var Pr=Dr("ms"),Or=Dr("s"),zr=Dr("m"),Ir=Dr("h"),Rr=Dr("d"),Fr=Dr("w"),Nr=Dr("M"),Yr=Dr("Q"),jr=Dr("y");function Br(t){return function(){return this.isValid()?this._data[t]:NaN}}var Hr=Br("milliseconds"),Ur=Br("seconds"),Vr=Br("minutes"),Wr=Br("hours"),Gr=Br("days"),qr=Br("months"),Zr=Br("years");var Xr=Math.round,Jr={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Kr(t,e,r,n,a){return a.relativeTime(e||1,!!r,t,n)}var $r=Math.abs;function Qr(t){return(t>0)-(t<0)||+t}function tn(){if(!this.isValid())return this.localeData().invalidDate();var t,e,r,n,a,i,o,s,l=$r(this._milliseconds)/1e3,u=$r(this._days),c=$r(this._months),h=this.asSeconds();return h?(t=G(l/60),e=G(t/60),l%=60,t%=60,r=G(c/12),c%=12,n=l?l.toFixed(3).replace(/\.?0+$/,""):"",a=h<0?"-":"",i=Qr(this._months)!==Qr(h)?"-":"",o=Qr(this._days)!==Qr(h)?"-":"",s=Qr(this._milliseconds)!==Qr(h)?"-":"",a+"P"+(r?i+r+"Y":"")+(c?i+c+"M":"")+(u?o+u+"D":"")+(e||t||l?"T":"")+(e?s+e+"H":"")+(t?s+t+"M":"")+(l?s+n+"S":"")):"P0D"}var en=De.prototype;return en.isValid=function(){return this._isValid},en.abs=function(){var t=this._data;return this._milliseconds=Lr(this._milliseconds),this._days=Lr(this._days),this._months=Lr(this._months),t.milliseconds=Lr(t.milliseconds),t.seconds=Lr(t.seconds),t.minutes=Lr(t.minutes),t.hours=Lr(t.hours),t.months=Lr(t.months),t.years=Lr(t.years),this},en.add=function(t,e){return Ar(this,t,e,1)},en.subtract=function(t,e){return Ar(this,t,e,-1)},en.as=function(t){if(!this.isValid())return NaN;var e,r,n=this._milliseconds;if("month"===(t=B(t))||"quarter"===t||"year"===t)switch(e=this._days+n/864e5,r=this._months+Er(e),t){case"month":return r;case"quarter":return r/3;case"year":return r/12}else switch(e=this._days+Math.round(Cr(this._months)),t){case"week":return e/7+n/6048e5;case"day":return e+n/864e5;case"hour":return 24*e+n/36e5;case"minute":return 1440*e+n/6e4;case"second":return 86400*e+n/1e3;case"millisecond":return Math.floor(864e5*e)+n;default:throw new Error("Unknown unit "+t)}},en.asMilliseconds=Pr,en.asSeconds=Or,en.asMinutes=zr,en.asHours=Ir,en.asDays=Rr,en.asWeeks=Fr,en.asMonths=Nr,en.asQuarters=Yr,en.asYears=jr,en.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*q(this._months/12):NaN},en._bubble=function(){var t,e,r,n,a,i=this._milliseconds,o=this._days,s=this._months,l=this._data;return i>=0&&o>=0&&s>=0||i<=0&&o<=0&&s<=0||(i+=864e5*Sr(Cr(s)+o),o=0,s=0),l.milliseconds=i%1e3,t=G(i/1e3),l.seconds=t%60,e=G(t/60),l.minutes=e%60,r=G(e/60),l.hours=r%24,o+=G(r/24),s+=a=G(Er(o)),o-=Sr(Cr(a)),n=G(s/12),s%=12,l.days=o,l.months=s,l.years=n,this},en.clone=function(){return He(this)},en.get=function(t){return t=B(t),this.isValid()?this[t+"s"]():NaN},en.milliseconds=Hr,en.seconds=Ur,en.minutes=Vr,en.hours=Wr,en.days=Gr,en.weeks=function(){return G(this.days()/7)},en.months=qr,en.years=Zr,en.humanize=function(t,e){if(!this.isValid())return this.localeData().invalidDate();var r,n,a=!1,i=Jr;return"object"==typeof t&&(e=t,t=!1),"boolean"==typeof t&&(a=t),"object"==typeof e&&(i=Object.assign({},Jr,e),null!=e.s&&null==e.ss&&(i.ss=e.s-1)),n=function(t,e,r,n){var a=He(t).abs(),i=Xr(a.as("s")),o=Xr(a.as("m")),s=Xr(a.as("h")),l=Xr(a.as("d")),u=Xr(a.as("M")),c=Xr(a.as("w")),h=Xr(a.as("y")),d=i<=r.ss&&["s",i]||i<r.s&&["ss",i]||o<=1&&["m"]||o<r.m&&["mm",o]||s<=1&&["h"]||s<r.h&&["hh",s]||l<=1&&["d"]||l<r.d&&["dd",l];return null!=r.w&&(d=d||c<=1&&["w"]||c<r.w&&["ww",c]),(d=d||u<=1&&["M"]||u<r.M&&["MM",u]||h<=1&&["y"]||["yy",h])[2]=e,d[3]=+t>0,d[4]=n,Kr.apply(null,d)}(this,!a,i,r=this.localeData()),a&&(n=r.pastFuture(+this,n)),r.postformat(n)},en.toISOString=tn,en.toString=tn,en.toJSON=tn,en.locale=Qe,en.localeData=er,en.toIsoString=k("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",tn),en.lang=tr,R("X",0,0,"unix"),R("x",0,0,"valueOf"),pt("x",ct),pt("X",/[+-]?\d+(\.\d{1,3})?/),vt("X",(function(t,e,r){r._d=new Date(1e3*parseFloat(t))})),vt("x",(function(t,e,r){r._d=new Date(q(t))})),a.version="2.29.4",e=Le,a.fn=xr,a.min=function(){return Ee("isBefore",[].slice.call(arguments,0))},a.max=function(){return Ee("isAfter",[].slice.call(arguments,0))},a.now=function(){return Date.now?Date.now():+new Date},a.utc=p,a.unix=function(t){return Le(1e3*t)},a.months=function(t,e){return kr(t,e,"months")},a.isDate=h,a.locale=oe,a.invalid=y,a.duration=He,a.isMoment=w,a.weekdays=function(t,e,r){return Tr(t,e,r,"weekdays")},a.parseZone=function(){return Le.apply(null,arguments).parseZone()},a.localeData=le,a.isDuration=Pe,a.monthsShort=function(t,e){return kr(t,e,"monthsShort")},a.weekdaysMin=function(t,e,r){return Tr(t,e,r,"weekdaysMin")},a.defineLocale=se,a.updateLocale=function(t,e){if(null!=e){var r,n,a=te;null!=ee[t]&&null!=ee[t].parentLocale?ee[t].set(E(ee[t]._config,e)):(null!=(n=ie(t))&&(a=n._config),e=E(a,e),null==n&&(e.abbr=t),(r=new C(e)).parentLocale=ee[t],ee[t]=r),oe(t)}else null!=ee[t]&&(null!=ee[t].parentLocale?(ee[t]=ee[t].parentLocale,t===oe()&&oe(t)):null!=ee[t]&&delete ee[t]);return ee[t]},a.locales=function(){return T(ee)},a.weekdaysShort=function(t,e,r){return Tr(t,e,r,"weekdaysShort")},a.normalizeUnits=B,a.relativeTimeRounding=function(t){return void 0===t?Xr:"function"==typeof t&&(Xr=t,!0)},a.relativeTimeThreshold=function(t,e){return void 0!==Jr[t]&&(void 0===e?Jr[t]:(Jr[t]=e,"s"===t&&(Jr.ss=e-1),!0))},a.calendarFormat=function(t,e){var r=t.diff(e,"days",!0);return r<-6?"sameElse":r<-1?"lastWeek":r<0?"lastDay":r<1?"sameDay":r<2?"nextDay":r<7?"nextWeek":"sameElse"},a.prototype=xr,a.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},a}()},92703:(t,e,r)=>{var n=r(50414);function a(){}function i(){}i.resetWarningCache=a,t.exports=function(){function t(t,e,r,a,i,o){if(o!==n){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function e(){return t}t.isRequired=t;var r={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:i,resetWarningCache:a};return r.PropTypes=r,r}},45697:(t,e,r)=>{t.exports=r(92703)()},50414:t=>{t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},14530:()=>{},65012:()=>{},35501:(t,e,r)=>{r.d(e,{rj:()=>T,QY:()=>L,ZP:()=>T,Fv:()=>v,X7:()=>g});var n=r(88239),a=r(85105),i=r.n(a),o=r(99663),s=r(22600),l=r(49135),u=r(93196),c=r(67294),h=r(94184),d=r.n(h);function f(t){var e=t.cellCount,r=t.cellSize,n=t.computeMetadataCallback,a=t.computeMetadataCallbackProps,i=t.nextCellsCount,o=t.nextCellSize,s=t.nextScrollToIndex,l=t.scrollToIndex,u=t.updateScrollOffsetForScrollToIndex;e===i&&("number"!=typeof r&&"number"!=typeof o||r===o)||(n(a),l>=0&&l===s&&u())}var p=r(54440),m=r(66683);function g(t){var e=t.cellCount,r=t.overscanCellsCount,n=t.scrollDirection,a=t.startIndex,i=t.stopIndex;return 1===n?{overscanStartIndex:Math.max(0,a),overscanStopIndex:Math.min(e-1,i+r)}:{overscanStartIndex:Math.max(0,a-r),overscanStopIndex:Math.min(e-1,i)}}function y(t){var e=t.cellSize,r=t.cellSizeAndPositionManager,n=t.previousCellsCount,a=t.previousCellSize,i=t.previousScrollToAlignment,o=t.previousScrollToIndex,s=t.previousSize,l=t.scrollOffset,u=t.scrollToAlignment,c=t.scrollToIndex,h=t.size,d=t.sizeJustIncreasedFromZero,f=t.updateScrollIndexCallback,p=r.getCellCount(),m=c>=0&&c<p;m&&(h!==s||d||!a||"number"==typeof e&&e!==a||u!==i||c!==o)?f(c):!m&&p>0&&(h<s||p<n)&&l>r.getTotalSize()-h&&f(p-1)}function v(t){for(var e=t.cellCache,r=t.cellRenderer,n=t.columnSizeAndPositionManager,a=t.columnStartIndex,i=t.columnStopIndex,o=t.deferredMeasurementCache,s=t.horizontalOffsetAdjustment,l=t.isScrolling,u=t.parent,c=t.rowSizeAndPositionManager,h=t.rowStartIndex,d=t.rowStopIndex,f=t.styleCache,p=t.verticalOffsetAdjustment,m=t.visibleColumnIndices,g=t.visibleRowIndices,y=[],v=n.areOffsetsAdjusted()||c.areOffsetsAdjusted(),_=!l&&!v,x=h;x<=d;x++)for(var b=c.getSizeAndPositionOfCell(x),w=a;w<=i;w++){var M=n.getSizeAndPositionOfCell(w),k=w>=m.start&&w<=m.stop&&x>=g.start&&x<=g.stop,T=x+"-"+w,L=void 0;_&&f[T]?L=f[T]:o&&!o.has(x,w)?L={height:"auto",left:0,position:"absolute",top:0,width:"auto"}:(L={height:b.size,left:M.offset+s,position:"absolute",top:b.offset+p,width:M.size},f[T]=L);var A={columnIndex:w,isScrolling:l,isVisible:k,key:T,parent:u,rowIndex:x,style:L},S=void 0;!l||s||p?S=r(A):(e[T]||(e[T]=r(A)),S=e[T]),null!=S&&!1!==S&&y.push(S)}return y}r(54634).w0||r(45697).any,r(54634).Wo||r(45697).any,r(54634).jc||r(45697).any,r(54634).M7||r(45697).any,r(54634).sI||r(45697).any;var _=r(44825),x=r.n(_),b=r(7085),w=(r(54634).M7||r(45697).any,r(54634).ww||r(45697).any,r(54634).Yx||r(45697).any,r(54634).tn||r(45697).any,r(54634).Cu||r(45697).any,r(54634).Ow||r(45697).any,r(54634).Hc||r(45697).any,r(54634).jc||r(45697).any,r(54634).Br||r(45697).any,r(54634).YB||r(45697).any,r(54634).Ag||r(45697).any,r(7085).babelPluginFlowReactPropTypes_proptype_AnimationTimeoutId||r(45697).any,"observed"),M="requested",k=function(t){function e(t){(0,o.default)(this,e);var r=(0,l.default)(this,(e.__proto__||i()(e)).call(this,t));return r.state={isScrolling:!1,scrollDirectionHorizontal:1,scrollDirectionVertical:1,scrollLeft:0,scrollTop:0,scrollPositionChangeReason:null},r._onGridRenderedMemoizer=(0,m.Z)(),r._onScrollMemoizer=(0,m.Z)(!1),r._deferredInvalidateColumnIndex=null,r._deferredInvalidateRowIndex=null,r._recomputeScrollLeftFlag=!1,r._recomputeScrollTopFlag=!1,r._horizontalScrollBarSize=0,r._verticalScrollBarSize=0,r._scrollbarPresenceChanged=!1,r._cellCache={},r._styleCache={},r._scrollbarSizeMeasured=!1,r._renderedColumnStartIndex=0,r._renderedColumnStopIndex=0,r._renderedRowStartIndex=0,r._renderedRowStopIndex=0,r._debounceScrollEndedCallback=function(){r._disablePointerEventsTimeoutId=null,r._resetStyleCache()},r._invokeOnGridRenderedHelper=function(){var t=r.props.onSectionRendered;r._onGridRenderedMemoizer({callback:t,indices:{columnOverscanStartIndex:r._columnStartIndex,columnOverscanStopIndex:r._columnStopIndex,columnStartIndex:r._renderedColumnStartIndex,columnStopIndex:r._renderedColumnStopIndex,rowOverscanStartIndex:r._rowStartIndex,rowOverscanStopIndex:r._rowStopIndex,rowStartIndex:r._renderedRowStartIndex,rowStopIndex:r._renderedRowStopIndex}})},r._setScrollingContainerRef=function(t){r._scrollingContainer=t},r._onScroll=function(t){t.target===r._scrollingContainer&&r.handleScrollEvent(t.target)},r._columnWidthGetter=r._wrapSizeGetter(t.columnWidth),r._rowHeightGetter=r._wrapSizeGetter(t.rowHeight),r._columnSizeAndPositionManager=new p.Z({cellCount:t.columnCount,cellSizeGetter:function(t){return r._columnWidthGetter(t)},estimatedCellSize:r._getEstimatedColumnSize(t)}),r._rowSizeAndPositionManager=new p.Z({cellCount:t.rowCount,cellSizeGetter:function(t){return r._rowHeightGetter(t)},estimatedCellSize:r._getEstimatedRowSize(t)}),r}return(0,u.default)(e,t),(0,s.Z)(e,[{key:"getOffsetForCell",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.alignment,r=void 0===e?this.props.scrollToAlignment:e,a=t.columnIndex,i=void 0===a?this.props.scrollToColumn:a,o=t.rowIndex,s=void 0===o?this.props.scrollToRow:o,l=(0,n.default)({},this.props,{scrollToAlignment:r,scrollToColumn:i,scrollToRow:s});return{scrollLeft:this._getCalculatedScrollLeft(l),scrollTop:this._getCalculatedScrollTop(l)}}},{key:"handleScrollEvent",value:function(t){var e=t.scrollLeft,r=void 0===e?0:e,n=t.scrollTop,a=void 0===n?0:n;if(!(a<0)){this._debounceScrollEnded();var i=this.props,o=i.autoHeight,s=i.autoWidth,l=i.height,u=i.width,c=this._scrollbarSize,h=this._rowSizeAndPositionManager.getTotalSize(),d=this._columnSizeAndPositionManager.getTotalSize(),f=Math.min(Math.max(0,d-u+c),r),p=Math.min(Math.max(0,h-l+c),a);if(this.state.scrollLeft!==f||this.state.scrollTop!==p){var m={isScrolling:!0,scrollDirectionHorizontal:f!==this.state.scrollLeft?f>this.state.scrollLeft?1:-1:this.state.scrollDirectionHorizontal,scrollDirectionVertical:p!==this.state.scrollTop?p>this.state.scrollTop?1:-1:this.state.scrollDirectionVertical,scrollPositionChangeReason:w};o||(m.scrollTop=p),s||(m.scrollLeft=f),this.setState(m)}this._invokeOnScrollMemoizer({scrollLeft:f,scrollTop:p,totalColumnsWidth:d,totalRowsHeight:h})}}},{key:"invalidateCellSizeAfterRender",value:function(t){var e=t.columnIndex,r=t.rowIndex;this._deferredInvalidateColumnIndex="number"==typeof this._deferredInvalidateColumnIndex?Math.min(this._deferredInvalidateColumnIndex,e):e,this._deferredInvalidateRowIndex="number"==typeof this._deferredInvalidateRowIndex?Math.min(this._deferredInvalidateRowIndex,r):r}},{key:"measureAllCells",value:function(){var t=this.props,e=t.columnCount,r=t.rowCount;this._columnSizeAndPositionManager.getSizeAndPositionOfCell(e-1),this._rowSizeAndPositionManager.getSizeAndPositionOfCell(r-1)}},{key:"recomputeGridSize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.columnIndex,r=void 0===e?0:e,n=t.rowIndex,a=void 0===n?0:n,i=this.props,o=i.scrollToColumn,s=i.scrollToRow;this._columnSizeAndPositionManager.resetCell(r),this._rowSizeAndPositionManager.resetCell(a),this._recomputeScrollLeftFlag=o>=0&&r<=o,this._recomputeScrollTopFlag=s>=0&&a<=s,this._cellCache={},this._styleCache={},this.forceUpdate()}},{key:"scrollToCell",value:function(t){var e=t.columnIndex,r=t.rowIndex,a=this.props.columnCount,i=this.props;a>1&&void 0!==e&&this._updateScrollLeftForScrollToColumn((0,n.default)({},i,{scrollToColumn:e})),void 0!==r&&this._updateScrollTopForScrollToRow((0,n.default)({},i,{scrollToRow:r}))}},{key:"componentDidMount",value:function(){var t=this.props,e=t.getScrollbarSize,r=t.height,n=t.scrollLeft,a=t.scrollToColumn,i=t.scrollTop,o=t.scrollToRow,s=t.width;this._handleInvalidatedGridSize(),this._scrollbarSizeMeasured||(this._scrollbarSize=e(),this._scrollbarSizeMeasured=!0,this.setState({})),("number"==typeof n&&n>=0||"number"==typeof i&&i>=0)&&this.scrollToPosition({scrollLeft:n,scrollTop:i});var l=r>0&&s>0;a>=0&&l&&this._updateScrollLeftForScrollToColumn(),o>=0&&l&&this._updateScrollTopForScrollToRow(),this._invokeOnGridRenderedHelper(),this._invokeOnScrollMemoizer({scrollLeft:n||0,scrollTop:i||0,totalColumnsWidth:this._columnSizeAndPositionManager.getTotalSize(),totalRowsHeight:this._rowSizeAndPositionManager.getTotalSize()}),this._maybeCallOnScrollbarPresenceChange()}},{key:"componentDidUpdate",value:function(t,e){var r=this,n=this.props,a=n.autoHeight,i=n.autoWidth,o=n.columnCount,s=n.height,l=n.rowCount,u=n.scrollToAlignment,c=n.scrollToColumn,h=n.scrollToRow,d=n.width,f=this.state,p=f.scrollLeft,m=f.scrollPositionChangeReason,g=f.scrollTop;this._handleInvalidatedGridSize();var v=o>0&&0===t.columnCount||l>0&&0===t.rowCount;m===M&&(!i&&p>=0&&(p!==e.scrollLeft&&p!==this._scrollingContainer.scrollLeft||v)&&(this._scrollingContainer.scrollLeft=p),!a&&g>=0&&(g!==e.scrollTop&&g!==this._scrollingContainer.scrollTop||v)&&(this._scrollingContainer.scrollTop=g));var _=(0===t.width||0===t.height)&&s>0&&d>0;if(this._recomputeScrollLeftFlag?(this._recomputeScrollLeftFlag=!1,this._updateScrollLeftForScrollToColumn(this.props)):y({cellSizeAndPositionManager:this._columnSizeAndPositionManager,previousCellsCount:t.columnCount,previousCellSize:t.columnWidth,previousScrollToAlignment:t.scrollToAlignment,previousScrollToIndex:t.scrollToColumn,previousSize:t.width,scrollOffset:p,scrollToAlignment:u,scrollToIndex:c,size:d,sizeJustIncreasedFromZero:_,updateScrollIndexCallback:function(){return r._updateScrollLeftForScrollToColumn(r.props)}}),this._recomputeScrollTopFlag?(this._recomputeScrollTopFlag=!1,this._updateScrollTopForScrollToRow(this.props)):y({cellSizeAndPositionManager:this._rowSizeAndPositionManager,previousCellsCount:t.rowCount,previousCellSize:t.rowHeight,previousScrollToAlignment:t.scrollToAlignment,previousScrollToIndex:t.scrollToRow,previousSize:t.height,scrollOffset:g,scrollToAlignment:u,scrollToIndex:h,size:s,sizeJustIncreasedFromZero:_,updateScrollIndexCallback:function(){return r._updateScrollTopForScrollToRow(r.props)}}),this._invokeOnGridRenderedHelper(),p!==e.scrollLeft||g!==e.scrollTop){var x=this._rowSizeAndPositionManager.getTotalSize(),b=this._columnSizeAndPositionManager.getTotalSize();this._invokeOnScrollMemoizer({scrollLeft:p,scrollTop:g,totalColumnsWidth:b,totalRowsHeight:x})}this._maybeCallOnScrollbarPresenceChange()}},{key:"componentWillMount",value:function(){var t=this.props.getScrollbarSize;this._scrollbarSize=t(),void 0===this._scrollbarSize?(this._scrollbarSizeMeasured=!1,this._scrollbarSize=0):this._scrollbarSizeMeasured=!0,this._calculateChildrenToRender()}},{key:"componentWillUnmount",value:function(){this._disablePointerEventsTimeoutId&&(0,b.w)(this._disablePointerEventsTimeoutId)}},{key:"componentWillReceiveProps",value:function(t){var e=this,r=this.state,n=r.scrollLeft,a=r.scrollTop;if(0===t.columnCount&&0!==n||0===t.rowCount&&0!==a)this.scrollToPosition({scrollLeft:0,scrollTop:0});else if(t.scrollLeft!==this.props.scrollLeft||t.scrollTop!==this.props.scrollTop){var i={};null!=t.scrollLeft&&(i.scrollLeft=t.scrollLeft),null!=t.scrollTop&&(i.scrollTop=t.scrollTop),this.scrollToPosition(i)}t.columnWidth===this.props.columnWidth&&t.rowHeight===this.props.rowHeight||(this._styleCache={}),this._columnWidthGetter=this._wrapSizeGetter(t.columnWidth),this._rowHeightGetter=this._wrapSizeGetter(t.rowHeight),this._columnSizeAndPositionManager.configure({cellCount:t.columnCount,estimatedCellSize:this._getEstimatedColumnSize(t)}),this._rowSizeAndPositionManager.configure({cellCount:t.rowCount,estimatedCellSize:this._getEstimatedRowSize(t)});var o=this.props,s=o.columnCount,l=o.rowCount;0!==s&&0!==l||(s=0,l=0),t.autoHeight&&!1===t.isScrolling&&!0===this.props.isScrolling&&this._resetStyleCache(),f({cellCount:s,cellSize:"number"==typeof this.props.columnWidth?this.props.columnWidth:null,computeMetadataCallback:function(){return e._columnSizeAndPositionManager.resetCell(0)},computeMetadataCallbackProps:t,nextCellsCount:t.columnCount,nextCellSize:"number"==typeof t.columnWidth?t.columnWidth:null,nextScrollToIndex:t.scrollToColumn,scrollToIndex:this.props.scrollToColumn,updateScrollOffsetForScrollToIndex:function(){return e._updateScrollLeftForScrollToColumn(t,e.state)}}),f({cellCount:l,cellSize:"number"==typeof this.props.rowHeight?this.props.rowHeight:null,computeMetadataCallback:function(){return e._rowSizeAndPositionManager.resetCell(0)},computeMetadataCallbackProps:t,nextCellsCount:t.rowCount,nextCellSize:"number"==typeof t.rowHeight?t.rowHeight:null,nextScrollToIndex:t.scrollToRow,scrollToIndex:this.props.scrollToRow,updateScrollOffsetForScrollToIndex:function(){return e._updateScrollTopForScrollToRow(t,e.state)}})}},{key:"componentWillUpdate",value:function(t,e){this._calculateChildrenToRender(t,e)}},{key:"render",value:function(){var t=this.props,e=t.autoContainerWidth,r=t.autoHeight,a=t.autoWidth,i=t.className,o=t.containerProps,s=t.containerRole,l=t.containerStyle,u=t.height,h=t.id,f=t.noContentRenderer,p=t.role,m=t.style,g=t.tabIndex,y=t.width,v=this._isScrolling(),_={boxSizing:"border-box",direction:"ltr",height:r?"auto":u,position:"relative",width:a?"auto":y,WebkitOverflowScrolling:"touch",willChange:"transform"},x=this._columnSizeAndPositionManager.getTotalSize(),b=this._rowSizeAndPositionManager.getTotalSize(),w=b>u?this._scrollbarSize:0,M=x>y?this._scrollbarSize:0;M===this._horizontalScrollBarSize&&w===this._verticalScrollBarSize||(this._horizontalScrollBarSize=M,this._verticalScrollBarSize=w,this._scrollbarPresenceChanged=!0),_.overflowX=x+w<=y?"hidden":"auto",_.overflowY=b+M<=u?"hidden":"auto";var k=this._childrenToDisplay,T=0===k.length&&u>0&&y>0;return c.createElement("div",(0,n.default)({ref:this._setScrollingContainerRef},o,{"aria-label":this.props["aria-label"],"aria-readonly":this.props["aria-readonly"],className:d()("ReactVirtualized__Grid",i),id:h,onScroll:this._onScroll,role:p,style:(0,n.default)({},_,m),tabIndex:g}),k.length>0&&c.createElement("div",{className:"ReactVirtualized__Grid__innerScrollContainer",role:s,style:(0,n.default)({width:e?"auto":x,height:b,maxWidth:x,maxHeight:b,overflow:"hidden",pointerEvents:v?"none":"",position:"relative"},l)},k),T&&f())}},{key:"_calculateChildrenToRender",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state,r=t.cellRenderer,n=t.cellRangeRenderer,a=t.columnCount,i=t.deferredMeasurementCache,o=t.height,s=t.overscanColumnCount,l=t.overscanIndicesGetter,u=t.overscanRowCount,c=t.rowCount,h=t.width,d=e.scrollDirectionHorizontal,f=e.scrollDirectionVertical,p=e.scrollLeft,m=e.scrollTop,g=this._isScrolling(t,e);if(this._childrenToDisplay=[],o>0&&h>0){var y=this._columnSizeAndPositionManager.getVisibleCellRange({containerSize:h,offset:p}),v=this._rowSizeAndPositionManager.getVisibleCellRange({containerSize:o,offset:m}),_=this._columnSizeAndPositionManager.getOffsetAdjustment({containerSize:h,offset:p}),x=this._rowSizeAndPositionManager.getOffsetAdjustment({containerSize:o,offset:m});this._renderedColumnStartIndex=y.start,this._renderedColumnStopIndex=y.stop,this._renderedRowStartIndex=v.start,this._renderedRowStopIndex=v.stop;var b=l({direction:"horizontal",cellCount:a,overscanCellsCount:s,scrollDirection:d,startIndex:"number"==typeof y.start?y.start:0,stopIndex:"number"==typeof y.stop?y.stop:-1}),w=l({direction:"vertical",cellCount:c,overscanCellsCount:u,scrollDirection:f,startIndex:"number"==typeof v.start?v.start:0,stopIndex:"number"==typeof v.stop?v.stop:-1});if(this._columnStartIndex=b.overscanStartIndex,this._columnStopIndex=b.overscanStopIndex,this._rowStartIndex=w.overscanStartIndex,this._rowStopIndex=w.overscanStopIndex,i){if(!i.hasFixedHeight())for(var M=this._rowStartIndex;M<=this._rowStopIndex;M++)if(!i.has(M,0)){this._columnStartIndex=0,this._columnStopIndex=a-1;break}if(!i.hasFixedWidth())for(var k=this._columnStartIndex;k<=this._columnStopIndex;k++)if(!i.has(0,k)){this._rowStartIndex=0,this._rowStopIndex=c-1;break}}this._childrenToDisplay=n({cellCache:this._cellCache,cellRenderer:r,columnSizeAndPositionManager:this._columnSizeAndPositionManager,columnStartIndex:this._columnStartIndex,columnStopIndex:this._columnStopIndex,deferredMeasurementCache:i,horizontalOffsetAdjustment:_,isScrolling:g,parent:this,rowSizeAndPositionManager:this._rowSizeAndPositionManager,rowStartIndex:this._rowStartIndex,rowStopIndex:this._rowStopIndex,scrollLeft:p,scrollTop:m,styleCache:this._styleCache,verticalOffsetAdjustment:x,visibleColumnIndices:y,visibleRowIndices:v})}}},{key:"_debounceScrollEnded",value:function(){var t=this.props.scrollingResetTimeInterval;this._disablePointerEventsTimeoutId&&(0,b.w)(this._disablePointerEventsTimeoutId),this._disablePointerEventsTimeoutId=(0,b.I)(this._debounceScrollEndedCallback,t)}},{key:"_getEstimatedColumnSize",value:function(t){return"number"==typeof t.columnWidth?t.columnWidth:t.estimatedColumnSize}},{key:"_getEstimatedRowSize",value:function(t){return"number"==typeof t.rowHeight?t.rowHeight:t.estimatedRowSize}},{key:"_handleInvalidatedGridSize",value:function(){if("number"==typeof this._deferredInvalidateColumnIndex&&"number"==typeof this._deferredInvalidateRowIndex){var t=this._deferredInvalidateColumnIndex,e=this._deferredInvalidateRowIndex;this._deferredInvalidateColumnIndex=null,this._deferredInvalidateRowIndex=null,this.recomputeGridSize({columnIndex:t,rowIndex:e})}}},{key:"_invokeOnScrollMemoizer",value:function(t){var e=this,r=t.scrollLeft,n=t.scrollTop,a=t.totalColumnsWidth,i=t.totalRowsHeight;this._onScrollMemoizer({callback:function(t){var r=t.scrollLeft,n=t.scrollTop,o=e.props,s=o.height;(0,o.onScroll)({clientHeight:s,clientWidth:o.width,scrollHeight:i,scrollLeft:r,scrollTop:n,scrollWidth:a})},indices:{scrollLeft:r,scrollTop:n}})}},{key:"_isScrolling",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state;return Object.hasOwnProperty.call(t,"isScrolling")?Boolean(t.isScrolling):Boolean(e.isScrolling)}},{key:"_maybeCallOnScrollbarPresenceChange",value:function(){if(this._scrollbarPresenceChanged){var t=this.props.onScrollbarPresenceChange;this._scrollbarPresenceChanged=!1,t({horizontal:this._horizontalScrollBarSize>0,size:this._scrollbarSize,vertical:this._verticalScrollBarSize>0})}}},{key:"scrollToPosition",value:function(t){var e=t.scrollLeft,r=t.scrollTop,n={scrollPositionChangeReason:M};"number"==typeof e&&e>=0&&(n.scrollDirectionHorizontal=e>this.state.scrollLeft?1:-1,n.scrollLeft=e),"number"==typeof r&&r>=0&&(n.scrollDirectionVertical=r>this.state.scrollTop?1:-1,n.scrollTop=r),("number"==typeof e&&e>=0&&e!==this.state.scrollLeft||"number"==typeof r&&r>=0&&r!==this.state.scrollTop)&&this.setState(n)}},{key:"_wrapSizeGetter",value:function(t){return"function"==typeof t?t:function(){return t}}},{key:"_getCalculatedScrollLeft",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state,r=t.columnCount,n=t.height,a=t.scrollToAlignment,i=t.scrollToColumn,o=t.width,s=e.scrollLeft;if(r>0){var l=r-1,u=i<0?l:Math.min(l,i),c=this._rowSizeAndPositionManager.getTotalSize(),h=c>n?this._scrollbarSize:0;return this._columnSizeAndPositionManager.getUpdatedOffsetForIndex({align:a,containerSize:o-h,currentOffset:s,targetIndex:u})}}},{key:"_updateScrollLeftForScrollToColumn",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state,r=e.scrollLeft,n=this._getCalculatedScrollLeft(t,e);"number"==typeof n&&n>=0&&r!==n&&this.scrollToPosition({scrollLeft:n,scrollTop:-1})}},{key:"_getCalculatedScrollTop",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state,r=t.height,n=t.rowCount,a=t.scrollToAlignment,i=t.scrollToRow,o=t.width,s=e.scrollTop;if(n>0){var l=n-1,u=i<0?l:Math.min(l,i),c=this._columnSizeAndPositionManager.getTotalSize(),h=c>o?this._scrollbarSize:0;return this._rowSizeAndPositionManager.getUpdatedOffsetForIndex({align:a,containerSize:r-h,currentOffset:s,targetIndex:u})}}},{key:"_resetStyleCache",value:function(){var t=this._styleCache;this._cellCache={},this._styleCache={};for(var e=this._rowStartIndex;e<=this._rowStopIndex;e++)for(var r=this._columnStartIndex;r<=this._columnStopIndex;r++){var n=e+"-"+r;this._styleCache[n]=t[n]}this.setState({isScrolling:!1})}},{key:"_updateScrollTopForScrollToRow",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state,r=e.scrollTop,n=this._getCalculatedScrollTop(t,e);"number"==typeof n&&n>=0&&r!==n&&this.scrollToPosition({scrollLeft:-1,scrollTop:n})}}]),e}(c.PureComponent);k.defaultProps={"aria-label":"grid","aria-readonly":!0,autoContainerWidth:!1,autoHeight:!1,autoWidth:!1,cellRangeRenderer:v,containerRole:"rowgroup",containerStyle:{},estimatedColumnSize:100,estimatedRowSize:30,getScrollbarSize:x(),noContentRenderer:function(){return null},onScroll:function(){},onScrollbarPresenceChange:function(){},onSectionRendered:function(){},overscanColumnCount:0,overscanIndicesGetter:g,overscanRowCount:10,role:"grid",scrollingResetTimeInterval:150,scrollToAlignment:"auto",scrollToColumn:-1,scrollToRow:-1,style:{},tabIndex:0},k.propTypes=null;const T=k;function L(t){var e=t.cellCount,r=t.overscanCellsCount,n=t.scrollDirection,a=t.startIndex,i=t.stopIndex;return r=Math.max(1,r),1===n?{overscanStartIndex:Math.max(0,a-1),overscanStopIndex:Math.min(e-1,i+r)}:{overscanStartIndex:Math.max(0,a-r),overscanStopIndex:Math.min(e-1,i+1)}}r(54634).w0||r(45697).any,r(54634).Wo||r(45697).any},54634:(t,e,r)=>{r(67294),r(54440)},54440:(t,e,r)=>{r.d(e,{Z:()=>s});var n=r(42723),a=r(99663),i=r(22600);r(54634).vZ||r(45697).any,r(54634).Hc||r(45697).any,r(54634).M7||r(45697).any;const o=function(){function t(e){var r=e.cellCount,n=e.cellSizeGetter,i=e.estimatedCellSize;(0,a.default)(this,t),this._cellSizeAndPositionData={},this._lastMeasuredIndex=-1,this._lastBatchedIndex=-1,this._cellSizeGetter=n,this._cellCount=r,this._estimatedCellSize=i}return(0,i.Z)(t,[{key:"areOffsetsAdjusted",value:function(){return!1}},{key:"configure",value:function(t){var e=t.cellCount,r=t.estimatedCellSize;this._cellCount=e,this._estimatedCellSize=r}},{key:"getCellCount",value:function(){return this._cellCount}},{key:"getEstimatedCellSize",value:function(){return this._estimatedCellSize}},{key:"getLastMeasuredIndex",value:function(){return this._lastMeasuredIndex}},{key:"getOffsetAdjustment",value:function(){return 0}},{key:"getSizeAndPositionOfCell",value:function(t){if(t<0||t>=this._cellCount)throw Error("Requested index "+t+" is outside of range 0.."+this._cellCount);if(t>this._lastMeasuredIndex)for(var e=this.getSizeAndPositionOfLastMeasuredCell(),r=e.offset+e.size,n=this._lastMeasuredIndex+1;n<=t;n++){var a=this._cellSizeGetter({index:n});if(void 0===a||isNaN(a))throw Error("Invalid size returned for cell "+n+" of value "+a);null===a?(this._cellSizeAndPositionData[n]={offset:r,size:0},this._lastBatchedIndex=t):(this._cellSizeAndPositionData[n]={offset:r,size:a},r+=a,this._lastMeasuredIndex=t)}return this._cellSizeAndPositionData[t]}},{key:"getSizeAndPositionOfLastMeasuredCell",value:function(){return this._lastMeasuredIndex>=0?this._cellSizeAndPositionData[this._lastMeasuredIndex]:{offset:0,size:0}}},{key:"getTotalSize",value:function(){var t=this.getSizeAndPositionOfLastMeasuredCell();return t.offset+t.size+(this._cellCount-this._lastMeasuredIndex-1)*this._estimatedCellSize}},{key:"getUpdatedOffsetForIndex",value:function(t){var e=t.align,r=void 0===e?"auto":e,n=t.containerSize,a=t.currentOffset,i=t.targetIndex;if(n<=0)return 0;var o=this.getSizeAndPositionOfCell(i),s=o.offset,l=s-n+o.size,u=void 0;switch(r){case"start":u=s;break;case"end":u=l;break;case"center":u=s-(n-o.size)/2;break;default:u=Math.max(l,Math.min(s,a))}var c=this.getTotalSize();return Math.max(0,Math.min(c-n,u))}},{key:"getVisibleCellRange",value:function(t){var e=t.containerSize,r=t.offset;if(0===this.getTotalSize())return{};var n=r+e,a=this._findNearestCell(r),i=this.getSizeAndPositionOfCell(a);r=i.offset+i.size;for(var o=a;r<n&&o<this._cellCount-1;)o++,r+=this.getSizeAndPositionOfCell(o).size;return{start:a,stop:o}}},{key:"resetCell",value:function(t){this._lastMeasuredIndex=Math.min(this._lastMeasuredIndex,t-1)}},{key:"_binarySearch",value:function(t,e,r){for(;e<=t;){var n=e+Math.floor((t-e)/2),a=this.getSizeAndPositionOfCell(n).offset;if(a===r)return n;a<r?e=n+1:a>r&&(t=n-1)}return e>0?e-1:0}},{key:"_exponentialSearch",value:function(t,e){for(var r=1;t<this._cellCount&&this.getSizeAndPositionOfCell(t).offset<e;)t+=r,r*=2;return this._binarySearch(Math.min(t,this._cellCount-1),Math.floor(t/2),e)}},{key:"_findNearestCell",value:function(t){if(isNaN(t))throw Error("Invalid offset "+t+" specified");t=Math.max(0,t);var e=this.getSizeAndPositionOfLastMeasuredCell(),r=Math.max(0,this._lastMeasuredIndex);return e.offset>=t?this._binarySearch(r,0,t):this._exponentialSearch(r,t)}}]),t}();r(54634).vZ||r(45697).any,r(54634).Hc||r(45697).any,r(54634).M7||r(45697).any;const s=function(){function t(e){var r=e.maxScrollSize,i=void 0===r?"undefined"!=typeof window&&window.chrome&&window.chrome.webstore?16777100:15e5:r,s=(0,n.default)(e,["maxScrollSize"]);(0,a.default)(this,t),this._cellSizeAndPositionManager=new o(s),this._maxScrollSize=i}return(0,i.Z)(t,[{key:"areOffsetsAdjusted",value:function(){return this._cellSizeAndPositionManager.getTotalSize()>this._maxScrollSize}},{key:"configure",value:function(t){this._cellSizeAndPositionManager.configure(t)}},{key:"getCellCount",value:function(){return this._cellSizeAndPositionManager.getCellCount()}},{key:"getEstimatedCellSize",value:function(){return this._cellSizeAndPositionManager.getEstimatedCellSize()}},{key:"getLastMeasuredIndex",value:function(){return this._cellSizeAndPositionManager.getLastMeasuredIndex()}},{key:"getOffsetAdjustment",value:function(t){var e=t.containerSize,r=t.offset,n=this._cellSizeAndPositionManager.getTotalSize(),a=this.getTotalSize(),i=this._getOffsetPercentage({containerSize:e,offset:r,totalSize:a});return Math.round(i*(a-n))}},{key:"getSizeAndPositionOfCell",value:function(t){return this._cellSizeAndPositionManager.getSizeAndPositionOfCell(t)}},{key:"getSizeAndPositionOfLastMeasuredCell",value:function(){return this._cellSizeAndPositionManager.getSizeAndPositionOfLastMeasuredCell()}},{key:"getTotalSize",value:function(){return Math.min(this._maxScrollSize,this._cellSizeAndPositionManager.getTotalSize())}},{key:"getUpdatedOffsetForIndex",value:function(t){var e=t.align,r=void 0===e?"auto":e,n=t.containerSize,a=t.currentOffset,i=t.targetIndex;a=this._safeOffsetToOffset({containerSize:n,offset:a});var o=this._cellSizeAndPositionManager.getUpdatedOffsetForIndex({align:r,containerSize:n,currentOffset:a,targetIndex:i});return this._offsetToSafeOffset({containerSize:n,offset:o})}},{key:"getVisibleCellRange",value:function(t){var e=t.containerSize,r=t.offset;return r=this._safeOffsetToOffset({containerSize:e,offset:r}),this._cellSizeAndPositionManager.getVisibleCellRange({containerSize:e,offset:r})}},{key:"resetCell",value:function(t){this._cellSizeAndPositionManager.resetCell(t)}},{key:"_getOffsetPercentage",value:function(t){var e=t.containerSize,r=t.offset,n=t.totalSize;return n<=e?0:r/(n-e)}},{key:"_offsetToSafeOffset",value:function(t){var e=t.containerSize,r=t.offset,n=this._cellSizeAndPositionManager.getTotalSize(),a=this.getTotalSize();if(n===a)return r;var i=this._getOffsetPercentage({containerSize:e,offset:r,totalSize:n});return Math.round(i*(a-e))}},{key:"_safeOffsetToOffset",value:function(t){var e=t.containerSize,r=t.offset,n=this._cellSizeAndPositionManager.getTotalSize(),a=this.getTotalSize();if(n===a)return r;var i=this._getOffsetPercentage({containerSize:e,offset:r,totalSize:a});return Math.round(i*(n-e))}}]),t}()},47606:(t,e,r)=>{r(67294)},56728:(t,e,r)=>{r.d(e,{Z:()=>O});var n=r(88239),a=r(85105),i=r.n(a),o=r(99663),s=r(22600),l=r(49135),u=r(93196),c=r(67294),h=r(94184),d=r.n(h),f=r(12424);const p=function(t,e,r,n,a){return"function"==typeof r?function(t,e,r,n,a){for(var i=r+1;e<=r;){var o=e+r>>>1;a(t[o],n)>=0?(i=o,r=o-1):e=o+1}return i}(t,void 0===n?0:0|n,void 0===a?t.length-1:0|a,e,r):function(t,e,r,n){for(var a=r+1;e<=r;){var i=e+r>>>1;t[i]>=n?(a=i,r=i-1):e=i+1}return a}(t,void 0===r?0:0|r,void 0===n?t.length-1:0|n,e)};function m(t,e,r,n,a){this.mid=t,this.left=e,this.right=r,this.leftPoints=n,this.rightPoints=a,this.count=(e?e.count:0)+(r?r.count:0)+n.length}var g=m.prototype;function y(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 v(t,e){var r=A(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 _(t,e){var r=t.intervals([]);r.push(e),v(t,r)}function x(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?0:(r.splice(n,1),v(t,r),1)}function b(t,e,r){for(var n=0;n<t.length&&t[n][0]<=e;++n){var a=r(t[n]);if(a)return a}}function w(t,e,r){for(var n=t.length-1;n>=0&&t[n][1]>=e;--n){var a=r(t[n]);if(a)return a}}function M(t,e){for(var r=0;r<t.length;++r){var n=e(t[r]);if(n)return n}}function k(t,e){return t-e}function T(t,e){return t[0]-e[0]||t[1]-e[1]}function L(t,e){return t[1]-e[1]||t[0]-e[0]}function A(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(k);var n=e[e.length>>1],a=[],i=[],o=[];for(r=0;r<t.length;++r){var s=t[r];s[1]<n?a.push(s):n<s[0]?i.push(s):o.push(s)}var l=o,u=o.slice();return l.sort(T),u.sort(L),new m(n,A(a),A(i),l,u)}function S(t){this.root=t}g.intervals=function(t){return t.push.apply(t,this.leftPoints),this.left&&this.left.intervals(t),this.right&&this.right.intervals(t),t},g.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)?_(this,t):this.left.insert(t):this.left=A([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?_(this,t):this.right.insert(t):this.right=A([t]);else{var r=p(this.leftPoints,t,T),n=p(this.rightPoints,t,L);this.leftPoints.splice(r,0,t),this.rightPoints.splice(n,0,t)}},g.remove=function(t){var e=this.count-this.leftPoints;if(t[1]<this.mid)return this.left?4*(this.right?this.right.count:0)>3*(e-1)?x(this,t):2===(i=this.left.remove(t))?(this.left=null,this.count-=1,1):(1===i&&(this.count-=1),i):0;if(t[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(e-1)?x(this,t):2===(i=this.right.remove(t))?(this.right=null,this.count-=1,1):(1===i&&(this.count-=1),i):0;if(1===this.count)return this.leftPoints[0]===t?2:0;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var r=this,n=this.left;n.right;)r=n,n=n.right;if(r===this)n.right=this.right;else{var a=this.left,i=this.right;r.count-=n.count,r.right=n.left,n.left=a,n.right=i}y(this,n),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?y(this,this.left):y(this,this.right);return 1}for(a=p(this.leftPoints,t,T);a<this.leftPoints.length&&this.leftPoints[a][0]===t[0];++a)if(this.leftPoints[a]===t)for(this.count-=1,this.leftPoints.splice(a,1),i=p(this.rightPoints,t,L);i<this.rightPoints.length&&this.rightPoints[i][1]===t[1];++i)if(this.rightPoints[i]===t)return this.rightPoints.splice(i,1),1;return 0},g.queryPoint=function(t,e){return t<this.mid?this.left&&(r=this.left.queryPoint(t,e))?r:b(this.leftPoints,t,e):t>this.mid?this.right&&(r=this.right.queryPoint(t,e))?r:w(this.rightPoints,t,e):M(this.leftPoints,e);var r},g.queryInterval=function(t,e,r){var n;return t<this.mid&&this.left&&(n=this.left.queryInterval(t,e,r))||e>this.mid&&this.right&&(n=this.right.queryInterval(t,e,r))?n:e<this.mid?b(this.leftPoints,e,r):t>this.mid?w(this.rightPoints,t,r):M(this.leftPoints,r)};var E=S.prototype;E.insert=function(t){this.root?this.root.insert(t):this.root=new m(t[0],null,null,[t],[t])},E.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),0!==e}return!1},E.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},E.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(E,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(E,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}});const C=function(){function t(){(0,o.default)(this,t),this._columnSizeMap={},this._intervalTree=new S(null),this._leftMap={}}return(0,s.Z)(t,[{key:"estimateTotalHeight",value:function(t,e,r){var n=t-this.count;return this.tallestColumnSize+Math.ceil(n/e)*r}},{key:"range",value:function(t,e,r){var n=this;this._intervalTree.queryInterval(t,t+e,(function(t){var e=(0,f.default)(t,3),a=e[0],i=(e[1],e[2]);return r(i,n._leftMap[i],a)}))}},{key:"setPosition",value:function(t,e,r,n){this._intervalTree.insert([r,r+n,t]),this._leftMap[t]=e;var a=this._columnSizeMap,i=a[e];a[e]=void 0===i?r+n:Math.max(i,r+n)}},{key:"count",get:function(){return this._intervalTree.count}},{key:"shortestColumnSize",get:function(){var t=this._columnSizeMap,e=0;for(var r in t){var n=t[r];e=0===e?n:Math.min(e,n)}return e}},{key:"tallestColumnSize",get:function(){var t=this._columnSizeMap,e=0;for(var r in t){var n=t[r];e=Math.max(e,n)}return e}}]),t}();var D=r(7085),P=(r(7085).babelPluginFlowReactPropTypes_proptype_AnimationTimeoutId||r(45697).any,function(t){function e(t,r){(0,o.default)(this,e);var n=(0,l.default)(this,(e.__proto__||i()(e)).call(this,t,r));return n._invalidateOnUpdateStartIndex=null,n._invalidateOnUpdateStopIndex=null,n._positionCache=new C,n._startIndex=null,n._startIndexMemoized=null,n._stopIndex=null,n._stopIndexMemoized=null,n.state={isScrolling:!1,scrollTop:0},n._debounceResetIsScrollingCallback=n._debounceResetIsScrollingCallback.bind(n),n._setScrollingContainerRef=n._setScrollingContainerRef.bind(n),n._onScroll=n._onScroll.bind(n),n}return(0,u.default)(e,t),(0,s.Z)(e,[{key:"clearCellPositions",value:function(){this._positionCache=new C,this.forceUpdate()}},{key:"invalidateCellSizeAfterRender",value:function(t){var e=t.rowIndex;null===this._invalidateOnUpdateStartIndex?(this._invalidateOnUpdateStartIndex=e,this._invalidateOnUpdateStopIndex=e):(this._invalidateOnUpdateStartIndex=Math.min(this._invalidateOnUpdateStartIndex,e),this._invalidateOnUpdateStopIndex=Math.max(this._invalidateOnUpdateStopIndex,e))}},{key:"recomputeCellPositions",value:function(){var t=this._positionCache.count-1;this._positionCache=new C,this._populatePositionCache(0,t),this.forceUpdate()}},{key:"componentDidMount",value:function(){this._checkInvalidateOnUpdate(),this._invokeOnScrollCallback(),this._invokeOnCellsRenderedCallback()}},{key:"componentDidUpdate",value:function(){this._checkInvalidateOnUpdate(),this._invokeOnScrollCallback(),this._invokeOnCellsRenderedCallback()}},{key:"componentWillUnmount",value:function(){this._debounceResetIsScrollingId&&(0,D.w)(this._debounceResetIsScrollingId)}},{key:"componentWillReceiveProps",value:function(t){this.props.scrollTop!==t.scrollTop&&(this._debounceResetIsScrolling(),this.setState({isScrolling:!0,scrollTop:t.scrollTop}))}},{key:"render",value:function(){var t=this,e=this.props,r=e.autoHeight,a=e.cellCount,i=e.cellMeasurerCache,o=e.cellRenderer,s=e.className,l=e.height,u=e.id,h=e.keyMapper,f=e.overscanByPixels,p=e.role,m=e.style,g=e.tabIndex,y=e.width,v=this.state,_=v.isScrolling,x=v.scrollTop,b=[],w=this._getEstimatedTotalHeight(),M=this._positionCache.shortestColumnSize,k=this._positionCache.count,T=0,L=void 0;if(this._positionCache.range(Math.max(0,x-f),l+2*f,(function(e,r,n){void 0===L?(T=e,L=e):(T=Math.min(T,e),L=Math.max(L,e)),b.push(o({index:e,isScrolling:_,key:h(e),parent:t,style:{height:i.getHeight(e),left:r,position:"absolute",top:n,width:i.getWidth(e)}}))})),M<x+l+f&&k<a)for(var A=Math.min(a-k,Math.ceil((x+l+f-M)/i.defaultHeight*y/i.defaultWidth)),S=k;S<k+A;S++)L=S,b.push(o({index:S,isScrolling:_,key:h(S),parent:this,style:{width:i.getWidth(S)}}));return this._startIndex=T,this._stopIndex=L,c.createElement("div",{ref:this._setScrollingContainerRef,"aria-label":this.props["aria-label"],className:d()("ReactVirtualized__Masonry",s),id:u,onScroll:this._onScroll,role:p,style:(0,n.default)({boxSizing:"border-box",direction:"ltr",height:r?"auto":l,overflowX:"hidden",overflowY:w<l?"hidden":"auto",position:"relative",width:y,WebkitOverflowScrolling:"touch",willChange:"transform"},m),tabIndex:g},c.createElement("div",{className:"ReactVirtualized__Masonry__innerScrollContainer",style:{width:"100%",height:w,maxWidth:"100%",maxHeight:w,overflow:"hidden",pointerEvents:_?"none":"",position:"relative"}},b))}},{key:"_checkInvalidateOnUpdate",value:function(){if("number"==typeof this._invalidateOnUpdateStartIndex){var t=this._invalidateOnUpdateStartIndex,e=this._invalidateOnUpdateStopIndex;this._invalidateOnUpdateStartIndex=null,this._invalidateOnUpdateStopIndex=null,this._populatePositionCache(t,e),this.forceUpdate()}}},{key:"_debounceResetIsScrolling",value:function(){var t=this.props.scrollingResetTimeInterval;this._debounceResetIsScrollingId&&(0,D.w)(this._debounceResetIsScrollingId),this._debounceResetIsScrollingId=(0,D.I)(this._debounceResetIsScrollingCallback,t)}},{key:"_debounceResetIsScrollingCallback",value:function(){this.setState({isScrolling:!1})}},{key:"_getEstimatedTotalHeight",value:function(){var t=this.props,e=t.cellCount,r=t.cellMeasurerCache,n=t.width,a=Math.max(1,Math.floor(n/r.defaultWidth));return this._positionCache.estimateTotalHeight(e,a,r.defaultHeight)}},{key:"_invokeOnScrollCallback",value:function(){var t=this.props,e=t.height,r=t.onScroll,n=this.state.scrollTop;this._onScrollMemoized!==n&&(r({clientHeight:e,scrollHeight:this._getEstimatedTotalHeight(),scrollTop:n}),this._onScrollMemoized=n)}},{key:"_invokeOnCellsRenderedCallback",value:function(){this._startIndexMemoized===this._startIndex&&this._stopIndexMemoized===this._stopIndex||((0,this.props.onCellsRendered)({startIndex:this._startIndex,stopIndex:this._stopIndex}),this._startIndexMemoized=this._startIndex,this._stopIndexMemoized=this._stopIndex)}},{key:"_populatePositionCache",value:function(t,e){for(var r=this.props,n=r.cellMeasurerCache,a=r.cellPositioner,i=t;i<=e;i++){var o=a(i),s=o.left,l=o.top;this._positionCache.setPosition(i,s,l,n.getHeight(i))}}},{key:"_setScrollingContainerRef",value:function(t){this._scrollingContainer=t}},{key:"_onScroll",value:function(t){var e=this.props.height,r=t.target.scrollTop,n=Math.min(Math.max(0,this._getEstimatedTotalHeight()-e),r);r===n&&(this._debounceResetIsScrolling(),this.state.scrollTop!==n&&this.setState({isScrolling:!0,scrollTop:n}))}}]),e}(c.PureComponent));P.defaultProps={autoHeight:!1,keyMapper:function(t){return t},onCellsRendered:z,onScroll:z,overscanByPixels:20,role:"grid",scrollingResetTimeInterval:150,style:{},tabIndex:0},P.propTypes=null;const O=P;function z(){}},34584:()=>{},70158:(t,e,r)=>{r.r(e),r.d(e,{ArrowKeyStepper:()=>h,AutoSizer:()=>m,CellMeasurer:()=>x,CellMeasurerCache:()=>y,Collection:()=>R,Column:()=>lt,ColumnSizer:()=>N,Grid:()=>Y.rj,InfiniteLoader:()=>B,List:()=>W,Masonry:()=>q.Z,MultiGrid:()=>J,ScrollSync:()=>$,SortDirection:()=>nt,SortIndicator:()=>at,Table:()=>ct,WindowScroller:()=>At,accessibilityOverscanIndicesGetter:()=>Y.QY,createMasonryCellPositioner:()=>G,createTableMultiSort:()=>Q,defaultCellRangeRenderer:()=>Y.Fv,defaultOverscanIndicesGetter:()=>Y.X7,defaultTableCellDataGetter:()=>tt,defaultTableCellRenderer:()=>et,defaultTableHeaderRenderer:()=>it,defaultTableHeaderRowRenderer:()=>rt,defaultTableRowRenderer:()=>ot});var n=r(85105),a=r.n(n),i=r(99663),o=r(22600),s=r(49135),l=r(93196),u=r(67294),c=(r(35501).babelPluginFlowReactPropTypes_proptype_RenderedSection||r(45697).any,r(14530).babelPluginFlowReactPropTypes_proptype_ScrollIndices||r(45697).any,function(t){function e(t){(0,i.default)(this,e);var r=(0,s.default)(this,(e.__proto__||a()(e)).call(this,t));return r._columnStartIndex=0,r._columnStopIndex=0,r._rowStartIndex=0,r._rowStopIndex=0,r._onKeyDown=function(t){var e=r.props,n=e.columnCount,a=e.disabled,i=e.mode,o=e.rowCount;if(!a){var s=r._getScrollState(),l=s.scrollToColumn,u=s.scrollToRow,c=r._getScrollState(),h=c.scrollToColumn,d=c.scrollToRow;switch(t.key){case"ArrowDown":d="cells"===i?Math.min(d+1,o-1):Math.min(r._rowStopIndex+1,o-1);break;case"ArrowLeft":h="cells"===i?Math.max(h-1,0):Math.max(r._columnStartIndex-1,0);break;case"ArrowRight":h="cells"===i?Math.min(h+1,n-1):Math.min(r._columnStopIndex+1,n-1);break;case"ArrowUp":d="cells"===i?Math.max(d-1,0):Math.max(r._rowStartIndex-1,0)}h===l&&d===u||(t.preventDefault(),r._updateScrollState({scrollToColumn:h,scrollToRow:d}))}},r._onSectionRendered=function(t){var e=t.columnStartIndex,n=t.columnStopIndex,a=t.rowStartIndex,i=t.rowStopIndex;r._columnStartIndex=e,r._columnStopIndex=n,r._rowStartIndex=a,r._rowStopIndex=i},r.state={scrollToColumn:t.scrollToColumn,scrollToRow:t.scrollToRow},r}return(0,l.default)(e,t),(0,o.Z)(e,[{key:"componentWillReceiveProps",value:function(t){if(!this.props.isControlled){var e=t.scrollToColumn,r=t.scrollToRow,n=this.props,a=n.scrollToColumn,i=n.scrollToRow;a!==e&&i!==r?this.setState({scrollToColumn:e,scrollToRow:r}):a!==e?this.setState({scrollToColumn:e}):i!==r&&this.setState({scrollToRow:r})}}},{key:"setScrollIndexes",value:function(t){var e=t.scrollToColumn,r=t.scrollToRow;this.setState({scrollToRow:r,scrollToColumn:e})}},{key:"render",value:function(){var t=this.props,e=t.className,r=t.children,n=this._getScrollState(),a=n.scrollToColumn,i=n.scrollToRow;return u.createElement("div",{className:e,onKeyDown:this._onKeyDown},r({onSectionRendered:this._onSectionRendered,scrollToColumn:a,scrollToRow:i}))}},{key:"_getScrollState",value:function(){return this.props.isControlled?this.props:this.state}},{key:"_updateScrollState",value:function(t){var e=t.scrollToColumn,r=t.scrollToRow,n=this.props,a=n.isControlled,i=n.onScrollToChange;"function"==typeof i&&i({scrollToColumn:e,scrollToRow:r}),a||this.setState({scrollToColumn:e,scrollToRow:r})}}]),e}(u.PureComponent));c.defaultProps={disabled:!1,isControlled:!1,mode:"edges",scrollToColumn:0,scrollToRow:0},c.propTypes=null;const h=c;var d=r(88239);function f(t){var e;e="undefined"!=typeof window?window:"undefined"!=typeof self?self:r.g;var n,a,i="undefined"!=typeof document&&document.attachEvent;if(!i){var o=(a=e.requestAnimationFrame||e.mozRequestAnimationFrame||e.webkitRequestAnimationFrame||function(t){return e.setTimeout(t,20)},function(t){return a(t)}),s=(n=e.cancelAnimationFrame||e.mozCancelAnimationFrame||e.webkitCancelAnimationFrame||e.clearTimeout,function(t){return n(t)}),l=function(t){var e=t.__resizeTriggers__,r=e.firstElementChild,n=e.lastElementChild,a=r.firstElementChild;n.scrollLeft=n.scrollWidth,n.scrollTop=n.scrollHeight,a.style.width=r.offsetWidth+1+"px",a.style.height=r.offsetHeight+1+"px",r.scrollLeft=r.scrollWidth,r.scrollTop=r.scrollHeight},u=function(t){if(!(t.target.className.indexOf("contract-trigger")<0&&t.target.className.indexOf("expand-trigger")<0)){var e=this;l(this),this.__resizeRAF__&&s(this.__resizeRAF__),this.__resizeRAF__=o((function(){(function(t){return t.offsetWidth!=t.__resizeLast__.width||t.offsetHeight!=t.__resizeLast__.height})(e)&&(e.__resizeLast__.width=e.offsetWidth,e.__resizeLast__.height=e.offsetHeight,e.__resizeListeners__.forEach((function(r){r.call(e,t)})))}))}},c=!1,h="",d="animationstart",f="Webkit Moz O ms".split(" "),p="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),m=document.createElement("fakeelement");if(void 0!==m.style.animationName&&(c=!0),!1===c)for(var g=0;g<f.length;g++)if(void 0!==m.style[f[g]+"AnimationName"]){h="-"+f[g].toLowerCase()+"-",d=p[g],c=!0;break}var y="resizeanim",v="@"+h+"keyframes "+y+" { from { opacity: 0; } to { opacity: 0; } } ",_=h+"animation: 1ms "+y+"; "}return{addResizeListener:function(r,n){if(i)r.attachEvent("onresize",n);else{if(!r.__resizeTriggers__){var a=r.ownerDocument,o=e.getComputedStyle(r);o&&"static"==o.position&&(r.style.position="relative"),function(e){if(!e.getElementById("detectElementResize")){var r=(v||"")+".resize-triggers { "+(_||"")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',n=e.head||e.getElementsByTagName("head")[0],a=e.createElement("style");a.id="detectElementResize",a.type="text/css",null!=t&&a.setAttribute("nonce",t),a.styleSheet?a.styleSheet.cssText=r:a.appendChild(e.createTextNode(r)),n.appendChild(a)}}(a),r.__resizeLast__={},r.__resizeListeners__=[],(r.__resizeTriggers__=a.createElement("div")).className="resize-triggers",r.__resizeTriggers__.innerHTML='<div class="expand-trigger"><div></div></div><div class="contract-trigger"></div>',r.appendChild(r.__resizeTriggers__),l(r),r.addEventListener("scroll",u,!0),d&&(r.__resizeTriggers__.__animationListener__=function(t){t.animationName==y&&l(r)},r.__resizeTriggers__.addEventListener(d,r.__resizeTriggers__.__animationListener__))}r.__resizeListeners__.push(n)}},removeResizeListener:function(t,e){if(i)t.detachEvent("onresize",e);else if(t.__resizeListeners__.splice(t.__resizeListeners__.indexOf(e),1),!t.__resizeListeners__.length){t.removeEventListener("scroll",u,!0),t.__resizeTriggers__.__animationListener__&&(t.__resizeTriggers__.removeEventListener(d,t.__resizeTriggers__.__animationListener__),t.__resizeTriggers__.__animationListener__=null);try{t.__resizeTriggers__=!t.removeChild(t.__resizeTriggers__)}catch(t){}}}}}var p=function(t){function e(){var t,r,n,o;(0,i.default)(this,e);for(var l=arguments.length,u=Array(l),c=0;c<l;c++)u[c]=arguments[c];return r=n=(0,s.default)(this,(t=e.__proto__||a()(e)).call.apply(t,[this].concat(u))),n.state={height:n.props.defaultHeight||0,width:n.props.defaultWidth||0},n._onResize=function(){var t=n.props,e=t.disableHeight,r=t.disableWidth,a=t.onResize;if(n._parentNode){var i=n._parentNode.offsetHeight||0,o=n._parentNode.offsetWidth||0,s=window.getComputedStyle(n._parentNode)||{},l=parseInt(s.paddingLeft,10)||0,u=parseInt(s.paddingRight,10)||0,c=parseInt(s.paddingTop,10)||0,h=parseInt(s.paddingBottom,10)||0,d=i-c-h,f=o-l-u;(!e&&n.state.height!==d||!r&&n.state.width!==f)&&(n.setState({height:i-c-h,width:o-l-u}),a({height:i,width:o}))}},n._setRef=function(t){n._autoSizer=t},o=r,(0,s.default)(n,o)}return(0,l.default)(e,t),(0,o.Z)(e,[{key:"componentDidMount",value:function(){var t=this.props.nonce;this._autoSizer&&this._autoSizer.parentNode&&this._autoSizer.parentNode.ownerDocument&&this._autoSizer.parentNode.ownerDocument.defaultView&&this._autoSizer.parentNode instanceof this._autoSizer.parentNode.ownerDocument.defaultView.HTMLElement&&(this._parentNode=this._autoSizer.parentNode,this._detectElementResize=f(t),this._detectElementResize.addResizeListener(this._parentNode,this._onResize),this._onResize())}},{key:"componentWillUnmount",value:function(){this._detectElementResize&&this._parentNode&&this._detectElementResize.removeResizeListener(this._parentNode,this._onResize)}},{key:"render",value:function(){var t=this.props,e=t.children,r=t.className,n=t.disableHeight,a=t.disableWidth,i=t.style,o=this.state,s=o.height,l=o.width,c={overflow:"visible"},h={};return n||(c.height=0,h.height=s),a||(c.width=0,h.width=l),u.createElement("div",{className:r,ref:this._setRef,style:(0,d.default)({},c,i)},e(h))}}]),e}(u.PureComponent);p.defaultProps={onResize:function(){},disableHeight:!1,disableWidth:!1,style:{}},p.propTypes=null;const m=p;var g=r(73935);const y=function(){function t(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,i.default)(this,t),this._cellHeightCache={},this._cellWidthCache={},this._columnWidthCache={},this._rowHeightCache={},this._columnCount=0,this._rowCount=0,this.columnWidth=function(t){var r=t.index,n=e._keyMapper(0,r);return e._columnWidthCache.hasOwnProperty(n)?e._columnWidthCache[n]:e._defaultWidth},this.rowHeight=function(t){var r=t.index,n=e._keyMapper(r,0);return e._rowHeightCache.hasOwnProperty(n)?e._rowHeightCache[n]:e._defaultHeight};var n=r.defaultHeight,a=r.defaultWidth,o=r.fixedHeight,s=r.fixedWidth,l=r.keyMapper,u=r.minHeight,c=r.minWidth;this._hasFixedHeight=!0===o,this._hasFixedWidth=!0===s,this._minHeight=u||0,this._minWidth=c||0,this._keyMapper=l||v,this._defaultHeight=Math.max(this._minHeight,"number"==typeof n?n:30),this._defaultWidth=Math.max(this._minWidth,"number"==typeof a?a:100)}return(0,o.Z)(t,[{key:"clear",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this._keyMapper(t,e);delete this._cellHeightCache[r],delete this._cellWidthCache[r],this._updateCachedColumnAndRowSizes(t,e)}},{key:"clearAll",value:function(){this._cellHeightCache={},this._cellWidthCache={},this._columnWidthCache={},this._rowHeightCache={},this._rowCount=0,this._columnCount=0}},{key:"hasFixedHeight",value:function(){return this._hasFixedHeight}},{key:"hasFixedWidth",value:function(){return this._hasFixedWidth}},{key:"getHeight",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(this._hasFixedHeight)return this._defaultHeight;var r=this._keyMapper(t,e);return this._cellHeightCache.hasOwnProperty(r)?Math.max(this._minHeight,this._cellHeightCache[r]):this._defaultHeight}},{key:"getWidth",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(this._hasFixedWidth)return this._defaultWidth;var r=this._keyMapper(t,e);return this._cellWidthCache.hasOwnProperty(r)?Math.max(this._minWidth,this._cellWidthCache[r]):this._defaultWidth}},{key:"has",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this._keyMapper(t,e);return this._cellHeightCache.hasOwnProperty(r)}},{key:"set",value:function(t,e,r,n){var a=this._keyMapper(t,e);e>=this._columnCount&&(this._columnCount=e+1),t>=this._rowCount&&(this._rowCount=t+1),this._cellHeightCache[a]=n,this._cellWidthCache[a]=r,this._updateCachedColumnAndRowSizes(t,e)}},{key:"_updateCachedColumnAndRowSizes",value:function(t,e){if(!this._hasFixedWidth){for(var r=0,n=0;n<this._rowCount;n++)r=Math.max(r,this.getWidth(n,e));var a=this._keyMapper(0,e);this._columnWidthCache[a]=r}if(!this._hasFixedHeight){for(var i=0,o=0;o<this._columnCount;o++)i=Math.max(i,this.getHeight(t,o));var s=this._keyMapper(t,0);this._rowHeightCache[s]=i}}},{key:"defaultHeight",get:function(){return this._defaultHeight}},{key:"defaultWidth",get:function(){return this._defaultWidth}}]),t}();function v(t,e){return t+"-"+e}var _=function(t){function e(){var t,r,n,o;(0,i.default)(this,e);for(var l=arguments.length,u=Array(l),c=0;c<l;c++)u[c]=arguments[c];return r=n=(0,s.default)(this,(t=e.__proto__||a()(e)).call.apply(t,[this].concat(u))),n._measure=function(){var t=n.props,e=t.cache,r=t.columnIndex,a=void 0===r?0:r,i=t.parent,o=t.rowIndex,s=void 0===o?n.props.index||0:o,l=n._getCellMeasurements(),u=l.height,c=l.width;u===e.getHeight(s,a)&&c===e.getWidth(s,a)||(e.set(s,a,c,u),i&&"function"==typeof i.recomputeGridSize&&i.recomputeGridSize({columnIndex:a,rowIndex:s}))},o=r,(0,s.default)(n,o)}return(0,l.default)(e,t),(0,o.Z)(e,[{key:"componentDidMount",value:function(){this._maybeMeasureCell()}},{key:"componentDidUpdate",value:function(){this._maybeMeasureCell()}},{key:"render",value:function(){var t=this.props.children;return"function"==typeof t?t({measure:this._measure}):t}},{key:"_getCellMeasurements",value:function(){var t=this.props.cache,e=(0,g.findDOMNode)(this);if(e&&e.ownerDocument&&e.ownerDocument.defaultView&&e instanceof e.ownerDocument.defaultView.HTMLElement){var r=e.style.width,n=e.style.height;t.hasFixedWidth()||(e.style.width="auto"),t.hasFixedHeight()||(e.style.height="auto");var a=Math.ceil(e.offsetHeight),i=Math.ceil(e.offsetWidth);return r&&(e.style.width=r),n&&(e.style.height=n),{height:a,width:i}}return{height:0,width:0}}},{key:"_maybeMeasureCell",value:function(){var t=this.props,e=t.cache,r=t.columnIndex,n=void 0===r?0:r,a=t.parent,i=t.rowIndex,o=void 0===i?this.props.index||0:i;if(!e.has(o,n)){var s=this._getCellMeasurements(),l=s.height,u=s.width;e.set(o,n,u,l),a&&"function"==typeof a.invalidateCellSizeAfterRender&&a.invalidateCellSizeAfterRender({columnIndex:n,rowIndex:o})}}}]),e}(u.PureComponent);_.__internalCellMeasurerFlag=!1,_.propTypes=null;const x=_;var b=r(42723),w=r(94184),M=r.n(w),k=r(66683),T=r(44825),L=r.n(T),A="requested",S=function(t){function e(t,r){(0,i.default)(this,e);var n=(0,s.default)(this,(e.__proto__||a()(e)).call(this,t,r));return n.state={isScrolling:!1,scrollLeft:0,scrollTop:0},n._calculateSizeAndPositionDataOnNextUpdate=!1,n._onSectionRenderedMemoizer=(0,k.Z)(),n._onScrollMemoizer=(0,k.Z)(!1),n._invokeOnSectionRenderedHelper=n._invokeOnSectionRenderedHelper.bind(n),n._onScroll=n._onScroll.bind(n),n._setScrollingContainerRef=n._setScrollingContainerRef.bind(n),n._updateScrollPositionForScrollToCell=n._updateScrollPositionForScrollToCell.bind(n),n}return(0,l.default)(e,t),(0,o.Z)(e,[{key:"recomputeCellSizesAndPositions",value:function(){this._calculateSizeAndPositionDataOnNextUpdate=!0,this.forceUpdate()}},{key:"componentDidMount",value:function(){var t=this.props,e=t.cellLayoutManager,r=t.scrollLeft,n=t.scrollToCell,a=t.scrollTop;this._scrollbarSizeMeasured||(this._scrollbarSize=L()(),this._scrollbarSizeMeasured=!0,this.setState({})),n>=0?this._updateScrollPositionForScrollToCell():(r>=0||a>=0)&&this._setScrollPosition({scrollLeft:r,scrollTop:a}),this._invokeOnSectionRenderedHelper();var i=e.getTotalSize(),o=i.height,s=i.width;this._invokeOnScrollMemoizer({scrollLeft:r||0,scrollTop:a||0,totalHeight:o,totalWidth:s})}},{key:"componentDidUpdate",value:function(t,e){var r=this.props,n=r.height,a=r.scrollToAlignment,i=r.scrollToCell,o=r.width,s=this.state,l=s.scrollLeft,u=s.scrollPositionChangeReason,c=s.scrollTop;u===A&&(l>=0&&l!==e.scrollLeft&&l!==this._scrollingContainer.scrollLeft&&(this._scrollingContainer.scrollLeft=l),c>=0&&c!==e.scrollTop&&c!==this._scrollingContainer.scrollTop&&(this._scrollingContainer.scrollTop=c)),n===t.height&&a===t.scrollToAlignment&&i===t.scrollToCell&&o===t.width||this._updateScrollPositionForScrollToCell(),this._invokeOnSectionRenderedHelper()}},{key:"componentWillMount",value:function(){this.props.cellLayoutManager.calculateSizeAndPositionData(),this._scrollbarSize=L()(),void 0===this._scrollbarSize?(this._scrollbarSizeMeasured=!1,this._scrollbarSize=0):this._scrollbarSizeMeasured=!0}},{key:"componentWillUnmount",value:function(){this._disablePointerEventsTimeoutId&&clearTimeout(this._disablePointerEventsTimeoutId)}},{key:"componentWillReceiveProps",value:function(t){var e=this.state,r=e.scrollLeft,n=e.scrollTop;0!==t.cellCount||0===r&&0===n?t.scrollLeft===this.props.scrollLeft&&t.scrollTop===this.props.scrollTop||this._setScrollPosition({scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}):this._setScrollPosition({scrollLeft:0,scrollTop:0}),(t.cellCount!==this.props.cellCount||t.cellLayoutManager!==this.props.cellLayoutManager||this._calculateSizeAndPositionDataOnNextUpdate)&&t.cellLayoutManager.calculateSizeAndPositionData(),this._calculateSizeAndPositionDataOnNextUpdate&&(this._calculateSizeAndPositionDataOnNextUpdate=!1)}},{key:"render",value:function(){var t=this.props,e=t.autoHeight,r=t.cellCount,n=t.cellLayoutManager,a=t.className,i=t.height,o=t.horizontalOverscanSize,s=t.id,l=t.noContentRenderer,c=t.style,h=t.verticalOverscanSize,f=t.width,p=this.state,m=p.isScrolling,g=p.scrollLeft,y=p.scrollTop,v=n.getTotalSize(),_=v.height,x=v.width,b=Math.max(0,g-o),w=Math.max(0,y-h),k=Math.min(x,g+f+o),T=Math.min(_,y+i+h),L=i>0&&f>0?n.cellRenderers({height:T-w,isScrolling:m,width:k-b,x:b,y:w}):[],A={boxSizing:"border-box",direction:"ltr",height:e?"auto":i,position:"relative",WebkitOverflowScrolling:"touch",width:f,willChange:"transform"},S=_>i?this._scrollbarSize:0,E=x>f?this._scrollbarSize:0;return A.overflowX=x+S<=f?"hidden":"auto",A.overflowY=_+E<=i?"hidden":"auto",u.createElement("div",{ref:this._setScrollingContainerRef,"aria-label":this.props["aria-label"],className:M()("ReactVirtualized__Collection",a),id:s,onScroll:this._onScroll,role:"grid",style:(0,d.default)({},A,c),tabIndex:0},r>0&&u.createElement("div",{className:"ReactVirtualized__Collection__innerScrollContainer",style:{height:_,maxHeight:_,maxWidth:x,overflow:"hidden",pointerEvents:m?"none":"",width:x}},L),0===r&&l())}},{key:"_enablePointerEventsAfterDelay",value:function(){var t=this;this._disablePointerEventsTimeoutId&&clearTimeout(this._disablePointerEventsTimeoutId),this._disablePointerEventsTimeoutId=setTimeout((function(){(0,t.props.isScrollingChange)(!1),t._disablePointerEventsTimeoutId=null,t.setState({isScrolling:!1})}),150)}},{key:"_invokeOnSectionRenderedHelper",value:function(){var t=this.props,e=t.cellLayoutManager,r=t.onSectionRendered;this._onSectionRenderedMemoizer({callback:r,indices:{indices:e.getLastRenderedIndices()}})}},{key:"_invokeOnScrollMemoizer",value:function(t){var e=this,r=t.scrollLeft,n=t.scrollTop,a=t.totalHeight,i=t.totalWidth;this._onScrollMemoizer({callback:function(t){var r=t.scrollLeft,n=t.scrollTop,o=e.props,s=o.height;(0,o.onScroll)({clientHeight:s,clientWidth:o.width,scrollHeight:a,scrollLeft:r,scrollTop:n,scrollWidth:i})},indices:{scrollLeft:r,scrollTop:n}})}},{key:"_setScrollingContainerRef",value:function(t){this._scrollingContainer=t}},{key:"_setScrollPosition",value:function(t){var e=t.scrollLeft,r=t.scrollTop,n={scrollPositionChangeReason:A};e>=0&&(n.scrollLeft=e),r>=0&&(n.scrollTop=r),(e>=0&&e!==this.state.scrollLeft||r>=0&&r!==this.state.scrollTop)&&this.setState(n)}},{key:"_updateScrollPositionForScrollToCell",value:function(){var t=this.props,e=t.cellLayoutManager,r=t.height,n=t.scrollToAlignment,a=t.scrollToCell,i=t.width,o=this.state,s=o.scrollLeft,l=o.scrollTop;if(a>=0){var u=e.getScrollPositionForCell({align:n,cellIndex:a,height:r,scrollLeft:s,scrollTop:l,width:i});u.scrollLeft===s&&u.scrollTop===l||this._setScrollPosition(u)}}},{key:"_onScroll",value:function(t){if(t.target===this._scrollingContainer){this._enablePointerEventsAfterDelay();var e=this.props,r=e.cellLayoutManager,n=e.height,a=e.isScrollingChange,i=e.width,o=this._scrollbarSize,s=r.getTotalSize(),l=s.height,u=s.width,c=Math.max(0,Math.min(u-i+o,t.target.scrollLeft)),h=Math.max(0,Math.min(l-n+o,t.target.scrollTop));if(this.state.scrollLeft!==c||this.state.scrollTop!==h){var d=t.cancelable?"observed":A;this.state.isScrolling||a(!0),this.setState({isScrolling:!0,scrollLeft:c,scrollPositionChangeReason:d,scrollTop:h})}this._invokeOnScrollMemoizer({scrollLeft:c,scrollTop:h,totalWidth:u,totalHeight:l})}}}]),e}(u.PureComponent);S.defaultProps={"aria-label":"grid",horizontalOverscanSize:0,noContentRenderer:function(){return null},onScroll:function(){return null},onSectionRendered:function(){return null},scrollToAlignment:"auto",scrollToCell:-1,style:{},verticalOverscanSize:0};const E=S;S.propTypes={};var C=r(88902),D=r.n(C);r(65012).babelPluginFlowReactPropTypes_proptype_SizeAndPositionInfo||r(45697).any,r(65012).babelPluginFlowReactPropTypes_proptype_Index||r(45697).any;const P=function(){function t(e){var r=e.height,n=e.width,a=e.x,o=e.y;(0,i.default)(this,t),this.height=r,this.width=n,this.x=a,this.y=o,this._indexMap={},this._indices=[]}return(0,o.Z)(t,[{key:"addCellIndex",value:function(t){var e=t.index;this._indexMap[e]||(this._indexMap[e]=!0,this._indices.push(e))}},{key:"getCellIndices",value:function(){return this._indices}},{key:"toString",value:function(){return this.x+","+this.y+" "+this.width+"x"+this.height}}]),t}();r(65012).babelPluginFlowReactPropTypes_proptype_SizeAndPositionInfo||r(45697).any,r(65012).babelPluginFlowReactPropTypes_proptype_Index||r(45697).any;const O=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;(0,i.default)(this,t),this._sectionSize=e,this._cellMetadata=[],this._sections={}}return(0,o.Z)(t,[{key:"getCellIndices",value:function(t){var e=t.height,r=t.width,n=t.x,a=t.y,i={};return this.getSections({height:e,width:r,x:n,y:a}).forEach((function(t){return t.getCellIndices().forEach((function(t){i[t]=t}))})),D()(i).map((function(t){return i[t]}))}},{key:"getCellMetadata",value:function(t){var e=t.index;return this._cellMetadata[e]}},{key:"getSections",value:function(t){for(var e=t.height,r=t.width,n=t.x,a=t.y,i=Math.floor(n/this._sectionSize),o=Math.floor((n+r-1)/this._sectionSize),s=Math.floor(a/this._sectionSize),l=Math.floor((a+e-1)/this._sectionSize),u=[],c=i;c<=o;c++)for(var h=s;h<=l;h++){var d=c+"."+h;this._sections[d]||(this._sections[d]=new P({height:this._sectionSize,width:this._sectionSize,x:c*this._sectionSize,y:h*this._sectionSize})),u.push(this._sections[d])}return u}},{key:"getTotalSectionCount",value:function(){return D()(this._sections).length}},{key:"toString",value:function(){var t=this;return D()(this._sections).map((function(e){return t._sections[e].toString()}))}},{key:"registerCell",value:function(t){var e=t.cellMetadatum,r=t.index;this._cellMetadata[r]=e,this.getSections(e).forEach((function(t){return t.addCellIndex({index:r})}))}}]),t}();function z(t){var e=t.align,r=void 0===e?"auto":e,n=t.cellOffset,a=t.cellSize,i=t.containerSize,o=t.currentOffset,s=n,l=s-i+a;switch(r){case"start":return s;case"end":return l;case"center":return s-(i-a)/2;default:return Math.max(l,Math.min(s,o))}}r(65012).babelPluginFlowReactPropTypes_proptype_SizeInfo||r(45697).any,r(65012).babelPluginFlowReactPropTypes_proptype_ScrollPosition||r(45697).any;var I=function(t){function e(t,r){(0,i.default)(this,e);var n=(0,s.default)(this,(e.__proto__||a()(e)).call(this,t,r));return n._cellMetadata=[],n._lastRenderedCellIndices=[],n._cellCache=[],n._isScrollingChange=n._isScrollingChange.bind(n),n._setCollectionViewRef=n._setCollectionViewRef.bind(n),n}return(0,l.default)(e,t),(0,o.Z)(e,[{key:"forceUpdate",value:function(){void 0!==this._collectionView&&this._collectionView.forceUpdate()}},{key:"recomputeCellSizesAndPositions",value:function(){this._cellCache=[],this._collectionView.recomputeCellSizesAndPositions()}},{key:"render",value:function(){var t=(0,b.default)(this.props,[]);return u.createElement(E,(0,d.default)({cellLayoutManager:this,isScrollingChange:this._isScrollingChange,ref:this._setCollectionViewRef},t))}},{key:"calculateSizeAndPositionData",value:function(){var t=this.props,e=function(t){for(var e=t.cellCount,r=t.cellSizeAndPositionGetter,n=[],a=new O(t.sectionSize),i=0,o=0,s=0;s<e;s++){var l=r({index:s});if(null==l.height||isNaN(l.height)||null==l.width||isNaN(l.width)||null==l.x||isNaN(l.x)||null==l.y||isNaN(l.y))throw Error("Invalid metadata returned for cell "+s+":\n x:"+l.x+", y:"+l.y+", width:"+l.width+", height:"+l.height);i=Math.max(i,l.y+l.height),o=Math.max(o,l.x+l.width),n[s]=l,a.registerCell({cellMetadatum:l,index:s})}return{cellMetadata:n,height:i,sectionManager:a,width:o}}({cellCount:t.cellCount,cellSizeAndPositionGetter:t.cellSizeAndPositionGetter,sectionSize:t.sectionSize});this._cellMetadata=e.cellMetadata,this._sectionManager=e.sectionManager,this._height=e.height,this._width=e.width}},{key:"getLastRenderedIndices",value:function(){return this._lastRenderedCellIndices}},{key:"getScrollPositionForCell",value:function(t){var e=t.align,r=t.cellIndex,n=t.height,a=t.scrollLeft,i=t.scrollTop,o=t.width,s=this.props.cellCount;if(r>=0&&r<s){var l=this._cellMetadata[r];a=z({align:e,cellOffset:l.x,cellSize:l.width,containerSize:o,currentOffset:a,targetIndex:r}),i=z({align:e,cellOffset:l.y,cellSize:l.height,containerSize:n,currentOffset:i,targetIndex:r})}return{scrollLeft:a,scrollTop:i}}},{key:"getTotalSize",value:function(){return{height:this._height,width:this._width}}},{key:"cellRenderers",value:function(t){var e=this,r=t.height,n=t.isScrolling,a=t.width,i=t.x,o=t.y,s=this.props,l=s.cellGroupRenderer,u=s.cellRenderer;return this._lastRenderedCellIndices=this._sectionManager.getCellIndices({height:r,width:a,x:i,y:o}),l({cellCache:this._cellCache,cellRenderer:u,cellSizeAndPositionGetter:function(t){var r=t.index;return e._sectionManager.getCellMetadata({index:r})},indices:this._lastRenderedCellIndices,isScrolling:n})}},{key:"_isScrollingChange",value:function(t){t||(this._cellCache=[])}},{key:"_setCollectionViewRef",value:function(t){this._collectionView=t}}]),e}(u.PureComponent);I.defaultProps={"aria-label":"grid",cellGroupRenderer:function(t){var e=t.cellCache,r=t.cellRenderer,n=t.cellSizeAndPositionGetter,a=t.indices,i=t.isScrolling;return a.map((function(t){var a=n({index:t}),o={index:t,isScrolling:i,key:t,style:{height:a.height,left:a.x,position:"absolute",top:a.y,width:a.width}};return i?(t in e||(e[t]=r(o)),e[t]):r(o)})).filter((function(t){return!!t}))}};const R=I;I.propTypes={};var F=function(t){function e(t,r){(0,i.default)(this,e);var n=(0,s.default)(this,(e.__proto__||a()(e)).call(this,t,r));return n._registerChild=n._registerChild.bind(n),n}return(0,l.default)(e,t),(0,o.Z)(e,[{key:"componentDidUpdate",value:function(t){var e=this.props,r=e.columnMaxWidth,n=e.columnMinWidth,a=e.columnCount,i=e.width;r===t.columnMaxWidth&&n===t.columnMinWidth&&a===t.columnCount&&i===t.width||this._registeredChild&&this._registeredChild.recomputeGridSize()}},{key:"render",value:function(){var t=this.props,e=t.children,r=t.columnMaxWidth,n=t.columnMinWidth,a=t.columnCount,i=t.width,o=n||1,s=r?Math.min(r,i):i,l=i/a;return l=Math.max(o,l),l=Math.min(s,l),l=Math.floor(l),e({adjustedWidth:Math.min(i,l*a),columnWidth:l,getColumnWidth:function(){return l},registerChild:this._registerChild})}},{key:"_registerChild",value:function(t){if(t&&"function"!=typeof t.recomputeGridSize)throw Error("Unexpected child type registered; only Grid/MultiGrid children are supported.");this._registeredChild=t,this._registeredChild&&this._registeredChild.recomputeGridSize()}}]),e}(u.PureComponent);const N=F;F.propTypes={};var Y=r(35501),j=function(t){function e(t,r){(0,i.default)(this,e);var n=(0,s.default)(this,(e.__proto__||a()(e)).call(this,t,r));return n._loadMoreRowsMemoizer=(0,k.Z)(),n._onRowsRendered=n._onRowsRendered.bind(n),n._registerChild=n._registerChild.bind(n),n}return(0,l.default)(e,t),(0,o.Z)(e,[{key:"resetLoadMoreRowsCache",value:function(t){this._loadMoreRowsMemoizer=(0,k.Z)(),t&&this._doStuff(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"render",value:function(){return(0,this.props.children)({onRowsRendered:this._onRowsRendered,registerChild:this._registerChild})}},{key:"_loadUnloadedRanges",value:function(t){var e=this,r=this.props.loadMoreRows;t.forEach((function(t){var n=r(t);n&&n.then((function(){var r;(r={lastRenderedStartIndex:e._lastRenderedStartIndex,lastRenderedStopIndex:e._lastRenderedStopIndex,startIndex:t.startIndex,stopIndex:t.stopIndex}).startIndex>r.lastRenderedStopIndex||r.stopIndex<r.lastRenderedStartIndex||e._registeredChild&&function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r="function"==typeof t.recomputeGridSize?t.recomputeGridSize:t.recomputeRowHeights;r?r.call(t,e):t.forceUpdate()}(e._registeredChild,e._lastRenderedStartIndex)}))}))}},{key:"_onRowsRendered",value:function(t){var e=t.startIndex,r=t.stopIndex;this._lastRenderedStartIndex=e,this._lastRenderedStopIndex=r,this._doStuff(e,r)}},{key:"_doStuff",value:function(t,e){var r=this,n=this.props,a=n.isRowLoaded,i=n.minimumBatchSize,o=n.rowCount,s=n.threshold,l=function(t){for(var e=t.isRowLoaded,r=t.minimumBatchSize,n=t.rowCount,a=t.stopIndex,i=[],o=null,s=null,l=t.startIndex;l<=a;l++)e({index:l})?null!==s&&(i.push({startIndex:o,stopIndex:s}),o=s=null):(s=l,null===o&&(o=l));if(null!==s){for(var u=Math.min(Math.max(s,o+r-1),n-1),c=s+1;c<=u&&!e({index:c});c++)s=c;i.push({startIndex:o,stopIndex:s})}if(i.length)for(var h=i[0];h.stopIndex-h.startIndex+1<r&&h.startIndex>0;){var d=h.startIndex-1;if(e({index:d}))break;h.startIndex=d}return i}({isRowLoaded:a,minimumBatchSize:i,rowCount:o,startIndex:Math.max(0,t-s),stopIndex:Math.min(o-1,e+s)}),u=l.reduce((function(t,e){return t.concat([e.startIndex,e.stopIndex])}),[]);this._loadMoreRowsMemoizer({callback:function(){r._loadUnloadedRanges(l)},indices:{squashedUnloadedRanges:u}})}},{key:"_registerChild",value:function(t){this._registeredChild=t}}]),e}(u.PureComponent);j.defaultProps={minimumBatchSize:10,rowCount:0,threshold:15};const B=j;j.propTypes={};var H=r(8177),U=r.n(H),V=(r(35501).babelPluginFlowReactPropTypes_proptype_Scroll||r(45697).any,r(35501).babelPluginFlowReactPropTypes_proptype_CellRendererParams||r(45697).any,r(35501).babelPluginFlowReactPropTypes_proptype_RenderedSection||r(45697).any,r(35501).babelPluginFlowReactPropTypes_proptype_OverscanIndicesGetter||r(45697).any,r(35501).babelPluginFlowReactPropTypes_proptype_CellPosition||r(45697).any,r(35501).babelPluginFlowReactPropTypes_proptype_CellSize||r(45697).any,r(35501).babelPluginFlowReactPropTypes_proptype_Alignment||r(45697).any,r(35501).babelPluginFlowReactPropTypes_proptype_NoContentRenderer||r(45697).any,r(47606).Cu||r(45697).any,r(47606).ks||r(45697).any,r(47606).Om||r(45697).any,function(t){function e(){var t,r,n,o;(0,i.default)(this,e);for(var l=arguments.length,u=Array(l),c=0;c<l;c++)u[c]=arguments[c];return r=n=(0,s.default)(this,(t=e.__proto__||a()(e)).call.apply(t,[this].concat(u))),n._cellRenderer=function(t){var e=t.parent,r=t.rowIndex,a=t.style,i=t.isScrolling,o=t.isVisible,s=t.key,l=n.props.rowRenderer;return U()(a,"width").writable&&(a.width="100%"),l({index:r,style:a,isScrolling:i,isVisible:o,key:s,parent:e})},n._setRef=function(t){n.Grid=t},n._onScroll=function(t){var e=t.clientHeight,r=t.scrollHeight,a=t.scrollTop;(0,n.props.onScroll)({clientHeight:e,scrollHeight:r,scrollTop:a})},n._onSectionRendered=function(t){var e=t.rowOverscanStartIndex,r=t.rowOverscanStopIndex,a=t.rowStartIndex,i=t.rowStopIndex;(0,n.props.onRowsRendered)({overscanStartIndex:e,overscanStopIndex:r,startIndex:a,stopIndex:i})},o=r,(0,s.default)(n,o)}return(0,l.default)(e,t),(0,o.Z)(e,[{key:"forceUpdateGrid",value:function(){this.Grid&&this.Grid.forceUpdate()}},{key:"getOffsetForRow",value:function(t){var e=t.alignment,r=t.index;return this.Grid?this.Grid.getOffsetForCell({alignment:e,rowIndex:r,columnIndex:0}).scrollTop:0}},{key:"invalidateCellSizeAfterRender",value:function(t){var e=t.columnIndex,r=t.rowIndex;this.Grid&&this.Grid.invalidateCellSizeAfterRender({rowIndex:r,columnIndex:e})}},{key:"measureAllRows",value:function(){this.Grid&&this.Grid.measureAllCells()}},{key:"recomputeGridSize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.columnIndex,r=void 0===e?0:e,n=t.rowIndex,a=void 0===n?0:n;this.Grid&&this.Grid.recomputeGridSize({rowIndex:a,columnIndex:r})}},{key:"recomputeRowHeights",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.Grid&&this.Grid.recomputeGridSize({rowIndex:t,columnIndex:0})}},{key:"scrollToPosition",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.Grid&&this.Grid.scrollToPosition({scrollTop:t})}},{key:"scrollToRow",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.Grid&&this.Grid.scrollToCell({columnIndex:0,rowIndex:t})}},{key:"render",value:function(){var t=this.props,e=t.className,r=t.noRowsRenderer,n=t.scrollToIndex,a=t.width,i=M()("ReactVirtualized__List",e);return u.createElement(Y.ZP,(0,d.default)({},this.props,{autoContainerWidth:!0,cellRenderer:this._cellRenderer,className:i,columnWidth:a,columnCount:1,noContentRenderer:r,onScroll:this._onScroll,onSectionRendered:this._onSectionRendered,ref:this._setRef,scrollToRow:n}))}}]),e}(u.PureComponent));V.defaultProps={autoHeight:!1,estimatedRowSize:30,onScroll:function(){},noRowsRenderer:function(){return null},onRowsRendered:function(){},overscanIndicesGetter:Y.QY,overscanRowCount:10,scrollToAlignment:"auto",scrollToIndex:-1,style:{}},V.propTypes=null;const W=V;function G(t){var e=t.cellMeasurerCache,r=t.columnCount,n=t.columnWidth,a=t.spacer,i=void 0===a?0:a,o=void 0;function s(t){for(var r=0,a=1;a<o.length;a++)o[a]<o[r]&&(r=a);var s=r*(n+i),l=o[r]||0;return o[r]=l+e.getHeight(t)+i,{left:s,top:l}}function l(){o=[];for(var t=0;t<r;t++)o[t]=0}return l(),s.reset=function(t){r=t.columnCount,n=t.columnWidth,i=t.spacer,l()},s}r(56728).babelPluginFlowReactPropTypes_proptype_Positioner||r(45697).any,r(56728).babelPluginFlowReactPropTypes_proptype_CellMeasurerCache||r(45697).any;var q=r(56728);const Z=function(){function t(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,i.default)(this,t),this.columnWidth=function(t){var r=t.index;e._cellMeasurerCache.columnWidth({index:r+e._columnIndexOffset})},this.rowHeight=function(t){var r=t.index;e._cellMeasurerCache.rowHeight({index:r+e._rowIndexOffset})};var n=r.cellMeasurerCache,a=r.columnIndexOffset,o=void 0===a?0:a,s=r.rowIndexOffset,l=void 0===s?0:s;this._cellMeasurerCache=n,this._columnIndexOffset=o,this._rowIndexOffset=l}return(0,o.Z)(t,[{key:"clear",value:function(t,e){this._cellMeasurerCache.clear(t+this._rowIndexOffset,e+this._columnIndexOffset)}},{key:"clearAll",value:function(){this._cellMeasurerCache.clearAll()}},{key:"hasFixedHeight",value:function(){return this._cellMeasurerCache.hasFixedHeight()}},{key:"hasFixedWidth",value:function(){return this._cellMeasurerCache.hasFixedWidth()}},{key:"getHeight",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this._cellMeasurerCache.getHeight(t+this._rowIndexOffset,e+this._columnIndexOffset)}},{key:"getWidth",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this._cellMeasurerCache.getWidth(t+this._rowIndexOffset,e+this._columnIndexOffset)}},{key:"has",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this._cellMeasurerCache.has(t+this._rowIndexOffset,e+this._columnIndexOffset)}},{key:"set",value:function(t,e,r,n){this._cellMeasurerCache.set(t+this._rowIndexOffset,e+this._columnIndexOffset,r,n)}},{key:"defaultHeight",get:function(){return this._cellMeasurerCache.defaultHeight}},{key:"defaultWidth",get:function(){return this._cellMeasurerCache.defaultWidth}}]),t}();var X=function(t){function e(t,r){(0,i.default)(this,e);var n=(0,s.default)(this,(e.__proto__||a()(e)).call(this,t,r));return n.state={scrollLeft:0,scrollTop:0,scrollbarSize:0,showHorizontalScrollbar:!1,showVerticalScrollbar:!1},n._deferredInvalidateColumnIndex=null,n._deferredInvalidateRowIndex=null,n._bottomLeftGridRef=n._bottomLeftGridRef.bind(n),n._bottomRightGridRef=n._bottomRightGridRef.bind(n),n._cellRendererBottomLeftGrid=n._cellRendererBottomLeftGrid.bind(n),n._cellRendererBottomRightGrid=n._cellRendererBottomRightGrid.bind(n),n._cellRendererTopRightGrid=n._cellRendererTopRightGrid.bind(n),n._columnWidthRightGrid=n._columnWidthRightGrid.bind(n),n._onScroll=n._onScroll.bind(n),n._onScrollbarPresenceChange=n._onScrollbarPresenceChange.bind(n),n._onScrollLeft=n._onScrollLeft.bind(n),n._onScrollTop=n._onScrollTop.bind(n),n._rowHeightBottomGrid=n._rowHeightBottomGrid.bind(n),n._topLeftGridRef=n._topLeftGridRef.bind(n),n._topRightGridRef=n._topRightGridRef.bind(n),n}return(0,l.default)(e,t),(0,o.Z)(e,[{key:"forceUpdateGrids",value:function(){this._bottomLeftGrid&&this._bottomLeftGrid.forceUpdate(),this._bottomRightGrid&&this._bottomRightGrid.forceUpdate(),this._topLeftGrid&&this._topLeftGrid.forceUpdate(),this._topRightGrid&&this._topRightGrid.forceUpdate()}},{key:"invalidateCellSizeAfterRender",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.columnIndex,r=void 0===e?0:e,n=t.rowIndex,a=void 0===n?0:n;this._deferredInvalidateColumnIndex="number"==typeof this._deferredInvalidateColumnIndex?Math.min(this._deferredInvalidateColumnIndex,r):r,this._deferredInvalidateRowIndex="number"==typeof this._deferredInvalidateRowIndex?Math.min(this._deferredInvalidateRowIndex,a):a}},{key:"measureAllCells",value:function(){this._bottomLeftGrid&&this._bottomLeftGrid.measureAllCells(),this._bottomRightGrid&&this._bottomRightGrid.measureAllCells(),this._topLeftGrid&&this._topLeftGrid.measureAllCells(),this._topRightGrid&&this._topRightGrid.measureAllCells()}},{key:"recomputeGridSize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.columnIndex,r=void 0===e?0:e,n=t.rowIndex,a=void 0===n?0:n,i=this.props,o=i.fixedColumnCount,s=i.fixedRowCount,l=Math.max(0,r-o),u=Math.max(0,a-s);this._bottomLeftGrid&&this._bottomLeftGrid.recomputeGridSize({columnIndex:r,rowIndex:u}),this._bottomRightGrid&&this._bottomRightGrid.recomputeGridSize({columnIndex:l,rowIndex:u}),this._topLeftGrid&&this._topLeftGrid.recomputeGridSize({columnIndex:r,rowIndex:a}),this._topRightGrid&&this._topRightGrid.recomputeGridSize({columnIndex:l,rowIndex:a}),this._leftGridWidth=null,this._topGridHeight=null,this._maybeCalculateCachedStyles(null,this.props,null,this.state)}},{key:"componentDidMount",value:function(){var t=this.props,e=t.scrollLeft,r=t.scrollTop;if(e>0||r>0){var n={};e>0&&(n.scrollLeft=e),r>0&&(n.scrollTop=r),this.setState(n)}this._handleInvalidatedGridSize()}},{key:"componentDidUpdate",value:function(){this._handleInvalidatedGridSize()}},{key:"componentWillMount",value:function(){var t=this.props,e=t.deferredMeasurementCache,r=t.fixedColumnCount,n=t.fixedRowCount;this._maybeCalculateCachedStyles(null,this.props,null,this.state),e&&(this._deferredMeasurementCacheBottomLeftGrid=n>0?new Z({cellMeasurerCache:e,columnIndexOffset:0,rowIndexOffset:n}):e,this._deferredMeasurementCacheBottomRightGrid=r>0||n>0?new Z({cellMeasurerCache:e,columnIndexOffset:r,rowIndexOffset:n}):e,this._deferredMeasurementCacheTopRightGrid=r>0?new Z({cellMeasurerCache:e,columnIndexOffset:r,rowIndexOffset:0}):e)}},{key:"componentWillReceiveProps",value:function(t,e){var r=this.props,n=r.columnWidth,a=r.fixedColumnCount,i=r.fixedRowCount,o=r.rowHeight;if(n===t.columnWidth&&a===t.fixedColumnCount||(this._leftGridWidth=null),i===t.fixedRowCount&&o===t.rowHeight||(this._topGridHeight=null),t.scrollLeft!==this.props.scrollLeft||t.scrollTop!==this.props.scrollTop){var s={};null!=t.scrollLeft&&t.scrollLeft>=0&&(s.scrollLeft=t.scrollLeft),null!=t.scrollTop&&t.scrollTop>=0&&(s.scrollTop=t.scrollTop),this.setState(s)}this._maybeCalculateCachedStyles(this.props,t,this.state,e)}},{key:"render",value:function(){var t=this.props,e=t.onScroll,r=t.onSectionRendered,n=(t.onScrollbarPresenceChange,t.scrollLeft,t.scrollToColumn),a=(t.scrollTop,t.scrollToRow),i=(0,b.default)(t,["onScroll","onSectionRendered","onScrollbarPresenceChange","scrollLeft","scrollToColumn","scrollTop","scrollToRow"]);if(0===this.props.width||0===this.props.height)return null;var o=this.state,s=o.scrollLeft,l=o.scrollTop;return u.createElement("div",{style:this._containerOuterStyle},u.createElement("div",{style:this._containerTopStyle},this._renderTopLeftGrid(i),this._renderTopRightGrid((0,d.default)({},i,{onScroll:e,scrollLeft:s}))),u.createElement("div",{style:this._containerBottomStyle},this._renderBottomLeftGrid((0,d.default)({},i,{onScroll:e,scrollTop:l})),this._renderBottomRightGrid((0,d.default)({},i,{onScroll:e,onSectionRendered:r,scrollLeft:s,scrollToColumn:n,scrollToRow:a,scrollTop:l}))))}},{key:"_bottomLeftGridRef",value:function(t){this._bottomLeftGrid=t}},{key:"_bottomRightGridRef",value:function(t){this._bottomRightGrid=t}},{key:"_cellRendererBottomLeftGrid",value:function(t){var e=t.rowIndex,r=(0,b.default)(t,["rowIndex"]),n=this.props,a=n.cellRenderer,i=n.fixedRowCount;return e===n.rowCount-i?u.createElement("div",{key:r.key,style:(0,d.default)({},r.style,{height:20})}):a((0,d.default)({},r,{parent:this,rowIndex:e+i}))}},{key:"_cellRendererBottomRightGrid",value:function(t){var e=t.columnIndex,r=t.rowIndex,n=(0,b.default)(t,["columnIndex","rowIndex"]),a=this.props,i=a.cellRenderer,o=a.fixedColumnCount,s=a.fixedRowCount;return i((0,d.default)({},n,{columnIndex:e+o,parent:this,rowIndex:r+s}))}},{key:"_cellRendererTopRightGrid",value:function(t){var e=t.columnIndex,r=(0,b.default)(t,["columnIndex"]),n=this.props,a=n.cellRenderer,i=n.columnCount,o=n.fixedColumnCount;return e===i-o?u.createElement("div",{key:r.key,style:(0,d.default)({},r.style,{width:20})}):a((0,d.default)({},r,{columnIndex:e+o,parent:this}))}},{key:"_columnWidthRightGrid",value:function(t){var e=t.index,r=this.props,n=r.columnCount,a=r.fixedColumnCount,i=r.columnWidth,o=this.state,s=o.scrollbarSize;return o.showHorizontalScrollbar&&e===n-a?s:"function"==typeof i?i({index:e+a}):i}},{key:"_getBottomGridHeight",value:function(t){return t.height-this._getTopGridHeight(t)}},{key:"_getLeftGridWidth",value:function(t){var e=t.fixedColumnCount,r=t.columnWidth;if(null==this._leftGridWidth)if("function"==typeof r){for(var n=0,a=0;a<e;a++)n+=r({index:a});this._leftGridWidth=n}else this._leftGridWidth=r*e;return this._leftGridWidth}},{key:"_getRightGridWidth",value:function(t){return t.width-this._getLeftGridWidth(t)}},{key:"_getTopGridHeight",value:function(t){var e=t.fixedRowCount,r=t.rowHeight;if(null==this._topGridHeight)if("function"==typeof r){for(var n=0,a=0;a<e;a++)n+=r({index:a});this._topGridHeight=n}else this._topGridHeight=r*e;return this._topGridHeight}},{key:"_handleInvalidatedGridSize",value:function(){if("number"==typeof this._deferredInvalidateColumnIndex){var t=this._deferredInvalidateColumnIndex,e=this._deferredInvalidateRowIndex;this._deferredInvalidateColumnIndex=null,this._deferredInvalidateRowIndex=null,this.recomputeGridSize({columnIndex:t,rowIndex:e}),this.forceUpdate()}}},{key:"_maybeCalculateCachedStyles",value:function(t,e){var r=e.columnWidth,n=e.enableFixedColumnScroll,a=e.enableFixedRowScroll,i=e.height,o=e.fixedColumnCount,s=e.fixedRowCount,l=e.rowHeight,u=e.style,c=e.styleBottomLeftGrid,h=e.styleBottomRightGrid,f=e.styleTopLeftGrid,p=e.styleTopRightGrid,m=e.width,g=!t,y=g||i!==t.height||m!==t.width,v=g||r!==t.columnWidth||o!==t.fixedColumnCount,_=g||s!==t.fixedRowCount||l!==t.rowHeight;(g||y||u!==t.style)&&(this._containerOuterStyle=(0,d.default)({height:i,overflow:"visible",width:m},u)),(g||y||_)&&(this._containerTopStyle={height:this._getTopGridHeight(e),position:"relative",width:m},this._containerBottomStyle={height:i-this._getTopGridHeight(e),overflow:"visible",position:"relative",width:m}),(g||c!==t.styleBottomLeftGrid)&&(this._bottomLeftGridStyle=(0,d.default)({left:0,overflowX:"hidden",overflowY:n?"auto":"hidden",position:"absolute"},c)),(g||v||h!==t.styleBottomRightGrid)&&(this._bottomRightGridStyle=(0,d.default)({left:this._getLeftGridWidth(e),position:"absolute"},h)),(g||f!==t.styleTopLeftGrid)&&(this._topLeftGridStyle=(0,d.default)({left:0,overflowX:"hidden",overflowY:"hidden",position:"absolute",top:0},f)),(g||v||p!==t.styleTopRightGrid)&&(this._topRightGridStyle=(0,d.default)({left:this._getLeftGridWidth(e),overflowX:a?"auto":"hidden",overflowY:"hidden",position:"absolute",top:0},p))}},{key:"_onScroll",value:function(t){var e=t.scrollLeft,r=t.scrollTop;this.setState({scrollLeft:e,scrollTop:r});var n=this.props.onScroll;n&&n(t)}},{key:"_onScrollbarPresenceChange",value:function(t){var e=t.horizontal,r=t.size,n=t.vertical,a=this.state,i=a.showHorizontalScrollbar,o=a.showVerticalScrollbar;if(e!==i||n!==o){this.setState({scrollbarSize:r,showHorizontalScrollbar:e,showVerticalScrollbar:n});var s=this.props.onScrollbarPresenceChange;"function"==typeof s&&s({horizontal:e,size:r,vertical:n})}}},{key:"_onScrollLeft",value:function(t){var e=t.scrollLeft;this._onScroll({scrollLeft:e,scrollTop:this.state.scrollTop})}},{key:"_onScrollTop",value:function(t){var e=t.scrollTop;this._onScroll({scrollTop:e,scrollLeft:this.state.scrollLeft})}},{key:"_renderBottomLeftGrid",value:function(t){var e=t.enableFixedColumnScroll,r=t.fixedColumnCount,n=t.fixedRowCount,a=t.rowCount,i=t.scrollTop,o=this.state.showVerticalScrollbar;if(!r)return null;var s=o?1:0;return u.createElement(Y.ZP,(0,d.default)({},t,{cellRenderer:this._cellRendererBottomLeftGrid,className:this.props.classNameBottomLeftGrid,columnCount:r,deferredMeasurementCache:this._deferredMeasurementCacheBottomLeftGrid,height:this._getBottomGridHeight(t),onScroll:e?this._onScrollTop:void 0,ref:this._bottomLeftGridRef,rowCount:Math.max(0,a-n)+s,rowHeight:this._rowHeightBottomGrid,scrollTop:i,style:this._bottomLeftGridStyle,tabIndex:null,width:this._getLeftGridWidth(t)}))}},{key:"_renderBottomRightGrid",value:function(t){var e=t.columnCount,r=t.fixedColumnCount,n=t.fixedRowCount,a=t.rowCount,i=t.scrollToColumn,o=t.scrollToRow;return u.createElement(Y.ZP,(0,d.default)({},t,{cellRenderer:this._cellRendererBottomRightGrid,className:this.props.classNameBottomRightGrid,columnCount:Math.max(0,e-r),columnWidth:this._columnWidthRightGrid,deferredMeasurementCache:this._deferredMeasurementCacheBottomRightGrid,height:this._getBottomGridHeight(t),onScroll:this._onScroll,onScrollbarPresenceChange:this._onScrollbarPresenceChange,ref:this._bottomRightGridRef,rowCount:Math.max(0,a-n),rowHeight:this._rowHeightBottomGrid,scrollToColumn:i-r,scrollToRow:o-n,style:this._bottomRightGridStyle,width:this._getRightGridWidth(t)}))}},{key:"_renderTopLeftGrid",value:function(t){var e=t.fixedColumnCount,r=t.fixedRowCount;return e&&r?u.createElement(Y.ZP,(0,d.default)({},t,{className:this.props.classNameTopLeftGrid,columnCount:e,height:this._getTopGridHeight(t),ref:this._topLeftGridRef,rowCount:r,style:this._topLeftGridStyle,tabIndex:null,width:this._getLeftGridWidth(t)})):null}},{key:"_renderTopRightGrid",value:function(t){var e=t.columnCount,r=t.enableFixedRowScroll,n=t.fixedColumnCount,a=t.fixedRowCount,i=t.scrollLeft,o=this.state.showHorizontalScrollbar;if(!a)return null;var s=o?1:0;return u.createElement(Y.ZP,(0,d.default)({},t,{cellRenderer:this._cellRendererTopRightGrid,className:this.props.classNameTopRightGrid,columnCount:Math.max(0,e-n)+s,columnWidth:this._columnWidthRightGrid,deferredMeasurementCache:this._deferredMeasurementCacheTopRightGrid,height:this._getTopGridHeight(t),onScroll:r?this._onScrollLeft:void 0,ref:this._topRightGridRef,rowCount:a,scrollLeft:i,style:this._topRightGridStyle,tabIndex:null,width:this._getRightGridWidth(t)}))}},{key:"_rowHeightBottomGrid",value:function(t){var e=t.index,r=this.props,n=r.fixedRowCount,a=r.rowCount,i=r.rowHeight,o=this.state,s=o.scrollbarSize;return o.showVerticalScrollbar&&e===a-n?s:"function"==typeof i?i({index:e+n}):i}},{key:"_topLeftGridRef",value:function(t){this._topLeftGrid=t}},{key:"_topRightGridRef",value:function(t){this._topRightGrid=t}}]),e}(u.PureComponent);X.defaultProps={classNameBottomLeftGrid:"",classNameBottomRightGrid:"",classNameTopLeftGrid:"",classNameTopRightGrid:"",enableFixedColumnScroll:!1,enableFixedRowScroll:!1,fixedColumnCount:0,fixedRowCount:0,scrollToColumn:-1,scrollToRow:-1,style:{},styleBottomLeftGrid:{},styleBottomRightGrid:{},styleTopLeftGrid:{},styleTopRightGrid:{}};const J=X;X.propTypes={};var K=function(t){function e(t,r){(0,i.default)(this,e);var n=(0,s.default)(this,(e.__proto__||a()(e)).call(this,t,r));return n.state={clientHeight:0,clientWidth:0,scrollHeight:0,scrollLeft:0,scrollTop:0,scrollWidth:0},n._onScroll=n._onScroll.bind(n),n}return(0,l.default)(e,t),(0,o.Z)(e,[{key:"render",value:function(){var t=this.props.children,e=this.state,r=e.clientHeight,n=e.clientWidth,a=e.scrollHeight,i=e.scrollLeft,o=e.scrollTop,s=e.scrollWidth;return t({clientHeight:r,clientWidth:n,onScroll:this._onScroll,scrollHeight:a,scrollLeft:i,scrollTop:o,scrollWidth:s})}},{key:"_onScroll",value:function(t){var e=t.clientHeight,r=t.clientWidth,n=t.scrollHeight,a=t.scrollLeft,i=t.scrollTop,o=t.scrollWidth;this.setState({clientHeight:e,clientWidth:r,scrollHeight:n,scrollLeft:a,scrollTop:i,scrollWidth:o})}}]),e}(u.PureComponent);const $=K;function Q(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.defaultSortBy,n=e.defaultSortDirection,a=void 0===n?{}:n;if(!t)throw Error('Required parameter "sortCallback" not specified');var i=r||[],o={};function s(e){var r=e.defaultSortDirection,n=e.event,a=e.sortBy;if(n.shiftKey)o.hasOwnProperty(a)?o[a]="ASC"===o[a]?"DESC":"ASC":(o[a]=r,i.push(a));else if(n.ctrlKey||n.metaKey){var s=i.indexOf(a);s>=0&&(i.splice(s,1),delete o[a])}else i.length=0,i.push(a),o.hasOwnProperty(a)?o[a]="ASC"===o[a]?"DESC":"ASC":o[a]=r;t({sortBy:i,sortDirection:o})}return i.forEach((function(t){o[t]=a.hasOwnProperty(t)?a[t]:"ASC"})),{sort:s,sortBy:i,sortDirection:o}}function tt(t){var e=t.dataKey,r=t.rowData;return"function"==typeof r.get?r.get(e):r[e]}function et(t){var e=t.cellData;return null==e?"":String(e)}function rt(t){var e=t.className,r=t.columns,n=t.style;return u.createElement("div",{className:e,role:"row",style:n},r)}K.propTypes={},r(34584).babelPluginFlowReactPropTypes_proptype_CellDataGetterParams||r(45697).any,r(34584).babelPluginFlowReactPropTypes_proptype_CellRendererParams||r(45697).any,r(34584).babelPluginFlowReactPropTypes_proptype_HeaderRowRendererParams||r(45697).any,rt.propTypes=null;const nt={ASC:"ASC",DESC:"DESC"};function at(t){var e=t.sortDirection,r=M()("ReactVirtualized__Table__sortableHeaderIcon",{"ReactVirtualized__Table__sortableHeaderIcon--ASC":e===nt.ASC,"ReactVirtualized__Table__sortableHeaderIcon--DESC":e===nt.DESC});return u.createElement("svg",{className:r,width:18,height:18,viewBox:"0 0 24 24"},e===nt.ASC?u.createElement("path",{d:"M7 14l5-5 5 5z"}):u.createElement("path",{d:"M7 10l5 5 5-5z"}),u.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}))}function it(t){var e=t.dataKey,r=t.label,n=t.sortBy,a=t.sortDirection,i=n===e,o=[u.createElement("span",{className:"ReactVirtualized__Table__headerTruncatedText",key:"label",title:r},r)];return i&&o.push(u.createElement(at,{key:"SortIndicator",sortDirection:a})),o}function ot(t){var e=t.className,r=t.columns,n=t.index,a=t.key,i=t.onRowClick,o=t.onRowDoubleClick,s=t.onRowMouseOut,l=t.onRowMouseOver,c=t.onRowRightClick,h=t.rowData,f=t.style,p={};return(i||o||s||l||c)&&(p["aria-label"]="row",p.tabIndex=0,i&&(p.onClick=function(t){return i({event:t,index:n,rowData:h})}),o&&(p.onDoubleClick=function(t){return o({event:t,index:n,rowData:h})}),s&&(p.onMouseOut=function(t){return s({event:t,index:n,rowData:h})}),l&&(p.onMouseOver=function(t){return l({event:t,index:n,rowData:h})}),c&&(p.onContextMenu=function(t){return c({event:t,index:n,rowData:h})})),u.createElement("div",(0,d.default)({},p,{className:e,key:a,role:"row",style:f}),r)}at.propTypes={},r(34584).babelPluginFlowReactPropTypes_proptype_HeaderRendererParams||r(45697).any,it.propTypes=null,r(34584).babelPluginFlowReactPropTypes_proptype_RowRendererParams||r(45697).any,ot.propTypes=null;var st=function(t){function e(){return(0,i.default)(this,e),(0,s.default)(this,(e.__proto__||a()(e)).apply(this,arguments))}return(0,l.default)(e,t),e}(u.Component);st.defaultProps={cellDataGetter:tt,cellRenderer:et,defaultSortDirection:nt.ASC,flexGrow:0,flexShrink:1,headerRenderer:it,style:{}};const lt=st;st.propTypes={},r(35501).babelPluginFlowReactPropTypes_proptype_CellPosition||r(45697).any;var ut=function(t){function e(t){(0,i.default)(this,e);var r=(0,s.default)(this,(e.__proto__||a()(e)).call(this,t));return r.state={scrollbarWidth:0},r._createColumn=r._createColumn.bind(r),r._createRow=r._createRow.bind(r),r._onScroll=r._onScroll.bind(r),r._onSectionRendered=r._onSectionRendered.bind(r),r._setRef=r._setRef.bind(r),r}return(0,l.default)(e,t),(0,o.Z)(e,[{key:"forceUpdateGrid",value:function(){this.Grid&&this.Grid.forceUpdate()}},{key:"getOffsetForRow",value:function(t){var e=t.alignment,r=t.index;return this.Grid?this.Grid.getOffsetForCell({alignment:e,rowIndex:r}).scrollTop:0}},{key:"invalidateCellSizeAfterRender",value:function(t){var e=t.columnIndex,r=t.rowIndex;this.Grid&&this.Grid.invalidateCellSizeAfterRender({rowIndex:r,columnIndex:e})}},{key:"measureAllRows",value:function(){this.Grid&&this.Grid.measureAllCells()}},{key:"recomputeGridSize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.columnIndex,r=void 0===e?0:e,n=t.rowIndex,a=void 0===n?0:n;this.Grid&&this.Grid.recomputeGridSize({rowIndex:a,columnIndex:r})}},{key:"recomputeRowHeights",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.Grid&&this.Grid.recomputeGridSize({rowIndex:t})}},{key:"scrollToPosition",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.Grid&&this.Grid.scrollToPosition({scrollTop:t})}},{key:"scrollToRow",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.Grid&&this.Grid.scrollToCell({columnIndex:0,rowIndex:t})}},{key:"componentDidMount",value:function(){this._setScrollbarWidth()}},{key:"componentDidUpdate",value:function(){this._setScrollbarWidth()}},{key:"render",value:function(){var t=this,e=this.props,r=e.children,n=e.className,a=e.disableHeader,i=e.gridClassName,o=e.gridStyle,s=e.headerHeight,l=e.headerRowRenderer,c=e.height,h=e.id,f=e.noRowsRenderer,p=e.rowClassName,m=e.rowStyle,g=e.scrollToIndex,y=e.style,v=e.width,_=this.state.scrollbarWidth,x=a?c:c-s,b="function"==typeof p?p({index:-1}):p,w="function"==typeof m?m({index:-1}):m;return this._cachedColumnStyles=[],u.Children.toArray(r).forEach((function(e,r){var n=t._getFlexStyleForColumn(e,e.props.style);t._cachedColumnStyles[r]=(0,d.default)({},n,{overflow:"hidden"})})),u.createElement("div",{className:M()("ReactVirtualized__Table",n),id:h,role:"grid",style:y},!a&&l({className:M()("ReactVirtualized__Table__headerRow",b),columns:this._getHeaderColumns(),style:(0,d.default)({},w,{height:s,overflow:"hidden",paddingRight:_,width:v})}),u.createElement(Y.ZP,(0,d.default)({},this.props,{autoContainerWidth:!0,className:M()("ReactVirtualized__Table__Grid",i),cellRenderer:this._createRow,columnWidth:v,columnCount:1,height:x,id:void 0,noContentRenderer:f,onScroll:this._onScroll,onSectionRendered:this._onSectionRendered,ref:this._setRef,role:"rowgroup",scrollbarWidth:_,scrollToRow:g,style:(0,d.default)({},o,{overflowX:"hidden"})})))}},{key:"_createColumn",value:function(t){var e=t.column,r=t.columnIndex,n=t.isScrolling,a=t.parent,i=t.rowData,o=t.rowIndex,s=e.props,l=s.cellDataGetter,c=s.cellRenderer,h=s.className,d=s.columnData,f=s.dataKey,p=s.id,m=c({cellData:l({columnData:d,dataKey:f,rowData:i}),columnData:d,columnIndex:r,dataKey:f,isScrolling:n,parent:a,rowData:i,rowIndex:o}),g=this._cachedColumnStyles[r],y="string"==typeof m?m:null;return u.createElement("div",{"aria-describedby":p,className:M()("ReactVirtualized__Table__rowColumn",h),key:"Row"+o+"-Col"+r,role:"gridcell",style:g,title:y},m)}},{key:"_createHeader",value:function(t){var e=t.column,r=t.index,n=this.props,a=n.headerClassName,i=n.headerStyle,o=n.onHeaderClick,s=n.sort,l=n.sortBy,c=n.sortDirection,h=e.props,f=h.columnData,p=h.dataKey,m=h.defaultSortDirection,g=h.disableSort,y=h.headerRenderer,v=h.id,_=h.label,x=!g&&s,b=M()("ReactVirtualized__Table__headerColumn",a,e.props.headerClassName,{ReactVirtualized__Table__sortableHeaderColumn:x}),w=this._getFlexStyleForColumn(e,(0,d.default)({},i,e.props.headerStyle)),k=y({columnData:f,dataKey:p,disableSort:g,label:_,sortBy:l,sortDirection:c}),T=void 0,L=void 0,A=void 0,S=void 0,E=void 0;if(x||o){var C=l!==p?m:c===nt.DESC?nt.ASC:nt.DESC,D=function(t){x&&s({defaultSortDirection:m,event:t,sortBy:p,sortDirection:C}),o&&o({columnData:f,dataKey:p,event:t})};E=e.props["aria-label"]||_||p,A=0,T=D,L=function(t){"Enter"!==t.key&&" "!==t.key||D(t)}}return l===p&&(S=c===nt.ASC?"ascending":"descending"),u.createElement("div",{"aria-label":E,"aria-sort":S,className:b,id:v,key:"Header-Col"+r,onClick:T,onKeyDown:L,role:"columnheader",style:w,tabIndex:A},k)}},{key:"_createRow",value:function(t){var e=this,r=t.rowIndex,n=t.isScrolling,a=t.key,i=t.parent,o=t.style,s=this.props,l=s.children,c=s.onRowClick,h=s.onRowDoubleClick,f=s.onRowRightClick,p=s.onRowMouseOver,m=s.onRowMouseOut,g=s.rowClassName,y=s.rowGetter,v=s.rowRenderer,_=s.rowStyle,x=this.state.scrollbarWidth,b="function"==typeof g?g({index:r}):g,w="function"==typeof _?_({index:r}):_,k=y({index:r}),T=u.Children.toArray(l).map((function(t,a){return e._createColumn({column:t,columnIndex:a,isScrolling:n,parent:i,rowData:k,rowIndex:r,scrollbarWidth:x})})),L=M()("ReactVirtualized__Table__row",b),A=(0,d.default)({},o,w,{height:this._getRowHeight(r),overflow:"hidden",paddingRight:x});return v({className:L,columns:T,index:r,isScrolling:n,key:a,onRowClick:c,onRowDoubleClick:h,onRowRightClick:f,onRowMouseOver:p,onRowMouseOut:m,rowData:k,style:A})}},{key:"_getFlexStyleForColumn",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.props.flexGrow+" "+t.props.flexShrink+" "+t.props.width+"px",n=(0,d.default)({},e,{flex:r,msFlex:r,WebkitFlex:r});return t.props.maxWidth&&(n.maxWidth=t.props.maxWidth),t.props.minWidth&&(n.minWidth=t.props.minWidth),n}},{key:"_getHeaderColumns",value:function(){var t=this,e=this.props,r=e.children;return(e.disableHeader?[]:u.Children.toArray(r)).map((function(e,r){return t._createHeader({column:e,index:r})}))}},{key:"_getRowHeight",value:function(t){var e=this.props.rowHeight;return"function"==typeof e?e({index:t}):e}},{key:"_onScroll",value:function(t){var e=t.clientHeight,r=t.scrollHeight,n=t.scrollTop;(0,this.props.onScroll)({clientHeight:e,scrollHeight:r,scrollTop:n})}},{key:"_onSectionRendered",value:function(t){var e=t.rowOverscanStartIndex,r=t.rowOverscanStopIndex,n=t.rowStartIndex,a=t.rowStopIndex;(0,this.props.onRowsRendered)({overscanStartIndex:e,overscanStopIndex:r,startIndex:n,stopIndex:a})}},{key:"_setRef",value:function(t){this.Grid=t}},{key:"_setScrollbarWidth",value:function(){if(this.Grid){var t=(0,g.findDOMNode)(this.Grid),e=t.clientWidth||0,r=(t.offsetWidth||0)-e;this.setState({scrollbarWidth:r})}}}]),e}(u.PureComponent);ut.defaultProps={disableHeader:!1,estimatedRowSize:30,headerHeight:0,headerStyle:{},noRowsRenderer:function(){return null},onRowsRendered:function(){return null},onScroll:function(){return null},overscanIndicesGetter:Y.QY,overscanRowCount:10,rowRenderer:ot,headerRowRenderer:rt,rowStyle:{},scrollToAlignment:"auto",scrollToIndex:-1,style:{}};const ct=ut;ut.propTypes={};var ht=r(7085),dt=[],ft=null,pt=null;function mt(){pt&&(pt=null,document.body&&null!=ft&&(document.body.style.pointerEvents=ft),ft=null)}function gt(){mt(),dt.forEach((function(t){return t.__resetIsScrolling()}))}function yt(t){t.currentTarget===window&&null==ft&&document.body&&(ft=document.body.style.pointerEvents,document.body.style.pointerEvents="none"),function(){pt&&(0,ht.w)(pt);var t=0;dt.forEach((function(e){t=Math.max(t,e.props.scrollingResetTimeInterval)})),pt=(0,ht.I)(gt,t)}(),dt.forEach((function(e){e.props.scrollElement===t.currentTarget&&e.__handleWindowScrollEvent()}))}function vt(t,e){dt.some((function(t){return t.props.scrollElement===e}))||e.addEventListener("scroll",yt),dt.push(t)}function _t(t,e){(dt=dt.filter((function(e){return e!==t}))).length||(e.removeEventListener("scroll",yt),pt&&((0,ht.w)(pt),mt()))}var xt=function(t){return t===window},bt=function(t){return t.getBoundingClientRect()};function wt(t,e){if(t){if(xt(t)){var r=window,n=r.innerHeight,a=r.innerWidth;return{height:"number"==typeof n?n:0,width:"number"==typeof a?a:0}}return bt(t)}return{height:e.serverHeight,width:e.serverWidth}}function Mt(t,e){if(xt(e)&&document.documentElement){var r=document.documentElement,n=bt(t),a=bt(r);return{top:n.top-a.top,left:n.left-a.left}}var i=kt(e),o=bt(t),s=bt(e);return{top:o.top+i.top-s.top,left:o.left+i.left-s.left}}function kt(t){return xt(t)&&document.documentElement?{top:"scrollY"in window?window.scrollY:document.documentElement.scrollTop,left:"scrollX"in window?window.scrollX:document.documentElement.scrollLeft}:{top:t.scrollTop,left:t.scrollLeft}}var Tt=function(){return"undefined"!=typeof window?window:void 0},Lt=function(t){function e(){var t,r,n,o;(0,i.default)(this,e);for(var l=arguments.length,u=Array(l),c=0;c<l;c++)u[c]=arguments[c];return r=n=(0,s.default)(this,(t=e.__proto__||a()(e)).call.apply(t,[this].concat(u))),n._window=Tt(),n._isMounted=!1,n._positionFromTop=0,n._positionFromLeft=0,n.state=(0,d.default)({},wt(n.props.scrollElement,n.props),{isScrolling:!1,scrollLeft:0,scrollTop:0}),n._registerChild=function(t){!t||t instanceof Element||console.warn("WindowScroller registerChild expects to be passed Element or null"),n._child=t,n.updatePosition()},n._onChildScroll=function(t){var e=t.scrollTop;if(n.state.scrollTop!==e){var r=n.props.scrollElement;r&&("function"==typeof r.scrollTo?r.scrollTo(0,e+n._positionFromTop):r.scrollTop=e+n._positionFromTop)}},n._registerResizeListener=function(t){t===window?window.addEventListener("resize",n._onResize,!1):n._detectElementResize.addResizeListener(t,n._onResize)},n._unregisterResizeListener=function(t){t===window?window.removeEventListener("resize",n._onResize,!1):t&&n._detectElementResize.removeResizeListener(t,n._onResize)},n._onResize=function(){n.updatePosition()},n.__handleWindowScrollEvent=function(){if(n._isMounted){var t=n.props.onScroll,e=n.props.scrollElement;if(e){var r=kt(e),a=Math.max(0,r.left-n._positionFromLeft),i=Math.max(0,r.top-n._positionFromTop);n.setState({isScrolling:!0,scrollLeft:a,scrollTop:i}),t({scrollLeft:a,scrollTop:i})}}},n.__resetIsScrolling=function(){n.setState({isScrolling:!1})},o=r,(0,s.default)(n,o)}return(0,l.default)(e,t),(0,o.Z)(e,[{key:"updatePosition",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.scrollElement,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.props,r=this.props.onResize,n=this.state,a=n.height,i=n.width,o=this._child||g.findDOMNode(this);if(o instanceof Element&&t){var s=Mt(o,t);this._positionFromTop=s.top,this._positionFromLeft=s.left}var l=wt(t,e);a===l.height&&i===l.width||(this.setState({height:l.height,width:l.width}),r({height:l.height,width:l.width}))}},{key:"componentDidMount",value:function(){var t=this.props.scrollElement;this._detectElementResize=f(),this.updatePosition(t),t&&(vt(this,t),this._registerResizeListener(t)),this._isMounted=!0}},{key:"componentWillReceiveProps",value:function(t){var e=this.props.scrollElement,r=t.scrollElement;e!==r&&e&&r&&(this.updatePosition(r,t),_t(this,e),vt(this,r),this._unregisterResizeListener(e),this._registerResizeListener(r))}},{key:"componentWillUnmount",value:function(){var t=this.props.scrollElement;t&&(_t(this,t),this._unregisterResizeListener(t)),this._isMounted=!1}},{key:"render",value:function(){var t=this.props.children,e=this.state,r=e.isScrolling,n=e.scrollTop,a=e.scrollLeft,i=e.height,o=e.width;return t({onChildScroll:this._onChildScroll,registerChild:this._registerChild,height:i,isScrolling:r,scrollLeft:a,scrollTop:n,width:o})}}]),e}(u.PureComponent);Lt.defaultProps={onResize:function(){},onScroll:function(){},scrollingResetTimeInterval:150,scrollElement:Tt(),serverHeight:0,serverWidth:0},Lt.propTypes=null;const At=Lt},66683:(t,e,r)=>{r.d(e,{Z:()=>i});var n=r(88902),a=r.n(n);function i(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e={};return function(r){var n=r.callback,i=r.indices,o=a()(i),s=!t||o.every((function(t){var e=i[t];return Array.isArray(e)?e.length>0:e>=0})),l=o.length!==a()(e).length||o.some((function(t){var r=e[t],n=i[t];return Array.isArray(n)?r.join(",")!==n.join(","):r!==n}));e=i,s&&l&&n(i)}}},7085:(t,e,r)=>{r.d(e,{w:()=>l,I:()=>u});var n=void 0,a=(n="undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).requestAnimationFrame||n.webkitRequestAnimationFrame||n.mozRequestAnimationFrame||n.oRequestAnimationFrame||n.msRequestAnimationFrame||function(t){return n.setTimeout(t,1e3/60)},i=n.cancelAnimationFrame||n.webkitCancelAnimationFrame||n.mozCancelAnimationFrame||n.oCancelAnimationFrame||n.msCancelAnimationFrame||function(t){n.clearTimeout(t)},o=a,s=i,l=function(t){return s(t.id)},u=function(t,e){var r=Date.now(),n={id:o((function a(){Date.now()-r>=e?t.call():n.id=o(a)}))};return n}},99018:function(t,e){var r,n;r=function(){var t,e,r,n;Object.keys||(Object.keys=(t=Object.prototype.hasOwnProperty,e=!{toString:null}.propertyIsEnumerable("toString"),n=(r=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"]).length,function(a){if("object"!=typeof a&&"function"!=typeof a||null===a)throw new TypeError("Object.keys called on non-object");var i=[];for(var o in a)t.call(a,o)&&i.push(o);if(e)for(var s=0;s<n;s++)t.call(a,r[s])&&i.push(r[s]);return i})),Object.create||(Object.create=function(){function t(){}return function(e){if(1!==arguments.length)throw new Error("Object.create implementation only accepts one parameter.");return t.prototype=e,new t}}()),Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),Array.prototype.indexOf||(Array.prototype.indexOf=function(t){if(null===this)throw new TypeError;var e=Object(this),r=e.length>>>0;if(0===r)return-1;var n=0;if(arguments.length>1&&((n=Number(arguments[1]))!=n?n=0:0!==n&&n!==1/0&&n!==-1/0&&(n=(n>0||-1)*Math.floor(Math.abs(n)))),n>=r)return-1;for(var a=n>=0?n:Math.max(r-Math.abs(n),0);a<r;a++)if(a in e&&e[a]===t)return a;return-1}),Object.isFrozen||(Object.isFrozen=function(t){for(var e="tv4_test_frozen_key";t.hasOwnProperty(e);)e+=Math.random();try{return t[e]=!0,delete t[e],!1}catch(t){return!0}});var a={"+":!0,"#":!0,".":!0,"/":!0,";":!0,"?":!0,"&":!0},i={"*":!0};function o(t){return encodeURI(t).replace(/%25[0-9][0-9]/g,(function(t){return"%"+t.substring(3)}))}function s(t){var e="";a[t.charAt(0)]&&(e=t.charAt(0),t=t.substring(1));var r="",n="",s=!0,l=!1,u=!1;"+"===e?s=!1:"."===e?(n=".",r="."):"/"===e?(n="/",r="/"):"#"===e?(n="#",s=!1):";"===e?(n=";",r=";",l=!0,u=!0):"?"===e?(n="?",r="&",l=!0):"&"===e&&(n="&",r="&",l=!0);for(var c=[],h=t.split(","),d=[],f={},p=0;p<h.length;p++){var m=h[p],g=null;if(-1!==m.indexOf(":")){var y=m.split(":");m=y[0],g=parseInt(y[1],10)}for(var v={};i[m.charAt(m.length-1)];)v[m.charAt(m.length-1)]=!0,m=m.substring(0,m.length-1);var _={truncate:g,name:m,suffices:v};d.push(_),f[m]=_,c.push(m)}var x=function(t){for(var e="",a=0,i=0;i<d.length;i++){var c=d[i],h=t(c.name);if(null==h||Array.isArray(h)&&0===h.length||"object"==typeof h&&0===Object.keys(h).length)a++;else if(e+=i===a?n:r||",",Array.isArray(h)){l&&(e+=c.name+"=");for(var f=0;f<h.length;f++)f>0&&(e+=c.suffices["*"]&&r||",",c.suffices["*"]&&l&&(e+=c.name+"=")),e+=s?encodeURIComponent(h[f]).replace(/!/g,"%21"):o(h[f])}else if("object"==typeof h){l&&!c.suffices["*"]&&(e+=c.name+"=");var p=!0;for(var m in h)p||(e+=c.suffices["*"]&&r||","),p=!1,e+=s?encodeURIComponent(m).replace(/!/g,"%21"):o(m),e+=c.suffices["*"]?"=":",",e+=s?encodeURIComponent(h[m]).replace(/!/g,"%21"):o(h[m])}else l&&(e+=c.name,u&&""===h||(e+="=")),null!=c.truncate&&(h=h.substring(0,c.truncate)),e+=s?encodeURIComponent(h).replace(/!/g,"%21"):o(h)}return e};return x.varNames=c,{prefix:n,substitution:x}}function l(t){if(!(this instanceof l))return new l(t);for(var e=t.split("{"),r=[e.shift()],n=[],a=[],i=[];e.length>0;){var o=e.shift(),u=o.split("}")[0],c=o.substring(u.length+1),h=s(u);a.push(h.substitution),n.push(h.prefix),r.push(c),i=i.concat(h.substitution.varNames)}this.fill=function(t){for(var e=r[0],n=0;n<a.length;n++)e+=(0,a[n])(t),e+=r[n+1];return e},this.varNames=i,this.template=t}l.prototype={toString:function(){return this.template},fillFromObject:function(t){return this.fill((function(e){return t[e]}))}};var u=function(t,e,r,n,a){if(this.missing=[],this.missingMap={},this.formatValidators=t?Object.create(t.formatValidators):{},this.schemas=t?Object.create(t.schemas):{},this.collectMultiple=e,this.errors=[],this.handleError=e?this.collectError:this.returnError,n&&(this.checkRecursive=!0,this.scanned=[],this.scannedFrozen=[],this.scannedFrozenSchemas=[],this.scannedFrozenValidationErrors=[],this.validatedSchemasKey="tv4_validation_id",this.validationErrorsKey="tv4_validation_errors_id"),a&&(this.trackUnknownProperties=!0,this.knownPropertyPaths={},this.unknownPropertyPaths={}),this.errorReporter=r||y("en"),"string"==typeof this.errorReporter)throw new Error("debug");if(this.definedKeywords={},t)for(var i in t.definedKeywords)this.definedKeywords[i]=t.definedKeywords[i].slice(0)};function c(t,e){if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){if(Array.isArray(t)!==Array.isArray(e))return!1;if(Array.isArray(t)){if(t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(!c(t[r],e[r]))return!1}else{var n;for(n in t)if(void 0===e[n]&&void 0!==t[n])return!1;for(n in e)if(void 0===t[n]&&void 0!==e[n])return!1;for(n in t)if(!c(t[n],e[n]))return!1}return!0}return!1}u.prototype.defineKeyword=function(t,e){this.definedKeywords[t]=this.definedKeywords[t]||[],this.definedKeywords[t].push(e)},u.prototype.createError=function(t,e,r,n,a,i,o){var s=new w(t,e,r,n,a);return s.message=this.errorReporter(s,i,o),s},u.prototype.returnError=function(t){return t},u.prototype.collectError=function(t){return t&&this.errors.push(t),null},u.prototype.prefixErrors=function(t,e,r){for(var n=t;n<this.errors.length;n++)this.errors[n]=this.errors[n].prefixWith(e,r);return this},u.prototype.banUnknownProperties=function(t,e){for(var r in this.unknownPropertyPaths){var n=this.createError(v.UNKNOWN_PROPERTY,{path:r},r,"",null,t,e),a=this.handleError(n);if(a)return a}return null},u.prototype.addFormat=function(t,e){if("object"==typeof t){for(var r in t)this.addFormat(r,t[r]);return this}this.formatValidators[t]=e},u.prototype.resolveRefs=function(t,e){if(void 0!==t.$ref){if((e=e||{})[t.$ref])return this.createError(v.CIRCULAR_REFERENCE,{urls:Object.keys(e).join(", ")},"","",null,void 0,t);e[t.$ref]=!0,t=this.getSchema(t.$ref,e)}return t},u.prototype.getSchema=function(t,e){var r;if(void 0!==this.schemas[t])return r=this.schemas[t],this.resolveRefs(r,e);var n=t,a="";if(-1!==t.indexOf("#")&&(a=t.substring(t.indexOf("#")+1),n=t.substring(0,t.indexOf("#"))),"object"==typeof this.schemas[n]){r=this.schemas[n];var i=decodeURIComponent(a);if(""===i)return this.resolveRefs(r,e);if("/"!==i.charAt(0))return;for(var o=i.split("/").slice(1),s=0;s<o.length;s++){var l=o[s].replace(/~1/g,"/").replace(/~0/g,"~");if(void 0===r[l]){r=void 0;break}r=r[l]}if(void 0!==r)return this.resolveRefs(r,e)}void 0===this.missing[n]&&(this.missing.push(n),this.missing[n]=n,this.missingMap[n]=n)},u.prototype.searchSchemas=function(t,e){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.searchSchemas(t[r],e);else if(t&&"object"==typeof t)for(var n in"string"==typeof t.id&&function(t,e){if(e.substring(0,t.length)===t){var r=e.substring(t.length);if(e.length>0&&"/"===e.charAt(t.length-1)||"#"===r.charAt(0)||"?"===r.charAt(0))return!0}return!1}(e,t.id)&&void 0===this.schemas[t.id]&&(this.schemas[t.id]=t),t)if("enum"!==n)if("object"==typeof t[n])this.searchSchemas(t[n],e);else if("$ref"===n){var a=m(t[n]);a&&void 0===this.schemas[a]&&void 0===this.missingMap[a]&&(this.missingMap[a]=a)}},u.prototype.addSchema=function(t,e){if("string"!=typeof t||void 0===e){if("object"!=typeof t||"string"!=typeof t.id)return;t=(e=t).id}t===m(t)+"#"&&(t=m(t)),this.schemas[t]=e,delete this.missingMap[t],g(e,t),this.searchSchemas(e,t)},u.prototype.getSchemaMap=function(){var t={};for(var e in this.schemas)t[e]=this.schemas[e];return t},u.prototype.getSchemaUris=function(t){var e=[];for(var r in this.schemas)t&&!t.test(r)||e.push(r);return e},u.prototype.getMissingUris=function(t){var e=[];for(var r in this.missingMap)t&&!t.test(r)||e.push(r);return e},u.prototype.dropSchemas=function(){this.schemas={},this.reset()},u.prototype.reset=function(){this.missing=[],this.missingMap={},this.errors=[]},u.prototype.validateAll=function(t,e,r,n,a){var i;if(!(e=this.resolveRefs(e)))return null;if(e instanceof w)return this.errors.push(e),e;var o,s=this.errors.length,l=null,u=null;if(this.checkRecursive&&t&&"object"==typeof t){if(i=!this.scanned.length,t[this.validatedSchemasKey]){var c=t[this.validatedSchemasKey].indexOf(e);if(-1!==c)return this.errors=this.errors.concat(t[this.validationErrorsKey][c]),null}if(Object.isFrozen(t)&&-1!==(o=this.scannedFrozen.indexOf(t))){var h=this.scannedFrozenSchemas[o].indexOf(e);if(-1!==h)return this.errors=this.errors.concat(this.scannedFrozenValidationErrors[o][h]),null}if(this.scanned.push(t),Object.isFrozen(t))-1===o&&(o=this.scannedFrozen.length,this.scannedFrozen.push(t),this.scannedFrozenSchemas.push([])),l=this.scannedFrozenSchemas[o].length,this.scannedFrozenSchemas[o][l]=e,this.scannedFrozenValidationErrors[o][l]=[];else{if(!t[this.validatedSchemasKey])try{Object.defineProperty(t,this.validatedSchemasKey,{value:[],configurable:!0}),Object.defineProperty(t,this.validationErrorsKey,{value:[],configurable:!0})}catch(e){t[this.validatedSchemasKey]=[],t[this.validationErrorsKey]=[]}u=t[this.validatedSchemasKey].length,t[this.validatedSchemasKey][u]=e,t[this.validationErrorsKey][u]=[]}}var d=this.errors.length,f=this.validateBasic(t,e,a)||this.validateNumeric(t,e,a)||this.validateString(t,e,a)||this.validateArray(t,e,a)||this.validateObject(t,e,a)||this.validateCombinations(t,e,a)||this.validateHypermedia(t,e,a)||this.validateFormat(t,e,a)||this.validateDefinedKeywords(t,e,a)||null;if(i){for(;this.scanned.length;)delete this.scanned.pop()[this.validatedSchemasKey];this.scannedFrozen=[],this.scannedFrozenSchemas=[]}if(f||d!==this.errors.length)for(;r&&r.length||n&&n.length;){var p=r&&r.length?""+r.pop():null,m=n&&n.length?""+n.pop():null;f&&(f=f.prefixWith(p,m)),this.prefixErrors(d,p,m)}return null!==l?this.scannedFrozenValidationErrors[o][l]=this.errors.slice(s):null!==u&&(t[this.validationErrorsKey][u]=this.errors.slice(s)),this.handleError(f)},u.prototype.validateFormat=function(t,e){if("string"!=typeof e.format||!this.formatValidators[e.format])return null;var r=this.formatValidators[e.format].call(null,t,e);return"string"==typeof r||"number"==typeof r?this.createError(v.FORMAT_CUSTOM,{message:r},"","/format",null,t,e):r&&"object"==typeof r?this.createError(v.FORMAT_CUSTOM,{message:r.message||"?"},r.dataPath||"",r.schemaPath||"/format",null,t,e):null},u.prototype.validateDefinedKeywords=function(t,e,r){for(var n in this.definedKeywords)if(void 0!==e[n])for(var a=this.definedKeywords[n],i=0;i<a.length;i++){var o=(0,a[i])(t,e[n],e,r);if("string"==typeof o||"number"==typeof o)return this.createError(v.KEYWORD_CUSTOM,{key:n,message:o},"","",null,t,e).prefixWith(null,n);if(o&&"object"==typeof o){var s=o.code;if("string"==typeof s){if(!v[s])throw new Error("Undefined error code (use defineError): "+s);s=v[s]}else"number"!=typeof s&&(s=v.KEYWORD_CUSTOM);var l="object"==typeof o.message?o.message:{key:n,message:o.message||"?"},u=o.schemaPath||"/"+n.replace(/~/g,"~0").replace(/\//g,"~1");return this.createError(s,l,o.dataPath||null,u,null,t,e)}}return null},u.prototype.validateBasic=function(t,e,r){var n;return(n=this.validateType(t,e,r))||(n=this.validateEnum(t,e,r))?n.prefixWith(null,"type"):null},u.prototype.validateType=function(t,e){if(void 0===e.type)return null;var r=typeof t;null===t?r="null":Array.isArray(t)&&(r="array");var n=e.type;Array.isArray(n)||(n=[n]);for(var a=0;a<n.length;a++){var i=n[a];if(i===r||"integer"===i&&"number"===r&&t%1==0)return null}return this.createError(v.INVALID_TYPE,{type:r,expected:n.join("/")},"","",null,t,e)},u.prototype.validateEnum=function(t,e){if(void 0===e.enum)return null;for(var r=0;r<e.enum.length;r++)if(c(t,e.enum[r]))return null;return this.createError(v.ENUM_MISMATCH,{value:"undefined"!=typeof JSON?JSON.stringify(t):t},"","",null,t,e)},u.prototype.validateNumeric=function(t,e,r){return this.validateMultipleOf(t,e,r)||this.validateMinMax(t,e,r)||this.validateNaN(t,e,r)||null};var h=Math.pow(2,-51),d=1-h;function f(t){var e=String(t).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return e?{href:e[0]||"",protocol:e[1]||"",authority:e[2]||"",host:e[3]||"",hostname:e[4]||"",port:e[5]||"",pathname:e[6]||"",search:e[7]||"",hash:e[8]||""}:null}function p(t,e){return e=f(e||""),t=f(t||""),e&&t?(e.protocol||t.protocol)+(e.protocol||e.authority?e.authority:t.authority)+(r=e.protocol||e.authority||"/"===e.pathname.charAt(0)?e.pathname:e.pathname?(t.authority&&!t.pathname?"/":"")+t.pathname.slice(0,t.pathname.lastIndexOf("/")+1)+e.pathname:t.pathname,n=[],r.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,(function(t){"/.."===t?n.pop():n.push(t)})),n.join("").replace(/^\//,"/"===r.charAt(0)?"/":""))+(e.protocol||e.authority||e.pathname?e.search:e.search||t.search)+e.hash:null;var r,n}function m(t){return t.split("#")[0]}function g(t,e){if(t&&"object"==typeof t)if(void 0===e?e=t.id:"string"==typeof t.id&&(e=p(e,t.id),t.id=e),Array.isArray(t))for(var r=0;r<t.length;r++)g(t[r],e);else for(var n in"string"==typeof t.$ref&&(t.$ref=p(e,t.$ref)),t)"enum"!==n&&g(t[n],e)}function y(t){var e=M[t=t||"en"];return function(t){var r=e[t.code]||b[t.code];if("string"!=typeof r)return"Unknown error code "+t.code+": "+JSON.stringify(t.messageParams);var n=t.params;return r.replace(/\{([^{}]*)\}/g,(function(t,e){var r=n[e];return"string"==typeof r||"number"==typeof r?r:t}))}}u.prototype.validateMultipleOf=function(t,e){var r=e.multipleOf||e.divisibleBy;if(void 0===r)return null;if("number"==typeof t){var n=t/r%1;if(n>=h&&n<d)return this.createError(v.NUMBER_MULTIPLE_OF,{value:t,multipleOf:r},"","",null,t,e)}return null},u.prototype.validateMinMax=function(t,e){if("number"!=typeof t)return null;if(void 0!==e.minimum){if(t<e.minimum)return this.createError(v.NUMBER_MINIMUM,{value:t,minimum:e.minimum},"","/minimum",null,t,e);if(e.exclusiveMinimum&&t===e.minimum)return this.createError(v.NUMBER_MINIMUM_EXCLUSIVE,{value:t,minimum:e.minimum},"","/exclusiveMinimum",null,t,e)}if(void 0!==e.maximum){if(t>e.maximum)return this.createError(v.NUMBER_MAXIMUM,{value:t,maximum:e.maximum},"","/maximum",null,t,e);if(e.exclusiveMaximum&&t===e.maximum)return this.createError(v.NUMBER_MAXIMUM_EXCLUSIVE,{value:t,maximum:e.maximum},"","/exclusiveMaximum",null,t,e)}return null},u.prototype.validateNaN=function(t,e){return"number"!=typeof t?null:!0===isNaN(t)||t===1/0||t===-1/0?this.createError(v.NUMBER_NOT_A_NUMBER,{value:t},"","/type",null,t,e):null},u.prototype.validateString=function(t,e,r){return this.validateStringLength(t,e,r)||this.validateStringPattern(t,e,r)||null},u.prototype.validateStringLength=function(t,e){return"string"!=typeof t?null:void 0!==e.minLength&&t.length<e.minLength?this.createError(v.STRING_LENGTH_SHORT,{length:t.length,minimum:e.minLength},"","/minLength",null,t,e):void 0!==e.maxLength&&t.length>e.maxLength?this.createError(v.STRING_LENGTH_LONG,{length:t.length,maximum:e.maxLength},"","/maxLength",null,t,e):null},u.prototype.validateStringPattern=function(t,e){if("string"!=typeof t||"string"!=typeof e.pattern&&!(e.pattern instanceof RegExp))return null;var r;if(e.pattern instanceof RegExp)r=e.pattern;else{var n,a="",i=e.pattern.match(/^\/(.+)\/([img]*)$/);i?(n=i[1],a=i[2]):n=e.pattern,r=new RegExp(n,a)}return r.test(t)?null:this.createError(v.STRING_PATTERN,{pattern:e.pattern},"","/pattern",null,t,e)},u.prototype.validateArray=function(t,e,r){return Array.isArray(t)&&(this.validateArrayLength(t,e,r)||this.validateArrayUniqueItems(t,e,r)||this.validateArrayItems(t,e,r))||null},u.prototype.validateArrayLength=function(t,e){var r;return void 0!==e.minItems&&t.length<e.minItems&&(r=this.createError(v.ARRAY_LENGTH_SHORT,{length:t.length,minimum:e.minItems},"","/minItems",null,t,e),this.handleError(r))||void 0!==e.maxItems&&t.length>e.maxItems&&(r=this.createError(v.ARRAY_LENGTH_LONG,{length:t.length,maximum:e.maxItems},"","/maxItems",null,t,e),this.handleError(r))?r:null},u.prototype.validateArrayUniqueItems=function(t,e){if(e.uniqueItems)for(var r=0;r<t.length;r++)for(var n=r+1;n<t.length;n++)if(c(t[r],t[n])){var a=this.createError(v.ARRAY_UNIQUE,{match1:r,match2:n},"","/uniqueItems",null,t,e);if(this.handleError(a))return a}return null},u.prototype.validateArrayItems=function(t,e,r){if(void 0===e.items)return null;var n,a;if(Array.isArray(e.items)){for(a=0;a<t.length;a++)if(a<e.items.length){if(n=this.validateAll(t[a],e.items[a],[a],["items",a],r+"/"+a))return n}else if(void 0!==e.additionalItems)if("boolean"==typeof e.additionalItems){if(!e.additionalItems&&(n=this.createError(v.ARRAY_ADDITIONAL_ITEMS,{},"/"+a,"/additionalItems",null,t,e),this.handleError(n)))return n}else if(n=this.validateAll(t[a],e.additionalItems,[a],["additionalItems"],r+"/"+a))return n}else for(a=0;a<t.length;a++)if(n=this.validateAll(t[a],e.items,[a],["items"],r+"/"+a))return n;return null},u.prototype.validateObject=function(t,e,r){return"object"!=typeof t||null===t||Array.isArray(t)?null:this.validateObjectMinMaxProperties(t,e,r)||this.validateObjectRequiredProperties(t,e,r)||this.validateObjectProperties(t,e,r)||this.validateObjectDependencies(t,e,r)||null},u.prototype.validateObjectMinMaxProperties=function(t,e){var r,n=Object.keys(t);return void 0!==e.minProperties&&n.length<e.minProperties&&(r=this.createError(v.OBJECT_PROPERTIES_MINIMUM,{propertyCount:n.length,minimum:e.minProperties},"","/minProperties",null,t,e),this.handleError(r))||void 0!==e.maxProperties&&n.length>e.maxProperties&&(r=this.createError(v.OBJECT_PROPERTIES_MAXIMUM,{propertyCount:n.length,maximum:e.maxProperties},"","/maxProperties",null,t,e),this.handleError(r))?r:null},u.prototype.validateObjectRequiredProperties=function(t,e){if(void 0!==e.required)for(var r=0;r<e.required.length;r++){var n=e.required[r];if(void 0===t[n]){var a=this.createError(v.OBJECT_REQUIRED,{key:n},"","/required/"+r,null,t,e);if(this.handleError(a))return a}}return null},u.prototype.validateObjectProperties=function(t,e,r){var n;for(var a in t){var i=r+"/"+a.replace(/~/g,"~0").replace(/\//g,"~1"),o=!1;if(void 0!==e.properties&&void 0!==e.properties[a]&&(o=!0,n=this.validateAll(t[a],e.properties[a],[a],["properties",a],i)))return n;if(void 0!==e.patternProperties)for(var s in e.patternProperties)if(new RegExp(s).test(a)&&(o=!0,n=this.validateAll(t[a],e.patternProperties[s],[a],["patternProperties",s],i)))return n;if(o)this.trackUnknownProperties&&(this.knownPropertyPaths[i]=!0,delete this.unknownPropertyPaths[i]);else if(void 0!==e.additionalProperties){if(this.trackUnknownProperties&&(this.knownPropertyPaths[i]=!0,delete this.unknownPropertyPaths[i]),"boolean"==typeof e.additionalProperties){if(!e.additionalProperties&&(n=this.createError(v.OBJECT_ADDITIONAL_PROPERTIES,{key:a},"","/additionalProperties",null,t,e).prefixWith(a,null),this.handleError(n)))return n}else if(n=this.validateAll(t[a],e.additionalProperties,[a],["additionalProperties"],i))return n}else this.trackUnknownProperties&&!this.knownPropertyPaths[i]&&(this.unknownPropertyPaths[i]=!0)}return null},u.prototype.validateObjectDependencies=function(t,e,r){var n;if(void 0!==e.dependencies)for(var a in e.dependencies)if(void 0!==t[a]){var i=e.dependencies[a];if("string"==typeof i){if(void 0===t[i]&&(n=this.createError(v.OBJECT_DEPENDENCY_KEY,{key:a,missing:i},"","",null,t,e).prefixWith(null,a).prefixWith(null,"dependencies"),this.handleError(n)))return n}else if(Array.isArray(i))for(var o=0;o<i.length;o++){var s=i[o];if(void 0===t[s]&&(n=this.createError(v.OBJECT_DEPENDENCY_KEY,{key:a,missing:s},"","/"+o,null,t,e).prefixWith(null,a).prefixWith(null,"dependencies"),this.handleError(n)))return n}else if(n=this.validateAll(t,i,[],["dependencies",a],r))return n}return null},u.prototype.validateCombinations=function(t,e,r){return this.validateAllOf(t,e,r)||this.validateAnyOf(t,e,r)||this.validateOneOf(t,e,r)||this.validateNot(t,e,r)||null},u.prototype.validateAllOf=function(t,e,r){if(void 0===e.allOf)return null;for(var n,a=0;a<e.allOf.length;a++){var i=e.allOf[a];if(n=this.validateAll(t,i,[],["allOf",a],r))return n}return null},u.prototype.validateAnyOf=function(t,e,r){if(void 0===e.anyOf)return null;var n,a,i=[],o=this.errors.length;this.trackUnknownProperties&&(n=this.unknownPropertyPaths,a=this.knownPropertyPaths);for(var s=!0,l=0;l<e.anyOf.length;l++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var u=e.anyOf[l],c=this.errors.length,h=this.validateAll(t,u,[],["anyOf",l],r);if(null===h&&c===this.errors.length){if(this.errors=this.errors.slice(0,o),this.trackUnknownProperties){for(var d in this.knownPropertyPaths)a[d]=!0,delete n[d];for(var f in this.unknownPropertyPaths)a[f]||(n[f]=!0);s=!1;continue}return null}h&&i.push(h.prefixWith(null,""+l).prefixWith(null,"anyOf"))}return this.trackUnknownProperties&&(this.unknownPropertyPaths=n,this.knownPropertyPaths=a),s?(i=i.concat(this.errors.slice(o)),this.errors=this.errors.slice(0,o),this.createError(v.ANY_OF_MISSING,{},"","/anyOf",i,t,e)):void 0},u.prototype.validateOneOf=function(t,e,r){if(void 0===e.oneOf)return null;var n,a,i=null,o=[],s=this.errors.length;this.trackUnknownProperties&&(n=this.unknownPropertyPaths,a=this.knownPropertyPaths);for(var l=0;l<e.oneOf.length;l++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var u=e.oneOf[l],c=this.errors.length,h=this.validateAll(t,u,[],["oneOf",l],r);if(null===h&&c===this.errors.length){if(null!==i)return this.errors=this.errors.slice(0,s),this.createError(v.ONE_OF_MULTIPLE,{index1:i,index2:l},"","/oneOf",null,t,e);if(i=l,this.trackUnknownProperties){for(var d in this.knownPropertyPaths)a[d]=!0,delete n[d];for(var f in this.unknownPropertyPaths)a[f]||(n[f]=!0)}}else h&&o.push(h)}return this.trackUnknownProperties&&(this.unknownPropertyPaths=n,this.knownPropertyPaths=a),null===i?(o=o.concat(this.errors.slice(s)),this.errors=this.errors.slice(0,s),this.createError(v.ONE_OF_MISSING,{},"","/oneOf",o,t,e)):(this.errors=this.errors.slice(0,s),null)},u.prototype.validateNot=function(t,e,r){if(void 0===e.not)return null;var n,a,i=this.errors.length;this.trackUnknownProperties&&(n=this.unknownPropertyPaths,a=this.knownPropertyPaths,this.unknownPropertyPaths={},this.knownPropertyPaths={});var o=this.validateAll(t,e.not,null,null,r),s=this.errors.slice(i);return this.errors=this.errors.slice(0,i),this.trackUnknownProperties&&(this.unknownPropertyPaths=n,this.knownPropertyPaths=a),null===o&&0===s.length?this.createError(v.NOT_PASSED,{},"","/not",null,t,e):null},u.prototype.validateHypermedia=function(t,e,r){if(!e.links)return null;for(var n,a=0;a<e.links.length;a++){var i=e.links[a];if("describedby"===i.rel){for(var o=new l(i.href),s=!0,u=0;u<o.varNames.length;u++)if(!(o.varNames[u]in t)){s=!1;break}if(s){var c={$ref:o.fillFromObject(t)};if(n=this.validateAll(t,c,[],["links",a],r))return n}}}};var v={INVALID_TYPE:0,ENUM_MISMATCH:1,ANY_OF_MISSING:10,ONE_OF_MISSING:11,ONE_OF_MULTIPLE:12,NOT_PASSED:13,NUMBER_MULTIPLE_OF:100,NUMBER_MINIMUM:101,NUMBER_MINIMUM_EXCLUSIVE:102,NUMBER_MAXIMUM:103,NUMBER_MAXIMUM_EXCLUSIVE:104,NUMBER_NOT_A_NUMBER:105,STRING_LENGTH_SHORT:200,STRING_LENGTH_LONG:201,STRING_PATTERN:202,OBJECT_PROPERTIES_MINIMUM:300,OBJECT_PROPERTIES_MAXIMUM:301,OBJECT_REQUIRED:302,OBJECT_ADDITIONAL_PROPERTIES:303,OBJECT_DEPENDENCY_KEY:304,ARRAY_LENGTH_SHORT:400,ARRAY_LENGTH_LONG:401,ARRAY_UNIQUE:402,ARRAY_ADDITIONAL_ITEMS:403,FORMAT_CUSTOM:500,KEYWORD_CUSTOM:501,CIRCULAR_REFERENCE:600,UNKNOWN_PROPERTY:1e3},_={};for(var x in v)_[v[x]]=x;var b={INVALID_TYPE:"Invalid type: {type} (expected {expected})",ENUM_MISMATCH:"No enum match for: {value}",ANY_OF_MISSING:'Data does not match any schemas from "anyOf"',ONE_OF_MISSING:'Data does not match any schemas from "oneOf"',ONE_OF_MULTIPLE:'Data is valid against more than one schema from "oneOf": indices {index1} and {index2}',NOT_PASSED:'Data matches schema from "not"',NUMBER_MULTIPLE_OF:"Value {value} is not a multiple of {multipleOf}",NUMBER_MINIMUM:"Value {value} is less than minimum {minimum}",NUMBER_MINIMUM_EXCLUSIVE:"Value {value} is equal to exclusive minimum {minimum}",NUMBER_MAXIMUM:"Value {value} is greater than maximum {maximum}",NUMBER_MAXIMUM_EXCLUSIVE:"Value {value} is equal to exclusive maximum {maximum}",NUMBER_NOT_A_NUMBER:"Value {value} is not a valid number",STRING_LENGTH_SHORT:"String is too short ({length} chars), minimum {minimum}",STRING_LENGTH_LONG:"String is too long ({length} chars), maximum {maximum}",STRING_PATTERN:"String does not match pattern: {pattern}",OBJECT_PROPERTIES_MINIMUM:"Too few properties defined ({propertyCount}), minimum {minimum}",OBJECT_PROPERTIES_MAXIMUM:"Too many properties defined ({propertyCount}), maximum {maximum}",OBJECT_REQUIRED:"Missing required property: {key}",OBJECT_ADDITIONAL_PROPERTIES:"Additional properties not allowed",OBJECT_DEPENDENCY_KEY:"Dependency failed - key must exist: {missing} (due to key: {key})",ARRAY_LENGTH_SHORT:"Array is too short ({length}), minimum {minimum}",ARRAY_LENGTH_LONG:"Array is too long ({length}), maximum {maximum}",ARRAY_UNIQUE:"Array items are not unique (indices {match1} and {match2})",ARRAY_ADDITIONAL_ITEMS:"Additional items not allowed",FORMAT_CUSTOM:"Format validation failed ({message})",KEYWORD_CUSTOM:"Keyword failed: {key} ({message})",CIRCULAR_REFERENCE:"Circular $refs: {urls}",UNKNOWN_PROPERTY:"Unknown property (not in schema)"};function w(t,e,r,n,a){if(Error.call(this),void 0===t)throw new Error("No error code supplied: "+n);this.message="",this.params=e,this.code=t,this.dataPath=r||"",this.schemaPath=n||"",this.subErrors=a||null;var i=new Error(this.message);if(this.stack=i.stack||i.stacktrace,!this.stack)try{throw i}catch(i){this.stack=i.stack||i.stacktrace}}w.prototype=Object.create(Error.prototype),w.prototype.constructor=w,w.prototype.name="ValidationError",w.prototype.prefixWith=function(t,e){if(null!==t&&(t=t.replace(/~/g,"~0").replace(/\//g,"~1"),this.dataPath="/"+t+this.dataPath),null!==e&&(e=e.replace(/~/g,"~0").replace(/\//g,"~1"),this.schemaPath="/"+e+this.schemaPath),null!==this.subErrors)for(var r=0;r<this.subErrors.length;r++)this.subErrors[r].prefixWith(t,e);return this};var M={};var k=function t(e){var r,n,a=new u,i={setErrorReporter:function(t){return"string"==typeof t?this.language(t):(n=t,!0)},addFormat:function(){a.addFormat.apply(a,arguments)},language:function(t){return t?(M[t]||(t=t.split("-")[0]),!!M[t]&&(r=t,t)):r},addLanguage:function(t,e){var r;for(r in v)e[r]&&!e[v[r]]&&(e[v[r]]=e[r]);var n=t.split("-")[0];if(M[n])for(r in M[t]=Object.create(M[n]),e)void 0===M[n][r]&&(M[n][r]=e[r]),M[t][r]=e[r];else M[t]=e,M[n]=e;return this},freshApi:function(e){var r=t();return e&&r.language(e),r},validate:function(t,e,i,o){var s=y(r),l=n?function(t,e,r){return n(t,e,r)||s(t,e,r)}:s,c=new u(a,!1,l,i,o);"string"==typeof e&&(e={$ref:e}),c.addSchema("",e);var h=c.validateAll(t,e,null,null,"");return!h&&o&&(h=c.banUnknownProperties(t,e)),this.error=h,this.missing=c.missing,this.valid=null===h,this.valid},validateResult:function(){var t={toString:function(){return this.valid?"valid":this.error.message}};return this.validate.apply(t,arguments),t},validateMultiple:function(t,e,i,o){var s=y(r),l=n?function(t,e,r){return n(t,e,r)||s(t,e,r)}:s,c=new u(a,!0,l,i,o);"string"==typeof e&&(e={$ref:e}),c.addSchema("",e),c.validateAll(t,e,null,null,""),o&&c.banUnknownProperties(t,e);var h={toString:function(){return this.valid?"valid":this.error.message}};return h.errors=c.errors,h.missing=c.missing,h.valid=0===h.errors.length,h},addSchema:function(){return a.addSchema.apply(a,arguments)},getSchema:function(){return a.getSchema.apply(a,arguments)},getSchemaMap:function(){return a.getSchemaMap.apply(a,arguments)},getSchemaUris:function(){return a.getSchemaUris.apply(a,arguments)},getMissingUris:function(){return a.getMissingUris.apply(a,arguments)},dropSchemas:function(){a.dropSchemas.apply(a,arguments)},defineKeyword:function(){a.defineKeyword.apply(a,arguments)},defineError:function(t,e,r){if("string"!=typeof t||!/^[A-Z]+(_[A-Z]+)*$/.test(t))throw new Error("Code name must be a string in UPPER_CASE_WITH_UNDERSCORES");if("number"!=typeof e||e%1!=0||e<1e4)throw new Error("Code number must be an integer > 10000");if(void 0!==v[t])throw new Error("Error already defined: "+t+" as "+v[t]);if(void 0!==_[e])throw new Error("Error code already used: "+_[e]+" as "+e);for(var n in v[t]=e,_[e]=t,b[t]=b[e]=r,M){var a=M[n];a[t]&&(a[e]=a[e]||a[t])}},reset:function(){a.reset(),this.error=null,this.missing=[],this.valid=!0},missing:[],error:null,valid:!0,normSchema:g,resolveUrl:p,getDocumentUri:m,errorCodes:v};return i.language(e||"en"),i}();return k.addLanguage("en-gb",b),k.tv4=k,k},void 0===(n=r.apply(e,[]))||(t.exports=n)},25550:(t,e,r)=>{t.exports=r(99785)},64836:t=>{t.exports=function(t){return t&&t.__esModule?t:{default:t}},t.exports.__esModule=!0,t.exports.default=t.exports},90344:t=>{t.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","id":"https://raw.githubusercontent.com/fge/sample-json-schemas/master/geojson/geojson.json#","title":"Geo JSON object","description":"Schema for a Geo JSON object","type":"object","required":["type"],"properties":{"crs":{"$ref":"#/definitions/crs"},"bbox":{"$ref":"#/definitions/bbox"}},"oneOf":[{"$ref":"#/definitions/geometry"},{"$ref":"#/definitions/geometryCollection"},{"$ref":"#/definitions/feature"},{"$ref":"#/definitions/featureCollection"}],"definitions":{"geometryCollection":{"title":"GeometryCollection","description":"A collection of geometry objects","required":["geometries"],"properties":{"type":{"enum":["GeometryCollection"]},"geometries":{"type":"array","items":{"$ref":"#/definitions/geometry"}}}},"feature":{"title":"Feature","description":"A Geo JSON feature object","required":["geometry","properties"],"properties":{"type":{"enum":["Feature"]},"geometry":{"oneOf":[{"type":"null"},{"$ref":"#/definitions/geometry"}]},"properties":{"type":["object","null"]},"id":{"FIXME":"may be there, type not known (string? number?)"}}},"featureCollection":{"title":"FeatureCollection","description":"A Geo JSON feature collection","required":["features"],"properties":{"type":{"enum":["FeatureCollection"]},"features":{"type":"array","items":{"$ref":"#/definitions/feature"}}}},"geometry":{"title":"geometry","description":"One geometry as defined by GeoJSON","type":"object","required":["type","coordinates"],"oneOf":[{"title":"Point","properties":{"type":{"enum":["Point"]},"coordinates":{"$ref":"#/definitions/geometry/definitions/position"}}},{"title":"MultiPoint","properties":{"type":{"enum":["MultiPoint"]},"coordinates":{"$ref":"#/definitions/geometry/definitions/positionArray"}}},{"title":"LineString","properties":{"type":{"enum":["LineString"]},"coordinates":{"$ref":"#/definitions/geometry/definitions/lineString"}}},{"title":"MultiLineString","properties":{"type":{"enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"$ref":"#/definitions/geometry/definitions/lineString"}}}},{"title":"Polygon","properties":{"type":{"enum":["Polygon"]},"coordinates":{"$ref":"#/definitions/geometry/definitions/polygon"}}},{"title":"MultiPolygon","properties":{"type":{"enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"$ref":"#/definitions/geometry/definitions/polygon"}}}}],"definitions":{"position":{"description":"A single position","type":"array","minItems":2,"items":[{"type":"number"},{"type":"number"}],"additionalItems":false},"positionArray":{"description":"An array of positions","type":"array","items":{"$ref":"#/definitions/geometry/definitions/position"}},"lineString":{"description":"An array of two or more positions","allOf":[{"$ref":"#/definitions/geometry/definitions/positionArray"},{"minItems":2}]},"linearRing":{"description":"An array of four positions where the first equals the last","allOf":[{"$ref":"#/definitions/geometry/definitions/positionArray"},{"minItems":4}]},"polygon":{"description":"An array of linear rings","type":"array","items":{"$ref":"#/definitions/geometry/definitions/linearRing"}}}},"crs":{"title":"crs","description":"a Coordinate Reference System object","type":["object","null"],"required":["type","properties"],"properties":{"type":{"type":"string"},"properties":{"type":"object"}},"additionalProperties":false,"oneOf":[{"$ref":"#/definitions/crs/definitions/namedCrs"},{"$ref":"#/definitions/crs/definitions/linkedCrs"}],"definitions":{"namedCrs":{"properties":{"type":{"enum":["name"]},"properties":{"required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","FIXME":"semantic validation necessary"}}}}},"linkedObject":{"type":"object","required":["href"],"properties":{"href":{"type":"string","format":"uri","FIXME":"spec says \\"dereferenceable\\", cannot enforce that"},"type":{"type":"string","description":"Suggested values: proj4, ogjwkt, esriwkt"}}},"linkedCrs":{"properties":{"type":{"enum":["link"]},"properties":{"$ref":"#/definitions/crs/definitions/linkedObject"}}}}},"bbox":{"description":"A bounding box as defined by GeoJSON","FIXME":"unenforceable constraint: even number of elements in array","type":"array","items":{"type":"number"}}}}')}}]);
//# sourceMappingURL=161.bundle.js.map