-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplotly-basic.min.js
7 lines (7 loc) · 854 KB
/
plotly-basic.min.js
1
2
3
4
5
6
7
/**
* plotly.js (basic - minified) v1.52.3
* Copyright 2012-2020, Plotly, Inc.
* All rights reserved.
* Licensed under the MIT license
*/
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Plotly=t()}}(function(){return function(){return function t(e,r,n){function a(o,l){if(!r[o]){if(!e[o]){var s="function"==typeof require&&require;if(!l&&s)return s(o,!0);if(i)return i(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}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="function"==typeof require&&require,o=0;o<n.length;o++)a(n[o]);return a}}()({1:[function(t,e,r){"use strict";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":159}],2:[function(t,e,r){"use strict";e.exports=t("../src/traces/bar")},{"../src/traces/bar":261}],3:[function(t,e,r){"use strict";e.exports=t("../src/core")},{"../src/core":141}],4:[function(t,e,r){"use strict";var n=t("./core");n.register([t("./bar"),t("./pie")]),e.exports=n},{"./bar":2,"./core":3,"./pie":5}],5:[function(t,e,r){"use strict";e.exports=t("../src/traces/pie")},{"../src/traces/pie":276}],6:[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 l,s=10;try{var c={};Object.defineProperty&&Object.defineProperty(c,"x",{value:0}),l=0===c.x}catch(t){l=!1}function u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function f(t,e,r,a){var i,o,l;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),l=o[e]):(o=t._events=n(null),t._eventsCount=0),l){if("function"==typeof l?l=o[e]=a?[r,l]:[l,r]:a?l.unshift(r):l.push(r),!l.warned&&(i=u(t))&&i>0&&l.length>i){l.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+l.length+' "'+String(e)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');s.name="MaxListenersExceededWarning",s.emitter=t,s.type=e,s.count=l.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",s.name,s.message)}}else l=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 p(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 h(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):v(a,a.length):[]}function g(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 v(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}l?Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(t){if("number"!=typeof t||t<0||t!=t)throw new TypeError('"defaultMaxListeners" must be a positive number');s=t}}):o.defaultMaxListeners=s,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 u(this)},o.prototype.emit=function(t){var e,r,n,a,i,o,l="error"===t;if(o=this._events)l=l&&null==o.error;else if(!l)return!1;if(l){if(arguments.length>1&&(e=arguments[1]),e instanceof Error)throw e;var s=new Error('Unhandled "error" event. ('+e+")");throw s.context=e,s}if(!(r=o[t]))return!1;var c="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=v(t,n),i=0;i<n;++i)a[i].call(r)}(r,c,this);break;case 2:!function(t,e,r,n){if(e)t.call(r,n);else for(var a=t.length,i=v(t,a),o=0;o<a;++o)i[o].call(r,n)}(r,c,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=v(t,i),l=0;l<i;++l)o[l].call(r,n,a)}(r,c,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,l=v(t,o),s=0;s<o;++s)l[s].call(r,n,a,i)}(r,c,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=v(t,a),o=0;o<a;++o)i[o].apply(r,n)}(r,c,this,a)}return!0},o.prototype.addListener=function(t,e){return f(this,t,e,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(t,e){return f(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,p(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,p(this,t,e)),this},o.prototype.removeListener=function(t,e){var r,a,i,o,l;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){l=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,l||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,l=a(r);for(i=0;i<l.length;++i)"removeListener"!==(o=l[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 h(this,t,!0)},o.prototype.rawListeners=function(t){return h(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):g.call(t,e)},o.prototype.listenerCount=g,o.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],7:[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 l=this.Element.prototype,s=l.setAttribute,c=l.setAttributeNS,u=this.CSSStyleDeclaration.prototype,f=u.setProperty;l.setAttribute=function(t,e){s.call(this,t,e+"")},l.setAttributeNS=function(t,e,r){c.call(this,t,e,r+"")},u.setProperty=function(t,e,r){f.call(this,t,e+"",r)}}function d(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function p(t){return null===t?NaN:+t}function h(t){return!isNaN(t)}function g(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;)h(r=+t[i])&&(n+=r);else for(;++i<a;)h(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;)h(r=p(t[i]))?n+=r:--o;else for(;++i<a;)h(r=p(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;)h(n=p(e[o]))&&a.push(n);else for(;++o<i;)h(n=p(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,l=-1,s=0;if(1===arguments.length)for(;++l<a;)h(r=p(t[l]))&&(o+=(n=r-i)*(r-(i+=n/++s)));else for(;++l<a;)h(r=p(e.call(t,t[l],l)))&&(o+=(n=r-i)*(r-(i+=n/++s)));if(s>1)return o/(s-1)},t.deviation=function(){var e=t.variance.apply(this,arguments);return e?Math.sqrt(e):e};var v=g(d);function m(t){return t.length}t.bisectLeft=v.left,t.bisect=t.bisectRight=v.right,t.bisector=function(t){return g(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,m),a=new Array(n);++r<n;)for(var i,o=-1,l=a[r]=new Array(i);++o<i;)l[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 y=Math.abs;function x(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function b(){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){var e=1;for(;t*e%1;)e*=10;return e}(y(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 b;if(t instanceof b)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};var _="__proto__",w="\0";function k(t){return(t+="")===_||t[0]===w?w+t:t}function T(t){return(t+="")[0]===w?t.slice(1):t}function M(t){return k(t)in this._}function A(t){return(t=k(t))in this._&&delete this._[t]}function L(){var t=[];for(var e in this._)t.push(T(e));return t}function S(){var t=0;for(var e in this._)++t;return t}function C(){for(var t in this._)return!1;return!0}function O(){this._=Object.create(null)}function P(t){return t}function D(t,e,r){return function(){var n=r.apply(e,arguments);return n===e?t:n}}function z(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=R.length;r<n;++r){var a=R[r]+e;if(a in t)return a}}x(b,{has:M,get:function(t){return this._[k(t)]},set:function(t,e){return this._[k(t)]=e},remove:A,keys:L,values:function(){var t=[];for(var e in this._)t.push(this._[e]);return t},entries:function(){var t=[];for(var e in this._)t.push({key:T(e),value:this._[e]});return t},size:S,empty:C,forEach:function(t){for(var e in this._)t.call(this,T(e),this._[e])}}),t.nest=function(){var e,r,n={},a=[],i=[];function o(t,i,l){if(l>=a.length)return r?r.call(n,i):e?i.sort(e):i;for(var s,c,u,f,d=-1,p=i.length,h=a[l++],g=new b;++d<p;)(f=g.get(s=h(c=i[d])))?f.push(c):g.set(s,[c]);return t?(c=t(),u=function(e,r){c.set(e,o(t,r,l))}):(c={},u=function(e,r){c[e]=o(t,r,l)}),g.forEach(u),c}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 O;if(t)for(var r=0,n=t.length;r<n;++r)e.add(t[r]);return e},x(O,{has:M,add:function(t){return this._[k(t+="")]=!0,t},remove:A,values:L,size:S,empty:C,forEach:function(t){for(var e in this._)t.call(this,T(e))}}),t.behavior={},t.rebind=function(t,e){for(var r,n=1,a=arguments.length;++n<a;)t[r=arguments[n]]=D(t,e,e[r]);return t};var R=["webkit","ms","moz","Moz","o","O"];function E(){}function I(){}function F(t){var e=[],r=new b;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 N(){t.event.preventDefault()}function j(){for(var e,r=t.event;e=r.sourceEvent;)r=e;return r}function B(e){for(var r=new I,n=0,a=arguments.length;++n<a;)r[arguments[n]]=F(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 I,e=-1,r=arguments.length;++e<r;)t[arguments[e]]=F(t);return t},I.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(H,"\\$&")};var H=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,V={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function q(t){return V(t,X),t}var U=function(t,e){return e.querySelector(t)},G=function(t,e){return e.querySelectorAll(t)},Z=function(t,e){var r=t.matches||t[z(t,"matchesSelector")];return(Z=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(U=function(t,e){return Sizzle(t,e)[0]||null},G=Sizzle,Z=Sizzle.matchesSelector),t.selection=function(){return t.select(a.documentElement)};var X=t.selection.prototype=[];function Y(t){return"function"==typeof t?t:function(){return U(t,this)}}function W(t){return"function"==typeof t?t:function(){return G(t,this)}}X.select=function(t){var e,r,n,a,i=[];t=Y(t);for(var o=-1,l=this.length;++o<l;){i.push(e=[]),e.parentNode=(n=this[o]).parentNode;for(var s=-1,c=n.length;++s<c;)(a=n[s])?(e.push(r=t.call(a,a.__data__,s,o)),r&&"__data__"in a&&(r.__data__=a.__data__)):e.push(null)}return q(i)},X.selectAll=function(t){var e,r,a=[];t=W(t);for(var i=-1,o=this.length;++i<o;)for(var l=this[i],s=-1,c=l.length;++s<c;)(r=l[s])&&(a.push(e=n(t.call(r,r.__data__,s,i))),e.parentNode=r);return q(a)};var $="http://www.w3.org/1999/xhtml",Q={svg:"http://www.w3.org/2000/svg",xhtml:$,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 tt(e){return new RegExp("(?:^|\\s+)"+t.requote(e)+"(?:\\s+|$)","g")}function et(t){return(t+"").trim().split(/^|\s+/)}function rt(t,e){var r=(t=et(t).map(nt)).length;return"function"==typeof e?function(){for(var n=-1,a=e.apply(this,arguments);++n<r;)t[n](this,a)}:function(){for(var n=-1;++n<r;)t[n](this,e)}}function nt(t){var e=tt(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 at(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 it(t,e){return null==e?function(){delete this[t]}:"function"==typeof e?function(){var r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}:function(){this[t]=e}}function ot(e){return"function"==typeof e?e:(e=t.ns.qualify(e)).local?function(){return this.ownerDocument.createElementNS(e.space,e.local)}:function(){var t=this.ownerDocument,r=this.namespaceURI;return r===$&&t.documentElement.namespaceURI===$?t.createElement(e):t.createElementNS(r,e)}}function lt(){var t=this.parentNode;t&&t.removeChild(this)}function st(t){return{__data__:t}}function ct(t){return function(){return Z(this,t)}}function ut(t,e){for(var r=0,n=t.length;r<n;r++)for(var a,i=t[r],o=0,l=i.length;o<l;o++)(a=i[o])&&e(a,o,r);return t}function ft(t){return V(t,dt),t}t.ns={prefix:Q,qualify:function(t){var e=t.indexOf(":"),r=t;return e>=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),Q.hasOwnProperty(r)?{space:Q[r],local:t}:t}},X.attr=function(e,r){if(arguments.length<2){if("string"==typeof e){var n=this.node();return(e=t.ns.qualify(e)).local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(r in e)this.each(J(r,e[r]));return this}return this.each(J(e,r))},X.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=et(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(!tt(t[a]).test(e))return!1;return!0}for(e in t)this.each(rt(e,t[e]));return this}return this.each(rt(t,e))},X.style=function(t,e,r){var n=arguments.length;if(n<3){if("string"!=typeof t){for(r in n<2&&(e=""),t)this.each(at(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(at(t,e,r))},X.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(it(e,t[e]));return this}return this.each(it(t,e))},X.text=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}:null==t?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent},X.html=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML},X.append=function(t){return t=ot(t),this.select(function(){return this.appendChild(t.apply(this,arguments))})},X.insert=function(t,e){return t=ot(t),e=Y(e),this.select(function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)})},X.remove=function(){return this.each(lt)},X.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,u=r.length,f=Math.min(o,u),d=new Array(u),p=new Array(u),h=new Array(o);if(e){var g,v=new b,m=new Array(o);for(n=-1;++n<o;)(a=t[n])&&(v.has(g=e.call(a,a.__data__,n))?h[n]=a:v.set(g,a),m[n]=g);for(n=-1;++n<u;)(a=v.get(g=e.call(r,i=r[n],n)))?!0!==a&&(d[n]=a,a.__data__=i):p[n]=st(i),v.set(g,!0);for(n=-1;++n<o;)n in m&&!0!==v.get(m[n])&&(h[n]=t[n])}else{for(n=-1;++n<f;)a=t[n],i=r[n],a?(a.__data__=i,d[n]=a):p[n]=st(i);for(;n<u;++n)p[n]=st(r[n]);for(;n<o;++n)h[n]=t[n]}p.update=d,p.parentNode=d.parentNode=h.parentNode=t.parentNode,l.push(p),s.push(d),c.push(h)}var l=ft([]),s=q([]),c=q([]);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 s.enter=function(){return l},s.exit=function(){return c},s},X.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")},X.filter=function(t){var e,r,n,a=[];"function"!=typeof t&&(t=ct(t));for(var i=0,o=this.length;i<o;i++){a.push(e=[]),e.parentNode=(r=this[i]).parentNode;for(var l=0,s=r.length;l<s;l++)(n=r[l])&&t.call(n,n.__data__,l,i)&&e.push(n)}return q(a)},X.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},X.sort=function(t){t=function(t){arguments.length||(t=d);return function(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}}.apply(this,arguments);for(var e=-1,r=this.length;++e<r;)this[e].sort(t);return this.order()},X.each=function(t){return ut(this,function(e,r,n){t.call(e,e.__data__,r,n)})},X.call=function(t){var e=n(arguments);return t.apply(e[0]=this,e),this},X.empty=function(){return!this.node()},X.node=function(){for(var t=0,e=this.length;t<e;t++)for(var r=this[t],n=0,a=r.length;n<a;n++){var i=r[n];if(i)return i}return null},X.size=function(){var t=0;return ut(this,function(){++t}),t};var dt=[];function pt(e,r,a){var i="__on"+e,o=e.indexOf("."),l=gt;o>0&&(e=e.slice(0,o));var s=ht.get(e);function c(){var t=this[i];t&&(this.removeEventListener(e,t,t.$),delete this[i])}return s&&(e=s,l=vt),o?r?function(){var t=l(r,n(arguments));c.call(this),this.addEventListener(e,this[i]=t,t.$=a),t._=r}:c:r?E: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=ft,t.selection.enter.prototype=dt,dt.append=X.append,dt.empty=X.empty,dt.node=X.node,dt.call=X.call,dt.size=X.size,dt.select=function(t){for(var e,r,n,a,i,o=[],l=-1,s=this.length;++l<s;){n=(a=this[l]).update,o.push(e=[]),e.parentNode=a.parentNode;for(var c=-1,u=a.length;++c<u;)(i=a[c])?(e.push(n[c]=r=t.call(a.parentNode,i.__data__,c,l)),r.__data__=i.__data__):e.push(null)}return q(o)},dt.insert=function(t,e){var r,n,a;return arguments.length<2&&(r=this,e=function(t,e,i){var o,l=r[i].update,s=l.length;for(i!=a&&(a=i,n=0),e>=n&&(n=e+1);!(o=l[n])&&++n<s;);return o}),X.insert.call(this,t,e)},t.select=function(t){var e;return"string"==typeof t?(e=[U(t,a)]).parentNode=a.documentElement:(e=[t]).parentNode=i(t),q([e])},t.selectAll=function(t){var e;return"string"==typeof t?(e=n(G(t,a))).parentNode=a.documentElement:(e=n(t)).parentNode=null,q([e])},X.on=function(t,e,r){var n=arguments.length;if(n<3){if("string"!=typeof t){for(r in n<2&&(e=!1),t)this.each(pt(r,t[r],e));return this}if(n<2)return(n=this.node()["__on"+t])&&n._;r=!1}return this.each(pt(t,e,r))};var ht=t.map({mouseenter:"mouseover",mouseleave:"mouseout"});function gt(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 vt(t,e){var r=gt(t,e);return function(t){var e=t.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||r.call(this,t)}}a&&ht.forEach(function(t){"on"+t in a&&ht.remove(t)});var mt,yt=0;function xt(e){var r=".dragsuppress-"+ ++yt,n="click"+r,a=t.select(o(e)).on("touchmove"+r,N).on("dragstart"+r,N).on("selectstart"+r,N);if(null==mt&&(mt=!("onselectstart"in e)&&z(e.style,"userSelect")),mt){var l=i(e).style,s=l[mt];l[mt]="none"}return function(t){if(a.on(r,null),mt&&(l[mt]=s),t){var e=function(){a.on(n,null)};a.on(n,function(){N(),e()},!0),setTimeout(e,0)}}}t.mouse=function(t){return _t(t,j())};var bt=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(bt<0){var i=o(e);if(i.scrollX||i.scrollY){var l=(n=t.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important"))[0][0].getScreenCTM();bt=!(l.f||l.e),n.remove()}}return bt?(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 s=e.getBoundingClientRect();return[r.clientX-s.left-e.clientLeft,r.clientY-s.top-e.clientTop]}function wt(){return t.event.changedTouches[0].identifier}t.touch=function(t,e,r){if(arguments.length<3&&(r=e,e=j().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=B(i,"drag","dragstart","dragend"),r=null,n=l(E,t.mouse,o,"mousemove","mouseup"),a=l(wt,t.touch,P,"touchmove","touchend");function i(){this.on("mousedown.drag",n).on("touchstart.drag",a)}function l(n,a,i,o,l){return function(){var s,c=t.event.target.correspondingElement||t.event.target,u=this.parentNode,f=e.of(this,arguments),d=0,p=n(),h=".drag"+(null==p?"":"-"+p),g=t.select(i(c)).on(o+h,function(){var t,e,r=a(u,p);if(!r)return;t=r[0]-m[0],e=r[1]-m[1],d|=t|e,m=r,f({type:"drag",x:r[0]+s[0],y:r[1]+s[1],dx:t,dy:e})}).on(l+h,function(){if(!a(u,p))return;g.on(o+h,null).on(l+h,null),v(d),f({type:"dragend"})}),v=xt(c),m=a(u,p);s=r?[(s=r.apply(this,arguments)).x-m[0],s.y-m[1]]:[0,0],f({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=j().touches),e?n(e).map(function(e){var r=_t(t,e);return r.identifier=e.identifier,r}):[]};var kt=1e-6,Tt=kt*kt,Mt=Math.PI,At=2*Mt,Lt=At-kt,St=Mt/2,Ct=Mt/180,Ot=180/Mt;function Pt(t){return t>0?1:t<0?-1:0}function Dt(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function zt(t){return t>1?0:t<-1?Mt:Math.acos(t)}function Rt(t){return t>1?St:t<-1?-St:Math.asin(t)}function Et(t){return((t=Math.exp(t))+1/t)/2}function It(t){return(t=Math.sin(t/2))*t}var Ft=Math.SQRT2;t.interpolateZoom=function(t,e){var r,n,a=t[0],i=t[1],o=t[2],l=e[0],s=e[1],c=e[2],u=l-a,f=s-i,d=u*u+f*f;if(d<Tt)n=Math.log(c/o)/Ft,r=function(t){return[a+t*u,i+t*f,o*Math.exp(Ft*t*n)]};else{var p=Math.sqrt(d),h=(c*c-o*o+4*d)/(2*o*2*p),g=(c*c-o*o-4*d)/(2*c*2*p),v=Math.log(Math.sqrt(h*h+1)-h),m=Math.log(Math.sqrt(g*g+1)-g);n=(m-v)/Ft,r=function(t){var e,r=t*n,l=Et(v),s=o/(2*p)*(l*(e=Ft*r+v,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(v));return[a+s*u,i+s*f,o*l/Et(Ft*r+v)]}}return r.duration=1e3*n,r},t.behavior.zoom=function(){var e,r,n,i,l,s,c,u,f,d={x:0,y:0,k:1},p=[960,500],h=Bt,g=250,v=0,m="mousedown.zoom",y="mousemove.zoom",x="mouseup.zoom",b="touchstart.zoom",_=B(w,"zoomstart","zoom","zoomend");function w(t){t.on(m,P).on(jt+".zoom",z).on("dblclick.zoom",R).on(b,D)}function k(t){return[(t[0]-d.x)/d.k,(t[1]-d.y)/d.k]}function T(t){d.k=Math.max(h[0],Math.min(h[1],t))}function M(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 A(e,n,a,i){e.__chart__={x:d.x,y:d.y,k:d.k},T(Math.pow(2,i)),M(r=n,a),e=t.select(e),g>0&&(e=e.transition().duration(g)),e.call(w.event)}function L(){c&&c.domain(s.range().map(function(t){return(t-d.x)/d.k}).map(s.invert)),f&&f.domain(u.range().map(function(t){return(t-d.y)/d.k}).map(u.invert))}function S(t){v++||t({type:"zoomstart"})}function C(t){L(),t({type:"zoom",scale:d.k,translate:[d.x,d.y]})}function O(t){--v||(t({type:"zoomend"}),r=null)}function P(){var e=this,r=_.of(e,arguments),n=0,a=t.select(o(e)).on(y,function(){n=1,M(t.mouse(e),i),C(r)}).on(x,function(){a.on(y,null).on(x,null),l(n),O(r)}),i=k(t.mouse(e)),l=xt(e);pl.call(e),S(r)}function D(){var e,r=this,n=_.of(r,arguments),a={},i=0,o=".zoom-"+t.event.changedTouches[0].identifier,s="touchmove"+o,c="touchend"+o,u=[],f=t.select(r),p=xt(r);function h(){var n=t.touches(r);return e=d.k,n.forEach(function(t){t.identifier in a&&(a[t.identifier]=k(t))}),n}function g(){var e=t.event.target;t.select(e).on(s,v).on(c,y),u.push(e);for(var n=t.event.changedTouches,o=0,f=n.length;o<f;++o)a[n[o].identifier]=null;var p=h(),g=Date.now();if(1===p.length){if(g-l<500){var m=p[0];A(r,m,a[m.identifier],Math.floor(Math.log(d.k)/Math.LN2)+1),N()}l=g}else if(p.length>1){m=p[0];var x=p[1],b=m[0]-x[0],_=m[1]-x[1];i=b*b+_*_}}function v(){var o,s,c,u,f=t.touches(r);pl.call(r);for(var d=0,p=f.length;d<p;++d,u=null)if(c=f[d],u=a[c.identifier]){if(s)break;o=c,s=u}if(u){var h=(h=c[0]-o[0])*h+(h=c[1]-o[1])*h,g=i&&Math.sqrt(h/i);o=[(o[0]+c[0])/2,(o[1]+c[1])/2],s=[(s[0]+u[0])/2,(s[1]+u[1])/2],T(g*e)}l=null,M(o,s),C(n)}function y(){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 l in a)return void h()}t.selectAll(u).on(o,null),f.on(m,P).on(b,D),p(),O(n)}g(),S(n),f.on(m,null).on(b,g)}function z(){var a=_.of(this,arguments);i?clearTimeout(i):(pl.call(this),e=k(r=n||t.mouse(this)),S(a)),i=setTimeout(function(){i=null,O(a)},50),N(),T(Math.pow(2,.002*Nt())*d.k),M(r,e),C(a)}function R(){var e=t.mouse(this),r=Math.log(d.k)/Math.LN2;A(this,e,k(e),t.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}return jt||(jt="onwheel"in a?(Nt=function(){return-t.event.deltaY*(t.event.deltaMode?120:1)},"wheel"):"onmousewheel"in a?(Nt=function(){return t.event.wheelDelta},"mousewheel"):(Nt=function(){return-t.event.detail},"MozMousePixelScroll")),w.event=function(e){e.each(function(){var e=_.of(this,arguments),n=d;vl?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=p[0],i=p[1],o=r?r[0]:a/2,l=r?r[1]:i/2,s=t.interpolateZoom([(o-d.x)/d.k,(l-d.y)/d.k,a/d.k],[(o-n.x)/n.k,(l-n.y)/n.k,a/n.k]);return function(t){var r=s(t),n=a/r[2];this.__chart__=d={x:o-r[0]*n,y:l-r[1]*n,k:n},C(e)}}).each("interrupt.zoom",function(){O(e)}).each("end.zoom",function(){O(e)}):(this.__chart__=d,S(e),C(e),O(e))})},w.translate=function(t){return arguments.length?(d={x:+t[0],y:+t[1],k:d.k},L(),w):[d.x,d.y]},w.scale=function(t){return arguments.length?(d={x:d.x,y:d.y,k:null},T(+t),L(),w):d.k},w.scaleExtent=function(t){return arguments.length?(h=null==t?Bt:[+t[0],+t[1]],w):h},w.center=function(t){return arguments.length?(n=t&&[+t[0],+t[1]],w):n},w.size=function(t){return arguments.length?(p=t&&[+t[0],+t[1]],w):p},w.duration=function(t){return arguments.length?(g=+t,w):g},w.x=function(t){return arguments.length?(c=t,s=t.copy(),d={x:0,y:0,k:1},w):c},w.y=function(t){return arguments.length?(f=t,u=t.copy(),d={x:0,y:0,k:1},w):f},t.rebind(w,_,"on")};var Nt,jt,Bt=[0,1/0];function Ht(){}function Vt(t,e,r){return this instanceof Vt?(this.h=+t,this.s=+e,void(this.l=+r)):arguments.length<2?t instanceof Vt?new Vt(t.h,t.s,t.l):ue(""+t,fe,Vt):new Vt(t,e,r)}t.color=Ht,Ht.prototype.toString=function(){return this.rgb()+""},t.hsl=Vt;var qt=Vt.prototype=new Ht;function Ut(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)?0: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 ie(i(t+120),i(t),i(t-120))}function Gt(e,r,n){return this instanceof Gt?(this.h=+e,this.c=+r,void(this.l=+n)):arguments.length<2?e instanceof Gt?new Gt(e.h,e.c,e.l):ee(e instanceof Yt?e.l:(e=de((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Gt(e,r,n)}qt.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new Vt(this.h,this.s,this.l/t)},qt.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new Vt(this.h,this.s,t*this.l)},qt.rgb=function(){return Ut(this.h,this.s,this.l)},t.hcl=Gt;var Zt=Gt.prototype=new Ht;function Xt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new Yt(r,Math.cos(t*=Ct)*e,Math.sin(t)*e)}function Yt(t,e,r){return this instanceof Yt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof Yt?new Yt(t.l,t.a,t.b):t instanceof Gt?Xt(t.h,t.c,t.l):de((t=ie(t)).r,t.g,t.b):new Yt(t,e,r)}Zt.brighter=function(t){return new Gt(this.h,this.c,Math.min(100,this.l+Wt*(arguments.length?t:1)))},Zt.darker=function(t){return new Gt(this.h,this.c,Math.max(0,this.l-Wt*(arguments.length?t:1)))},Zt.rgb=function(){return Xt(this.h,this.c,this.l).rgb()},t.lab=Yt;var Wt=18,$t=.95047,Qt=1,Jt=1.08883,Kt=Yt.prototype=new Ht;function te(t,e,r){var n=(t+16)/116,a=n+e/500,i=n-r/200;return new ie(ae(3.2404542*(a=re(a)*$t)-1.5371385*(n=re(n)*Qt)-.4985314*(i=re(i)*Jt)),ae(-.969266*a+1.8760108*n+.041556*i),ae(.0556434*a-.2040259*n+1.0572252*i))}function ee(t,e,r){return t>0?new Gt(Math.atan2(r,e)*Ot,Math.sqrt(e*e+r*r),t):new Gt(NaN,NaN,t)}function re(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function ne(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function ae(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function ie(t,e,r){return this instanceof ie?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof ie?new ie(t.r,t.g,t.b):ue(""+t,ie,Ut):new ie(t,e,r)}function oe(t){return new ie(t>>16,t>>8&255,255&t)}function le(t){return oe(t)+""}Kt.brighter=function(t){return new Yt(Math.min(100,this.l+Wt*(arguments.length?t:1)),this.a,this.b)},Kt.darker=function(t){return new Yt(Math.max(0,this.l-Wt*(arguments.length?t:1)),this.a,this.b)},Kt.rgb=function(){return te(this.l,this.a,this.b)},t.rgb=ie;var se=ie.prototype=new Ht;function ce(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function ue(t,e,r){var n,a,i,o=0,l=0,s=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=ge.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,l=240&i,l|=l>>4,s=15&i,s|=s<<4):7===t.length&&(o=(16711680&i)>>16,l=(65280&i)>>8,s=255&i)),e(o,l,s))}function fe(t,e,r){var n,a,i=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),l=o-i,s=(o+i)/2;return l?(a=s<.5?l/(o+i):l/(2-o-i),n=t==o?(e-r)/l+(e<r?6:0):e==o?(r-t)/l+2:(t-e)/l+4,n*=60):(n=NaN,a=s>0&&s<1?0:n),new Vt(n,a,s)}function de(t,e,r){var n=ne((.4124564*(t=pe(t))+.3575761*(e=pe(e))+.1804375*(r=pe(r)))/$t),a=ne((.2126729*t+.7151522*e+.072175*r)/Qt);return Yt(116*a-16,500*(n-a),200*(a-ne((.0193339*t+.119192*e+.9503041*r)/Jt)))}function pe(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}se.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 ie(Math.min(255,e/t),Math.min(255,r/t),Math.min(255,n/t))):new ie(a,a,a)},se.darker=function(t){return new ie((t=Math.pow(.7,arguments.length?t:1))*this.r,t*this.g,t*this.b)},se.hsl=function(){return fe(this.r,this.g,this.b)},se.toString=function(){return"#"+ce(this.r)+ce(this.g)+ce(this.b)};var ge=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 ve(t){return"function"==typeof t?t:function(){return t}}function me(t){return function(e,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=null),ye(e,r,t,n)}}function ye(e,r,a,i){var o={},l=t.dispatch("beforesend","progress","load","error"),s={},c=new XMLHttpRequest,u=null;function f(){var t,e=c.status;if(!e&&function(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}(c)||e>=200&&e<300||304===e){try{t=a.call(o,c)}catch(t){return void l.error.call(o,t)}l.load.call(o,t)}else l.error.call(o,c)}return!this.XDomainRequest||"withCredentials"in c||!/^(http(s)?:)?\/\//.test(e)||(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=f:c.onreadystatechange=function(){c.readyState>3&&f()},c.onprogress=function(e){var r=t.event;t.event=e;try{l.progress.call(o,c)}finally{t.event=r}},o.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?s[t]:(null==e?delete s[t]:s[t]=e+"",o)},o.mimeType=function(t){return arguments.length?(r=null==t?null:t+"",o):r},o.responseType=function(t){return arguments.length?(u=t,o):u},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),c.open(t,e,!0),null==r||"accept"in s||(s.accept=r+",*/*"),c.setRequestHeader)for(var i in s)c.setRequestHeader(i,s[i]);return null!=r&&c.overrideMimeType&&c.overrideMimeType(r),null!=u&&(c.responseType=u),null!=a&&o.on("error",a).on("load",function(t){a(null,t)}),l.beforesend.call(o,c),c.send(null==n?null:n),o},o.abort=function(){return c.abort(),o},t.rebind(o,l,"on"),null==i?o:o.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(i))}ge.forEach(function(t,e){ge.set(t,oe(e))}),t.functor=ve,t.xhr=me(P),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=ye(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 l(e){return e.map(s).join(t)}function s(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={},l=[],s=t.length,c=0,u=0;function f(){if(c>=s)return o;if(a)return a=!1,i;var e=c;if(34===t.charCodeAt(e)){for(var r=e;r++<s;)if(34===t.charCodeAt(r)){if(34!==t.charCodeAt(r+1))break;++r}return c=r+2,13===(l=t.charCodeAt(r+1))?(a=!0,10===t.charCodeAt(r+2)&&++c):10===l&&(a=!0),t.slice(e+1,r).replace(/""/g,'"')}for(;c<s;){var l,u=1;if(10===(l=t.charCodeAt(c++)))a=!0;else if(13===l)a=!0,10===t.charCodeAt(c)&&(++c,++u);else if(l!==n)continue;return t.slice(e,c-u)}return t.slice(e)}for(;(r=f())!==o;){for(var d=[];r!==i&&r!==o;)d.push(r),r=f();e&&null==(d=e(d,u++))||l.push(d)}return l},a.format=function(e){if(Array.isArray(e[0]))return a.formatRows(e);var r=new O,n=[];return e.forEach(function(t){for(var e in t)r.has(e)||n.push(r.add(e))}),[n.map(s).join(t)].concat(e.map(function(e){return n.map(function(t){return s(e[t])}).join(t)})).join("\n")},a.formatRows=function(t){return t.map(l).join("\n")},a},t.csv=t.dsv(",","text/csv"),t.tsv=t.dsv("\t","text/tab-separated-values");var xe,be,_e,we,ke=this[z(this,"requestAnimationFrame")]||function(t){setTimeout(t,17)};function Te(t,e,r){var n=arguments.length;n<2&&(e=0),n<3&&(r=Date.now());var a={c:t,t:r+e,n:null};return be?be.n=a:xe=a,be=a,_e||(we=clearTimeout(we),_e=1,ke(Me)),a}function Me(){var t=Ae(),e=Le()-t;e>24?(isFinite(e)&&(clearTimeout(we),we=setTimeout(Me,e)),_e=0):(_e=1,ke(Me))}function Ae(){for(var t=Date.now(),e=xe;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function Le(){for(var t,e=xe,r=1/0;e;)e.c?(e.t<r&&(r=e.t),e=(t=e).n):e=t?t.n=e.n:xe=e.n;return be=t,r}function Se(t,e){return e-(t?Math.ceil(Math.log(t)/Math.LN10):1)}t.timer=function(){Te.apply(this,arguments)},t.timer.flush=function(){Ae(),Le()},t.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var Ce=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map(function(t,e){var r=Math.pow(10,3*y(8-e));return{scale:e>8?function(t){return t/r}:function(t){return t*r},symbol:t}});function Oe(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,l=a[0],s=0;r>0&&l>0&&(s+l+1>e&&(l=Math.max(1,e-s)),i.push(t.substring(r-=l,r+l)),!((s+=l+1)>e));)l=a[o=(o+1)%a.length];return i.reverse().join(n)}:P;return function(e){var n=Pe.exec(e),a=n[1]||" ",l=n[2]||">",s=n[3]||"-",c=n[4]||"",u=n[5],f=+n[6],d=n[7],p=n[8],h=n[9],g=1,v="",m="",y=!1,x=!0;switch(p&&(p=+p.substring(1)),(u||"0"===a&&"="===l)&&(u=a="0",l="="),h){case"n":d=!0,h="g";break;case"%":g=100,m="%",h="f";break;case"p":g=100,m="%",h="r";break;case"b":case"o":case"x":case"X":"#"===c&&(v="0"+h.toLowerCase());case"c":x=!1;case"d":y=!0,p=0;break;case"s":g=-1,h="r"}"$"===c&&(v=i[0],m=i[1]),"r"!=h||p||(h="g"),null!=p&&("g"==h?p=Math.max(1,Math.min(21,p)):"e"!=h&&"f"!=h||(p=Math.max(0,Math.min(20,p)))),h=De.get(h)||ze;var b=u&&d;return function(e){var n=m;if(y&&e%1)return"";var i=e<0||0===e&&1/e<0?(e=-e,"-"):"-"===s?"":s;if(g<0){var c=t.formatPrefix(e,p);e=c.scale(e),n=c.symbol+m}else e*=g;var _,w,k=(e=h(e,p)).lastIndexOf(".");if(k<0){var T=x?e.lastIndexOf("e"):-1;T<0?(_=e,w=""):(_=e.substring(0,T),w=e.substring(T))}else _=e.substring(0,k),w=r+e.substring(k+1);!u&&d&&(_=o(_,1/0));var M=v.length+_.length+w.length+(b?0:i.length),A=M<f?new Array(M=f-M+1).join(a):"";return b&&(_=o(A+_,A.length?f-w.length:1/0)),i+=v,e=_+w,("<"===l?i+e+A:">"===l?A+i+e:"^"===l?A.substring(0,M>>=1)+i+e+A.substring(M):i+(b?e:A+e))+n}}}t.formatPrefix=function(e,r){var n=0;return(e=+e)&&(e<0&&(e*=-1),r&&(e=t.round(e,Se(e,r))),n=1+Math.floor(1e-12+Math.log(e)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),Ce[8+n/3]};var Pe=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,De=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,Se(e,r))).toFixed(Math.max(0,Math.min(20,Se(e*(1+1e-15),r))))}});function ze(t){return t+""}var Re=t.time={},Ee=Date;function Ie(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}Ie.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){Fe.setUTCDate.apply(this._,arguments)},setDay:function(){Fe.setUTCDay.apply(this._,arguments)},setFullYear:function(){Fe.setUTCFullYear.apply(this._,arguments)},setHours:function(){Fe.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Fe.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Fe.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Fe.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Fe.setUTCSeconds.apply(this._,arguments)},setTime:function(){Fe.setTime.apply(this._,arguments)}};var Fe=Date.prototype;function Ne(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 Ee(r-1)),1),r}function i(t,r){return e(t=new Ee(+t),r),t}function o(t,n,i){var o=a(t),l=[];if(i>1)for(;o<n;)r(o)%i||l.push(new Date(+o)),e(o,1);else for(;o<n;)l.push(new Date(+o)),e(o,1);return l}t.floor=t,t.round=n,t.ceil=a,t.offset=i,t.range=o;var l=t.utc=je(t);return l.floor=l,l.round=je(n),l.ceil=je(a),l.offset=je(i),l.range=function(t,e,r){try{Ee=Ie;var n=new Ie;return n._=t,o(n,e,r)}finally{Ee=Date}},t}function je(t){return function(e,r){try{Ee=Ie;var n=new Ie;return n._=e,t(n,r)._}finally{Ee=Date}}}function Be(e){var r=e.dateTime,n=e.date,a=e.time,i=e.periods,o=e.days,l=e.shortDays,s=e.months,c=e.shortMonths;function u(t){var e=t.length;function r(r){for(var n,a,i,o=[],l=-1,s=0;++l<e;)37===t.charCodeAt(l)&&(o.push(t.slice(s,l)),null!=(a=He[n=t.charAt(++l)])&&(n=t.charAt(++l)),(i=_[n])&&(n=i(r,null==a?"e"===n?" ":"0":a)),o.push(n),s=l+1);return o.push(t.slice(s,l)),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(f(r,t,e,0)!=e.length)return null;"p"in r&&(r.H=r.H%12+12*r.p);var n=null!=r.Z&&Ee!==Ie,a=new(n?Ie:Ee);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 f(t,e,r,n){for(var a,i,o,l=0,s=e.length,c=r.length;l<s;){if(n>=c)return-1;if(37===(a=e.charCodeAt(l++))){if(o=e.charAt(l++),!(i=w[o in He?e.charAt(l++):o])||(n=i(t,r,n))<0)return-1}else if(a!=r.charCodeAt(n++))return-1}return n}u.utc=function(t){var e=u(t);function r(t){try{var r=new(Ee=Ie);return r._=t,e(r)}finally{Ee=Date}}return r.parse=function(t){try{Ee=Ie;var r=e.parse(t);return r&&r._}finally{Ee=Date}},r.toString=e.toString,r},u.multi=u.utc.multi=sr;var d=t.map(),p=Ge(o),h=Ze(o),g=Ge(l),v=Ze(l),m=Ge(s),y=Ze(s),x=Ge(c),b=Ze(c);i.forEach(function(t,e){d.set(t.toLowerCase(),e)});var _={a:function(t){return l[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:u(r),d:function(t,e){return Ue(t.getDate(),e,2)},e:function(t,e){return Ue(t.getDate(),e,2)},H:function(t,e){return Ue(t.getHours(),e,2)},I:function(t,e){return Ue(t.getHours()%12||12,e,2)},j:function(t,e){return Ue(1+Re.dayOfYear(t),e,3)},L:function(t,e){return Ue(t.getMilliseconds(),e,3)},m:function(t,e){return Ue(t.getMonth()+1,e,2)},M:function(t,e){return Ue(t.getMinutes(),e,2)},p:function(t){return i[+(t.getHours()>=12)]},S:function(t,e){return Ue(t.getSeconds(),e,2)},U:function(t,e){return Ue(Re.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Ue(Re.mondayOfYear(t),e,2)},x:u(n),X:u(a),y:function(t,e){return Ue(t.getFullYear()%100,e,2)},Y:function(t,e){return Ue(t.getFullYear()%1e4,e,4)},Z:or,"%":function(){return"%"}},w={a:function(t,e,r){g.lastIndex=0;var n=g.exec(e.slice(r));return n?(t.w=v.get(n[0].toLowerCase()),r+n[0].length):-1},A:function(t,e,r){p.lastIndex=0;var n=p.exec(e.slice(r));return n?(t.w=h.get(n[0].toLowerCase()),r+n[0].length):-1},b:function(t,e,r){x.lastIndex=0;var n=x.exec(e.slice(r));return n?(t.m=b.get(n[0].toLowerCase()),r+n[0].length):-1},B:function(t,e,r){m.lastIndex=0;var n=m.exec(e.slice(r));return n?(t.m=y.get(n[0].toLowerCase()),r+n[0].length):-1},c:function(t,e,r){return f(t,_.c.toString(),e,r)},d:tr,e:tr,H:rr,I:rr,j:er,L:ir,m:Ke,M:nr,p:function(t,e,r){var n=d.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)},S:ar,U:Ye,w:Xe,W:We,x:function(t,e,r){return f(t,_.x.toString(),e,r)},X:function(t,e,r){return f(t,_.X.toString(),e,r)},y:Qe,Y:$e,Z:Je,"%":lr};return u}Re.year=Ne(function(t){return(t=Re.day(t)).setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),Re.years=Re.year.range,Re.years.utc=Re.year.utc.range,Re.day=Ne(function(t){var e=new Ee(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}),Re.days=Re.day.range,Re.days.utc=Re.day.utc.range,Re.dayOfYear=function(t){var e=Re.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=Re[t]=Ne(function(t){return(t=Re.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=Re.year(t).getDay();return Math.floor((Re.dayOfYear(t)+(r+e)%7)/7)-(r!==e)});Re[t+"s"]=r.range,Re[t+"s"].utc=r.utc.range,Re[t+"OfYear"]=function(t){var r=Re.year(t).getDay();return Math.floor((Re.dayOfYear(t)+(r+e)%7)/7)}}),Re.week=Re.sunday,Re.weeks=Re.sunday.range,Re.weeks.utc=Re.sunday.utc.range,Re.weekOfYear=Re.sundayOfYear;var He={"-":"",_:" ",0:"0"},Ve=/^\s*\d+/,qe=/^%/;function Ue(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 Ge(e){return new RegExp("^(?:"+e.map(t.requote).join("|")+")","i")}function Ze(t){for(var e=new b,r=-1,n=t.length;++r<n;)e.set(t[r].toLowerCase(),r);return e}function Xe(t,e,r){Ve.lastIndex=0;var n=Ve.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function Ye(t,e,r){Ve.lastIndex=0;var n=Ve.exec(e.slice(r));return n?(t.U=+n[0],r+n[0].length):-1}function We(t,e,r){Ve.lastIndex=0;var n=Ve.exec(e.slice(r));return n?(t.W=+n[0],r+n[0].length):-1}function $e(t,e,r){Ve.lastIndex=0;var n=Ve.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function Qe(t,e,r){Ve.lastIndex=0;var n,a=Ve.exec(e.slice(r,r+2));return a?(t.y=(n=+a[0])+(n>68?1900:2e3),r+a[0].length):-1}function Je(t,e,r){return/^[+-]\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function Ke(t,e,r){Ve.lastIndex=0;var n=Ve.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function tr(t,e,r){Ve.lastIndex=0;var n=Ve.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function er(t,e,r){Ve.lastIndex=0;var n=Ve.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function rr(t,e,r){Ve.lastIndex=0;var n=Ve.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function nr(t,e,r){Ve.lastIndex=0;var n=Ve.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function ar(t,e,r){Ve.lastIndex=0;var n=Ve.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function ir(t,e,r){Ve.lastIndex=0;var n=Ve.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function or(t){var e=t.getTimezoneOffset(),r=e>0?"-":"+",n=y(e)/60|0,a=y(e)%60;return r+Ue(n,"0",2)+Ue(a,"0",2)}function lr(t,e,r){qe.lastIndex=0;var n=qe.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function sr(t){for(var e=t.length,r=-1;++r<e;)t[r][0]=this(t[r][0]);return function(e){for(var r=0,n=t[r];!n[1](e);)n=t[++r];return n[0](e)}}t.locale=function(t){return{numberFormat:Oe(t),timeFormat:Be(t)}};var cr=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 ur(){}t.format=cr.numberFormat,t.geo={},ur.prototype={s:0,t:0,add:function(t){dr(t,this.t,fr),dr(fr.s,this.s,this),this.s?this.t+=fr.t:this.s=fr.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var fr=new ur;function dr(t,e,r){var n=r.s=t+e,a=n-t,i=n-a;r.t=t-i+(e-a)}function pr(t,e){t&&gr.hasOwnProperty(t.type)&&gr[t.type](t,e)}t.geo.stream=function(t,e){t&&hr.hasOwnProperty(t.type)?hr[t.type](t,e):pr(t,e)};var hr={Feature:function(t,e){pr(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,a=r.length;++n<a;)pr(r[n].geometry,e)}},gr={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){vr(t.coordinates,e,0)},MultiLineString:function(t,e){for(var r=t.coordinates,n=-1,a=r.length;++n<a;)vr(r[n],e,0)},Polygon:function(t,e){mr(t.coordinates,e)},MultiPolygon:function(t,e){for(var r=t.coordinates,n=-1,a=r.length;++n<a;)mr(r[n],e)},GeometryCollection:function(t,e){for(var r=t.geometries,n=-1,a=r.length;++n<a;)pr(r[n],e)}};function vr(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 mr(t,e){var r=-1,n=t.length;for(e.polygonStart();++r<n;)vr(t[r],e,1);e.polygonEnd()}t.geo.area=function(e){return yr=0,t.geo.stream(e,Pr),yr};var yr,xr,br,_r,wr,kr,Tr,Mr,Ar,Lr,Sr,Cr,Or=new ur,Pr={sphere:function(){yr+=4*Mt},point:E,lineStart:E,lineEnd:E,polygonStart:function(){Or.reset(),Pr.lineStart=Dr},polygonEnd:function(){var t=2*Or;yr+=t<0?4*Mt+t:t,Pr.lineStart=Pr.lineEnd=Pr.point=E}};function Dr(){var t,e,r,n,a;function i(t,e){e=e*Ct/2+Mt/4;var i=(t*=Ct)-r,o=i>=0?1:-1,l=o*i,s=Math.cos(e),c=Math.sin(e),u=a*c,f=n*s+u*Math.cos(l),d=u*o*Math.sin(l);Or.add(Math.atan2(d,f)),r=t,n=s,a=c}Pr.point=function(o,l){Pr.point=i,r=(t=o)*Ct,n=Math.cos(l=(e=l)*Ct/2+Mt/4),a=Math.sin(l)},Pr.lineEnd=function(){i(t,e)}}function zr(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 Rr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Er(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 Ir(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Fr(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Nr(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 jr(t){return[Math.atan2(t[1],t[0]),Rt(t[2])]}function Br(t,e){return y(t[0]-e[0])<kt&&y(t[1]-e[1])<kt}t.geo.bounds=function(){var e,r,n,a,i,o,l,s,c,u,f,d={point:p,lineStart:g,lineEnd:v,polygonStart:function(){d.point=m,d.lineStart=x,d.lineEnd=b,c=0,Pr.polygonStart()},polygonEnd:function(){Pr.polygonEnd(),d.point=p,d.lineStart=g,d.lineEnd=v,Or<0?(e=-(n=180),r=-(a=90)):c>kt?a=90:c<-kt&&(r=-90),f[0]=e,f[1]=n}};function p(t,i){u.push(f=[e=t,n=t]),i<r&&(r=i),i>a&&(a=i)}function h(t,o){var l=zr([t*Ct,o*Ct]);if(s){var c=Er(s,l),u=Er([c[1],-c[0],0],c);Nr(u),u=jr(u);var f=t-i,d=f>0?1:-1,h=u[0]*Ot*d,g=y(f)>180;if(g^(d*i<h&&h<d*t))(v=u[1]*Ot)>a&&(a=v);else if(g^(d*i<(h=(h+360)%360-180)&&h<d*t)){var v;(v=-u[1]*Ot)<r&&(r=v)}else o<r&&(r=o),o>a&&(a=o);g?t<i?_(e,t)>_(e,n)&&(n=t):_(t,n)>_(e,n)&&(e=t):n>=e?(t<e&&(e=t),t>n&&(n=t)):t>i?_(e,t)>_(e,n)&&(n=t):_(t,n)>_(e,n)&&(e=t)}else p(t,o);s=l,i=t}function g(){d.point=h}function v(){f[0]=e,f[1]=n,d.point=p,s=null}function m(t,e){if(s){var r=t-i;c+=y(r)>180?r+(r>0?360:-360):r}else o=t,l=e;Pr.point(t,e),h(t,e)}function x(){Pr.lineStart()}function b(){m(o,l),Pr.lineEnd(),y(c)>kt&&(e=-(n=180)),f[0]=e,f[1]=n,s=null}function _(t,e){return(e-=t)<0?e+360:e}function w(t,e){return t[0]-e[0]}function k(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}return function(i){if(a=n=-(e=r=1/0),u=[],t.geo.stream(i,d),c=u.length){u.sort(w);for(var o=1,l=[g=u[0]];o<c;++o)k((p=u[o])[0],g)||k(p[1],g)?(_(g[0],p[1])>_(g[0],g[1])&&(g[1]=p[1]),_(p[0],g[1])>_(g[0],g[1])&&(g[0]=p[0])):l.push(g=p);for(var s,c,p,h=-1/0,g=(o=0,l[c=l.length-1]);o<=c;g=p,++o)p=l[o],(s=_(g[1],p[0]))>h&&(h=s,e=p[0],n=g[1])}return u=f=null,e===1/0||r===1/0?[[NaN,NaN],[NaN,NaN]]:[[e,r],[n,a]]}}(),t.geo.centroid=function(e){xr=br=_r=wr=kr=Tr=Mr=Ar=Lr=Sr=Cr=0,t.geo.stream(e,Hr);var r=Lr,n=Sr,a=Cr,i=r*r+n*n+a*a;return i<Tt&&(r=Tr,n=Mr,a=Ar,br<kt&&(r=_r,n=wr,a=kr),(i=r*r+n*n+a*a)<Tt)?[NaN,NaN]:[Math.atan2(n,r)*Ot,Rt(a/Math.sqrt(i))*Ot]};var Hr={sphere:E,point:Vr,lineStart:Ur,lineEnd:Gr,polygonStart:function(){Hr.lineStart=Zr},polygonEnd:function(){Hr.lineStart=Ur}};function Vr(t,e){t*=Ct;var r=Math.cos(e*=Ct);qr(r*Math.cos(t),r*Math.sin(t),Math.sin(e))}function qr(t,e,r){_r+=(t-_r)/++xr,wr+=(e-wr)/xr,kr+=(r-kr)/xr}function Ur(){var t,e,r;function n(n,a){n*=Ct;var i=Math.cos(a*=Ct),o=i*Math.cos(n),l=i*Math.sin(n),s=Math.sin(a),c=Math.atan2(Math.sqrt((c=e*s-r*l)*c+(c=r*o-t*s)*c+(c=t*l-e*o)*c),t*o+e*l+r*s);br+=c,Tr+=c*(t+(t=o)),Mr+=c*(e+(e=l)),Ar+=c*(r+(r=s)),qr(t,e,r)}Hr.point=function(a,i){a*=Ct;var o=Math.cos(i*=Ct);t=o*Math.cos(a),e=o*Math.sin(a),r=Math.sin(i),Hr.point=n,qr(t,e,r)}}function Gr(){Hr.point=Vr}function Zr(){var t,e,r,n,a;function i(t,e){t*=Ct;var i=Math.cos(e*=Ct),o=i*Math.cos(t),l=i*Math.sin(t),s=Math.sin(e),c=n*s-a*l,u=a*o-r*s,f=r*l-n*o,d=Math.sqrt(c*c+u*u+f*f),p=r*o+n*l+a*s,h=d&&-zt(p)/d,g=Math.atan2(d,p);Lr+=h*c,Sr+=h*u,Cr+=h*f,br+=g,Tr+=g*(r+(r=o)),Mr+=g*(n+(n=l)),Ar+=g*(a+(a=s)),qr(r,n,a)}Hr.point=function(o,l){t=o,e=l,Hr.point=i,o*=Ct;var s=Math.cos(l*=Ct);r=s*Math.cos(o),n=s*Math.sin(o),a=Math.sin(l),qr(r,n,a)},Hr.lineEnd=function(){i(t,e),Hr.lineEnd=Gr,Hr.point=Vr}}function Xr(t,e){function r(r,n){return r=t(r,n),e(r[0],r[1])}return t.invert&&e.invert&&(r.invert=function(r,n){return(r=e.invert(r,n))&&t.invert(r[0],r[1])}),r}function Yr(){return!0}function Wr(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(Br(r,n)){a.lineStart();for(var l=0;l<e;++l)a.point((r=t[l])[0],r[1]);a.lineEnd()}else{var s=new Qr(r,t,null,!0),c=new Qr(r,null,s,!1);s.o=c,i.push(s),o.push(c),s=new Qr(n,t,null,!1),c=new Qr(n,null,s,!0),s.o=c,i.push(s),o.push(c)}}}),o.sort(e),$r(i),$r(o),i.length){for(var l=0,s=r,c=o.length;l<c;++l)o[l].e=s=!s;for(var u,f,d=i[0];;){for(var p=d,h=!0;p.v;)if((p=p.n)===d)return;u=p.z,a.lineStart();do{if(p.v=p.o.v=!0,p.e){if(h)for(l=0,c=u.length;l<c;++l)a.point((f=u[l])[0],f[1]);else n(p.x,p.n.x,1,a);p=p.n}else{if(h)for(l=(u=p.p.z).length-1;l>=0;--l)a.point((f=u[l])[0],f[1]);else n(p.x,p.p.x,-1,a);p=p.p}u=(p=p.o).z,h=!h}while(!p.v);a.lineEnd()}}}function $r(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 Qr(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 Jr(e,r,n,a){return function(i,o){var l,s=r(o),c=i.invert(a[0],a[1]),u={point:f,lineStart:p,lineEnd:h,polygonStart:function(){u.point=b,u.lineStart=_,u.lineEnd=w,l=[],g=[]},polygonEnd:function(){u.point=f,u.lineStart=p,u.lineEnd=h,l=t.merge(l);var e=function(t,e){var r=t[0],n=t[1],a=[Math.sin(r),-Math.cos(r),0],i=0,o=0;Or.reset();for(var l=0,s=e.length;l<s;++l){var c=e[l],u=c.length;if(u)for(var f=c[0],d=f[0],p=f[1]/2+Mt/4,h=Math.sin(p),g=Math.cos(p),v=1;;){v===u&&(v=0);var m=(t=c[v])[0],y=t[1]/2+Mt/4,x=Math.sin(y),b=Math.cos(y),_=m-d,w=_>=0?1:-1,k=w*_,T=k>Mt,M=h*x;if(Or.add(Math.atan2(M*w*Math.sin(k),g*b+M*Math.cos(k))),i+=T?_+w*At:_,T^d>=r^m>=r){var A=Er(zr(f),zr(t));Nr(A);var L=Er(a,A);Nr(L);var S=(T^_>=0?-1:1)*Rt(L[2]);(n>S||n===S&&(A[0]||A[1]))&&(o+=T^_>=0?1:-1)}if(!v++)break;d=m,h=x,g=b,f=t}}return(i<-kt||i<kt&&Or<-kt)^1&o}(c,g);l.length?(x||(o.polygonStart(),x=!0),Wr(l,en,e,n,o)):e&&(x||(o.polygonStart(),x=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),x&&(o.polygonEnd(),x=!1),l=g=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function f(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);s.point(r[0],r[1])}function p(){u.point=d,s.lineStart()}function h(){u.point=f,s.lineEnd()}var g,v,m=tn(),y=r(m),x=!1;function b(t,e){v.push([t,e]);var r=i(t,e);y.point(r[0],r[1])}function _(){y.lineStart(),v=[]}function w(){b(v[0][0],v[0][1]),y.lineEnd();var t,e=y.clean(),r=m.buffer(),n=r.length;if(v.pop(),g.push(v),v=null,n)if(1&e){var a,i=-1;if((n=(t=r[0]).length-1)>0){for(x||(o.polygonStart(),x=!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())),l.push(r.filter(Kr))}return u}}function Kr(t){return t.length>1}function tn(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:E,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function en(t,e){return((t=t.x)[0]<0?t[1]-St-kt:St-t[1])-((e=e.x)[0]<0?e[1]-St-kt:St-e[1])}var rn=Jr(Yr,function(t){var e,r=NaN,n=NaN,a=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(i,o){var l=i>0?Mt:-Mt,s=y(i-r);y(s-Mt)<kt?(t.point(r,n=(n+o)/2>0?St:-St),t.point(a,n),t.lineEnd(),t.lineStart(),t.point(l,n),t.point(i,n),e=0):a!==l&&s>=Mt&&(y(r-a)<kt&&(r-=a*kt),y(i-l)<kt&&(i-=l*kt),n=function(t,e,r,n){var a,i,o=Math.sin(t-r);return y(o)>kt?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(l,n),e=0),t.point(r=i,n=o),a=l},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}},function(t,e,r,n){var a;if(null==t)a=r*St,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(y(t[0]-e[0])>kt){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 nn(t,e,r,n){return function(a){var i,o=a.a,l=a.b,s=o.x,c=o.y,u=0,f=1,d=l.x-s,p=l.y-c;if(i=t-s,d||!(i>0)){if(i/=d,d<0){if(i<u)return;i<f&&(f=i)}else if(d>0){if(i>f)return;i>u&&(u=i)}if(i=r-s,d||!(i<0)){if(i/=d,d<0){if(i>f)return;i>u&&(u=i)}else if(d>0){if(i<u)return;i<f&&(f=i)}if(i=e-c,p||!(i>0)){if(i/=p,p<0){if(i<u)return;i<f&&(f=i)}else if(p>0){if(i>f)return;i>u&&(u=i)}if(i=n-c,p||!(i<0)){if(i/=p,p<0){if(i>f)return;i>u&&(u=i)}else if(p>0){if(i<u)return;i<f&&(f=i)}return u>0&&(a.a={x:s+u*d,y:c+u*p}),f<1&&(a.b={x:s+f*d,y:c+f*p}),a}}}}}}var an=1e9;function on(e,r,n,a){return function(s){var c,u,f,d,p,h,g,v,m,y,x,b=s,_=tn(),w=nn(e,r,n,a),k={point:A,lineStart:function(){k.point=L,u&&u.push(f=[]);y=!0,m=!1,g=v=NaN},lineEnd:function(){c&&(L(d,p),h&&m&&_.rejoin(),c.push(_.buffer()));k.point=A,m&&s.lineEnd()},polygonStart:function(){s=_,c=[],u=[],x=!0},polygonEnd:function(){s=b,c=t.merge(c);var r=function(t){for(var e=0,r=u.length,n=t[1],a=0;a<r;++a)for(var i,o=1,l=u[a],s=l.length,c=l[0];o<s;++o)i=l[o],c[1]<=n?i[1]>n&&Dt(c,i,t)>0&&++e:i[1]<=n&&Dt(c,i,t)<0&&--e,c=i;return 0!==e}([e,a]),n=x&&r,i=c.length;(n||i)&&(s.polygonStart(),n&&(s.lineStart(),T(null,null,1,s),s.lineEnd()),i&&Wr(c,o,r,T,s),s.polygonEnd()),c=u=f=null}};function T(t,o,s,c){var u=0,f=0;if(null==t||(u=i(t,s))!==(f=i(o,s))||l(t,o)<0^s>0)do{c.point(0===u||3===u?e:n,u>1?a:r)}while((u=(u+s+4)%4)!==f);else c.point(o[0],o[1])}function M(t,i){return e<=t&&t<=n&&r<=i&&i<=a}function A(t,e){M(t,e)&&s.point(t,e)}function L(t,e){var r=M(t=Math.max(-an,Math.min(an,t)),e=Math.max(-an,Math.min(an,e)));if(u&&f.push([t,e]),y)d=t,p=e,h=r,y=!1,r&&(s.lineStart(),s.point(t,e));else if(r&&m)s.point(t,e);else{var n={a:{x:g,y:v},b:{x:t,y:e}};w(n)?(m||(s.lineStart(),s.point(n.a.x,n.a.y)),s.point(n.b.x,n.b.y),r||s.lineEnd(),x=!1):r&&(s.lineStart(),s.point(t,e),x=!1)}g=t,v=e,m=r}return k};function i(t,a){return y(t[0]-e)<kt?a>0?0:3:y(t[0]-n)<kt?a>0?2:1:y(t[1]-r)<kt?a>0?1:0:a>0?3:2}function o(t,e){return l(t.x,e.x)}function l(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 ln(t){var e=0,r=Mt/3,n=Pn(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 sn(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,Rt((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(l){return arguments.length?(i=on(t=+l[0][0],e=+l[0][1],r=+l[1][0],n=+l[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 ln(sn)}).raw=sn,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]),l=t.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s={point:function(t,r){e=[t,r]}};function c(t){var i=t[0],o=t[1];return e=null,r(i,o),e||(n(i,o),e)||a(i,o),e}return c.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?l:i).invert(t)},c.stream=function(t){var e=i.stream(t),r=o.stream(t),n=l.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()}}},c.precision=function(t){return arguments.length?(i.precision(t),o.precision(t),l.precision(t),c):i.precision()},c.scale=function(t){return arguments.length?(i.scale(t),o.scale(.35*t),l.scale(t),c.translate(i.translate())):i.scale()},c.translate=function(t){if(!arguments.length)return i.translate();var e=i.scale(),u=+t[0],f=+t[1];return r=i.translate(t).clipExtent([[u-.455*e,f-.238*e],[u+.455*e,f+.238*e]]).stream(s).point,n=o.translate([u-.307*e,f+.201*e]).clipExtent([[u-.425*e+kt,f+.12*e+kt],[u-.214*e-kt,f+.234*e-kt]]).stream(s).point,a=l.translate([u-.205*e,f+.212*e]).clipExtent([[u-.214*e+kt,f+.166*e+kt],[u-.115*e-kt,f+.234*e-kt]]).stream(s).point,c},c.scale(1070)};var cn,un,fn,dn,pn,hn,gn={point:E,lineStart:E,lineEnd:E,polygonStart:function(){un=0,gn.lineStart=vn},polygonEnd:function(){gn.lineStart=gn.lineEnd=gn.point=E,cn+=y(un/2)}};function vn(){var t,e,r,n;function a(t,e){un+=n*t-r*e,r=t,n=e}gn.point=function(i,o){gn.point=a,t=r=i,e=n=o},gn.lineEnd=function(){a(t,e)}}var mn={point:function(t,e){t<fn&&(fn=t);t>pn&&(pn=t);e<dn&&(dn=e);e>hn&&(hn=e)},lineStart:E,lineEnd:E,polygonStart:E,polygonEnd:E};function yn(){var t=xn(4.5),e=[],r={point:n,lineStart:function(){r.point=a},lineEnd:o,polygonStart:function(){r.lineEnd=l},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(e){return t=xn(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 l(){e.push("Z")}return r}function xn(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}var bn,_n={point:wn,lineStart:kn,lineEnd:Tn,polygonStart:function(){_n.lineStart=Mn},polygonEnd:function(){_n.point=wn,_n.lineStart=kn,_n.lineEnd=Tn}};function wn(t,e){_r+=t,wr+=e,++kr}function kn(){var t,e;function r(r,n){var a=r-t,i=n-e,o=Math.sqrt(a*a+i*i);Tr+=o*(t+r)/2,Mr+=o*(e+n)/2,Ar+=o,wn(t=r,e=n)}_n.point=function(n,a){_n.point=r,wn(t=n,e=a)}}function Tn(){_n.point=wn}function Mn(){var t,e,r,n;function a(t,e){var a=t-r,i=e-n,o=Math.sqrt(a*a+i*i);Tr+=o*(r+t)/2,Mr+=o*(n+e)/2,Ar+=o,Lr+=(o=n*t-r*e)*(r+t),Sr+=o*(n+e),Cr+=3*o,wn(r=t,n=e)}_n.point=function(i,o){_n.point=a,wn(t=r=i,e=n=o)},_n.lineEnd=function(){a(t,e)}}function An(t){var e=4.5,r={point:n,lineStart:function(){r.point=a},lineEnd:o,polygonStart:function(){r.lineEnd=l},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(t){return e=t,r},result:E};function n(r,n){t.moveTo(r+e,n),t.arc(r,n,e,0,At)}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 l(){t.closePath()}return r}function Ln(t){var e=.5,r=Math.cos(30*Ct),n=16;function a(e){return(n?function(e){var r,a,o,l,s,c,u,f,d,p,h,g,v={point:m,lineStart:y,lineEnd:b,polygonStart:function(){e.polygonStart(),v.lineStart=_},polygonEnd:function(){e.polygonEnd(),v.lineStart=y}};function m(r,n){r=t(r,n),e.point(r[0],r[1])}function y(){f=NaN,v.point=x,e.lineStart()}function x(r,a){var o=zr([r,a]),l=t(r,a);i(f,d,u,p,h,g,f=l[0],d=l[1],u=r,p=o[0],h=o[1],g=o[2],n,e),e.point(f,d)}function b(){v.point=m,e.lineEnd()}function _(){y(),v.point=w,v.lineEnd=k}function w(t,e){x(r=t,e),a=f,o=d,l=p,s=h,c=g,v.point=x}function k(){i(f,d,u,p,h,g,a,o,r,l,s,c,n,e),v.lineEnd=b,b()}return v}:function(e){return Cn(e,function(r,n){r=t(r,n),e.point(r[0],r[1])})})(e)}function i(n,a,o,l,s,c,u,f,d,p,h,g,v,m){var x=u-n,b=f-a,_=x*x+b*b;if(_>4*e&&v--){var w=l+p,k=s+h,T=c+g,M=Math.sqrt(w*w+k*k+T*T),A=Math.asin(T/=M),L=y(y(T)-1)<kt||y(o-d)<kt?(o+d)/2:Math.atan2(k,w),S=t(L,A),C=S[0],O=S[1],P=C-n,D=O-a,z=b*P-x*D;(z*z/_>e||y((x*P+b*D)/_-.5)>.3||l*p+s*h+c*g<r)&&(i(n,a,o,l,s,c,C,O,L,w/=M,k/=M,T,v,m),m.point(C,O),i(C,O,L,w,k,T,u,f,d,p,h,g,v,m))}}return a.precision=function(t){return arguments.length?(n=(e=t*t)>0&&16,a):Math.sqrt(e)},a}function Sn(t){this.stream=t}function Cn(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function On(t){return Pn(function(){return t})()}function Pn(e){var r,n,a,i,o,l,s=Ln(function(t,e){return[(t=r(t,e))[0]*c+i,o-t[1]*c]}),c=150,u=480,f=250,d=0,p=0,h=0,g=0,v=0,m=rn,x=P,b=null,_=null;function w(t){return[(t=a(t[0]*Ct,t[1]*Ct))[0]*c+i,o-t[1]*c]}function k(t){return(t=a.invert((t[0]-i)/c,(o-t[1])/c))&&[t[0]*Ot,t[1]*Ot]}function T(){a=Xr(n=En(h,g,v),r);var t=r(d,p);return i=u-t[0]*c,o=f+t[1]*c,M()}function M(){return l&&(l.valid=!1,l=null),w}return w.stream=function(t){return l&&(l.valid=!1),(l=Dn(m(n,s(x(t))))).valid=!0,l},w.clipAngle=function(t){return arguments.length?(m=null==t?(b=t,rn):function(t){var e=Math.cos(t),r=e>0,n=y(e)>kt;return Jr(a,function(t){var e,l,s,c,u;return{lineStart:function(){c=s=!1,u=1},point:function(f,d){var p,h=[f,d],g=a(f,d),v=r?g?0:o(f,d):g?o(f+(f<0?Mt:-Mt),d):0;if(!e&&(c=s=g)&&t.lineStart(),g!==s&&(p=i(e,h),(Br(e,p)||Br(h,p))&&(h[0]+=kt,h[1]+=kt,g=a(h[0],h[1]))),g!==s)u=0,g?(t.lineStart(),p=i(h,e),t.point(p[0],p[1])):(p=i(e,h),t.point(p[0],p[1]),t.lineEnd()),e=p;else if(n&&e&&r^g){var m;v&l||!(m=i(h,e,!0))||(u=0,r?(t.lineStart(),t.point(m[0][0],m[0][1]),t.point(m[1][0],m[1][1]),t.lineEnd()):(t.point(m[1][0],m[1][1]),t.lineEnd(),t.lineStart(),t.point(m[0][0],m[0][1])))}!g||e&&Br(e,h)||t.point(h[0],h[1]),e=h,s=g,l=v},lineEnd:function(){s&&t.lineEnd(),e=null},clean:function(){return u|(c&&s)<<1}}},jn(t,6*Ct),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=Er(zr(t),zr(r)),o=Rr(i,i),l=i[0],s=o-l*l;if(!s)return!n&&t;var c=e*o/s,u=-e*l/s,f=Er(a,i),d=Fr(a,c);Ir(d,Fr(i,u));var p=f,h=Rr(d,p),g=Rr(p,p),v=h*h-g*(Rr(d,d)-1);if(!(v<0)){var m=Math.sqrt(v),x=Fr(p,(-h-m)/g);if(Ir(x,d),x=jr(x),!n)return x;var b,_=t[0],w=r[0],k=t[1],T=r[1];w<_&&(b=_,_=w,w=b);var M=w-_,A=y(M-Mt)<kt;if(!A&&T<k&&(b=k,k=T,T=b),A||M<kt?A?k+T>0^x[1]<(y(x[0]-_)<kt?k:T):k<=x[1]&&x[1]<=T:M>Mt^(_<=x[0]&&x[0]<=w)){var L=Fr(p,(-h+m)/g);return Ir(L,d),[x,jr(L)]}}}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}}((b=+t)*Ct),M()):b},w.clipExtent=function(t){return arguments.length?(_=t,x=t?on(t[0][0],t[0][1],t[1][0],t[1][1]):P,M()):_},w.scale=function(t){return arguments.length?(c=+t,T()):c},w.translate=function(t){return arguments.length?(u=+t[0],f=+t[1],T()):[u,f]},w.center=function(t){return arguments.length?(d=t[0]%360*Ct,p=t[1]%360*Ct,T()):[d*Ot,p*Ot]},w.rotate=function(t){return arguments.length?(h=t[0]%360*Ct,g=t[1]%360*Ct,v=t.length>2?t[2]%360*Ct:0,T()):[h*Ot,g*Ot,v*Ot]},t.rebind(w,s,"precision"),function(){return r=e.apply(this,arguments),w.invert=r.invert&&k,T()}}function Dn(t){return Cn(t,function(e,r){t.point(e*Ct,r*Ct)})}function zn(t,e){return[t,e]}function Rn(t,e){return[t>Mt?t-At:t<-Mt?t+At:t,e]}function En(t,e,r){return t?e||r?Xr(Fn(t),Nn(e,r)):Fn(t):e||r?Nn(e,r):Rn}function In(t){return function(e,r){return[(e+=t)>Mt?e-At:e<-Mt?e+At:e,r]}}function Fn(t){var e=In(t);return e.invert=In(-t),e}function Nn(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),l=Math.cos(t)*o,s=Math.sin(t)*o,c=Math.sin(e),u=c*r+l*n;return[Math.atan2(s*a-u*i,l*r-c*n),Rt(u*a+s*i)]}return o.invert=function(t,e){var o=Math.cos(e),l=Math.cos(t)*o,s=Math.sin(t)*o,c=Math.sin(e),u=c*a-s*i;return[Math.atan2(s*a+c*i,l*r+u*n),Rt(u*r-l*n)]},o}function jn(t,e){var r=Math.cos(t),n=Math.sin(t);return function(a,i,o,l){var s=o*e;null!=a?(a=Bn(r,a),i=Bn(r,i),(o>0?a<i:a>i)&&(a+=o*At)):(a=t+o*At,i=t-.5*s);for(var c,u=a;o>0?u>i:u<i;u-=s)l.point((c=jr([r,-n*Math.cos(u),-n*Math.sin(u)]))[0],c[1])}}function Bn(t,e){var r=zr(e);r[0]-=t,Nr(r);var n=zt(-r[1]);return((-r[2]<0?-n:n)+2*Math.PI-kt)%(2*Math.PI)}function Hn(e,r,n){var a=t.range(e,r-kt,n).concat(r);return function(t){return a.map(function(e){return[t,e]})}}function Vn(e,r,n){var a=t.range(e,r-kt,n).concat(r);return function(t){return a.map(function(e){return[e,t]})}}function qn(t){return t.source}function Un(t){return t.target}t.geo.path=function(){var e,r,n,a,i,o=4.5;function l(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 s(){return i=null,l}return l.area=function(e){return cn=0,t.geo.stream(e,n(gn)),cn},l.centroid=function(e){return _r=wr=kr=Tr=Mr=Ar=Lr=Sr=Cr=0,t.geo.stream(e,n(_n)),Cr?[Lr/Cr,Sr/Cr]:Ar?[Tr/Ar,Mr/Ar]:kr?[_r/kr,wr/kr]:[NaN,NaN]},l.bounds=function(e){return pn=hn=-(fn=dn=1/0),t.geo.stream(e,n(mn)),[[fn,dn],[pn,hn]]},l.projection=function(t){return arguments.length?(n=(e=t)?t.stream||(r=t,a=Ln(function(t,e){return r([t*Ot,e*Ot])}),function(t){return Dn(a(t))}):P,s()):e;var r,a},l.context=function(t){return arguments.length?(a=null==(r=t)?new yn:new An(t),"function"!=typeof o&&a.pointRadius(o),s()):r},l.pointRadius=function(t){return arguments.length?(o="function"==typeof t?t:(a.pointRadius(+t),+t),l):o},l.projection(t.geo.albersUsa()).context(null)},t.geo.transform=function(t){return{stream:function(e){var r=new Sn(e);for(var n in t)r[n]=t[n];return r}}},Sn.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=On,t.geo.projectionMutator=Pn,(t.geo.equirectangular=function(){return On(zn)}).raw=zn.invert=zn,t.geo.rotation=function(t){function e(e){return(e=t(e[0]*Ct,e[1]*Ct))[0]*=Ot,e[1]*=Ot,e}return t=En(t[0]%360*Ct,t[1]*Ct,t.length>2?t[2]*Ct:0),e.invert=function(e){return(e=t.invert(e[0]*Ct,e[1]*Ct))[0]*=Ot,e[1]*=Ot,e},e},Rn.invert=zn,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=En(-t[0]*Ct,-t[1]*Ct,0).invert,a=[];return e(null,null,1,{point:function(t,e){a.push(t=n(t,e)),t[0]*=Ot,t[1]*=Ot}}),{type:"Polygon",coordinates:[a]}}return a.origin=function(t){return arguments.length?(r=t,a):r},a.angle=function(r){return arguments.length?(e=jn((t=+r)*Ct,n*Ct),a):t},a.precision=function(r){return arguments.length?(e=jn(t*Ct,(n=+r)*Ct),a):n},a.angle(90)},t.geo.distance=function(t,e){var r,n=(e[0]-t[0])*Ct,a=t[1]*Ct,i=e[1]*Ct,o=Math.sin(n),l=Math.cos(n),s=Math.sin(a),c=Math.cos(a),u=Math.sin(i),f=Math.cos(i);return Math.atan2(Math.sqrt((r=f*o)*r+(r=c*u-s*f*l)*r),s*u+c*f*l)},t.geo.graticule=function(){var e,r,n,a,i,o,l,s,c,u,f,d,p=10,h=p,g=90,v=360,m=2.5;function x(){return{type:"MultiLineString",coordinates:b()}}function b(){return t.range(Math.ceil(a/g)*g,n,g).map(f).concat(t.range(Math.ceil(s/v)*v,l,v).map(d)).concat(t.range(Math.ceil(r/p)*p,e,p).filter(function(t){return y(t%g)>kt}).map(c)).concat(t.range(Math.ceil(o/h)*h,i,h).filter(function(t){return y(t%v)>kt}).map(u))}return x.lines=function(){return b().map(function(t){return{type:"LineString",coordinates:t}})},x.outline=function(){return{type:"Polygon",coordinates:[f(a).concat(d(l).slice(1),f(n).reverse().slice(1),d(s).reverse().slice(1))]}},x.extent=function(t){return arguments.length?x.majorExtent(t).minorExtent(t):x.minorExtent()},x.majorExtent=function(t){return arguments.length?(a=+t[0][0],n=+t[1][0],s=+t[0][1],l=+t[1][1],a>n&&(t=a,a=n,n=t),s>l&&(t=s,s=l,l=t),x.precision(m)):[[a,s],[n,l]]},x.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),x.precision(m)):[[r,o],[e,i]]},x.step=function(t){return arguments.length?x.majorStep(t).minorStep(t):x.minorStep()},x.majorStep=function(t){return arguments.length?(g=+t[0],v=+t[1],x):[g,v]},x.minorStep=function(t){return arguments.length?(p=+t[0],h=+t[1],x):[p,h]},x.precision=function(t){return arguments.length?(m=+t,c=Hn(o,i,90),u=Vn(r,e,m),f=Hn(s,l,90),d=Vn(a,n,m),x):m},x.majorExtent([[-180,-90+kt],[180,90-kt]]).minorExtent([[-180,-80-kt],[180,80+kt]])},t.geo.greatArc=function(){var e,r,n=qn,a=Un;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]*Ct,n=t[1]*Ct,a=e[0]*Ct,i=e[1]*Ct,o=Math.cos(n),l=Math.sin(n),s=Math.cos(i),c=Math.sin(i),u=o*Math.cos(r),f=o*Math.sin(r),d=s*Math.cos(a),p=s*Math.sin(a),h=2*Math.asin(Math.sqrt(It(i-n)+o*s*It(a-r))),g=1/Math.sin(h),(v=h?function(t){var e=Math.sin(t*=h)*g,r=Math.sin(h-t)*g,n=r*u+e*d,a=r*f+e*p,i=r*l+e*c;return[Math.atan2(a,n)*Ot,Math.atan2(i,Math.sqrt(n*n+a*a))*Ot]}:function(){return[r*Ot,n*Ot]}).distance=h,v;var r,n,a,i,o,l,s,c,u,f,d,p,h,g,v},t.geo.length=function(e){return bn=0,t.geo.stream(e,Gn),bn};var Gn={sphere:E,point:E,lineStart:function(){var t,e,r;function n(n,a){var i=Math.sin(a*=Ct),o=Math.cos(a),l=y((n*=Ct)-t),s=Math.cos(l);bn+=Math.atan2(Math.sqrt((l=o*Math.sin(l))*l+(l=r*i-e*o*s)*l),e*i+r*o*s),t=n,e=i,r=o}Gn.point=function(a,i){t=a*Ct,e=Math.sin(i*=Ct),r=Math.cos(i),Gn.point=n},Gn.lineEnd=function(){Gn.point=Gn.lineEnd=E}},lineEnd:E,polygonStart:E,polygonEnd:E};function Zn(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 Xn=Zn(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(t.geo.azimuthalEqualArea=function(){return On(Xn)}).raw=Xn;var Yn=Zn(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},P);function Wn(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 Jn;function o(t,e){i>0?e<-St+kt&&(e=-St+kt):e>St-kt&&(e=St-kt);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=Pt(a)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/a,2*Math.atan(Math.pow(i/n,1/a))-St]},o}function $n(t,e){var r=Math.cos(t),n=t===e?Math.sin(t):(r-Math.cos(e))/(e-t),a=r/n+t;if(y(n)<kt)return zn;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-Pt(n)*Math.sqrt(t*t+r*r)]},i}(t.geo.azimuthalEquidistant=function(){return On(Yn)}).raw=Yn,(t.geo.conicConformal=function(){return ln(Wn)}).raw=Wn,(t.geo.conicEquidistant=function(){return ln($n)}).raw=$n;var Qn=Zn(function(t){return 1/t},Math.atan);function Jn(t,e){return[t,Math.log(Math.tan(Mt/4+e/2))]}function Kn(t){var e,r=On(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 l=Mt*n(),s=a();i([[s[0]-l,s[1]-l],[s[0]+l,s[1]+l]])}}else e&&(o=null);return o},r.clipExtent(null)}(t.geo.gnomonic=function(){return On(Qn)}).raw=Qn,Jn.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-St]},(t.geo.mercator=function(){return Kn(Jn)}).raw=Jn;var ta=Zn(function(){return 1},Math.asin);(t.geo.orthographic=function(){return On(ta)}).raw=ta;var ea=Zn(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});function ra(t,e){return[Math.log(Math.tan(Mt/4+e/2)),-t]}function na(t){return t[0]}function aa(t){return t[1]}function ia(t){for(var e=t.length,r=[0,1],n=2,a=2;a<e;a++){for(;n>1&&Dt(t[r[n-2]],t[r[n-1]],t[a])<=0;)--n;r[n++]=a}return r.slice(0,n)}function oa(t,e){return t[0]-e[0]||t[1]-e[1]}(t.geo.stereographic=function(){return On(ea)}).raw=ea,ra.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-St]},(t.geo.transverseMercator=function(){var t=Kn(ra),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=ra,t.geom={},t.geom.hull=function(t){var e=na,r=aa;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,a=ve(e),i=ve(r),o=t.length,l=[],s=[];for(n=0;n<o;n++)l.push([+a.call(this,t[n],n),+i.call(this,t[n],n),n]);for(l.sort(oa),n=0;n<o;n++)s.push([l[n][0],-l[n][1]]);var c=ia(l),u=ia(s),f=u[0]===c[0],d=u[u.length-1]===c[c.length-1],p=[];for(n=c.length-1;n>=0;--n)p.push(t[l[c[n]][2]]);for(n=+f;n<u.length-d;++n)p.push(t[l[u[n]][2]]);return p}return n.x=function(t){return arguments.length?(e=t,n):e},n.y=function(t){return arguments.length?(r=t,n):r},n},t.geom.polygon=function(t){return V(t,la),t};var la=t.geom.polygon.prototype=[];function sa(t,e,r){return(r[0]-e[0])*(t[1]-e[1])<(r[1]-e[1])*(t[0]-e[0])}function ca(t,e,r,n){var a=t[0],i=r[0],o=e[0]-a,l=n[0]-i,s=t[1],c=r[1],u=e[1]-s,f=n[1]-c,d=(l*(s-c)-f*(a-i))/(f*o-l*u);return[a+d*o,s+d*u]}function ua(t){var e=t[0],r=t[t.length-1];return!(e[0]-r[0]||e[1]-r[1])}la.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},la.centroid=function(t){var e,r,n=-1,a=this.length,i=0,o=0,l=this[a-1];for(arguments.length||(t=-1/(6*this.area()));++n<a;)e=l,l=this[n],r=e[0]*l[1]-l[0]*e[1],i+=(e[0]+l[0])*r,o+=(e[1]+l[1])*r;return[i*t,o*t]},la.clip=function(t){for(var e,r,n,a,i,o,l=ua(t),s=-1,c=this.length-ua(this),u=this[c-1];++s<c;){for(e=t.slice(),t.length=0,a=this[s],i=e[(n=e.length-l)-1],r=-1;++r<n;)sa(o=e[r],u,a)?(sa(i,u,a)||t.push(ca(i,o,u,a)),t.push(o)):sa(i,u,a)&&t.push(ca(i,o,u,a)),i=o;l&&t.push(t[0]),u=a}return t};var fa,da,pa,ha,ga,va=[],ma=[];function ya(){Ia(this),this.edge=this.site=this.circle=null}function xa(t){var e=va.pop()||new ya;return e.site=t,e}function ba(t){Ca(t),pa.remove(t),va.push(t),Ia(t)}function _a(t){var e=t.circle,r=e.x,n=e.cy,a={x:r,y:n},i=t.P,o=t.N,l=[t];ba(t);for(var s=i;s.circle&&y(r-s.circle.x)<kt&&y(n-s.circle.cy)<kt;)i=s.P,l.unshift(s),ba(s),s=i;l.unshift(s),Ca(s);for(var c=o;c.circle&&y(r-c.circle.x)<kt&&y(n-c.circle.cy)<kt;)o=c.N,l.push(c),ba(c),c=o;l.push(c),Ca(c);var u,f=l.length;for(u=1;u<f;++u)c=l[u],s=l[u-1],za(c.edge,s.site,c.site,a);s=l[0],(c=l[f-1]).edge=Da(s.site,c.site,null,a),Sa(s),Sa(c)}function wa(t){for(var e,r,n,a,i=t.x,o=t.y,l=pa._;l;)if((n=ka(l,o)-i)>kt)l=l.L;else{if(!((a=i-Ta(l,o))>kt)){n>-kt?(e=l.P,r=l):a>-kt?(e=l,r=l.N):e=r=l;break}if(!l.R){e=l;break}l=l.R}var s=xa(t);if(pa.insert(e,s),e||r){if(e===r)return Ca(e),r=xa(e.site),pa.insert(s,r),s.edge=r.edge=Da(e.site,s.site),Sa(e),void Sa(r);if(r){Ca(e),Ca(r);var c=e.site,u=c.x,f=c.y,d=t.x-u,p=t.y-f,h=r.site,g=h.x-u,v=h.y-f,m=2*(d*v-p*g),y=d*d+p*p,x=g*g+v*v,b={x:(v*y-p*x)/m+u,y:(d*x-g*y)/m+f};za(r.edge,c,h,b),s.edge=Da(c,t,null,b),r.edge=Da(t,h,null,b),Sa(e),Sa(r)}else s.edge=Da(e.site,s.site)}}function ka(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 l=(r=o.site).x,s=r.y,c=s-e;if(!c)return l;var u=l-n,f=1/i-1/c,d=u/c;return f?(-d+Math.sqrt(d*d-2*f*(u*u/(-2*c)-s+c/2+a-i/2)))/f+n:(n+l)/2}function Ta(t,e){var r=t.N;if(r)return ka(r,e);var n=t.site;return n.y===e?n.x:1/0}function Ma(t){this.site=t,this.edges=[]}function Aa(t,e){return e.angle-t.angle}function La(){Ia(this),this.x=this.y=this.arc=this.site=this.cy=null}function Sa(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,l=a.y,s=n.x-o,c=n.y-l,u=i.x-o,f=2*(s*(v=i.y-l)-c*u);if(!(f>=-Tt)){var d=s*s+c*c,p=u*u+v*v,h=(v*d-c*p)/f,g=(s*p-u*d)/f,v=g+l,m=ma.pop()||new La;m.arc=t,m.site=a,m.x=h+o,m.y=v+Math.sqrt(h*h+g*g),m.cy=v,t.circle=m;for(var y=null,x=ga._;x;)if(m.y<x.y||m.y===x.y&&m.x<=x.x){if(!x.L){y=x.P;break}x=x.L}else{if(!x.R){y=x;break}x=x.R}ga.insert(y,m),y||(ha=m)}}}}function Ca(t){var e=t.circle;e&&(e.P||(ha=e.N),ga.remove(e),ma.push(e),Ia(e),t.circle=null)}function Oa(t,e){var r=t.b;if(r)return!0;var n,a,i=t.a,o=e[0][0],l=e[1][0],s=e[0][1],c=e[1][1],u=t.l,f=t.r,d=u.x,p=u.y,h=f.x,g=f.y,v=(d+h)/2,m=(p+g)/2;if(g===p){if(v<o||v>=l)return;if(d>h){if(i){if(i.y>=c)return}else i={x:v,y:s};r={x:v,y:c}}else{if(i){if(i.y<s)return}else i={x:v,y:c};r={x:v,y:s}}}else if(a=m-(n=(d-h)/(g-p))*v,n<-1||n>1)if(d>h){if(i){if(i.y>=c)return}else i={x:(s-a)/n,y:s};r={x:(c-a)/n,y:c}}else{if(i){if(i.y<s)return}else i={x:(c-a)/n,y:c};r={x:(s-a)/n,y:s}}else if(p<g){if(i){if(i.x>=l)return}else i={x:o,y:n*o+a};r={x:l,y:n*l+a}}else{if(i){if(i.x<o)return}else i={x:l,y:n*l+a};r={x:o,y:n*o+a}}return t.a=i,t.b=r,!0}function Pa(t,e){this.l=t,this.r=e,this.a=this.b=null}function Da(t,e,r,n){var a=new Pa(t,e);return fa.push(a),r&&za(a,t,e,r),n&&za(a,e,t,n),da[t.i].edges.push(new Ra(a,t,e)),da[e.i].edges.push(new Ra(a,e,t)),a}function za(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 Ra(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 Ea(){this._=null}function Ia(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function Fa(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 Na(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 ja(t){for(;t.L;)t=t.L;return t}function Ba(t,e){var r,n,a,i=t.sort(Ha).pop();for(fa=[],da=new Array(t.length),pa=new Ea,ga=new Ea;;)if(a=ha,i&&(!a||i.y<a.y||i.y===a.y&&i.x<a.x))i.x===r&&i.y===n||(da[i.i]=new Ma(i),wa(i),r=i.x,n=i.y),i=t.pop();else{if(!a)break;_a(a.arc)}e&&(function(t){for(var e,r=fa,n=nn(t[0][0],t[0][1],t[1][0],t[1][1]),a=r.length;a--;)(!Oa(e=r[a],t)||!n(e)||y(e.a.x-e.b.x)<kt&&y(e.a.y-e.b.y)<kt)&&(e.a=e.b=null,r.splice(a,1))}(e),function(t){for(var e,r,n,a,i,o,l,s,c,u,f=t[0][0],d=t[1][0],p=t[0][1],h=t[1][1],g=da,v=g.length;v--;)if((i=g[v])&&i.prepare())for(s=(l=i.edges).length,o=0;o<s;)n=(u=l[o].end()).x,a=u.y,e=(c=l[++o%s].start()).x,r=c.y,(y(n-e)>kt||y(a-r)>kt)&&(l.splice(o,0,new Ra((m=i.site,x=u,b=y(n-f)<kt&&h-a>kt?{x:f,y:y(e-f)<kt?r:h}:y(a-h)<kt&&d-n>kt?{x:y(r-h)<kt?e:d,y:h}:y(n-d)<kt&&a-p>kt?{x:d,y:y(e-d)<kt?r:p}:y(a-p)<kt&&n-f>kt?{x:y(r-p)<kt?e:f,y:p}:null,_=void 0,_=new Pa(m,null),_.a=x,_.b=b,fa.push(_),_),i.site,null)),++s);var m,x,b,_}(e));var o={cells:da,edges:fa};return pa=ga=fa=da=null,o}function Ha(t,e){return e.y-t.y||e.x-t.x}Ma.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(Aa),e.length},Ra.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}},Ea.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=ja(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&&(Fa(this,r),r=(t=r).U),r.C=!1,n.C=!0,Na(this,n)):(a=n.L)&&a.C?(r.C=a.C=!1,n.C=!0,t=n):(t===r.L&&(Na(this,r),r=(t=r).U),r.C=!1,n.C=!0,Fa(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?ja(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,Fa(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,Na(this,e),e=a.R),e.C=a.C,a.C=e.R.C=!1,Fa(this,a),t=this._;break}}else if((e=a.L).C&&(e.C=!1,a.C=!0,Na(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,Fa(this,e),e=a.L),e.C=a.C,a.C=e.L.C=!1,Na(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=na,r=aa,n=e,a=r,i=Va;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 Ba(l(t),i).cells.forEach(function(i,l){var s=i.edges,c=i.site;(e[l]=s.length?s.map(function(t){var e=t.start();return[e.x,e.y]}):c.x>=r&&c.x<=a&&c.y>=n&&c.y<=o?[[r,o],[a,o],[a,n],[r,n]]:[]).point=t[l]}),e}function l(t){return t.map(function(t,e){return{x:Math.round(n(t,e)/kt)*kt,y:Math.round(a(t,e)/kt)*kt,i:e}})}return o.links=function(t){return Ba(l(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 Ba(l(t)).cells.forEach(function(r,n){for(var a,i,o,l,s=r.site,c=r.edges.sort(Aa),u=-1,f=c.length,d=c[f-1].edge,p=d.l===s?d.r:d.l;++u<f;)d,a=p,p=(d=c[u].edge).l===s?d.r:d.l,n<a.i&&n<p.i&&(o=a,l=p,((i=s).x-l.x)*(o.y-i.y)-(i.x-o.x)*(l.y-i.y)<0)&&e.push([t[n],t[a.i],t[p.i]])}),e},o.x=function(t){return arguments.length?(n=ve(e=t),o):e},o.y=function(t){return arguments.length?(a=ve(r=t),o):r},o.clipExtent=function(t){return arguments.length?(i=null==t?Va:t,o):i===Va?null:i},o.size=function(t){return arguments.length?o.clipExtent(t&&[[0,0],t]):i===Va?null:i&&i[1]},o};var Va=[[-1e6,-1e6],[1e6,1e6]];function qa(t){return t.x}function Ua(t){return t.y}function Ga(e,r){e=t.rgb(e),r=t.rgb(r);var n=e.r,a=e.g,i=e.b,o=r.r-n,l=r.g-a,s=r.b-i;return function(t){return"#"+ce(Math.round(n+o*t))+ce(Math.round(a+l*t))+ce(Math.round(i+s*t))}}function Za(t,e){var r,n={},a={};for(r in t)r in e?n[r]=Qa(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 Xa(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function Ya(t,e){var r,n,a,i=Wa.lastIndex=$a.lastIndex=0,o=-1,l=[],s=[];for(t+="",e+="";(r=Wa.exec(t))&&(n=$a.exec(e));)(a=n.index)>i&&(a=e.slice(i,a),l[o]?l[o]+=a:l[++o]=a),(r=r[0])===(n=n[0])?l[o]?l[o]+=n:l[++o]=n:(l[++o]=null,s.push({i:o,x:Xa(r,n)})),i=$a.lastIndex;return i<e.length&&(a=e.slice(i),l[o]?l[o]+=a:l[++o]=a),l.length<2?s[0]?(e=s[0].x,function(t){return e(t)+""}):function(){return e}:(e=s.length,function(t){for(var r,n=0;n<e;++n)l[(r=s[n]).i]=r.x(t);return l.join("")})}t.geom.delaunay=function(e){return t.geom.voronoi().triangles(e)},t.geom.quadtree=function(t,e,r,n,a){var i,o=na,l=aa;if(i=arguments.length)return o=qa,l=Ua,3===i&&(a=r,n=e,r=e=0),s(t);function s(t){var s,c,u,f,d,p,h,g,v,m=ve(o),x=ve(l);if(null!=e)p=e,h=r,g=n,v=a;else if(g=v=-(p=h=1/0),c=[],u=[],d=t.length,i)for(f=0;f<d;++f)(s=t[f]).x<p&&(p=s.x),s.y<h&&(h=s.y),s.x>g&&(g=s.x),s.y>v&&(v=s.y),c.push(s.x),u.push(s.y);else for(f=0;f<d;++f){var b=+m(s=t[f],f),_=+x(s,f);b<p&&(p=b),_<h&&(h=_),b>g&&(g=b),_>v&&(v=_),c.push(b),u.push(_)}var w=g-p,k=v-h;function T(t,e,r,n,a,i,o,l){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var s=t.x,c=t.y;if(null!=s)if(y(s-r)+y(c-n)<.01)M(t,e,r,n,a,i,o,l);else{var u=t.point;t.x=t.y=t.point=null,M(t,u,s,c,a,i,o,l),M(t,e,r,n,a,i,o,l)}else t.x=r,t.y=n,t.point=e}else M(t,e,r,n,a,i,o,l)}function M(t,e,r,n,a,i,o,l){var s=.5*(a+o),c=.5*(i+l),u=r>=s,f=n>=c,d=f<<1|u;t.leaf=!1,u?a=s:o=s,f?i=c:l=c,T(t=t.nodes[d]||(t.nodes[d]={leaf:!0,nodes:[],point:null,x:null,y:null}),e,r,n,a,i,o,l)}w>k?v=h+w:g=p+k;var A={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){T(A,t,+m(t,++f),+x(t,f),p,h,g,v)}};if(A.visit=function(t){!function t(e,r,n,a,i,o){if(!e(r,n,a,i,o)){var l=.5*(n+i),s=.5*(a+o),c=r.nodes;c[0]&&t(e,c[0],n,a,l,s),c[1]&&t(e,c[1],l,a,i,s),c[2]&&t(e,c[2],n,s,l,o),c[3]&&t(e,c[3],l,s,i,o)}}(t,A,p,h,g,v)},A.find=function(t){return function(t,e,r,n,a,i,o){var l,s=1/0;return function t(c,u,f,d,p){if(!(u>i||f>o||d<n||p<a)){if(h=c.point){var h,g=e-c.x,v=r-c.y,m=g*g+v*v;if(m<s){var y=Math.sqrt(s=m);n=e-y,a=r-y,i=e+y,o=r+y,l=h}}for(var x=c.nodes,b=.5*(u+d),_=.5*(f+p),w=(r>=_)<<1|e>=b,k=w+4;w<k;++w)if(c=x[3&w])switch(3&w){case 0:t(c,u,f,b,_);break;case 1:t(c,b,f,d,_);break;case 2:t(c,u,_,b,p);break;case 3:t(c,b,_,d,p)}}}(t,n,a,i,o),l}(A,t[0],t[1],p,h,g,v)},f=-1,null==e){for(;++f<d;)T(A,t[f],c[f],u[f],p,h,g,v);--f}else t.forEach(A.add);return c=u=t=s=null,A}return s.x=function(t){return arguments.length?(o=t,s):o},s.y=function(t){return arguments.length?(l=t,s):l},s.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]),s):null==e?null:[[e,r],[n,a]]},s.size=function(t){return arguments.length?(null==t?e=r=n=a=null:(e=r=0,n=+t[0],a=+t[1]),s):null==e?null:[n-e,a-r]},s},t.interpolateRgb=Ga,t.interpolateObject=Za,t.interpolateNumber=Xa,t.interpolateString=Ya;var Wa=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,$a=new RegExp(Wa.source,"g");function Qa(e,r){for(var n,a=t.interpolators.length;--a>=0&&!(n=t.interpolators[a](e,r)););return n}function Ja(t,e){var r,n=[],a=[],i=t.length,o=e.length,l=Math.min(t.length,e.length);for(r=0;r<l;++r)n.push(Qa(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<l;++r)a[r]=n[r](t);return a}}t.interpolate=Qa,t.interpolators=[function(t,e){var r=typeof e;return("string"===r?ge.has(e.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(e)?Ga:Ya:e instanceof Ht?Ga:Array.isArray(e)?Ja:"object"===r&&isNaN(e)?Za:Xa)(t,e)}],t.interpolateArray=Ja;var Ka=function(){return P},ti=t.map({linear:Ka,poly:function(t){return function(e){return Math.pow(e,t)}},quad:function(){return ai},cubic:function(){return ii},sin:function(){return li},exp:function(){return si},circle:function(){return ci},elastic:function(t,e){var r;arguments.length<2&&(e=.45);arguments.length?r=e/At*Math.asin(1/t):(t=1,r=e/4);return function(n){return 1+t*Math.pow(2,-10*n)*Math.sin((n-r)*At/e)}},back:function(t){t||(t=1.70158);return function(e){return e*e*((t+1)*e-t)}},bounce:function(){return ui}}),ei=t.map({in:P,out:ri,"in-out":ni,"out-in":function(t){return ni(ri(t))}});function ri(t){return function(e){return 1-t(1-e)}}function ni(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function ai(t){return t*t}function ii(t){return t*t*t}function oi(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 li(t){return 1-Math.cos(t*St)}function si(t){return Math.pow(2,10*(t-1))}function ci(t){return 1-Math.sqrt(1-t*t)}function ui(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 fi(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function di(t){var e,r,n,a=[t.a,t.b],i=[t.c,t.d],o=hi(a),l=pi(a,i),s=hi(((e=i)[0]+=(n=-l)*(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,l*=-1),this.rotate=(o?Math.atan2(a[1],a[0]):Math.atan2(-i[0],i[1]))*Ot,this.translate=[t.e,t.f],this.scale=[o,s],this.skew=s?Math.atan2(l,s)*Ot:0}function pi(t,e){return t[0]*e[0]+t[1]*e[1]}function hi(t){var e=Math.sqrt(pi(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=ti.get(a)||Ka,i=ei.get(i)||P,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,l=r.c-a,s=r.l-i;isNaN(l)&&(l=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);return function(t){return Xt(n+o*t,a+l*t,i+s*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,l=r.s-a,s=r.l-i;isNaN(l)&&(l=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);return function(t){return Ut(n+o*t,a+l*t,i+s*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,l=r.a-a,s=r.b-i;return function(t){return te(n+o*t,a+l*t,i+s*t)+""}},t.interpolateRound=fi,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 di(e?e.matrix:gi)})(e)},di.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var gi={a:1,b:0,c:0,d:1,e:0,f:0};function vi(t){return t.length?t.pop()+",":""}function mi(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:Xa(t[0],e[0])},{i:a-2,x:Xa(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(vi(r)+"rotate(",null,")")-2,x:Xa(t,e)})):e&&r.push(vi(r)+"rotate("+e+")")}(e.rotate,r.rotate,n,a),function(t,e,r,n){t!==e?n.push({i:r.push(vi(r)+"skewX(",null,")")-2,x:Xa(t,e)}):e&&r.push(vi(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(vi(r)+"scale(",null,",",null,")");n.push({i:a-4,x:Xa(t[0],e[0])},{i:a-2,x:Xa(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(vi(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 yi(t,e){return e=(e-=t=+t)||1/e,function(r){return(r-t)/e}}function xi(t,e){return e=(e-=t=+t)||1/e,function(r){return Math.max(0,Math.min(1,(r-t)/e))}}function bi(t){for(var e=t.source,r=t.target,n=function(t,e){if(t===e)return t;var r=_i(t),n=_i(e),a=r.pop(),i=n.pop(),o=null;for(;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 _i(t){for(var e=[],r=t.parent;null!=r;)e.push(t),t=r,r=r.parent;return e.push(t),e}function wi(t){t.fixed|=2}function ki(t){t.fixed&=-7}function Ti(t){t.fixed|=4,t.px=t.x,t.py=t.y}function Mi(t){t.fixed&=-5}t.interpolateTransform=mi,t.layout={},t.layout.bundle=function(){return function(t){for(var e=[],r=-1,n=t.length;++r<n;)e.push(bi(t[r]));return e}},t.layout.chord=function(){var e,r,n,a,i,o,l,s={},c=0;function u(){var s,u,d,p,h,g={},v=[],m=t.range(a),y=[];for(e=[],r=[],s=0,p=-1;++p<a;){for(u=0,h=-1;++h<a;)u+=n[p][h];v.push(u),y.push(t.range(a)),s+=u}for(i&&m.sort(function(t,e){return i(v[t],v[e])}),o&&y.forEach(function(t,e){t.sort(function(t,r){return o(n[e][t],n[e][r])})}),s=(At-c*a)/s,u=0,p=-1;++p<a;){for(d=u,h=-1;++h<a;){var x=m[p],b=y[x][h],_=n[x][b],w=u,k=u+=_*s;g[x+"-"+b]={index:x,subindex:b,startAngle:w,endAngle:k,value:_}}r[x]={index:x,startAngle:d,endAngle:u,value:v[x]},u+=c}for(p=-1;++p<a;)for(h=p-1;++h<a;){var T=g[p+"-"+h],M=g[h+"-"+p];(T.value||M.value)&&e.push(T.value<M.value?{source:M,target:T}:{source:T,target:M})}l&&f()}function f(){e.sort(function(t,e){return l((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)})}return s.matrix=function(t){return arguments.length?(a=(n=t)&&n.length,e=r=null,s):n},s.padding=function(t){return arguments.length?(c=t,e=r=null,s):c},s.sortGroups=function(t){return arguments.length?(i=t,e=r=null,s):i},s.sortSubgroups=function(t){return arguments.length?(o=t,e=null,s):o},s.sortChords=function(t){return arguments.length?(l=t,e&&f(),s):l},s.chords=function(){return e||u(),e},s.groups=function(){return r||u(),r},s},t.layout.force=function(){var e,r,n,a,i,o,l={},s=t.dispatch("start","tick","end"),c=[1,1],u=.9,f=Ai,d=Li,p=-30,h=Si,g=.1,v=.64,m=[],y=[];function x(t){return function(e,r,n,a){if(e.point!==t){var i=e.cx-t.x,o=e.cy-t.y,l=a-r,s=i*i+o*o;if(l*l/v<s){if(s<h){var c=e.charge/s;t.px-=i*c,t.py-=o*c}return!0}if(e.point&&s&&s<h){c=e.pointCharge/s;t.px-=i*c,t.py-=o*c}}return!e.charge}}function b(e){e.px=t.event.x,e.py=t.event.y,l.resume()}return l.tick=function(){if((n*=.99)<.005)return e=null,s.end({type:"end",alpha:n=0}),!0;var r,l,f,d,h,v,b,_,w,k=m.length,T=y.length;for(l=0;l<T;++l)d=(f=y[l]).source,(v=(_=(h=f.target).x-d.x)*_+(w=h.y-d.y)*w)&&(_*=v=n*i[l]*((v=Math.sqrt(v))-a[l])/v,w*=v,h.x-=_*(b=d.weight+h.weight?d.weight/(d.weight+h.weight):.5),h.y-=w*b,d.x+=_*(b=1-b),d.y+=w*b);if((b=n*g)&&(_=c[0]/2,w=c[1]/2,l=-1,b))for(;++l<k;)(f=m[l]).x+=(_-f.x)*b,f.y+=(w-f.y)*b;if(p)for(!function t(e,r,n){var a=0,i=0;e.charge=0;if(!e.leaf)for(var o,l=e.nodes,s=l.length,c=-1;++c<s;)null!=(o=l[c])&&(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 u=r*n[e.point.index];e.charge+=e.pointCharge=u,a+=u*e.point.x,i+=u*e.point.y}e.cx=a/e.charge;e.cy=i/e.charge}(r=t.geom.quadtree(m),n,o),l=-1;++l<k;)(f=m[l]).fixed||r.visit(x(f));for(l=-1;++l<k;)(f=m[l]).fixed?(f.x=f.px,f.y=f.py):(f.x-=(f.px-(f.px=f.x))*u,f.y-=(f.py-(f.py=f.y))*u);s.tick({type:"tick",alpha:n})},l.nodes=function(t){return arguments.length?(m=t,l):m},l.links=function(t){return arguments.length?(y=t,l):y},l.size=function(t){return arguments.length?(c=t,l):c},l.linkDistance=function(t){return arguments.length?(f="function"==typeof t?t:+t,l):f},l.distance=l.linkDistance,l.linkStrength=function(t){return arguments.length?(d="function"==typeof t?t:+t,l):d},l.friction=function(t){return arguments.length?(u=+t,l):u},l.charge=function(t){return arguments.length?(p="function"==typeof t?t:+t,l):p},l.chargeDistance=function(t){return arguments.length?(h=t*t,l):Math.sqrt(h)},l.gravity=function(t){return arguments.length?(g=+t,l):g},l.theta=function(t){return arguments.length?(v=t*t,l):Math.sqrt(v)},l.alpha=function(t){return arguments.length?(t=+t,n?t>0?n=t:(e.c=null,e.t=NaN,e=null,s.end({type:"end",alpha:n=0})):t>0&&(s.start({type:"start",alpha:n=t}),e=Te(l.tick)),l):n},l.start=function(){var t,e,r,n=m.length,s=y.length,u=c[0],h=c[1];for(t=0;t<n;++t)(r=m[t]).index=t,r.weight=0;for(t=0;t<s;++t)"number"==typeof(r=y[t]).source&&(r.source=m[r.source]),"number"==typeof r.target&&(r.target=m[r.target]),++r.source.weight,++r.target.weight;for(t=0;t<n;++t)r=m[t],isNaN(r.x)&&(r.x=g("x",u)),isNaN(r.y)&&(r.y=g("y",h)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(a=[],"function"==typeof f)for(t=0;t<s;++t)a[t]=+f.call(this,y[t],t);else for(t=0;t<s;++t)a[t]=f;if(i=[],"function"==typeof d)for(t=0;t<s;++t)i[t]=+d.call(this,y[t],t);else for(t=0;t<s;++t)i[t]=d;if(o=[],"function"==typeof p)for(t=0;t<n;++t)o[t]=+p.call(this,m[t],t);else for(t=0;t<n;++t)o[t]=p;function g(r,a){if(!e){for(e=new Array(n),c=0;c<n;++c)e[c]=[];for(c=0;c<s;++c){var i=y[c];e[i.source.index].push(i.target),e[i.target.index].push(i.source)}}for(var o,l=e[t],c=-1,u=l.length;++c<u;)if(!isNaN(o=l[c][r]))return o;return Math.random()*a}return l.resume()},l.resume=function(){return l.alpha(.1)},l.stop=function(){return l.alpha(0)},l.drag=function(){if(r||(r=t.behavior.drag().origin(P).on("dragstart.force",wi).on("drag.force",b).on("dragend.force",ki)),!arguments.length)return r;this.on("mouseover.force",Ti).on("mouseout.force",Mi).call(r)},t.rebind(l,s,"on")};var Ai=20,Li=1,Si=1/0;function Ci(e,r){return t.rebind(e,r,"sort","children","value"),e.nodes=e,e.links=Ei,e}function Oi(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 Pi(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 Di(t){return t.children}function zi(t){return t.value}function Ri(t,e){return e.value-t.value}function Ei(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=Ri,e=Di,r=zi;function n(a){var i,o=[a],l=[];for(a.depth=0;null!=(i=o.pop());)if(l.push(i),(c=e.call(n,i,i.depth))&&(s=c.length)){for(var s,c,u;--s>=0;)o.push(u=c[s]),u.parent=i,u.depth=i.depth+1;r&&(i.value=0),i.children=c}else r&&(i.value=+r.call(n,i,i.depth)||0),delete i.children;return Pi(a,function(e){var n,a;t&&(n=e.children)&&n.sort(t),r&&(a=e.parent)&&(a.value+=e.value)}),l}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&&(Oi(t,function(t){t.children&&(t.value=0)}),Pi(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,l,s,c=-1;for(n=e.value?n/e.value:0;++c<o;)t(l=i[c],r,s=l.value*n,a),r+=s}}(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},Ci(n,e)},t.layout.pie=function(){var e=Number,r=Ii,n=0,a=At,i=0;function o(l){var s,c=l.length,u=l.map(function(t,r){return+e.call(o,t,r)}),f=+("function"==typeof n?n.apply(this,arguments):n),d=("function"==typeof a?a.apply(this,arguments):a)-f,p=Math.min(Math.abs(d)/c,+("function"==typeof i?i.apply(this,arguments):i)),h=p*(d<0?-1:1),g=t.sum(u),v=g?(d-c*h)/g:0,m=t.range(c),y=[];return null!=r&&m.sort(r===Ii?function(t,e){return u[e]-u[t]}:function(t,e){return r(l[t],l[e])}),m.forEach(function(t){y[t]={data:l[t],value:s=u[t],startAngle:f,endAngle:f+=s*v+h,padAngle:p}}),y}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 Ii={};function Fi(t){return t.x}function Ni(t){return t.y}function ji(t,e,r){t.y0=e,t.y=r}t.layout.stack=function(){var e=P,r=Vi,n=qi,a=ji,i=Fi,o=Ni;function l(s,c){if(!(p=s.length))return s;var u=s.map(function(t,r){return e.call(l,t,r)}),f=u.map(function(t){return t.map(function(t,e){return[i.call(l,t,e),o.call(l,t,e)]})}),d=r.call(l,f,c);u=t.permute(u,d),f=t.permute(f,d);var p,h,g,v,m=n.call(l,f,c),y=u[0].length;for(g=0;g<y;++g)for(a.call(l,u[0][g],v=m[g],f[0][g][1]),h=1;h<p;++h)a.call(l,u[h][g],v+=f[h-1][g][1],f[h][g][1]);return s}return l.values=function(t){return arguments.length?(e=t,l):e},l.order=function(t){return arguments.length?(r="function"==typeof t?t:Bi.get(t)||Vi,l):r},l.offset=function(t){return arguments.length?(n="function"==typeof t?t:Hi.get(t)||qi,l):n},l.x=function(t){return arguments.length?(i=t,l):i},l.y=function(t){return arguments.length?(o=t,l):o},l.out=function(t){return arguments.length?(a=t,l):a},l};var Bi=t.map({"inside-out":function(e){var r,n,a=e.length,i=e.map(Ui),o=e.map(Gi),l=t.range(a).sort(function(t,e){return i[t]-i[e]}),s=0,c=0,u=[],f=[];for(r=0;r<a;++r)n=l[r],s<c?(s+=o[n],u.push(n)):(c+=o[n],f.push(n));return f.reverse().concat(u)},reverse:function(e){return t.range(e.length).reverse()},default:Vi}),Hi=t.map({silhouette:function(t){var e,r,n,a=t.length,i=t[0].length,o=[],l=0,s=[];for(r=0;r<i;++r){for(e=0,n=0;e<a;e++)n+=t[e][r][1];n>l&&(l=n),o.push(n)}for(r=0;r<i;++r)s[r]=(l-o[r])/2;return s},wiggle:function(t){var e,r,n,a,i,o,l,s,c,u=t.length,f=t[0],d=f.length,p=[];for(p[0]=s=c=0,r=1;r<d;++r){for(e=0,a=0;e<u;++e)a+=t[e][r][1];for(e=0,i=0,l=f[r][0]-f[r-1][0];e<u;++e){for(n=0,o=(t[e][r][1]-t[e][r-1][1])/(2*l);n<e;++n)o+=(t[n][r][1]-t[n][r-1][1])/l;i+=o*t[e][r][1]}p[r]=s-=a?i/a*l:0,s<c&&(c=s)}for(r=0;r<d;++r)p[r]-=c;return p},expand:function(t){var e,r,n,a=t.length,i=t[0].length,o=1/a,l=[];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)l[r]=0;return l},zero:qi});function Vi(e){return t.range(e.length)}function qi(t){for(var e=-1,r=t[0].length,n=[];++e<r;)n[e]=0;return n}function Ui(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 Gi(t){return t.reduce(Zi,0)}function Zi(t,e){return t+e[1]}function Xi(t,e){return Yi(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function Yi(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 Wi(e){return[t.min(e),t.max(e)]}function $i(t,e){return t.value-e.value}function Qi(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function Ji(t,e){t._pack_next=e,e._pack_prev=t}function Ki(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 to(t){if((e=t.children)&&(s=e.length)){var e,r,n,a,i,o,l,s,c=1/0,u=-1/0,f=1/0,d=-1/0;if(e.forEach(eo),(r=e[0]).x=-r.r,r.y=0,x(r),s>1&&((n=e[1]).x=n.r,n.y=0,x(n),s>2))for(no(r,n,a=e[2]),x(a),Qi(r,a),r._pack_prev=a,Qi(a,n),n=r._pack_next,i=3;i<s;i++){no(r,n,a=e[i]);var p=0,h=1,g=1;for(o=n._pack_next;o!==n;o=o._pack_next,h++)if(Ki(o,a)){p=1;break}if(1==p)for(l=r._pack_prev;l!==o._pack_prev&&!Ki(l,a);l=l._pack_prev,g++);p?(h<g||h==g&&n.r<r.r?Ji(r,n=o):Ji(r=l,n),i--):(Qi(r,a),n=a,x(a))}var v=(c+u)/2,m=(f+d)/2,y=0;for(i=0;i<s;i++)(a=e[i]).x-=v,a.y-=m,y=Math.max(y,a.r+Math.sqrt(a.x*a.x+a.y*a.y));t.r=y,e.forEach(ro)}function x(t){c=Math.min(t.x-t.r,c),u=Math.max(t.x+t.r,u),f=Math.min(t.y-t.r,f),d=Math.max(t.y+t.r,d)}}function eo(t){t._pack_next=t._pack_prev=t}function ro(t){delete t._pack_next,delete t._pack_prev}function no(t,e,r){var n=t.r+r.r,a=e.x-t.x,i=e.y-t.y;if(n&&(a||i)){var o=e.r+r.r,l=a*a+i*i,s=.5+((n*=n)-(o*=o))/(2*l),c=Math.sqrt(Math.max(0,2*o*(n+l)-(n-=l)*n-o*o))/(2*l);r.x=t.x+s*a+c*i,r.y=t.y+s*i-c*a}else r.x=t.x+n,r.y=t.y}function ao(t,e){return t.parent==e.parent?1:2}function io(t){var e=t.children;return e.length?e[0]:t.t}function oo(t){var e,r=t.children;return(e=r.length)?r[e-1]:t.t}function lo(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 so(t,e,r){return t.a.parent===e.parent?t.a:r}function co(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function uo(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 fo(t){var e=t[0],r=t[t.length-1];return e<r?[e,r]:[r,e]}function po(t){return t.rangeExtent?t.rangeExtent():fo(t.range())}function ho(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 go(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 vo(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:mo}t.layout.histogram=function(){var e=!0,r=Number,n=Wi,a=Xi;function i(i,o){for(var l,s,c=[],u=i.map(r,this),f=n.call(this,u,o),d=a.call(this,f,u,o),p=(o=-1,u.length),h=d.length-1,g=e?1:1/p;++o<h;)(l=c[o]=[]).dx=d[o+1]-(l.x=d[o]),l.y=0;if(h>0)for(o=-1;++o<p;)(s=u[o])>=f[0]&&s<=f[1]&&((l=c[t.bisect(d,s,1,h)-1]).y+=g,l.push(i[o]));return c}return i.value=function(t){return arguments.length?(r=t,i):r},i.range=function(t){return arguments.length?(n=ve(t),i):n},i.bins=function(t){return arguments.length?(a="number"==typeof t?function(e){return Yi(e,t)}:ve(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($i),n=0,a=[1,1];function i(t,i){var o=r.call(this,t,i),l=o[0],s=a[0],c=a[1],u=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(l.x=l.y=0,Pi(l,function(t){t.r=+u(t.value)}),Pi(l,to),n){var f=n*(e?1:Math.max(2*l.r/s,2*l.r/c))/2;Pi(l,function(t){t.r+=f}),Pi(l,to),Pi(l,function(t){t.r-=f})}return function t(e,r,n,a){var i=e.children;e.x=r+=a*e.x;e.y=n+=a*e.y;e.r*=a;if(i)for(var o=-1,l=i.length;++o<l;)t(i[o],r,n,a)}(l,s/2,c/2,e?1:1/Math.max(2*l.r/s,2*l.r/c)),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},Ci(i,r)},t.layout.tree=function(){var e=t.layout.hierarchy().sort(null).value(null),r=ao,n=[1,1],a=null;function i(t,i){var c=e.call(this,t,i),u=c[0],f=function(t){var e,r={A:null,children:[t]},n=[r];for(;null!=(e=n.pop());)for(var a,i=e.children,o=0,l=i.length;o<l;++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]}(u);if(Pi(f,o),f.parent.m=-f.z,Oi(f,l),a)Oi(u,s);else{var d=u,p=u,h=u;Oi(u,function(t){t.x<d.x&&(d=t),t.x>p.x&&(p=t),t.depth>h.depth&&(h=t)});var g=r(d,p)/2-d.x,v=n[0]/(p.x+r(p,d)/2+g),m=n[1]/(h.depth||1);Oi(u,function(t){t.x=(t.x+g)*v,t.y=t.depth*m})}return c}function o(t){var e=t.children,n=t.parent.children,a=t.i?n[t.i-1]:null;if(e.length){!function(t){var e,r=0,n=0,a=t.children,i=a.length;for(;--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,l=e,s=i.parent.children[0],c=i.m,u=o.m,f=l.m,d=s.m;l=oo(l),i=io(i),l&&i;)s=io(s),(o=oo(o)).a=t,(a=l.z+f-i.z-c+r(l._,i._))>0&&(lo(so(l,t,n),t,a),c+=a,u+=a),f+=l.m,c+=i.m,d+=s.m,u+=o.m;l&&!oo(o)&&(o.t=l,o.m+=f-u),i&&!io(s)&&(s.t=i,s.m+=c-d,n=t)}return n}(t,a,t.parent.A||n[0])}function l(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(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)?s:null,i):a?null:n},i.nodeSize=function(t){return arguments.length?(a=null==(n=t)?null:s,i):a?n:null},Ci(i,e)},t.layout.cluster=function(){var e=t.layout.hierarchy().sort(null).value(null),r=ao,n=[1,1],a=!1;function i(i,o){var l,s=e.call(this,i,o),c=s[0],u=0;Pi(c,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=l?u+=r(e,l):0,e.y=0,l=e)});var f=function t(e){var r=e.children;return r&&r.length?t(r[0]):e}(c),d=function t(e){var r,n=e.children;return n&&(r=n.length)?t(n[r-1]):e}(c),p=f.x-r(f,d)/2,h=d.x+r(d,f)/2;return Pi(c,a?function(t){t.x=(t.x-c.x)*n[0],t.y=(c.y-t.y)*n[1]}:function(t){t.x=(t.x-p)/(h-p)*n[0],t.y=(1-(c.y?t.y/c.y:1))*n[1]}),s}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},Ci(i,e)},t.layout.treemap=function(){var e,r=t.layout.hierarchy(),n=Math.round,a=[1,1],i=null,o=co,l=!1,s="squarify",c=.5*(1+Math.sqrt(5));function u(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 f(t){var e=t.children;if(e&&e.length){var r,n,a,i=o(t),l=[],c=e.slice(),d=1/0,g="slice"===s?i.dx:"dice"===s?i.dy:"slice-dice"===s?1&t.depth?i.dy:i.dx:Math.min(i.dx,i.dy);for(u(c,i.dx*i.dy/t.value),l.area=0;(a=c.length)>0;)l.push(r=c[a-1]),l.area+=r.area,"squarify"!==s||(n=p(l,g))<=d?(c.pop(),d=n):(l.area-=l.pop().area,h(l,g,i,!1),g=Math.min(i.dx,i.dy),l.length=l.area=0,d=1/0);l.length&&(h(l,g,i,!0),l.length=l.area=0),e.forEach(f)}}function d(t){var e=t.children;if(e&&e.length){var r,n=o(t),a=e.slice(),i=[];for(u(a,n.dx*n.dy/t.value),i.area=0;r=a.pop();)i.push(r),i.area+=r.area,null!=r.z&&(h(i,r.z?n.dx:n.dy,n,!a.length),i.length=i.area=0);e.forEach(d)}}function p(t,e){for(var r,n=t.area,a=0,i=1/0,o=-1,l=t.length;++o<l;)(r=t[o].area)&&(r<i&&(i=r),r>a&&(a=r));return e*=e,(n*=n)?Math.max(e*a*c/n,n/(e*i*c)):1/0}function h(t,e,r,a){var i,o=-1,l=t.length,s=r.x,c=r.y,u=e?n(t.area/e):0;if(e==r.dx){for((a||u>r.dy)&&(u=r.dy);++o<l;)(i=t[o]).x=s,i.y=c,i.dy=u,s+=i.dx=Math.min(r.x+r.dx-s,u?n(i.area/u):0);i.z=!0,i.dx+=r.x+r.dx-s,r.y+=u,r.dy-=u}else{for((a||u>r.dx)&&(u=r.dx);++o<l;)(i=t[o]).x=s,i.y=c,i.dx=u,c+=i.dy=Math.min(r.y+r.dy-c,u?n(i.area/u):0);i.z=!1,i.dy+=r.y+r.dy-c,r.x+=u,r.dx-=u}}function g(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),u([i],i.dx*i.dy/i.value),(e?d:f)(i),l&&(e=n),n}return g.size=function(t){return arguments.length?(a=t,g):a},g.padding=function(t){if(!arguments.length)return i;function e(e){return uo(e,t)}var r;return o=null==(i=t)?co:"function"==(r=typeof t)?function(e){var r=t.call(g,e,e.depth);return null==r?co(e):uo(e,"number"==typeof r?[r,r,r,r]:r)}:"number"===r?(t=[t,t,t,t],e):e,g},g.round=function(t){return arguments.length?(n=t?Math.round:Number,g):n!=Number},g.sticky=function(t){return arguments.length?(l=t,e=null,g):l},g.ratio=function(t){return arguments.length?(c=t,g):c},g.mode=function(t){return arguments.length?(s=t+"",g):s},Ci(g,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 mo={floor:P,ceil:P};function yo(e,r,n,a){var i=[],o=[],l=0,s=Math.min(e.length,r.length)-1;for(e[s]<e[0]&&(e=e.slice().reverse(),r=r.slice().reverse());++l<=s;)i.push(n(e[l-1],e[l])),o.push(a(r[l-1],r[l]));return function(r){var n=t.bisect(e,r,1,s)-1;return o[n](i[n](r))}}function xo(e,r){return t.rebind(e,r,"range","rangeRound","interpolate","clamp")}function bo(t,e){return go(t,vo(_o(t,e)[2])),go(t,vo(_o(t,e)[2])),t}function _o(t,e){null==e&&(e=10);var r=fo(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 wo(e,r){return t.range.apply(t,_o(e,r))}function ko(e,r,n){var a=_o(e,r);if(n){var i=Pe.exec(n);if(i.shift(),"s"===i[8]){var o=t.formatPrefix(Math.max(y(a[0]),y(a[1])));return i[7]||(i[7]="."+Mo(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=Mo(e[2]);return t in To?Math.abs(r-Mo(Math.max(y(e[0]),y(e[1]))))+ +("e"!==t):r-2*("%"===t)}(i[8],a)),n=i.join("")}else n=",."+Mo(a[2])+"f";return t.format(n)}t.scale.linear=function(){return function t(e,r,n,a){var i,o;function l(){var t=Math.min(e.length,r.length)>2?yo:ho,l=a?xi:yi;return i=t(e,r,l,n),o=t(r,e,l,Qa),s}function s(t){return i(t)}s.invert=function(t){return o(t)};s.domain=function(t){return arguments.length?(e=t.map(Number),l()):e};s.range=function(t){return arguments.length?(r=t,l()):r};s.rangeRound=function(t){return s.range(t).interpolate(fi)};s.clamp=function(t){return arguments.length?(a=t,l()):a};s.interpolate=function(t){return arguments.length?(n=t,l()):n};s.ticks=function(t){return wo(e,t)};s.tickFormat=function(t,r){return ko(e,t,r)};s.nice=function(t){return bo(e,t),l()};s.copy=function(){return t(e,r,n,a)};return l()}([0,1],[0,1],Qa,!1)};var To={s:1,g:1,p:1,r:1,e:1};function Mo(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 l(t){return a?Math.pow(n,t):-Math.pow(n,-t)}function s(t){return r(o(t))}s.invert=function(t){return l(r.invert(t))};s.domain=function(t){return arguments.length?(a=t[0]>=0,r.domain((i=t.map(Number)).map(o)),s):i};s.base=function(t){return arguments.length?(n=+t,r.domain(i.map(o)),s):n};s.nice=function(){var t=go(i.map(o),a?Math:Lo);return r.domain(t),i=t.map(l),s};s.ticks=function(){var t=fo(i),e=[],r=t[0],s=t[1],c=Math.floor(o(r)),u=Math.ceil(o(s)),f=n%1?2:n;if(isFinite(u-c)){if(a){for(;c<u;c++)for(var d=1;d<f;d++)e.push(l(c)*d);e.push(l(c))}else for(e.push(l(c));c++<u;)for(var d=f-1;d>0;d--)e.push(l(c)*d);for(c=0;e[c]<r;c++);for(u=e.length;e[u-1]>s;u--);e=e.slice(c,u)}return e};s.tickFormat=function(e,r){if(!arguments.length)return Ao;arguments.length<2?r=Ao:"function"!=typeof r&&(r=t.format(r));var a=Math.max(1,n*e/s.ticks().length);return function(t){var e=t/l(Math.round(o(t)));return e*n<n-.5&&(e*=n),e<=a?r(t):""}};s.copy=function(){return e(r.copy(),n,a,i)};return xo(s,r)}(t.scale.linear().domain([0,1]),10,!0,[1,10])};var Ao=t.format(".0e"),Lo={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};function So(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=So(r),i=So(1/r);function o(t){return e(a(t))}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 wo(n,t)};o.tickFormat=function(t,e){return ko(n,t,e)};o.nice=function(t){return o.domain(bo(n,t))};o.exponent=function(t){return arguments.length?(a=So(r=t),i=So(1/r),e.domain(n.map(a)),o):r};o.copy=function(){return t(e.copy(),r,n)};return xo(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 l(t){return i[((a.get(t)||("range"===n.t?a.set(t,r.push(t)):NaN))-1)%i.length]}function s(e,n){return t.range(r.length).map(function(t){return e+n*t})}l.domain=function(t){if(!arguments.length)return r;r=[],a=new b;for(var e,i=-1,o=t.length;++i<o;)a.has(e=t[i])||a.set(e,r.push(e));return l[n.t].apply(l,n.a)};l.range=function(t){return arguments.length?(i=t,o=0,n={t:"range",a:arguments},l):i};l.rangePoints=function(t,e){arguments.length<2&&(e=0);var a=t[0],c=t[1],u=r.length<2?(a=(a+c)/2,0):(c-a)/(r.length-1+e);return i=s(a+u*e/2,u),o=0,n={t:"rangePoints",a:arguments},l};l.rangeRoundPoints=function(t,e){arguments.length<2&&(e=0);var a=t[0],c=t[1],u=r.length<2?(a=c=Math.round((a+c)/2),0):(c-a)/(r.length-1+e)|0;return i=s(a+Math.round(u*e/2+(c-a-(r.length-1+e)*u)/2),u),o=0,n={t:"rangeRoundPoints",a:arguments},l};l.rangeBands=function(t,e,a){arguments.length<2&&(e=0),arguments.length<3&&(a=e);var c=t[1]<t[0],u=t[c-0],f=t[1-c],d=(f-u)/(r.length-e+2*a);return i=s(u+d*a,d),c&&i.reverse(),o=d*(1-e),n={t:"rangeBands",a:arguments},l};l.rangeRoundBands=function(t,e,a){arguments.length<2&&(e=0),arguments.length<3&&(a=e);var c=t[1]<t[0],u=t[c-0],f=t[1-c],d=Math.floor((f-u)/(r.length-e+2*a));return i=s(u+Math.round((f-u-(r.length-e)*d)/2),d),c&&i.reverse(),o=Math.round(d*(1-e)),n={t:"rangeRoundBands",a:arguments},l};l.rangeBand=function(){return o};l.rangeExtent=function(){return fo(n.a[0])};l.copy=function(){return e(r,n)};return l.domain(r)}([],{t:"range",a:[[]]})},t.scale.category10=function(){return t.scale.ordinal().range(Co)},t.scale.category20=function(){return t.scale.ordinal().range(Oo)},t.scale.category20b=function(){return t.scale.ordinal().range(Po)},t.scale.category20c=function(){return t.scale.ordinal().range(Do)};var Co=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(le),Oo=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(le),Po=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(le),Do=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(le);function zo(){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)]}o.domain=function(t){return arguments.length?(r=t.map(p).filter(h).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)};return 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 l(){return a=n.length/(r-e),i=n.length-1,o}o.domain=function(t){return arguments.length?(e=+t[0],r=+t[t.length-1],l()):[e,r]};o.range=function(t){return arguments.length?(n=t,l()):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)};return l()}(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)]}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)};return a}([.5],[0,1])},t.scale.identity=function(){return function t(e){function r(t){return+t}r.invert=r;r.domain=r.range=function(t){return arguments.length?(e=t.map(r),r):e};r.ticks=function(t){return wo(e,t)};r.tickFormat=function(t,r){return ko(e,t,r)};r.copy=function(){return t(e)};return r}([0,1])},t.svg={},t.svg.arc=function(){var t=Eo,e=Io,r=zo,n=Ro,a=Fo,i=No,o=jo;function l(){var l=Math.max(0,+t.apply(this,arguments)),c=Math.max(0,+e.apply(this,arguments)),u=a.apply(this,arguments)-St,f=i.apply(this,arguments)-St,d=Math.abs(f-u),p=u>f?0:1;if(c<l&&(h=c,c=l,l=h),d>=Lt)return s(c,p)+(l?s(l,1-p):"")+"Z";var h,g,v,m,y,x,b,_,w,k,T,M,A=0,L=0,S=[];if((m=(+o.apply(this,arguments)||0)/2)&&(v=n===Ro?Math.sqrt(l*l+c*c):+n.apply(this,arguments),p||(L*=-1),c&&(L=Rt(v/c*Math.sin(m))),l&&(A=Rt(v/l*Math.sin(m)))),c){y=c*Math.cos(u+L),x=c*Math.sin(u+L),b=c*Math.cos(f-L),_=c*Math.sin(f-L);var C=Math.abs(f-u-2*L)<=Mt?0:1;if(L&&Bo(y,x,b,_)===p^C){var O=(u+f)/2;y=c*Math.cos(O),x=c*Math.sin(O),b=_=null}}else y=x=0;if(l){w=l*Math.cos(f-A),k=l*Math.sin(f-A),T=l*Math.cos(u+A),M=l*Math.sin(u+A);var P=Math.abs(u-f+2*A)<=Mt?0:1;if(A&&Bo(w,k,T,M)===1-p^P){var D=(u+f)/2;w=l*Math.cos(D),k=l*Math.sin(D),T=M=null}}else w=k=0;if(d>kt&&(h=Math.min(Math.abs(c-l)/2,+r.apply(this,arguments)))>.001){g=l<c^p?0:1;var z=h,R=h;if(d<Mt){var E=null==T?[w,k]:null==b?[y,x]:ca([y,x],[T,M],[b,_],[w,k]),I=y-E[0],F=x-E[1],N=b-E[0],j=_-E[1],B=1/Math.sin(Math.acos((I*N+F*j)/(Math.sqrt(I*I+F*F)*Math.sqrt(N*N+j*j)))/2),H=Math.sqrt(E[0]*E[0]+E[1]*E[1]);R=Math.min(h,(l-H)/(B-1)),z=Math.min(h,(c-H)/(B+1))}if(null!=b){var V=Ho(null==T?[w,k]:[T,M],[y,x],c,z,p),q=Ho([b,_],[w,k],c,z,p);h===z?S.push("M",V[0],"A",z,",",z," 0 0,",g," ",V[1],"A",c,",",c," 0 ",1-p^Bo(V[1][0],V[1][1],q[1][0],q[1][1]),",",p," ",q[1],"A",z,",",z," 0 0,",g," ",q[0]):S.push("M",V[0],"A",z,",",z," 0 1,",g," ",q[0])}else S.push("M",y,",",x);if(null!=T){var U=Ho([y,x],[T,M],l,-R,p),G=Ho([w,k],null==b?[y,x]:[b,_],l,-R,p);h===R?S.push("L",G[0],"A",R,",",R," 0 0,",g," ",G[1],"A",l,",",l," 0 ",p^Bo(G[1][0],G[1][1],U[1][0],U[1][1]),",",1-p," ",U[1],"A",R,",",R," 0 0,",g," ",U[0]):S.push("L",G[0],"A",R,",",R," 0 0,",g," ",U[0])}else S.push("L",w,",",k)}else S.push("M",y,",",x),null!=b&&S.push("A",c,",",c," 0 ",C,",",p," ",b,",",_),S.push("L",w,",",k),null!=T&&S.push("A",l,",",l," 0 ",P,",",1-p," ",T,",",M);return S.push("Z"),S.join("")}function s(t,e){return"M0,"+t+"A"+t+","+t+" 0 1,"+e+" 0,"+-t+"A"+t+","+t+" 0 1,"+e+" 0,"+t}return l.innerRadius=function(e){return arguments.length?(t=ve(e),l):t},l.outerRadius=function(t){return arguments.length?(e=ve(t),l):e},l.cornerRadius=function(t){return arguments.length?(r=ve(t),l):r},l.padRadius=function(t){return arguments.length?(n=t==Ro?Ro:ve(t),l):n},l.startAngle=function(t){return arguments.length?(a=ve(t),l):a},l.endAngle=function(t){return arguments.length?(i=ve(t),l):i},l.padAngle=function(t){return arguments.length?(o=ve(t),l):o},l.centroid=function(){var r=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,n=(+a.apply(this,arguments)+ +i.apply(this,arguments))/2-St;return[Math.cos(n)*r,Math.sin(n)*r]},l};var Ro="auto";function Eo(t){return t.innerRadius}function Io(t){return t.outerRadius}function Fo(t){return t.startAngle}function No(t){return t.endAngle}function jo(t){return t&&t.padAngle}function Bo(t,e,r,n){return(t-r)*e-(e-n)*t>0?0:1}function Ho(t,e,r,n,a){var i=t[0]-e[0],o=t[1]-e[1],l=(a?n:-n)/Math.sqrt(i*i+o*o),s=l*o,c=-l*i,u=t[0]+s,f=t[1]+c,d=e[0]+s,p=e[1]+c,h=(u+d)/2,g=(f+p)/2,v=d-u,m=p-f,y=v*v+m*m,x=r-n,b=u*p-d*f,_=(m<0?-1:1)*Math.sqrt(Math.max(0,x*x*y-b*b)),w=(b*m-v*_)/y,k=(-b*v-m*_)/y,T=(b*m+v*_)/y,M=(-b*v+m*_)/y,A=w-h,L=k-g,S=T-h,C=M-g;return A*A+L*L>S*S+C*C&&(w=T,k=M),[[w-s,k-c],[w*r/x,k*r/x]]}function Vo(t){var e=na,r=aa,n=Yr,a=Uo,i=a.key,o=.7;function l(i){var l,s=[],c=[],u=-1,f=i.length,d=ve(e),p=ve(r);function h(){s.push("M",a(t(c),o))}for(;++u<f;)n.call(this,l=i[u],u)?c.push([+d.call(this,l,u),+p.call(this,l,u)]):c.length&&(h(),c=[]);return c.length&&h(),s.length?s.join(""):null}return l.x=function(t){return arguments.length?(e=t,l):e},l.y=function(t){return arguments.length?(r=t,l):r},l.defined=function(t){return arguments.length?(n=t,l):n},l.interpolate=function(t){return arguments.length?(i="function"==typeof t?a=t:(a=qo.get(t)||Uo).key,l):i},l.tension=function(t){return arguments.length?(o=t,l):o},l}t.svg.line=function(){return Vo(P)};var qo=t.map({linear:Uo,"linear-closed":Go,step:function(t){var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];for(;++e<r;)a.push("H",(n[0]+(n=t[e])[0])/2,"V",n[1]);r>1&&a.push("H",n[0]);return a.join("")},"step-before":Zo,"step-after":Xo,basis:$o,"basis-open":function(t){if(t.length<4)return Uo(t);var e,r=[],n=-1,a=t.length,i=[0],o=[0];for(;++n<3;)e=t[n],i.push(e[0]),o.push(e[1]);r.push(Qo(tl,i)+","+Qo(tl,o)),--n;for(;++n<a;)e=t[n],i.shift(),i.push(e[0]),o.shift(),o.push(e[1]),el(r,i,o);return r.join("")},"basis-closed":function(t){var e,r,n=-1,a=t.length,i=a+4,o=[],l=[];for(;++n<4;)r=t[n%a],o.push(r[0]),l.push(r[1]);e=[Qo(tl,o),",",Qo(tl,l)],--n;for(;++n<i;)r=t[n%a],o.shift(),o.push(r[0]),l.shift(),l.push(r[1]),el(e,o,l);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],l=t[r][0]-i,s=t[r][1]-o,c=-1;++c<=r;)n=t[c],a=c/r,n[0]=e*n[0]+(1-e)*(i+a*l),n[1]=e*n[1]+(1-e)*(o+a*s);return $o(t)},cardinal:function(t,e){return t.length<3?Uo(t):t[0]+Yo(t,Wo(t,e))},"cardinal-open":function(t,e){return t.length<4?Uo(t):t[1]+Yo(t.slice(1,-1),Wo(t,e))},"cardinal-closed":function(t,e){return t.length<3?Go(t):t[0]+Yo((t.push(t[0]),t),Wo([t[t.length-2]].concat(t,[t[1]]),e))},monotone:function(t){return t.length<3?Uo(t):t[0]+Yo(t,function(t){var e,r,n,a,i=[],o=function(t){var e=0,r=t.length-1,n=[],a=t[0],i=t[1],o=n[0]=rl(a,i);for(;++e<r;)n[e]=(o+(o=rl(a=i,i=t[e+1])))/2;return n[e]=o,n}(t),l=-1,s=t.length-1;for(;++l<s;)e=rl(t[l],t[l+1]),y(e)<kt?o[l]=o[l+1]=0:(r=o[l]/e,n=o[l+1]/e,(a=r*r+n*n)>9&&(a=3*e/Math.sqrt(a),o[l]=a*r,o[l+1]=a*n));l=-1;for(;++l<=s;)a=(t[Math.min(s,l+1)][0]-t[Math.max(0,l-1)][0])/(6*(1+o[l]*o[l])),i.push([a||0,o[l]*a||0]);return i}(t))}});function Uo(t){return t.length>1?t.join("L"):t+"Z"}function Go(t){return t.join("L")+"Z"}function Zo(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 Xo(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 Yo(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return Uo(t);var r=t.length!=e.length,n="",a=t[0],i=t[1],o=e[0],l=o,s=1;if(r&&(n+="Q"+(i[0]-2*o[0]/3)+","+(i[1]-2*o[1]/3)+","+i[0]+","+i[1],a=t[1],s=2),e.length>1){l=e[1],i=t[s],s++,n+="C"+(a[0]+o[0])+","+(a[1]+o[1])+","+(i[0]-l[0])+","+(i[1]-l[1])+","+i[0]+","+i[1];for(var c=2;c<e.length;c++,s++)i=t[s],l=e[c],n+="S"+(i[0]-l[0])+","+(i[1]-l[1])+","+i[0]+","+i[1]}if(r){var u=t[s];n+="Q"+(i[0]+2*l[0]/3)+","+(i[1]+2*l[1]/3)+","+u[0]+","+u[1]}return n}function Wo(t,e){for(var r,n=[],a=(1-e)/2,i=t[0],o=t[1],l=1,s=t.length;++l<s;)r=i,i=o,o=t[l],n.push([a*(o[0]-r[0]),a*(o[1]-r[1])]);return n}function $o(t){if(t.length<3)return Uo(t);var e=1,r=t.length,n=t[0],a=n[0],i=n[1],o=[a,a,a,(n=t[1])[0]],l=[i,i,i,n[1]],s=[a,",",i,"L",Qo(tl,o),",",Qo(tl,l)];for(t.push(t[r-1]);++e<=r;)n=t[e],o.shift(),o.push(n[0]),l.shift(),l.push(n[1]),el(s,o,l);return t.pop(),s.push("L",n),s.join("")}function Qo(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}qo.forEach(function(t,e){e.key=t,e.closed=/-closed$/.test(t)});var Jo=[0,2/3,1/3,0],Ko=[0,1/3,2/3,0],tl=[0,1/6,2/3,1/6];function el(t,e,r){t.push("C",Qo(Jo,e),",",Qo(Jo,r),",",Qo(Ko,e),",",Qo(Ko,r),",",Qo(tl,e),",",Qo(tl,r))}function rl(t,e){return(e[1]-t[1])/(e[0]-t[0])}function nl(t){for(var e,r,n,a=-1,i=t.length;++a<i;)r=(e=t[a])[0],n=e[1]-St,e[0]=r*Math.cos(n),e[1]=r*Math.sin(n);return t}function al(t){var e=na,r=na,n=0,a=aa,i=Yr,o=Uo,l=o.key,s=o,c="L",u=.7;function f(l){var f,d,p,h=[],g=[],v=[],m=-1,y=l.length,x=ve(e),b=ve(n),_=e===r?function(){return d}:ve(r),w=n===a?function(){return p}:ve(a);function k(){h.push("M",o(t(v),u),c,s(t(g.reverse()),u),"Z")}for(;++m<y;)i.call(this,f=l[m],m)?(g.push([d=+x.call(this,f,m),p=+b.call(this,f,m)]),v.push([+_.call(this,f,m),+w.call(this,f,m)])):g.length&&(k(),g=[],v=[]);return g.length&&k(),h.length?h.join(""):null}return f.x=function(t){return arguments.length?(e=r=t,f):r},f.x0=function(t){return arguments.length?(e=t,f):e},f.x1=function(t){return arguments.length?(r=t,f):r},f.y=function(t){return arguments.length?(n=a=t,f):a},f.y0=function(t){return arguments.length?(n=t,f):n},f.y1=function(t){return arguments.length?(a=t,f):a},f.defined=function(t){return arguments.length?(i=t,f):i},f.interpolate=function(t){return arguments.length?(l="function"==typeof t?o=t:(o=qo.get(t)||Uo).key,s=o.reverse||o,c=o.closed?"M":"L",f):l},f.tension=function(t){return arguments.length?(u=t,f):u},f}function il(t){return t.radius}function ol(t){return[t.x,t.y]}function ll(){return 64}function sl(){return"circle"}function cl(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=Vo(nl);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},Zo.reverse=Xo,Xo.reverse=Zo,t.svg.area=function(){return al(P)},t.svg.area.radial=function(){var t=al(nl);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},t.svg.chord=function(){var t=qn,e=Un,r=il,n=Fo,a=No;function i(r,n){var a,i,c=o(this,t,r,n),u=o(this,e,r,n);return"M"+c.p0+l(c.r,c.p1,c.a1-c.a0)+(i=u,(a=c).a0==i.a0&&a.a1==i.a1?s(c.r,c.p1,c.r,c.p0):s(c.r,c.p1,u.r,u.p0)+l(u.r,u.p1,u.a1-u.a0)+s(u.r,u.p1,c.r,c.p0))+"Z"}function o(t,e,i,o){var l=e.call(t,i,o),s=r.call(t,l,o),c=n.call(t,l,o)-St,u=a.call(t,l,o)-St;return{r:s,a0:c,a1:u,p0:[s*Math.cos(c),s*Math.sin(c)],p1:[s*Math.cos(u),s*Math.sin(u)]}}function l(t,e,r){return"A"+t+","+t+" 0 "+ +(r>Mt)+",1 "+e}function s(t,e,r,n){return"Q 0,0 "+n}return i.radius=function(t){return arguments.length?(r=ve(t),i):r},i.source=function(e){return arguments.length?(t=ve(e),i):t},i.target=function(t){return arguments.length?(e=ve(t),i):e},i.startAngle=function(t){return arguments.length?(n=ve(t),i):n},i.endAngle=function(t){return arguments.length?(a=ve(t),i):a},i},t.svg.diagonal=function(){var t=qn,e=Un,r=ol;function n(n,a){var i=t.call(this,n,a),o=e.call(this,n,a),l=(i.y+o.y)/2,s=[i,{x:i.x,y:l},{x:o.x,y:l},o];return"M"+(s=s.map(r))[0]+"C"+s[1]+" "+s[2]+" "+s[3]}return n.source=function(e){return arguments.length?(t=ve(e),n):t},n.target=function(t){return arguments.length?(e=ve(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=ol,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]-St;return[r*Math.cos(n),r*Math.sin(n)]}}(r=t)):r},e},t.svg.symbol=function(){var t=sl,e=ll;function r(r,n){return(ul.get(t.call(this,r,n))||cl)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=ve(e),r):t},r.size=function(t){return arguments.length?(e=ve(t),r):e},r};var ul=t.map({circle:cl,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*dl)),r=e*dl;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/fl),r=e*fl/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/fl),r=e*fl/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});t.svg.symbolTypes=ul.keys();var fl=Math.sqrt(3),dl=Math.tan(30*Ct);X.transition=function(t){for(var e,r,n=vl||++xl,a=wl(t),i=[],o=ml||{time:Date.now(),ease:oi,delay:0,duration:250},l=-1,s=this.length;++l<s;){i.push(e=[]);for(var c=this[l],u=-1,f=c.length;++u<f;)(r=c[u])&&kl(r,u,a,n,o),e.push(r)}return gl(i,a,n)},X.interrupt=function(t){return this.each(null==t?pl:hl(wl(t)))};var pl=hl(wl());function hl(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 gl(t,e,r){return V(t,yl),t.namespace=e,t.id=r,t}var vl,ml,yl=[],xl=0;function bl(t,e,r,n){var a=t.id,i=t.namespace;return ut(t,"function"==typeof r?function(t,o,l){t[i][a].tween.set(e,n(r.call(t,t.__data__,o,l)))}:(r=n(r),function(t){t[i][a].tween.set(e,r)}))}function _l(t){return null==t&&(t=""),function(){this.textContent=t}}function wl(t){return null==t?"__transition__":"__transition_"+t+"__"}function kl(t,e,r,n,a){var i,o,l,s,c,u=t[r]||(t[r]={active:0,count:0}),f=u[n];function d(r){var a=u.active,d=u[a];for(var h in d&&(d.timer.c=null,d.timer.t=NaN,--u.count,delete u[a],d.event&&d.event.interrupt.call(t,t.__data__,d.index)),u)if(+h<n){var g=u[h];g.timer.c=null,g.timer.t=NaN,--u.count,delete u[h]}o.c=p,Te(function(){return o.c&&p(r||1)&&(o.c=null,o.t=NaN),1},0,i),u.active=n,f.event&&f.event.start.call(t,t.__data__,e),c=[],f.tween.forEach(function(r,n){(n=n.call(t,t.__data__,e))&&c.push(n)}),s=f.ease,l=f.duration}function p(a){for(var i=a/l,o=s(i),d=c.length;d>0;)c[--d].call(t,o);if(i>=1)return f.event&&f.event.end.call(t,t.__data__,e),--u.count?delete u[n]:delete t[r],1}f||(i=a.time,o=Te(function(t){var e=f.delay;if(o.t=e+i,e<=t)return d(t-e);o.c=d},0,i),f=u[n]={tween:new b,time:i,timer:o,delay:a.delay,duration:a.duration,ease:a.ease,index:e},a=null,++u.count)}yl.call=X.call,yl.empty=X.empty,yl.node=X.node,yl.size=X.size,t.transition=function(e,r){return e&&e.transition?vl?e.transition(r):e:t.selection().transition(e)},t.transition.prototype=yl,yl.select=function(t){var e,r,n,a=this.id,i=this.namespace,o=[];t=Y(t);for(var l=-1,s=this.length;++l<s;){o.push(e=[]);for(var c=this[l],u=-1,f=c.length;++u<f;)(n=c[u])&&(r=t.call(n,n.__data__,u,l))?("__data__"in n&&(r.__data__=n.__data__),kl(r,u,i,a,n[i][a]),e.push(r)):e.push(null)}return gl(o,i,a)},yl.selectAll=function(t){var e,r,n,a,i,o=this.id,l=this.namespace,s=[];t=W(t);for(var c=-1,u=this.length;++c<u;)for(var f=this[c],d=-1,p=f.length;++d<p;)if(n=f[d]){i=n[l][o],r=t.call(n,n.__data__,d,c),s.push(e=[]);for(var h=-1,g=r.length;++h<g;)(a=r[h])&&kl(a,h,l,o,i),e.push(a)}return gl(s,l,o)},yl.filter=function(t){var e,r,n=[];"function"!=typeof t&&(t=ct(t));for(var a=0,i=this.length;a<i;a++){n.push(e=[]);for(var o,l=0,s=(o=this[a]).length;l<s;l++)(r=o[l])&&t.call(r,r.__data__,l,a)&&e.push(r)}return gl(n,this.namespace,this.id)},yl.tween=function(t,e){var r=this.id,n=this.namespace;return arguments.length<2?this.node()[n][r].tween.get(t):ut(this,null==e?function(e){e[n][r].tween.remove(t)}:function(a){a[n][r].tween.set(t,e)})},yl.attr=function(e,r){if(arguments.length<2){for(r in e)this.attr(r,e[r]);return this}var n="transform"==e?mi:Qa,a=t.ns.qualify(e);function i(){this.removeAttribute(a)}function o(){this.removeAttributeNS(a.space,a.local)}return bl(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))})})})},yl.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))}})},yl.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 bl(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=Qa(a,e),function(e){this.style.setProperty(t,n(e),r)})})})},yl.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)}})},yl.text=function(t){return bl(this,"text",t,_l)},yl.remove=function(){var t=this.namespace;return this.each("end.transition",function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)})},yl.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)),ut(this,function(t){t[n][r].ease=e}))},yl.delay=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].delay:ut(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}))},yl.duration=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].duration:ut(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}))},yl.each=function(e,r){var n=this.id,a=this.namespace;if(arguments.length<2){var i=ml,o=vl;try{vl=n,ut(this,function(t,r,i){ml=t[a][n],e.call(t,t.__data__,r,i)})}finally{ml=i,vl=o}}else ut(this,function(i){var o=i[a][n];(o.event||(o.event=t.dispatch("start","end","interrupt"))).on(e,r)});return this},yl.transition=function(){for(var t,e,r,n=this.id,a=++xl,i=this.namespace,o=[],l=0,s=this.length;l<s;l++){o.push(t=[]);for(var c,u=0,f=(c=this[l]).length;u<f;u++)(e=c[u])&&kl(e,u,i,a,{time:(r=e[i][n]).time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration}),t.push(e)}return gl(o,i,a)},t.svg.axis=function(){var e,r=t.scale.linear(),a=Tl,i=6,o=6,l=3,s=[10],c=null;function u(n){n.each(function(){var n,u=t.select(this),f=this.__chart__||r,d=this.__chart__=r.copy(),p=null==c?d.ticks?d.ticks.apply(d,s):d.domain():c,h=null==e?d.tickFormat?d.tickFormat.apply(d,s):P:e,g=u.selectAll(".tick").data(p,d),v=g.enter().insert("g",".domain").attr("class","tick").style("opacity",kt),m=t.transition(g.exit()).style("opacity",kt).remove(),y=t.transition(g.order()).style("opacity",1),x=Math.max(i,0)+l,b=po(d),_=u.selectAll(".domain").data([0]),w=(_.enter().append("path").attr("class","domain"),t.transition(_));v.append("line"),v.append("text");var k,T,M,A,L=v.select("line"),S=y.select("line"),C=g.select("text").text(h),O=v.select("text"),D=y.select("text"),z="top"===a||"left"===a?-1:1;if("bottom"===a||"top"===a?(n=Al,k="x",M="y",T="x2",A="y2",C.attr("dy",z<0?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+b[0]+","+z*o+"V0H"+b[1]+"V"+z*o)):(n=Ll,k="y",M="x",T="y2",A="x2",C.attr("dy",".32em").style("text-anchor",z<0?"end":"start"),w.attr("d","M"+z*o+","+b[0]+"H0V"+b[1]+"H"+z*o)),L.attr(A,z*i),O.attr(M,z*x),S.attr(T,0).attr(A,z*i),D.attr(k,0).attr(M,z*x),d.rangeBand){var R=d,E=R.rangeBand()/2;f=d=function(t){return R(t)+E}}else f.rangeBand?f=d:m.call(n,d,f);v.call(n,f,d),y.call(n,d,d)})}return u.scale=function(t){return arguments.length?(r=t,u):r},u.orient=function(t){return arguments.length?(a=t in Ml?t+"":Tl,u):a},u.ticks=function(){return arguments.length?(s=n(arguments),u):s},u.tickValues=function(t){return arguments.length?(c=t,u):c},u.tickFormat=function(t){return arguments.length?(e=t,u):e},u.tickSize=function(t){var e=arguments.length;return e?(i=+t,o=+arguments[e-1],u):i},u.innerTickSize=function(t){return arguments.length?(i=+t,u):i},u.outerTickSize=function(t){return arguments.length?(o=+t,u):o},u.tickPadding=function(t){return arguments.length?(l=+t,u):l},u.tickSubdivide=function(){return arguments.length&&u},u};var Tl="bottom",Ml={top:1,right:1,bottom:1,left:1};function Al(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate("+(isFinite(n)?n:r(t))+",0)"})}function Ll(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=B(d,"brushstart","brush","brushend"),a=null,i=null,l=[0,0],s=[0,0],c=!0,u=!0,f=Cl[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",v).on("touchstart.brush",v),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(f,P);n.exit().remove(),n.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return Sl[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,l=t.transition(e),s=t.transition(r);a&&(o=po(a),s.attr("x",o[0]).attr("width",o[1]-o[0]),h(l)),i&&(o=po(i),s.attr("y",o[0]).attr("height",o[1]-o[0]),g(l)),p(l)})}function p(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+l[+/e$/.test(t)]+","+s[+/^s/.test(t)]+")"})}function h(t){t.select(".extent").attr("x",l[0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",l[1]-l[0])}function g(t){t.select(".extent").attr("y",s[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",s[1]-s[0])}function v(){var f,v,m=this,y=t.select(t.event.target),x=n.of(m,arguments),b=t.select(m),_=y.datum(),w=!/^(n|s)$/.test(_)&&a,k=!/^(e|w)$/.test(_)&&i,T=y.classed("extent"),M=xt(m),A=t.mouse(m),L=t.select(o(m)).on("keydown.brush",function(){32==t.event.keyCode&&(T||(f=null,A[0]-=l[1],A[1]-=s[1],T=2),N())}).on("keyup.brush",function(){32==t.event.keyCode&&2==T&&(A[0]+=l[1],A[1]+=s[1],T=0,N())});if(t.event.changedTouches?L.on("touchmove.brush",O).on("touchend.brush",D):L.on("mousemove.brush",O).on("mouseup.brush",D),b.interrupt().selectAll("*").interrupt(),T)A[0]=l[0]-A[0],A[1]=s[0]-A[1];else if(_){var S=+/w$/.test(_),C=+/^n/.test(_);v=[l[1-S]-A[0],s[1-C]-A[1]],A[0]=l[S],A[1]=s[C]}else t.event.altKey&&(f=A.slice());function O(){var e=t.mouse(m),r=!1;v&&(e[0]+=v[0],e[1]+=v[1]),T||(t.event.altKey?(f||(f=[(l[0]+l[1])/2,(s[0]+s[1])/2]),A[0]=l[+(e[0]<f[0])],A[1]=s[+(e[1]<f[1])]):f=null),w&&P(e,a,0)&&(h(b),r=!0),k&&P(e,i,1)&&(g(b),r=!0),r&&(p(b),x({type:"brush",mode:T?"move":"resize"}))}function P(t,n,a){var i,o,d=po(n),p=d[0],h=d[1],g=A[a],v=a?s:l,m=v[1]-v[0];if(T&&(p-=g,h-=m+g),i=(a?u:c)?Math.max(p,Math.min(h,t[a])):t[a],T?o=(i+=g)+m:(f&&(g=Math.max(p,Math.min(h,2*f[a]-i))),g<i?(o=i,i=g):o=g),v[0]!=i||v[1]!=o)return a?r=null:e=null,v[0]=i,v[1]=o,!0}function D(){O(),b.style("pointer-events","all").selectAll(".resize").style("display",d.empty()?"none":null),t.select("body").style("cursor",null),L.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),M(),x({type:"brushend"})}b.style("pointer-events","none").selectAll(".resize").style("display",null),t.select("body").style("cursor",y.style("cursor")),x({type:"brushstart"}),O()}return d.event=function(a){a.each(function(){var a=n.of(this,arguments),i={x:l,y:s,i:e,j:r},o=this.__chart__||i;this.__chart__=i,vl?t.select(this).transition().each("start.brush",function(){e=o.i,r=o.j,l=o.x,s=o.y,a({type:"brushstart"})}).tween("brush:brush",function(){var t=Ja(l,i.x),n=Ja(s,i.y);return e=r=null,function(e){l=i.x=t(e),s=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?(f=Cl[!(a=t)<<1|!i],d):a},d.y=function(t){return arguments.length?(f=Cl[!a<<1|!(i=t)],d):i},d.clamp=function(t){return arguments.length?(a&&i?(c=!!t[0],u=!!t[1]):a?c=!!t:i&&(u=!!t),d):a&&i?[c,u]:a?c:i?u:null},d.extent=function(t){var n,o,c,u,f;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&&(f=n,n=o,o=f),n==l[0]&&o==l[1]||(l=[n,o])),i&&(c=t[0],u=t[1],a&&(c=c[1],u=u[1]),r=[c,u],i.invert&&(c=i(c),u=i(u)),u<c&&(f=c,c=u,u=f),c==s[0]&&u==s[1]||(s=[c,u])),d):(a&&(e?(n=e[0],o=e[1]):(n=l[0],o=l[1],a.invert&&(n=a.invert(n),o=a.invert(o)),o<n&&(f=n,n=o,o=f))),i&&(r?(c=r[0],u=r[1]):(c=s[0],u=s[1],i.invert&&(c=i.invert(c),u=i.invert(u)),u<c&&(f=c,c=u,u=f))),a&&i?[[n,c],[o,u]]:a?[n,o]:i&&[c,u])},d.clear=function(){return d.empty()||(l=[0,0],s=[0,0],e=r=null),d},d.empty=function(){return!!a&&l[0]==l[1]||!!i&&s[0]==s[1]},t.rebind(d,n,"on")};var Sl={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Cl=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Ol=Re.format=cr.timeFormat,Pl=Ol.utc,Dl=Pl("%Y-%m-%dT%H:%M:%S.%LZ");function zl(t){return t.toISOString()}function Rl(e,r,n){function a(t){return e(t)}function i(e,n){var a=(e[1]-e[0])/n,i=t.bisect(Il,a);return i==Il.length?[r.year,_o(e.map(function(t){return t/31536e6}),n)[2]]:i?r[a/Il[i-1]<Il[i]/a?i-1:i]:[jl,_o(e,n)[2]]}return a.invert=function(t){return El(e.invert(t))},a.domain=function(t){return arguments.length?(e.domain(t),a):e.domain().map(El)},a.nice=function(t,e){var r=a.domain(),n=fo(r),o=null==t?i(n,10):"number"==typeof t&&i(n,t);function l(r){return!isNaN(r)&&!t.range(r,El(+r+1),e).length}return o&&(t=o[0],e=o[1]),a.domain(go(r,e>1?{floor:function(e){for(;l(e=t.floor(e));)e=El(e-1);return e},ceil:function(e){for(;l(e=t.ceil(e));)e=El(+e+1);return e}}:t))},a.ticks=function(t,e){var r=fo(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],El(+r[1]+1),e<1?1:e)},a.tickFormat=function(){return n},a.copy=function(){return Rl(e.copy(),r,n)},xo(a,e)}function El(t){return new Date(t)}Ol.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?zl:Dl,zl.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},zl.toString=Dl.toString,Re.second=Ne(function(t){return new Ee(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),Re.seconds=Re.second.range,Re.seconds.utc=Re.second.utc.range,Re.minute=Ne(function(t){return new Ee(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),Re.minutes=Re.minute.range,Re.minutes.utc=Re.minute.utc.range,Re.hour=Ne(function(t){var e=t.getTimezoneOffset()/60;return new Ee(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),Re.hours=Re.hour.range,Re.hours.utc=Re.hour.utc.range,Re.month=Ne(function(t){return(t=Re.day(t)).setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),Re.months=Re.month.range,Re.months.utc=Re.month.utc.range;var Il=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Fl=[[Re.second,1],[Re.second,5],[Re.second,15],[Re.second,30],[Re.minute,1],[Re.minute,5],[Re.minute,15],[Re.minute,30],[Re.hour,1],[Re.hour,3],[Re.hour,6],[Re.hour,12],[Re.day,1],[Re.day,2],[Re.week,1],[Re.month,1],[Re.month,3],[Re.year,1]],Nl=Ol.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",Yr]]),jl={range:function(e,r,n){return t.range(Math.ceil(e/n)*n,+r,n).map(El)},floor:P,ceil:P};Fl.year=Re.year,Re.scale=function(){return Rl(t.scale.linear(),Fl,Nl)};var Bl=Fl.map(function(t){return[t[0].utc,t[1]]}),Hl=Pl.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",Yr]]);function Vl(t){return JSON.parse(t.responseText)}function ql(t){var e=a.createRange();return e.selectNode(a.body),e.createContextualFragment(t.responseText)}Bl.year=Re.year.utc,Re.scale.utc=function(){return Rl(t.scale.linear(),Bl,Hl)},t.text=me(function(t){return t.responseText}),t.json=function(t,e){return ye(t,"application/json",Vl,e)},t.html=function(t,e){return ye(t,"text/html",ql,e)},t.xml=me(function(t){return t.responseXML}),"object"==typeof e&&e.exports?e.exports=t:this.d3=t}()},{}],8:[function(t,e,r){(function(n,a){!function(t,n){"object"==typeof r&&"undefined"!=typeof e?e.exports=n():t.ES6Promise=n()}(this,function(){"use strict";function e(t){return"function"==typeof t}var r=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},i=0,o=void 0,l=void 0,s=function(t,e){g[i]=t,g[i+1]=e,2===(i+=2)&&(l?l(v):_())};var c="undefined"!=typeof window?window:void 0,u=c||{},f=u.MutationObserver||u.WebKitMutationObserver,d="undefined"==typeof self&&"undefined"!=typeof n&&"[object process]"==={}.toString.call(n),p="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function h(){var t=setTimeout;return function(){return t(v,1)}}var g=new Array(1e3);function v(){for(var t=0;t<i;t+=2){(0,g[t])(g[t+1]),g[t]=void 0,g[t+1]=void 0}i=0}var m,y,x,b,_=void 0;function w(t,e){var r=arguments,n=this,a=new this.constructor(M);void 0===a[T]&&V(a);var i,o=n._state;return o?(i=r[o-1],s(function(){return B(o,a,i,n._result)})):I(n,a,t,e),a}function k(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(M);return D(e,t),e}d?_=function(){return n.nextTick(v)}:f?(y=0,x=new f(v),b=document.createTextNode(""),x.observe(b,{characterData:!0}),_=function(){b.data=y=++y%2}):p?((m=new MessageChannel).port1.onmessage=v,_=function(){return m.port2.postMessage(0)}):_=void 0===c&&"function"==typeof t?function(){try{var e=t("vertx");return o=e.runOnLoop||e.runOnContext,function(){o(v)}}catch(t){return h()}}():h();var T=Math.random().toString(36).substring(16);function M(){}var A=void 0,L=1,S=2,C=new N;function O(t){try{return t.then}catch(t){return C.error=t,C}}function P(t,r,n){r.constructor===t.constructor&&n===w&&r.constructor.resolve===k?function(t,e){e._state===L?R(t,e._result):e._state===S?E(t,e._result):I(e,void 0,function(e){return D(t,e)},function(e){return E(t,e)})}(t,r):n===C?E(t,C.error):void 0===n?R(t,r):e(n)?function(t,e,r){s(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?D(t,r):R(t,r))},function(e){n||(n=!0,E(t,e))},t._label);!n&&a&&(n=!0,E(t,a))},t)}(t,r,n):R(t,r)}function D(t,e){var r;t===e?E(t,new TypeError("You cannot resolve a promise with itself")):"function"==typeof(r=e)||"object"==typeof r&&null!==r?P(t,e,O(e)):R(t,e)}function z(t){t._onerror&&t._onerror(t._result),F(t)}function R(t,e){t._state===A&&(t._result=e,t._state=L,0!==t._subscribers.length&&s(F,t))}function E(t,e){t._state===A&&(t._state=S,t._result=e,s(z,t))}function I(t,e,r,n){var a=t._subscribers,i=a.length;t._onerror=null,a[i]=e,a[i+L]=r,a[i+S]=n,0===i&&t._state&&s(F,t)}function F(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?B(r,n,a,i):a(i);t._subscribers.length=0}}function N(){this.error=null}var j=new N;function B(t,r,n,a){var i=e(n),o=void 0,l=void 0,s=void 0,c=void 0;if(i){if((o=function(t,e){try{return t(e)}catch(t){return j.error=t,j}}(n,a))===j?(c=!0,l=o.error,o=null):s=!0,r===o)return void E(r,new TypeError("A promises callback cannot return that same promise."))}else o=a,s=!0;r._state!==A||(i&&s?D(r,o):c?E(r,l):t===L?R(r,o):t===S&&E(r,o))}var H=0;function V(t){t[T]=H++,t._state=void 0,t._result=void 0,t._subscribers=[]}function q(t,e){this._instanceConstructor=t,this.promise=new t(M),this.promise[T]||V(this.promise),r(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?R(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&R(this.promise,this._result))):E(this.promise,new Error("Array Methods must be provided an Array"))}function U(t){this[T]=H++,this._result=this._state=void 0,this._subscribers=[],M!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof U?function(t,e){try{e(function(e){D(t,e)},function(e){E(t,e)})}catch(e){E(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 G(){var t=void 0;if("undefined"!=typeof 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=U}return q.prototype._enumerate=function(){for(var t=this.length,e=this._input,r=0;this._state===A&&r<t;r++)this._eachEntry(e[r],r)},q.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===k){var a=O(t);if(a===w&&t._state!==A)this._settledAt(t._state,e,t._result);else if("function"!=typeof a)this._remaining--,this._result[e]=t;else if(r===U){var i=new r(M);P(i,t,a),this._willSettleAt(i,e)}else this._willSettleAt(new r(function(e){return e(t)}),e)}else this._willSettleAt(n(t),e)},q.prototype._settledAt=function(t,e,r){var n=this.promise;n._state===A&&(this._remaining--,t===S?E(n,r):this._result[e]=r),0===this._remaining&&R(n,this._result)},q.prototype._willSettleAt=function(t,e){var r=this;I(t,void 0,function(t){return r._settledAt(L,e,t)},function(t){return r._settledAt(S,e,t)})},U.all=function(t){return new q(this,t).promise},U.race=function(t){var e=this;return r(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."))})},U.resolve=k,U.reject=function(t){var e=new this(M);return E(e,t),e},U._setScheduler=function(t){l=t},U._setAsap=function(t){s=t},U._asap=s,U.prototype={constructor:U,then:w,catch:function(t){return this.then(null,t)}},G(),U.polyfill=G,U.Promise=U,U})}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:24}],9:[function(t,e,r){"use strict";var n=t("is-string-blank");e.exports=function(t){var e=typeof t;if("string"===e){var r=t;if(0===(t=+t)&&n(r))return!1}else if("number"!==e)return!1;return t-t<1}},{"is-string-blank":14}],10:[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,l=n+n,s=a+a,c=r*o,u=n*o,f=n*l,d=a*o,p=a*l,h=a*s,g=i*o,v=i*l,m=i*s;return t[0]=1-f-h,t[1]=u+m,t[2]=d-v,t[3]=0,t[4]=u-m,t[5]=1-c-h,t[6]=p+g,t[7]=0,t[8]=d+v,t[9]=p-g,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],11:[function(t,e,r){(function(r){"use strict";var n,a=t("is-browser");n="function"==typeof r.matchMedia?!r.matchMedia("(hover: none)").matches:a,e.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"is-browser":13}],12:[function(t,e,r){"use strict";var n=t("is-browser");e.exports=n&&function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){t=!1}return t}()},{"is-browser":13}],13:[function(t,e,r){e.exports=!0},{}],14:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=t.length,n=0;n<r;n++)if(((e=t.charCodeAt(n))<9||e>13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}},{}],15:[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=t.clientX||0,i=t.clientY||0,o=(l=e,l===window||l===document||l===document.body?n:l.getBoundingClientRect());var l;return r[0]=a-o.left,r[1]=i-o.top,r}},{}],16:[function(t,e,r){var n,a=t("./lib/build-log"),i=t("./lib/epsilon"),o=t("./lib/intersecter"),l=t("./lib/segment-chainer"),s=t("./lib/segment-selector"),c=t("./lib/geojson"),u=!1,f=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?u=a():!1===t&&(u=!1),!1!==u&&u.list},epsilon:function(t){return f.epsilon(t)},segments:function(t){var e=o(!0,f,u);return t.regions.forEach(e.addRegion),{segments:e.calculate(t.inverted),inverted:t.inverted}},combine:function(t,e){return{combined:o(!1,f,u).calculate(t.segments,t.inverted,e.segments,e.inverted),inverted1:t.inverted,inverted2:e.inverted}},selectUnion:function(t){return{segments:s.union(t.combined,u),inverted:t.inverted1||t.inverted2}},selectIntersect:function(t){return{segments:s.intersect(t.combined,u),inverted:t.inverted1&&t.inverted2}},selectDifference:function(t){return{segments:s.difference(t.combined,u),inverted:t.inverted1&&!t.inverted2}},selectDifferenceRev:function(t){return{segments:s.differenceRev(t.combined,u),inverted:!t.inverted1&&t.inverted2}},selectXor:function(t){return{segments:s.xor(t.combined,u),inverted:t.inverted1!==t.inverted2}},polygon:function(t){return{regions:l(t.segments,f,u),inverted:t.inverted}},polygonFromGeoJSON:function(t){return c.toPolygon(n,t)},polygonToGeoJSON:function(t){return c.fromPolygon(n,f,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":17,"./lib/epsilon":18,"./lib/geojson":19,"./lib/intersecter":20,"./lib/segment-chainer":22,"./lib/segment-selector":23}],17:[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")}}}},{}],18:[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],l=n[1],s=e[0];return(o-a)*(e[1]-i)-(l-i)*(s-a)>=-t},pointBetween:function(e,r,n){var a=e[1]-r[1],i=n[0]-r[0],o=e[0]-r[0],l=n[1]-r[1],s=o*i+a*l;return!(s<t||s-(i*i+l*l)>-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],l=r[1]-n[1];return Math.abs(a*l-o*i)<t},linesIntersect:function(e,r,n,a){var i=r[0]-e[0],o=r[1]-e[1],l=a[0]-n[0],s=a[1]-n[1],c=i*s-o*l;if(Math.abs(c)<t)return!1;var u=e[0]-n[0],f=e[1]-n[1],d=(l*f-s*u)/c,p=(i*f-o*u)/c,h={alongA:0,alongB:0,pt:[e[0]+d*i,e[1]+d*o]};return h.alongA=d<=-t?-2:d<t?-1:d-1<=-t?0:d-1<t?1:2,h.alongB=p<=-t?-2:p<t?-1:p-1<=-t?0:p-1<t?1:2,h},pointInsideRegion:function(e,r){for(var n=e[0],a=e[1],i=r[r.length-1][0],o=r[r.length-1][1],l=!1,s=0;s<r.length;s++){var c=r[s][0],u=r[s][1];u-a>t!=o-a>t&&(i-c)*(a-u)/(o-u)+c-n>t&&(l=!l),i=c,o=u}return l}};return e}},{}],19:[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,(l=t.children[r]).region))return void o(l,e)}var i=a(e);for(r=0;r<t.children.length;r++){var l;n((l=t.children[r]).region,e)&&(i.children.push(l),t.children.splice(r,1),r--)}t.children.push(i)}for(var l=0;l<r.regions.length;l++){var s=r.regions[l];s.length<3||o(i,s)}function c(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 l=t[o][0],s=t[o][1];i.push([l,s]),r+=s*n-l*a,n=l,a=s}return r<0!==e&&i.reverse(),i.push([i[0][0],i[0][1]]),i}var u=[];function f(t){var e=[c(t.region,!1)];u.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++)f(t.children[e]);return c(t.region,!0)}for(l=0;l<i.children.length;l++)f(i.children[l]);return u.length<=0?{type:"Polygon",coordinates:[]}:1==u.length?{type:"Polygon",coordinates:u[0]}:{type:"MultiPolygon",coordinates:u}}};e.exports=n},{}],20:[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 l=e.pointsCompare(r,i);return 0!==l?l: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 l(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 s(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),l(n,t.primary)}function c(a,o){var l=n.create();function c(t){return l.findTransition(function(r){var n,a,i,o,l,s;return n=t,a=r.ev,i=n.seg.start,o=n.seg.end,l=a.seg.start,s=a.seg.end,(e.pointsCollinear(i,l,s)?e.pointsCollinear(o,l,s)?1:e.pointAboveOrOnLine(o,l,s)?1:-1:e.pointAboveOrOnLine(i,l,s)?1:-1)>0})}function u(t,n){var a=t.seg,i=n.seg,o=a.start,l=a.end,c=i.start,u=i.end;r&&r.checkIntersection(a,i);var f=e.linesIntersect(o,l,c,u);if(!1===f){if(!e.pointsCollinear(o,l,c))return!1;if(e.pointsSame(o,u)||e.pointsSame(l,c))return!1;var d=e.pointsSame(o,c),p=e.pointsSame(l,u);if(d&&p)return n;var h=!d&&e.pointBetween(o,c,u),g=!p&&e.pointBetween(l,c,u);if(d)return g?s(n,l):s(t,u),n;h&&(p||(g?s(n,l):s(t,u)),s(n,o))}else 0===f.alongA&&(-1===f.alongB?s(t,c):0===f.alongB?s(t,f.pt):1===f.alongB&&s(t,u)),0===f.alongB&&(-1===f.alongA?s(n,o):0===f.alongA?s(n,f.pt):1===f.alongA&&s(n,l));return!1}for(var f=[];!i.isEmpty();){var d=i.getHead();if(r&&r.vert(d.pt[0]),d.isStart){r&&r.segmentNew(d.seg,d.primary);var p=c(d),h=p.before?p.before.ev:null,g=p.after?p.after.ev:null;function v(){if(h){var t=u(d,h);if(t)return t}return!!g&&u(d,g)}r&&r.tempStatus(d.seg,!!h&&h.seg,!!g&&g.seg);var m,y,x=v();if(x)t?(y=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below)&&(x.seg.myFill.above=!x.seg.myFill.above):x.seg.otherFill=d.seg.myFill,r&&r.segmentUpdate(x.seg),d.other.remove(),d.remove();if(i.getHead()!==d){r&&r.rewind(d.seg);continue}t?(y=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below,d.seg.myFill.below=g?g.seg.myFill.above:a,d.seg.myFill.above=y?!d.seg.myFill.below:d.seg.myFill.below):null===d.seg.otherFill&&(m=g?d.primary===g.primary?g.seg.otherFill.above:g.seg.myFill.above:d.primary?o:a,d.seg.otherFill={above:m,below:m}),r&&r.status(d.seg,!!h&&h.seg,!!g&&g.seg),d.other.status=p.insert(n.node({ev:d}))}else{var b=d.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(l.exists(b.prev)&&l.exists(b.next)&&u(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.remove(),!d.primary){var _=d.seg.myFill;d.seg.myFill=d.seg.otherFill,d.seg.otherFill=_}f.push(d.seg)}i.getHead().remove()}return r&&r.done(),f}return t?{addRegion:function(t){for(var n,a,i,o=t[t.length-1],s=0;s<t.length;s++){n=o,o=t[s];var c=e.pointsCompare(n,o);0!==c&&l((a=c<0?n:o,i=c<0?o:n,{id:r?r.segmentId():-1,start:a,end:i,myFill:{above:null,below:null},otherFill:null}),!0)}},calculate:function(t){return c(t,!1)}}:{calculate:function(t,e,r,n){return t.forEach(function(t){l(a(t.start,t.end,t),!0)}),r.forEach(function(t){l(a(t.start,t.end,t),!1)}),c(e,n)}}}},{"./linked-list":21}],21:[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}}},{}],22:[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 l={index:0,matches_head:!1,matches_pt1:!1},s={index:0,matches_head:!1,matches_pt1:!1},c=l,u=0;u<n.length;u++){var f=(v=n[u])[0],d=(v[1],v[v.length-1]);if(v[v.length-2],e.pointsSame(f,i)){if(T(u,!0,!0))break}else if(e.pointsSame(f,o)){if(T(u,!0,!1))break}else if(e.pointsSame(d,i)){if(T(u,!1,!0))break}else if(e.pointsSame(d,o)&&T(u,!1,!1))break}if(c===l)return n.push([i,o]),void(r&&r.chainNew(i,o));if(c===s){r&&r.chainMatch(l.index);var p=l.index,h=l.matches_pt1?o:i,g=l.matches_head,v=n[p],m=g?v[0]:v[v.length-1],y=g?v[1]:v[v.length-2],x=g?v[v.length-1]:v[0],b=g?v[v.length-2]:v[1];return e.pointsCollinear(y,m,h)&&(g?(r&&r.chainRemoveHead(l.index,h),v.shift()):(r&&r.chainRemoveTail(l.index,h),v.pop()),m=y),e.pointsSame(x,h)?(n.splice(p,1),e.pointsCollinear(b,x,m)&&(g?(r&&r.chainRemoveTail(l.index,m),v.pop()):(r&&r.chainRemoveHead(l.index,m),v.shift())),r&&r.chainClose(l.index),void a.push(v)):void(g?(r&&r.chainAddHead(l.index,h),v.unshift(h)):(r&&r.chainAddTail(l.index,h),v.push(h)))}var _=l.index,w=s.index;r&&r.chainConnect(_,w);var k=n[_].length<n[w].length;l.matches_head?s.matches_head?k?(M(_),A(_,w)):(M(w),A(w,_)):A(w,_):s.matches_head?A(_,w):k?(M(_),A(w,_)):(M(w),A(_,w))}function T(t,e,r){return c.index=t,c.matches_head=e,c.matches_pt1=r,c===l?(c=s,!1):(c=null,!0)}function M(t){r&&r.chainReverse(t),n[t].reverse()}function A(t,a){var i=n[t],o=n[a],l=i[i.length-1],s=i[i.length-2],c=o[0],u=o[1];e.pointsCollinear(s,l,c)&&(r&&r.chainRemoveTail(t,l),i.pop(),l=s),e.pointsCollinear(l,c,u)&&(r&&r.chainRemoveHead(a,c),o.shift()),r&&r.chainJoin(t,a),n[t]=i.concat(o),n.splice(a,1)}}),a}},{}],23:[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},{}],24:[function(t,e,r){var n,a,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}function s(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:l}catch(t){a=l}}();var c,u=[],f=!1,d=-1;function p(){f&&c&&(f=!1,c.length?u=c.concat(u):d=-1,u.length&&h())}function h(){if(!f){var t=s(p);f=!0;for(var e=u.length;e;){for(c=u,u=[];++d<e;)c&&c[d].run();d=-1,e=u.length}c=null,f=!1,function(t){if(a===clearTimeout)return clearTimeout(t);if((a===l||!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 g(t,e){this.fun=t,this.array=e}function v(){}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];u.push(new g(t,e)),1!==u.length||f||s(h)},g.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=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,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}},{}],25:[function(t,e,r){!function(t){var r=/^\s+/,n=/\s+$/,a=0,i=t.round,o=t.min,l=t.max,s=t.random;function c(e,s){if(s=s||{},(e=e||"")instanceof c)return e;if(!(this instanceof c))return new c(e,s);var u=function(e){var a={r:0,g:0,b:0},i=1,s=null,c=null,u=null,f=!1,d=!1;"string"==typeof e&&(e=function(t){t=t.replace(r,"").replace(n,"").toLowerCase();var e,a=!1;if(L[t])t=L[t],a=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=B.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=B.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=B.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=B.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=B.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=B.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=B.hex8.exec(t))return{r:D(e[1]),g:D(e[2]),b:D(e[3]),a:I(e[4]),format:a?"name":"hex8"};if(e=B.hex6.exec(t))return{r:D(e[1]),g:D(e[2]),b:D(e[3]),format:a?"name":"hex"};if(e=B.hex4.exec(t))return{r:D(e[1]+""+e[1]),g:D(e[2]+""+e[2]),b:D(e[3]+""+e[3]),a:I(e[4]+""+e[4]),format:a?"name":"hex8"};if(e=B.hex3.exec(t))return{r:D(e[1]+""+e[1]),g:D(e[2]+""+e[2]),b:D(e[3]+""+e[3]),format:a?"name":"hex"};return!1}(e));"object"==typeof e&&(H(e.r)&&H(e.g)&&H(e.b)?(p=e.r,h=e.g,g=e.b,a={r:255*O(p,255),g:255*O(h,255),b:255*O(g,255)},f=!0,d="%"===String(e.r).substr(-1)?"prgb":"rgb"):H(e.h)&&H(e.s)&&H(e.v)?(s=R(e.s),c=R(e.v),a=function(e,r,n){e=6*O(e,360),r=O(r,100),n=O(n,100);var a=t.floor(e),i=e-a,o=n*(1-r),l=n*(1-i*r),s=n*(1-(1-i)*r),c=a%6;return{r:255*[n,l,o,o,s,n][c],g:255*[s,n,n,l,o,o][c],b:255*[o,o,s,n,n,l][c]}}(e.h,s,c),f=!0,d="hsv"):H(e.h)&&H(e.s)&&H(e.l)&&(s=R(e.s),u=R(e.l),a=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=O(t,360),e=O(e,100),r=O(r,100),0===e)n=a=i=r;else{var l=r<.5?r*(1+e):r+e-r*e,s=2*r-l;n=o(s,l,t+1/3),a=o(s,l,t),i=o(s,l,t-1/3)}return{r:255*n,g:255*a,b:255*i}}(e.h,s,u),f=!0,d="hsl"),e.hasOwnProperty("a")&&(i=e.a));var p,h,g;return i=C(i),{ok:f,format:e.format||d,r:o(255,l(a.r,0)),g:o(255,l(a.g,0)),b:o(255,l(a.b,0)),a:i}}(e);this._originalInput=e,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=i(100*this._a)/100,this._format=s.format||u.format,this._gradientType=s.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=u.ok,this._tc_id=a++}function u(t,e,r){t=O(t,255),e=O(e,255),r=O(r,255);var n,a,i=l(t,e,r),s=o(t,e,r),c=(i+s)/2;if(i==s)n=a=0;else{var u=i-s;switch(a=c>.5?u/(2-i-s):u/(i+s),i){case t:n=(e-r)/u+(e<r?6:0);break;case e:n=(r-t)/u+2;break;case r:n=(t-e)/u+4}n/=6}return{h:n,s:a,l:c}}function f(t,e,r){t=O(t,255),e=O(e,255),r=O(r,255);var n,a,i=l(t,e,r),s=o(t,e,r),c=i,u=i-s;if(a=0===i?0:u/i,i==s)n=0;else{switch(i){case t:n=(e-r)/u+(e<r?6:0);break;case e:n=(r-t)/u+2;break;case r:n=(t-e)/u+4}n/=6}return{h:n,s:a,v:c}}function d(t,e,r,n){var a=[z(i(t).toString(16)),z(i(e).toString(16)),z(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 p(t,e,r,n){return[z(E(n)),z(i(t).toString(16)),z(i(e).toString(16)),z(i(r).toString(16))].join("")}function h(t,e){e=0===e?0:e||10;var r=c(t).toHsl();return r.s-=e/100,r.s=P(r.s),c(r)}function g(t,e){e=0===e?0:e||10;var r=c(t).toHsl();return r.s+=e/100,r.s=P(r.s),c(r)}function v(t){return c(t).desaturate(100)}function m(t,e){e=0===e?0:e||10;var r=c(t).toHsl();return r.l+=e/100,r.l=P(r.l),c(r)}function y(t,e){e=0===e?0:e||10;var r=c(t).toRgb();return r.r=l(0,o(255,r.r-i(-e/100*255))),r.g=l(0,o(255,r.g-i(-e/100*255))),r.b=l(0,o(255,r.b-i(-e/100*255))),c(r)}function x(t,e){e=0===e?0:e||10;var r=c(t).toHsl();return r.l-=e/100,r.l=P(r.l),c(r)}function b(t,e){var r=c(t).toHsl(),n=(r.h+e)%360;return r.h=n<0?360+n:n,c(r)}function _(t){var e=c(t).toHsl();return e.h=(e.h+180)%360,c(e)}function w(t){var e=c(t).toHsl(),r=e.h;return[c(t),c({h:(r+120)%360,s:e.s,l:e.l}),c({h:(r+240)%360,s:e.s,l:e.l})]}function k(t){var e=c(t).toHsl(),r=e.h;return[c(t),c({h:(r+90)%360,s:e.s,l:e.l}),c({h:(r+180)%360,s:e.s,l:e.l}),c({h:(r+270)%360,s:e.s,l:e.l})]}function T(t){var e=c(t).toHsl(),r=e.h;return[c(t),c({h:(r+72)%360,s:e.s,l:e.l}),c({h:(r+216)%360,s:e.s,l:e.l})]}function M(t,e,r){e=e||6,r=r||30;var n=c(t).toHsl(),a=360/r,i=[c(t)];for(n.h=(n.h-(a*e>>1)+720)%360;--e;)n.h=(n.h+a)%360,i.push(c(n));return i}function A(t,e){e=e||6;for(var r=c(t).toHsv(),n=r.h,a=r.s,i=r.v,o=[],l=1/e;e--;)o.push(c({h:n,s:a,v:i})),i=(i+l)%1;return o}c.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=C(t),this._roundA=i(100*this._a)/100,this},toHsv:function(){var t=f(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=f(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=u(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=u(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=[z(i(t).toString(16)),z(i(e).toString(16)),z(i(r).toString(16)),z(E(n))];if(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))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r: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*O(this._r,255))+"%",g:i(100*O(this._g,255))+"%",b:i(100*O(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(this._b,255))+"%)":"rgba("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(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="#"+p(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var a=c(t);r="#"+p(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 c(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(m,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(M,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(T,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(k,arguments)}},c.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:R(t[n]));t=r}return c(t,e)},c.equals=function(t,e){return!(!t||!e)&&c(t).toRgbString()==c(e).toRgbString()},c.random=function(){return c.fromRatio({r:s(),g:s(),b:s()})},c.mix=function(t,e,r){r=0===r?0:r||50;var n=c(t).toRgb(),a=c(e).toRgb(),i=r/100;return c({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})},c.readability=function(e,r){var n=c(e),a=c(r);return(t.max(n.getLuminance(),a.getLuminance())+.05)/(t.min(n.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(t,e,r){var n,a,i=c.readability(t,e);switch(a=!1,(n=function(t){var e,r;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==r&&"large"!==r&&(r="small");return{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},c.mostReadable=function(t,e,r){var n,a,i,o,l=null,s=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;u<e.length;u++)(n=c.readability(t,e[u]))>s&&(s=n,l=c(e[u]));return c.isReadable(t,l,{level:i,size:o})||!a?l:(r.includeFallbackColors=!1,c.mostReadable(t,["#fff","#000"],r))};var L=c.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=c.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(L);function C(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function O(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,l(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function P(t){return o(1,l(0,t))}function D(t){return parseInt(t,16)}function z(t){return 1==t.length?"0"+t:""+t}function R(t){return t<=1&&(t=100*t+"%"),t}function E(e){return t.round(255*parseFloat(e)).toString(16)}function I(t){return D(t)/255}var F,N,j,B=(N="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",j="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+N),rgba:new RegExp("rgba"+j),hsl:new RegExp("hsl"+N),hsla:new RegExp("hsla"+j),hsv:new RegExp("hsv"+N),hsva:new RegExp("hsva"+j),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 H(t){return!!B.CSS_UNIT.exec(t)}"undefined"!=typeof e&&e.exports?e.exports=c:window.tinycolor=c}(Math)},{}],26:[function(t,e,r){"use strict";e.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],27:[function(t,e,r){"use strict";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":193,"../../plots/cartesian/constants":209,"../../plots/font_attributes":229,"./arrow_paths":26}],28:[function(t,e,r){"use strict";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&&l(e,r),n&&l(e,n)})}function l(t,e){var r,n=e._id,i=n.charAt(0),o=t[i],l=t["a"+i],s=t[i+"ref"],c=t["a"+i+"ref"],u=t["_"+i+"padplus"],f=t["_"+i+"padminus"],d={x:1,y:-1}[i]*t[i+"shift"],p=3*t.arrowsize*t.arrowwidth||0,h=p+d,g=p-d,v=3*t.startarrowsize*t.arrowwidth||0,m=v+d,y=v-d;if(c===s){var x=a.findExtremes(e,[e.r2c(o)],{ppadplus:h,ppadminus:g}),b=a.findExtremes(e,[e.r2c(l)],{ppadplus:Math.max(u,m),ppadminus:Math.max(f,y)});r={min:[x.min[0],b.min[0]],max:[x.max[0],b.max[0]]}}else m=l?m+l:m,y=l?y-l:y,r=a.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(u,h,m),ppadminus:Math.max(f,g,y)});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":159,"../../plots/cartesian/axes":203,"./draw":33}],29:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("../../plot_api/plot_template").arrayEditor;function o(t,e){var r,n,a,i,o,s,c,u=t._fullLayout.annotations,f=[],d=[],p=[],h=(e||[]).length;for(r=0;r<u.length;r++)if(i=(a=u[r]).clicktoshow){for(n=0;n<h;n++)if(s=(o=e[n]).xaxis,c=o.yaxis,s._id===a.xref&&c._id===a.yref&&s.d2r(o.x)===l(a._xclick,s)&&c.d2r(o.y)===l(a._yclick,c)){(a.visible?"onout"===i?d:p:f).push(r);break}n===h&&a.visible&&"onout"===i&&d.push(r)}return{on:f,off:d,explicitOff:p}}function l(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,l,s=o(t,e),c=s.on,u=s.off.concat(s.explicitOff),f={},d=t._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r<c.length;r++)(l=i(t.layout,"annotations",d[c[r]])).modifyItem("visible",!0),n.extendFlat(f,l.getUpdateObj());for(r=0;r<u.length;r++)(l=i(t.layout,"annotations",d[u[r]])).modifyItem("visible",!1),n.extendFlat(f,l.getUpdateObj());return a.call("update",t,{},f)}}},{"../../lib":159,"../../plot_api/plot_template":193,"../../registry":243}],30:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../color");e.exports=function(t,e,r,i){i("opacity");var o=i("bgcolor"),l=i("bordercolor"),s=a.opacity(l);i("borderpad");var c=i("borderwidth"),u=i("showarrow");if(i("text",u?" ":r._dfltTitle.annotation),i("textangle"),n.coerceFont(i,"font",r.font),i("width"),i("align"),i("height")&&i("valign"),u){var f,d,p=i("arrowside");-1!==p.indexOf("end")&&(f=i("arrowhead"),d=i("arrowsize")),-1!==p.indexOf("start")&&(i("startarrowhead",f),i("startarrowsize",d)),i("arrowcolor",s?e.bordercolor:a.defaultLine),i("arrowwidth",2*(s&&c||1)),i("standoff"),i("startstandoff")}var h=i("hovertext"),g=r.hoverlabel||{};if(h){var v=i("hoverlabel.bgcolor",g.bgcolor||(a.opacity(o)?a.rgb(o):a.defaultLine)),m=i("hoverlabel.bordercolor",g.bordercolor||a.contrast(v));n.coerceFont(i,"hoverlabel.font",{family:g.font.family,size:g.font.size,color:g.font.color||m})}i("captureevents",!!h)}},{"../../lib":159,"../color":42}],31:[function(t,e,r){"use strict";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,l="linear"===r&&"log"===e.type;if(o||l)for(var s,c,u=t._fullLayout.annotations,f=e._id.charAt(0),d=0;d<u.length;d++)s=u[d],c="annotations["+d+"].",s[f+"ref"]===e._id&&p(f),s["a"+f+"ref"]===e._id&&p("a"+f);function p(t){var r=s[t],l=null;l=o?a(r,e.range):Math.pow(10,r),n(l)||(l=null),i(c+t,l)}}},{"../../lib/to_log_range":182,"fast-isnumeric":9}],32:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../../plots/array_container_defaults"),o=t("./common_defaults"),l=t("./attributes");function s(t,e,r){function i(r,a){return n.coerce(t,e,l,r,a)}var s=i("visible"),c=i("clicktoshow");if(s||c){o(t,e,r,i);for(var u=e.showarrow,f=["x","y"],d=[-10,-30],p={_fullLayout:r},h=0;h<2;h++){var g=f[h],v=a.coerceRef(t,e,p,g,"","paper");if("paper"!==v)a.getFromId(p,v)._annIndices.push(e._index);if(a.coercePosition(e,p,i,v,g,.5),u){var m="a"+g,y=a.coerceRef(t,e,p,m,"pixel");"pixel"!==y&&y!==v&&(y=e[m]="pixel");var x="pixel"===y?d[h]:.4;a.coercePosition(e,p,i,y,m,x)}i(g+"anchor"),i(g+"shift")}if(n.noneOrAll(t,e,["x","y"]),u&&n.noneOrAll(t,e,["ax","ay"]),c){var b=i("xclick"),_=i("yclick");e._xclick=void 0===b?e.x:a.cleanPosition(b,p,e.xref),e._yclick=void 0===_?e.y:a.cleanPosition(_,p,e.yref)}}}e.exports=function(t,e){i(t,e,{name:"annotations",handleItemDefaults:s})}},{"../../lib":159,"../../plots/array_container_defaults":199,"../../plots/cartesian/axes":203,"./attributes":27,"./common_defaults":30}],33:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../plots/plots"),o=t("../../lib"),l=t("../../plots/cartesian/axes"),s=t("../color"),c=t("../drawing"),u=t("../fx"),f=t("../../lib/svg_text_utils"),d=t("../../lib/setcursor"),p=t("../dragelement"),h=t("../../plot_api/plot_template").arrayEditor,g=t("./draw_arrow_head");function v(t,e){var r=t._fullLayout.annotations[e]||{},n=l.getFromId(t,r.xref),a=l.getFromId(t,r.yref);n&&n.setScale(),a&&a.setScale(),m(t,r,e,!1,n,a)}function m(t,e,r,i,l,v){var m,y,x=t._fullLayout,b=t._fullLayout._size,_=t._context.edits;i?(m="annotation-"+i,y=i+".annotations"):(m="annotation",y="annotations");var w=h(t.layout,y,e),k=w.modifyBase,T=w.modifyItem,M=w.getUpdateObj;x._infolayer.selectAll("."+m+'[data-index="'+r+'"]').remove();var A="clip"+x._uid+"_ann"+r;if(e._input&&!1!==e.visible){var L={x:{},y:{}},S=+e.textangle||0,C=x._infolayer.append("g").classed(m,!0).attr("data-index",String(r)).style("opacity",e.opacity),O=C.append("g").classed("annotation-text-g",!0),P=_[e.showarrow?"annotationTail":"annotationPosition"],D=e.captureevents||_.annotationText||P,z=O.append("g").style("pointer-events",D?"all":null).call(d,"pointer").on("click",function(){t._dragging=!1,t.emit("plotly_clickannotation",q(n.event))});e.hovertext&&z.on("mouseover",function(){var r=e.hoverlabel,n=r.font,a=this.getBoundingClientRect(),i=t.getBoundingClientRect();u.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:x._hoverlayer.node(),outerContainer:x._paper.node(),gd:t})}).on("mouseout",function(){u.loneUnhover(x._hoverlayer.node())});var R=e.borderwidth,E=e.borderpad,I=R+E,F=z.append("rect").attr("class","bg").style("stroke-width",R+"px").call(s.stroke,e.bordercolor).call(s.fill,e.bgcolor),N=e.width||e.height,j=x._topclips.selectAll("#"+A).data(N?[0]:[]);j.enter().append("clipPath").classed("annclip",!0).attr("id",A).append("rect"),j.exit().remove();var B=e.font,H=x._meta?o.templateString(e.text,x._meta):e.text,V=z.append("text").classed("annotation-text",!0).text(H);_.annotationText?V.call(f.makeEditable,{delegate:z,gd:t}).call(U).on("edit",function(r){e.text=r,this.call(U),T("text",r),l&&l.autorange&&k(l._name+".autorange",!0),v&&v.autorange&&k(v._name+".autorange",!0),a.call("_guiRelayout",t,M())}):V.call(U)}else n.selectAll("#"+A).remove();function q(t){var n={index:r,annotation:e._input,fullAnnotation:e,event:t};return i&&(n.subplotId=i),n}function U(r){return r.call(c.font,B).attr({"text-anchor":{left:"start",right:"end"}[e.align]||"middle"}),f.convertToTspans(r,t,G),r}function G(){var r=V.selectAll("a");1===r.size()&&r.text()===V.text()&&z.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=z.select(".annotation-text-math-group"),u=!n.empty(),h=c.bBox((u?n:V).node()),m=h.width,y=h.height,w=e.width||m,D=e.height||y,E=Math.round(w+2*I),B=Math.round(D+2*I);function H(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 U=!1,G=["x","y"],Z=0;Z<G.length;Z++){var X,Y,W,$,Q,J=G[Z],K=e[J+"ref"]||J,tt=e["a"+J+"ref"],et={x:l,y:v}[J],rt=(S+("x"===J?0:-90))*Math.PI/180,nt=E*Math.cos(rt),at=B*Math.sin(rt),it=Math.abs(nt)+Math.abs(at),ot=e[J+"anchor"],lt=e[J+"shift"]*("x"===J?1:-1),st=L[J];if(et){var ct=et.r2fraction(e[J]);(ct<0||ct>1)&&(tt===K?((ct=et.r2fraction(e["a"+J]))<0||ct>1)&&(U=!0):U=!0),X=et._offset+et.r2p(e[J]),$=.5}else"x"===J?(W=e[J],X=b.l+b.w*W):(W=1-e[J],X=b.t+b.h*W),$=e.showarrow?.5:W;if(e.showarrow){st.head=X;var ut=e["a"+J];Q=nt*H(.5,e.xanchor)-at*H(.5,e.yanchor),tt===K?(st.tail=et._offset+et.r2p(ut),Y=Q):(st.tail=X+ut,Y=Q+ut),st.text=st.tail+Q;var ft=x["x"===J?"width":"height"];if("paper"===K&&(st.head=o.constrain(st.head,1,ft-1)),"pixel"===tt){var dt=-Math.max(st.tail-3,st.text),pt=Math.min(st.tail+3,st.text)-ft;dt>0?(st.tail+=dt,st.text+=dt):pt>0&&(st.tail-=pt,st.text-=pt)}st.tail+=lt,st.head+=lt}else Y=Q=it*H($,ot),st.text=X+Q;st.text+=lt,Q+=lt,Y+=lt,e["_"+J+"padplus"]=it/2+Y,e["_"+J+"padminus"]=it/2-Y,e["_"+J+"size"]=it,e["_"+J+"shift"]=Q}if(U)z.remove();else{var ht=0,gt=0;if("left"!==e.align&&(ht=(w-m)*("center"===e.align?.5:1)),"top"!==e.valign&&(gt=(D-y)*("middle"===e.valign?.5:1)),u)n.select("svg").attr({x:I+ht-1,y:I+gt}).call(c.setClipUrl,N?A:null,t);else{var vt=I+gt-h.top,mt=I+ht-h.left;V.call(f.positionText,mt,vt).call(c.setClipUrl,N?A:null,t)}j.select("rect").call(c.setRect,I,I,w,D),F.call(c.setRect,R/2,R/2,E-R,B-R),z.call(c.setTranslate,Math.round(L.x.text-E/2),Math.round(L.y.text-B/2)),O.attr({transform:"rotate("+S+","+L.x.text+","+L.y.text+")"});var yt,xt=function(r,n){C.selectAll(".annotation-arrow-g").remove();var u=L.x.head,f=L.y.head,d=L.x.tail+r,h=L.y.tail+n,m=L.x.text+r,y=L.y.text+n,x=o.rotationXYMatrix(S,m,y),w=o.apply2DTransform(x),A=o.apply2DTransform2(x),P=+F.attr("width"),D=+F.attr("height"),R=m-.5*P,E=R+P,I=y-.5*D,N=I+D,j=[[R,I,R,N],[R,N,E,N],[E,N,E,I],[E,I,R,I]].map(A);if(!j.reduce(function(t,e){return t^!!o.segmentsIntersect(u,f,u+1e6,f+1e6,e[0],e[1],e[2],e[3])},!1)){j.forEach(function(t){var e=o.segmentsIntersect(d,h,u,f,t[0],t[1],t[2],t[3]);e&&(d=e.x,h=e.y)});var B=e.arrowwidth,H=e.arrowcolor,V=e.arrowside,q=C.append("g").style({opacity:s.opacity(H)}).classed("annotation-arrow-g",!0),U=q.append("path").attr("d","M"+d+","+h+"L"+u+","+f).style("stroke-width",B+"px").call(s.stroke,s.rgb(H));if(g(U,V,e),_.annotationPosition&&U.node().parentNode&&!i){var G=u,Z=f;if(e.standoff){var X=Math.sqrt(Math.pow(u-d,2)+Math.pow(f-h,2));G+=e.standoff*(d-u)/X,Z+=e.standoff*(h-f)/X}var Y,W,$=q.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-G)+","+(h-Z),transform:"translate("+G+","+Z+")"}).style("stroke-width",B+6+"px").call(s.stroke,"rgba(0,0,0,0)").call(s.fill,"rgba(0,0,0,0)");p.init({element:$.node(),gd:t,prepFn:function(){var t=c.getTranslate(z);Y=t.x,W=t.y,l&&l.autorange&&k(l._name+".autorange",!0),v&&v.autorange&&k(v._name+".autorange",!0)},moveFn:function(t,r){var n=w(Y,W),a=n[0]+t,i=n[1]+r;z.call(c.setTranslate,a,i),T("x",l?l.p2r(l.r2p(e.x)+t):e.x+t/b.w),T("y",v?v.p2r(v.r2p(e.y)+r):e.y-r/b.h),e.axref===e.xref&&T("ax",l.p2r(l.r2p(e.ax)+t)),e.ayref===e.yref&&T("ay",v.p2r(v.r2p(e.ay)+r)),q.attr("transform","translate("+t+","+r+")"),O.attr({transform:"rotate("+S+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",t,M());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&xt(0,0),P)p.init({element:z.node(),gd:t,prepFn:function(){yt=O.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?T("ax",l.p2r(l.r2p(e.ax)+t)):T("ax",e.ax+t),e.ayref===e.yref?T("ay",v.p2r(v.r2p(e.ay)+r)):T("ay",e.ay+r),xt(t,r);else{if(i)return;var a,o;if(l)a=l.p2r(l.r2p(e.x)+t);else{var s=e._xsize/b.w,c=e.x+(e._xshift-e.xshift)/b.w-s/2;a=p.align(c+t/b.w,s,0,1,e.xanchor)}if(v)o=v.p2r(v.r2p(e.y)+r);else{var u=e._ysize/b.h,f=e.y-(e._yshift+e.yshift)/b.h-u/2;o=p.align(f-r/b.h,u,0,1,e.yanchor)}T("x",a),T("y",o),l&&v||(n=p.getCursor(l?.5:a,v?.5:o,e.xanchor,e.yanchor))}O.attr({transform:"translate("+t+","+r+")"+yt}),d(z,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",q(n))},doneFn:function(){d(z),a.call("_guiRelayout",t,M());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r<e.annotations.length;r++)e.annotations[r].visible&&v(t,r);return i.previousPromises(t)},drawOne:v,drawRaw:m}},{"../../lib":159,"../../lib/setcursor":178,"../../lib/svg_text_utils":180,"../../plot_api/plot_template":193,"../../plots/cartesian/axes":203,"../../plots/plots":235,"../../registry":243,"../color":42,"../dragelement":60,"../drawing":63,"../fx":80,"./draw_arrow_head":34,d3:7}],34:[function(t,e,r){"use strict";var n=t("d3"),a=t("../color"),i=t("./arrow_paths");e.exports=function(t,e,r){var o,l,s,c,u=t.node(),f=i[r.arrowhead||0],d=i[r.startarrowhead||0],p=(r.arrowwidth||1)*(r.arrowsize||1),h=(r.arrowwidth||1)*(r.startarrowsize||1),g=e.indexOf("start")>=0,v=e.indexOf("end")>=0,m=f.backoff*p+r.standoff,y=d.backoff*h+r.startstandoff;if("line"===u.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},l={x:+t.attr("x2"),y:+t.attr("y2")};var x=o.x-l.x,b=o.y-l.y;if(c=(s=Math.atan2(b,x))+Math.PI,m&&y&&m+y>Math.sqrt(x*x+b*b))return void P();if(m){if(m*m>x*x+b*b)return void P();var _=m*Math.cos(s),w=m*Math.sin(s);l.x+=_,l.y+=w,t.attr({x2:l.x,y2:l.y})}if(y){if(y*y>x*x+b*b)return void P();var k=y*Math.cos(s),T=y*Math.sin(s);o.x-=k,o.y-=T,t.attr({x1:o.x,y1:o.y})}}else if("path"===u.nodeName){var M=u.getTotalLength(),A="";if(M<m+y)return void P();var L=u.getPointAtLength(0),S=u.getPointAtLength(.1);s=Math.atan2(L.y-S.y,L.x-S.x),o=u.getPointAtLength(Math.min(y,M)),A="0px,"+y+"px,";var C=u.getPointAtLength(M),O=u.getPointAtLength(M-.1);c=Math.atan2(C.y-O.y,C.x-O.x),l=u.getPointAtLength(Math.max(0,M-m)),A+=M-(A?y+m:m)+"px,"+M+"px",t.style("stroke-dasharray",A)}function P(){t.style("stroke-dasharray","0px,100px")}function D(e,i,o,l){e.path&&(e.noRotate&&(o=0),n.select(u.parentNode).append("path").attr({class:t.attr("class"),d:e.path,transform:"translate("+i.x+","+i.y+")"+(o?"rotate("+180*o/Math.PI+")":"")+"scale("+l+")"}).style({fill:a.rgb(r.arrowcolor),"stroke-width":0}))}g&&D(d,o,s,h),v&&D(f,l,c,p)}},{"../color":42,"./arrow_paths":26,d3:7}],35:[function(t,e,r){"use strict";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":213,"./attributes":27,"./calc_autorange":28,"./click":29,"./convert_coords":31,"./defaults":32,"./draw":33}],36:[function(t,e,r){"use strict";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":186,"../../plot_api/plot_template":193,"../annotations/attributes":27}],37:[function(t,e,r){"use strict";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":159,"../../plots/cartesian/axes":203}],38:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../../plots/array_container_defaults"),o=t("../annotations/common_defaults"),l=t("./attributes");function s(t,e,r,i){function s(r,a){return n.coerce(t,e,l,r,a)}function c(t){var n=t+"axis",i={_fullLayout:{}};return i._fullLayout[n]=r[n],a.coercePosition(e,i,s,t,t,.5)}s("visible")&&(o(t,e,i.fullLayout,s),c("x"),c("y"),c("z"),n.noneOrAll(t,e,["x","y","z"]),e.xref="x",e.yref="y",e.zref="z",s("xanchor"),s("yanchor"),s("xshift"),s("yshift"),e.showarrow&&(e.axref="pixel",e.ayref="pixel",s("ax",-10),s("ay",-30),n.noneOrAll(t,e,["ax","ay"])))}e.exports=function(t,e,r){i(t,e,{name:"annotations",handleItemDefaults:s,fullLayout:r.fullLayout})}},{"../../lib":159,"../../plots/array_container_defaults":199,"../../plots/cartesian/axes":203,"../annotations/common_defaults":30,"./attributes":36}],39:[function(t,e,r){"use strict";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,l=0;l<o.length;l++){for(var s=o[l],c=!1,u=0;u<3;u++){var f=i[u],d=s[f],p=e[f+"axis"].r2fraction(d);if(p<0||p>1){c=!0;break}}c?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+l+'"]').remove():(s._pdata=a(t.glplot.cameraParams,[e.xaxis.r2l(s.x)*r[0],e.yaxis.r2l(s.y)*r[1],e.zaxis.r2l(s.z)*r[2]]),n(t.graphDiv,s,l,t.id,s._xa,s._ya))}}},{"../../plots/gl3d/project":232,"../annotations/draw":33}],40:[function(t,e,r){"use strict";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)return;for(var i=r.attrRegex,o=Object.keys(t),l=0;l<o.length;l++){var s=o[l];i.test(s)&&(t[s].annotations||[]).length&&(a.pushUnique(e._basePlotModules,r),a.pushUnique(e._subplots.gl3d,s))}},convert:t("./convert"),draw:t("./draw")}},{"../../lib":159,"../../registry":243,"./attributes":36,"./convert":37,"./defaults":38,"./draw":39}],41:[function(t,e,r){"use strict";r.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],r.defaultLine="#444",r.lightLine="#eee",r.background="#fff",r.borderLine="#BEC8D9",r.lightFraction=1e3/11},{}],42:[function(t,e,r){"use strict";var n=t("tinycolor2"),a=t("fast-isnumeric"),i=e.exports={},o=t("./attributes");i.defaults=o.defaults;var l=i.defaultLine=o.defaultLine;i.lightLine=o.lightLine;var s=i.background=o.background;function c(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 l=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+l+", "+n[3]+")":"rgb("+l+")"}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||s).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,s))),(a.isDark()?e?a.lighten(e):s:r?a.darken(r):l).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]=c(a[r]);else t[n]=c(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]=c(a[r][1]));else if(Array.isArray(a)){var l=a[0];if(!Array.isArray(l)&&l&&"object"==typeof l)for(r=0;r<a.length;r++)i.clean(a[r])}else a&&"object"==typeof a&&i.clean(a)}}},{"./attributes":41,"fast-isnumeric":9,tinycolor2:25}],43:[function(t,e,r){"use strict";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":154,"../../plot_api/edit_types":186,"../../plots/cartesian/layout_attributes":215,"../../plots/font_attributes":229}],44:[function(t,e,r){"use strict";e.exports={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}}},{}],45:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plot_api/plot_template"),i=t("../../plots/cartesian/tick_value_defaults"),o=t("../../plots/cartesian/tick_mark_defaults"),l=t("../../plots/cartesian/tick_label_defaults"),s=t("./attributes");e.exports=function(t,e,r){var c=a.newContainer(e,"colorbar"),u=t.colorbar||{};function f(t,e){return n.coerce(u,c,s,t,e)}var d=f("thicknessmode");f("thickness","fraction"===d?30/(r.width-r.margin.l-r.margin.r):30);var p=f("lenmode");f("len","fraction"===p?1:r.height-r.margin.t-r.margin.b),f("x"),f("xanchor"),f("xpad"),f("y"),f("yanchor"),f("ypad"),n.noneOrAll(u,c,["x","y"]),f("outlinecolor"),f("outlinewidth"),f("bordercolor"),f("borderwidth"),f("bgcolor"),i(u,c,f,"linear");var h={outerTicks:!1,font:r.font};l(u,c,f,"linear",h),o(u,c,f,"linear",h),f("title.text",r._dfltTitle.colorbar),n.coerceFont(f,"title.font",r.font),f("title.side")}},{"../../lib":159,"../../plot_api/plot_template":193,"../../plots/cartesian/tick_label_defaults":222,"../../plots/cartesian/tick_mark_defaults":223,"../../plots/cartesian/tick_value_defaults":224,"./attributes":43}],46:[function(t,e,r){"use strict";var n=t("d3"),a=t("tinycolor2"),i=t("../../plots/plots"),o=t("../../registry"),l=t("../../plots/cartesian/axes"),s=t("../dragelement"),c=t("../../lib"),u=t("../../lib/extend").extendFlat,f=t("../../lib/setcursor"),d=t("../drawing"),p=t("../color"),h=t("../titles"),g=t("../../lib/svg_text_utils"),v=t("../colorscale/helpers").flipScale,m=t("../../plots/cartesian/axis_defaults"),y=t("../../plots/cartesian/position_defaults"),x=t("../../plots/cartesian/layout_attributes"),b=t("../../constants/alignment"),_=b.LINE_SPACING,w=b.FROM_TL,k=b.FROM_BR,T=t("./constants").cn;e.exports={draw:function(t){var e=t._fullLayout._infolayer.selectAll("g."+T.colorbar).data(function(t){var e,r,n,a,i=t._fullLayout,o=t.calcdata,l=[];function s(t){return u(t,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function c(){"function"==typeof a.calc?a.calc(t,n,e):(e._fillgradient=r.reversescale?v(r.colorscale):r.colorscale,e._zrange=[r[a.min],r[a.max]])}for(var f=0;f<o.length;f++){var d=o[f],p=(n=d[0].trace)._module.colorbar;if(!0===n.visible&&p)for(var h=Array.isArray(p),g=h?p:[p],m=0;m<g.length;m++){var y=(a=g[m]).container;(r=y?n[y]:n)&&r.showscale&&((e=s(r.colorbar))._id="cb"+n.uid+(h&&y?"-"+y:""),e._traceIndex=n.index,e._propPrefix=(y?y+".":"")+"colorbar.",e._meta=n._meta,c(),l.push(e))}}for(var x in i._colorAxes)if((r=i[x]).showscale){var b=i._colorAxes[x];(e=s(r.colorbar))._id="cb"+x,e._propPrefix=x+".colorbar.",e._meta=i._meta,a={min:"cmin",max:"cmax"},"heatmap"!==b[0]&&(n=b[1],a.calc=n._module.colorbar.calc),c(),l.push(e)}return l}(t),function(t){return t._id});e.enter().append("g").attr("class",function(t){return t._id}).classed(T.colorbar,!0),e.each(function(e){var r=n.select(this);c.ensureSingle(r,"rect",T.cbbg),c.ensureSingle(r,"g",T.cbfills),c.ensureSingle(r,"g",T.cblines),c.ensureSingle(r,"g",T.cbaxis,function(t){t.classed(T.crisp,!0)}),c.ensureSingle(r,"g",T.cbtitleunshift,function(t){t.append("g").classed(T.cbtitle,!0)}),c.ensureSingle(r,"rect",T.cboutline);var v=function(t,e,r){var o=r._fullLayout,s=o._size,f=e._fillcolor,v=e._line,b=e.title,M=b.side,A=e._zrange||n.extent(("function"==typeof f?f:v.color).domain()),L="function"==typeof v.color?v.color:function(){return v.color},S="function"==typeof f?f:function(){return f},C=e._levels,O=function(t,e,r){var n,a,i=e._levels,o=[],l=[],s=i.end+i.size/100,c=i.size,u=1.001*r[0]-.001*r[1],f=1.001*r[1]-.001*r[0];for(a=0;a<1e5&&(n=i.start+a*c,!(c>0?n>=s:n<=s));a++)n>u&&n<f&&o.push(n);if(e._fillgradient)l=[0];else if("function"==typeof e._fillcolor){var d=e._filllevels;if(d)for(s=d.end+d.size/100,c=d.size,a=0;a<1e5&&(n=d.start+a*c,!(c>0?n>=s:n<=s));a++)n>r[0]&&n<r[1]&&l.push(n);else(l=o.map(function(t){return t-i.size/2})).push(l[l.length-1]+i.size)}else e._fillcolor&&"string"==typeof e._fillcolor&&(l=[0]);return i.size<0&&(o.reverse(),l.reverse()),{line:o,fill:l}}(0,e,A),P=O.fill,D=O.line,z=Math.round(e.thickness*("fraction"===e.thicknessmode?s.w:1)),R=z/s.w,E=Math.round(e.len*("fraction"===e.lenmode?s.h:1)),I=E/s.h,F=e.xpad/s.w,N=(e.borderwidth+e.outlinewidth)/2,j=e.ypad/s.h,B=Math.round(e.x*s.w+e.xpad),H=e.x-R*({middle:.5,right:1}[e.xanchor]||0),V=e.y+I*(({top:-.5,bottom:.5}[e.yanchor]||0)-.5),q=Math.round(s.h*(1-V)),U=q-E;e._lenFrac=I,e._thickFrac=R,e._xLeftFrac=H,e._yBottomFrac=V;var G=e._axis=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 l(t,e){return c.coerce(a,i,x,t,e)}return m(a,i,l,o,n),y(a,i,l,o),i}(r,e,A);if(G.position=e.x+F+R,-1!==["top","bottom"].indexOf(M)&&(G.title.side=M,G.titlex=e.x+F,G.titley=V+("top"===b.side?I-j:j)),v.color&&"auto"===e.tickmode){G.tickmode="linear",G.tick0=C.start;var Z=C.size,X=c.constrain((q-U)/50,4,15)+1,Y=(A[1]-A[0])/((e.nticks||X)*Z);if(Y>1){var W=Math.pow(10,Math.floor(Math.log(Y)/Math.LN10));Z*=W*c.roundUp(Y/W,[2,5,10]),(Math.abs(C.start)/C.size+1e-6)%1<2e-6&&(G.tick0=0)}G.dtick=Z}G.domain=[V+j,V+I-j],G.setScale(),t.attr("transform","translate("+Math.round(s.l)+","+Math.round(s.t)+")");var $,Q=t.select("."+T.cbtitleunshift).attr("transform","translate(-"+Math.round(s.l)+",-"+Math.round(s.t)+")"),J=t.select("."+T.cbaxis),K=0;function tt(n,a){var i={propContainer:G,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:o._dfltTitle.colorbar,containerGroup:t.select("."+T.cbtitle)},l="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+l+",."+l+"-math-group").remove(),h.draw(r,n,u(i,a||{}))}return c.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(M)){var t,r=s.l+(e.x+F)*s.w,n=G.title.font.size;t="top"===M?(1-(V+I-j))*s.h+s.t+3+.75*n:(1-(V+j))*s.h+s.t-3-.25*n,tt(G._id+"title",{attributes:{x:r,y:t,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(M)){var i=t.select("."+T.cbtitle),o=i.select("text"),u=[-e.outlinewidth/2,e.outlinewidth/2],f=i.select(".h"+G._id+"title-math-group").node(),p=15.6;if(o.node()&&(p=parseInt(o.node().style.fontSize,10)*_),f?(K=d.bBox(f).height)>p&&(u[1]-=(K-p)/2):o.node()&&!o.classed(T.jsPlaceholder)&&(K=d.bBox(o.node()).height),K){if(K+=5,"top"===M)G.domain[1]-=K/s.h,u[1]*=-1;else{G.domain[0]+=K/s.h;var h=g.lineCount(o);u[1]+=(1-h)*p}i.attr("transform","translate("+u+")"),G.setScale()}}t.selectAll("."+T.cbfills+",."+T.cblines).attr("transform","translate(0,"+Math.round(s.h*(1-G.domain[1]))+")"),J.attr("transform","translate(0,"+Math.round(-s.t)+")");var m=t.select("."+T.cbfills).selectAll("rect."+T.cbfill).data(P);m.enter().append("rect").classed(T.cbfill,!0).style("stroke","none"),m.exit().remove();var y=A.map(G.c2p).map(Math.round).sort(function(t,e){return t-e});m.each(function(t,i){var o=[0===i?A[0]:(P[i]+P[i-1])/2,i===P.length-1?A[1]:(P[i]+P[i+1])/2].map(G.c2p).map(Math.round);o[1]=c.constrain(o[1]+(o[1]>o[0])?1:-1,y[0],y[1]);var l=n.select(this).attr({x:B,width:Math.max(z,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(e._fillgradient)d.gradient(l,r,e._id,"vertical",e._fillgradient,"fill");else{var s=S(t).replace("e-","");l.attr("fill",a(s).toHexString())}});var x=t.select("."+T.cblines).selectAll("path."+T.cbline).data(v.color&&v.width?D:[]);x.enter().append("path").classed(T.cbline,!0),x.exit().remove(),x.each(function(t){n.select(this).attr("d","M"+B+","+(Math.round(G.c2p(t))+v.width/2%1)+"h"+z).call(d.lineGroupStyle,v.width,L(t),v.dash)}),J.selectAll("g."+G._id+"tick,path").remove();var b=B+z+(e.outlinewidth||0)/2-("outside"===e.ticks?1:0),w=l.calcTicks(G),k=l.makeTransFn(G),C=l.getTickSigns(G)[2];return l.drawTicks(r,G,{vals:"inside"===G.ticks?l.clipEnds(G,w):w,layer:J,path:l.makeTickPath(G,b,C),transFn:k}),l.drawLabels(r,G,{vals:w,layer:J,transFn:k,labelFns:l.makeLabelFns(G,b)})},function(){if(-1===["top","bottom"].indexOf(M)){var t=G.title.font.size,e=G._offset+G._length/2,a=s.l+(G.position||0)*s.w+("right"===G.side?10+t*(G.showticklabels?1:.5):-10-t*(G.showticklabels?.5:0));tt("h"+G._id+"title",{avoid:{selection:n.select(r).selectAll("g."+G._id+"tick"),side:M,offsetLeft:s.l,offsetTop:0,maxShift:o.width},attributes:{x:a,y:e,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},i.previousPromises,function(){var n=z+e.outlinewidth/2+d.bBox(J.node()).width;if(($=Q.select("text")).node()&&!$.classed(T.jsPlaceholder)){var a,o=Q.select(".h"+G._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(M)?d.bBox(o).width:d.bBox(Q.node()).right-B-s.l,n=Math.max(n,a)}var l=2*e.xpad+n+e.borderwidth+e.outlinewidth/2,c=q-U;t.select("."+T.cbbg).attr({x:B-e.xpad-(e.borderwidth+e.outlinewidth)/2,y:U-N,width:Math.max(l,2),height:Math.max(c+2*N,2)}).call(p.fill,e.bgcolor).call(p.stroke,e.bordercolor).style("stroke-width",e.borderwidth),t.selectAll("."+T.cboutline).attr({x:B,y:U+e.ypad+("top"===M?K:0),width:Math.max(z,2),height:Math.max(c-2*e.ypad-K,2)}).call(p.stroke,e.outlinecolor).style({fill:"none","stroke-width":e.outlinewidth});var u=({center:.5,right:1}[e.xanchor]||0)*l;t.attr("transform","translate("+(s.l-u)+","+s.t+")");var f={},h=w[e.yanchor],g=k[e.yanchor];"pixels"===e.lenmode?(f.y=e.y,f.t=c*h,f.b=c*g):(f.t=f.b=0,f.yt=e.y+e.len*h,f.yb=e.y-e.len*g);var v=w[e.xanchor],m=k[e.xanchor];if("pixels"===e.thicknessmode)f.x=e.x,f.l=l*v,f.r=l*m;else{var y=l-z;f.l=y*v,f.r=y*m,f.xl=e.x-e.thickness*v,f.xr=e.x+e.thickness*m}i.autoMargin(r,e._id,f)}],r)}(r,e,t);v&&v.then&&(t._promises||[]).push(v),t._context.edits.colorbarPosition&&function(t,e,r){var n,a,i,l=r._fullLayout._size;s.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),f(t)},moveFn:function(r,o){t.attr("transform",n+" translate("+r+","+o+")"),a=s.align(e._xLeftFrac+r/l.w,e._thickFrac,0,1,e.xanchor),i=s.align(e._yBottomFrac-o/l.h,e._lenFrac,0,1,e.yanchor);var c=s.getCursor(a,i,e.xanchor,e.yanchor);f(t,c)},doneFn:function(){if(f(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":136,"../../lib":159,"../../lib/extend":154,"../../lib/setcursor":178,"../../lib/svg_text_utils":180,"../../plots/cartesian/axes":203,"../../plots/cartesian/axis_defaults":205,"../../plots/cartesian/layout_attributes":215,"../../plots/cartesian/position_defaults":218,"../../plots/plots":235,"../../registry":243,"../color":42,"../colorscale/helpers":53,"../dragelement":60,"../drawing":63,"../titles":129,"./constants":44,d3:7,tinycolor2:25}],47:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":159}],48:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"colorbar",attributes:t("./attributes"),supplyDefaults:t("./defaults"),draw:t("./draw").draw,hasColorbar:t("./has_colorbar")}},{"./attributes":43,"./defaults":45,"./draw":46,"./has_colorbar":47}],49:[function(t,e,r){"use strict";var n=t("../colorbar/attributes"),a=t("../../lib/regex").counter,i=t("./scales.js").scales;Object.keys(i);function o(t){return"`"+t+"`"}e.exports=function(t,e){t=t||"";var r,l=(e=e||{}).cLetter||"c",s=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),c="showScaleDflt"in e?e.showScaleDflt:"z"===l,u="string"==typeof e.colorscaleDflt?i[e.colorscaleDflt]:null,f=e.editTypeOverride||"",d=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.colorAttr):o(d+(r={z:"z",c:"color"}[l]));var p=l+"auto",h=l+"min",g=l+"max",v=l+"mid",m=(o(d+p),o(d+h),o(d+g),{});m[h]=m[g]=void 0;var y={};y[p]=!1;var x={};return"color"===r&&(x.color={valType:"color",arrayOk:!0,editType:f||"style"},e.anim&&(x.color.anim=!0)),x[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:m},x[h]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[g]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[v]={valType:"number",dflt:null,editType:"calc",impliedEdits:m},x.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},x.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},x.reversescale={valType:"boolean",dflt:!1,editType:"plot"},s||(x.showscale={valType:"boolean",dflt:c,editType:"calc"},x.colorbar=n),e.noColorAxis||(x.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),x}},{"../../lib/regex":174,"../colorbar/attributes":43,"./scales.js":57}],50:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("./helpers").extractOpts;e.exports=function(t,e,r){var o,l=t._fullLayout,s=r.vals,c=r.containerStr,u=c?a.nestedProperty(e,c).get():e,f=i(u),d=!1!==f.auto,p=f.min,h=f.max,g=f.mid,v=function(){return a.aggNums(Math.min,null,s)},m=function(){return a.aggNums(Math.max,null,s)};(void 0===p?p=v():d&&(p=u._colorAx&&n(p)?Math.min(p,v()):v()),void 0===h?h=m():d&&(h=u._colorAx&&n(h)?Math.max(h,m()):m()),d&&void 0!==g&&(h-g>g-p?p=g-(h-g):h-g<g-p&&(h=g+(g-p))),p===h&&(p-=.5,h+=.5),f._sync("min",p),f._sync("max",h),f.autocolorscale)&&(o=p*h<0?l.colorscale.diverging:p>=0?l.colorscale.sequential:l.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":159,"./helpers":53,"fast-isnumeric":9}],51:[function(t,e,r){"use strict";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 l=i(o),s=l.auto;(s||void 0===l.min)&&r(o,a.min),(s||void 0===l.max)&&r(o,a.max),l.autocolorscale&&r(o,"colorscale")}}for(var l=0;l<t.length;l++){var s=t[l],c=s._module.colorbar;if(c)if(Array.isArray(c))for(var u=0;u<c.length;u++)o(s,c[u]);else o(s,c);a(s,"marker.line")&&o(s,{container:"marker.line",min:"cmin",max:"cmax"})}for(var f in e._colorAxes)o(e[f],{min:"cmin",max:"cmax"})}},{"../../lib":159,"./helpers":53}],52:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../colorbar/has_colorbar"),o=t("../colorbar/defaults"),l=t("./scales").isValid,s=t("../../registry").traceIs;function c(t,e){var r=e.slice(0,e.length-1);return e?a.nestedProperty(t,r).get()||{}:t}e.exports=function t(e,r,u,f,d){var p=d.prefix,h=d.cLetter,g="_module"in r,v=c(e,p),m=c(r,p),y=c(r._template||{},p)||{},x=function(){return delete e.coloraxis,delete r.coloraxis,t(e,r,u,f,d)};if(g){var b=u._colorAxes||{},_=f(p+"coloraxis");if(_){var w=s(r,"contour")&&a.nestedProperty(r,"contours.coloring").get()||"heatmap",k=b[_];return void(k?(k[2].push(x),k[0]!==w&&(k[0]=!1,a.warn(["Ignoring coloraxis:",_,"setting","as it is linked to incompatible colorscales."].join(" ")))):b[_]=[w,r,[x]])}}var T=v[h+"min"],M=v[h+"max"],A=n(T)&&n(M)&&T<M;f(p+h+"auto",!A)?f(p+h+"mid"):(f(p+h+"min"),f(p+h+"max"));var L,S,C=v.colorscale,O=y.colorscale;(void 0!==C&&(L=!l(C)),void 0!==O&&(L=!l(O)),f(p+"autocolorscale",L),f(p+"colorscale"),f(p+"reversescale"),"marker.line."!==p)&&(p&&g&&(S=i(v)),f(p+"showscale",S)&&(p&&y&&(m._template=y),o(v,m,u)))}},{"../../lib":159,"../../registry":243,"../colorbar/defaults":45,"../colorbar/has_colorbar":47,"./scales":57,"fast-isnumeric":9}],53:[function(t,e,r){"use strict";var n=t("d3"),a=t("tinycolor2"),i=t("fast-isnumeric"),o=t("../../lib"),l=t("../color"),s=t("./scales").isValid;var c=["showscale","autocolorscale","colorscale","reversescale","colorbar"],u=["min","max","mid","auto"];function f(t){var e,r,n,a=t._colorAx,i=a||t,o={};for(r=0;r<c.length;r++)o[n=c[r]]=i[n];if(a)for(e="c",r=0;r<u.length;r++)o[n=u[r]]=i["c"+n];else{var l;for(r=0;r<u.length;r++)(l="c"+(n=u[r]))in i?o[n]=i[l]:(l="z"+n)in i&&(o[n]=i[l]);e=l.charAt(0)}return o._sync=function(t,r){var n=-1!==u.indexOf(t)?e+t:t;i[n]=i["_"+n]=r},o}function d(t){for(var e=f(t),r=e.min,n=e.max,a=e.reversescale?p(e.colorscale):e.colorscale,i=a.length,o=new Array(i),l=new Array(i),s=0;s<i;s++){var c=a[s];o[s]=r+c[0]*(n-r),l[s]=c[1]}return{domain:o,range:l}}function p(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 h(t,e){e=e||{};for(var r=t.domain,o=t.range,s=o.length,c=new Array(s),u=0;u<s;u++){var f=a(o[u]).toRgb();c[u]=[f.r,f.g,f.b,f.a]}var d,p=n.scale.linear().domain(r).range(c).clamp(!0),h=e.noNumericCheck,v=e.returnArray;return(d=h&&v?p:h?function(t){return g(p(t))}:v?function(t){return i(t)?p(t):a(t).isValid()?t:l.defaultLine}:function(t){return i(t)?g(p(t)):a(t).isValid()?t:l.defaultLine}).domain=p.domain,d.range=function(){return o},d}function g(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,r){var n=e?o.nestedProperty(t,e).get()||{}:t,a=n[r||"color"],l=!1;if(o.isArrayOrTypedArray(a))for(var c=0;c<a.length;c++)if(i(a[c])){l=!0;break}return o.isPlainObject(n)&&(l||!0===n.showscale||i(n.cmin)&&i(n.cmax)||s(n.colorscale)||o.isPlainObject(n.colorbar))},extractOpts:f,extractScale:d,flipScale:p,makeColorScaleFunc:h,makeColorScaleFuncFromTrace:function(t,e){return h(d(t),e)}}},{"../../lib":159,"../color":42,"./scales":57,d3:7,"fast-isnumeric":9,tinycolor2:25}],54:[function(t,e,r){"use strict";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":49,"./calc":50,"./cross_trace_defaults":51,"./defaults":52,"./helpers":53,"./layout_attributes":55,"./layout_defaults":56,"./scales":57}],55:[function(t,e,r){"use strict";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":154,"./attributes":49,"./scales":57}],56:[function(t,e,r){"use strict";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 l,s,c=e._colorAxes;function u(t,e){return n.coerce(l,s,i.coloraxis,t,e)}for(var f in c){var d=c[f];if(d[0])l=t[f]||{},(s=a.newContainer(e,f,"coloraxis"))._name=f,o(l,s,e,u,{prefix:"",cLetter:"c"});else{for(var p=0;p<d[2].length;p++)d[2][p]();delete e._colorAxes[f]}}}},{"../../lib":159,"../../plot_api/plot_template":193,"./defaults":52,"./layout_attributes":55}],57:[function(t,e,r){"use strict";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:25}],58:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,a){var i=(t-r)/(n-r),o=i+e/(n-r),l=(i+o)/2;return"left"===a||"bottom"===a?i:"center"===a||"middle"===a?l:"right"===a||"top"===a?o:i<2/3-l?i:o>4/3-l?o:l}},{}],59:[function(t,e,r){"use strict";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":159}],60:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),a=t("has-hover"),i=t("has-passive-events"),o=t("../../lib").removeElement,l=t("../../plots/cartesian/constants"),s=e.exports={};s.align=t("./align"),s.getCursor=t("./cursor");var c=t("./unhover");function u(){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 f(t){return n(t.changedTouches?t.changedTouches[0]:t,document.body)}s.unhover=c.wrapped,s.unhoverRaw=c.raw,s.init=function(t){var e,r,n,c,d,p,h,g,v=t.gd,m=1,y=v._context.doubleClickDelay,x=t.element;v._mouseDownTime||(v._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=_,i?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=_,x.addEventListener("touchstart",_,{passive:!1})):x.ontouchstart=_;var b=t.clampFn||function(t,e,r){return Math.abs(t)<r&&(t=0),Math.abs(e)<r&&(e=0),[t,e]};function _(i){v._dragged=!1,v._dragging=!0;var o=f(i);e=o[0],r=o[1],h=i.target,p=i,g=2===i.buttons||i.ctrlKey,"undefined"==typeof i.clientX&&"undefined"==typeof i.clientY&&(i.clientX=e,i.clientY=r),(n=(new Date).getTime())-v._mouseDownTime<y?m+=1:(m=1,v._mouseDownTime=n),t.prepFn&&t.prepFn(i,e,r),a&&!g?(d=u()).style.cursor=window.getComputedStyle(x).cursor:a||(d=document,c=window.getComputedStyle(document.documentElement).cursor,document.documentElement.style.cursor=window.getComputedStyle(x).cursor),document.addEventListener("mouseup",k),document.addEventListener("touchend",k),!1!==t.dragmode&&(i.preventDefault(),document.addEventListener("mousemove",w),document.addEventListener("touchmove",w,{passive:!1}))}function w(n){n.preventDefault();var a=f(n),i=t.minDrag||l.MINDRAG,o=b(a[0]-e,a[1]-r,i),c=o[0],u=o[1];(c||u)&&(v._dragged=!0,s.unhover(v)),v._dragged&&t.moveFn&&!g&&(v._dragdata={element:x,dx:c,dy:u},t.moveFn(c,u))}function k(e){if(delete v._dragdata,!1!==t.dragmode&&(e.preventDefault(),document.removeEventListener("mousemove",w),document.removeEventListener("touchmove",w)),document.removeEventListener("mouseup",k),document.removeEventListener("touchend",k),a?o(d):c&&(d.documentElement.style.cursor=c,c=null),v._dragging){if(v._dragging=!1,(new Date).getTime()-v._mouseDownTime>y&&(m=Math.max(m-1,1)),v._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(m,p),!g){var r;try{r=new MouseEvent("click",e)}catch(t){var n=f(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)}h.dispatchEvent(r)}v._dragging=!1,v._dragged=!1}else v._dragged=!1}},s.coverSlip=u},{"../../lib":159,"../../plots/cartesian/constants":209,"./align":58,"./cursor":59,"./unhover":61,"has-hover":11,"has-passive-events":12,"mouse-event-offset":15}],61:[function(t,e,r){"use strict";var n=t("../../lib/events"),a=t("../../lib/throttle"),i=t("../../lib/dom").getGraphDiv,o=t("../fx/constants"),l=e.exports={};l.wrapped=function(t,e,r){(t=i(t))._fullLayout&&a.clear(t._fullLayout._uid+o.HOVERID),l.raw(t,e,r)},l.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":152,"../../lib/events":153,"../../lib/throttle":181,"../fx/constants":75}],62:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],63:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("tinycolor2"),o=t("../../registry"),l=t("../color"),s=t("../colorscale"),c=t("../../lib"),u=t("../../lib/svg_text_utils"),f=t("../../constants/xmlns_namespaces"),d=t("../../constants/alignment").LINE_SPACING,p=t("../../constants/interactions").DESELECTDIM,h=t("../../traces/scatter/subtypes"),g=t("../../traces/scatter/make_bubble_size_func"),v=t("../../components/fx/helpers").appendArrayPointValue,m=e.exports={};m.font=function(t,e,r,n){c.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(l.fill,n)},m.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},m.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},m.setRect=function(t,e,r,n,a){t.call(m.setPosition,e,r).call(m.setSize,n,a)},m.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)},m.translatePoints=function(t,e,r){t.each(function(t){var a=n.select(this);m.translatePoint(t,a,e,r)})},m.hideOutsideRangePoint=function(t,e,r,n,a,i){e.attr("display",r.isPtWithinRange(t,a)&&n.isPtWithinRange(t,i)?null:"none")},m.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,a=e.yaxis;t.each(function(e){var i=e[0].trace,l=i.xcalendar,s=i.ycalendar,c=o.traceIs(i,"bar-like")?".bartext":".point,.textpoint";t.selectAll(c).each(function(t){m.hideOutsideRangePoint(t,n.select(this),r,a,l,s)})})}},m.crispRound=function(t,e,r){return e&&a(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},m.singleLineStyle=function(t,e,r,n,a){e.style("fill","none");var i=(((t||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,s=a||i.dash||"";l.stroke(e,n||i.color),m.dashLine(e,s,o)},m.lineGroupStyle=function(t,e,r,a){t.style("fill","none").each(function(t){var i=(((t||[])[0]||{}).trace||{}).line||{},o=e||i.width||0,s=a||i.dash||"";n.select(this).call(l.stroke,r||i.color).call(m.dashLine,s,o)})},m.dashLine=function(t,e,r){r=+r||0,e=m.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},m.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},m.singleFillStyle=function(t){var e=(((n.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(l.fill,e)},m.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(t){var e=n.select(this);t[0].trace&&e.call(l.fill,t[0].trace.fillcolor)})};var y=t("./symbol_defs");m.symbolNames=[],m.symbolFuncs=[],m.symbolNeedLines={},m.symbolNoDot={},m.symbolNoFill={},m.symbolList=[],Object.keys(y).forEach(function(t){var e=y[t],r=e.n;m.symbolList.push(r,t,r+100,t+"-open"),m.symbolNames[r]=t,m.symbolFuncs[r]=e.f,e.needLine&&(m.symbolNeedLines[r]=!0),e.noDot?m.symbolNoDot[r]=!0:m.symbolList.push(r+200,t+"-dot",r+300,t+"-open-dot"),e.noFill&&(m.symbolNoFill[r]=!0)});var x=m.symbolNames.length,b="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";function _(t,e){var r=t%100;return m.symbolFuncs[r](e)+(t>=200?b:"")}m.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=m.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=x||t>=400?0:Math.floor(Math.max(t,0))};var w={x1:1,x2:0,y1:0,y2:0},k={x1:0,x2:0,y1:1,y2:0},T=n.format("~.1f"),M={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:w},horizontalreversed:{node:"linearGradient",attrs:w,reversed:!0},vertical:{node:"linearGradient",attrs:k},verticalreversed:{node:"linearGradient",attrs:k,reversed:!0}};m.gradient=function(t,e,r,a,o,s){for(var u=o.length,f=M[a],d=new Array(u),p=0;p<u;p++)f.reversed?d[u-1-p]=[T(100*(1-o[p][0])),o[p][1]]:d[p]=[T(100*o[p][0]),o[p][1]];var h=e._fullLayout,g="g"+h._uid+"-"+r,v=h._defs.select(".gradients").selectAll("#"+g).data([a+d.join(";")],c.identity);v.exit().remove(),v.enter().append(f.node).each(function(){var t=n.select(this);f.attrs&&t.attr(f.attrs),t.attr("id",g);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":l.tinyRGB(e),"stop-opacity":e.getAlpha()})})}),t.style(s,E(g,e)).style(s+"-opacity",null);var m=function(t){return"."+t.attr("class").replace(/\s/g,".")},y=m(n.select(t.node().parentNode))+">"+m(t);h._gradientUrlQueryParts[y]=1},m.initGradients=function(t){var e=t._fullLayout;c.ensureSingle(e._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),e._gradientUrlQueryParts={}},m.pointStyle=function(t,e,r){if(t.size()){var a=m.makePointStyleFns(e);t.each(function(t){m.singlePointStyle(t,n.select(this),e,a,r)})}},m.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 s;s="various"===t.ms||"various"===i.size?3:n.ms2mrc(t.ms),t.mrc=s,n.selectedSizeFn&&(s=t.mrc=n.selectedSizeFn(t));var u=m.symbolNumber(t.mx||i.symbol)||0;t.om=u%200>=100,e.attr("d",_(u,s))}var f,d,p,h=!1;if(t.so)p=o.outlierwidth,d=o.outliercolor,f=i.outliercolor;else{var g=(o||{}).width;p=(t.mlw+1||g+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,d="mlc"in t?t.mlcc=n.lineScale(t.mlc):c.isArrayOrTypedArray(o.color)?l.defaultLine:o.color,c.isArrayOrTypedArray(i.color)&&(f=l.defaultLine,h=!0),f="mc"in t?t.mcc=n.markerScale(t.mc):i.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(t))}if(t.om)e.call(l.stroke,f).style({"stroke-width":(p||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:p)+"px");var v=i.gradient,y=t.mgt;if(y?h=!0:y=v&&v.type,Array.isArray(y)&&(y=y[0],M[y]||(y=0)),y&&"none"!==y){var x=t.mgc;x?h=!0:x=v.color;var b=r.uid;h&&(b+="-"+t.i),m.gradient(e,a,b,y,[[0,x],[1,f]],"fill")}else l.fill(e,f);p&&l.stroke(e,d)}},m.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=m.tryColorscale(r,""),e.lineScale=m.tryColorscale(r,"line"),o.traceIs(t,"symbols")&&(e.ms2mrc=h.isBubble(t)?g(t):function(){return(r.size||6)/2}),t.selectedpoints&&c.extendFlat(e,m.makeSelectedPointStyleFns(t)),e},m.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.marker||{},i=r.marker||{},l=n.marker||{},s=a.opacity,u=i.opacity,f=l.opacity,d=void 0!==u,h=void 0!==f;(c.isArrayOrTypedArray(s)||d||h)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?a.opacity:t.mo;return t.selected?d?u:e:h?f:p*e});var g=a.color,v=i.color,m=l.color;(v||m)&&(e.selectedColorFn=function(t){var e=t.mcc||g;return t.selected?v||e:m||e});var y=a.size,x=i.size,b=l.size,_=void 0!==x,w=void 0!==b;return o.traceIs(t,"symbols")&&(_||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||y/2;return t.selected?_?x/2:e:w?b/2:e}),e},m.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.textfont||{},i=r.textfont||{},o=n.textfont||{},s=a.color,c=i.color,u=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||s;return t.selected?c||e:u||(c?e:l.addOpacity(e,p))},e},m.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=m.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){l.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",_(m.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)})}},m.tryColorscale=function(t,e){var r=e?c.nestedProperty(t,e).get():t;if(r){var n=r.color;if((r.colorscale||r._colorAx)&&c.isArrayOrTypedArray(n))return s.makeColorScaleFuncFromTrace(r)}return c.identity};var A={start:1,end:-1,middle:0,bottom:1,top:-1};function L(t,e,r,a){var i=n.select(t.node().parentNode),o=-1!==e.indexOf("top")?"top":-1!==e.indexOf("bottom")?"bottom":"middle",l=-1!==e.indexOf("left")?"end":-1!==e.indexOf("right")?"start":"middle",s=a?a/.8+1:0,c=(u.lineCount(t)-1)*d+1,f=A[l]*s,p=.75*r+A[o]*s+(A[o]-1)*c*r/2;t.attr("text-anchor",l),i.attr("transform","translate("+f+","+p+")")}function S(t,e){var r=t.ts||e.textfont.size;return a(r)&&r>0?r:0}m.textPointStyle=function(t,e,r){if(t.size()){var a;if(e.selectedpoints){var i=m.makeSelectedTextStyleFns(e);a=i.selectedTextColorFn}var o=e.texttemplate,l=r._fullLayout;t.each(function(t){var i=n.select(this),s=o?c.extractOption(t,e,"txt","texttemplate"):c.extractOption(t,e,"tx","text");if(s||0===s){if(o){var f=e._module.formatLabels?e._module.formatLabels(t,e,l):{},d={};v(d,e,t.i);var p=e._meta||{};s=c.texttemplateString(s,f,l._d3locale,d,t,p)}var h=t.tp||e.textposition,g=S(t,e),y=a?a(t):t.tc||e.textfont.color;i.call(m.font,t.tf||e.textfont.family,g,y).text(s).call(u.convertToTspans,r).call(L,h,g,t.mrc)}else i.remove()})}},m.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=m.makeSelectedTextStyleFns(e);t.each(function(t){var a=n.select(this),i=r.selectedTextColorFn(t),o=t.tp||e.textposition,s=S(t,e);l.fill(a,i),L(a,o,s,t.mrc2||t.mrc)})}};var C=.5;function O(t,e,r,a){var i=t[0]-e[0],o=t[1]-e[1],l=r[0]-e[0],s=r[1]-e[1],c=Math.pow(i*i+o*o,C/2),u=Math.pow(l*l+s*s,C/2),f=(u*u*i-c*c*l)*a,d=(u*u*o-c*c*s)*a,p=3*u*(c+u),h=3*c*(c+u);return[[n.round(e[0]+(p&&f/p),2),n.round(e[1]+(p&&d/p),2)],[n.round(e[0]-(h&&f/h),2),n.round(e[1]-(h&&d/h),2)]]}m.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(O(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]},m.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=[O(t[a],t[0],t[1],e)];for(r=1;r<a;r++)i.push(O(t[r-1],t[r],t[r+1],e));for(i.push(O(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 P={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)}},D=function(t,e){return"L"+n.round(e[0],2)+","+n.round(e[1],2)};m.steps=function(t){var e=P[t]||D;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}},m.makeTester=function(){var t=c.ensureSingleById(n.select("body"),"svg","js-plotly-tester",function(t){t.attr(f.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})}),e=c.ensureSingle(t,"path","js-reference-point",function(t){t.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})});m.tester=t,m.testref=e},m.savedBBoxes={};var z=0;function R(t){var e=t.getAttribute("data-unformatted");if(null!==e)return e+t.getAttribute("data-math")+t.getAttribute("text-anchor")+t.getAttribute("style")}function E(t,e){if(!t)return null;var r=e._context;return"url('"+(r._exportedPlot?"":r._baseUrl||"")+"#"+t+"')"}m.bBox=function(t,e,r){var a,i,o;if(r||(r=R(t)),r){if(a=m.savedBBoxes[r])return c.extendFlat({},a)}else if(1===t.childNodes.length){var l=t.childNodes[0];if(r=R(l)){var s=+l.getAttribute("x")||0,f=+l.getAttribute("y")||0,d=l.getAttribute("transform");if(!d){var p=m.bBox(l,!1,r);return s&&(p.left+=s,p.right+=s),f&&(p.top+=f,p.bottom+=f),p}if(r+="~"+s+"~"+f+"~"+d,a=m.savedBBoxes[r])return c.extendFlat({},a)}}e?i=t:(o=m.tester.node(),i=t.cloneNode(!0),o.appendChild(i)),n.select(i).attr("transform",null).call(u.positionText,0,0);var h=i.getBoundingClientRect(),g=m.testref.node().getBoundingClientRect();e||o.removeChild(i);var v={height:h.height,width:h.width,left:h.left-g.left,top:h.top-g.top,right:h.right-g.left,bottom:h.bottom-g.top};return z>=1e4&&(m.savedBBoxes={},z=0),r&&(m.savedBBoxes[r]=v),z++,c.extendFlat({},v)},m.setClipUrl=function(t,e,r){t.attr("clip-path",E(e,r))},m.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}},m.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},m.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}},m.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 I=/\s*sc.*/;m.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(I,"");t=(t+=n).trim(),this.setAttribute("transform",t)})}};var F=/translate\([^)]*\)\s*$/;m.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),l=parseFloat(i.attr("y")||0),s=(a.attr("transform")||"").match(F);t=1===e&&1===r?[]:["translate("+o+","+l+")","scale("+e+","+r+")","translate("+-o+","+-l+")"],s&&t.push(s),a.attr("transform",t.join(" "))}})}},{"../../components/fx/helpers":77,"../../constants/alignment":136,"../../constants/interactions":138,"../../constants/xmlns_namespaces":140,"../../lib":159,"../../lib/svg_text_utils":180,"../../registry":243,"../../traces/scatter/make_bubble_size_func":300,"../../traces/scatter/subtypes":307,"../color":42,"../colorscale":54,"./symbol_defs":64,d3:7,"fast-isnumeric":9,tinycolor2:25}],64:[function(t,e,r){"use strict";var n=t("d3");e.exports={circle:{n:0,f:function(t){var e=n.round(t,2);return"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"}},square:{n:1,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"}},diamond:{n:2,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"Z"}},cross:{n:3,f:function(t){var e=n.round(.4*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H"+e+"V"+r+"H-"+e+"V"+e+"H-"+r+"V-"+e+"H-"+e+"V-"+r+"H"+e+"V-"+e+"H"+r+"Z"}},x:{n:4,f:function(t){var e=n.round(.8*t/Math.sqrt(2),2),r="l"+e+","+e,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),l=n.round(-e,2),s=n.round(-.309*e,2),c=n.round(.118*e,2),u=n.round(.809*e,2);return"M"+r+","+s+"H"+a+"L"+i+","+c+"L"+o+","+u+"L0,"+n.round(.382*e,2)+"L-"+o+","+u+"L-"+i+","+c+"L-"+a+","+s+"H-"+r+"L0,"+l+"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:7}],65:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],66:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../registry"),i=t("../../plots/cartesian/axes"),o=t("../../lib"),l=t("./compute_error");function s(t,e,r,a){var s=e["error_"+a]||{},c=[];if(s.visible&&-1!==["linear","log"].indexOf(r.type)){for(var u=l(s),f=0;f<t.length;f++){var d=t[f],p=d.i;if(void 0===p)p=f;else if(null===p)continue;var h=d[a];if(n(r.c2l(h))){var g=u(h,p);if(n(g[0])&&n(g[1])){var v=d[a+"s"]=h-g[0],m=d[a+"h"]=h+g[1];c.push(v,m)}}}var y=r._id,x=e._extremes[y],b=i.findExtremes(r,c,o.extendFlat({tozero:x.opts.tozero},{padded:!0}));x.min=x.min.concat(b.min),x.max=x.max.concat(b.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 l=i.getFromId(t,o.xaxis),c=i.getFromId(t,o.yaxis);s(n,o,l,"x"),s(n,o,c,"y")}}}},{"../../lib":159,"../../plots/cartesian/axes":203,"../../registry":243,"./compute_error":67,"fast-isnumeric":9}],67:[function(t,e,r){"use strict";function n(t,e){return"percent"===t?function(t){return Math.abs(t*e/100)}:"constant"===t?function(){return Math.abs(e)}:"sqrt"===t?function(t){return Math.sqrt(Math.abs(t))}:void 0}e.exports=function(t){var e=t.type,r=t.symmetric;if("data"===e){var 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),l=n(e,t.valueminus);return r||void 0===t.valueminus?function(t){var e=o(t);return[e,e]}:function(t){return[l(t),o(t)]}}},{}],68:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../registry"),i=t("../../lib"),o=t("../../plot_api/plot_template"),l=t("./attributes");e.exports=function(t,e,r,s){var c="error_"+s.axis,u=o.newContainer(e,c),f=t[c]||{};function d(t,e){return i.coerce(f,u,l,t,e)}if(!1!==d("visible",void 0!==f.array||void 0!==f.value||"sqrt"===f.type)){var p=d("type","array"in f?"data":"percent"),h=!0;"sqrt"!==p&&(h=d("symmetric",!(("data"===p?"arrayminus":"valueminus")in f))),"data"===p?(d("array"),d("traceref"),h||(d("arrayminus"),d("tracerefminus"))):"percent"!==p&&"constant"!==p||(d("value"),h||d("valueminus"));var g="copy_"+s.inherit+"style";if(s.inherit)(e["error_"+s.inherit]||{}).visible&&d(g,!(f.color||n(f.thickness)||n(f.width)));s.inherit&&u[g]||(d("color",r),d("thickness"),d("width",a.traceIs(e,"gl3d")?0:4))}}},{"../../lib":159,"../../plot_api/plot_template":193,"../../registry":243,"./attributes":65,"fast-isnumeric":9}],69:[function(t,e,r){"use strict";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 l={error_x:n.extendFlat({},i),error_y:n.extendFlat({},i),error_z:n.extendFlat({},i)};delete l.error_x.copy_ystyle,delete l.error_y.copy_ystyle,delete l.error_z.copy_ystyle,delete l.error_z.copy_zstyle,e.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:o,bar:o,histogram:o,scatter3d:a(l,"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":159,"../../plot_api/edit_types":186,"./attributes":65,"./calc":66,"./compute_error":67,"./defaults":68,"./plot":70,"./style":71}],70:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../drawing"),o=t("../../traces/scatter/subtypes");e.exports=function(t,e,r,l){var s=r.xaxis,c=r.yaxis,u=l&&l.duration>0;e.each(function(e){var f,d=e[0].trace,p=d.error_x||{},h=d.error_y||{};d.ids&&(f=function(t){return t.id});var g=o.hasMarkers(d)&&d.marker.maxdisplayed>0;h.visible||p.visible||(e=[]);var v=n.select(this).selectAll("g.errorbar").data(e,f);if(v.exit().remove(),e.length){p.visible||v.selectAll("path.xerror").remove(),h.visible||v.selectAll("path.yerror").remove(),v.style("opacity",1);var m=v.enter().append("g").classed("errorbar",!0);u&&m.style("opacity",0).transition().duration(l.duration).style("opacity",1),i.setClipUrl(v,r.layerClipId,t),v.each(function(t){var e=n.select(this),r=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),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)));return n}(t,s,c);if(!g||t.vis){var i,o=e.select("path.yerror");if(h.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var f=h.width;i="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(i+="m-"+f+",0h"+2*f),!o.size()?o=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):u&&(o=o.transition().duration(l.duration).ease(l.easing)),o.attr("d",i)}else o.remove();var d=e.select("path.xerror");if(p.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var v=(p.copy_ystyle?h:p).width;i="M"+r.xh+","+(r.y-v)+"v"+2*v+"m0,-"+v+"H"+r.xs,r.noXS||(i+="m0,-"+v+"v"+2*v),!d.size()?d=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(d=d.transition().duration(l.duration).ease(l.easing)),d.attr("d",i)}else d.remove()}})}})}},{"../../traces/scatter/subtypes":307,"../drawing":63,d3:7,"fast-isnumeric":9}],71:[function(t,e,r){"use strict";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":42,d3:7}],72:[function(t,e,r){"use strict";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":154,"../../plots/font_attributes":229,"./layout_attributes":81}],73:[function(t,e,r){"use strict";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 l=0;l<e.length;l++){var s=e[l],c=s[0].trace;if(!a.traceIs(c,"pie-like")){var u=a.traceIs(c,"2dMap")?i:n.fillArray;u(c.hoverinfo,s,"hi",o(c)),c.hovertemplate&&u(c.hovertemplate,s,"ht"),c.hoverlabel&&(u(c.hoverlabel.bgcolor,s,"hbg"),u(c.hoverlabel.bordercolor,s,"hbc"),u(c.hoverlabel.font.size,s,"hts"),u(c.hoverlabel.font.color,s,"htc"),u(c.hoverlabel.font.family,s,"htf"),u(c.hoverlabel.namelength,s,"hnl"),u(c.hoverlabel.align,s,"hta"))}}}},{"../../lib":159,"../../registry":243}],74:[function(t,e,r){"use strict";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":243,"./hover":78}],75:[function(t,e,r){"use strict";e.exports={YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,HOVERID:"-hover"}},{}],76:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),i=t("./hoverlabel_defaults");e.exports=function(t,e,r,o){var l=n.extendFlat({},o.hoverlabel);e.hovertemplate&&(l.namelength=-1),i(t,e,function(r,i){return n.coerce(t,e,a,r,i)},l)}},{"../../lib":159,"./attributes":72,"./hoverlabel_defaults":79}],77:[function(t,e,r){"use strict";var n=t("../../lib");r.getSubplot=function(t){return t.subplot||t.xaxis+t.yaxis||t.geo},r.isTraceInSubplots=function(t,e){if("splom"===t.type){for(var n=t.xaxes||[],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 l=0;l<a.length;l++){var s=a[l],c=i(s);if(void 0===t[c]){var u=o(n.nestedProperty(e,s).get(),r);void 0!==u&&(t[c]=u)}}},r.appendArrayMultiPointValues=function(t,e,r){var a=e._arrayAttrs;if(a)for(var l=0;l<a.length;l++){var s=a[l],c=i(s);if(void 0===t[c]){for(var u=n.nestedProperty(e,s).get(),f=new Array(r.length),d=0;d<r.length;d++)f[d]=o(u,r[d]);t[c]=f}}};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":159}],78:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("tinycolor2"),o=t("../../lib"),l=t("../../lib/events"),s=t("../../lib/svg_text_utils"),c=t("../../lib/override_cursor"),u=t("../drawing"),f=t("../color"),d=t("../dragelement"),p=t("../../plots/cartesian/axes"),h=t("../../registry"),g=t("./helpers"),v=t("./constants"),m=v.YANGLE,y=Math.PI*m/180,x=1/Math.sin(y),b=Math.cos(y),_=Math.sin(y),w=v.HOVERARROWSIZE,k=v.HOVERTEXTPAD;r.hover=function(t,e,r,i){t=o.getGraphDiv(t),o.throttle(t._fullLayout._uid+v.HOVERID,v.HOVERMINTIME,function(){!function(t,e,r,i){r||(r="xy");var s=Array.isArray(r)?r:[r],u=t._fullLayout,p=u._plots||[],v=p[r],m=u._has("cartesian");if(v){var y=v.overlays.map(function(t){return t.id});s=s.concat(y)}for(var b=s.length,_=new Array(b),w=new Array(b),k=!1,T=0;T<b;T++){var O=s[T];if(p[O])k=!0,_[T]=p[O].xaxis,w[T]=p[O].yaxis;else{if(!u[O]||!u[O]._subplot)return void o.warn("Unrecognized subplot: "+O);var P=u[O]._subplot;_[T]=P.xaxis,w[T]=P.yaxis}}var D=e.hovermode||u.hovermode;D&&!k&&(D="closest");if(-1===["x","y","closest"].indexOf(D)||!t.calcdata||t.querySelector(".zoombox")||t._dragging)return d.unhoverRaw(t,e);var z,R,E,I,F,N,j,B,H,V,q,U,G,Z=-1===u.hoverdistance?1/0:u.hoverdistance,X=-1===u.spikedistance?1/0:u.spikedistance,Y=[],W=[],$={hLinePoint:null,vLinePoint:null},Q=!1;if(Array.isArray(e))for(D="array",E=0;E<e.length;E++)(F=t.calcdata[e[E].curveNumber||0])&&(N=F[0].trace,"skip"!==F[0].trace.hoverinfo&&(W.push(F),"h"===N.orientation&&(Q=!0)));else{for(I=0;I<t.calcdata.length;I++)F=t.calcdata[I],"skip"!==(N=F[0].trace).hoverinfo&&g.isTraceInSubplots(N,s)&&(W.push(F),"h"===N.orientation&&(Q=!0));var J,K,tt=!e.target;if(tt)J="xpx"in e?e.xpx:_[0]._length/2,K="ypx"in e?e.ypx:w[0]._length/2;else{if(!1===l.triggerHandler(t,"plotly_beforehover",e))return;var et=e.target.getBoundingClientRect();if(J=e.clientX-et.left,K=e.clientY-et.top,J<0||J>_[0]._length||K<0||K>w[0]._length)return d.unhoverRaw(t,e)}if(e.pointerX=J+_[0]._offset,e.pointerY=K+w[0]._offset,z="xval"in e?g.flat(s,e.xval):g.p2c(_,J),R="yval"in e?g.flat(s,e.yval):g.p2c(w,K),!a(z[0])||!a(R[0]))return o.warn("Fx.hover failed",e,t),d.unhoverRaw(t,e)}var rt=1/0;for(I=0;I<W.length;I++)if((F=W[I])&&F[0]&&F[0].trace&&!0===(N=F[0].trace).visible&&0!==N._length&&-1===["carpet","contourcarpet"].indexOf(N._module.name)){if("splom"===N.type?j=s[B=0]:(j=g.getSubplot(N),B=s.indexOf(j)),H=D,U={cd:F,trace:N,xa:_[B],ya:w[B],maxHoverDistance:Z,maxSpikeDistance:X,index:!1,distance:Math.min(rt,Z),spikeDistance:1/0,xSpike:void 0,ySpike:void 0,color:f.defaultLine,name:N.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},u[j]&&(U.subplot=u[j]._subplot),u._splomScenes&&u._splomScenes[N.uid]&&(U.scene=u._splomScenes[N.uid]),G=Y.length,"array"===H){var nt=e[I];"pointNumber"in nt?(U.index=nt.pointNumber,H="closest"):(H="","xval"in nt&&(V=nt.xval,H="x"),"yval"in nt&&(q=nt.yval,H=H?"closest":"y"))}else V=z[B],q=R[B];if(0!==Z)if(N._module&&N._module.hoverPoints){var at=N._module.hoverPoints(U,V,q,H,u._hoverlayer);if(at)for(var it,ot=0;ot<at.length;ot++)it=at[ot],a(it.x0)&&a(it.y0)&&Y.push(L(it,D))}else o.log("Unrecognized trace type in hover:",N);if("closest"===D&&Y.length>G&&(Y.splice(0,G),rt=Y[0].distance),m&&0!==X&&0===Y.length){U.distance=X,U.index=!1;var lt=N._module.hoverPoints(U,V,q,"closest",u._hoverlayer);if(lt&&(lt=lt.filter(function(t){return t.spikeDistance<=X})),lt&<.length){var st,ct=lt.filter(function(t){return t.xa.showspikes});if(ct.length){var ut=ct[0];a(ut.x0)&&a(ut.y0)&&(st=ht(ut),(!$.vLinePoint||$.vLinePoint.spikeDistance>st.spikeDistance)&&($.vLinePoint=st))}var ft=lt.filter(function(t){return t.ya.showspikes});if(ft.length){var dt=ft[0];a(dt.x0)&&a(dt.y0)&&(st=ht(dt),(!$.hLinePoint||$.hLinePoint.spikeDistance>st.spikeDistance)&&($.hLinePoint=st))}}}}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 ht(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:u,container:u._hoverlayer,outerContainer:u._paperdiv,event:e},vt=t._spikepoints,mt={vLinePoint:$.vLinePoint,hLinePoint:$.hLinePoint};if(t._spikepoints=mt,m&&0!==X&&0!==Y.length){var yt=Y.filter(function(t){return t.ya.showspikes}),xt=pt(yt,X);$.hLinePoint=ht(xt);var bt=Y.filter(function(t){return t.xa.showspikes}),_t=pt(bt,X);$.vLinePoint=ht(_t)}if(0===Y.length){var wt=d.unhoverRaw(t,e);return!m||null===$.hLinePoint&&null===$.vLinePoint||C(vt)&&S(t,$,gt),wt}m&&C(vt)&&S(t,$,gt);Y.sort(function(t,e){return t.distance-e.distance});var kt=t._hoverdata,Tt=[];for(E=0;E<Y.length;E++){var Mt=Y[E],At=g.makeEventData(Mt,Mt.trace,Mt.cd);if(!1!==Mt.hovertemplate){var Lt=!1;Mt.cd[Mt.index]&&Mt.cd[Mt.index].ht&&(Lt=Mt.cd[Mt.index].ht),Mt.hovertemplate=Lt||Mt.trace.hovertemplate||!1}Mt.eventData=[At],Tt.push(At)}t._hoverdata=Tt;var St="y"===D&&(W.length>1||Y.length>1)||"closest"===D&&Q&&Y.length>1,Ct=f.combine(u.plot_bgcolor||f.background,u.paper_bgcolor),Ot={hovermode:D,rotateLabels:St,bgColor:Ct,container:u._hoverlayer,outerContainer:u._paperdiv,commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance},Pt=M(Y,Ot,t);if(function(t,e,r){var n,a,i,o,l,s,c,u=0,f=1,d=t.size(),p=new Array(d),h=0;function g(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(l=t.length-1;l>=0;l--)t[l].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(l=t.length-1;l>=0;l--)t[l].dp-=i;n=!1}if(n){var c=0;for(o=0;o<t.length;o++)(s=t[o]).pos+s.dp+s.size>e.pmax&&c++;for(o=t.length-1;o>=0&&!(c<=0);o--)(s=t[o]).pos>e.pmax-1&&(s.del=!0,c--);for(o=0;o<t.length&&!(c<=0);o++)if((s=t[o]).pos<e.pmin+1)for(s.del=!0,c--,i=2*s.size,l=t.length-1;l>=0;l--)t[l].dp-=i;for(o=t.length-1;o>=0&&!(c<=0);o--)(s=t[o]).pos+s.dp+s.size>e.pmax&&(s.del=!0,c--)}}}for(t.each(function(t){var n=t[e],a="x"===n._id.charAt(0),i=n.range;0===h&&i&&i[0]>i[1]!==a&&(f=-1),p[h++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(a?x:1)/2,pmin:0,pmax:a?r.width:r.height}]}),p.sort(function(t,e){return t[0].posref-e[0].posref||f*(e[0].traceIndex-t[0].traceIndex)});!n&&u<=d;){for(u++,n=!0,o=0;o<p.length-1;){var v=p[o],m=p[o+1],y=v[v.length-1],b=m[0];if((a=y.pos+y.dp+y.size-b.pos-b.dp+b.size)>.01&&y.pmin===b.pmin&&y.pmax===b.pmax){for(l=m.length-1;l>=0;l--)m[l].dp+=a;for(v.push.apply(v,m),p.splice(o+1,1),c=0,l=v.length-1;l>=0;l--)c+=v[l].dp;for(i=c/v.length,l=v.length-1;l>=0;l--)v[l].dp-=i;n=!1}else o++}p.forEach(g)}for(o=p.length-1;o>=0;o--){var _=p[o];for(l=_.length-1;l>=0;l--){var w=_[l],k=w.datum;k.offset=w.dp,k.del=w.del}}}(Pt,St?"xa":"ya",u),A(Pt,St),e.target&&e.target.tagName){var Dt=h.getComponentMethod("annotations","hasClickToShow")(t,Tt);c(n.select(e.target),Dt?"pointer":"")}if(!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))return;kt&&t.emit("plotly_unhover",{event:e,points:kt});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:_,yaxes:w,xvals:z,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||f.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,l={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||f.background,container:i,outerContainer:o},s=M(a,l,e.gd),c=0,u=0;return s.sort(function(t,e){return t.y0-e.y0}).each(function(t,r){var n=t.y0-t.by/2;t.offset=n-5<c?c-n+5:0,c=n+t.by+t.offset,r===e.anchorIndex&&(u=t.offset)}).each(function(t){t.offset-=u}),A(s,l.rotateLabels),r?s:s.node()};var T=/<extra>([\s\S]*)<\/extra>/;function M(t,e,r){var a=r._fullLayout,i=e.hovermode,l=e.rotateLabels,c=e.bgColor,d=e.container,p=e.outerContainer,h=e.commonLabelOpts||{},g=e.fontFamily||v.HOVERFONT,y=e.fontSize||v.HOVERFONTSIZE,x=t[0],b=x.xa,_=x.ya,M="y"===i?"yLabel":"xLabel",A=x[M],L=(String(A)||"").split(" ")[0],S=p.node().getBoundingClientRect(),C=S.top,P=S.width,D=S.height,z=void 0!==A&&x.distance<=e.hoverdistance&&("x"===i||"y"===i);if(z){var R,E,I=!0;for(R=0;R<t.length;R++)if(I&&void 0===t[R].zLabel&&(I=!1),E=t[R].hoverinfo||t[R].trace.hoverinfo){var F=Array.isArray(E)?E:E.split("+");if(-1===F.indexOf("all")&&-1===F.indexOf(i)){z=!1;break}}I&&(z=!1)}var N=d.selectAll("g.axistext").data(z?[0]:[]);N.enter().append("g").classed("axistext",!0),N.exit().remove(),N.each(function(){var e=n.select(this),l=o.ensureSingle(e,"path","",function(t){t.style({"stroke-width":"1px"})}),c=o.ensureSingle(e,"text","",function(t){t.attr("data-notex",1)}),d=h.bgcolor||f.defaultLine,p=h.bordercolor||f.contrast(d),v=f.contrast(d),m={family:h.font.family||g,size:h.font.size||y,color:h.font.color||v};l.style({fill:d,stroke:p}),c.text(A).call(u.font,m).call(s.positionText,0,0).call(s.convertToTspans,r),e.attr("transform","");var T,S,O=c.node().getBoundingClientRect();if("x"===i){var P="top"===b.side?"-":"";c.attr("text-anchor","middle").call(s.positionText,0,"top"===b.side?C-O.bottom-w-k:C-O.top+w+k),T=b._offset+(x.x0+x.x1)/2,S=_._offset+("top"===b.side?0:_._length);var D=O.width/2+k;T<D?(T=D,l.attr("d","M-"+(D-w)+",0L-"+(D-2*w)+","+P+w+"H"+(k+O.width/2)+"v"+P+(2*k+O.height)+"H-"+D+"V"+P+w+"Z")):T>a.width-D?(T=a.width-D,l.attr("d","M"+(D-w)+",0L"+D+","+P+w+"v"+P+(2*k+O.height)+"H-"+D+"V"+P+w+"H"+(D-2*w)+"Z")):l.attr("d","M0,0L"+w+","+P+w+"H"+(k+O.width/2)+"v"+P+(2*k+O.height)+"H-"+(k+O.width/2)+"V"+P+w+"H-"+w+"Z")}else{var z,R,E;"right"===_.side?(z="start",R=1,E="",T=b._offset+b._length):(z="end",R=-1,E="-",T=b._offset),S=_._offset+(x.y0+x.y1)/2,c.attr("text-anchor",z),l.attr("d","M0,0L"+E+w+","+w+"V"+(k+O.height/2)+"h"+E+(2*k+O.width)+"V-"+(k+O.height/2)+"H"+E+w+"V-"+w+"Z");var I,F=O.height/2,N=C-O.top-F,j="clip"+a._uid+"commonlabel"+_._id;if(T<O.width+2*k+w){I="M-"+(w+k)+"-"+F+"h-"+(O.width-k)+"V"+F+"h"+(O.width-k)+"Z";var B=O.width-T+k;s.positionText(c,B,N),"end"===z&&c.selectAll("tspan").each(function(){var t=n.select(this),e=u.tester.append("text").text(t.text()).call(u.font,m),r=e.node().getBoundingClientRect();Math.round(r.width)<Math.round(O.width)&&t.attr("x",B-r.width),e.remove()})}else s.positionText(c,R*(k+w),N),I=null;var H=a._topclips.selectAll("#"+j).data(I?[0]:[]);H.enter().append("clipPath").attr("id",j).append("path"),H.exit().remove(),H.select("path").attr("d",I),u.setClipUrl(c,I?j:null,r)}e.attr("transform","translate("+T+","+S+")"),t=t.filter(function(t){return void 0!==t.zLabelVal||(t[M]||"").split(" ")[0]===L})});var j=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 j.enter().append("g").classed("hovertext",!0).each(function(){var t=n.select(this);t.append("rect").call(f.fill,f.addOpacity(c,.8)),t.append("text").classed("name",!0),t.append("path").style("stroke-width","1px"),t.append("text").classed("nums",!0).call(u.font,g,y)}),j.exit().remove(),j.each(function(t){var e=n.select(this).attr("transform",""),d="",p="",h=t.bgcolor||t.color,v=f.combine(f.opacity(h)?h:f.defaultLine,c),x=f.combine(f.opacity(t.color)?t.color:f.defaultLine,c),b=t.borderColor||f.contrast(v);void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),d=O(t.name,t.nameLength)),void 0!==t.zLabel?(void 0!==t.xLabel&&(p+="x: "+t.xLabel+"<br>"),void 0!==t.yLabel&&(p+="y: "+t.yLabel+"<br>"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(p+=(p?"z: ":"")+t.zLabel)):z&&t[i+"Label"]===A?p=t[("x"===i?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(p=t.yLabel):p=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(p+=(p?"<br>":"")+t.text),void 0!==t.extraText&&(p+=(p?"<br>":"")+t.extraText),""!==p||t.hovertemplate||(""===d&&e.remove(),p=d);var _=a._d3locale,M=t.hovertemplate||!1,L=t.hovertemplateLabels||t,S=t.eventData[0]||{};M&&(p=(p=o.hovertemplateString(M,L,_,S,t.trace._meta)).replace(T,function(e,r){return d=O(r,t.nameLength),""}));var R=e.select("text.nums").call(u.font,t.fontFamily||g,t.fontSize||y,t.fontColor||b).text(p).attr("data-notex",1).call(s.positionText,0,0).call(s.convertToTspans,r),E=e.select("text.name"),I=0,F=0;if(d&&d!==p){E.call(u.font,t.fontFamily||g,t.fontSize||y,x).text(d).attr("data-notex",1).call(s.positionText,0,0).call(s.convertToTspans,r);var N=E.node().getBoundingClientRect();I=N.width+2*k,F=N.height+2*k}else E.remove(),e.select("rect").remove();e.select("path").style({fill:v,stroke:b});var j,B,H=R.node().getBoundingClientRect(),V=t.xa._offset+(t.x0+t.x1)/2,q=t.ya._offset+(t.y0+t.y1)/2,U=Math.abs(t.x1-t.x0),G=Math.abs(t.y1-t.y0),Z=H.width+w+k+I;if(t.ty0=C-H.top,t.bx=H.width+2*k,t.by=Math.max(H.height+2*k,F),t.anchor="start",t.txwidth=H.width,t.tx2width=I,t.offset=0,l)t.pos=V,j=q+G/2+Z<=D,B=q-G/2-Z>=0,"top"!==t.idealAlign&&j||!B?j?(q+=G/2,t.anchor="start"):t.anchor="middle":(q-=G/2,t.anchor="end");else if(t.pos=q,j=V+U/2+Z<=P,B=V-U/2-Z>=0,"left"!==t.idealAlign&&j||!B)if(j)V+=U/2,t.anchor="start";else{t.anchor="middle";var X=Z/2,Y=V+X-P,W=V-X;Y>0&&(V-=Y),W<0&&(V+=-W)}else V-=U/2,t.anchor="end";R.attr("text-anchor",t.anchor),I&&E.attr("text-anchor",t.anchor),e.attr("transform","translate("+V+","+q+")"+(l?"rotate("+m+")":""))}),j}function A(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,l={start:1,end:-1,middle:0}[i],c=l*(w+k),f=c+l*(t.txwidth+k),d=0,p=t.offset;"middle"===i&&(c-=t.tx2width/2,f+=t.txwidth/2+k),e&&(p*=-_,d=t.offset*b),r.select("path").attr("d","middle"===i?"M-"+(t.bx/2+t.tx2width/2)+","+(p-t.by/2)+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(o*w+d)+","+(w+p)+"v"+(t.by/2-w)+"h"+o*t.bx+"v-"+t.by+"H"+(o*w+d)+"V"+(p-w)+"Z");var h=c+d,g=p+t.ty0-t.by/2+k,v=t.textAlign||"auto";"auto"!==v&&("left"===v&&"start"!==i?(a.attr("text-anchor","start"),h="middle"===i?-t.bx/2-t.tx2width/2+k:-t.bx-k):"right"===v&&"end"!==i&&(a.attr("text-anchor","end"),h="middle"===i?t.bx/2-t.tx2width/2-k:t.bx+k)),a.call(s.positionText,h,g),t.tx2width&&(r.select("text.name").call(s.positionText,f+l*k+d,p+t.ty0-t.by/2+k),r.select("rect").call(u.setRect,f+(l-1)*t.tx2width/2+d,p-t.by/2-1,t.tx2width,t.by+2))})}function L(t,e){var r=t.index,n=t.trace||{},i=t.cd[0],l=t.cd[r]||{};function s(t){return t||a(t)&&0===t}var c=Array.isArray(r)?function(t,e){var a=o.castOption(i,r,t);return s(a)?a:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(l,n,t,e)};function u(e,r,n){var a=c(r,n);s(a)&&(t[e]=a)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("nameLength","hnl","hoverlabel.namelength"),u("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:p.hoverLabelText(t.xa,t.xLabelVal),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:p.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 f=p.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+f+" / -"+p.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+f,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var d=p.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+d+" / -"+p.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+d,"y"===e&&(t.distance+=1)}var h=t.hoverinfo||t.trace.hoverinfo;return h&&"all"!==h&&(-1===(h=Array.isArray(h)?h:h.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===h.indexOf("y")&&(t.yLabel=void 0),-1===h.indexOf("z")&&(t.zLabel=void 0),-1===h.indexOf("text")&&(t.text=void 0),-1===h.indexOf("name")&&(t.name=void 0)),t}function S(t,e,r){var n,a,o=r.container,l=r.fullLayout,s=l._size,c=r.event,d=!!e.hLinePoint,h=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),h||d){var g=f.combine(l.plot_bgcolor,l.paper_bgcolor);if(d){var v,m,y=e.hLinePoint;n=y&&y.xa,"cursor"===(a=y&&y.ya).spikesnap?(v=c.pointerX,m=c.pointerY):(v=n._offset+y.x,m=a._offset+y.y);var x,b,_=i.readability(y.color,g)<1.5?f.contrast(g):y.color,w=a.spikemode,k=a.spikethickness,T=a.spikecolor||_,M=p.getPxPosition(t,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=M,b=v),-1!==w.indexOf("across")){var A=a._counterDomainMin,L=a._counterDomainMax;"free"===a.anchor&&(A=Math.min(A,a.position),L=Math.max(L,a.position)),x=s.l+A*s.w,b=s.l+L*s.w}o.insert("line",":first-child").attr({x1:x,x2:b,y1:m,y2:m,"stroke-width":k,stroke:T,"stroke-dasharray":u.dashStyle(a.spikedash,k)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:m,y2:m,"stroke-width":k+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:M+("right"!==a.side?k:-k),cy:m,r:k,fill:T}).classed("spikeline",!0)}if(h){var S,C,O=e.vLinePoint;n=O&&O.xa,a=O&&O.ya,"cursor"===n.spikesnap?(S=c.pointerX,C=c.pointerY):(S=n._offset+O.x,C=a._offset+O.y);var P,D,z=i.readability(O.color,g)<1.5?f.contrast(g):O.color,R=n.spikemode,E=n.spikethickness,I=n.spikecolor||z,F=p.getPxPosition(t,n);if(-1!==R.indexOf("toaxis")||-1!==R.indexOf("across")){if(-1!==R.indexOf("toaxis")&&(P=F,D=C),-1!==R.indexOf("across")){var N=n._counterDomainMin,j=n._counterDomainMax;"free"===n.anchor&&(N=Math.min(N,n.position),j=Math.max(j,n.position)),P=s.t+(1-j)*s.h,D=s.t+(1-N)*s.h}o.insert("line",":first-child").attr({x1:S,x2:S,y1:P,y2:D,"stroke-width":E,stroke:I,"stroke-dasharray":u.dashStyle(n.spikedash,E)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:S,x2:S,y1:P,y2:D,"stroke-width":E+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==R.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S,cy:F-("top"!==n.side?E:-E),r:E,fill:I}).classed("spikeline",!0)}}}function C(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}function O(t,e){return s.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}},{"../../lib":159,"../../lib/events":153,"../../lib/override_cursor":170,"../../lib/svg_text_utils":180,"../../plots/cartesian/axes":203,"../../registry":243,"../color":42,"../dragelement":60,"../drawing":63,"./constants":75,"./helpers":77,d3:7,"fast-isnumeric":9,tinycolor2:25}],79:[function(t,e,r){"use strict";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":159}],80:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../dragelement"),o=t("./helpers"),l=t("./layout_attributes"),s=t("./hover");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:l},attributes:t("./attributes"),layoutAttributes:l,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:s.hover,unhover:i.unhover,loneHover:s.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":159,"../dragelement":60,"./attributes":72,"./calc":73,"./click":74,"./constants":75,"./defaults":76,"./helpers":77,"./hover":78,"./layout_attributes":81,"./layout_defaults":82,"./layout_global_defaults":83,d3:7}],81:[function(t,e,r){"use strict";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":229,"./constants":75}],82:[function(t,e,r){"use strict";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,l=i("clickmode");"select"===i("dragmode")&&i("selectdirection"),e._has("cartesian")?l.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=a.xaxis+a.yaxis,o=r[i]||{},l=o[a.stackgroup]||{};if("h"!==a.orientation&&"h"!==l.orientation)return!1}return!0}(r,e),o=e._isHoriz?"y":"x"):o="closest",i("hovermode",o)&&(i("hoverdistance"),i("spikedistance"));var s=e._has("mapbox"),c=e._has("geo"),u=e._basePlotModules.length;"zoom"===e.dragmode&&((s||c)&&1===u||s&&c&&2===u)&&(e.dragmode="pan")}},{"../../lib":159,"./layout_attributes":81}],83:[function(t,e,r){"use strict";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":159,"./hoverlabel_defaults":79,"./layout_attributes":81}],84:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../lib/regex").counter,i=t("../../plots/domain").attributes,o=t("../../plots/cartesian/constants").idRegex,l=t("../../plot_api/plot_template"),s={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 c(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 u(t,e,r,n,a,i){var o=e(t+"gap",r),l=e("domain."+t);e(t+"side",n);for(var s=new Array(a),c=l[0],u=(l[1]-c)/(a-o),f=u*(1-o),d=0;d<a;d++){var p=c+u*d;s[i?a-1-d:d]=[p,p+f]}return s}function f(t,e,r,n,a){var i,o=new Array(r);function l(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++)l(i,t[i]);else for(l(0,a),i=1;i<r;i++)l(i,a+(i+1));return o}e.exports={moduleType:"component",name:"grid",schema:{layout:{grid:s}},layoutAttributes:s,sizeDefaults:function(t,e){var r=t.grid||{},a=c(e,r,"x"),i=c(e,r,"y");if(t.grid||a||i){var o,f,d=Array.isArray(r.subplots)&&Array.isArray(r.subplots[0]),p=Array.isArray(a),h=Array.isArray(i),g=p&&a!==r.xaxes&&h&&i!==r.yaxes;d?(o=r.subplots.length,f=r.subplots[0].length):(h&&(o=i.length),p&&(f=a.length));var v=l.newContainer(e,"grid"),m=T("rows",o),y=T("columns",f);if(m*y>1){d||p||h||"independent"===T("pattern")&&(d=!0),v._hasSubplotGrid=d;var x,b,_="top to bottom"===T("roworder"),w=d?.2:.1,k=d?.3:.1;g&&e._splomGridDflt&&(x=e._splomGridDflt.xside,b=e._splomGridDflt.yside),v._domains={x:u("x",T,w,x,y),y:u("y",T,k,b,m,_)}}else delete e.grid}function T(t,e){return n.coerce(r,v,s,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,a,i,o,l,s,u,d=t.grid||{},p=e._subplots,h=r._hasSubplotGrid,g=r.rows,v=r.columns,m="independent"===r.pattern,y=r._axisMap={};if(h){var x=d.subplots||[];s=r.subplots=new Array(g);var b=1;for(n=0;n<g;n++){var _=s[n]=new Array(v),w=x[n]||[];for(a=0;a<v;a++)if(m?(l=1===b?"xy":"x"+b+"y"+b,b++):l=w[a],_[a]="",-1!==p.cartesian.indexOf(l)){if(u=l.indexOf("y"),i=l.slice(0,u),o=l.slice(u),void 0!==y[i]&&y[i]!==a||void 0!==y[o]&&y[o]!==n)continue;_[a]=l,y[i]=a,y[o]=n}}}else{var k=c(e,d,"x"),T=c(e,d,"y");r.xaxes=f(k,p.xaxis,v,y,"x"),r.yaxes=f(T,p.yaxis,g,y,"y")}var M=r._anchors={},A="top to bottom"===r.roworder;for(var L in y){var S,C,O,P=L.charAt(0),D=r[P+"side"];if(D.length<8)M[L]="free";else if("x"===P){if("t"===D.charAt(0)===A?(S=0,C=1,O=g):(S=g-1,C=-1,O=-1),h){var z=y[L];for(n=S;n!==O;n+=C)if((l=s[n][z])&&(u=l.indexOf("y"),l.slice(0,u)===L)){M[L]=l.slice(u);break}}else for(n=S;n!==O;n+=C)if(o=r.yaxes[n],-1!==p.cartesian.indexOf(L+o)){M[L]=o;break}}else if("l"===D.charAt(0)?(S=0,C=1,O=v):(S=v-1,C=-1,O=-1),h){var R=y[L];for(n=S;n!==O;n+=C)if((l=s[R][n])&&(u=l.indexOf("y"),l.slice(u)===L)){M[L]=l.slice(0,u);break}}else for(n=S;n!==O;n+=C)if(i=r.xaxes[n],-1!==p.cartesian.indexOf(i+L)){M[L]=i;break}}}}}},{"../../lib":159,"../../lib/regex":174,"../../plot_api/plot_template":193,"../../plots/cartesian/constants":209,"../../plots/domain":228}],85:[function(t,e,r){"use strict";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":193,"../../plots/cartesian/constants":209}],86:[function(t,e,r){"use strict";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,l="linear"===r&&"log"===e.type;if(o||l)for(var s,c,u=t._fullLayout.images,f=e._id.charAt(0),d=0;d<u.length;d++)if(c="images["+d+"].",(s=u[d])[f+"ref"]===e._id){var p=s[f],h=s["size"+f],g=null,v=null;if(o){g=a(p,e.range);var m=h/Math.pow(10,g)/2;v=2*Math.log(m+Math.sqrt(1+m*m))/Math.LN10}else v=(g=Math.pow(10,p))*(Math.pow(10,h/2)-Math.pow(10,-h/2));n(g)?n(v)||(v=null):(g=null,v=null),i(c+f,g),i(c+"size"+f,v)}}},{"../../lib/to_log_range":182,"fast-isnumeric":9}],87:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../../plots/array_container_defaults"),o=t("./attributes");function l(t,e,r){function i(r,a){return n.coerce(t,e,o,r,a)}var l=i("source");if(!i("visible",!!l))return e;i("layer"),i("xanchor"),i("yanchor"),i("sizex"),i("sizey"),i("sizing"),i("opacity");for(var s={_fullLayout:r},c=["x","y"],u=0;u<2;u++){var f=c[u],d=a.coerceRef(t,e,s,f,"paper");if("paper"!==d)a.getFromId(s,d)._imgIndices.push(e._index);a.coercePosition(e,s,i,d,f,0)}return e}e.exports=function(t,e){i(t,e,{name:"images",handleItemDefaults:l})}},{"../../lib":159,"../../plots/array_container_defaults":199,"../../plots/cartesian/axes":203,"./attributes":85}],88:[function(t,e,r){"use strict";var n=t("d3"),a=t("../drawing"),i=t("../../plots/cartesian/axes"),o=t("../../constants/xmlns_namespaces");e.exports=function(t){var e,r,l=t._fullLayout,s=[],c={},u=[];for(r=0;r<l.images.length;r++){var f=l.images[r];if(f.visible)if("below"===f.layer&&"paper"!==f.xref&&"paper"!==f.yref){e=f.xref+f.yref;var d=l._plots[e];if(!d){u.push(f);continue}d.mainplot&&(e=d.mainplot.id),c[e]||(c[e]=[]),c[e].push(f)}else"above"===f.layer?s.push(f):u.push(f)}var p={x:{left:{sizing:"xMin",offset:0},center:{sizing:"xMid",offset:-.5},right:{sizing:"xMax",offset:-1}},y:{top:{sizing:"YMin",offset:0},middle:{sizing:"YMid",offset:-.5},bottom:{sizing:"YMax",offset:-1}}};function h(e){var r=n.select(this);if(this._imgSrc!==e.source)if(r.attr("xmlns",o.svg),e.source&&"data:"===e.source.slice(0,5))r.attr("xlink:href",e.source),this._imgSrc=e.source;else{var 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,this._imgSrc=e.source}.bind(this));t._promises.push(a)}}function g(e){var r=n.select(this),o=i.getFromId(t,e.xref),s=i.getFromId(t,e.yref),c=l._size,u=o?Math.abs(o.l2p(e.sizex)-o.l2p(0)):e.sizex*c.w,f=s?Math.abs(s.l2p(e.sizey)-s.l2p(0)):e.sizey*c.h,d=u*p.x[e.xanchor].offset,h=f*p.y[e.yanchor].offset,g=p.x[e.xanchor].sizing+p.y[e.yanchor].sizing,v=(o?o.r2p(e.x)+o._offset:e.x*c.w+c.l)+d,m=(s?s.r2p(e.y)+s._offset:c.h-e.y*c.h+c.t)+h;switch(e.sizing){case"fill":g+=" slice";break;case"stretch":g="none"}r.attr({x:v,y:m,width:u,height:f,preserveAspectRatio:g,opacity:e.opacity});var y=(o?o._id:"")+(s?s._id:"");a.setClipUrl(r,y?"clip"+l._uid+y:null,t)}var v=l._imageLowerLayer.selectAll("image").data(u),m=l._imageUpperLayer.selectAll("image").data(s);v.enter().append("image"),m.enter().append("image"),v.exit().remove(),m.exit().remove(),v.each(function(t){h.bind(this)(t),g.bind(this)(t)}),m.each(function(t){h.bind(this)(t),g.bind(this)(t)});var y=Object.keys(l._plots);for(r=0;r<y.length;r++){e=y[r];var x=l._plots[e];if(x.imagelayer){var b=x.imagelayer.selectAll("image").data(c[e]||[]);b.enter().append("image"),b.exit().remove(),b.each(function(t){h.bind(this)(t),g.bind(this)(t)})}}}},{"../../constants/xmlns_namespaces":140,"../../plots/cartesian/axes":203,"../drawing":63,d3:7}],89:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"images",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),includeBasePlot:t("../../plots/cartesian/include_components")("images"),draw:t("./draw"),convertCoords:t("./convert_coords")}},{"../../plots/cartesian/include_components":213,"./attributes":85,"./convert_coords":86,"./defaults":87,"./draw":88}],90:[function(t,e,r){"use strict";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,editType:"legend"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",min:-2,max:3,editType:"legend"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],editType:"legend"},uirevision:{valType:"any",editType:"none"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"legend"},title:{text:{valType:"string",dflt:"",editType:"legend"},font:n({editType:"legend"}),side:{valType:"enumerated",values:["top","left","top left"],editType:"legend"},editType:"legend"},editType:"legend"}},{"../../plots/font_attributes":229,"../color/attributes":41}],91:[function(t,e,r){"use strict";e.exports={scrollBarWidth:6,scrollBarMinHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4,scrollBarEnterAttrs:{rx:20,ry:3,width:0,height:0},titlePad:2,textGap:40,itemGap:5}},{}],92:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("../../plot_api/plot_template"),o=t("./attributes"),l=t("../../plots/layout_attributes"),s=t("./helpers");e.exports=function(t,e,r){for(var c=t.legend||{},u=0,f=!1,d="normal",p=0;p<r.length;p++){var h=r[p];h.visible&&((h.showlegend||h._dfltShowLegend&&!(h._module&&h._module.attributes&&h._module.attributes.showlegend&&!1===h._module.attributes.showlegend.dflt))&&(u++,h.showlegend&&(f=!0,(n.traceIs(h,"pie-like")||!0===h._input.showlegend)&&u++)),(n.traceIs(h,"bar")&&"stack"===e.barmode||-1!==["tonextx","tonexty"].indexOf(h.fill))&&(d=s.isGrouped({traceorder:d})?"grouped+reversed":"reversed"),void 0!==h.legendgroup&&""!==h.legendgroup&&(d=s.isReversed({traceorder:d})?"reversed+grouped":"grouped"))}var g=a.coerce(t,e,l,"showlegend",f&&u>1);if(!1!==g||c.uirevision){var v=i.newContainer(e,"legend");if(_("uirevision",e.uirevision),!1!==g){_("bgcolor",e.paper_bgcolor),_("bordercolor"),_("borderwidth"),a.coerceFont(_,"font",e.font);var m,y,x,b=_("orientation");"h"===b?(m=0,n.getComponentMethod("rangeslider","isVisible")(t.xaxis)?(y=1.1,x="bottom"):(y=-.1,x="top")):(m=1.02,y=1,x="auto"),_("traceorder",d),s.isGrouped(e.legend)&&_("tracegroupgap"),_("itemsizing"),_("itemclick"),_("itemdoubleclick"),_("x",m),_("xanchor"),_("y",y),_("yanchor",x),_("valign"),a.noneOrAll(c,v,["x","y"]),_("title.text")&&(_("title.side","h"===b?"left":"top"),a.coerceFont(_,"title.font",e.font))}}function _(t,e){return a.coerce(c,v,o,t,e)}}},{"../../lib":159,"../../plot_api/plot_template":193,"../../plots/layout_attributes":233,"../../registry":243,"./attributes":90,"./helpers":96}],93:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../plots/plots"),o=t("../../registry"),l=t("../../lib/events"),s=t("../dragelement"),c=t("../drawing"),u=t("../color"),f=t("../../lib/svg_text_utils"),d=t("./handle_click"),p=t("./constants"),h=t("../../constants/alignment"),g=h.LINE_SPACING,v=h.FROM_TL,m=h.FROM_BR,y=t("./get_legend_data"),x=t("./style"),b=t("./helpers");function _(t,e,r,n,a){var i=r.data()[0][0].trace,s={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};if(i._group&&(s.group=i._group),o.traceIs(i,"pie-like")&&(s.label=r.datum()[0].label),!1!==l.triggerHandler(t,"plotly_legendclick",s))if(1===n)e._clickTimeout=setTimeout(function(){d(r,t,n)},t._context.doubleClickDelay);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==l.triggerHandler(t,"plotly_legenddoubleclick",s)&&d(r,t,n)}}function w(t,e){var r=t.data()[0][0],n=e._fullLayout.legend,i=r.trace,l=o.traceIs(i,"pie-like"),s=i.index,u=e._context.edits.legendText&&!l,d=n._maxNameLength,h=l?r.label:i.name;i._meta&&(h=a.templateString(h,i._meta));var g=a.ensureSingle(t,"text","legendtext");g.attr("text-anchor","start").classed("user-select-none",!0).call(c.font,n.font).text(u?k(h,d):h),f.positionText(g,p.textGap,0),u?g.call(f.makeEditable,{gd:e,text:h}).call(M,t,e).on("edit",function(n){this.text(k(n,d)).call(M,t,e);var i=r.trace._fullInput||{},l={};if(o.hasTransform(i,"groupby")){var c=o.getTransformIndices(i,"groupby"),u=c[c.length-1],f=a.keyedContainer(i,"transforms["+u+"].styles","target","value.name");f.set(r.trace._group,n),l=f.constructUpdate()}else l.name=n;return o.call("_guiRestyle",e,l,s)}):M(g,t,e)}function k(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function T(t,e){var r,i=e._context.doubleClickDelay,o=1,l=a.ensureSingle(t,"rect","legendtoggle",function(t){t.style("cursor","pointer").attr("pointer-events","all").call(u.fill,"rgba(0,0,0,0)")});l.on("mousedown",function(){(r=(new Date).getTime())-e._legendMouseDownTime<i?o+=1:(o=1,e._legendMouseDownTime=r)}),l.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)),_(e,r,t,o,n.event)}})}function M(t,e,r){f.convertToTspans(t,r,function(){!function(t,e){var r=t.data()[0][0];if(r&&!r.trace.showlegend)return void t.remove();var n,a,i=t.select("g[class*=math-group]"),o=i.node(),l=e._fullLayout.legend.borderwidth,s=e._fullLayout.legend,u=(r?s:s.title).font.size*g;if(o){var d=c.bBox(o);n=d.height,a=d.width,r?c.setTranslate(i,0,.25*n):c.setTranslate(i,l,.75*n+l)}else{var h=t.select(r?".legendtext":".legendtitletext"),v=f.lineCount(h),m=h.node();n=u*v,a=m?c.bBox(m).width:0;var y=u*((v-1)/2-.3);r?f.positionText(h,p.textGap,-y):f.positionText(h,p.titlePad+l,u+l)}r?(r.lineHeight=u,r.height=Math.max(n,16)+3,r.width=a):(s._titleWidth=a,s._titleHeight=n)}(e,r)})}function A(t){return a.isRightAnchor(t)?"right":a.isCenterAnchor(t)?"center":"left"}function L(t){return a.isBottomAnchor(t)?"bottom":a.isMiddleAnchor(t)?"middle":"top"}e.exports=function(t){var e=t._fullLayout,r="legend"+e._uid;if(e._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var l=e.legend,f=e.showlegend&&y(t.calcdata,l),d=e.hiddenlabels||[];if(!e.showlegend||!f.length)return e._infolayer.selectAll(".legend").remove(),e._topdefs.select("#"+r).remove(),i.autoMargin(t,"legend");var h=a.ensureSingle(e._infolayer,"g","legend",function(t){t.attr("pointer-events","all")}),g=a.ensureSingleById(e._topdefs,"clipPath",r,function(t){t.append("rect")}),k=a.ensureSingle(h,"rect","bg",function(t){t.attr("shape-rendering","crispEdges")});k.call(u.stroke,l.bordercolor).call(u.fill,l.bgcolor).style("stroke-width",l.borderwidth+"px");var S=a.ensureSingle(h,"g","scrollbox"),C=l.title;if(l._titleWidth=0,l._titleHeight=0,C.text){var O=a.ensureSingle(S,"text","legendtitletext");O.attr("text-anchor","start").classed("user-select-none",!0).call(c.font,C.font).text(C.text),M(O,S,t)}var P=a.ensureSingle(h,"rect","scrollbar",function(t){t.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)}),D=S.selectAll("g.groups").data(f);D.enter().append("g").attr("class","groups"),D.exit().remove();var z=D.selectAll("g.traces").data(a.identity);z.enter().append("g").attr("class","traces"),z.exit().remove(),z.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)}).call(x,t).each(function(){n.select(this).call(T,t)}),a.syncOrAsync([i.previousPromises,function(){return function(t,e,r){var a=t._fullLayout,i=a.legend,o=a._size,l=b.isVertical(i),s=b.isGrouped(i),u=i.borderwidth,f=2*u,d=p.textGap,h=p.itemGap,g=2*(u+h),v=L(i),m=i.y<0||0===i.y&&"top"===v,y=i.y>1||1===i.y&&"bottom"===v;i._maxHeight=Math.max(m||y?a.height/2:o.h,30);var x=0;i._width=0,i._height=0;var _=function(t){var e=0,r=0,n=t.title.side;n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight));return[e,r]}(i);if(l)r.each(function(t){var e=t[0].height;c.setTranslate(this,u+_[0],u+_[1]+i._height+e/2+h),i._height+=e,i._width=Math.max(i._width,t[0].width)}),x=d+i._width,i._width+=h+d+f,i._height+=g,s&&(e.each(function(t,e){c.setTranslate(this,0,e*i.tracegroupgap)}),i._height+=(i._lgroupsLength-1)*i.tracegroupgap);else{var w=A(i),k=i.x<0||0===i.x&&"right"===w,T=i.x>1||1===i.x&&"left"===w,M=y||m,S=a.width/2;i._maxWidth=Math.max(k?M&&"left"===w?o.l+o.w:S:T?M&&"right"===w?o.r+o.w:S:o.w,2*d);var C=0,O=0;r.each(function(t){var e=t[0].width+d;C=Math.max(C,e),O+=e}),x=null;var P=0;if(s){var D=0,z=0,R=0;e.each(function(){var t=0,e=0;n.select(this).selectAll("g.traces").each(function(r){var n=r[0].height;c.setTranslate(this,_[0],_[1]+u+h+n/2+e),e+=n,t=Math.max(t,d+r[0].width)}),D=Math.max(D,e);var r=t+h;r+u+z>i._maxWidth&&(P=Math.max(P,z),z=0,R+=D+i.tracegroupgap,D=e),c.setTranslate(this,z,R),z+=r}),i._width=Math.max(P,z)+u,i._height=R+D+g}else{var E=r.size(),I=O+f+(E-1)*h<i._maxWidth,F=0,N=0,j=0,B=0;r.each(function(t){var e=t[0].height,r=d+t[0].width,n=(I?r:C)+h;n+u+N>i._maxWidth&&(P=Math.max(P,B),N=0,j+=F,i._height+=F,F=0),c.setTranslate(this,_[0]+u+N,_[1]+u+j+e/2+h),B=N+r+h,N+=n,F=Math.max(F,e)}),I?(i._width=N+f,i._height=F+g):(i._width=Math.max(P,B)+f,i._height+=F+g)}}i._width=Math.ceil(Math.max(i._width+_[0],i._titleWidth+2*(u+p.titlePad))),i._height=Math.ceil(Math.max(i._height+_[1],i._titleHeight+2*(u+p.itemGap))),i._effHeight=Math.min(i._height,i._maxHeight);var H=t._context.edits,V=H.legendText||H.legendPosition;r.each(function(t){var e=n.select(this).select(".legendtoggle"),r=t[0].height,a=V?d:x||d+t[0].width;l||(a+=h/2),c.setRect(e,0,-r/2,a,r)})}(t,D,z)},function(){if(!function(t){var e=t._fullLayout.legend,r=A(e),n=L(e);return i.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*v[r],r:e._width*m[r],b:e._effHeight*m[n],t:e._effHeight*v[n]})}(t)){var u,f,d,y,x=e._size,b=l.borderwidth,w=x.l+x.w*l.x-v[A(l)]*l._width,T=x.t+x.h*(1-l.y)-v[L(l)]*l._effHeight;if(e.margin.autoexpand){var M=w,C=T;w=a.constrain(w,0,e.width-l._width),T=a.constrain(T,0,e.height-l._effHeight),w!==M&&a.log("Constrain legend.x to make legend fit inside graph"),T!==C&&a.log("Constrain legend.y to make legend fit inside graph")}if(c.setTranslate(h,w,T),P.on(".drag",null),h.on("wheel",null),l._height<=l._maxHeight||t._context.staticPlot)k.attr({width:l._width-b,height:l._effHeight-b,x:b/2,y:b/2}),c.setTranslate(S,0,0),g.select("rect").attr({width:l._width-2*b,height:l._effHeight-2*b,x:b,y:b}),c.setClipUrl(S,r,t),c.setRect(P,0,0,0,0),delete l._scrollY;else{var O,D,z,R=Math.max(p.scrollBarMinHeight,l._effHeight*l._effHeight/l._height),E=l._effHeight-R-2*p.scrollBarMargin,I=l._height-l._effHeight,F=E/I,N=Math.min(l._scrollY||0,I);k.attr({width:l._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:l._effHeight-b,x:b/2,y:b/2}),g.select("rect").attr({width:l._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:l._effHeight-2*b,x:b,y:b+N}),c.setClipUrl(S,r,t),H(N,R,F),h.on("wheel",function(){H(N=a.constrain(l._scrollY+n.event.deltaY/E*I,0,I),R,F),0!==N&&N!==I&&n.event.preventDefault()});var j=n.behavior.drag().on("dragstart",function(){var t=n.event.sourceEvent;O="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,z=N}).on("drag",function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(D="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,H(N=function(t,e,r){var n=(r-e)/F+t;return a.constrain(n,0,I)}(z,O,D),R,F))});P.call(j);var B=n.behavior.drag().on("dragstart",function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(O=t.changedTouches[0].clientY,z=N)}).on("drag",function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(D=t.changedTouches[0].clientY,H(N=function(t,e,r){var n=(e-r)/F+t;return a.constrain(n,0,I)}(z,O,D),R,F))});S.call(B)}if(t._context.edits.legendPosition)h.classed("cursor-move",!0),s.init({element:h.node(),gd:t,prepFn:function(){var t=c.getTranslate(h);d=t.x,y=t.y},moveFn:function(t,e){var r=d+t,n=y+e;c.setTranslate(h,r,n),u=s.align(r,0,x.l,x.l+x.w,l.xanchor),f=s.align(n,0,x.t+x.h,x.t,l.yanchor)},doneFn:function(){void 0!==u&&void 0!==f&&o.call("_guiRelayout",t,{"legend.x":u,"legend.y":f})},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&&_(t,h,a,r,n)}})}function H(e,r,n){l._scrollY=t._fullLayout.legend._scrollY=e,c.setTranslate(S,0,-e),c.setRect(P,l._width,p.scrollBarMargin+e*n,p.scrollBarWidth,r),g.select("rect").attr("y",b+e)}}],t)}}},{"../../constants/alignment":136,"../../lib":159,"../../lib/events":153,"../../lib/svg_text_utils":180,"../../plots/plots":235,"../../registry":243,"../color":42,"../dragelement":60,"../drawing":63,"./constants":91,"./get_legend_data":94,"./handle_click":95,"./helpers":96,"./style":98,d3:7}],94:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./helpers");e.exports=function(t,e){var r,i,o={},l=[],s=!1,c={},u=0,f=0;function d(t,r){if(""!==t&&a.isGrouped(e))-1===l.indexOf(t)?(l.push(t),s=!0,o[t]=[[r]]):o[t].push([r]);else{var n="~~i"+u;l.push(n),o[n]=[[r]],u++}}for(r=0;r<t.length;r++){var p=t[r],h=p[0],g=h.trace,v=g.legendgroup;if(g.visible&&g.showlegend)if(n.traceIs(g,"pie-like"))for(c[v]||(c[v]={}),i=0;i<p.length;i++){var m=p[i].label;c[v][m]||(d(v,{label:m,color:p[i].color,i:p[i].i,trace:g,pts:p[i].pts}),c[v][m]=!0,f=Math.max(f,(m||"").length))}else d(v,h),f=Math.max(f,(g.name||"").length)}if(!l.length)return[];var y,x,b=l.length;if(s&&a.isGrouped(e))for(x=new Array(b),r=0;r<b;r++)y=o[l[r]],x[r]=a.isReversed(e)?y.reverse():y;else{for(x=[new Array(b)],r=0;r<b;r++)y=o[l[r]][0],x[0][a.isReversed(e)?b-r-1:r]=y;b=1}return e._lgroupsLength=b,e._maxNameLength=f,x}},{"../../registry":243,"./helpers":96}],95:[function(t,e,r){"use strict";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 l,s=o.legend.itemclick,c=o.legend.itemdoubleclick;if(1===r&&"toggle"===s&&"toggleothers"===c&&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?l=s:2===r&&(l=c),l){var u,f,d,p,h,g=o.hiddenlabels?o.hiddenlabels.slice():[],v=t.data()[0][0],m=e._fullData,y=v.trace,x=y.legendgroup,b={},_=[],w=[],k=[];if(a.traceIs(y,"pie-like")){var T=v.label,M=g.indexOf(T);"toggle"===l?-1===M?g.push(T):g.splice(M,1):"toggleothers"===l&&(g=[],e.calcdata[0].forEach(function(t){T!==t.label&&g.push(t.label)}),e._fullLayout.hiddenlabels&&e._fullLayout.hiddenlabels.length===g.length&&-1===M&&(g=[])),a.call("_guiRelayout",e,"hiddenlabels",g)}else{var A,L=x&&x.length,S=[];if(L)for(u=0;u<m.length;u++)(A=m[u]).visible&&A.legendgroup===x&&S.push(u);if("toggle"===l){var C;switch(y.visible){case!0:C="legendonly";break;case!1:C=!1;break;case"legendonly":C=!0}if(L)for(u=0;u<m.length;u++)!1!==m[u].visible&&m[u].legendgroup===x&&N(m[u],C);else N(y,C)}else if("toggleothers"===l){var O,P,D,z,R=!0;for(u=0;u<m.length;u++)if(O=m[u]===y,D=!0!==m[u].showlegend,!(O||D||(P=L&&m[u].legendgroup===x)||!0!==m[u].visible||a.traceIs(m[u],"notLegendIsolatable"))){R=!1;break}for(u=0;u<m.length;u++)if(!1!==m[u].visible&&!a.traceIs(m[u],"notLegendIsolatable"))switch(y.visible){case"legendonly":N(m[u],!0);break;case!0:z=!!R||"legendonly",O=m[u]===y,D=!0!==m[u].showlegend&&!m[u].legendgroup,P=O||L&&m[u].legendgroup===x,N(m[u],!(!P&&!D)||z)}}for(u=0;u<w.length;u++)if(d=w[u]){var E=d.constructUpdate(),I=Object.keys(E);for(f=0;f<I.length;f++)p=I[f],(b[p]=b[p]||[])[k[u]]=E[p]}for(h=Object.keys(b),u=0;u<h.length;u++)for(p=h[u],f=0;f<_.length;f++)b[p].hasOwnProperty(f)||(b[p][f]=void 0);a.call("_guiRestyle",e,b,_)}}}function F(t,e,r){var n=_.indexOf(t),a=b[e];return a||(a=b[e]=[]),-1===_.indexOf(t)&&(_.push(t),n=_.length-1),a[n]=r,n}function N(t,e){var r=t._fullInput;if(a.hasTransform(r,"groupby")){var i=w[r.index];if(!i){var o=a.getTransformIndices(r,"groupby"),l=o[o.length-1];i=n.keyedContainer(r,"transforms["+l+"].styles","target","value.visible"),w[r.index]=i}var s=i.get(t._group);void 0===s&&(s=!0),!1!==s&&i.set(t._group,e),k[r.index]=F(r.index,"visible",!1!==r.visible)}else{var c=!1!==r.visible&&e;F(r.index,"visible",c)}}}},{"../../lib":159,"../../registry":243}],96:[function(t,e,r){"use strict";r.isGrouped=function(t){return-1!==(t.traceorder||"").indexOf("grouped")},r.isVertical=function(t){return"h"!==t.orientation},r.isReversed=function(t){return-1!==(t.traceorder||"").indexOf("reversed")}},{}],97:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"legend",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw"),style:t("./style")}},{"./attributes":90,"./defaults":92,"./draw":93,"./style":98}],98:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../lib"),o=t("../drawing"),l=t("../color"),s=t("../colorscale/helpers").extractOpts,c=t("../../traces/scatter/subtypes"),u=t("../../traces/pie/style_one"),f=t("../../traces/pie/helpers").castOption,d=12,p=5,h=2,g=10,v=5;function m(t,e){return(e?"radial":"horizontal")+(t?"":"reversed")}e.exports=function(t,e){var r=e._fullLayout.legend,y="constant"===r.itemsizing,x=function(t,e,r,n){var a;if(t+1)a=t;else{if(!(e&&e.width>0))return 0;a=e.width}return y?n:Math.min(a,r)};function b(t,e,r){var i=t[0].trace,o=i.marker||{},s=o.line||{},c=r?i.visible&&i.type===r:a.traceIs(i,"bar"),u=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(c?[t]:[]);u.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),u.exit().remove(),u.each(function(t){var e=n.select(this),r=t[0],a=x(r.mlw,o.line,v,h);e.style("stroke-width",a+"px").call(l.fill,r.mc||o.color),a&&l.stroke(e,r.mlc||s.color)})}function _(t,e,r){var o=t[0],l=o.trace,s=r?l.visible&&l.type===r:a.traceIs(l,r),c=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(s?[t]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),c.exit().remove(),c.size()){var d=(l.marker||{}).line,p=x(f(d.width,o.pts),d,v,h),g=i.minExtend(l,{marker:{line:{width:p}}});g.marker.line.color=d.color;var m=i.minExtend(o,{trace:g});u(c,m,g)}}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,l=t[0].lineHeight,s=t[0].height;if("middle"!==o&&l&&s){var c={top:1,bottom:-1}[o]*(.5*(l-s+3));a.attr("transform","translate(0,"+c+")")}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 u=a.selectAll("g.legendsymbols").data([t]);u.enter().append("g").classed("legendsymbols",!0),u.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)}).each(function(t){var r,a=t[0].trace,c=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":c=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":c=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":c=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":c=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":c=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":c=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var u=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(c);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),u.exit().remove(),u.each(function(t,c){var u,f=n.select(this),d=s(a),p=d.colorscale,h=d.reversescale;if(p){if(!r){var g=p.length;u=0===c?p[h?g-1:0][1]:1===c?p[h?0:g-1][1]:p[Math.floor((g-1)/2)][1]}}else{var v=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(v)?v[c]||v[0]:v}f.attr("d",t[0]),u?f.call(l.fill,u):f.call(function(t){if(t.size()){var n="legendfill-"+a.uid;o.gradient(t,e,n,m(h,"radial"===r),p,"fill")}})})}).each(function(t){var e=t[0].trace,r=[];e.visible&&"waterfall"===e.type&&(r=t[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var 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=x(void 0,a.line,v,h);r.attr("d",t[1]).style("stroke-width",i+"px").call(l.fill,a.color),i&&r.call(l.stroke,a.line.color)})}).each(function(t){b(t,this,"funnel")}).each(function(t){b(t,this)}).each(function(t){var r=t[0].trace,s=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[t]:[]);s.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),s.exit().remove(),s.each(function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var a=x(void 0,r.line,v,h);t.style("stroke-width",a+"px").call(l.fill,r.fillcolor),a&&l.stroke(t,r.line.color)}else{var c=i.minExtend(r,{marker:{size:y?d:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});s.call(o.pointStyle,c,e)}})}).each(function(t){_(t,this,"funnelarea")}).each(function(t){_(t,this,"pie")}).each(function(t){var r,a,l=t[0],u=l.trace,f=u.visible&&u.fill&&"none"!==u.fill,d=c.hasLines(u),h=u.contours,v=!1,y=!1,b=s(u),_=b.colorscale,w=b.reversescale;if(h){var k=h.coloring;"lines"===k?v=!0:d="none"===k||"heatmap"===k||h.showlines,"constraint"===h.type?f="="!==h._operation:"fill"!==k&&"heatmap"!==k||(y=!0)}var T=c.hasMarkers(u)||c.hasText(u),M=f||y,A=d||v,L=T||!M?"M5,0":A?"M5,-2":"M5,-3",S=n.select(this),C=S.select(".legendfill").selectAll("path").data(f||y?[t]:[]);if(C.enter().append("path").classed("js-fill",!0),C.exit().remove(),C.attr("d",L+"h30v6h-30z").call(f?o.fillGroupStyle:function(t){if(t.size()){var r="legendfill-"+u.uid;o.gradient(t,e,r,m(w),_,"fill")}}),d||v){var O=x(void 0,u.line,g,p);a=i.minExtend(u,{line:{width:O}}),r=[i.minExtend(l,{trace:a})]}var P=S.select(".legendlines").selectAll("path").data(d||v?[r]:[]);P.enter().append("path").classed("js-line",!0),P.exit().remove(),P.attr("d",L+(v?"l30,0.0001":"h30")).call(d?o.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+u.uid;o.lineGroupStyle(t),o.gradient(t,e,r,m(w),_,"stroke")}})}).each(function(t){var r,a,l=t[0],s=l.trace,u=c.hasMarkers(s),f=c.hasText(s),g=c.hasLines(s);function v(t,e,r,n){var a=i.nestedProperty(s,t).get(),o=i.isArrayOrTypedArray(a)&&e?e(a):a;if(y&&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(u||f||g){var x={},b={};if(u){x.mc=v("marker.color",m),x.mx=v("marker.symbol",m),x.mo=v("marker.opacity",i.mean,[.2,1]),x.mlc=v("marker.line.color",m),x.mlw=v("marker.line.width",i.mean,[0,5],h),b.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var _=v("marker.size",i.mean,[2,16],d);x.ms=_,b.marker.size=_}g&&(b.line={width:v("line.width",m,[0,10],p)}),f&&(x.tx="Aa",x.tp=v("textposition",m),x.ts=10,x.tc=v("textfont.color",m),x.tf=v("textfont.family",m)),r=[i.minExtend(l,x)],(a=i.minExtend(s,b)).selectedpoints=null,a.texttemplate=null}var w=n.select(this).select("g.legendpoints"),k=w.selectAll("path.scatterpts").data(u?r:[]);k.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform","translate(20,0)"),k.exit().remove(),k.call(o.pointStyle,a,e),u&&(r[0].mrc=3);var T=w.selectAll("g.pointtext").data(f?r:[]);T.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),T.exit().remove(),T.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(e.visible&&"candlestick"===e.type?[t,t]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each(function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],o=x(void 0,i.line,v,h);a.style("stroke-width",o+"px").call(l.fill,i.fillcolor),o&&l.stroke(a,i.line.color)})}).each(function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(e.visible&&"ohlc"===e.type?[t,t]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each(function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],s=x(void 0,i.line,v,h);a.style("fill","none").call(o.dashLine,i.line.dash,s),s&&l.stroke(a,i.line.color)})})}},{"../../lib":159,"../../registry":243,"../../traces/pie/helpers":275,"../../traces/pie/style_one":281,"../../traces/scatter/subtypes":307,"../color":42,"../colorscale/helpers":53,"../drawing":63,d3:7}],99:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/plots"),i=t("../../plots/cartesian/axis_ids"),o=t("../../lib"),l=t("../../fonts/ploticon"),s=o._,c=e.exports={};function u(t,e){var r,a,o=e.currentTarget,l=o.getAttribute("data-attr"),s=o.getAttribute("data-val")||!0,c=t._fullLayout,u={},f=i.list(t,null,!0),d=c._cartesianSpikesEnabled;if("zoom"===l){var p,h="in"===s?.5:2,g=(1+h)/2,v=(1-h)/2;for(a=0;a<f.length;a++)if(!(r=f[a]).fixedrange)if(p=r._name,"auto"===s)u[p+".autorange"]=!0;else if("reset"===s){if(void 0===r._rangeInitial)u[p+".autorange"]=!0;else{var m=r._rangeInitial.slice();u[p+".range[0]"]=m[0],u[p+".range[1]"]=m[1]}void 0!==r._showSpikeInitial&&(u[p+".showspikes"]=r._showSpikeInitial,"on"!==d||r._showSpikeInitial||(d="off"))}else{var y=[r.r2l(r.range[0]),r.r2l(r.range[1])],x=[g*y[0]+v*y[1],g*y[1]+v*y[0]];u[p+".range[0]"]=r.l2r(x[0]),u[p+".range[1]"]=r.l2r(x[1])}}else"hovermode"!==l||"x"!==s&&"y"!==s||(s=c._isHoriz?"y":"x",o.setAttribute("data-val",s)),u[l]=s;c._cartesianSpikesEnabled=d,n.call("_guiRelayout",t,u)}function f(t,e){for(var r=e.currentTarget,a=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,o=t._fullLayout._subplots.gl3d||[],l={},s=a.split("."),c=0;c<o.length;c++)l[o[c]+"."+s[1]]=i;var u="pan"===i?i:"zoom";l.dragmode=u,n.call("_guiRelayout",t,l)}function d(t,e){for(var r=e.currentTarget.getAttribute("data-attr"),a=t._fullLayout,i=a._subplots.gl3d||[],o={},l=0;l<i.length;l++){var s,c=i[l],u=c+".camera",f=c+".aspectratio",d=c+".aspectmode",p=a[c]._scene;"resetLastSave"===r?(o[u+".up"]=p.viewInitial.up,o[u+".eye"]=p.viewInitial.eye,o[u+".center"]=p.viewInitial.center,s=!0):"resetDefault"===r&&(o[u+".up"]=null,o[u+".eye"]=null,o[u+".center"]=null,s=!0),s&&(o[f+".x"]=p.viewInitial.aspectratio.x,o[f+".y"]=p.viewInitial.aspectratio.y,o[f+".z"]=p.viewInitial.aspectratio.z,o[d]=p.viewInitial.aspectmode)}n.call("_guiRelayout",t,o)}function p(t,e){var r=e.currentTarget,n=r._previousVal,a=t._fullLayout,i=a._subplots.gl3d||[],o=["xaxis","yaxis","zaxis"],l={},s={};if(n)s=n,r._previousVal=null;else{for(var c=0;c<i.length;c++){var u=i[c],f=a[u],d=u+".hovermode";l[d]=f.hovermode,s[d]=!1;for(var p=0;p<3;p++){var h=o[p],g=u+"."+h+".showspikes";s[g]=!1,l[g]=f[h].showspikes}}r._previousVal=l}return s}function h(t,e){for(var r=e.currentTarget,a=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,o=t._fullLayout,l=o._subplots.geo||[],s=0;s<l.length;s++){var c=l[s],u=o[c];if("zoom"===a){var f=u.projection.scale,d="in"===i?2*f:.5*f;n.call("_guiRelayout",t,c+".projection.scale",d)}}"reset"===a&&y(t,"geo")}function g(t){var e=t._fullLayout;return!e.hovermode&&(e._has("cartesian")?e._isHoriz?"y":"x":"closest")}function v(t){var e=g(t);n.call("_guiRelayout",t,"hovermode",e)}function m(t,e){for(var r=e.currentTarget.getAttribute("data-val"),a=t._fullLayout,i=a._subplots.mapbox||[],o={},l=0;l<i.length;l++){var s=i[l],c=a[s].zoom,u="in"===r?1.05*c:c/1.05;o[s+".zoom"]=u}n.call("_guiRelayout",t,o)}function y(t,e){for(var r=t._fullLayout,a=r._subplots[e]||[],i={},o=0;o<a.length;o++)for(var l=a[o],s=r[l]._subplot.viewInitial,c=Object.keys(s),u=0;u<c.length;u++){var f=c[u];i[l+"."+f]=s[f]}n.call("_guiRelayout",t,i)}c.toImage={name:"toImage",title:function(t){var e=(t._context.toImageButtonOptions||{}).format||"png";return s(t,"png"===e?"Download plot as a png":"Download plot")},icon:l.camera,click:function(t){var e=t._context.toImageButtonOptions,r={format:e.format||"png"};o.notifier(s(t,"Taking snapshot - this may take a few seconds"),"long"),"svg"!==r.format&&o.isIE()&&(o.notifier(s(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(s(t,"Snapshot succeeded")+" - "+e,"long")}).catch(function(){o.notifier(s(t,"Sorry, there was a problem downloading your snapshot!"),"long")})}},c.sendDataToCloud={name:"sendDataToCloud",title:function(t){return s(t,"Edit in Chart Studio")},icon:l.disk,click:function(t){a.sendDataToCloud(t)}},c.editInChartStudio={name:"editInChartStudio",title:function(t){return s(t,"Edit in Chart Studio")},icon:l.pencil,click:function(t){a.sendDataToCloud(t)}},c.zoom2d={name:"zoom2d",title:function(t){return s(t,"Zoom")},attr:"dragmode",val:"zoom",icon:l.zoombox,click:u},c.pan2d={name:"pan2d",title:function(t){return s(t,"Pan")},attr:"dragmode",val:"pan",icon:l.pan,click:u},c.select2d={name:"select2d",title:function(t){return s(t,"Box Select")},attr:"dragmode",val:"select",icon:l.selectbox,click:u},c.lasso2d={name:"lasso2d",title:function(t){return s(t,"Lasso Select")},attr:"dragmode",val:"lasso",icon:l.lasso,click:u},c.zoomIn2d={name:"zoomIn2d",title:function(t){return s(t,"Zoom in")},attr:"zoom",val:"in",icon:l.zoom_plus,click:u},c.zoomOut2d={name:"zoomOut2d",title:function(t){return s(t,"Zoom out")},attr:"zoom",val:"out",icon:l.zoom_minus,click:u},c.autoScale2d={name:"autoScale2d",title:function(t){return s(t,"Autoscale")},attr:"zoom",val:"auto",icon:l.autoscale,click:u},c.resetScale2d={name:"resetScale2d",title:function(t){return s(t,"Reset axes")},attr:"zoom",val:"reset",icon:l.home,click:u},c.hoverClosestCartesian={name:"hoverClosestCartesian",title:function(t){return s(t,"Show closest data on hover")},attr:"hovermode",val:"closest",icon:l.tooltip_basic,gravity:"ne",click:u},c.hoverCompareCartesian={name:"hoverCompareCartesian",title:function(t){return s(t,"Compare data on hover")},attr:"hovermode",val:function(t){return t._fullLayout._isHoriz?"y":"x"},icon:l.tooltip_compare,gravity:"ne",click:u},c.zoom3d={name:"zoom3d",title:function(t){return s(t,"Zoom")},attr:"scene.dragmode",val:"zoom",icon:l.zoombox,click:f},c.pan3d={name:"pan3d",title:function(t){return s(t,"Pan")},attr:"scene.dragmode",val:"pan",icon:l.pan,click:f},c.orbitRotation={name:"orbitRotation",title:function(t){return s(t,"Orbital rotation")},attr:"scene.dragmode",val:"orbit",icon:l["3d_rotate"],click:f},c.tableRotation={name:"tableRotation",title:function(t){return s(t,"Turntable rotation")},attr:"scene.dragmode",val:"turntable",icon:l["z-axis"],click:f},c.resetCameraDefault3d={name:"resetCameraDefault3d",title:function(t){return s(t,"Reset camera to default")},attr:"resetDefault",icon:l.home,click:d},c.resetCameraLastSave3d={name:"resetCameraLastSave3d",title:function(t){return s(t,"Reset camera to last save")},attr:"resetLastSave",icon:l.movie,click:d},c.hoverClosest3d={name:"hoverClosest3d",title:function(t){return s(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:l.tooltip_basic,gravity:"ne",click:function(t,e){var r=p(t,e);n.call("_guiRelayout",t,r)}},c.zoomInGeo={name:"zoomInGeo",title:function(t){return s(t,"Zoom in")},attr:"zoom",val:"in",icon:l.zoom_plus,click:h},c.zoomOutGeo={name:"zoomOutGeo",title:function(t){return s(t,"Zoom out")},attr:"zoom",val:"out",icon:l.zoom_minus,click:h},c.resetGeo={name:"resetGeo",title:function(t){return s(t,"Reset")},attr:"reset",val:null,icon:l.autoscale,click:h},c.hoverClosestGeo={name:"hoverClosestGeo",title:function(t){return s(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:l.tooltip_basic,gravity:"ne",click:v},c.hoverClosestGl2d={name:"hoverClosestGl2d",title:function(t){return s(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:l.tooltip_basic,gravity:"ne",click:v},c.hoverClosestPie={name:"hoverClosestPie",title:function(t){return s(t,"Toggle show closest data on hover")},attr:"hovermode",val:"closest",icon:l.tooltip_basic,gravity:"ne",click:v},c.resetViewSankey={name:"resetSankeyGroup",title:function(t){return s(t,"Reset view")},icon:l.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)}},c.toggleHover={name:"toggleHover",title:function(t){return s(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:l.tooltip_basic,gravity:"ne",click:function(t,e){var r=p(t,e);r.hovermode=g(t),n.call("_guiRelayout",t,r)}},c.resetViews={name:"resetViews",title:function(t){return s(t,"Reset views")},icon:l.home,click:function(t,e){var r=e.currentTarget;r.setAttribute("data-attr","zoom"),r.setAttribute("data-val","reset"),u(t,e),r.setAttribute("data-attr","resetLastSave"),d(t,e),y(t,"geo"),y(t,"mapbox")}},c.toggleSpikelines={name:"toggleSpikelines",title:function(t){return s(t,"Toggle Spike Lines")},icon:l.spikeline,attr:"_cartesianSpikesEnabled",val:"on",click:function(t){var e=t._fullLayout,r=e._cartesianSpikesEnabled;e._cartesianSpikesEnabled="on"===r?"off":"on",n.call("_guiRelayout",t,function(t){for(var e="on"===t._fullLayout._cartesianSpikesEnabled,r=i.list(t,null,!0),n={},a=0;a<r.length;a++){var o=r[a];n[o._name+".showspikes"]=!!e||o._showSpikeInitial}return n}(t))}},c.resetViewMapbox={name:"resetViewMapbox",title:function(t){return s(t,"Reset view")},attr:"reset",icon:l.home,click:function(t){y(t,"mapbox")}},c.zoomInMapbox={name:"zoomInMapbox",title:function(t){return s(t,"Zoom in")},attr:"zoom",val:"in",icon:l.zoom_plus,click:m},c.zoomOutMapbox={name:"zoomOutMapbox",title:function(t){return s(t,"Zoom out")},attr:"zoom",val:"out",icon:l.zoom_minus,click:m}},{"../../fonts/ploticon":143,"../../lib":159,"../../plots/cartesian/axis_ids":206,"../../plots/plots":235,"../../registry":243}],100:[function(t,e,r){"use strict";r.manage=t("./manage")},{"./manage":101}],101:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axis_ids"),a=t("../../traces/scatter/subtypes"),i=t("../../registry"),o=t("./modebar"),l=t("./buttons");e.exports=function(t){var e=t._fullLayout,r=t._context,s=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 c,u=r.modeBarButtons;c=Array.isArray(u)&&u.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===l[a])throw new Error(["*modeBarButtons* configuration options","invalid button name"].join(" "));t[e][n]=l[a]}}return t}(u):!r.displayModeBar&&r.watermark?[]:function(t){var e=t._fullLayout,r=t._fullData,o=t._context,s=o.modeBarButtonsToRemove,c=o.modeBarButtonsToAdd,u=e._has("cartesian"),f=e._has("gl3d"),d=e._has("geo"),p=e._has("pie"),h=e._has("funnelarea"),g=e._has("gl2d"),v=e._has("ternary"),m=e._has("mapbox"),y=e._has("polar"),x=e._has("sankey"),b=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),_=[];function w(t){if(t.length){for(var e=[],r=0;r<t.length;r++){var n=t[r];-1===s.indexOf(n)&&e.push(l[n])}_.push(e)}}var k=["toImage"];o.showEditInChartStudio?k.push("editInChartStudio"):o.showSendToCloud&&k.push("sendDataToCloud");w(k);var T=[],M=[],A=[],L=[];(u||g||p||h||v)+d+f+m+y>1?(M=["toggleHover"],A=["resetViews"]):d?(T=["zoomInGeo","zoomOutGeo"],M=["hoverClosestGeo"],A=["resetGeo"]):f?(M=["hoverClosest3d"],A=["resetCameraDefault3d","resetCameraLastSave3d"]):m?(T=["zoomInMapbox","zoomOutMapbox"],M=["toggleHover"],A=["resetViewMapbox"]):g?M=["hoverClosestGl2d"]:p?M=["hoverClosestPie"]:x?(M=["hoverClosestCartesian","hoverCompareCartesian"],A=["resetViewSankey"]):M=["toggleHover"];u&&(M=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(t){for(var e=0;e<t.length;e++)if(!i.traceIs(t[e],"noHover"))return!1;return!0})(r)&&(M=[]);!u&&!g||b||(T=["zoomIn2d","zoomOut2d","autoScale2d"],"resetViews"!==A[0]&&(A=["resetScale2d"]));f?L=["zoom3d","pan3d","orbitRotation","tableRotation"]:(u||g)&&!b||v?L=["zoom2d","pan2d"]:m||d?L=["pan2d"]:y&&(L=["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)&&L.push("select2d","lasso2d");return w(L),w(T.concat(A)),w(M),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}(_,c)}(t),s?s.update(t,c):e._modeBar=o(t,c)}else s&&(s.destroy(),delete e._modeBar)}},{"../../plots/cartesian/axis_ids":206,"../../registry":243,"../../traces/scatter/subtypes":307,"./buttons":99,"./modebar":102}],102:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../../lib"),o=t("../../fonts/ploticon"),l=new DOMParser;function s(t){this.container=t.container,this.element=document.createElement("div"),this.update(t.graphInfo,t.buttons),this.container.appendChild(this.element)}var c=s.prototype;c.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,l="hover"===r.displayModeBar?".js-plotly-plot .plotly:hover ":"";i.deleteRelatedStyleRule(a),i.addRelatedStyleRule(a,l+"#"+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 s=!this.hasButtons(e),c=this.hasLogo!==r.displaylogo,u=this.locale!==r.locale;if(this.locale=r.locale,(s||c||u)&&(this.removeAllButtons(),this.updateButtons(e),r.watermark||r.displaylogo)){var f=this.getLogo();r.watermark&&(f.className=f.className+" watermark"),"v"===n.modebar.orientation?this.element.insertBefore(f,this.element.childNodes[0]):this.element.appendChild(f),this.hasLogo=!0}this.updateActiveButton()},c.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)})},c.createGroup=function(){var t=document.createElement("div");return t.className="modebar-group",t},c.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 l=t.icon;return"function"==typeof l?r.appendChild(l()):r.appendChild(this.createIcon(l||o.question)),r.setAttribute("data-gravity",t.gravity||"n"),r},c.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)}t.svg&&(e=l.parseFromString(t.svg,"application/xml").childNodes[0]);return e.setAttribute("height","1em"),e.setAttribute("width","1em"),e},c.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"),l="true"===t.getAttribute("data-toggle"),s=n.select(t);if(l)o===r&&s.classed("active",!s.classed("active"));else{var c=null===o?o:i.nestedProperty(e,o).get();s.classed("active",c===a)}})},c.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},c.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},c.removeAllButtons=function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.hasLogo=!1},c.destroy=function(){i.removeElement(this.container.querySelector(".modebar")),i.deleteRelatedStyleRule(this._uid)},e.exports=function(t,e){var r=t._fullLayout,a=new s({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":143,"../../lib":159,d3:7,"fast-isnumeric":9}],103:[function(t,e,r){"use strict";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":193,"../../plots/font_attributes":229,"../color/attributes":41}],104:[function(t,e,r){"use strict";e.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}},{}],105:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../color"),i=t("../../plot_api/plot_template"),o=t("../../plots/array_container_defaults"),l=t("./attributes"),s=t("./constants");function c(t,e,r,a){var i=a.calendar;function o(r,a){return n.coerce(t,e,l.buttons,r,a)}if(o("visible")){var s=o("step");"all"!==s&&(!i||"gregorian"===i||"month"!==s&&"year"!==s?o("stepmode"):e.stepmode="backward",o("count")),o("label")}}e.exports=function(t,e,r,u,f){var d=t.rangeselector||{},p=i.newContainer(e,"rangeselector");function h(t,e){return n.coerce(d,p,l,t,e)}if(h("visible",o(d,p,{name:"buttons",handleItemDefaults:c,calendar:f}).length>0)){var g=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+s.yPad]}(e,r,u);h("x",g[0]),h("y",g[1]),n.noneOrAll(t,e,["x","y"]),h("xanchor"),h("yanchor"),n.coerceFont(h,"font",r.font);var v=h("bgcolor");h("activecolor",a.contrast(v,s.lightAmount,s.darkAmount)),h("bordercolor"),h("borderwidth")}}},{"../../lib":159,"../../plot_api/plot_template":193,"../../plots/array_container_defaults":199,"../color":42,"./attributes":103,"./constants":104}],106:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../plots/plots"),o=t("../color"),l=t("../drawing"),s=t("../../lib"),c=t("../../lib/svg_text_utils"),u=t("../../plots/cartesian/axis_ids"),f=t("../../constants/alignment"),d=f.LINE_SPACING,p=f.FROM_TL,h=f.FROM_BR,g=t("./constants"),v=t("./get_update_object");function m(t){return t._id}function y(t,e,r){var n=s.ensureSingle(t,"rect","selector-rect",function(t){t.attr("shape-rendering","crispEdges")});n.attr({rx:g.rx,ry:g.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 x(t,e,r,n){s.ensureSingle(t,"text","selector-text",function(t){t.classed("user-select-none",!0).attr("text-anchor","middle")}).call(l.font,e.font).text(function(t,e){if(t.label)return e?s.templateString(t.label,e):t.label;return"all"===t.step?"all":t.count+t.step.charAt(0)}(r,n._fullLayout._meta)).call(function(t){c.convertToTspans(t,n)})}e.exports=function(t){var e=t._fullLayout._infolayer.selectAll(".rangeselector").data(function(t){for(var e=u.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),m);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,u=o.rangeselector,f=r.selectAll("g.button").data(s.filterVisible(u.buttons));f.enter().append("g").classed("button",!0),f.exit().remove(),f.each(function(e){var r=n.select(this),i=v(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(y,u,e),r.call(x,u,e,t),r.on("click",function(){t._dragged||a.call("_guiRelayout",t,i)}),r.on("mouseover",function(){e._isHovered=!0,r.call(y,u,e)}),r.on("mouseout",function(){e._isHovered=!1,r.call(y,u,e)})}),function(t,e,r,a,o){var u=0,f=0,v=r.borderwidth;e.each(function(){var t=n.select(this),e=t.select(".selector-text"),a=r.font.size*d,i=Math.max(a*c.lineCount(e),16)+3;f=Math.max(f,i)}),e.each(function(){var t=n.select(this),e=t.select(".selector-rect"),a=t.select(".selector-text"),i=a.node()&&l.bBox(a.node()).width,o=r.font.size*d,s=c.lineCount(a),p=Math.max(i+10,g.minButtonWidth);t.attr("transform","translate("+(v+u)+","+v+")"),e.attr({x:0,y:0,width:p,height:f}),c.positionText(a,p/2,f/2-(s-1)*o/2+3),u+=p+5});var m=t._fullLayout._size,y=m.l+m.w*r.x,x=m.t+m.h*(1-r.y),b="left";s.isRightAnchor(r)&&(y-=u,b="right");s.isCenterAnchor(r)&&(y-=u/2,b="center");var _="top";s.isBottomAnchor(r)&&(x-=f,_="bottom");s.isMiddleAnchor(r)&&(x-=f/2,_="middle");u=Math.ceil(u),f=Math.ceil(f),y=Math.round(y),x=Math.round(x),i.autoMargin(t,a+"-range-selector",{x:r.x,y:r.y,l:u*p[b],r:u*h[b],b:f*h[_],t:f*p[_]}),o.attr("transform","translate("+y+","+x+")")}(t,f,u,o._name,r)})}},{"../../constants/alignment":136,"../../lib":159,"../../lib/svg_text_utils":180,"../../plots/cartesian/axis_ids":206,"../../plots/plots":235,"../../registry":243,"../color":42,"../drawing":63,"./constants":104,"./get_update_object":107,d3:7}],107:[function(t,e,r){"use strict";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,l=e.count;switch(e.stepmode){case"backward":r=t.l2r(+n.time[o].utc.offset(i,-l));break;case"todate":var s=n.time[o].utc.offset(i,-l);r=t.l2r(+n.time[o].utc.ceil(s))}var c=a[1];return[r,c]}(t,e);a[r+".range[0]"]=i[0],a[r+".range[1]"]=i[1]}return a}},{d3:7}],108:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"rangeselector",schema:{subplots:{xaxis:{rangeselector:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":103,"./defaults":105,"./draw":106}],109:[function(t,e,r){"use strict";var n=t("../color/attributes");e.exports={bgcolor:{valType:"color",dflt:n.background,editType:"plot"},bordercolor:{valType:"color",dflt:n.defaultLine,editType:"plot"},borderwidth:{valType:"integer",dflt:0,min:0,editType:"plot"},autorange:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},range:{valType:"info_array",items:[{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}}],editType:"calc",impliedEdits:{autorange:!1}},thickness:{valType:"number",dflt:.15,min:0,max:1,editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"}},{"../color/attributes":41}],110:[function(t,e,r){"use strict";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],l=o[i.name];l&&l.visible&&l.autorange&&(l._input.autorange=!0,l._input.range=l.range=a(t,o))}}},{"../../plots/cartesian/autorange":202,"../../plots/cartesian/axis_ids":206,"./constants":111}],111:[function(t,e,r){"use strict";e.exports={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskMinOppAxisClassName:"rangeslider-mask-min-opp-axis",maskMaxOppAxisClassName:"rangeslider-mask-max-opp-axis",maskColor:"rgba(0,0,0,0.4)",maskOppAxisColor:"rgba(0,0,0,0.2)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}},{}],112:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plot_api/plot_template"),i=t("../../plots/cartesian/axis_ids"),o=t("./attributes"),l=t("./oppaxis_attributes");e.exports=function(t,e,r){var s=t[r],c=e[r];if(s.rangeslider||e._requestRangeslider[c._id]){n.isPlainObject(s.rangeslider)||(s.rangeslider={});var u,f,d=s.rangeslider,p=a.newContainer(c,"rangeslider");if(_("visible")){_("bgcolor",e.plot_bgcolor),_("bordercolor"),_("borderwidth"),_("thickness"),_("autorange",!c.isValidRange(d.range)),_("range");var h=e._subplots;if(h)for(var g=h.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)}),v=n.simpleMap(g,i.id2name),m=0;m<v.length;m++){var y=v[m];u=d[y]||{},f=a.newContainer(p,y,"yaxis");var x,b=e[y];u.range&&b.isValidRange(u.range)&&(x="fixed"),"match"!==w("rangemode",x)&&w("range",b.range.slice())}p._input=d}}function _(t,e){return n.coerce(d,p,o,t,e)}function w(t,e){return n.coerce(u,f,l,t,e)}}},{"../../lib":159,"../../plot_api/plot_template":193,"../../plots/cartesian/axis_ids":206,"./attributes":109,"./oppaxis_attributes":116}],113:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../plots/plots"),o=t("../../lib"),l=t("../drawing"),s=t("../color"),c=t("../titles"),u=t("../../plots/cartesian"),f=t("../../plots/cartesian/axis_ids"),d=t("../dragelement"),p=t("../../lib/setcursor"),h=t("./constants");function g(t,e,r,n){var a=o.ensureSingle(t,"rect",h.bgClassName,function(t){t.attr({x:0,y:0,"shape-rendering":"crispEdges"})}),i=n.borderwidth%2==0?n.borderwidth:n.borderwidth-1,s=-n._offsetShift,c=l.crispRound(e,n.borderwidth);a.attr({width:n._width+i,height:n._height+i,transform:"translate("+s+","+s+")",fill:n.bgcolor,stroke:n.bordercolor,"stroke-width":c})}function v(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 m(t,e,r,a){var s,c=e.calcdata,d=t.selectAll("g."+h.rangePlotClassName).data(r._subplotsWith,o.identity);d.enter().append("g").attr("class",function(t){return h.rangePlotClassName+" "+t}).call(l.setClipUrl,a._clipId,e),d.order(),d.exit().remove(),d.each(function(t,o){var l=n.select(this),d=0===o,p=f.getFromId(e,t,"y"),h=p._name,g=a[h],v={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};v.layout[h]={type:p.type,domain:[0,1],range:"match"!==g.rangemode?g.range.slice():p.range.slice(),calendar:p.calendar},i.supplyDefaults(v);var m=v._fullLayout.xaxis,y=v._fullLayout[h];m.clearCalc(),m.setScale(),y.clearCalc(),y.setScale();var x={id:t,plotgroup:l,xaxis:m,yaxis:y,isRangePlot:!0};d?s=x:(x.mainplot="xy",x.mainplotinfo=s),u.rangePlot(e,x,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}(c,t))})}function y(t,e,r,n,a){(o.ensureSingle(t,"rect",h.maskMinClassName,function(t){t.attr({x:0,y:0,"shape-rendering":"crispEdges"})}).attr("height",n._height).call(s.fill,h.maskColor),o.ensureSingle(t,"rect",h.maskMaxClassName,function(t){t.attr({y:0,"shape-rendering":"crispEdges"})}).attr("height",n._height).call(s.fill,h.maskColor),"match"!==a.rangemode)&&(o.ensureSingle(t,"rect",h.maskMinOppAxisClassName,function(t){t.attr({y:0,"shape-rendering":"crispEdges"})}).attr("width",n._width).call(s.fill,h.maskOppAxisColor),o.ensureSingle(t,"rect",h.maskMaxOppAxisClassName,function(t){t.attr({y:0,"shape-rendering":"crispEdges"})}).attr("width",n._width).style("border-top",h.maskOppBorder).call(s.fill,h.maskOppAxisColor))}function x(t,e,r,n){e._context.staticPlot||o.ensureSingle(t,"rect",h.slideBoxClassName,function(t){t.attr({y:0,cursor:h.slideBoxCursor,"shape-rendering":"crispEdges"})}).attr({height:n._height,fill:h.slideBoxFill})}function b(t,e,r,n){var a=o.ensureSingle(t,"g",h.grabberMinClassName),i=o.ensureSingle(t,"g",h.grabberMaxClassName),l={x:0,width:h.handleWidth,rx:h.handleRadius,fill:s.background,stroke:s.defaultLine,"stroke-width":h.handleStrokeWidth,"shape-rendering":"crispEdges"},c={y:Math.round(n._height/4),height:Math.round(n._height/2)};if(o.ensureSingle(a,"rect",h.handleMinClassName,function(t){t.attr(l)}).attr(c),o.ensureSingle(i,"rect",h.handleMaxClassName,function(t){t.attr(l)}).attr(c),!e._context.staticPlot){var u={width:h.grabAreaWidth,x:0,y:0,fill:h.grabAreaFill,cursor:h.grabAreaCursor};o.ensureSingle(a,"rect",h.grabAreaMinClassName,function(t){t.attr(u)}).attr("height",n._height),o.ensureSingle(i,"rect",h.grabAreaMaxClassName,function(t){t.attr(u)}).attr("height",n._height)}}e.exports=function(t){for(var e=t._fullLayout,r=e._rangeSliderData,i=0;i<r.length;i++){var l=r[i][h.name];l._clipId=l._id+"-"+e._uid}var s=e._infolayer.selectAll("g."+h.containerClassName).data(r,function(t){return t._name});s.exit().each(function(t){var r=t[h.name];e._topdefs.select("#"+r._clipId).remove()}).remove(),0!==r.length&&(s.enter().append("g").classed(h.containerClassName,!0).attr("pointer-events","all"),s.each(function(r){var i=n.select(this),l=r[h.name],s=e[f.id2name(r.anchor)],u=l[f.id2name(r.anchor)];if(l.range){var _,w=o.simpleMap(l.range,r.r2l),k=o.simpleMap(r.range,r.r2l);_=k[0]<k[1]?[Math.min(w[0],k[0]),Math.max(w[1],k[1])]:[Math.max(w[0],k[0]),Math.min(w[1],k[1])],l.range=l._input.range=o.simpleMap(_,r.l2r)}r.cleanRange("rangeslider.range");var T=e._size,M=r.domain;l._width=T.w*(M[1]-M[0]);var A=Math.round(T.l+T.w*M[0]),L=Math.round(T.t+T.h*(1-r._counterDomainMin)+("bottom"===r.side?r._depth:0)+l._offsetShift+h.extraPad);i.attr("transform","translate("+A+","+L+")");var S=r.r2l(l.range[0]),C=r.r2l(l.range[1]),O=C-S;if(l.p2d=function(t){return t/l._width*O+S},l.d2p=function(t){return(t-S)/O*l._width},l._rl=[S,C],"match"!==u.rangemode){var P=s.r2l(u.range[0]),D=s.r2l(u.range[1])-P;l.d2pOppAxis=function(t){return(t-P)/D*l._height}}i.call(g,t,r,l).call(v,t,r,l).call(m,t,r,l).call(y,t,r,l,u).call(x,t,r,l).call(b,t,r,l),function(t,e,r,i){var l=t.select("rect."+h.slideBoxClassName).node(),s=t.select("rect."+h.grabAreaMinClassName).node(),c=t.select("rect."+h.grabAreaMaxClassName).node();t.on("mousedown",function(){var u=n.event,f=u.target,h=u.clientX,g=h-t.node().getBoundingClientRect().left,v=i.d2p(r._rl[0]),m=i.d2p(r._rl[1]),y=d.coverSlip();function x(t){var u,d,x,b=+t.clientX-h;switch(f){case l:x="ew-resize",u=v+b,d=m+b;break;case s:x="col-resize",u=v+b,d=m;break;case c:x="col-resize",u=v,d=m+b;break;default:x="ew-resize",u=g,d=g+b}if(d<u){var _=d;d=u,u=_}i._pixelMin=u,i._pixelMax=d,p(n.select(y),x),function(t,e,r,n){function i(t){return r.l2r(o.constrain(t,n._rl[0],n._rl[1]))}var l=i(n.p2d(n._pixelMin)),s=i(n.p2d(n._pixelMax));window.requestAnimationFrame(function(){a.call("_guiRelayout",e,r._name+".range",[l,s])})}(0,e,r,i)}y.addEventListener("mousemove",x),y.addEventListener("mouseup",function t(){y.removeEventListener("mousemove",x);y.removeEventListener("mouseup",t);o.removeElement(y)})})}(i,t,r,l),function(t,e,r,n,a,i){var l=h.handleWidth/2;function s(t){return o.constrain(t,0,n._width)}function c(t){return o.constrain(t,0,n._height)}function u(t){return o.constrain(t,-l,n._width+l)}var f=s(n.d2p(r._rl[0])),d=s(n.d2p(r._rl[1]));if(t.select("rect."+h.slideBoxClassName).attr("x",f).attr("width",d-f),t.select("rect."+h.maskMinClassName).attr("width",f),t.select("rect."+h.maskMaxClassName).attr("x",d).attr("width",n._width-d),"match"!==i.rangemode){var p=n._height-c(n.d2pOppAxis(a._rl[1])),g=n._height-c(n.d2pOppAxis(a._rl[0]));t.select("rect."+h.maskMinOppAxisClassName).attr("x",f).attr("height",p).attr("width",d-f),t.select("rect."+h.maskMaxOppAxisClassName).attr("x",f).attr("y",g).attr("height",n._height-g).attr("width",d-f),t.select("rect."+h.slideBoxClassName).attr("y",p).attr("height",g-p)}var v=Math.round(u(f-l))-.5,m=Math.round(u(d-l))+.5;t.select("g."+h.grabberMinClassName).attr("transform","translate("+v+",0.5)"),t.select("g."+h.grabberMaxClassName).attr("transform","translate("+m+",0.5)")}(i,0,r,l,s,u),"bottom"===r.side&&c.draw(t,r._id+"title",{propContainer:r,propName:r._name+".title",placeholder:e._dfltTitle.x,attributes:{x:r._offset+r._length/2,y:L+l._height+l._offsetShift+10+1.5*r.title.font.size,"text-anchor":"middle"}})}))}},{"../../lib":159,"../../lib/setcursor":178,"../../plots/cartesian":214,"../../plots/cartesian/axis_ids":206,"../../plots/plots":235,"../../registry":243,"../color":42,"../dragelement":60,"../drawing":63,"../titles":129,"./constants":111,d3:7}],114:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axis_ids"),a=t("../../lib/svg_text_utils"),i=t("./constants"),o=t("../../constants/alignment").LINE_SPACING,l=i.name;function s(t){var e=t&&t[l];return e&&e.visible}r.isVisible=s,r.makeData=function(t){var e=n.list({_fullLayout:t},"x",!0),r=t.margin,a=[];if(!t._has("gl2d"))for(var i=0;i<e.length;i++){var o=e[i];if(s(o)){a.push(o);var c=o[l];c._id=l+o._id,c._height=(t.height-r.b-r.t)*c.thickness,c._offsetShift=Math.floor(c.borderwidth/2)}}t._rangeSliderData=a},r.autoMarginOpts=function(t,e){var r=t._fullLayout,n=e[l],s=e._id.charAt(0),c=0,u=0;"bottom"===e.side&&(c=e._depth,e.title.text!==r._dfltTitle[s]&&(u=1.5*e.title.font.size+10+n._offsetShift,u+=(e.title.text.match(a.BR_TAG_ALL)||[]).length*e.title.font.size*o));return{x:0,y:e._counterDomainMin,l:0,r:0,t:0,b:n._height+c+Math.max(r.margin.b,u),pad:i.extraPad+2*n._offsetShift}}},{"../../constants/alignment":136,"../../lib/svg_text_utils":180,"../../plots/cartesian/axis_ids":206,"./constants":111}],115:[function(t,e,r){"use strict";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":159,"./attributes":109,"./calc_autorange":110,"./defaults":112,"./draw":113,"./helpers":114,"./oppaxis_attributes":116}],116:[function(t,e,r){"use strict";e.exports={_isSubplotObj:!0,rangemode:{valType:"enumerated",values:["auto","fixed","match"],dflt:"match",editType:"calc"},range:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},editType:"calc"}},{}],117:[function(t,e,r){"use strict";var n=t("../annotations/attributes"),a=t("../../traces/scatter/attributes").line,i=t("../drawing/attributes").dash,o=t("../../lib/extend").extendFlat,l=t("../../plot_api/plot_template").templatedArray;e.exports=l("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":154,"../../plot_api/plot_template":193,"../../traces/scatter/attributes":283,"../annotations/attributes":27,"../drawing/attributes":62}],118:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("./constants"),o=t("./helpers");function l(t){return c(t.line.width,t.xsizemode,t.x0,t.x1,t.path,!1)}function s(t){return c(t.line.width,t.ysizemode,t.y0,t.y1,t.path,!0)}function c(t,e,r,a,l,s){var c=t/2,u=s;if("pixel"===e){var f=l?o.extractPathCoords(l,s?i.paramIsY:i.paramIsX):[r,a],d=n.aggNums(Math.max,null,f),p=n.aggNums(Math.min,null,f),h=p<0?Math.abs(p)+c:c,g=d>0?d+c:c;return{ppad:c,ppadplus:u?h:g,ppadminus:u?g:h}}return{ppad:c}}function u(t,e,r,n,a){var l="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[l(e),l(r)];if(n){var s,c,u,f,d=1/0,p=-1/0,h=n.match(i.segmentRE);for("date"===t.type&&(l=o.decodeDate(l)),s=0;s<h.length;s++)void 0!==(c=a[h[s].charAt(0)].drawn)&&(!(u=h[s].substr(1).match(i.paramRE))||u.length<c||((f=l(u[c]))<d&&(d=f),f>p&&(p=f)));return p>=d?[d,p]: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 c,f,d=r[o];if(d._extremes={},"paper"!==d.xref){var p="pixel"===d.xsizemode?d.xanchor:d.x0,h="pixel"===d.xsizemode?d.xanchor:d.x1;(f=u(c=a.getFromId(t,d.xref),p,h,d.path,i.paramIsX))&&(d._extremes[c._id]=a.findExtremes(c,f,l(d)))}if("paper"!==d.yref){var g="pixel"===d.ysizemode?d.yanchor:d.y0,v="pixel"===d.ysizemode?d.yanchor:d.y1;(f=u(c=a.getFromId(t,d.yref),g,v,d.path,i.paramIsY))&&(d._extremes[c._id]=a.findExtremes(c,f,s(d)))}}}},{"../../lib":159,"../../plots/cartesian/axes":203,"./constants":119,"./helpers":122}],119:[function(t,e,r){"use strict";e.exports={segmentRE:/[MLHVQCTSZ][^MLHVQCTSZ]*/g,paramRE:/[^\s,]+/g,paramIsX:{M:{0:!0,drawn:0},L:{0:!0,drawn:0},H:{0:!0,drawn:0},V:{},Q:{0:!0,2:!0,drawn:2},C:{0:!0,2:!0,4:!0,drawn:4},T:{0:!0,drawn:0},S:{0:!0,2:!0,drawn:2},Z:{}},paramIsY:{M:{1:!0,drawn:1},L:{1:!0,drawn:1},H:{},V:{0:!0,drawn:0},Q:{1:!0,3:!0,drawn:3},C:{1:!0,3:!0,5:!0,drawn:5},T:{1:!0,drawn:1},S:{1:!0,3:!0,drawn:5},Z:{}},numParams:{M:2,L:2,H:1,V:1,Q:4,C:6,T:2,S:4,Z:0}}},{}],120:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../../plots/array_container_defaults"),o=t("./attributes"),l=t("./helpers");function s(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 s=i("type",t.path?"path":"rect"),c=i("xsizemode"),u=i("ysizemode"),f=["x","y"],d=0;d<2;d++){var p,h,g,v=f[d],m=v+"anchor",y="x"===v?c:u,x={_fullLayout:r},b=a.coerceRef(t,e,x,v,"","paper");if("paper"!==b?((p=a.getFromId(x,b))._shapeIndices.push(e._index),g=l.rangeToShapePosition(p),h=l.shapePositionToRange(p)):h=g=n.identity,"path"!==s){var _=v+"0",w=v+"1",k=t[_],T=t[w];t[_]=h(t[_],!0),t[w]=h(t[w],!0),"pixel"===y?(i(_,0),i(w,10)):(a.coercePosition(e,x,i,b,_,.25),a.coercePosition(e,x,i,b,w,.75)),e[_]=g(e[_]),e[w]=g(e[w]),t[_]=k,t[w]=T}if("pixel"===y){var M=t[m];t[m]=h(t[m],!0),a.coercePosition(e,x,i,b,m,.25),e[m]=g(e[m]),t[m]=M}}"path"===s?i("path"):n.noneOrAll(t,e,["x0","x1","y0","y1"])}}e.exports=function(t,e){i(t,e,{name:"shapes",handleItemDefaults:s})}},{"../../lib":159,"../../plots/array_container_defaults":199,"../../plots/cartesian/axes":203,"./attributes":117,"./helpers":122}],121:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("../../plots/cartesian/axes"),o=t("../color"),l=t("../drawing"),s=t("../../plot_api/plot_template").arrayEditor,c=t("../dragelement"),u=t("../../lib/setcursor"),f=t("./constants"),d=t("./helpers");function p(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)m(t._fullLayout._shapeUpperLayer);else if("paper"===r.xref||"paper"===r.yref)m(t._fullLayout._shapeLowerLayer);else{var p=t._fullLayout._plots[r.xref+r.yref];if(p)m((p.mainplotinfo||p).shapelayer);else m(t._fullLayout._shapeLowerLayer)}function m(p){var m={"data-index":e,"fill-rule":"evenodd",d:g(t,r)},y=r.line.width?r.line.color:"rgba(0,0,0,0)",x=p.append("path").attr(m).style("opacity",r.opacity).call(o.stroke,y).call(o.fill,r.fillcolor).call(l.dashLine,r.line.dash,r.line.width);h(x,t,r),t._context.edits.shapePosition&&function(t,e,r,o,p){var m,y,x,b,_,w,k,T,M,A,L,S,C,O,P,D,z=10,R=10,E="pixel"===r.xsizemode,I="pixel"===r.ysizemode,F="line"===r.type,N="path"===r.type,j=s(t.layout,"shapes",r),B=j.modifyItem,H=i.getFromId(t,r.xref),V=i.getFromId(t,r.yref),q=d.getDataToPixel(t,H),U=d.getDataToPixel(t,V,!0),G=d.getPixelToData(t,H),Z=d.getPixelToData(t,V,!0),X=F?function(){var t=Math.max(r.line.width,10),n=p.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:E?q(r.xanchor)+r.x0:q(r.x0),cy:I?U(r.yanchor)-r.y0:U(r.y0),r:i}).style(a).classed("cursor-grab",!0),n.append("circle").attr({"data-line-point":"end-point",cx:E?q(r.xanchor)+r.x1:q(r.x1),cy:I?U(r.yanchor)-r.y1:U(r.y1),r:i}).style(a).classed("cursor-grab",!0),n}():e,Y={element:X.node(),gd:t,prepFn:function(n){E&&(_=q(r.xanchor));I&&(w=U(r.yanchor));"path"===r.type?P=r.path:(m=E?r.x0:q(r.x0),y=I?r.y0:U(r.y0),x=E?r.x1:q(r.x1),b=I?r.y1:U(r.y1));m<x?(M=m,C="x0",A=x,O="x1"):(M=x,C="x1",A=m,O="x0");!I&&y<b||I&&y>b?(k=y,L="y0",T=b,S="y1"):(k=b,L="y1",T=y,S="y0");W(n),J(p,r),function(t,e,r){var n=e.xref,a=e.yref,o=i.getFromId(r,n),s=i.getFromId(r,a),c="";"paper"===n||o.autorange||(c+=n);"paper"===a||s.autorange||(c+=a);l.setClipUrl(t,c?"clip"+r._fullLayout._uid+c:null,r)}(e,r,t),Y.moveFn="move"===D?$:Q},doneFn:function(){u(e),K(p),h(e,t,r),n.call("_guiRelayout",t,j.getUpdateObj())},clickFn:function(){K(p)}};function W(t){if(F)D="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=Y.element.getBoundingClientRect(),n=r.right-r.left,a=r.bottom-r.top,i=t.clientX-r.left,o=t.clientY-r.top,l=!N&&n>z&&a>R&&!t.shiftKey?c.getCursor(i/n,1-o/a):"move";u(e,l),D=l.split("-")[0]}}function $(n,a){if("path"===r.type){var i=function(t){return t},o=i,l=i;E?B("xanchor",r.xanchor=G(_+n)):(o=function(t){return G(q(t)+n)},H&&"date"===H.type&&(o=d.encodeDate(o))),I?B("yanchor",r.yanchor=Z(w+a)):(l=function(t){return Z(U(t)+a)},V&&"date"===V.type&&(l=d.encodeDate(l))),B("path",r.path=v(P,o,l))}else E?B("xanchor",r.xanchor=G(_+n)):(B("x0",r.x0=G(m+n)),B("x1",r.x1=G(x+n))),I?B("yanchor",r.yanchor=Z(w+a)):(B("y0",r.y0=Z(y+a)),B("y1",r.y1=Z(b+a)));e.attr("d",g(t,r)),J(p,r)}function Q(n,a){if(N){var i=function(t){return t},o=i,l=i;E?B("xanchor",r.xanchor=G(_+n)):(o=function(t){return G(q(t)+n)},H&&"date"===H.type&&(o=d.encodeDate(o))),I?B("yanchor",r.yanchor=Z(w+a)):(l=function(t){return Z(U(t)+a)},V&&"date"===V.type&&(l=d.encodeDate(l))),B("path",r.path=v(P,o,l))}else if(F){if("resize-over-start-point"===D){var s=m+n,c=I?y-a:y+a;B("x0",r.x0=E?s:G(s)),B("y0",r.y0=I?c:Z(c))}else if("resize-over-end-point"===D){var u=x+n,f=I?b-a:b+a;B("x1",r.x1=E?u:G(u)),B("y1",r.y1=I?f:Z(f))}}else{var h=~D.indexOf("n")?k+a:k,j=~D.indexOf("s")?T+a:T,X=~D.indexOf("w")?M+n:M,Y=~D.indexOf("e")?A+n:A;~D.indexOf("n")&&I&&(h=k-a),~D.indexOf("s")&&I&&(j=T-a),(!I&&j-h>R||I&&h-j>R)&&(B(L,r[L]=I?h:Z(h)),B(S,r[S]=I?j:Z(j))),Y-X>z&&(B(C,r[C]=E?X:G(X)),B(O,r[O]=E?Y:G(Y)))}e.attr("d",g(t,r)),J(p,r)}function J(t,e){(E||I)&&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=q(E?e.xanchor:a.midRange(r?[e.x0,e.x1]:d.extractPathCoords(e.path,f.paramIsX))),o=U(I?e.yanchor:a.midRange(r?[e.y0,e.y1]:d.extractPathCoords(e.path,f.paramIsY)));if(i=d.roundPositionForSharpStrokeRendering(i,1),o=d.roundPositionForSharpStrokeRendering(o,1),E&&I){var l="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",l)}else if(E){var s="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",s)}else{var c="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function K(t){t.selectAll(".visual-cue").remove()}c.init(Y),X.node().onmousemove=W}(t,x,r,e,p)}}function h(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"");l.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function g(t,e){var r,n,o,l,s,c,u,p,h=e.type,g=i.getFromId(t,e.xref),v=i.getFromId(t,e.yref),m=t._fullLayout._size;if(g?(r=d.shapePositionToRange(g),n=function(t){return g._offset+g.r2p(r(t,!0))}):n=function(t){return m.l+m.w*t},v?(o=d.shapePositionToRange(v),l=function(t){return v._offset+v.r2p(o(t,!0))}):l=function(t){return m.t+m.h*(1-t)},"path"===h)return g&&"date"===g.type&&(n=d.decodeDate(n)),v&&"date"===v.type&&(l=d.decodeDate(l)),function(t,e,r){var n=t.path,i=t.xsizemode,o=t.ysizemode,l=t.xanchor,s=t.yanchor;return n.replace(f.segmentRE,function(t){var n=0,c=t.charAt(0),u=f.paramIsX[c],d=f.paramIsY[c],p=f.numParams[c],h=t.substr(1).replace(f.paramRE,function(t){return u[n]?t="pixel"===i?e(l)+Number(t):e(t):d[n]&&(t="pixel"===o?r(s)-Number(t):r(t)),++n>p&&(t="X"),t});return n>p&&(h=h.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+t)),c+h})}(e,n,l);if("pixel"===e.xsizemode){var y=n(e.xanchor);s=y+e.x0,c=y+e.x1}else s=n(e.x0),c=n(e.x1);if("pixel"===e.ysizemode){var x=l(e.yanchor);u=x-e.y0,p=x-e.y1}else u=l(e.y0),p=l(e.y1);if("line"===h)return"M"+s+","+u+"L"+c+","+p;if("rect"===h)return"M"+s+","+u+"H"+c+"V"+p+"H"+s+"Z";var b=(s+c)/2,_=(u+p)/2,w=Math.abs(b-s),k=Math.abs(_-u),T="A"+w+","+k,M=b+w+","+_;return"M"+M+T+" 0 1,1 "+(b+","+(_-k))+T+" 0 0,1 "+M+"Z"}function v(t,e,r){return t.replace(f.segmentRE,function(t){var n=0,a=t.charAt(0),i=f.paramIsX[a],o=f.paramIsY[a],l=f.numParams[a];return a+t.substr(1).replace(f.paramRE,function(t){return n>=l?t:(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&&p(t,a)},drawOne:p}},{"../../lib":159,"../../lib/setcursor":178,"../../plot_api/plot_template":193,"../../plots/cartesian/axes":203,"../../registry":243,"../color":42,"../dragelement":60,"../drawing":63,"./constants":119,"./helpers":122}],122:[function(t,e,r){"use strict";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":159,"./constants":119}],123:[function(t,e,r){"use strict";var n=t("./draw");e.exports={moduleType:"component",name:"shapes",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),includeBasePlot:t("../../plots/cartesian/include_components")("shapes"),calcAutorange:t("./calc_autorange"),draw:n.draw,drawOne:n.drawOne}},{"../../plots/cartesian/include_components":213,"./attributes":117,"./calc_autorange":118,"./defaults":120,"./draw":121}],124:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../../plots/pad_attributes"),i=t("../../lib/extend").extendDeepAll,o=t("../../plot_api/edit_types").overrideAll,l=t("../../plots/animation_attributes"),s=t("../../plot_api/plot_template").templatedArray,c=t("./constants"),u=s("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(s("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:u,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad: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:l.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:c.gripBgActiveColor},bgcolor:{valType:"color",dflt:c.railBgColor},bordercolor:{valType:"color",dflt:c.railBorderColor},borderwidth:{valType:"number",min:0,dflt:c.railBorderWidth},ticklen:{valType:"number",min:0,dflt:c.tickLength},tickcolor:{valType:"color",dflt:c.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:c.minorTickLength}}),"arraydraw","from-root")},{"../../lib/extend":154,"../../plot_api/edit_types":186,"../../plot_api/plot_template":193,"../../plots/animation_attributes":198,"../../plots/font_attributes":229,"../../plots/pad_attributes":234,"./constants":125}],125:[function(t,e,r){"use strict";e.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},{}],126:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/array_container_defaults"),i=t("./attributes"),o=t("./constants").name,l=i.steps;function s(t,e,r){function o(r,a){return n.coerce(t,e,i,r,a)}for(var l=a(t,e,{name:"steps",handleItemDefaults:c}),s=0,u=0;u<l.length;u++)l[u].visible&&s++;if(s<2?e.visible=!1:o("visible")){e._stepCount=s;var f=e._visibleSteps=n.filterVisible(l);(l[o("active")]||{}).visible||(e.active=f[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 c(t,e){function r(r,a){return n.coerce(t,e,l,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:s})}},{"../../lib":159,"../../plots/array_container_defaults":199,"./attributes":124,"./constants":125}],127:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plots/plots"),i=t("../color"),o=t("../drawing"),l=t("../../lib"),s=t("../../lib/svg_text_utils"),c=t("../../plot_api/plot_template").arrayEditor,u=t("./constants"),f=t("../../constants/alignment"),d=f.LINE_SPACING,p=f.FROM_TL,h=f.FROM_BR;function g(t){return u.autoMarginIdRoot+t._index}function v(t){return t._index}function m(t,e){var r=o.tester.selectAll("g."+u.labelGroupClass).data(e._visibleSteps);r.enter().append("g").classed(u.labelGroupClass,!0);var i=0,c=0;r.each(function(t){var r=b(n.select(this),{step:t},e).node();if(r){var a=o.bBox(r);c=Math.max(c,a.height),i=Math.max(i,a.width)}}),r.remove();var f=e._dims={};f.inputAreaWidth=Math.max(u.railWidth,u.gripHeight);var d=t._fullLayout._size;f.lx=d.l+d.w*e.x,f.ly=d.t+d.h*(1-e.y),"fraction"===e.lenmode?f.outerLength=Math.round(d.w*e.len):f.outerLength=e.len,f.inputAreaStart=0,f.inputAreaLength=Math.round(f.outerLength-e.pad.l-e.pad.r);var v=(f.inputAreaLength-2*u.stepInset)/(e._stepCount-1),m=i+u.labelPadding;if(f.labelStride=Math.max(1,Math.ceil(m/v)),f.labelHeight=c,f.currentValueMaxWidth=0,f.currentValueHeight=0,f.currentValueTotalHeight=0,f.currentValueMaxLines=1,e.currentvalue.visible){var x=o.tester.append("g");r.each(function(t){var r=y(x,e,t.label),n=r.node()&&o.bBox(r.node())||{width:0,height:0},a=s.lineCount(r);f.currentValueMaxWidth=Math.max(f.currentValueMaxWidth,Math.ceil(n.width)),f.currentValueHeight=Math.max(f.currentValueHeight,Math.ceil(n.height)),f.currentValueMaxLines=Math.max(f.currentValueMaxLines,a)}),f.currentValueTotalHeight=f.currentValueHeight+e.currentvalue.offset,x.remove()}f.height=f.currentValueTotalHeight+u.tickOffset+e.ticklen+u.labelOffset+f.labelHeight+e.pad.t+e.pad.b;var _="left";l.isRightAnchor(e)&&(f.lx-=f.outerLength,_="right"),l.isCenterAnchor(e)&&(f.lx-=f.outerLength/2,_="center");var w="top";l.isBottomAnchor(e)&&(f.ly-=f.height,w="bottom"),l.isMiddleAnchor(e)&&(f.ly-=f.height/2,w="middle"),f.outerLength=Math.ceil(f.outerLength),f.height=Math.ceil(f.height),f.lx=Math.round(f.lx),f.ly=Math.round(f.ly);var k={y:e.y,b:f.height*h[w],t:f.height*p[w]};"fraction"===e.lenmode?(k.l=0,k.xl=e.x-e.len*p[_],k.r=0,k.xr=e.x+e.len*h[_]):(k.x=e.x,k.l=f.outerLength*p[_],k.r=f.outerLength*h[_]),a.autoMargin(t,g(e),k)}function y(t,e,r){if(e.currentvalue.visible){var n,a,i=e._dims;switch(e.currentvalue.xanchor){case"right":n=i.inputAreaLength-u.currentValueInset-i.currentValueMaxWidth,a="left";break;case"center":n=.5*i.inputAreaLength,a="middle";break;default:n=u.currentValueInset,a="left"}var c=l.ensureSingle(t,"text",u.labelClass,function(t){t.classed("user-select-none",!0).attr({"text-anchor":a,"data-notex":1})}),f=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof r)f+=r;else{var p=e.steps[e.active].label,h=e._gd._fullLayout._meta;h&&(p=l.templateString(p,h)),f+=p}e.currentvalue.suffix&&(f+=e.currentvalue.suffix),c.call(o.font,e.currentvalue.font).text(f).call(s.convertToTspans,e._gd);var g=s.lineCount(c),v=(i.currentValueMaxLines+1-g)*e.currentvalue.font.size*d;return s.positionText(c,n,v),c}}function x(t,e,r){l.ensureSingle(t,"rect",u.gripRectClass,function(n){n.call(T,e,t,r).style("pointer-events","all")}).attr({width:u.gripWidth,height:u.gripHeight,rx:u.gripRadius,ry:u.gripRadius}).call(i.stroke,r.bordercolor).call(i.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function b(t,e,r){var n=l.ensureSingle(t,"text",u.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=l.templateString(a,i)),n.call(o.font,r.font).text(a).call(s.convertToTspans,r._gd),n}function _(t,e){var r=l.ensureSingle(t,"g",u.labelsClass),a=e._dims,i=r.selectAll("g."+u.labelGroupClass).data(a.labelSteps);i.enter().append("g").classed(u.labelGroupClass,!0),i.exit().remove(),i.each(function(t){var r=n.select(this);r.call(b,t,e),o.setTranslate(r,L(e,t.fraction),u.tickOffset+e.ticklen+e.font.size*d+u.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&&k(t,e,r,o,!0,a)}function k(t,e,r,n,i,o){var l=r.active;r.active=n,c(t.layout,u.name,r).applyUpdate("active",n);var s=r.steps[r.active];e.call(A,r,o),e.call(y,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:i,previousActive:l}),s&&s.method&&i&&(e._nextMethod?(e._nextMethod.step=s,e._nextMethod.doCallback=i,e._nextMethod.doTransition=o):(e._nextMethod={step:s,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 T(t,e,r){var a=r.node(),o=n.select(e);function l(){return r.data()[0]}t.on("mousedown",function(){var t=l();e.emit("plotly_sliderstart",{slider:t});var s=r.select("."+u.gripRectClass);n.event.stopPropagation(),n.event.preventDefault(),s.call(i.fill,t.activebgcolor);var c=S(t,n.mouse(a)[0]);w(e,r,t,c,!0),t._dragging=!0,o.on("mousemove",function(){var t=l(),i=S(t,n.mouse(a)[0]);w(e,r,t,i,!1)}),o.on("mouseup",function(){var t=l();t._dragging=!1,s.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 M(t,e){var r=t.selectAll("rect."+u.tickRectClass).data(e._visibleSteps),a=e._dims;r.enter().append("rect").classed(u.tickRectClass,!0),r.exit().remove(),r.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),r.each(function(t,r){var l=r%a.labelStride==0,s=n.select(this);s.attr({height:l?e.ticklen:e.minorticklen}).call(i.fill,e.tickcolor),o.setTranslate(s,L(e,r/(e._stepCount-1))-.5*e.tickwidth,(l?u.tickOffset:u.minorTickOffset)+a.currentValueTotalHeight)})}function A(t,e,r){for(var n=t.select("rect."+u.gripRectClass),a=0,i=0;i<e._stepCount;i++)if(e._visibleSteps[i]._index===e.active){a=i;break}var o=L(e,a/(e._stepCount-1));if(!e._invokingCommand){var l=n;r&&e.transition.duration>0&&(l=l.transition().duration(e.transition.duration).ease(e.transition.easing)),l.attr("transform","translate("+(o-.5*u.gripWidth)+","+e._dims.currentValueTotalHeight+")")}}function L(t,e){var r=t._dims;return r.inputAreaStart+u.stepInset+(r.inputAreaLength-2*u.stepInset)*Math.min(1,Math.max(0,e))}function S(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-u.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*u.stepInset-2*r.inputAreaStart)))}function C(t,e,r){var n=r._dims,a=l.ensureSingle(t,"rect",u.railTouchRectClass,function(n){n.call(T,e,t,r).style("pointer-events","all")});a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,u.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function O(t,e){var r=e._dims,n=r.inputAreaLength-2*u.railInset,a=l.ensureSingle(t,"rect",u.railRectClass);a.attr({width:n,height:u.railWidth,rx:u.railRadius,ry:u.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,e.bordercolor).call(i.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(a,u.railInset,.5*(r.inputAreaWidth-u.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[u.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."+u.containerClassName).data(r.length>0?[0]:[]);function l(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),a.autoMargin(t,g(e))}if(i.enter().append("g").classed(u.containerClassName,!0).style("cursor","ew-resize"),i.exit().each(function(){n.select(this).selectAll("g."+u.groupClassName).each(l)}).remove(),0!==r.length){var s=i.selectAll("g."+u.groupClassName).data(r,v);s.enter().append("g").classed(u.groupClassName,!0),s.exit().each(l).remove();for(var c=0;c<r.length;c++){var f=r[c];m(t,f)}s.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||k(t,r,n,e.index,!1,!0))}),function(t,e,r){(r.steps[r.active]||{}).visible||(r.active=r._visibleSteps[0]._index);e.call(y,r).call(O,r).call(_,r).call(M,r).call(C,t,r).call(x,t,r);var n=r._dims;o.setTranslate(e,n.lx+r.pad.l,n.ly+r.pad.t),e.call(A,r,!1),e.call(y,r)}(t,n.select(this),e)})}}},{"../../constants/alignment":136,"../../lib":159,"../../lib/svg_text_utils":180,"../../plot_api/plot_template":193,"../../plots/plots":235,"../color":42,"../drawing":63,"./constants":125,d3:7}],128:[function(t,e,r){"use strict";var n=t("./constants");e.exports={moduleType:"component",name:n.name,layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":124,"./constants":125,"./defaults":126,"./draw":127}],129:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../../plots/plots"),o=t("../../registry"),l=t("../../lib"),s=t("../drawing"),c=t("../color"),u=t("../../lib/svg_text_utils"),f=t("../../constants/interactions"),d=t("../../constants/alignment").OPPOSITE_SIDE,p=/ [XY][0-9]* /;e.exports={draw:function(t,e,r){var h,g=r.propContainer,v=r.propName,m=r.placeholder,y=r.traceIndex,x=r.avoid||{},b=r.attributes,_=r.transform,w=r.containerGroup,k=t._fullLayout,T=1,M=!1,A=g.title,L=(A&&A.text?A.text:"").trim(),S=A&&A.font?A.font:{},C=S.family,O=S.size,P=S.color;"title.text"===v?h="titleText":-1!==v.indexOf("axis")?h="axisTitleText":v.indexOf(!0)&&(h="colorbarTitleText");var D=t._context.edits[h];""===L?T=0:L.replace(p," % ")===m.replace(p," % ")&&(T=.2,M=!0,D||(L="")),r._meta?L=l.templateString(L,r._meta):k._meta&&(L=l.templateString(L,k._meta));var z=L||D;w||(w=l.ensureSingle(k._infolayer,"g","g-"+e));var R=w.selectAll("text").data(z?[0]:[]);if(R.enter().append("text"),R.text(L).attr("class",e),R.exit().remove(),!z)return w;function E(t){l.syncOrAsync([I,F],t)}function I(e){var r;return _?(r="",_.rotate&&(r+="rotate("+[_.rotate,b.x,b.y]+")"),_.offset&&(r+="translate(0, "+_.offset+")")):r=null,e.attr("transform",r),e.style({"font-family":C,"font-size":n.round(O,2)+"px",fill:c.rgb(P),opacity:T*c.opacity(P),"font-weight":i.fontWeight}).attr(b).call(u.convertToTspans,t),i.previousPromises(t)}function F(t){var e=n.select(t.node().parentNode);if(x&&x.selection&&x.side&&L){e.attr("transform",null);var r=d[x.side],i="left"===x.side||"top"===x.side?-1:1,o=a(x.pad)?x.pad:2,c=s.bBox(e.node()),u={left:0,top:0,right:k.width,bottom:k.height},f=x.maxShift||i*(u[x.side]-c[x.side]),p=0;if(f<0)p=f;else{var h=x.offsetLeft||0,g=x.offsetTop||0;c.left-=h,c.right-=h,c.top-=g,c.bottom-=g,x.selection.each(function(){var t=s.bBox(this);l.bBoxIntersect(c,t,o)&&(p=Math.max(p,i*(t[x.side]-c[r])+o))}),p=Math.min(f,p)}if(p>0||f<0){var v={left:[-p,0],right:[p,0],top:[0,-p],bottom:[0,p]}[x.side];e.attr("transform","translate("+v+")")}}}return R.call(E),D&&(L?R.on(".opacity",null):(T=0,M=!0,R.text(m).on("mouseover.opacity",function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)})),R.call(u.makeEditable,{gd:t}).on("edit",function(e){void 0!==y?o.call("_guiRestyle",t,v,e,y):o.call("_guiRelayout",t,v,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(E)}).on("input",function(t){this.text(t||" ").call(u.positionText,b.x,b.y)})),R.classed("js-placeholder",M),w}}},{"../../constants/alignment":136,"../../constants/interactions":138,"../../lib":159,"../../lib/svg_text_utils":180,"../../plots/plots":235,"../../registry":243,"../color":42,"../drawing":63,d3:7,"fast-isnumeric":9}],130:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),i=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,l=t("../../plots/pad_attributes"),s=t("../../plot_api/plot_template").templatedArray,c=s("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});e.exports=o(s("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:c,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(l({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":154,"../../plot_api/edit_types":186,"../../plot_api/plot_template":193,"../../plots/font_attributes":229,"../../plots/pad_attributes":234,"../color/attributes":41}],131:[function(t,e,r){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],132:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/array_container_defaults"),i=t("./attributes"),o=t("./constants").name,l=i.buttons;function s(t,e,r){function o(r,a){return n.coerce(t,e,i,r,a)}o("visible",a(t,e,{name:"buttons",handleItemDefaults:c}).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 c(t,e){function r(r,a){return n.coerce(t,e,l,r,a)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}e.exports=function(t,e){a(t,e,{name:o,handleItemDefaults:s})}},{"../../lib":159,"../../plots/array_container_defaults":199,"./attributes":130,"./constants":131}],133:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plots/plots"),i=t("../color"),o=t("../drawing"),l=t("../../lib"),s=t("../../lib/svg_text_utils"),c=t("../../plot_api/plot_template").arrayEditor,u=t("../../constants/alignment").LINE_SPACING,f=t("./constants"),d=t("./scrollbox");function p(t){return t._index}function h(t,e){return+t.attr(f.menuIndexAttrName)===e._index}function g(t,e,r,n,a,i,o,l){e.active=o,c(t.layout,f.name,e).applyUpdate("active",o),"buttons"===e.type?m(t,n,null,null,e):"dropdown"===e.type&&(a.attr(f.menuIndexAttrName,"-1"),v(t,n,a,i,e),l||m(t,n,a,i,e))}function v(t,e,r,n,a){var i=l.ensureSingle(e,"g",f.headerClassName,function(t){t.style("pointer-events","all")}),s=a._dims,c=a.active,u=a.buttons[c]||f.blankHeaderOpts,d={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},p={width:s.headerWidth,height:s.headerHeight};i.call(y,a,u,t).call(A,a,d,p),l.ensureSingle(e,"text",f.headerArrowClassName,function(t){t.classed("user-select-none",!0).attr("text-anchor","end").call(o.font,a.font).text(f.arrowSymbol[a.direction])}).attr({x:s.headerWidth-f.arrowOffsetX+a.pad.l,y:s.headerHeight/2+f.textOffsetY+a.pad.t}),i.on("click",function(){r.call(L,String(h(r,a)?-1:a._index)),m(t,e,r,n,a)}),i.on("mouseover",function(){i.call(w)}),i.on("mouseout",function(){i.call(k,a)}),o.setTranslate(e,s.lx,s.ly)}function m(t,e,r,i,o){r||(r=e).attr("pointer-events","all");var s=function(t){return-1==+t.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,u=r.selectAll("g."+c).data(l.filterVisible(s)),d=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(d.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var h=0,v=0,m=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?v=m.headerHeight+f.gapButtonHeader:h=m.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(v=-f.gapButtonHeader+f.gapButton-m.openHeight),"dropdown"===o.type&&"left"===o.direction&&(h=-f.gapButtonHeader+f.gapButton-m.openWidth);var b={x:m.lx+h+o.pad.l,y:m.ly+v+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},T={l:b.x+o.borderwidth,t:b.y+o.borderwidth};u.each(function(l,s){var c=n.select(this);c.call(y,o,l,t).call(A,o,b),c.on("click",function(){n.event.defaultPrevented||(l.execute&&(l.args2&&o.active===s?(g(t,o,0,e,r,i,-1),a.executeAPICommand(t,l.method,l.args2)):(g(t,o,0,e,r,i,s),a.executeAPICommand(t,l.method,l.args))),t.emit("plotly_buttonclicked",{menu:o,button:l,active:o.active}))}),c.on("mouseover",function(){c.call(w)}),c.on("mouseout",function(){c.call(k,o),u.call(_,o)})}),u.call(_,o),x?(T.w=Math.max(m.openWidth,m.headerWidth),T.h=b.y-T.t):(T.w=b.x-T.l,T.h=Math.max(m.openHeight,m.headerHeight)),T.direction=o.direction,i&&(u.size()?function(t,e,r,n,a,i){var o,l,s,c=a.direction,u="up"===c||"down"===c,d=a._dims,p=a.active;if(u)for(l=0,s=0;s<p;s++)l+=d.heights[s]+f.gapButton;else for(o=0,s=0;s<p;s++)o+=d.widths[s]+f.gapButton;n.enable(i,o,l),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,T):function(t){var e=!!t.hbar,r=!!t.vbar;e&&t.hbar.transition().attr("opacity","0").each("end",function(){e=!1,r||t.disable()});r&&t.vbar.transition().attr("opacity","0").each("end",function(){r=!1,e||t.disable()})}(i))}function y(t,e,r,n){t.call(x,e).call(b,e,r,n)}function x(t,e){l.ensureSingle(t,"rect",f.itemRectClassName,function(t){t.attr({rx:f.rx,ry:f.ry,"shape-rendering":"crispEdges"})}).call(i.stroke,e.bordercolor).call(i.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px")}function b(t,e,r,n){var a=l.ensureSingle(t,"text",f.itemTextClassName,function(t){t.classed("user-select-none",!0).attr({"text-anchor":"start","data-notex":1})}),i=r.label,c=n._fullLayout._meta;c&&(i=l.templateString(i,c)),a.call(o.font,e.font).text(i).call(s.convertToTspans,n)}function _(t,e){var r=e.active;t.each(function(t,a){var o=n.select(this);a===r&&e.showactive&&o.select("rect."+f.itemRectClassName).call(i.fill,f.activeColor)})}function w(t){t.select("rect."+f.itemRectClassName).call(i.fill,f.hoverColor)}function k(t,e){t.select("rect."+f.itemRectClassName).call(i.fill,e.bgcolor)}function T(t,e){var r=e._dims={width1:0,height1:0,heights:[],widths:[],totalWidth:0,totalHeight:0,openWidth:0,openHeight:0,lx:0,ly:0},i=o.tester.selectAll("g."+f.dropdownButtonClassName).data(l.filterVisible(e.buttons));i.enter().append("g").classed(f.dropdownButtonClassName,!0);var c=-1!==["up","down"].indexOf(e.direction);i.each(function(a,i){var l=n.select(this);l.call(y,e,a,t);var d=l.select("."+f.itemTextClassName),p=d.node()&&o.bBox(d.node()).width,h=Math.max(p+f.textPadX,f.minWidth),g=e.font.size*u,v=s.lineCount(d),m=Math.max(g*v,f.minHeight)+f.textOffsetY;m=Math.ceil(m),h=Math.ceil(h),r.widths[i]=h,r.heights[i]=m,r.height1=Math.max(r.height1,m),r.width1=Math.max(r.width1,h),c?(r.totalWidth=Math.max(r.totalWidth,h),r.openWidth=r.totalWidth,r.totalHeight+=m+f.gapButton,r.openHeight+=m+f.gapButton):(r.totalWidth+=h+f.gapButton,r.openWidth+=h+f.gapButton,r.totalHeight=Math.max(r.totalHeight,m),r.openHeight=r.totalHeight)}),c?r.totalHeight-=f.gapButton:r.totalWidth-=f.gapButton,r.headerWidth=r.width1+f.arrowPadX,r.headerHeight=r.height1,"dropdown"===e.type&&(c?(r.width1+=f.arrowPadX,r.totalHeight=r.height1):r.totalWidth=r.width1,r.totalWidth+=f.arrowPadX),i.remove();var d=r.totalWidth+e.pad.l+e.pad.r,p=r.totalHeight+e.pad.t+e.pad.b,h=t._fullLayout._size;r.lx=h.l+h.w*e.x,r.ly=h.t+h.h*(1-e.y);var g="left";l.isRightAnchor(e)&&(r.lx-=d,g="right"),l.isCenterAnchor(e)&&(r.lx-=d/2,g="center");var v="top";l.isBottomAnchor(e)&&(r.ly-=p,v="bottom"),l.isMiddleAnchor(e)&&(r.ly-=p/2,v="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,M(e),{x:e.x,y:e.y,l:d*({right:1,center:.5}[g]||0),r:d*({left:1,center:.5}[g]||0),b:p*({top:1,middle:.5}[v]||0),t:p*({bottom:1,middle:.5}[v]||0)})}function M(t){return f.autoMarginIdRoot+t._index}function A(t,e,r,n){n=n||{};var a=t.select("."+f.itemRectClassName),i=t.select("."+f.itemTextClassName),l=e.borderwidth,c=r.index,d=e._dims;o.setTranslate(t,l+r.x,l+r.y);var p=-1!==["up","down"].indexOf(e.direction),h=n.height||(p?d.heights[c]:d.height1);a.attr({x:0,y:0,width:n.width||(p?d.width1:d.widths[c]),height:h});var g=e.font.size*u,v=(s.lineCount(i)-1)*g/2;s.positionText(i,f.textOffsetX,h/2-v+f.textOffsetY),p?r.y+=d.heights[c]+r.yPad:r.x+=d.widths[c]+r.xPad,r.index++}function L(t,e){t.attr(f.menuIndexAttrName,e||"-1").selectAll("g."+f.dropdownButtonClassName).remove()}e.exports=function(t){var e=t._fullLayout,r=l.filterVisible(e[f.name]);function i(e){a.autoMargin(t,M(e))}var o=e._menulayer.selectAll("g."+f.containerClassName).data(r.length>0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each(function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(i)}).remove(),0!==r.length){var s=o.selectAll("g."+f.headerGroupClassName).data(r,p);s.enter().append("g").classed(f.headerGroupClassName,!0);for(var c=l.ensureSingle(o,"g",f.dropdownButtonGroupClassName,function(t){t.style("pointer-events","all")}),u=0;u<r.length;u++){var y=r[u];T(t,y)}var x="updatemenus"+e._uid,b=new d(t,c,x);s.enter().size()&&(c.node().parentNode.appendChild(c.node()),c.call(L)),s.exit().each(function(t){c.call(L),i(t)}).remove(),s.each(function(e){var r=n.select(this),i="dropdown"===e.type?c:null;a.manageCommandObserver(t,e,e.buttons,function(n){g(t,e,e.buttons[n.index],r,i,b,n.index,!0)}),"dropdown"===e.type?(v(t,r,c,b,e),h(c,e)&&m(t,r,c,b,e)):m(t,r,null,null,e)})}}},{"../../constants/alignment":136,"../../lib":159,"../../lib/svg_text_utils":180,"../../plot_api/plot_template":193,"../../plots/plots":235,"../color":42,"../drawing":63,"./constants":131,"./scrollbox":135,d3:7}],134:[function(t,e,r){arguments[4][128][0].apply(r,arguments)},{"./attributes":130,"./constants":131,"./defaults":132,"./draw":133,dup:128}],135:[function(t,e,r){"use strict";e.exports=l;var n=t("d3"),a=t("../color"),i=t("../drawing"),o=t("../../lib");function l(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})}l.barWidth=2,l.barLength=20,l.barRadius=2,l.barPad=1,l.barColor="#808BA4",l.prototype.enable=function(t,e,r){var o=this.gd._fullLayout,s=o.width,c=o.height;this.position=t;var u,f,d,p,h=this.position.l,g=this.position.w,v=this.position.t,m=this.position.h,y=this.position.direction,x="down"===y,b="left"===y,_="up"===y,w=g,k=m;x||b||"right"===y||_||(this.position.direction="down",x=!0),x||_?(f=(u=h)+w,x?(d=v,k=(p=Math.min(d+k,c))-d):k=(p=v+k)-(d=Math.max(p-k,0))):(p=(d=v)+k,b?w=(f=h+w)-(u=Math.max(f-w,0)):(u=h,w=(f=Math.min(u+w,s))-u)),this._box={l:u,t:d,w:w,h:k};var T=g>w,M=l.barLength+2*l.barPad,A=l.barWidth+2*l.barPad,L=h,S=v+m;S+A>c&&(S=c-A);var C=this.container.selectAll("rect.scrollbar-horizontal").data(T?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,l.barColor),T?(this.hbar=C.attr({rx:l.barRadius,ry:l.barRadius,x:L,y:S,width:M,height:A}),this._hbarXMin=L+M/2,this._hbarTranslateMax=w-M):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var O=m>k,P=l.barWidth+2*l.barPad,D=l.barLength+2*l.barPad,z=h+g,R=v;z+P>s&&(z=s-P);var E=this.container.selectAll("rect.scrollbar-vertical").data(O?[0]:[]);E.exit().on(".drag",null).remove(),E.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,l.barColor),O?(this.vbar=E.attr({rx:l.barRadius,ry:l.barRadius,x:z,y:R,width:P,height:D}),this._vbarYMin=R+D/2,this._vbarTranslateMax=k-D):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var I=this.id,F=u-.5,N=O?f+P+.5:f+.5,j=d-.5,B=T?p+A+.5:p+.5,H=o._topdefs.selectAll("#"+I).data(T||O?[0]:[]);if(H.exit().remove(),H.enter().append("clipPath").attr("id",I).append("rect"),T||O?(this._clipRect=H.select("rect").attr({x:Math.floor(F),y:Math.floor(j),width:Math.ceil(N)-Math.floor(F),height:Math.ceil(B)-Math.floor(j)}),this.container.call(i.setClipUrl,I,this.gd),this.bg.attr({x:h,y:v,width:g,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),T||O){var V=n.behavior.drag().on("dragstart",function(){n.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var q=n.behavior.drag().on("dragstart",function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));T&&this.hbar.on(".drag",null).call(q),O&&this.vbar.on(".drag",null).call(q)}this.setTranslate(e,r)},l.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)},l.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)},l.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)},l.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,l=i+this._vbarTranslateMax;e=(o.constrain(n.event.y,i,l)-i)/(l-i)*(this.position.h-this._box.h)}this.setTranslate(t,e)},l.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 l=e/n;this.vbar.call(i.setTranslate,t,e+l*this._vbarTranslateMax)}}},{"../../lib":159,"../color":42,"../drawing":63,d3:7}],136:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],137:[function(t,e,r){"use strict";e.exports={FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format",DATE_FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format"}},{}],138:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],139:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:1-1e-6,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],140:[function(t,e,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],141:[function(t,e,r){"use strict";r.version="1.52.3",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),l=0;l<o.length;l++){var s=o[l];"_"!==s.charAt(0)&&(r[s]=i[s]),a({moduleType:"apiMethod",name:s,fn:i[s]})}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")]),window.PlotlyLocales&&Array.isArray(window.PlotlyLocales)&&(a(window.PlotlyLocales),delete window.PlotlyLocales),r.Icons=t("./fonts/ploticon"),r.Plots=t("./plots/plots"),r.Fx=t("./components/fx"),r.Snapshot=t("./snapshot"),r.PlotSchema=t("./plot_api/plot_schema"),r.Queue=t("./lib/queue"),r.d3=t("d3")},{"../build/plotcss":1,"./components/annotations":35,"./components/annotations3d":40,"./components/colorbar":48,"./components/colorscale":54,"./components/errorbars":69,"./components/fx":80,"./components/grid":84,"./components/images":89,"./components/legend":97,"./components/rangeselector":108,"./components/rangeslider":115,"./components/shapes":123,"./components/sliders":128,"./components/updatemenus":134,"./fonts/mathjax_config":142,"./fonts/ploticon":143,"./lib/queue":173,"./locale-en":184,"./locale-en-us":183,"./plot_api":188,"./plot_api/plot_schema":192,"./plots/plots":235,"./registry":243,"./snapshot":248,"./traces/scatter":295,d3:7,"es6-promise":8}],142:[function(t,e,r){"use strict";e.exports=function(){"undefined"!=typeof MathJax&&("local"!==(window.PlotlyConfig||{}).MathJaxConfig&&(MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()))}},{}],143:[function(t,e,r){"use strict";e.exports={undo:{width:857.1,height:1e3,path:"m857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z",transform:"matrix(1 0 0 -1 0 850)"},home:{width:928.6,height:1e3,path:"m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z",transform:"matrix(1 0 0 -1 0 850)"},"camera-retro":{width:1e3,height:1e3,path:"m518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z",transform:"matrix(1 0 0 -1 0 850)"},zoombox:{width:1e3,height:1e3,path:"m1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z",transform:"matrix(1 0 0 -1 0 850)"},pan:{width:1e3,height:1e3,path:"m1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z",transform:"matrix(1 0 0 -1 0 850)"},zoom_plus:{width:875,height:1e3,path:"m1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},zoom_minus:{width:875,height:1e3,path:"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},autoscale:{width:1e3,height:1e3,path:"m250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_basic:{width:1500,height:1e3,path:"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_compare:{width:1125,height:1e3,path:"m187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z",transform:"matrix(1 0 0 -1 0 850)"},plotlylogo:{width:1542,height:1e3,path:"m0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z",transform:"matrix(1 0 0 -1 0 850)"},"z-axis":{width:1e3,height:1e3,path:"m833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z",transform:"matrix(1 0 0 -1 0 850)"},"3d_rotate":{width:1e3,height:1e3,path:"m922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z",transform:"matrix(1 0 0 -1 0 850)"},camera:{width:1e3,height:1e3,path:"m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z",transform:"matrix(1 0 0 -1 0 850)"},movie:{width:1e3,height:1e3,path:"m938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z",transform:"matrix(1 0 0 -1 0 850)"},question:{width:857.1,height:1e3,path:"m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z",transform:"matrix(1 0 0 -1 0 850)"},disk:{width:857.1,height:1e3,path:"m214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z",transform:"matrix(1 0 0 -1 0 850)"},lasso:{width:1031,height:1e3,path:"m1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z",transform:"matrix(1 0 0 -1 0 850)"},selectbox:{width:1e3,height:1e3,path:"m0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z",transform:"matrix(1 0 0 -1 0 850)"},spikeline:{width:1e3,height:1e3,path:"M512 409c0-57-46-104-103-104-57 0-104 47-104 104 0 57 47 103 104 103 57 0 103-46 103-103z m-327-39l92 0 0 92-92 0z m-185 0l92 0 0 92-92 0z m370-186l92 0 0 93-92 0z m0-184l92 0 0 92-92 0z",transform:"matrix(1.5 0 0 -1.5 0 850)"},pencil:{width:1792,height:1792,path:"M491 1536l91-91-235-235-91 91v107h128v128h107zm523-928q0-22-22-22-10 0-17 7l-542 542q-7 7-7 17 0 22 22 22 10 0 17-7l542-542q7-7 7-17zm-54-192l416 416-832 832h-416v-416zm683 96q0 53-37 90l-166 166-416-416 166-165q36-38 90-38 53 0 91 38l235 234q37 39 37 91z",transform:"matrix(1 0 0 1 0 1)"},newplotlylogo:{name:"newplotlylogo",svg:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 132 132'><defs><style>.cls-1 {fill: #119dff;} .cls-2 {fill: #25fefd;} .cls-3 {fill: #fff;}</style></defs><title>plotly-logomark</title><g id='symbol'><rect class='cls-1' width='132' height='132' rx='6' ry='6'/><circle class='cls-2' cx='78' cy='54' r='6'/><circle class='cls-2' cx='102' cy='30' r='6'/><circle class='cls-2' cx='78' cy='30' r='6'/><circle class='cls-2' cx='54' cy='30' r='6'/><circle class='cls-2' cx='30' cy='30' r='6'/><circle class='cls-2' cx='30' cy='54' r='6'/><path class='cls-3' d='M30,72a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V78A6,6,0,0,0,30,72Z'/><path class='cls-3' d='M78,72a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V78A6,6,0,0,0,78,72Z'/><path class='cls-3' d='M54,48a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V54A6,6,0,0,0,54,48Z'/><path class='cls-3' d='M102,48a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V54A6,6,0,0,0,102,48Z'/></g></svg>"}}},{}],144:[function(t,e,r){"use strict";r.isLeftAnchor=function(t){return"left"===t.xanchor||"auto"===t.xanchor&&t.x<=1/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},r.isTopAnchor=function(t){return"top"===t.yanchor||"auto"===t.yanchor&&t.y>=2/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3}},{}],145:[function(t,e,r){"use strict";var n=t("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,l=2*o;function s(t){return Math.abs(t[1]-t[0])>l-1e-14}function c(t,e){return i(e-t,l)}function u(t,e){if(s(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,l))>(n=a(n,l))&&(n+=l);var i=a(t,l),o=i+l;return i>=r&&i<=n||o>=r&&o<=n}function f(t,e,r,n,a,i,c){a=a||0,i=i||0;var u,f,d,p,h,g=s([r,n]);function v(t,e){return[t*Math.cos(e)+a,i-t*Math.sin(e)]}g?(u=0,f=o,d=l):r<n?(u=r,d=n):(u=n,d=r),t<e?(p=t,h=e):(p=e,h=t);var m,y=Math.abs(d-u)<=o?0:1;function x(t,e,r){return"A"+[t,t]+" "+[0,y,r]+" "+v(t,e)}return g?m=null===p?"M"+v(h,u)+x(h,f,0)+x(h,d,0)+"Z":"M"+v(p,u)+x(p,f,0)+x(p,d,0)+"ZM"+v(h,u)+x(h,f,1)+x(h,d,1)+"Z":null===p?(m="M"+v(h,u)+x(h,d,0),c&&(m+="L0,0Z")):m="M"+v(p,u)+"L"+v(h,u)+x(h,d,0)+"L"+v(p,d)+x(p,u,1)+"Z",m}e.exports={deg2rad:function(t){return t/180*o},rad2deg:function(t){return t/o*180},angleDelta:c,angleDist:function(t,e){return Math.abs(c(t,e))},isFullCircle:s,isAngleInsideSector:u,isPtInsideSector:function(t,e,r,n){return!!u(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 f(null,t,e,r,n,a,0)},pathSector:function(t,e,r,n,a){return f(null,t,e,r,n,a,1)},pathAnnulus:function(t,e,r,n,a,i){return f(t,e,r,n,a,i,1)}}},{"./mod":166}],146:[function(t,e,r){"use strict";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 l(t){return n(t)||o(t)}function s(t,e,r){if(l(t)){if(l(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=l,r.isArray1D=function(t){return!l(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,l,s,c=[],u=!0,f=0;for(r=0;r<arguments.length;r++)(o=(a=arguments[r]).length)&&(e?c.push(a):(e=a,i=o),n(a)?t=!1:(u=!1,f?t!==a.constructor&&(t=!1):t=a.constructor),f+=o);if(!f)return[];if(!c.length)return e;if(u)return e.concat.apply(e,c);if(t){for((l=new t(f)).set(e),r=0;r<c.length;r++)a=c[r],l.set(a,i),i+=a.length;return l}for(l=new Array(f),s=0;s<e.length;s++)l[s]=e[s];for(r=0;r<c.length;r++){for(a=c[r],s=0;s<a.length;s++)l[i+s]=a[s];i+=s}return l},r.maxRowLength=function(t){return s(t,Math.max,0)},r.minRowLength=function(t){return s(t,Math.min,1/0)}},{}],147:[function(t,e,r){"use strict";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":139,"fast-isnumeric":9}],148:[function(t,e,r){"use strict";e.exports=function(t){var e=t._fullLayout;e._glcanvas&&e._glcanvas.size()&&e._glcanvas.each(function(t){t.regl&&t.regl.clear({color:!0,depth:!0})})}},{}],149:[function(t,e,r){"use strict";e.exports=function(t){t._responsiveChartHandler&&(window.removeEventListener("resize",t._responsiveChartHandler),delete t._responsiveChartHandler)}},{}],150:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("tinycolor2"),i=t("../plots/attributes"),o=t("../components/colorscale/scales"),l=t("../constants/interactions").DESELECTDIM,s=t("./nested_property"),c=t("./regex").counter,u=t("./mod").modHalf,f=t("./array").isArrayOrTypedArray;function d(t,e){var n=r.valObjectMeta[e.valType];if(e.arrayOk&&f(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){f(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(u(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var a=n.regex||c(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&&!!c(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 l,s,c,u,f,d,p=a.items,h=[],g=Array.isArray(p),v=g&&o&&Array.isArray(p[0]),m=o&&g&&!v,y=g&&!m?p.length:t.length;if(n=Array.isArray(n)?n:[],o)for(l=0;l<y;l++)for(h[l]=[],c=Array.isArray(t[l])?t[l]:[],f=m?p.length:g?p[l].length:c.length,s=0;s<f;s++)u=m?p[s]:g?p[l][s]:p,void 0!==(d=i(c[s],u,(n[l]||[])[s]))&&(h[l][s]=d);else for(l=0;l<y;l++)void 0!==(d=i(t[l],g?p[l]:p,n[l]))&&(h[l]=d);e.set(h)}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=s(n,a).get(),l=s(t,a),c=s(e,a),u=l.get(),p=e._template;if(void 0===u&&p&&(u=s(p,a).get(),p=0),void 0===i&&(i=o.dflt),o.arrayOk&&f(u))return c.set(u),u;var h=r.valObjectMeta[o.valType].coerceFunction;h(u,c,i,o);var g=c.get();return p&&g===i&&!d(u,o)&&(h(u=s(p,a).get(),c,i,o),g=c.get()),g},r.coerce2=function(t,e,n,a,i){var o=s(t,a),l=r.coerce(t,e,n,a,i),c=o.get();return null!=c&&l},r.coerceFont=function(t,e,r){var n={};return r=r||{},n.family=t(e+".family",r.family),n.size=t(e+".size",r.size),n.color=t(e+".color",r.color),n},r.coerceHoverinfo=function(t,e,n){var a,o=e._module.attributes,l=o.hoverinfo?o:i,s=l.hoverinfo;if(1===n._dataLength){var c="all"===s.dflt?s.flags.slice():s.dflt.split("+");c.splice(c.indexOf("name"),1),a=c.join("+")}return r.coerce(t,e,l,"hoverinfo",a)},r.coerceSelectionMarkerOpacity=function(t,e){if(t.marker){var r,n,a=t.marker.opacity;if(void 0!==a)f(a)||t.selected||t.unselected||(r=a,n=l*a),e("selected.marker.opacity",r),e("unselected.marker.opacity",n)}},r.validate=d},{"../components/colorscale/scales":57,"../constants/interactions":138,"../plots/attributes":200,"./array":146,"./mod":166,"./nested_property":167,"./regex":174,"fast-isnumeric":9,tinycolor2:25}],151:[function(t,e,r){"use strict";var n,a,i=t("d3"),o=t("fast-isnumeric"),l=t("./loggers"),s=t("./mod").mod,c=t("../constants/numerical"),u=c.BADNUM,f=c.ONEDAY,d=c.ONEHOUR,p=c.ONEMIN,h=c.ONESEC,g=c.EPOCHJD,v=t("../registry"),m=i.time.format.utc,y=/^\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,x=/^\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,b=(new Date).getFullYear()-70;function _(t){return t&&v.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 _(t)?e?v.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:v.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"},r.dfltRange=function(t){return _(t)?v.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()*p,o=(t.getUTCMinutes()-t.getMinutes())*p+(t.getUTCSeconds()-t.getSeconds())*h+(t.getUTCMilliseconds()-t.getMilliseconds());if(o){var l=3*p;i=i-l/2+s(o-i+l/2,l)}return(t=Number(t)-i)>=n&&t<=a?t:u}if("string"!=typeof t&&"number"!=typeof t)return u;t=String(t);var c=_(e),m=t.charAt(0);!c||"G"!==m&&"g"!==m||(t=t.substr(1),e="");var w=c&&"chinese"===e.substr(0,7),k=t.match(w?x:y);if(!k)return u;var T=k[1],M=k[3]||"1",A=Number(k[5]||1),L=Number(k[7]||0),S=Number(k[9]||0),C=Number(k[11]||0);if(c){if(2===T.length)return u;var O;T=Number(T);try{var P=v.getComponentMethod("calendars","getCal")(e);if(w){var D="i"===M.charAt(M.length-1);M=parseInt(M,10),O=P.newDate(T,P.toMonthIndex(T,M,D),A)}else O=P.newDate(T,Number(M),A)}catch(t){return u}return O?(O.toJD()-g)*f+L*d+S*p+C*h:u}T=2===T.length?(Number(T)+2e3-b)%100+b:Number(T),M-=1;var z=new Date(Date.UTC(2e3,M,A,L,S));return z.setUTCFullYear(T),z.getUTCMonth()!==M?u:z.getUTCDate()!==A?u:z.getTime()+C*h},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)!==u};var k=90*f,T=3*d,M=5*p;function A(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 u;e||(e=0);var i,o,l,c,y,x,b=Math.floor(10*s(t+.05,1)),w=Math.round(t-b/10);if(_(r)){var L=Math.floor(w/f)+g,S=Math.floor(s(t,f));try{i=v.getComponentMethod("calendars","getCal")(r).fromJD(L).formatDate("yyyy-mm-dd")}catch(t){i=m("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<k?Math.floor(S/d):0,l=e<k?Math.floor(S%d/p):0,c=e<T?Math.floor(S%p/h):0,y=e<M?S%h*10+b:0}else x=new Date(w),i=m("%Y-%m-%d")(x),o=e<k?x.getUTCHours():0,l=e<k?x.getUTCMinutes():0,c=e<T?x.getUTCSeconds():0,y=e<M?10*x.getUTCMilliseconds()+b:0;return A(i,o,l,c,y)},r.ms2DateTimeLocal=function(t){if(!(t>=n+f&&t<=a-f))return u;var e=Math.floor(10*s(t+.05,1)),r=new Date(Math.round(t-e/10));return A(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===u)return e;if(r.isJSDate(t)||"number"==typeof t&&isFinite(t)){if(_(n))return l.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 l.error("unrecognized date",t),e;return t};var L=/%\d?f/g;function S(t,e,r,n){t=t.replace(L,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(_(n))try{t=v.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(a)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,a,i){if(a=_(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=s(t+.05,f),n=w(Math.floor(r/d),2)+":"+w(s(Math.floor(r/p),60),2);if("M"!==e){o(e)||(e=0);var a=(100+Math.min(s(t/h,60),C[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 O=3*f;r.incrementMonth=function(t,e,r){r=_(r)&&r;var n=s(t,f);if(t=Math.round(t-n),r)try{var a=Math.round(t/f)+g,i=v.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return e%12?i.add(o,e,"m"):i.add(o,e/12,"y"),(o.toJD()-g)*f+n}catch(e){l.error("invalid ms "+t+" in calendar "+r)}var c=new Date(t+O);return c.setUTCMonth(c.getUTCMonth()+e)+n-O},r.findExactDates=function(t,e){for(var r,n,a=0,i=0,l=0,s=0,c=_(e)&&v.getComponentMethod("calendars","getCal")(e),u=0;u<t.length;u++)if(n=t[u],o(n)){if(!(n%f))if(c)try{1===(r=c.fromJD(n/f+g)).day()?1===r.month()?a++:i++:l++}catch(t){}else 1===(r=new Date(n)).getUTCDate()?0===r.getUTCMonth()?a++:i++:l++}else s++;l+=i+=a;var d=t.length-s;return{exactYears:a/d,exactMonths:i/d,exactDays:l/d}}},{"../constants/numerical":139,"../registry":243,"./loggers":163,"./mod":166,d3:7,"fast-isnumeric":9}],152:[function(t,e,r){"use strict";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":163,d3:7}],153:[function(t,e,r){"use strict";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,l=i._events[e];if(!l)return n;function s(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(l=Array.isArray(l)?l:[l],o=0;o<l.length-1;o++)s(l[o]);return a=s(l[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:6}],154:[function(t,e,r){"use strict";var n=t("./is_plain_object.js"),a=Array.isArray;function i(t,e,r,o){var l,s,c,u,f,d,p=t[0],h=t.length;if(2===h&&a(p)&&a(t[1])&&0===p.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],p))return p;p.splice(0,p.length)}for(var g=1;g<h;g++)for(s in l=t[g])c=p[s],u=l[s],o&&a(u)?p[s]=u:e&&u&&(n(u)||(f=a(u)))?(f?(f=!1,d=c&&a(c)?c:[]):d=c&&n(c)?c:{},p[s]=i([d,u],e,r,o)):("undefined"!=typeof u||r)&&(p[s]=u);return p}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":160}],155:[function(t,e,r){"use strict";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}},{}],156:[function(t,e,r){"use strict";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 l=t[o];r(l)&&i.push(l)}return i}},{}],157:[function(t,e,r){"use strict";var n,a,i,o=t("./mod").mod;function l(t,e,r,n,a,i,o,l){var s=r-t,c=a-t,u=o-a,f=n-e,d=i-e,p=l-i,h=s*p-u*f;if(0===h)return null;var g=(c*p-u*d)/h,v=(c*f-s*d)/h;return v<0||v>1||g<0||g>1?null:{x:t+s*g,y:e+f*g}}function s(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,l=a-e;return o*o+l*l}var s=n*e-a*t;return s*s/r}r.segmentsIntersect=l,r.segmentDistance=function(t,e,r,n,a,i,o,c){if(l(t,e,r,n,a,i,o,c))return 0;var u=r-t,f=n-e,d=o-a,p=c-i,h=u*u+f*f,g=d*d+p*p,v=Math.min(s(u,f,h,a-t,i-e),s(u,f,h,o-t,c-e),s(d,p,g,t-a,e-i),s(d,p,g,r-a,n-i));return Math.sqrt(v)},r.getTextLocation=function(t,e,r,l){if(t===a&&l===i||(n={},a=t,i=l),n[r])return n[r];var s=t.getPointAtLength(o(r-l/2,e)),c=t.getPointAtLength(o(r+l/2,e)),u=Math.atan((c.y-s.y)/(c.x-s.x)),f=t.getPointAtLength(o(r,e)),d={x:(4*f.x+s.x+c.x)/6,y:(4*f.y+s.y+c.y)/6,theta:u};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,l=e.top,s=e.bottom,c=0,u=t.getTotalLength(),f=u;function d(e){var r=t.getPointAtLength(e);0===e?n=r:e===u&&(a=r);var c=r.x<i?i-r.x:r.x>o?r.x-o:0,f=r.y<l?l-r.y:r.y>s?r.y-s:0;return Math.sqrt(c*c+f*f)}for(var p=d(c);p;){if((c+=p+r)>f)return;p=d(c)}for(p=d(f);p;){if(c>(f-=p+r))return;p=d(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&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,l=(n=n||{}).pathLength||t.getTotalLength(),s=n.tolerance||.001,c=n.iterationLimit||30,u=t.getPointAtLength(0)[r]>t.getPointAtLength(l)[r]?-1:1,f=0,d=0,p=l;f<c;){if(a=(d+p)/2,o=(i=t.getPointAtLength(a))[r]-e,Math.abs(o)<s)return i;u*o>0?p=a:d=a,f++}return i}},{"./mod":166}],158:[function(t,e,r){"use strict";e.exports=function(t){return t}},{}],159:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../constants/numerical"),o=i.FP_SAFE,l=i.BADNUM,s=e.exports={};s.nestedProperty=t("./nested_property"),s.keyedContainer=t("./keyed_container"),s.relativeAttr=t("./relative_attr"),s.isPlainObject=t("./is_plain_object"),s.toLogRange=t("./to_log_range"),s.relinkPrivateKeys=t("./relink_private");var c=t("./array");s.isTypedArray=c.isTypedArray,s.isArrayOrTypedArray=c.isArrayOrTypedArray,s.isArray1D=c.isArray1D,s.ensureArray=c.ensureArray,s.concat=c.concat,s.maxRowLength=c.maxRowLength,s.minRowLength=c.minRowLength;var u=t("./mod");s.mod=u.mod,s.modHalf=u.modHalf;var f=t("./coerce");s.valObjectMeta=f.valObjectMeta,s.coerce=f.coerce,s.coerce2=f.coerce2,s.coerceFont=f.coerceFont,s.coerceHoverinfo=f.coerceHoverinfo,s.coerceSelectionMarkerOpacity=f.coerceSelectionMarkerOpacity,s.validate=f.validate;var d=t("./dates");s.dateTime2ms=d.dateTime2ms,s.isDateTime=d.isDateTime,s.ms2DateTime=d.ms2DateTime,s.ms2DateTimeLocal=d.ms2DateTimeLocal,s.cleanDate=d.cleanDate,s.isJSDate=d.isJSDate,s.formatDate=d.formatDate,s.incrementMonth=d.incrementMonth,s.dateTick0=d.dateTick0,s.dfltRange=d.dfltRange,s.findExactDates=d.findExactDates,s.MIN_MS=d.MIN_MS,s.MAX_MS=d.MAX_MS;var p=t("./search");s.findBin=p.findBin,s.sorterAsc=p.sorterAsc,s.sorterDes=p.sorterDes,s.distinctVals=p.distinctVals,s.roundUp=p.roundUp,s.sort=p.sort,s.findIndexOfMin=p.findIndexOfMin;var h=t("./stats");s.aggNums=h.aggNums,s.len=h.len,s.mean=h.mean,s.median=h.median,s.midRange=h.midRange,s.variance=h.variance,s.stdev=h.stdev,s.interp=h.interp;var g=t("./matrix");s.init2dArray=g.init2dArray,s.transposeRagged=g.transposeRagged,s.dot=g.dot,s.translationMatrix=g.translationMatrix,s.rotationMatrix=g.rotationMatrix,s.rotationXYMatrix=g.rotationXYMatrix,s.apply2DTransform=g.apply2DTransform,s.apply2DTransform2=g.apply2DTransform2;var v=t("./angles");s.deg2rad=v.deg2rad,s.rad2deg=v.rad2deg,s.angleDelta=v.angleDelta,s.angleDist=v.angleDist,s.isFullCircle=v.isFullCircle,s.isAngleInsideSector=v.isAngleInsideSector,s.isPtInsideSector=v.isPtInsideSector,s.pathArc=v.pathArc,s.pathSector=v.pathSector,s.pathAnnulus=v.pathAnnulus;var m=t("./anchor_utils");s.isLeftAnchor=m.isLeftAnchor,s.isCenterAnchor=m.isCenterAnchor,s.isRightAnchor=m.isRightAnchor,s.isTopAnchor=m.isTopAnchor,s.isMiddleAnchor=m.isMiddleAnchor,s.isBottomAnchor=m.isBottomAnchor;var y=t("./geometry2d");s.segmentsIntersect=y.segmentsIntersect,s.segmentDistance=y.segmentDistance,s.getTextLocation=y.getTextLocation,s.clearLocationCache=y.clearLocationCache,s.getVisibleSegment=y.getVisibleSegment,s.findPointOnPath=y.findPointOnPath;var x=t("./extend");s.extendFlat=x.extendFlat,s.extendDeep=x.extendDeep,s.extendDeepAll=x.extendDeepAll,s.extendDeepNoArrays=x.extendDeepNoArrays;var b=t("./loggers");s.log=b.log,s.warn=b.warn,s.error=b.error;var _=t("./regex");s.counterRegex=_.counter;var w=t("./throttle");s.throttle=w.throttle,s.throttleDone=w.done,s.clearThrottle=w.clear;var k=t("./dom");function T(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}s.getGraphDiv=k.getGraphDiv,s.isPlotDiv=k.isPlotDiv,s.removeElement=k.removeElement,s.addStyleRule=k.addStyleRule,s.addRelatedStyleRule=k.addRelatedStyleRule,s.deleteRelatedStyleRule=k.deleteRelatedStyleRule,s.clearResponsive=t("./clear_responsive"),s.makeTraceGroups=t("./make_trace_groups"),s._=t("./localize"),s.notifier=t("./notifier"),s.filterUnique=t("./filter_unique"),s.filterVisible=t("./filter_visible"),s.pushUnique=t("./push_unique"),s.cleanNumber=t("./clean_number"),s.ensureNumber=function(t){return a(t)?(t=Number(t))<-o||t>o?l:a(t)?Number(t):l:l},s.isIndex=function(t,e){return!(void 0!==e&&t>=e)&&(a(t)&&t>=0&&t%1==0)},s.noop=t("./noop"),s.identity=t("./identity"),s.repeat=function(t,e){for(var r=new Array(e),n=0;n<e;n++)r[n]=t;return r},s.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=s.nestedProperty(t,i.replace("?",r)),l=s.nestedProperty(t,i.replace("?",n)),c=o.get();o.set(l.get()),l.set(c)}},s.raiseToTop=function(t){t.parentNode.appendChild(t)},s.cancelTransition=function(t){return t.transition().duration(0)},s.constrain=function(t,e,r){return e>r?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},s.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},s.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},s.randstr=function t(e,r,n,a){if(n||(n=16),void 0===r&&(r=24),r<=0)return"0";var i,o,l=Math.log(Math.pow(2,r))/Math.log(n),c="";for(i=2;l===1/0;i*=2)l=Math.log(Math.pow(2,r/i))/Math.log(n)*i;var u=l-Math.floor(l);for(i=0;i<Math.floor(l);i++)c=Math.floor(Math.random()*n).toString(n)+c;u&&(o=Math.pow(n,u),c=Math.floor(Math.random()*o).toString(n)+c);var f=parseInt(c,n);return e&&e[c]||f!==1/0&&f>=Math.pow(2,r)?a>10?(s.warn("randstr failed uniqueness"),c):t(e,r,n,(a||0)+1):c},s.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},s.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,a,i,o=t.length,l=2*o,s=2*e-1,c=new Array(s),u=new Array(o);for(r=0;r<s;r++)c[r]=(1-Math.cos(Math.PI*(r+1)/e))/(2*e);for(r=0;r<o;r++){for(i=0,n=0;n<s;n++)(a=r+n+1-e)<-o?a-=l*Math.round(a/l):a>=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=o&&(a=l-1-a),i+=t[a]*c[n];u[r]=i}return u},s.syncOrAsync=function(t,e,r){var n;function a(){return s.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,s.promiseError);return r&&r(e)},s.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},s.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]]}},s.mergeArray=function(t,e,r,n){var a="function"==typeof n;if(s.isArrayOrTypedArray(t))for(var i=Math.min(t.length,e.length),o=0;o<i;o++){var l=t[o];e[o][r]=a?n(l):l}},s.mergeArrayCastPositive=function(t,e,r){return s.mergeArray(t,e,r,function(t){var e=+t;return isFinite(e)&&e>0?e:0})},s.fillArray=function(t,e,r,n){if(n=n||s.identity,s.isArrayOrTypedArray(t))for(var a=0;a<e.length;a++)e[a][r]=n(t[a])},s.castOption=function(t,e,r,n){n=n||s.identity;var a=s.nestedProperty(t,r).get();return s.isArrayOrTypedArray(a)?Array.isArray(e)&&s.isArrayOrTypedArray(a[e[0]])?n(a[e[0]][e[1]]):n(a[e]):a},s.extractOption=function(t,e,r,n){if(r in t)return t[r];var a=s.nestedProperty(e,n).get();return Array.isArray(a)?void 0:a},s.tagSelected=function(t,e,r){var n,a,i=e.selectedpoints,o=e._indexToPoints;o&&(n=T(o));for(var l=0;l<i.length;l++){var c=i[l];if(s.isIndex(c)||s.isArrayOrTypedArray(c)&&s.isIndex(c[0])&&s.isIndex(c[1])){var u=n?n[c]:c,f=r?r[u]:u;void 0!==(a=f)&&a<t.length&&(t[f].selected=1)}}},s.selIndices2selPoints=function(t){var e=t.selectedpoints,r=t._indexToPoints;if(r){for(var n=T(r),a=[],i=0;i<e.length;i++){var o=e[i];if(s.isIndex(o)){var l=n[o];s.isIndex(l)&&a.push(l)}}return a}return e},s.getTargetArray=function(t,e){var r=e.target;if("string"==typeof r&&r){var n=s.nestedProperty(t,r).get();return!!Array.isArray(n)&&n}return!!Array.isArray(r)&&r},s.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):s.isTypedArray(i)?r[a]=i.subarray(0,3):r[a]=i&&"object"==typeof i?s.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},s.titleCase=function(t){return t.charAt(0).toUpperCase()+t.substr(1)},s.containsAny=function(t,e){for(var r=0;r<e.length;r++)if(-1!==t.indexOf(e[r]))return!0;return!1},s.isIE=function(){return"undefined"!=typeof window.navigator.msSaveBlob};var M=/MSIE [1-9]\./;s.isIE9orBelow=function(){return s.isIE()&&M.test(window.navigator.userAgent)};var A=/Version\/[\d\.]+.*Safari/;s.isSafari=function(){return A.test(window.navigator.userAgent)},s.isD3Selection=function(t){return t&&"function"==typeof t.classed},s.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},s.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},s.objectFromPath=function(t,e){for(var r,n=t.split("."),a=r={},i=0;i<n.length;i++){var o=n[i],l=null,s=n[i].match(/(.*)\[([0-9]+)\]/);s?(o=s[1],l=s[2],r=r[o]=[],i===n.length-1?r[l]=e:r[l]={},r=r[l]):(i===n.length-1?r[o]=e:r[o]={},r=r[o])}return a};var L=/^([^\[\.]+)\.(.+)?/,S=/^([^\.]+)\[([0-9]+)\](\.)?(.+)?/;s.expandObjectPaths=function(t){var e,r,n,a,i,o,l;if("object"==typeof t&&!Array.isArray(t))for(r in t)t.hasOwnProperty(r)&&((e=r.match(L))?(a=t[r],n=e[1],delete t[r],t[n]=s.extendDeepNoArrays(t[n]||{},s.objectFromPath(r,s.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]?(l=e[4],o=t[n][i]=t[n][i]||{},s.extendDeepNoArrays(o,s.objectFromPath(l,s.expandObjectPaths(a)))):t[n][i]=s.expandObjectPaths(a)):t[r]=s.expandObjectPaths(t[r]));return t},s.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("."),l=o[0],s=o.length>1?a+o[1]:"";if(i&&(o.length>1||l.length>4||r))for(;n.test(l);)l=l.replace(n,"$1"+i+"$2");return l+s},s.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var C=/^\w*$/;s.templateString=function(t,e){var r={};return t.replace(s.TEMPLATE_STRING_REGEX,function(t,n){var a;return C.test(n)?a=e[n]:(r[n]=r[n]||s.nestedProperty(e,n).get,a=r[n]()),s.isValidTextValue(a)?a:""})};var O={max:10,count:0,name:"hovertemplate"};s.hovertemplateString=function(){return z.apply(O,arguments)};var P={max:10,count:0,name:"texttemplate"};s.texttemplateString=function(){return z.apply(P,arguments)};var D=/^[:|\|]/;function z(t,e,r){var a=this,i=arguments;e||(e={});var o={};return t.replace(s.TEMPLATE_STRING_REGEX,function(t,l,c){var u,f,d,p;for(d=3;d<i.length;d++)if(u=i[d]){if(u.hasOwnProperty(l)){f=u[l];break}if(C.test(l)||(f=o[l]||s.nestedProperty(u,l).get())&&(o[l]=f),void 0!==f)break}if(void 0===f&&a)return a.count<a.max&&(s.warn("Variable '"+l+"' in "+a.name+" could not be found!"),f=t),a.count===a.max&&s.warn("Too many "+a.name+" warnings - additional warnings will be suppressed"),a.count++,t;if(c){if(":"===c[0]&&(f=(p=r?r.numberFormat:n.format)(c.replace(D,""))(f)),"|"===c[0]){p=r?r.timeFormat.utc:n.time.format.utc;var h=s.dateTime2ms(f);f=s.formatDate(h,c.replace(D,""),!1,p)}}else e.hasOwnProperty(l+"Label")&&(f=e[l+"Label"]);return f})}s.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,l=e.charCodeAt(i)||0,s=o>=48&&o<=57,c=l>=48&&l<=57;if(s&&(n=10*n+o-48),c&&(a=10*a+l-48),!s||!c){if(n!==a)return n-a;if(o!==l)return o-l}}return a-n};var R=2e9;s.seedPseudoRandom=function(){R=2e9},s.pseudoRandom=function(){var t=R;return R=(69069*R+1)%4294967296,Math.abs(R-t)<429496729?s.pseudoRandom():R/4294967296},s.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},a=s.extractOption(t,e,"htx","hovertext");if(s.isValidTextValue(a))return n(a);var i=s.extractOption(t,e,"tx","text");return s.isValidTextValue(i)?n(i):void 0},s.isValidTextValue=function(t){return t||0===t},s.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},s.isHidden=function(t){var e=window.getComputedStyle(t).display;return!e||"none"===e},s.getTextTransform=function(t){var e=t.noCenter,r=t.textX,n=t.textY,a=t.targetX,i=t.targetY,o=t.anchorX||0,l=t.anchorY||0,s=t.rotate,c=t.scale;return c?c>1&&(c=1):c=0,"translate("+(a-c*(r+o))+","+(i-c*(n+l))+")"+(c<1?"scale("+c+")":"")+(s?"rotate("+s+(e?"":" "+r+" "+n)+")":"")},s.ensureUniformFontSize=function(t,e){var r=s.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r}},{"../constants/numerical":139,"./anchor_utils":144,"./angles":145,"./array":146,"./clean_number":147,"./clear_responsive":149,"./coerce":150,"./dates":151,"./dom":152,"./extend":154,"./filter_unique":155,"./filter_visible":156,"./geometry2d":157,"./identity":158,"./is_plain_object":160,"./keyed_container":161,"./localize":162,"./loggers":163,"./make_trace_groups":164,"./matrix":165,"./mod":166,"./nested_property":167,"./noop":168,"./notifier":169,"./push_unique":172,"./regex":174,"./relative_attr":175,"./relink_private":176,"./search":177,"./stats":179,"./throttle":181,"./to_log_range":182,d3:7,"fast-isnumeric":9}],160:[function(t,e,r){"use strict";e.exports=function(t){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(t):"[object Object]"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t)===Object.prototype}},{}],161:[function(t,e,r){"use strict";var n=t("./nested_property"),a=/^\w*$/;e.exports=function(t,e,r,i){var o,l,s;r=r||"name",i=i||"value";var c={};e&&e.length?(s=n(t,e),l=s.get()):l=t,e=e||"";var u={};if(l)for(o=0;o<l.length;o++)u[l[o][r]]=o;var f=a.test(i),d={set:function(t,e){var a=null===e?4:0;if(!l){if(!s||4===a)return;l=[],s.set(l)}var o=u[t];if(void 0===o){if(4===a)return;a|=3,o=l.length,u[t]=o}else e!==(f?l[o][i]:n(l[o],i).get())&&(a|=2);var p=l[o]=l[o]||{};return p[r]=t,f?p[i]=e:n(p,i).set(e),null!==e&&(a&=-5),c[o]=c[o]|a,d},get:function(t){if(l){var e=u[t];return void 0===e?void 0:f?l[e][i]:n(l[e],i).get()}},rename:function(t,e){var n=u[t];return void 0===n?d:(c[n]=1|c[n],u[e]=n,delete u[t],l[n][r]=e,d)},remove:function(t){var e=u[t];if(void 0===e)return d;var a=l[e];if(Object.keys(a).length>2)return c[e]=2|c[e],d.set(t,null);if(f){for(o=e;o<l.length;o++)c[o]=3|c[o];for(o=e;o<l.length;o++)u[l[o][r]]--;l.splice(e,1),delete u[t]}else n(a,i).set(null),c[e]=6|c[e];return d},constructUpdate:function(){for(var t,a,o={},s=Object.keys(c),u=0;u<s.length;u++)a=s[u],t=e+"["+a+"]",l[a]?(1&c[a]&&(o[t+"."+r]=l[a][r]),2&c[a]&&(o[t+"."+i]=f?4&c[a]?null:l[a][i]:4&c[a]?null:n(l[a],i).get())):o[t]=null;return o}};return d}},{"./nested_property":167}],162:[function(t,e,r){"use strict";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 l=(i[r]||{}).dictionary;if(l){var s=l[e];if(s)return s}i=n.localeRegistry}var c=r.split("-")[0];if(c===r)break;r=c}return e}},{"../registry":243}],163:[function(t,e,r){"use strict";var n=t("../plot_api/plot_config").dfltConfig,a=t("./notifier"),i=e.exports={};function o(t,e){if(t&&t.apply)try{return void t.apply(console,e)}catch(t){}for(var r=0;r<e.length;r++)try{t(e[r])}catch(t){console.log(e[r])}}i.log=function(){var t;if(n.logging>1){var e=["LOG:"];for(t=0;t<arguments.length;t++)e.push(arguments[t]);o(console.trace||console.log,e)}if(n.notifyOnLogging>1){var r=[];for(t=0;t<arguments.length;t++)r.push(arguments[t]);a(r.join("<br>"),"long")}},i.warn=function(){var t;if(n.logging>0){var e=["WARN:"];for(t=0;t<arguments.length;t++)e.push(arguments[t]);o(console.trace||console.log,e)}if(n.notifyOnLogging>0){var r=[];for(t=0;t<arguments.length;t++)r.push(arguments[t]);a(r.join("<br>"),"stick")}},i.error=function(){var t;if(n.logging>0){var e=["ERROR:"];for(t=0;t<arguments.length;t++)e.push(arguments[t]);o(console.error,e)}if(n.notifyOnLogging>0){var r=[];for(t=0;t<arguments.length;t++)r.push(arguments[t]);a(r.join("<br>"),"stick")}}},{"../plot_api/plot_config":191,"./notifier":169}],164:[function(t,e,r){"use strict";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:7}],165:[function(t,e,r){"use strict";r.init2dArray=function(t,e){for(var r=new Array(t),n=0;n<t;n++)r[n]=new Array(e);return r},r.transposeRagged=function(t){var e,r,n=0,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)))}}},{}],166:[function(t,e,r){"use strict";e.exports={mod:function(t,e){var r=t%e;return r<0?r+e:r},modHalf:function(t,e){return Math.abs(t)>e/2?t-Math.round(t/e)*e:t}}},{}],167:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./array").isArrayOrTypedArray;function i(t,e){return function(){var r,n,o,l,s,c=t;for(l=0;l<e.length-1;l++){if(-1===(r=e[l])){for(n=!0,o=[],s=0;s<c.length;s++)o[s]=i(c[s],e.slice(l+1))(),o[s]!==o[0]&&(n=!1);return n?o[0]:o}if("number"==typeof r&&!a(c))return;if("object"!=typeof(c=c[r])||null===c)return}if("object"==typeof c&&null!==c&&null!==(o=c[e[l]]))return o}}e.exports=function(t,e){if(n(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,a,o,l=0,c=e.split(".");l<c.length;){if(r=String(c[l]).match(/^([^\[\]]*)((\[\-?[0-9]*\])+)$/)){if(r[1])c[l]=r[1];else{if(0!==l)throw"bad property string";c.splice(0,1)}for(a=r[2].substr(1,r[2].length-2).split("]["),o=0;o<a.length;o++)l++,c.splice(l,0,Number(a[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,c):{set:s(t,c,e),get:i(t,c),astr:e,parts:c,obj:t}};var o=/(^|\.)args\[/;function l(t,e){return void 0===t||null===t&&!e.match(o)}function s(t,e,r){return function(n){var i,o,s=t,d="",p=[[t,d]],h=l(n,r);for(o=0;o<e.length-1;o++){if("number"==typeof(i=e[o])&&!a(s))throw"array index but container is not an array";if(-1===i){if(h=!u(s,e.slice(o+1),n,r))break;return}if(!f(s,i,e[o+1],h))break;if("object"!=typeof(s=s[i])||null===s)throw"container is not an object";d=c(d,i),p.push([s,d])}if(h){if(o===e.length-1&&(delete s[e[o]],Array.isArray(s)&&+e[o]==s.length-1))for(;s.length&&void 0===s[s.length-1];)s.pop()}else s[e[o]]=n}}function c(t,e){var r=e;return n(e)?r="["+e+"]":t&&(r="."+e),t+r}function u(t,e,r,n){var i,o=a(r),c=!0,u=r,d=n.replace("-1",0),p=!o&&l(r,d),h=e[0];for(i=0;i<t.length;i++)d=n.replace("-1",i),o&&(p=l(u=r[i%r.length],d)),p&&(c=!1),f(t,i,h,p)&&s(t[i],e,n.replace("-1",i))(u);return c}function f(t,e,r,n){if(void 0===t[e]){if(n)return!1;t[e]="number"==typeof r?[]:{}}return!0}},{"./array":146,"fast-isnumeric":9}],168:[function(t,e,r){"use strict";e.exports=function(){}},{}],169:[function(t,e,r){"use strict";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 a=n.select(this);a.append("button").classed("notifier-close",!0).html("×").on("click",function(){a.transition().call(l)});for(var i=a.append("p"),o=t.split(/<br\s*\/?>/g),s=0;s<o.length;s++)s&&i.append("br"),i.append("span").text(o[s]);"stick"===e?a.transition().duration(350).style("opacity",1):a.transition().duration(700).style("opacity",1).transition().delay(r).call(l)})}function l(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:7,"fast-isnumeric":9}],170:[function(t,e,r){"use strict";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 l=i[o];0===l.indexOf("cursor-")&&t.attr(a,l.substr(7)).classed(l,!1)}t.attr(a)||t.attr(a,"!!")}n(t,e)}else r&&(t.attr(a,null),"!!"===r?n(t):n(t,r))}},{"./setcursor":178}],171:[function(t,e,r){"use strict";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],l=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]),l=Math.max(l,r[e][1]);var s,c=!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]&&(c=!0,s=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]&&(c=!0,s=function(t){return t[1]===r[0][1]}));var u=!0,f=r[0];for(e=1;e<r.length;e++)if(f[0]!==r[e][0]||f[1]!==r[e][1]){u=!1;break}return{xmin:n,xmax:i,ymin:o,ymax:l,pts:r,contains:c?function(t,e){var r=t[0],c=t[1];return!(r===a||r<n||r>i||c===a||c<o||c>l||e&&s(t))}:function(t,e){var s=t[0],c=t[1];if(s===a||s<n||s>i||c===a||c<o||c>l)return!1;var u,f,d,p,h,g=r.length,v=r[0][0],m=r[0][1],y=0;for(u=1;u<g;u++)if(f=v,d=m,v=r[u][0],m=r[u][1],!(s<(p=Math.min(f,v))||s>Math.max(f,v)||c>Math.max(d,m)))if(c<Math.min(d,m))s!==p&&y++;else{if(c===(h=v===f?c:d+(s-f)*(m-d)/(v-f)))return 1!==u||!e;c<=h&&s!==p&&y++}return y%2==1},isRect:c,degenerate:u}},i.isSegmentBent=function(t,e,r,a){var i,o,l,s=t[e],c=[t[r][0]-s[0],t[r][1]-s[1]],u=n(c,c),f=Math.sqrt(u),d=[-c[1]/f,c[0]/f];for(i=e+1;i<r;i++)if(o=[t[i][0]-s[0],t[i][1]-s[1]],(l=n(o,c))<0||l>u||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 l=r.length,s=n;r.splice(a+1);for(var c=s+1;c<t.length;c++)(c===t.length-1||i.isSegmentBent(t,s,c+1,e))&&(r.push(t[c]),r.length<l-2&&(n=c,a=r.length-1),s=c)}t.length>1&&o(t.pop());return{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":139,"./matrix":165}],172:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;n<t.length;n++)if(t[n]instanceof RegExp&&t[n].toString()===r)return t;t.push(e)}else!e&&0!==e||-1!==t.indexOf(e)||t.push(e);return t}},{}],173:[function(t,e,r){"use strict";var n=t("../lib"),a=t("../plot_api/plot_config").dfltConfig;var i={add:function(t,e,r,n,i){var o,l;t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},l=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(l,t.undoQueue.queue.length-l,o),t.undoQueue.index+=1):o=t.undoQueue.queue[l-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++}}};i.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":159,"../plot_api/plot_config":191}],174:[function(t,e,r){"use strict";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)}},{}],175:[function(t,e,r){"use strict";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}},{}],176:[function(t,e,r){"use strict";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],l=e[i];if(l!==o)if("_"===i.charAt(0)||"function"==typeof o){if(i in e)continue;e[i]=o}else if(n(o)&&n(l)&&a(o[0])){if("customdata"===i||"ids"===i)continue;for(var s=Math.min(o.length,l.length),c=0;c<s;c++)l[c]!==o[c]&&a(o[c])&&a(l[c])&&t(l[c],o[c])}else a(o)&&a(l)&&(t(l,o),Object.keys(l).length||delete e[i])}}},{"./array":146,"./is_plain_object":160}],177:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./loggers"),i=t("./identity");function o(t,e){return t<e}function l(t,e){return t<=e}function s(t,e){return t>e}function c(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,u,f=0,d=e.length,p=0,h=d>1?(e[d-1]-e[0])/(d-1):1;for(u=h>=0?r?o:l:r?c:s,t+=1e-9*h*(r?-1:1)*(h>=0?1:-1);f<d&&p++<100;)u(e[i=Math.floor((f+d)/2)],t)?f=i+1:d=i;return p>90&&a.log("Long binary search..."),f-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]],l=0;l<n;l++)e[l+1]>e[l]+i&&(a=Math.min(a,e[l+1]-e[l]),o.push(e[l+1]));return{vals:o,minDiff:a}},r.roundUp=function(t,e,r){for(var n,a=0,i=e.length-1,o=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;a<i&&o++<100;)e[n=c((a+i)/2)]<=t?a=n+l:i=n-s;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":158,"./loggers":163,"fast-isnumeric":9}],178:[function(t,e,r){"use strict";e.exports=function(t,e){(t.attr("class")||"").split(" ").forEach(function(e){0===e.indexOf("cursor-")&&t.classed(e,!1)}),e&&t.classed("cursor-"+e,!0)}},{}],179:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./array").isArrayOrTypedArray;r.aggNums=function(t,e,i,o){var l,s;if((!o||o>i.length)&&(o=i.length),n(e)||(e=!1),a(i[0])){for(s=new Array(o),l=0;l<o;l++)s[l]=r.aggNums(t,e,i[l]);i=s}for(l=0;l<o;l++)n(e)?n(i[l])&&(e=t(+e,+i[l])):e=i[l];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":146,"fast-isnumeric":9}],180:[function(t,e,r){"use strict";var n=t("d3"),a=t("../lib"),i=t("../constants/xmlns_namespaces"),o=t("../constants/alignment").LINE_SPACING;function l(t,e){return t.node().getBoundingClientRect()[e]}var s=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,A){var L=t.text(),C=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&L.match(s),O=n.select(t.node().parentNode);if(!O.empty()){var P=t.attr("class")?t.attr("class").split(" ")[0]:"text";return P+="-math",O.selectAll("svg."+P).remove(),O.selectAll("g."+P+"-group").remove(),t.style("display",null).attr({"data-unformatted":L,"data-math":"N"}),C?(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,l,s;MathJax.Hub.Queue(function(){return o=a.extendDeepAll({},MathJax.Hub.config),l=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 s=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(t.replace(c,"\\lt ").replace(u,"\\gt ")),MathJax.Hub.Typeset(s.node())},function(){var e=n.select("body").select("#MathJax_SVG_glyphs");if(s.select(".MathJax_SVG").empty()||!s.select("svg").node())a.log("There was an error in the tex syntax.",t),r();else{var o=s.select("svg").node().getBoundingClientRect();r(s.select(".MathJax_SVG"),e,o)}if(s.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)},function(){return void 0!==l&&(MathJax.Hub.processSectionDelay=l),MathJax.Hub.Config(o)})}(C[2],i,function(n,a,i){O.selectAll("svg."+P).remove(),O.selectAll("g."+P+"-group").remove();var o=n&&n.select("svg");if(!o||!o.node())return D(),void e();var s=O.append("g").classed(P+"-group",!0).attr({"pointer-events":"none","data-unformatted":L,"data-math":"Y"});s.node().appendChild(o.node()),a&&a.node()&&o.node().insertBefore(a.node().cloneNode(!0),o.node().firstChild),o.attr({class:P,height:i.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var c=t.node().style.fill||"black",u=o.select("g");u.attr({fill:c,stroke:c});var f=l(u,"width"),d=l(u,"height"),p=+t.attr("x")-f*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],h=-(r||l(t,"height"))/4;"y"===P[0]?(s.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+") translate("+[-f/2,h-d/2]+")"}),o.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===P[0]?o.attr({x:t.attr("x"),y:h-d/2}):"a"===P[0]&&0!==P.indexOf("atitle")?o.attr({x:0,y:h}):o.attr({x:p,y:+t.attr("y")+h-d/2}),A&&A.call(t,s),e(s)})})):D(),t}function D(){O.empty()||(P=t.attr("class")+"-math",O.select("svg."+P).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(v," ");var r,l=!1,s=[],c=-1;function u(){c++;var e=document.createElementNS(i.svg,"tspan");n.select(e).attr({class:"line",dy:c*o+"em"}),t.appendChild(e),r=e;var a=s;if(s=[{node:e}],a.length>1)for(var l=1;l<a.length;l++)A(a[l])}function A(t){var e,a=t.type,o={};if("a"===a){e="a";var l=t.target,c=t.href,u=t.popup;c&&(o={"xlink:xlink:show":"_blank"===l||"_"!==l.charAt(0)?"new":"replace",target:l,"xlink:xlink:href":c},u&&(o.onclick='window.open(this.href.baseVal,this.target.baseVal,"'+u+'");return false;'))}else e="tspan";t.style&&(o.style=t.style);var f=document.createElementNS(i.svg,e);if("sup"===a||"sub"===a){L(r,h),r.appendChild(f);var g=document.createElementNS(i.svg,"tspan");L(g,h),n.select(g).attr("dy",p[a]),o.dy=d[a],r.appendChild(f),r.appendChild(g)}else r.appendChild(f);n.select(f).attr(o),r=t.node=f,s.push(t)}function L(t,e){t.appendChild(document.createTextNode(e))}function C(t){if(1!==s.length){var n=s.pop();t!==n.type&&a.log("Start tag <"+n.type+"> doesnt match end tag <"+t+">. Pretending it did match.",e),r=s[s.length-1].node}else a.log("Ignoring unexpected end tag </"+t+">.",e)}x.test(e)?u():(r=t,s=[{node:t}]);for(var O=e.split(m),P=0;P<O.length;P++){var D=O[P],z=D.match(y),R=z&&z[2].toLowerCase(),E=f[R];if("br"===R)u();else if(void 0===E)L(r,S(D));else if(z[1])C(R);else{var I=z[4],F={type:R},N=T(I,b);if(N?(N=N.replace(M,"$1 fill:"),E&&(N+=";"+E)):E&&(N=E),N&&(F.style=N),"a"===R){l=!0;var j=T(I,_);if(j){var B=document.createElement("a");B.href=j,-1!==g.indexOf(B.protocol)&&(F.href=encodeURI(decodeURI(j)),F.target=T(I,w)||"_blank",F.popup=T(I,k))}}A(F)}}return l}(t.node(),L)&&t.style("pointer-events","all"),r.positionText(t),A&&A.call(t)}};var c=/(<|<|<)/g,u=/(>|>|>)/g;var f={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"},p={sub:"-0.21em",sup:"0.42em"},h="\u200b",g=["http:","https:","mailto:","",void 0,":"],v=r.NEWLINES=/(\r\n?|\n)/g,m=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,x=/<br(\s+.*)?>/i;r.BR_TAG_ALL=/<br(\s+.*)?>/gi;var b=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,_=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,k=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function T(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&S(n)}var M=/(^|;)\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(m),o=[],l="",s=0,c=0;c<i.length;c++){var u=i[c],f=u.match(y),d=f&&f[2].toLowerCase();if(d)-1!==n.indexOf(d)&&(o.push(u),l=d);else{var p=u.length;if(s+p<r)o.push(u),s+=p;else if(s<r){var h=r-s;l&&("br"!==l||h<=a||p<=a)&&o.pop(),r>a?o.push(u.substr(0,h-a)+"..."):o.push(u.substr(0,h));break}l=""}}return o.join("")};var A={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},L=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function S(t){return t.replace(L,function(t,e){return("#"===e.charAt(0)?function(t){if(t>1114111)return;var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}("x"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):A[e])||t})}function C(t,e,r){var n,a,i,o=r.horizontalAlign,l=r.verticalAlign||"top",s=t.node().getBoundingClientRect(),c=e.node().getBoundingClientRect();return a="bottom"===l?function(){return s.bottom-n.height}:"middle"===l?function(){return s.top+(s.height-n.height)/2}:function(){return s.top},i="right"===o?function(){return s.right-n.width}:"center"===o?function(){return s.left+(s.width-n.width)/2}:function(){return s.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:a()-c.top+"px",left:i()-c.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 l(){!function(){var a=n.select(r).select(".svg-container"),o=a.append("div"),l=t.node().style,c=parseFloat(l.fontSize||12),u=e.text;void 0===u&&(u=t.attr("data-unformatted"));o.classed("plugin-editable editable",!0).style({position:"absolute","font-family":l.fontFamily||"Arial","font-size":c,color:e.fill||l.fill||"black",opacity:1,"background-color":e.background||"transparent",outline:"#ffffff33 1px solid",margin:[-c/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(u).call(C(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(C(t,a,e)))}).on("keydown",function(){13===n.event.which&&this.blur()}).call(s)}(),t.style({opacity:0});var a,l=o.attr("class");(a=l?"."+l.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(t.node().parentNode).select(a).style({opacity:0})}function s(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?l():o.on("click",l),n.rebind(t,i,"on")}},{"../constants/alignment":136,"../constants/xmlns_namespaces":140,"../lib":159,d3:7}],181:[function(t,e,r){"use strict";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 l in n)n[l].ts<o-6e4&&delete n[l];i=n[t]={ts:0,timer:null}}function s(){r(),i.ts=Date.now(),i.onDone&&(i.onDone(),i.onDone=null)}a(i),o>i.ts+e?s():i.timer=setTimeout(function(){s(),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)}},{}],182:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var r=Math.log(Math.min(e[0],e[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),r}},{"fast-isnumeric":9}],183:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],184:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],185:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=t.split("[")[0],l=0;l<i.length;l++)if((r=t.match(i[l]))&&0===r.index){e=r[0];break}if(e||(e=a[a.indexOf(o)]),!e)return!1;var s=t.substr(e.length);return s?!!(r=s.match(/^\[(0|[1-9][0-9]*)\](\.(.+))?$/))&&{array:e,index:Number(r[1]),property:r[3]||""}:{array:e,index:"",property:""}}},{"../registry":243}],186:[function(t,e,r){"use strict";var n=t("../lib"),a=n.extendFlat,i=n.isPlainObject,o={valType:"flaglist",extras:["none"],flags:["calc","clearAxisTypes","plot","style","markerSize","colorbars"]},l={valType:"flaglist",extras:["none"],flags:["calc","plot","legend","ticks","axrange","layoutstyle","modebar","camera","arraydraw","colorbars"]},s=o.flags.slice().concat(["fullReplot"]),c=l.flags.slice().concat("layoutReplot");function u(t){for(var e={},r=0;r<t.length;r++)e[t[r]]=!1;return e}function f(t,e,r){var n=a({},t);for(var o in n){var l=n[o];i(l)&&(n[o]=d(l,e,r,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,"from-root")}return i}return f(t,e,"_"===n.charAt(0)?"nested":"from-root")}e.exports={traces:o,layout:l,traceFlags:function(){return u(s)},layoutFlags:function(){return u(c)},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:f}},{"../lib":159}],187:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("gl-mat4/fromQuat"),i=t("../registry"),o=t("../lib"),l=t("../plots/plots"),s=t("../plots/cartesian/axis_ids"),c=t("../components/color"),u=s.cleanId,f=s.getFromTrace,d=i.traceIs;function p(t,e){var r=t[e],n=e.charAt(0);r&&"paper"!==r&&(t[e]=u(r,n))}function h(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 g(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 v(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 m(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 y(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=(l.subplotsRegistry.cartesian||{}).attrRegex,s=(l.subplotsRegistry.polar||{}).attrRegex,f=(l.subplotsRegistry.ternary||{}).attrRegex,d=(l.subplotsRegistry.gl3d||{}).attrRegex,g=Object.keys(t);for(e=0;e<g.length;e++){var v=g[e];if(i&&i.test(v)){var m=t[v];m.anchor&&"free"!==m.anchor&&(m.anchor=u(m.anchor)),m.overlaying&&(m.overlaying=u(m.overlaying)),m.type||(m.isdate?m.type="date":m.islog?m.type="log":!1===m.isdate&&!1===m.islog&&(m.type="linear")),"withzero"!==m.autorange&&"tozero"!==m.autorange||(m.autorange=!0,m.rangemode="tozero"),delete m.islog,delete m.isdate,delete m.categories,y(m,"domain")&&delete m.domain,void 0!==m.autotick&&(void 0===m.tickmode&&(m.tickmode=m.autotick?"auto":"linear"),delete m.autotick),h(m)}else if(s&&s.test(v)){h(t[v].radialaxis)}else if(f&&f.test(v)){var x=t[v];h(x.aaxis),h(x.baxis),h(x.caxis)}else if(d&&d.test(v)){var b=t[v],_=b.cameraposition;if(Array.isArray(_)&&4===_[0].length){var w=_[0],k=_[1],T=_[2],M=a([],w),A=[];for(n=0;n<3;++n)A[n]=k[n]+T*M[2+4*n];b.camera={eye:{x:A[0],y:A[1],z:A[2]},center:{x:k[0],y:k[1],z:k[2]},up:{x:0,y:0,z:1}},delete b.cameraposition}h(b.xaxis),h(b.yaxis),h(b.zaxis)}}var L=Array.isArray(t.annotations)?t.annotations.length:0;for(e=0;e<L;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),p(S,"xref"),p(S,"yref"))}var C=Array.isArray(t.shapes)?t.shapes.length:0;for(e=0;e<C;e++){var O=t.shapes[e];o.isPlainObject(O)&&(p(O,"xref"),p(O,"yref"))}var P=t.legend;return P&&(P.x>3?(P.x=1.02,P.xanchor="left"):P.x<-2&&(P.x=-.02,P.xanchor="right"),P.y>3?(P.y=1.02,P.yanchor="bottom"):P.y<-2&&(P.y=-.02,P.yanchor="top")),h(t),"rotate"===t.dragmode&&(t.dragmode="orbit"),c.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 s=c.defaults,f=a.error_y.color||(d(a,"bar")?c.defaultLine:s[e%s.length]);a.error_y.color=c.addOpacity(c.rgb(f),c.opacity(f)*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=u(a.xaxis,"x")),a.yaxis&&(a.yaxis=u(a.yaxis,"y")),d(a,"gl3d")&&a.scene&&(a.scene=l.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]=m(a.textposition[n]);else a.textposition&&(a.textposition=m(a.textposition));var p=i.getModule(a);if(p&&p.colorbar){var x=p.colorbar.container,b=x?a[x]:a;b&&b.colorscale&&("YIGnBu"===b.colorscale&&(b.colorscale="YlGnBu"),"YIOrRd"===b.colorscale&&(b.colorscale="YlOrRd"))}if("surface"===a.type&&o.isPlainObject(a.contours)){var _=["x","y","z"];for(n=0;n<_.length;n++){var w=a.contours[_[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 k=!1!==(a.increasing||{}).showlegend,T=!1!==(a.decreasing||{}).showlegend,M=g(a.increasing),A=g(a.decreasing);if(!1!==M&&!1!==A){var L=v(M,A,k,T);L&&(a.name=L)}else!M&&!A||a.name||(a.name=M||A)}if(Array.isArray(a.transforms)){var S=a.transforms;for(n=0;n<S.length;n++){var C=S[n];if(o.isPlainObject(C))switch(C.type){case"filter":C.filtersrc&&(C.target=C.filtersrc,delete C.filtersrc),C.calendar&&(C.valuecalendar||(C.valuecalendar=C.calendar),delete C.calendar);break;case"groupby":if(C.styles=C.styles||C.style,C.styles&&!Array.isArray(C.styles)){var O=C.styles,P=Object.keys(O);C.styles=[];for(var D=0;D<P.length;D++)C.styles.push({target:P[D],value:O[P[D]]})}}}}y(a,"line")&&delete a.line,"marker"in a&&(y(a.marker,"line")&&delete a.marker.line,y(a,"marker")&&delete a.marker),c.clean(a),a.autobinx&&(delete a.autobinx,delete a.xbins),a.autobiny&&(delete a.autobiny,delete a.ybins),h(a),a.colorbar&&h(a.colorbar),a.marker&&a.marker.colorbar&&h(a.marker.colorbar),a.line&&a.line.colorbar&&h(a.line.colorbar),a.aaxis&&h(a.aaxis),a.baxis&&h(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,l=i.length,s=i[l-1],c=n(s);if(c&&null===e){var u=i.slice(0,l-1).join(".");o.nestedProperty(a,u).get().splice(s,1)}else c&&void 0===t.get()?(void 0===t.get()&&(r[t.astr]=null),t.set(e)):t.set(e)};var x=/(\.[^\[\]\.]+|\[[^\[\]\.]+\])$/;function b(t){var e=t.search(x);if(e>0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=b(e);r;){if(r in t)return!0;r=b(r)}return!1};var _=["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 l=f(t,a,_[i]);if(l&&"log"!==l.type){var s=l._name,c=l._id.substr(1);if("scene"===c.substr(0,5)){if(void 0!==r[c])continue;s=c+"."+s}var u=s+".type";void 0===r[s]&&void 0===r[u]&&o.nestedProperty(t.layout,u).set(null)}}}},{"../components/color":42,"../lib":159,"../plots/cartesian/axis_ids":206,"../plots/plots":235,"../registry":243,"fast-isnumeric":9,"gl-mat4/fromQuat":10}],188:[function(t,e,r){"use strict";var n=t("./plot_api");r.plot=n.plot,r.newPlot=n.newPlot,r.restyle=n.restyle,r.relayout=n.relayout,r.redraw=n.redraw,r.update=n.update,r._guiRestyle=n._guiRestyle,r._guiRelayout=n._guiRelayout,r._guiUpdate=n._guiUpdate,r._storeDirectGUIEdit=n._storeDirectGUIEdit,r.react=n.react,r.extendTraces=n.extendTraces,r.prependTraces=n.prependTraces,r.addTraces=n.addTraces,r.deleteTraces=n.deleteTraces,r.moveTraces=n.moveTraces,r.purge=n.purge,r.addFrames=n.addFrames,r.deleteFrames=n.deleteFrames,r.animate=n.animate,r.setPlotConfig=n.setPlotConfig,r.toImage=t("./to_image"),r.validate=t("./validate"),r.downloadImage=t("../snapshot/download");var a=t("./template_api");r.makeTemplate=a.makeTemplate,r.validateTemplate=a.validateTemplate},{"../snapshot/download":245,"./plot_api":190,"./template_api":195,"./to_image":196,"./validate":197}],189:[function(t,e,r){"use strict";var n=t("../lib/is_plain_object"),a=t("../lib/noop"),i=t("../lib/loggers"),o=t("../lib/search").sorterAsc,l=t("../registry");r.containerArrayMatch=t("./container_array_match");var s=r.isAddVal=function(t){return"add"===t||n(t)},c=r.isRemoveVal=function(t){return null===t||"remove"===t};r.applyContainerArrayChanges=function(t,e,r,n,u){var f=e.astr,d=l.getComponentMethod(f,"supplyLayoutDefaults"),p=l.getComponentMethod(f,"draw"),h=l.getComponentMethod(f,"drawOne"),g=n.replot||n.recalc||d===a||p===a,v=t.layout,m=t._fullLayout;if(r[""]){Object.keys(r).length>1&&i.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(c(y))e.set(null);else{if(!Array.isArray(y))return i.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!g&&(d(v,m),p(t),!0)}var x,b,_,w,k,T,M,A,L=Object.keys(r).map(Number).sort(o),S=e.get(),C=S||[],O=u(m,f).get(),P=[],D=-1,z=C.length;for(x=0;x<L.length;x++)if(w=r[_=L[x]],k=Object.keys(w),T=w[""],M=s(T),_<0||_>C.length-(M?0:1))i.warn("index out of range",f,_);else if(void 0!==T)k.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(T)?P.push(_):M?("add"===T&&(T={}),C.splice(_,0,T),O&&O.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,T),-1===D&&(D=_);else for(b=0;b<k.length;b++)A=f+"["+_+"].",u(C[_],k[b],A).set(w[k[b]]);for(x=P.length-1;x>=0;x--)C.splice(P[x],1),O&&O.splice(P[x],1);if(C.length?S||e.set(C):e.set(null),g)return!1;if(d(v,m),h!==a){var R;if(-1===D)R=L;else{for(z=Math.max(C.length,z),R=[],x=0;x<L.length&&!((_=L[x])>=D);x++)R.push(_);for(x=D;x<z;x++)R.push(x)}for(x=0;x<R.length;x++)h(t,R[x])}else p(t);return!0}},{"../lib/is_plain_object":160,"../lib/loggers":163,"../lib/noop":168,"../lib/search":177,"../registry":243,"./container_array_match":185}],190:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("has-hover"),o=t("../lib"),l=o.nestedProperty,s=t("../lib/events"),c=t("../lib/queue"),u=t("../registry"),f=t("./plot_schema"),d=t("../plots/plots"),p=t("../plots/polar/legacy"),h=t("../plots/cartesian/axes"),g=t("../components/drawing"),v=t("../components/color"),m=t("../plots/cartesian/graph_interact").initInteractions,y=t("../constants/xmlns_namespaces"),x=t("../lib/svg_text_utils"),b=t("../plots/cartesian/select").clearSelect,_=t("./plot_config").dfltConfig,w=t("./manage_arrays"),k=t("./helpers"),T=t("./subroutines"),M=t("./edit_types"),A=t("../plots/cartesian/constants").AX_NAME_PATTERN,L=0,S=5;function C(t){var e=t._fullLayout;e._redrawFromAutoMarginCount?e._redrawFromAutoMarginCount--:t.emit("plotly_afterplot")}function O(t,e){try{t._fullLayout._paper.style("background",e)}catch(t){o.error(t)}}function P(t,e){O(t,v.combine(e,"white"))}function D(t,e){if(!t._context){t._context=o.extendDeep({},_);var r=n.select("base");t._context._baseUrl=r.size()&&r.attr("href")?window.location.href.split("#")[0]:""}var a,l,s,c=t._context;if(e){for(l=Object.keys(e),a=0;a<l.length;a++)"editable"!==(s=l[a])&&"edits"!==s&&s in c&&("setBackground"===s&&"opaque"===e[s]?c[s]=P:c[s]=e[s]);e.plot3dPixelRatio&&!c.plotGlPixelRatio&&(c.plotGlPixelRatio=c.plot3dPixelRatio);var u=e.editable;if(void 0!==u)for(c.editable=u,l=Object.keys(c.edits),a=0;a<l.length;a++)c.edits[l[a]]=u;if(e.edits)for(l=Object.keys(e.edits),a=0;a<l.length;a++)(s=l[a])in c.edits&&(c.edits[s]=e.edits[s]);c._exportedPlot=e._exportedPlot}c.staticPlot&&(c.editable=!1,c.edits={},c.autosizable=!1,c.scrollZoom=!1,c.doubleClick=!1,c.showTips=!1,c.showLink=!1,c.displayModeBar=!1),"hover"!==c.displayModeBar||i||(c.displayModeBar=!0),"transparent"!==c.setBackground&&"function"==typeof c.setBackground||(c.setBackground=O),c._hasZeroHeight=c._hasZeroHeight||0===t.clientHeight,c._hasZeroWidth=c._hasZeroWidth||0===t.clientWidth;var f=c.scrollZoom,d=c._scrollZoom={};if(!0===f)d.cartesian=1,d.gl3d=1,d.geo=1,d.mapbox=1;else if("string"==typeof f){var p=f.split("+");for(a=0;a<p.length;a++)d[p[a]]=1}else!1!==f&&(d.gl3d=1,d.geo=1,d.mapbox=1)}function z(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 R(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 E(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),R(t,e,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&R(t,r,"newIndices"),"undefined"!=typeof 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("undefined"==typeof r)throw new Error("indices must be an integer or array of integers");for(var i in R(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 s=function(t,e,r,n){var i,s,c,u,f,d=o.isPlainObject(n),p=[];for(var h in Array.isArray(r)||(r=[r]),r=z(r,t.data.length-1),e)for(var g=0;g<r.length;g++){if(i=t.data[r[g]],s=(c=l(i,h)).get(),u=e[h][g],!o.isArrayOrTypedArray(u))throw new Error("attribute: "+h+" index: "+g+" must be an array");if(!o.isArrayOrTypedArray(s))throw new Error("cannot extend missing or non-array attribute: "+h);if(s.constructor!==u.constructor)throw new Error("cannot extend array with an array of a different type: "+h);f=d?n[h][g]:n,a(f)||(f=-1),p.push({prop:c,target:s,insert:u,maxp:Math.floor(f)})}return p}(t,e,r,n),c={},u={},f=0;f<s.length;f++){var d=s[f].prop,p=s[f].maxp,h=i(s[f].target,s[f].insert,p);d.set(h[0]),Array.isArray(c[d.astr])||(c[d.astr]=[]),c[d.astr].push(h[1]),Array.isArray(u[d.astr])||(u[d.astr]=[]),u[d.astr].push(s[f].target.length)}return{update:c,maxPoints:u}}function F(t,e){var r=new t.constructor(t.length+e.length);return r.set(t),r.set(e,t.length),r}function N(t,e,n,a){t=o.getGraphDiv(t),k.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 l=k.coerceTraceIndices(t,a),s=V(t,i,l),u=s.flags;u.calc&&(t.calcdata=void 0),u.clearAxisTypes&&k.clearAxisTypes(t,l,{});var f=[];u.fullReplot?f.push(r.plot):(f.push(d.previousPromises),d.supplyDefaults(t),u.markerSize&&(d.doCalcdata(t),Z(f)),u.style&&f.push(T.doTraceStyle),u.colorbars&&f.push(T.doColorBars),f.push(C)),f.push(d.rehover,d.redrag),c.add(t,N,[t,s.undoit,s.traces],N,[t,s.redoit,s.traces]);var p=o.syncOrAsync(f,t);return p&&p.then||(p=Promise.resolve()),p.then(function(){return t.emit("plotly_restyle",s.eventData),t})}function j(t){return void 0===t?null:t}function B(t,e){return e?function(e,r,n){var a=l(e,r),i=a.set;return a.set=function(e){H((n||"")+r,a.get(),e,t),i(e)},a}:l}function H(t,e,r,n){if(Array.isArray(e)||Array.isArray(r))for(var a=Array.isArray(e)?e:[],i=Array.isArray(r)?r:[],l=Math.max(a.length,i.length),s=0;s<l;s++)H(t+"["+s+"]",a[s],i[s],n);else if(o.isPlainObject(e)||o.isPlainObject(r)){var c=o.isPlainObject(e)?e:{},u=o.isPlainObject(r)?r:{},f=o.extendFlat({},c,u);for(var d in f)H(t+"."+d,c[d],u[d],n)}else void 0===n[t]&&(n[t]=j(e))}function V(t,e,r){var n,a=t._fullLayout,i=t._fullData,s=t.data,c=a._guiEditing,p=B(a._preGUI,c),g=o.extendDeepAll({},e);q(e);var v,m=M.traceFlags(),y={},x={};function b(){return r.map(function(){})}function _(t){var e=h.id2name(t);-1===v.indexOf(e)&&v.push(e)}function w(t){return"LAYOUT"+t+".autorange"}function T(t){return"LAYOUT"+t+".range"}function A(t){for(var e=t;e<i.length;e++)if(i[e]._input===s[t])return i[e]}function L(n,i,o){if(Array.isArray(n))n.forEach(function(t){L(t,i,o)});else if(!(n in e||k.hasParent(e,n))){var l;if("LAYOUT"===n.substr(0,6))l=p(t.layout,n.replace("LAYOUT",""));else{var u=r[o];l=B(a._tracePreGUI[A(u)._fullInput.uid],c)(s[u],n)}n in x||(x[n]=b()),void 0===x[n][o]&&(x[n][o]=j(l.get())),void 0!==i&&l.set(i)}}function S(t){return function(e){return i[e][t]}}function C(t){return function(e,n){return!1===e?i[r[n]][t]:null}}for(var O in e){if(k.hasParent(e,O))throw new Error("cannot set "+O+" and a parent attribute simultaneously");var P,D,z,R,E,I,F=e[O];if("autobinx"!==O&&"autobiny"!==O||(O=O.charAt(O.length-1)+"bins",F=Array.isArray(F)?F.map(C(O)):!1===F?r.map(S(O)):null),y[O]=F,"LAYOUT"!==O.substr(0,6)){for(x[O]=b(),n=0;n<r.length;n++){if(P=s[r[n]],D=A(r[n]),R=(z=B(a._tracePreGUI[D._fullInput.uid],c)(P,O)).get(),void 0!==(E=Array.isArray(F)?F[n%F.length]:F)){var N=z.parts[z.parts.length-1],H=O.substr(0,O.length-N.length-1),V=H?H+".":"",U=H?l(D,H).get():D;if((I=f.getTraceValObject(D,z.parts))&&I.impliedEdits&&null!==E)for(var G in I.impliedEdits)L(o.relativeAttr(O,G),I.impliedEdits[G],n);else if("thicknessmode"!==N&&"lenmode"!==N||R===E||"fraction"!==E&&"pixels"!==E||!U){if("type"===O&&("pie"===E!=("pie"===R)||"funnelarea"===E!=("funnelarea"===R))){var Z="x",X="y";"bar"!==E&&"bar"!==R||"h"!==P.orientation||(Z="y",X="x"),o.swapAttrs(P,["?","?src"],"labels",Z),o.swapAttrs(P,["d?","?0"],"label",Z),o.swapAttrs(P,["?","?src"],"values",X),"pie"===R||"funnelarea"===R?(l(P,"marker.color").set(l(P,"marker.colors").get()),a._pielayer.selectAll("g.trace").remove()):u.traceIs(P,"cartesian")&&l(P,"marker.colors").set(l(P,"marker.color").get())}}else{var Y=a._size,W=U.orient,$="top"===W||"bottom"===W;if("thicknessmode"===N){var Q=$?Y.h:Y.w;L(V+"thickness",U.thickness*("fraction"===E?1/Q:Q),n)}else{var J=$?Y.w:Y.h;L(V+"len",U.len*("fraction"===E?1/J:J),n)}}x[O][n]=j(R);if(-1!==["swapxy","swapxyaxes","orientation","orientationaxes"].indexOf(O)){if("orientation"===O){z.set(E);var K=P.x&&!P.y?"h":"v";if((z.get()||K)===D.orientation)continue}else"orientationaxes"===O&&(P.orientation={v:"h",h:"v"}[D.orientation]);k.swapXYData(P),m.calc=m.clearAxisTypes=!0}else-1!==d.dataArrayContainers.indexOf(z.parts[0])?(k.manageArrayContainers(z,E,x),m.calc=!0):(I?I.arrayOk&&!u.traceIs(D,"regl")&&(o.isArrayOrTypedArray(E)||o.isArrayOrTypedArray(R))?m.calc=!0:M.update(m,I):m.calc=!0,z.set(E))}}if(-1!==["swapxyaxes","orientationaxes"].indexOf(O)&&h.swap(t,r),"orientationaxes"===O){var tt=l(t.layout,"hovermode");"x"===tt.get()?tt.set("y"):"y"===tt.get()&&tt.set("x")}if(-1!==["orientation","type"].indexOf(O)){for(v=[],n=0;n<r.length;n++){var et=s[r[n]];u.traceIs(et,"cartesian")&&(_(et.xaxis||"x"),_(et.yaxis||"y"))}L(v.map(w),!0,0),L(v.map(T),[0,1],0)}}else z=p(t.layout,O.replace("LAYOUT","")),x[O]=[j(z.get())],z.set(Array.isArray(F)?F[0]:F),m.calc=!0}return(m.calc||m.plot)&&(m.fullReplot=!0),{flags:m,undoit:x,redoit:y,traces:r,eventData:o.extendDeepNoArrays([],[g,r])}}function q(t){var e,r,n,a=o.counterRegex("axis",".title",!1,!1),i=/colorbar\.title$/,l=Object.keys(t);for(e=0;e<l.length;e++)r=l[e],n=t[r],"title"!==r&&!a.test(r)&&!i.test(r)||"string"!=typeof n&&"number"!=typeof n?r.indexOf("titlefont")>-1?s(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?s(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?s(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&s(r,r.replace("titleoffset","title.offset")):s(r,r.replace("title","title.text"));function s(e,r){t[r]=t[e],delete t[e]}}function U(t,e,r){if(t=o.getGraphDiv(t),k.clearPromiseQueue(t),t.framework&&t.framework.isPolar)return Promise.resolve(t);var n={};if("string"==typeof e)n[e]=r;else{if(!o.isPlainObject(e))return o.warn("Relayout fail.",e,r),Promise.reject();n=o.extendFlat({},e)}Object.keys(n).length&&(t.changed=!0);var a=$(t,n),i=a.flags;i.calc&&(t.calcdata=void 0);var l=[d.previousPromises];i.layoutReplot?l.push(T.layoutReplot):Object.keys(n).length&&(G(t,i,a)||d.supplyDefaults(t),i.legend&&l.push(T.doLegend),i.layoutstyle&&l.push(T.layoutStyles),i.axrange&&Z(l,a.rangesAltered),i.ticks&&l.push(T.doTicksRelayout),i.modebar&&l.push(T.doModeBar),i.camera&&l.push(T.doCamera),i.colorbars&&l.push(T.doColorBars),l.push(C)),l.push(d.rehover,d.redrag),c.add(t,U,[t,a.undoit],U,[t,a.redoit]);var s=o.syncOrAsync(l,t);return s&&s.then||(s=Promise.resolve(t)),s.then(function(){return t.emit("plotly_relayout",a.eventData),t})}function G(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=h.id2name(i),l=t.layout[o],s=n[o];if(s.autorange=l.autorange,s.range=l.range.slice(),s.cleanRange(),s._matchGroup)for(var c in s._matchGroup)if(c!==i){var u=n[h.id2name(c)];u.autorange=s.autorange,u.range=s.range.slice(),u._input.range=s.range.slice()}}return!0}function Z(t,e){var r=e?function(t){var r=[],n=!0;for(var a in e){var i=h.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 h.draw(t,r,{skipTitle:n})}:function(t){return h.draw(t,"redraw")};t.push(b,T.doAutoRangeAndConstraints,r,T.drawData,T.finalDraw)}var X=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,Y=/^[xyz]axis[0-9]*\.autorange$/,W=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function $(t,e){var r,n,a,i=t.layout,s=t._fullLayout,c=s._guiEditing,d=B(s._preGUI,c),p=Object.keys(e),g=h.list(t),v=o.extendDeepAll({},e),m={};for(q(e),p=Object.keys(e),n=0;n<p.length;n++)if(0===p[n].indexOf("allaxes")){for(a=0;a<g.length;a++){var y=g[a]._id.substr(1),x=-1!==y.indexOf("scene")?y+".":"",b=p[n].replace("allaxes",x+g[a]._name);e[b]||(e[b]=e[p[n]])}delete e[p[n]]}var _=M.layoutFlags(),T={},L={};function S(t,r){if(Array.isArray(t))t.forEach(function(t){S(t,r)});else if(!(t in e||k.hasParent(e,t))){var n=d(i,t);t in L||(L[t]=j(n.get())),void 0!==r&&n.set(r)}}var C,O={};function P(t){var e=h.name2id(t.split(".")[0]);return O[e]=1,e}for(var D in e){if(k.hasParent(e,D))throw new Error("cannot set "+D+" and a parent attribute simultaneously");for(var z=d(i,D),R=e[D],E=z.parts.length-1;E>0&&"string"!=typeof z.parts[E];)E--;var I=z.parts[E],F=z.parts[E-1]+"."+I,N=z.parts.slice(0,E).join("."),H=l(t.layout,N).get(),V=l(s,N).get(),U=z.get();if(void 0!==R){T[D]=R,L[D]="reverse"===I?R:j(U);var G=f.getLayoutValObject(s,z.parts);if(G&&G.impliedEdits&&null!==R)for(var Z in G.impliedEdits)S(o.relativeAttr(D,Z),G.impliedEdits[Z]);if(-1!==["width","height"].indexOf(D))if(R){S("autosize",null);var $="height"===D?"width":"height";S($,s[$])}else s[D]=t._initialAutoSize[D];else if("autosize"===D)S("width",R?null:s.width),S("height",R?null:s.height);else if(F.match(X))P(F),l(s,N+"._inputRange").set(null);else if(F.match(Y)){P(F),l(s,N+"._inputRange").set(null);var J=l(s,N).get();J._inputDomain&&(J._input.domain=J._inputDomain.slice())}else F.match(W)&&l(s,N+"._inputDomain").set(null);if("type"===I){var K=H,tt="linear"===V.type&&"log"===R,et="log"===V.type&&"linear"===R;if(tt||et){if(K&&K.range)if(V.autorange)tt&&(K.range=K.range[1]>K.range[0]?[1,2]:[2,1]);else{var rt=K.range[0],nt=K.range[1];tt?(rt<=0&&nt<=0&&S(N+".autorange",!0),rt<=0?rt=nt/1e6:nt<=0&&(nt=rt/1e6),S(N+".range[0]",Math.log(rt)/Math.LN10),S(N+".range[1]",Math.log(nt)/Math.LN10)):(S(N+".range[0]",Math.pow(10,rt)),S(N+".range[1]",Math.pow(10,nt)))}else S(N+".autorange",!0);Array.isArray(s._subplots.polar)&&s._subplots.polar.length&&s[z.parts[0]]&&"radialaxis"===z.parts[1]&&delete s[z.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(t,V,R,S),u.getComponentMethod("images","convertCoords")(t,V,R,S)}else S(N+".autorange",!0),S(N+".range",null);l(s,N+"._inputRange").set(null)}else if(I.match(A)){var at=l(s,D).get(),it=(R||{}).type;it&&"-"!==it||(it="linear"),u.getComponentMethod("annotations","convertCoords")(t,at,it,S),u.getComponentMethod("images","convertCoords")(t,at,it,S)}var ot=w.containerArrayMatch(D);if(ot){r=ot.array,n=ot.index;var lt=ot.property,st=G||{editType:"calc"};""!==n&&""===lt&&(w.isAddVal(R)?L[D]=null:w.isRemoveVal(R)?L[D]=(l(i,r).get()||[])[n]:o.warn("unrecognized full object value",e)),M.update(_,st),m[r]||(m[r]={});var ct=m[r][n];ct||(ct=m[r][n]={}),ct[lt]=R,delete e[D]}else"reverse"===I?(H.range?H.range.reverse():(S(N+".autorange",!0),H.range=[1,0]),V.autorange?_.calc=!0:_.plot=!0):(s._has("scatter-like")&&s._has("regl")&&"dragmode"===D&&("lasso"===R||"select"===R)&&"lasso"!==U&&"select"!==U?_.plot=!0:s._has("gl2d")?_.plot=!0:G?M.update(_,G):_.calc=!0,z.set(R))}}for(r in m){w.applyContainerArrayChanges(t,d(i,r),m[r],_,d)||(_.plot=!0)}var ut=s._axisConstraintGroups||[];for(C in O)for(n=0;n<ut.length;n++){var ft=ut[n];if(ft[C])for(var dt in _.calc=!0,ft)O[dt]||(h.getFromId(t,dt)._constraintShrinkable=!0)}return(Q(t)||e.height||e.width)&&(_.plot=!0),(_.plot||_.calc)&&(_.layoutReplot=!0),{flags:_,rangesAltered:O,undoit:L,redoit:T,eventData:v}}function Q(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 J(t,e,n,a){if(t=o.getGraphDiv(t),k.clearPromiseQueue(t),t.framework&&t.framework.isPolar)return Promise.resolve(t);o.isPlainObject(e)||(e={}),o.isPlainObject(n)||(n={}),Object.keys(e).length&&(t.changed=!0),Object.keys(n).length&&(t.changed=!0);var i=k.coerceTraceIndices(t,a),l=V(t,o.extendFlat({},e),i),s=l.flags,u=$(t,o.extendFlat({},n)),f=u.flags;(s.calc||f.calc)&&(t.calcdata=void 0),s.clearAxisTypes&&k.clearAxisTypes(t,i,n);var p=[];f.layoutReplot?p.push(T.layoutReplot):s.fullReplot?p.push(r.plot):(p.push(d.previousPromises),G(t,f,u)||d.supplyDefaults(t),s.style&&p.push(T.doTraceStyle),(s.colorbars||f.colorbars)&&p.push(T.doColorBars),f.legend&&p.push(T.doLegend),f.layoutstyle&&p.push(T.layoutStyles),f.axrange&&Z(p,u.rangesAltered),f.ticks&&p.push(T.doTicksRelayout),f.modebar&&p.push(T.doModeBar),f.camera&&p.push(T.doCamera),p.push(C)),p.push(d.rehover,d.redrag),c.add(t,J,[t,l.undoit,u.undoit,l.traces],J,[t,l.redoit,u.redoit,l.traces]);var h=o.syncOrAsync(p,t);return h&&h.then||(h=Promise.resolve(t)),h.then(function(){return t.emit("plotly_update",{data:l.eventData,layout:u.eventData}),t})}function K(t){return function(e){e._fullLayout._guiEditing=!0;var r=t.apply(null,arguments);return e._fullLayout._guiEditing=!1,r}}var tt=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],et=[{pattern:/^selectedpoints$/,attr:"selectionrevision"},{pattern:/(^|value\.)visible$/,attr:"legend.uirevision"},{pattern:/^dimensions\[\d+\]\.constraintrange/},{pattern:/^node\.(x|y|groups)/},{pattern:/^level$/},{pattern:/(^|value\.)name$/},{pattern:/colorbar\.title\.text$/},{pattern:/colorbar\.(x|y)$/,attr:"editrevision"}];function rt(t,e){for(var r=0;r<e.length;r++){var n=e[r],a=t.match(n.pattern);if(a)return{head:a[1],attr:n.attr}}}function nt(t,e){var r=l(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=l(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function at(t,e){for(var r=0;r<e.length;r++)if(e[r]._fullInput.uid===t)return r;return-1}function it(t,e,r){for(var n=0;n<e.length;n++)if(e[n].uid===t)return n;return!e[r]||e[r].uid?-1:r}function ot(t,e){var r=o.isPlainObject(t),n=Array.isArray(t);return r||n?(r&&o.isPlainObject(e)||n&&Array.isArray(e))&&JSON.stringify(t)===JSON.stringify(e):t===e}function lt(t,e,r,n){var a,i,s,c=n.getValObject,u=n.flags,f=n.immutable,d=n.inArray,p=n.arrayIndex;function h(){var t=a.editType;d&&-1!==t.indexOf("arraydraw")?o.pushUnique(u.arrays[d],p):(M.update(u,a),"none"!==t&&u.nChanges++,n.transition&&a.anim&&u.nChangesAnim++,(X.test(s)||Y.test(s))&&(u.rangesAltered[r[0]]=1),W.test(s)&&l(e,"_inputDomain").set(null),"datarevision"===i&&(u.newDataRevision=1))}function g(t){return"data_array"===t.valType||t.arrayOk}for(i in t){if(u.calc&&!n.transition)return;var v=t[i],m=e[i],y=r.concat(i);if(s=y.join("."),"_"!==i.charAt(0)&&"function"!=typeof v&&v!==m){if(("tick0"===i||"dtick"===i)&&"geo"!==r[0]){var x=e.tickmode;if("auto"===x||"array"===x||!x)continue}if(("range"!==i||!e.autorange)&&("zmin"!==i&&"zmax"!==i||"contourcarpet"!==e.type)&&(a=c(y))&&(!a._compareAsJSON||JSON.stringify(v)!==JSON.stringify(m))){var b,_=a.valType,w=g(a),k=Array.isArray(v),T=Array.isArray(m);if(k&&T){var A="_input_"+i,L=t[A],S=e[A];if(Array.isArray(L)&&L===S)continue}if(void 0===m)w&&k?u.calc=!0:h();else if(a._isLinkedToArray){var C=[],O=!1;d||(u.arrays[i]=C);var P=Math.min(v.length,m.length),D=Math.max(v.length,m.length);if(P!==D){if("arraydraw"!==a.editType){h();continue}O=!0}for(b=0;b<P;b++)lt(v[b],m[b],y.concat(b),o.extendFlat({inArray:i,arrayIndex:b},n));if(O)for(b=P;b<D;b++)C.push(b)}else!_&&o.isPlainObject(v)?lt(v,m,y,n):w?k&&T?(f&&(u.calc=!0),(f||n.newDataRevision)&&h()):k!==T?u.calc=!0:h():k&&T&&v.length===m.length&&String(v)===String(m)||h()}}}for(i in e)if(!(i in t||"_"===i.charAt(0)||"function"==typeof e[i])){if(g(a=c(r.concat(i)))&&Array.isArray(e[i]))return void(u.calc=!0);h()}}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(y.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._treemaplayer=r._paper.append("g").classed("treemaplayer",!0),r._sunburstlayer=r._paper.append("g").classed("sunburstlayer",!0),r._indicatorlayer=r._toppaper.append("g").classed("indicatorlayer",!0),r._glimages=r._paper.append("g").classed("glimages",!0);var l=r._toppaper.append("g").classed("layer-above",!0);r._imageUpperLayer=l.append("g").classed("imagelayer",!0),r._shapeUpperLayer=l.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 l(t){return Array.isArray(a)?t>=a.length?a[0]:a[t]:a}function s(t){return Array.isArray(i)?t>=i.length?i[0]:i[t]:i}function c(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,u){function f(){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,k.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then(function(){e.onComplete&&e.onComplete()}),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){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&&f()};e()}var h,g,v=0;function m(t){return Array.isArray(a)?v>=a.length?t.transitionOpts=a[v]:t.transitionOpts=a[0]:t.transitionOpts=a,v++,t}var y=[],x=null==e,b=Array.isArray(e);if(x||b||!o.isPlainObject(e)){if(x||-1!==["string","number"].indexOf(typeof e))for(h=0;h<n._frames.length;h++)(g=n._frames[h])&&(x||String(g.group)===String(e))&&y.push({type:"byname",name:String(g.name),data:m({name:g.name})});else if(b)for(h=0;h<e.length;h++){var _=e[h];-1!==["number","string"].indexOf(typeof _)?(_=String(_),y.push({type:"byname",name:_,data:m({name:_})})):o.isPlainObject(_)&&y.push({type:"object",data:m(o.extendFlat({},_))})}}else y.push({type:"object",data:m(o.extendFlat({},e))});for(h=0;h<y.length;h++)if("byname"===(g=y[h]).type&&!n._frameHash[g.data.name])return o.warn('animate failure: frame not found: "'+g.data.name+'"'),void u();-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 w=t._fullLayout._currentFrame;if(w&&r.fromcurrent){var T=-1;for(h=0;h<y.length;h++)if("byname"===(g=y[h]).type&&g.name===w){T=h;break}if(T>0&&T<y.length-1){var M=[];for(h=0;h<y.length;h++)g=y[h],("byname"!==y[h].type||h>T)&&M.push(g);y=M}}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=s(a),h=l(a);h.duration=Math.min(h.duration,f.duration);var g={frame:o,name:e[a].name,frameOpts:f,transitionOpts:h};a===e.length-1&&(g.onComplete=c(i,2),g.onInterrupt=u),n._frameQueue.push(g)}"immediate"===r.mode&&(n._lastFrameAt=-1/0),n._animationRaf||p()}}(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,l,s=t._transitionData._frames,u=t._transitionData._frameHash;if(!Array.isArray(e))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+e);var f=s.length+2*e.length,p=[],h={};for(n=e.length-1;n>=0;n--)if(o.isPlainObject(e[n])){var g=e[n].name,v=(u[g]||h[g]||{}).name,m=e[n].name,y=u[v]||h[v];v&&m&&"number"==typeof m&&y&&L<S&&(L++,o.warn('addFrames: overwriting frame "'+(u[v]||h[v]).name+'" with a frame whose name of type "number" also equates to "'+v+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),L===S&&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.")),h[g]={name:g},p.push({frame:d.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}p.sort(function(t,e){return t.index>e.index?-1:t.index<e.index?1:0});var x=[],b=[],_=s.length;for(n=p.length-1;n>=0;n--){if("number"==typeof(a=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+t._transitionData._counter++];);if(u[a.name]){for(i=0;i<s.length&&(s[i]||{}).name!==a.name;i++);x.push({type:"replace",index:i,value:a}),b.unshift({type:"replace",index:i,value:s[i]})}else l=Math.max(0,Math.min(p[n].index,_)),x.push({type:"insert",index:l,value:a}),b.unshift({type:"delete",index:l}),_++}var w=d.modifyFrames,k=d.modifyFrames,T=[t,b],M=[t,x];return c&&c.add(t,w,T,k,M),d.modifyFrames(t,x)},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=[],l=[];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}),l.unshift({type:"insert",index:n,value:a[n]});var s=d.modifyFrames,u=d.modifyFrames,f=[t,l],p=[t,i];return c&&c.add(t,s,f,u,p),d.modifyFrames(t,i)},r.addTraces=function t(e,n,a){e=o.getGraphDiv(e);var i,l,s=[],u=r.deleteTraces,f=t,d=[e,s],p=[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("undefined"==typeof e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n<e.length;n++)if("object"!=typeof(a=e[n])||Array.isArray(a)||null===a)throw new Error("all values in traces array must be non-array objects");if("undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&r.length!==e.length)throw new Error("if indices is specified, traces.length must equal indices.length")}(e,n,a),Array.isArray(n)||(n=[n]),n=n.map(function(t){return o.extendFlat({},t)}),k.cleanData(n),i=0;i<n.length;i++)e.data.push(n[i]);for(i=0;i<n.length;i++)s.push(-n.length+i);if("undefined"==typeof a)return l=r.redraw(e),c.add(e,u,d,f,p),l;Array.isArray(a)||(a=[a]);try{E(e,s,a)}catch(t){throw e.data.splice(e.data.length-n.length,n.length),t}return c.startSequence(e),c.add(e,u,d,f,p),l=r.moveTraces(e,s,a),c.stopSequence(e),l},r.deleteTraces=function t(e,n){e=o.getGraphDiv(e);var a,i,l=[],s=r.addTraces,u=t,f=[e,l,n],d=[e,n];if("undefined"==typeof n)throw new Error("indices must be an integer or array of integers.");for(Array.isArray(n)||(n=[n]),R(e,n,"indices"),(n=z(n,e.data.length-1)).sort(o.sorterDes),a=0;a<n.length;a+=1)i=e.data.splice(n[a],1)[0],l.push(i);var p=r.redraw(e);return c.add(e,s,f,u,d),p},r.extendTraces=function t(e,n,a,i){var l=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),l=F(t,e);r<0?(n=l,a=i):(n=i,a=l)}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 s=e.length-r;n.set(e.subarray(s)),a.set(t),a.set(e.subarray(0,s),t.length)}else{var c=r-e.length,u=t.length-c;n.set(t.subarray(u)),n.set(e,c),a.set(t.subarray(0,u))}else n=t.concat(e),a=r>=0&&r<n.length?n.splice(0,n.length-r):[];return[n,a]}),s=r.redraw(e),u=[e,l.update,a,l.maxPoints];return c.add(e,r.prependTraces,u,t,arguments),s},r.moveTraces=function t(e,n,a){var i,l=[],s=[],u=t,f=t,d=[e=o.getGraphDiv(e),a,n],p=[e,n,a];if(E(e,n,a),n=Array.isArray(n)?n:[n],"undefined"==typeof a)for(a=[],i=0;i<n.length;i++)a.push(-n.length+i);for(a=Array.isArray(a)?a:[a],n=z(n,e.data.length-1),a=z(a,e.data.length-1),i=0;i<e.data.length;i++)-1===n.indexOf(i)&&l.push(e.data[i]);for(i=0;i<n.length;i++)s.push({newIndex:a[i],trace:e.data[n[i]]});for(s.sort(function(t,e){return t.newIndex-e.newIndex}),i=0;i<s.length;i+=1)l.splice(s[i].newIndex,0,s[i].trace);e.data=l;var h=r.redraw(e);return c.add(e,u,d,f,p),h},r.prependTraces=function t(e,n,a,i){var l=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),l=F(e,t);r<0?(n=l,a=i):(n=i,a=l)}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 s=e.length-r;n.set(e.subarray(0,s)),a.set(e.subarray(s)),a.set(t,s)}else{var c=r-e.length;n.set(e),n.set(t.subarray(0,c),e.length),a.set(t.subarray(c))}else n=e.concat(t),a=r>=0&&r<n.length?n.splice(r,n.length):[];return[n,a]}),s=r.redraw(e),u=[e,l.update,a,l.maxPoints];return c.add(e,r.extendTraces,u,t,arguments),s},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 l;if(t=o.getGraphDiv(t),s.init(t),o.isPlainObject(e)){var c=e;e=c.data,a=c.layout,i=c.config,l=c.frames}if(!1===s.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),g.makeTester(),Array.isArray(t._promises)||(t._promises=[]);var f=0===(t.data||[]).length&&Array.isArray(e);Array.isArray(e)&&(k.cleanData(e),f?t.data=e:t.data.push.apply(t.data,e),t.empty=!1),t.layout&&!f||(t.layout=k.cleanLayout(a)),d.supplyDefaults(t);var v=t._fullLayout,y=v._has("cartesian");if(!v._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),p.manager.fillLayout(t),i.style({width:t._fullLayout.width+"px",height:t._fullLayout.height+"px"}),t.framework=p.manager.framework(t),t.framework({data:t.data,layout:t.layout},i.node()),t.framework.setUndoPoint();var l=t.framework.svg(),s=1,c=t._fullLayout.title?t._fullLayout.title.text:"";""!==c&&c||(s=0);var u=function(){this.call(x.convertToTspans,t)},f=l.select(".title-group text").call(u);if(t._context.edits.titleText){var h=o._(t,"Click to enter Plot title");c&&c!==h||(s=.2,f.attr({"data-unformatted":h}).text(h).style({opacity:s}).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 g=function(){this.call(x.makeEditable,{gd:t}).on("edit",function(e){t.framework({layout:{title:{text:e}}}),this.text(e).call(u),this.call(g)}).on("cancel",function(){var t=this.attr("data-unformatted");this.text(t).call(u)})};f.call(g)}return t._context.setBackground(t,t._fullLayout.paper_bgcolor),d.addLinks(t),Promise.resolve()}(t,e,a);v._replotting=!0,f&&st(t),t.framework!==st&&(t.framework=st,st(t)),g.initGradients(t),f&&h.saveShowSpikeInitial(t);var b=!t.calcdata||t.calcdata.length!==(t._fullData||[]).length;b&&d.doCalcdata(t);for(var _=0;_<t.calcdata.length;_++)t.calcdata[_][0].trace=t._fullData[_];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({},v._size),M=0;function A(){if(d.clearAutoMarginIds(t),T.drawMarginPushers(t),h.allowAutoMargin(t),v._has("pie"))for(var e=t._fullData,r=0;r<e.length;r++){var n=e[r];"pie"===n.type&&n.automargin&&d.allowAutoMargin(t,"pie."+n.uid+".automargin")}return d.doAutoMargin(t),d.previousPromises(t)}function L(){t._transitioning||(T.doAutoRangeAndConstraints(t),f&&h.saveRangeInitial(t),u.getComponentMethod("rangeslider","calcAutorange")(t))}var S=[d.previousPromises,function(){if(l)return r.addFrames(t,l)},function e(){for(var r=v._basePlotModules,n=0;n<r.length;n++)r[n].drawFramework&&r[n].drawFramework(t);if(!v._glcanvas&&v._has("gl")&&(v._glcanvas=v._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}),v._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"})),v._glcanvas){v._glcanvas.attr("width",v.width).attr("height",v.height);var a=v._glcanvas.data()[0].regl;if(a&&(Math.floor(v.width)!==a._gl.drawingBufferWidth||Math.floor(v.height)!==a._gl.drawingBufferHeight)){var i="WebGL context buffer and canvas dimensions do not match due to browser/WebGL bug.";if(!M)return o.log(i+" Clearing graph and plotting again."),d.cleanPlot([],{},t._fullData,v),d.supplyDefaults(t),v=t._fullLayout,d.doCalcdata(t),M++,e();o.error(i)}}return"h"===v.modebar.orientation?v._modebardiv.style("height",null).style("width","100%"):v._modebardiv.style("width",null).style("height",v.height+"px"),d.previousPromises(t)},A,function(){if(d.didMarginChange(w,v._size))return o.syncOrAsync([A,T.layoutStyles],t)}];y&&S.push(function(){if(b)return o.syncOrAsync([u.getComponentMethod("shapes","calcAutorange"),u.getComponentMethod("annotations","calcAutorange"),L],t);L()}),S.push(T.layoutStyles),y&&S.push(function(){return h.draw(t,f?"":"redraw")}),S.push(T.drawData,T.finalDraw,m,d.addLinks,d.rehover,d.redrag,d.doAutoMargin,d.previousPromises);var O=o.syncOrAsync(S,t);return O&&O.then||(O=Promise.resolve()),O.then(function(){return C(t),t})},r.purge=function(t){var e=(t=o.getGraphDiv(t))._fullLayout||{},r=t._fullData||[];return d.cleanPlot([],{},r,e),d.purge(t),s.purge(t),e._container&&e._container.remove(),delete t._context,t},r.react=function(t,e,n,a){var i,s;t=o.getGraphDiv(t),k.clearPromiseQueue(t);var c=t._fullData,p=t._fullLayout;if(o.isPlotDiv(t)&&c&&p){if(o.isPlainObject(e)){var h=e;e=h.data,n=h.layout,a=h.config,i=h.frames}var g=!1;if(a){var v=o.extendDeep({},t._context);t._context=void 0,D(t,a),g=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 l=0;l<a.length;l++)if(a[l]!==i[l]){if(!o.isPlainObject(a[l])||!o.isPlainObject(i[l]))return!0;if(t(a[l],i[l]))return!0}}}}(v,t._context)}t.data=e||[],k.cleanData(t.data),t.layout=n||{},k.cleanLayout(t.layout),function(t,e,r,n){var a,i,s,c,u,f,d,p,h=n._preGUI,g=[],v={};for(a in h){if(u=rt(a,tt)){if(i=u.attr||u.head+".uirevision",(c=(s=l(n,i).get())&&nt(i,e))&&c===s&&(null===(f=h[a])&&(f=void 0),ot(p=(d=l(e,a)).get(),f))){void 0===p&&"autorange"===a.substr(a.length-9)&&g.push(a.substr(0,a.length-10)),d.set(j(l(n,a).get()));continue}}else o.warn("unrecognized GUI edit: "+a);delete h[a],"range["===a.substr(a.length-8,6)&&(v[a.substr(0,a.length-9)]=1)}for(var m=0;m<g.length;m++){var y=g[m];if(v[y]){var x=l(e,y).get();x&&delete x.autorange}}var b=n._tracePreGUI;for(var _ in b){var w,k=b[_],T=null;for(a in k){if(!T){var M=at(_,r);if(M<0){delete b[_];break}var A=it(_,t,(w=r[M]._fullInput).index);if(A<0){delete b[_];break}T=t[A]}if(u=rt(a,et)){if(u.attr?c=(s=l(n,u.attr).get())&&nt(u.attr,e):(s=w.uirevision,void 0===(c=T.uirevision)&&(c=e.uirevision)),c&&c===s&&(null===(f=k[a])&&(f=void 0),ot(p=(d=l(T,a)).get(),f))){d.set(j(l(w,a).get()));continue}}else o.warn("unrecognized GUI edit: "+a+" in trace uid "+_);delete k[a]}}}(t.data,t.layout,c,p),d.supplyDefaults(t,{skipUpdateCalc:!0});var m=t._fullData,y=t._fullLayout,x=void 0===y.datarevision,b=y.transition,_=function(t,e,r,n,a){var i=M.layoutFlags();return i.arrays={},i.rangesAltered={},i.nChanges=0,i.nChangesAnim=0,lt(e,r,[],{getValObject:function(t){return f.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,p,y,x,b),w=_.newDataRevision,A=function(t,e,r,n,a,i){var o=e.length===r.length;if(!a&&!o)return{fullReplot:!0,calc:!0};var l,s,c=M.traceFlags();c.arrays={},c.nChanges=0,c.nChangesAnim=0;var u={getValObject:function(t){var e=f.getTraceValObject(s,t);return!s._module.animatable&&e.anim&&(e.anim=!1),e},flags:c,immutable:n,transition:a,newDataRevision:i,gd:t},p={};for(l=0;l<e.length;l++)if(r[l]){if(s=r[l]._fullInput,d.hasMakesDataTransform(s)&&(s=r[l]),p[s.uid])continue;p[s.uid]=1,lt(e[l]._fullInput,s,[],u)}return(c.calc||c.plot)&&(c.fullReplot=!0),a&&c.nChanges&&c.nChangesAnim&&(c.anim=c.nChanges===c.nChangesAnim&&o?"all":"some"),c}(t,c,m,x,b,w);Q(t)&&(_.layoutReplot=!0),A.calc||_.calc?t.calcdata=void 0:d.supplyDefaultsUpdateCalc(t.calcdata,m);var L=[];if(i&&(t._transitionData={},d.createTransitionData(t),L.push(function(){return r.addFrames(t,i)})),y.transition&&!g&&(A.anim||_.anim))d.doCalcdata(t),T.doAutoRangeAndConstraints(t),L.push(function(){return d.transitionFromReact(t,A,_,p)});else if(A.fullReplot||_.layoutReplot||g)t._fullLayout._skipDefaults=!0,L.push(r.plot);else{for(var S in _.arrays){var O=_.arrays[S];if(O.length){var P=u.getComponentMethod(S,"drawOne");if(P!==o.noop)for(var z=0;z<O.length;z++)P(t,O[z]);else{var R=u.getComponentMethod(S,"draw");if(R===o.noop)throw new Error("cannot draw components: "+S);R(t)}}}L.push(d.previousPromises),A.style&&L.push(T.doTraceStyle),(A.colorbars||_.colorbars)&&L.push(T.doColorBars),_.legend&&L.push(T.doLegend),_.layoutstyle&&L.push(T.layoutStyles),_.axrange&&Z(L),_.ticks&&L.push(T.doTicksRelayout),_.modebar&&L.push(T.doModeBar),_.camera&&L.push(T.doCamera),L.push(C)}L.push(d.rehover,d.redrag),(s=o.syncOrAsync(L,t))&&s.then||(s=Promise.resolve(t))}else s=r.newPlot(t,e,n,a);return s.then(function(){return t.emit("plotly_react",{data:e,layout:n}),t})},r.redraw=function(t){if(t=o.getGraphDiv(t),!o.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t);return k.cleanData(t.data),k.cleanLayout(t.layout),t.calcdata=void 0,r.plot(t).then(function(){return t.emit("plotly_redraw"),t})},r.relayout=U,r.restyle=N,r.setPlotConfig=function(t){return o.extendFlat(_,t)},r.update=J,r._guiRelayout=K(U),r._guiRestyle=K(N),r._guiUpdate=K(J),r._storeDirectGUIEdit=function(t,e,r){for(var n in r)H(n,l(t,n).get(),r[n],e)}},{"../components/color":42,"../components/drawing":63,"../constants/xmlns_namespaces":140,"../lib":159,"../lib/events":153,"../lib/queue":173,"../lib/svg_text_utils":180,"../plots/cartesian/axes":203,"../plots/cartesian/constants":209,"../plots/cartesian/graph_interact":212,"../plots/cartesian/select":220,"../plots/plots":235,"../plots/polar/legacy":238,"../registry":243,"./edit_types":186,"./helpers":187,"./manage_arrays":189,"./plot_config":191,"./plot_schema":192,"./subroutines":194,d3:7,"fast-isnumeric":9,"has-hover":11}],191:[function(t,e,r){"use strict";var n={staticPlot:{valType:"boolean",dflt:!1},plotlyServerURL:{valType:"string",dflt:"https://plot.ly"},editable:{valType:"boolean",dflt:!1},edits:{annotationPosition:{valType:"boolean",dflt:!1},annotationTail:{valType:"boolean",dflt:!1},annotationText:{valType:"boolean",dflt:!1},axisTitleText:{valType:"boolean",dflt:!1},colorbarPosition:{valType:"boolean",dflt:!1},colorbarTitleText:{valType:"boolean",dflt:!1},legendPosition:{valType:"boolean",dflt:!1},legendText:{valType:"boolean",dflt:!1},shapePosition:{valType:"boolean",dflt:!1},titleText:{valType:"boolean",dflt:!1}},autosizable:{valType:"boolean",dflt:!1},responsive:{valType:"boolean",dflt:!1},fillFrame:{valType:"boolean",dflt:!1},frameMargins:{valType:"number",dflt:0,min:0,max:.5},scrollZoom:{valType:"flaglist",flags:["cartesian","gl3d","geo","mapbox"],extras:[!0,!1],dflt:"gl3d+geo+mapbox"},doubleClick:{valType:"enumerated",values:[!1,"reset","autosize","reset+autosize"],dflt:"reset+autosize"},doubleClickDelay:{valType:"number",dflt:300,min:0},showAxisDragHandles:{valType:"boolean",dflt:!0},showAxisRangeEntryBoxes:{valType:"boolean",dflt:!0},showTips:{valType:"boolean",dflt:!0},showLink:{valType:"boolean",dflt:!1},linkText:{valType:"string",dflt:"Edit chart",noBlank:!0},sendData:{valType:"boolean",dflt:!0},showSources:{valType:"any",dflt:!1},displayModeBar:{valType:"enumerated",values:["hover",!0,!1],dflt:"hover"},showSendToCloud:{valType:"boolean",dflt:!1},showEditInChartStudio:{valType:"boolean",dflt:!1},modeBarButtonsToRemove:{valType:"any",dflt:[]},modeBarButtonsToAdd:{valType:"any",dflt:[]},modeBarButtons:{valType:"any",dflt:!1},toImageButtonOptions:{valType:"any",dflt:{}},displaylogo:{valType:"boolean",dflt:!0},watermark:{valType:"boolean",dflt:!1},plotGlPixelRatio:{valType:"number",dflt:2,min:1,max:4},setBackground:{valType:"any",dflt:"transparent"},topojsonURL:{valType:"string",noBlank:!0,dflt:"https://cdn.plot.ly/"},mapboxAccessToken:{valType:"string",dflt:null},logging:{valType:"integer",min:0,max:2,dflt:1},notifyOnLogging:{valType:"integer",min:0,max:2,dflt:0},queueLength:{valType:"integer",min:0,dflt:0},globalTransforms:{valType:"any",dflt:[]},locale:{valType:"string",dflt:"en-US"},locales:{valType:"any",dflt:{}}},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}},{}],192:[function(t,e,r){"use strict";var n=t("../registry"),a=t("../lib"),i=t("../plots/attributes"),o=t("../plots/layout_attributes"),l=t("../plots/frame_attributes"),s=t("../plots/animation_attributes"),c=t("./plot_config").configAttributes,u=t("../plots/polar/legacy/area_attributes"),f=t("../plots/polar/legacy/axis_attributes"),d=t("./edit_types"),p=a.extendFlat,h=a.extendDeepAll,g=a.isPlainObject,v=a.isArrayOrTypedArray,m=a.nestedProperty,y=a.valObjectMeta,x="_isSubplotObj",b="_isLinkedToArray",_=[x,b,"_arrayAttrRegexps","_deprecated"];function w(t,e,r){if(!t)return!1;if(t._isLinkedToArray)if(k(e[r]))r++;else if(r<e.length)return!1;for(;r<e.length;r++){var n=t[e[r]];if(!g(n))break;if(t=n,r===e.length-1)break;if(t._isLinkedToArray){if(!k(e[++r]))return!1}else if("info_array"===t.valType){var a=e[++r];if(!k(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(!k(o))return!1;t=i[a][o]}else t=i[a]}else t=i}}return t}function k(t){return t===Math.round(t)&&t>=0}function T(){var t,e,r={};for(t in h(r,o),n.subplotsRegistry){if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var a=0;a<e.attr.length;a++)L(r,e,e.attr[a]);else L(r,e,"subplot"===e.attr?e.name:e.attr)}for(t in r=function(t){return p(t,{radialaxis:f.radialaxis,angularaxis:f.angularaxis}),p(t,f.layout),t}(r),n.componentsRegistry){var i=(e=n.componentsRegistry[t]).schema;if(i&&(i.subplots||i.layout)){var l=i.subplots;if(l&&l.xaxis&&!l.yaxis)for(var s in l.xaxis)delete r.yaxis[s]}else"colorscale"===e.name?h(r,e.layoutAttributes):e.layoutAttributes&&S(r,e.layoutAttributes,e.name)}return{layoutAttributes:A(r)}}function M(){var t={frames:h({},l)};return A(t),t.frames}function A(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"}):g(t)&&(t.role="object")})}(t),function(t){r.crawl(t,function(t,e,r){if(!t)return;var n=t[b];if(!n)return;delete t[b],r[e]={items:{}},r[e].items[n]=t,r[e].role="object"})}(t),function(t){!function t(e){for(var r in e)if(g(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 L(t,e,r){var n=m(t,r),a=h({},e.layoutAttributes);a[x]=!0,n.set(a)}function S(t,e,r){var n=m(t,r);n.set(h(n.get()||{},e))}r.IS_SUBPLOT_OBJ=x,r.IS_LINKED_TO_ARRAY=b,r.DEPRECATED="_deprecated",r.UNDERSCORE_ATTRS=_,r.get=function(){var t={};n.allTypes.concat("area").forEach(function(e){t[e]=function(t){var e,a;"area"===t?(e={attributes:u},a={}):(e=n.modules[t]._module,a=e.basePlotModule);var o={type:null},l=h({},i),s=h({},e.attributes);r.crawl(s,function(t,e,r,n,a){m(l,a).set(void 0),void 0===t&&m(s,a).set(void 0)}),h(o,l),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;h(o,s),a.attributes&&h(o,a.attributes);o.type=t;var c={meta:e.meta||{},categories:e.categories||{},animatable:Boolean(e.animatable),type:t,attributes:A(o)};if(e.layoutAttributes){var f={};h(f,e.layoutAttributes),c.layoutAttributes=A(f)}e.animatable||r.crawl(c,function(t){r.isValObject(t)&&"anim"in t&&delete t.anim});return c}(e)});var e={};return Object.keys(n.transformsRegistry).forEach(function(t){e[t]=function(t){var e=n.transformsRegistry[t],r=h({},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){S(r,a.schema.transforms[t][e],e)})}),{attributes:A(r)}}(t)}),{defs:{valObjects:y,metaKeys:_.concat(["description","role","editType","impliedEdits"]),editType:{traces:d.traces,layout:d.layout},impliedEdits:{}},traces:t,layout:T(),transforms:e,frames:M(),animation:A(s),config:A(c)}},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===_.indexOf(n)){var l=(a?a+".":"")+n;e(o,n,t,i,l),r.isValObject(o)||g(o)&&"impliedEdits"!==n&&r.crawl(o,e,i+1,l)}})},r.isValObject=function(t){return t&&void 0!==t.valType},r.findArrayAttributes=function(t){var e,n,a=[],o=[],l=[];function s(t,r,i,s){o=o.slice(0,s).concat([r]),l=l.slice(0,s).concat([t&&t._isLinkedToArray]),t&&("data_array"===t.valType||!0===t.arrayOk)&&!("colorbar"===o[s-1]&&("ticktext"===r||"tickvals"===r))&&function t(e,r,i){var s=e[o[r]];var c=i+o[r];if(r===o.length-1)v(s)&&a.push(n+c);else if(l[r]){if(Array.isArray(s))for(var u=0;u<s.length;u++)g(s[u])&&t(s[u],r+1,c+"["+u+"].")}else g(s)&&t(s,r+1,c+".")}(e,0,"")}e=t,n="",r.crawl(i,s),t._module&&t._module.attributes&&r.crawl(t._module.attributes,s);var c=t.transforms;if(c)for(var u=0;u<c.length;u++){var f=c[u],d=f._module;d&&(n="transforms["+u+"].",e=f,r.crawl(d.attributes,s))}return a},r.getTraceValObject=function(t,e){var r,a,o=e[0],l=1;if("transforms"===o){if(1===e.length)return i.transforms;var s=t.transforms;if(!Array.isArray(s)||!s.length)return!1;var c=e[1];if(!k(c)||c>=s.length)return!1;a=(r=(n.transformsRegistry[s[c].type]||{}).attributes)&&r[e[2]],l=3}else if("area"===t.type)a=u[o];else{var f=t._module;if(f||(f=(n.modules[t.type||i.type.dflt]||{})._module),!f)return!1;if(!(a=(r=f.attributes)&&r[o])){var d=f.basePlotModule;d&&d.attributes&&(a=d.attributes[o])}a||(a=i[o])}return w(a,e,l)},r.getLayoutValObject=function(t,e){return w(function(t,e){var r,a,i,l,s=t._basePlotModules;if(s){var c;for(r=0;r<s.length;r++){if((i=s[r]).attrRegex&&i.attrRegex.test(e)){if(i.layoutAttrOverrides)return i.layoutAttrOverrides;!c&&i.layoutAttributes&&(c=i.layoutAttributes)}var u=i.baseLayoutAttrOverrides;if(u&&e in u)return u[e]}if(c)return c}var d=t._modules;if(d)for(r=0;r<d.length;r++)if((l=d[r].layoutAttributes)&&e in l)return l[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}if(e in o)return o[e];if("radialaxis"===e||"angularaxis"===e)return f[e];return f.layout[e]||!1}(t,e[0]),e,1)}},{"../lib":159,"../plots/animation_attributes":198,"../plots/attributes":200,"../plots/frame_attributes":230,"../plots/layout_attributes":233,"../plots/polar/legacy/area_attributes":236,"../plots/polar/legacy/axis_attributes":237,"../registry":243,"./edit_types":186,"./plot_config":191}],193:[function(t,e,r){"use strict";var n=t("../lib"),a=t("../plots/attributes"),i="templateitemname",o={name:{valType:"string",editType:"none"}};function l(t){return t&&"string"==typeof t}function s(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 l={type:e=n.coerce(o,{},a,"type"),_template:null};if(e in i){r=t[e];var s=i[e]%r.length;i[e]++,l._template=r[s]}return l}}},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[s(e)],o=n&&n[e];Array.isArray(o)&&o.length||(o=[]);var c={};return{newItem:function(t){var e={name:t.name,_input:t},n=e[i]=t[i];if(!l(n))return e._template=a,e;for(var s=0;s<o.length;s++){var u=o[s];if(u.name===n)return c[n]=1,e._template=u,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(l(n)&&!c[n]){var a={_template:r,name:n,_input:{_templateitemname:n}};a[i]=r[i],t.push(a),c[n]=1}}return t}}},r.arrayDefaultKey=s,r.arrayEditor=function(t,e,r){var a=(n.nestedProperty(t,e).get()||[]).length,o=r._index,l=o>=a&&(r._input||{})._templateitemname;l&&(o=a);var s,c=e+"["+o+"]";function u(){s={},l&&(s[c]={},s[c][i]=l)}function f(t,e){l?n.nestedProperty(s[c],t).set(e):s[c+"."+t]=e}function d(){var t=s;return u(),t}return u(),{modifyBase:function(t,e){s[t]=e},modifyItem:f,getUpdateObj:d,applyUpdate:function(e,r){e&&f(e,r);var a=d();for(var i in a)n.nestedProperty(t,i).set(a[i])}}}},{"../lib":159,"../plots/attributes":200}],194:[function(t,e,r){"use strict";var n=t("d3"),a=t("../registry"),i=t("../plots/plots"),o=t("../lib"),l=t("../lib/clear_gl_canvases"),s=t("../components/color"),c=t("../components/drawing"),u=t("../components/titles"),f=t("../components/modebar"),d=t("../plots/cartesian/axes"),p=t("../constants/alignment"),h=t("../plots/cartesian/constraints"),g=h.enforce,v=h.clean,m=t("../plots/cartesian/autorange").doAutoRange,y="start",x="middle",b="end";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 w(t){var e,a,l,u,h,g,v=t._fullLayout,m=v._size,y=m.p,x=d.list(t,"",!0);if(v._paperdiv.style({width:t._context.responsive&&v.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":v.width+"px",height:t._context.responsive&&v.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":v.height+"px"}).selectAll(".main-svg").call(c.setSize,v.width,v.height),t._context.setBackground(t,v.paper_bgcolor),r.drawMainTitle(t),f.manage(t),!v._has("cartesian"))return i.previousPromises(t);function b(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:m.t+m.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+y+n:e._offset-y-n:m.l+m.w*(t.position||0)+n%1}for(e=0;e<x.length;e++){var w=(u=x[e])._anchorAxis;u._linepositions={},u._lw=c.crispRound(t,u.linewidth,1),u._mainLinePosition=b(u,w,u.side),u._mainMirrorPosition=u.mirror&&w?b(u,w,p.OPPOSITE_SIDE[u.side]):null}var T=[],A=[],L=[],S=1===s.opacity(v.paper_bgcolor)&&1===s.opacity(v.plot_bgcolor)&&v.paper_bgcolor===v.plot_bgcolor;for(a in v._plots)if((l=v._plots[a]).mainplot)l.bg&&l.bg.remove(),l.bg=void 0;else{var C=l.xaxis.domain,O=l.yaxis.domain,P=l.plotgroup;if(_(C,O,L)){var D=P.node(),z=l.bg=o.ensureSingle(P,"rect","bg");D.insertBefore(z.node(),D.childNodes[0]),A.push(a)}else P.select("rect.bg").remove(),L.push([C,O]),S||(T.push(a),A.push(a))}var R,E,I,F,N,j,B,H,V,q,U,G,Z,X=v._bgLayer.selectAll(".bg").data(T);for(X.enter().append("rect").classed("bg",!0),X.exit().remove(),X.each(function(t){v._plots[t].bg=n.select(this)}),e=0;e<A.length;e++)l=v._plots[A[e]],h=l.xaxis,g=l.yaxis,l.bg&&l.bg.call(c.setRect,h._offset-y,g._offset-y,h._length+2*y,g._length+2*y).call(s.fill,v.plot_bgcolor).style("stroke-width",0);if(!v._hasOnlyLargeSploms)for(a in v._plots){l=v._plots[a],h=l.xaxis,g=l.yaxis;var Y,W,$=l.clipId="clip"+v._uid+a+"plot",Q=o.ensureSingleById(v._clips,"clipPath",$,function(t){t.classed("plotclip",!0).append("rect")});l.clipRect=Q.select("rect").attr({width:h._length,height:g._length}),c.setTranslate(l.plot,h._offset,g._offset),l._hasClipOnAxisFalse?(Y=null,W=$):(Y=$,W=null),c.setClipUrl(l.plot,Y,t),l.layerClipId=W}function J(t){return"M"+R+","+t+"H"+E}function K(t){return"M"+h._offset+","+t+"h"+h._length}function tt(t){return"M"+t+","+H+"V"+B}function et(t){return"M"+t+","+g._offset+"v"+g._length}function rt(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 v._plots){l=v._plots[a],h=l.xaxis,g=l.yaxis;var nt="M0,0";k(h,a)&&(N=M(h,"left",g,x),R=h._offset-(N?y+N:0),j=M(h,"right",g,x),E=h._offset+h._length+(j?y+j:0),I=b(h,g,"bottom"),F=b(h,g,"top"),!(Z=!h._anchorAxis||a!==h._mainSubplot)||"allticks"!==h.mirror&&"all"!==h.mirror||(h._linepositions[a]=[I,F]),nt=rt(h,J,K),Z&&h.showline&&("all"===h.mirror||"allticks"===h.mirror)&&(nt+=J(I)+J(F)),l.xlines.style("stroke-width",h._lw+"px").call(s.stroke,h.showline?h.linecolor:"rgba(0,0,0,0)")),l.xlines.attr("d",nt);var at="M0,0";k(g,a)&&(U=M(g,"bottom",h,x),B=g._offset+g._length+(U?y:0),G=M(g,"top",h,x),H=g._offset-(G?y:0),V=b(g,h,"left"),q=b(g,h,"right"),!(Z=!g._anchorAxis||a!==g._mainSubplot)||"allticks"!==g.mirror&&"all"!==g.mirror||(g._linepositions[a]=[V,q]),at=rt(g,tt,et),Z&&g.showline&&("all"===g.mirror||"allticks"===g.mirror)&&(at+=tt(V)+tt(q)),l.ylines.style("stroke-width",g._lw+"px").call(s.stroke,g.showline?g.linecolor:"rgba(0,0,0,0)")),l.ylines.attr("d",at)}return d.makeClipPaths(t),i.previousPromises(t)}function k(t,e){return(t.ticks||t.showline)&&(e===t._mainSubplot||"all"===t.mirror||"allticks"===t.mirror)}function T(t,e,r){if(!r.showline||!r._lw)return!1;if("all"===r.mirror||"allticks"===r.mirror)return!0;var n=r._anchorAxis;if(!n)return!1;var a=p.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(T(t,e,r))return r._lw;for(var a=0;a<n.length;a++){var i=n[a];if(i._mainAxis===r._mainAxis&&T(t,e,i))return i._lw}return 0}function A(t,e){var r=t.title,n=t._size,a=0;switch(e===y?a=r.pad.l:e===b&&(a=-r.pad.r),r.xref){case"paper":return n.l+n.w*r.x+a;case"container":default:return t.width*r.x+a}}function L(t,e){var r=t.title,n=t._size,a=0;if("0em"!==e&&e?e===p.CAP_SHIFT+"em"&&(a=r.pad.t):a=-r.pad.b,"auto"===r.y)return n.t/2;switch(r.yref){case"paper":return n.t+n.h-n.h*r.y+a;case"container":default:return t.height-t.height*r.y+a}}r.layoutStyles=function(t){return o.syncOrAsync([i.doAutoMargin,w],t)},r.drawMainTitle=function(t){var e=t._fullLayout,r=function(t){var e=t.title,r=x;o.isRightAnchor(e)?r=b:o.isLeftAnchor(e)&&(r=y);return r}(e),n=function(t){var e=t.title,r="0em";o.isTopAnchor(e)?r=p.CAP_SHIFT+"em":o.isMiddleAnchor(e)&&(r=p.MID_SHIFT+"em");return r}(e);u.draw(t,"gtitle",{propContainer:e,propName:"title.text",placeholder:e._dfltTitle.plot,attributes:{x:A(e,r),y:L(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 s=n[e],c=s[0]||{},u=c.trace||{},f=u._module||{},d=f.arraysToCalcdata;d&&d(s,u);var p=f.editStyle;p&&o.push({fn:p,cd0:c})}if(o.length){for(e=0;e<o.length;e++){var h=o[e];h.fn(t,h.cd0)}l(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),l(t),r.redrawReglTraces(t)),r.drawMainTitle(t),i.previousPromises(t)},r.doModeBar=function(t){var e=t._fullLayout;f.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]];a._scene.setViewport(a)}},r.drawData=function(t){var e=t._fullLayout;l(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),a.getComponentMethod("images","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=[],l=[];for(e._hasOnlyLargeSploms&&e._splomGrid.draw(),r=0;r<a.length;r++){var s=a[r];!0===s.visible&&0!==s._length&&("splom"===s.type?e._splomScenes[s.uid].draw():"scattergl"===s.type?o.pushUnique(i,s.xaxis+s.yaxis):"scatterpolargl"===s.type&&o.pushUnique(l,s.subplot))}for(r=0;r<i.length;r++)(n=e._plots[i[r]])._scene&&n._scene.draw();for(r=0;r<l.length;r++)(n=e[l[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||[],l={},s=0;s<a.length;s++)e=a[s],v(t,e),m(t,e),l[e._id]=1;g(t);t:for(var c=0;c<i.length;c++){var u,f=i[c],p=null;for(u in f)if(l[(e=d.getFromId(t,u))._id]){if(!1===e.autorange)continue t;r=o.simpleMap(e.range,e.r2l),p?p[0]<p[1]?(p[0]=Math.min(p[0],r[0]),p[1]=Math.max(p[1],r[1])):(p[0]=Math.max(p[0],r[0]),p[1]=Math.min(p[1],r[1])):p=r}for(u in f)(e=d.getFromId(t,u)).range=o.simpleMap(p,e.l2r),e._input.range=e.range.slice(),e.setScale()}},r.finalDraw=function(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":42,"../components/drawing":63,"../components/modebar":100,"../components/titles":129,"../constants/alignment":136,"../lib":159,"../lib/clear_gl_canvases":148,"../plots/cartesian/autorange":202,"../plots/cartesian/axes":203,"../plots/cartesian/constraints":210,"../plots/plots":235,"../registry":243,d3:7}],195:[function(t,e,r){"use strict";var n=t("../lib"),a=n.isPlainObject,i=t("./plot_schema"),o=t("../plots/plots"),l=t("../plots/attributes"),s=t("./plot_template"),c=t("./plot_config").dfltConfig;function u(t,e){t=n.extendDeep({},t);var r,i,o=Object.keys(t).sort();function l(e,r,n){if(a(r)&&a(e))u(e,r);else if(Array.isArray(r)&&Array.isArray(e)){var o=s.arrayTemplater({_template:t},n);for(i=0;i<r.length;i++){var l=r[i],c=o.newItem(l)._template;c&&u(c,l)}var f=o.defaultItems();for(i=0;i<f.length;i++)r.push(f[i]._template);for(i=0;i<r.length;i++)delete r[i].templateitemname}}for(r=0;r<o.length;r++){var c=o[r],d=t[c];if(c in e?l(d,e[c],c):e[c]=d,f(c)===c)for(var p in e){var h=f(p);p===h||h!==c||p in t||l(d,e[p],c)}}}function f(t){return t.replace(/[0-9]+$/,"")}function d(t,e,r,i,o){var l=o&&r(o);for(var c in t){var u=t[c],h=p(t,c,i),g=p(t,c,o),v=r(g);if(!v){var m=f(c);m!==c&&(v=r(g=p(t,m,o)))}if((!l||l!==v)&&!(!v||v._noTemplating||"data_array"===v.valType||v.arrayOk&&Array.isArray(u)))if(!v.valType&&a(u))d(u,e,r,h,g);else if(v._isLinkedToArray&&Array.isArray(u))for(var y=!1,x=0,b={},_=0;_<u.length;_++){var w=u[_];if(a(w)){var k=w.name;if(k)b[k]||(d(w,e,r,p(u,x,h),p(u,x,g)),x++,b[k]=1);else if(!y){var T=p(t,s.arrayDefaultKey(c),i),M=p(u,x,h);d(w,e,r,M,p(u,x,g));var A=n.nestedProperty(e,M);n.nestedProperty(e,T).set(A.get()),A.set(null),y=!0}}}else{n.nestedProperty(e,h).set(u)}}}function p(t,e,r){return r?Array.isArray(t)?r+"["+e+"]":r+"."+e:e}function h(t){for(var e=0;e<t.length;e++)if(a(t[e]))return!0}function g(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:c},{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 s={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,{},l,"type"),a=s.data[r];a||(a=s.data[r]=[]),a.push(e)}),d(r,s.layout,function(t,e){return i.getLayoutValObject(t,n.nestedProperty({},e).parts)}.bind(null,r)),delete s.layout.template;var f=r.template;if(a(f)){var p,h,g,v,m,y,x=f.layout;a(x)&&u(x,s.layout);var b=f.data;if(a(b)){for(h in s.data)if(g=b[h],Array.isArray(g)){for(y=(m=s.data[h]).length,v=g.length,p=0;p<y;p++)u(g[p%v],m[p]);for(p=y;p<v;p++)m.push(n.extendDeep({},g[p]))}for(h in b)h in s.data||(s.data[h]=n.extendDeep([],b[h]))}}return s},r.validateTemplate=function(t,e){var r=n.extendDeep({},{_context:c,data:t.data,layout:t.layout}),i=r.layout||{};a(e)||(e=i.template||{});var l=e.layout,s=e.data,u=[];r.layout=i,r.layout.template=e,o.supplyDefaults(r);var d=r._fullLayout,v=r._fullData,m={};if(a(l)?(!function t(e,r){for(var n in e)if("_"!==n.charAt(0)&&a(e[n])){var i,o=f(n),l=[];for(i=0;i<r.length;i++)l.push(p(e,n,r[i])),o!==n&&l.push(p(e,o,r[i]));for(i=0;i<l.length;i++)m[l[i]]=1;t(e[n],l)}}(d,["layout"]),function t(e,r){for(var n in e)if(-1===n.indexOf("defaults")&&a(e[n])){var i=p(e,n,r);m[i]?t(e[n],i):u.push({code:"unused",path:i})}}(l,"layout")):u.push({code:"layout"}),a(s)){for(var y,x={},b=0;b<v.length;b++){var _=v[b];x[y=_.type]=(x[y]||0)+1,_._fullInput._template||u.push({code:"missing",index:_._fullInput.index,traceType:y})}for(y in s){var w=s[y].length,k=x[y]||0;w>k?u.push({code:"unused",traceType:y,templateCount:w,dataCount:k}):k>w&&u.push({code:"reused",traceType:y,templateCount:w,dataCount:k})}}else u.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var i=e[n],o=p(e,n,r);a(i)?(Array.isArray(e)&&!1===i._template&&i.templateitemname&&u.push({code:"missing",path:o,templateitemname:i.templateitemname}),t(i,o)):Array.isArray(i)&&h(i)&&t(i,o)}}({data:v,layout:d},""),u.length)return u.map(g)}},{"../lib":159,"../plots/attributes":200,"../plots/plots":235,"./plot_config":191,"./plot_schema":192,"./plot_template":193}],196:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./plot_api"),i=t("../lib"),o=t("../snapshot/helpers"),l=t("../snapshot/tosvg"),s=t("../snapshot/svgtoimg"),c={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,u,f,d;function p(t){return!(t in e)||i.validate(e[t],c[t])}if(e=e||{},i.isPlainObject(t)?(r=t.data||[],u=t.layout||{},f=t.config||{},d={}):(t=i.getGraphDiv(t),r=i.extendDeep([],t.data),u=i.extendDeep({},t.layout),f=t._context,d=t._fullLayout||{}),!p("width")&&null!==e.width||!p("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!p("format"))throw new Error("Image format is not jpeg, png, svg or webp.");var h={};function g(t,r){return i.coerce(e,h,c,t,r)}var v=g("format"),m=g("width"),y=g("height"),x=g("scale"),b=g("setBackground"),_=g("imageDataOnly"),w=document.createElement("div");w.style.position="absolute",w.style.left="-5000px",document.body.appendChild(w);var k=i.extendFlat({},u);m?k.width=m:null===e.width&&n(d.width)&&(k.width=d.width),y?k.height=y:null===e.height&&n(d.height)&&(k.height=d.height);var T=i.extendFlat({},f,{_exportedPlot:!0,staticPlot:!0,setBackground:b}),M=o.getRedrawFunc(w);function A(){return new Promise(function(t){setTimeout(t,o.getDelay(w._fullLayout))})}function L(){return new Promise(function(t,e){var r=l(w,v,x),n=w._fullLayout.width,c=w._fullLayout.height;if(a.purge(w),document.body.removeChild(w),"svg"===v)return t(_?r:o.encodeSVG(r));var u=document.createElement("canvas");u.id=i.randstr(),s({format:v,width:n,height:c,scale:x,canvas:u,svg:r,promise:!0}).then(t).catch(e)})}return new Promise(function(t,e){a.plot(w,r,k,T).then(M).then(A).then(L).then(function(e){t(function(t){return _?t.replace(o.IMAGE_URL_PREFIX,""):t}(e))}).catch(function(t){e(t)})})}},{"../lib":159,"../snapshot/helpers":247,"../snapshot/svgtoimg":249,"../snapshot/tosvg":251,"./plot_api":190,"fast-isnumeric":9}],197:[function(t,e,r){"use strict";var n=t("../lib"),a=t("../plots/plots"),i=t("./plot_schema"),o=t("./plot_config").dfltConfig,l=n.isPlainObject,s=Array.isArray,c=n.isArrayOrTypedArray;function u(t,e,r,a,i,o){o=o||[];for(var f=Object.keys(t),d=0;d<f.length;d++){var v=f[d];if("transforms"!==v){var m=o.slice();m.push(v);var y=t[v],x=e[v],b=g(r,v),_=(b||{}).valType,w="info_array"===_,k="colorscale"===_,T=(b||{}).items;if(h(r,v))if(l(y)&&l(x)&&"any"!==_)u(y,x,b,a,i,m);else if(w&&s(y)){y.length>x.length&&a.push(p("unused",i,m.concat(x.length)));var M,A,L,S,C,O=x.length,P=Array.isArray(T);if(P&&(O=Math.min(O,T.length)),2===b.dimensions)for(A=0;A<O;A++)if(s(y[A])){y[A].length>x[A].length&&a.push(p("unused",i,m.concat(A,x[A].length)));var D=x[A].length;for(M=0;M<(P?Math.min(D,T[A].length):D);M++)L=P?T[A][M]:T,S=y[A][M],C=x[A][M],n.validate(S,L)?C!==S&&C!==+S&&a.push(p("dynamic",i,m.concat(A,M),S,C)):a.push(p("value",i,m.concat(A,M),S))}else a.push(p("array",i,m.concat(A),y[A]));else for(A=0;A<O;A++)L=P?T[A]:T,S=y[A],C=x[A],n.validate(S,L)?C!==S&&C!==+S&&a.push(p("dynamic",i,m.concat(A),S,C)):a.push(p("value",i,m.concat(A),S))}else if(b.items&&!w&&s(y)){var z,R,E=T[Object.keys(T)[0]],I=[];for(z=0;z<x.length;z++){var F=x[z]._index||z;if((R=m.slice()).push(F),l(y[F])&&l(x[z])){I.push(F);var N=y[F],j=x[z];l(N)&&!1!==N.visible&&!1===j.visible?a.push(p("invisible",i,R)):u(N,j,E,a,i,R)}}for(z=0;z<y.length;z++)(R=m.slice()).push(z),l(y[z])?-1===I.indexOf(z)&&a.push(p("unused",i,R)):a.push(p("object",i,R,y[z]))}else!l(y)&&l(x)?a.push(p("object",i,m,y)):c(y)||!c(x)||w||k?v in e?n.validate(y,b)?"enumerated"===b.valType&&(b.coerceNumber&&y!==+x||y!==x)&&a.push(p("dynamic",i,m,y,x)):a.push(p("value",i,m,y)):a.push(p("unused",i,m,y)):a.push(p("array",i,m,y));else a.push(p("schema",i,m))}}return a}e.exports=function(t,e){var r,c,f=i.get(),d=[],h={_context:n.extendFlat({},o)};s(t)?(h.data=n.extendDeep([],t),r=t):(h.data=[],r=[],d.push(p("array","data"))),l(e)?(h.layout=n.extendDeep({},e),c=e):(h.layout={},c={},arguments.length>1&&d.push(p("object","layout"))),a.supplyDefaults(h);for(var g=h._fullData,v=r.length,m=0;m<v;m++){var y=r[m],x=["data",m];if(l(y)){var b=g[m],_=b.type,w=f.traces[_].attributes;w.type={valType:"enumerated",values:[_]},!1===b.visible&&!1!==y.visible&&d.push(p("invisible",x)),u(y,b,w,d,x);var k=y.transforms,T=b.transforms;if(k){s(k)||d.push(p("array",x,["transforms"])),x.push("transforms");for(var M=0;M<k.length;M++){var A=["transforms",M],L=k[M].type;if(l(k[M])){var S=f.transforms[L]?f.transforms[L].attributes:{};S.type={valType:"enumerated",values:Object.keys(f.transforms)},u(k[M],T[M],S,d,x,A)}else d.push(p("object",x,A))}}}else d.push(p("object",x))}return u(c,h._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],l=o.layoutAttributes;l&&(i.subplot?n.extendFlat(r[o.attributes.subplot.dflt],l):n.extendFlat(r,l))}return r}(f,g),d,"layout"),0===d.length?void 0:d};var f={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=l(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 s(t)?"In data trace "+t[1]+", ":"In "+t+", "}function p(t,e,r,a,i){var o,l;r=r||"",s(e)?(o=e[0],l=e[1]):(o=e,l=null);var c=function(t){if(!s(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),u=f[t](e,c,a,i);return n.log(u),{code:t,container:o,trace:l,path:r,astr:c,msg:u}}function h(t,e){var r=m(e),n=r.keyMinusId,a=r.id;return!!(n in t&&t[n]._isSubplotObj&&a)||e in t}function g(t,e){return e in t?t[e]:t[m(e).keyMinusId]}var v=n.counterRegex("([a-z]+)");function m(t){var e=t.match(v);return{keyMinusId:e&&e[1],id:e&&e[2]}}},{"../lib":159,"../plots/plots":235,"./plot_config":191,"./plot_schema":192}],198:[function(t,e,r){"use strict";e.exports={mode:{valType:"enumerated",dflt:"afterall",values:["immediate","next","afterall"]},direction:{valType:"enumerated",values:["forward","reverse"],dflt:"forward"},fromcurrent:{valType:"boolean",dflt:!1},frame:{duration:{valType:"number",min:0,dflt:500},redraw:{valType:"boolean",dflt:!0}},transition:{duration:{valType:"number",min:0,dflt:500,editType:"none"},easing:{valType:"enumerated",dflt:"cubic-in-out",values:["linear","quad","cubic","sin","exp","circle","elastic","back","bounce","linear-in","quad-in","cubic-in","sin-in","exp-in","circle-in","elastic-in","back-in","bounce-in","linear-out","quad-out","cubic-out","sin-out","exp-out","circle-out","elastic-out","back-out","bounce-out","linear-in-out","quad-in-out","cubic-in-out","sin-in-out","exp-in-out","circle-in-out","elastic-in-out","back-in-out","bounce-in-out"],editType:"none"},ordering:{valType:"enumerated",values:["layout first","traces first"],dflt:"layout first",editType:"none"}}}},{}],199:[function(t,e,r){"use strict";var n=t("../lib"),a=t("../plot_api/plot_template");e.exports=function(t,e,r){var i,o,l=r.name,s=r.inclusionAttr||"visible",c=e[l],u=n.isArrayOrTypedArray(t[l])?t[l]:[],f=e[l]=[],d=a.arrayTemplater(e,l,s);for(i=0;i<u.length;i++){var p=u[i];n.isPlainObject(p)?o=d.newItem(p):(o=d.newItem({}))[s]=!1,o._index=i,!1!==o[s]&&r.handleItemDefaults(p,o,e,r),f.push(o)}var h=d.defaultItems();for(i=0;i<h.length;i++)(o=h[i])._index=f.length,r.handleItemDefaults({},o,e,r,{}),f.push(o);if(n.isArrayOrTypedArray(c)){var g=Math.min(c.length,f.length);for(i=0;i<g;i++)n.relinkPrivateKeys(f[i],c[i])}return f}},{"../lib":159,"../plot_api/plot_template":193}],200:[function(t,e,r){"use strict";var n=t("../components/fx/attributes");e.exports={type:{valType:"enumerated",values:[],dflt:"scatter",editType:"calc+clearAxisTypes",_noTemplating:!0},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0,editType:"calc"},showlegend:{valType:"boolean",dflt:!0,editType:"style"},legendgroup:{valType:"string",dflt:"",editType:"style"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"style"},name:{valType:"string",editType:"style"},uid:{valType:"string",editType:"plot",anim:!0},ids:{valType:"data_array",editType:"calc",anim:!0},customdata:{valType:"data_array",editType:"calc"},meta:{valType:"any",arrayOk:!0,editType:"plot"},selectedpoints:{valType:"any",editType:"calc"},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none","skip"],arrayOk:!0,dflt:"all",editType:"none"},hoverlabel:n.hoverlabel,stream:{token:{valType:"string",noBlank:!0,strict:!0,editType:"calc"},maxpoints:{valType:"number",min:0,max:1e4,dflt:500,editType:"calc"},editType:"calc"},transforms:{_isLinkedToArray:"transform",editType:"calc"},uirevision:{valType:"any",editType:"none"}}},{"../components/fx/attributes":72}],201:[function(t,e,r){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],202:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../constants/numerical").FP_SAFE,o=t("../../registry");function l(t,e){var r,n,i=[],o=s(e),l=c(t,e),u=l.min,f=l.max;if(0===u.length||0===f.length)return a.simpleMap(e.range,e.r2l);var d=u[0].val,p=f[0].val;for(r=1;r<u.length&&d===p;r++)d=Math.min(d,u[r].val);for(r=1;r<f.length&&d===p;r++)p=Math.max(p,f[r].val);var h=!1;if(e.range){var g=a.simpleMap(e.range,e.r2l);h=g[1]<g[0]}"reversed"===e.autorange&&(h=!0,e.autorange=!0);var v,m,y,x,b,_,w=e.rangemode,k="tozero"===w,T="nonnegative"===w,M=e._length,A=M/10,L=0;for(r=0;r<u.length;r++)for(v=u[r],n=0;n<f.length;n++)(_=(m=f[n]).val-v.val)>0&&((b=M-o(v)-o(m))>A?_/b>L&&(y=v,x=m,L=_/b):_/M>L&&(y={val:v.val,pad:0},x={val:m.val,pad:0},L=_/M));if(d===p){var S=d-1,C=d+1;if(k)if(0===d)i=[0,1];else{var O=(d>0?f:u).reduce(function(t,e){return Math.max(t,o(e))},0),P=d/(1-Math.min(.5,O/M));i=d>0?[0,P]:[P,0]}else i=T?[Math.max(0,S),Math.max(1,C)]:[S,C]}else k?(y.val>=0&&(y={val:0,pad:0}),x.val<=0&&(x={val:0,pad:0})):T&&(y.val-L*o(y)<0&&(y={val:0,pad:0}),x.val<=0&&(x={val:1,pad:0})),L=(x.val-y.val)/(M-o(y)-o(x)),i=[y.val-L*o(y),x.val+L*o(x)];return h&&i.reverse(),a.simpleMap(i,e.l2r||Number)}function s(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 c(t,e){var r,n,a,i=e._id,o=t._fullData,l=t._fullLayout,s=[],c=[];function d(t,e){for(r=0;r<e.length;r++){var o=t[e[r]],l=(o._extremes||{})[i];if(!0===o.visible&&l){for(n=0;n<l.min.length;n++)a=l.min[n],u(s,a.val,a.pad,{extrapad:a.extrapad});for(n=0;n<l.max.length;n++)a=l.max[n],f(c,a.val,a.pad,{extrapad:a.extrapad})}}}return d(o,e._traceIndices),d(l.annotations||[],e._annIndices||[]),d(l.shapes||[],e._shapeIndices||[]),{min:s,max:c}}function u(t,e,r,n){d(t,e,r,n,h)}function f(t,e,r,n){d(t,e,r,n,g)}function d(t,e,r,n,a){for(var i=n.tozero,o=n.extrapad,l=!0,s=0;s<t.length&&l;s++){var c=t[s];if(a(c.val,e)&&c.pad>=r&&(c.extrapad||!o)){l=!1;break}a(e,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(t.splice(s,1),s--)}if(l){var u=i&&0===e;t.push({val:e,pad:u?0:r,extrapad:!u&&o})}}function p(t){return n(t)&&Math.abs(t)<i}function h(t,e){return t<=e}function g(t,e){return t>=e}e.exports={getAutoRange:l,makePadFn:s,doAutoRange:function(t,e){if(e.setScale(),e.autorange){e.range=l(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 s=i.rangeslider[e._name];s&&"auto"===s.rangemode&&(s.range=l(t,e)),i._input.rangeslider[e._name]=a.extendFlat({},s)}},findExtremes:function(t,e,r){r||(r={});t._m||t.setScale();var a,o,l,s,c,d,h,g,v,m=[],y=[],x=e.length,b=r.padded||!1,_=r.tozero&&("linear"===t.type||"-"===t.type),w="log"===t.type,k=!1,T=r.vpadLinearized||!1;function M(t){if(Array.isArray(t))return k=!0,function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}var A=M((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),L=M((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=M(r.vpadplus||r.vpad),C=M(r.vpadminus||r.vpad);if(!k){if(g=1/0,v=-1/0,w)for(a=0;a<x;a++)(o=e[a])<g&&o>0&&(g=o),o>v&&o<i&&(v=o);else for(a=0;a<x;a++)(o=e[a])<g&&o>-i&&(g=o),o>v&&o<i&&(v=o);e=[g,v],x=2}var O={tozero:_,extrapad:b};function P(r){l=e[r],n(l)&&(d=A(r),h=L(r),T?(s=t.c2l(l)-C(r),c=t.c2l(l)+S(r)):(g=l-C(r),v=l+S(r),w&&g<v/10&&(g=v/10),s=t.c2l(g),c=t.c2l(v)),_&&(s=Math.min(0,s),c=Math.max(0,c)),p(s)&&u(m,s,h,O),p(c)&&f(y,c,d,O))}var D=Math.min(6,x);for(a=0;a<D;a++)P(a);for(a=x-1;a>=D;a--)P(a);return{min:m,max:y,opts:r}},concatExtremes:c}},{"../../constants/numerical":139,"../../lib":159,"../../registry":243,"fast-isnumeric":9}],203:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../../plots/plots"),o=t("../../registry"),l=t("../../lib"),s=t("../../lib/svg_text_utils"),c=t("../../components/titles"),u=t("../../components/color"),f=t("../../components/drawing"),d=t("./layout_attributes"),p=t("./clean_ticks"),h=t("../../constants/numerical"),g=h.ONEAVGYEAR,v=h.ONEAVGMONTH,m=h.ONEDAY,y=h.ONEHOUR,x=h.ONEMIN,b=h.ONESEC,_=h.MINUS_SIGN,w=h.BADNUM,k=t("../../constants/alignment"),T=k.MID_SHIFT,M=k.CAP_SHIFT,A=k.LINE_SPACING,L=k.OPPOSITE_SIDE,S=e.exports={};S.setConvert=t("./set_convert");var C=t("./axis_autotype"),O=t("./axis_ids");S.id2name=O.id2name,S.name2id=O.name2id,S.cleanId=O.cleanId,S.list=O.list,S.listIds=O.listIds,S.getFromId=O.getFromId,S.getFromTrace=O.getFromTrace;var P=t("./autorange");S.getAutoRange=P.getAutoRange,S.findExtremes=P.findExtremes,S.coerceRef=function(t,e,r,n,a,i){var o=n.charAt(n.length-1),s=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return a||(a=s[0]||i),i||(i=a),u[c]={valType:"enumerated",values:s.concat(i?[i]:[]),dflt:a},l.coerce(t,e,u,c)},S.coercePosition=function(t,e,r,n,a,i){var o,s;if("paper"===n||"pixel"===n)o=l.ensureNumber,s=r(a,i);else{var c=S.getFromId(e,n);s=r(a,i=c.fraction2r(i)),o=c.cleanPos}t[a]=o(s)},S.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?l.ensureNumber:S.getFromId(e,r).cleanPos)(t)},S.redrawComponents=function(t,e){e=e||S.listIds(t);var r=t._fullLayout;function n(n,a,i,l){for(var s=o.getComponentMethod(n,a),c={},u=0;u<e.length;u++)for(var f=r[S.id2name(e[u])][i],d=0;d<f.length;d++){var p=f[d];if(!c[p]&&(s(t,p),c[p]=1,l))return}}n("annotations","drawOne","_annIndices"),n("shapes","drawOne","_shapeIndices"),n("images","draw","_imgIndices",!0)};var D=S.getDataConversions=function(t,e,r,n){var a,i="x"===r||"y"===r||"z"===r?r:n;if(Array.isArray(i)){if(a={type:C(n),_categories:[]},S.setConvert(a),"category"===a.type)for(var o=0;o<n.length;o++)a.d2c(n[o])}else a=S.getFromTrace(t,e,i);return a?{d2c:a.d2c,c2d:a.c2d}:"ids"===i?{d2c:R,c2d:R}:{d2c:z,c2d:z}};function z(t){return+t}function R(t){return String(t)}S.getDataToCoordFunc=function(t,e,r,n){return D(t,e,r,n).d2c},S.counterLetter=function(t){var e=t.charAt(0);return"x"===e?"y":"y"===e?"x":void 0},S.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},S.saveRangeInitial=function(t,e){for(var r=S.list(t,"",!0),n=!1,a=0;a<r.length;a++){var i=r[a],o=void 0===i._rangeInitial,l=o||!(i.range[0]===i._rangeInitial[0]&&i.range[1]===i._rangeInitial[1]);(o&&!1===i.autorange||e&&l)&&(i._rangeInitial=i.range.slice(),n=!0)}return n},S.saveShowSpikeInitial=function(t,e){for(var r=S.list(t,"",!0),n=!1,a="on",i=0;i<r.length;i++){var o=r[i],l=void 0===o._showSpikeInitial,s=l||!(o.showspikes===o._showspikes);(l||e&&s)&&(o._showSpikeInitial=o.showspikes,n=!0),"on"!==a||o.showspikes||(a="off")}return t._fullLayout._cartesianSpikesEnabled=a,n},S.autoBin=function(t,e,r,n,i,o){var s,c=l.aggNums(Math.min,null,t),u=l.aggNums(Math.max,null,t);if("category"===e.type||"multicategory"===e.type)return{start:c-.5,end:u+.5,size:Math.max(1,Math.round(o)||1),_dataSpan:u-c};if(i||(i=e.calendar),s="log"===e.type?{type:"linear",range:[c,u]}:{type:e.type,range:l.simpleMap([c,u],e.c2r,0,i),calendar:i},S.setConvert(s),o=o&&p.dtick(o,s.type))s.dtick=o,s.tick0=p.tick0(void 0,s.type,i);else{var f;if(r)f=(u-c)/r;else{var d=l.distinctVals(t),h=Math.pow(10,Math.floor(Math.log(d.minDiff)/Math.LN10)),g=h*l.roundUp(d.minDiff/h,[.9,1.9,4.9,9.9],!0);f=Math.max(g,2*l.stdev(t)/Math.pow(t.length,n?.25:.4)),a(f)||(f=1)}S.autoTicks(s,f)}var v,y=s.dtick,x=S.tickIncrement(S.tickFirst(s),y,"reverse",i);if("number"==typeof y)v=(x=function(t,e,r,n,i){var o=0,l=0,s=0,c=0;function u(e){return(1+100*(e-t)/r.dtick)%100<2}for(var f=0;f<e.length;f++)e[f]%1==0?s++:a(e[f])||c++,u(e[f])&&o++,u(e[f]+r.dtick/2)&&l++;var d=e.length-c;if(s===d&&"date"!==r.type)r.dtick<1?t=n-.5*r.dtick:(t-=.5)+r.dtick<n&&(t+=r.dtick);else if(l<.1*d&&(o>.3*d||u(n)||u(i))){var p=r.dtick/2;t+=t+p<n?p:-p}return t}(x,t,s,c,u))+(1+Math.floor((u-x)/y))*y;else for("M"===s.dtick.charAt(0)&&(x=function(t,e,r,n,a){var i=l.findExactDates(e,a);if(i.exactDays>.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?t=S.tickIncrement(t,"M6","reverse")+1.5*m:i.exactMonths>.8?t=S.tickIncrement(t,"M1","reverse")+15.5*m:t-=m/2;var s=S.tickIncrement(t,r);if(s<=n)return s}return t}(x,t,y,c,i)),v=x,0;v<=u;)v=S.tickIncrement(v,y,!1,i),0;return{start:e.c2r(x,0,i),end:e.c2r(v,0,i),size:y,_dataSpan:u-c}},S.prepTicks=function(t){var e=l.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=l.constrain(t._length/r,4,9)+1),"radialaxis"===t._name&&(n*=2)),"array"===t.tickmode&&(n*=100),S.autoTicks(t,Math.abs(e[1]-e[0])/n),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),"date"===t.type&&t.dtick<.1&&(t.dtick=.1),q(t)},S.calcTicks=function(t){S.prepTicks(t);var e=l.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=l.simpleMap(t.range,t.r2l),i=1.0001*a[0]-1e-4*a[1],o=1.0001*a[1]-1e-4*a[0],s=Math.min(i,o),c=Math.max(i,o),u=0;Array.isArray(r)||(r=[]);var f="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 p=f(e[d]);p>s&&p<c&&(void 0===r[d]?n[u]=S.tickText(t,p):n[u]=U(t,p,String(r[d])),u++)}u<e.length&&n.splice(u,e.length-u);return n}(t);t._tmin=S.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 s="log"===t.type&&!(a(t.dtick)||"L"===t.dtick.charAt(0)),c=null,u=Math.max(1e3,t._length||0),f=t._tmin;(i?f>=n:f<=n)&&!(o.length>u||f===c);f=S.tickIncrement(f,t.dtick,i,t.calendar)){c=f;var d=!1;s&&f!==(0|f)&&(d=!0),o.push({minor:d,value:f})}ot(t)&&360===Math.abs(e[1]-e[0])&&o.pop(),t._tmax=(o[o.length-1]||{}).value,t._prevDateHead="",t._inCalcTicks=!0;for(var p=new Array(o.length),h=0;h<o.length;h++)p[h]=S.tickText(t,o[h].value,!1,o[h].minor);return t._inCalcTicks=!1,p};var E=[2,5,10],I=[1,2,3,6,12],F=[1,2,5,10,15,30],N=[1,2,3,7,14],j=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],B=[-.301,0,.301,.699,1],H=[15,30,45,90,180];function V(t,e,r){return e*l.roundUp(t/e,r)}function q(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>=m&&i<=10||e>=15*m)t._tickround="d";else if(e>=x&&i<=16||e>=y)t._tickround="M";else if(e>=b&&i<=19||e>=x)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 l=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 s=Math.max(Math.abs(l[0]),Math.abs(l[1])),c=Math.floor(Math.log(s)/Math.LN10+.01);Math.abs(c)>3&&(Z(t.exponentformat)&&!X(c)?t._tickexponent=3*Math.round((c-1)/3):t._tickexponent=c)}else t._tickround=null}function U(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}}S.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=l.dateTick0(t.calendar);var i=2*e;i>g?(e/=g,r=n(10),t.dtick="M"+12*V(e,r,E)):i>v?(e/=v,t.dtick="M"+V(e,1,I)):i>m?(t.dtick=V(e,m,N),t.tick0=l.dateTick0(t.calendar,!0)):i>y?t.dtick=V(e,y,I):i>x?t.dtick=V(e,x,F):i>b?t.dtick=V(e,b,F):(r=n(10),t.dtick=V(e,r,E))}else if("log"===t.type){t.tick0=0;var o=l.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(o[1]-o[0])<1){var s=1.5*Math.abs((o[1]-o[0])/e);e=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/s,r=n(10),t.dtick="L"+V(e,r,E)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):ot(t)?(t.tick0=0,r=1,t.dtick=V(e,r,H)):(t.tick0=0,r=n(10),t.dtick=V(e,r,E));if(0===t.dtick&&(t.dtick=1),!a(t.dtick)&&"string"!=typeof t.dtick){var c=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(c)}},S.tickIncrement=function(t,e,r,i){var o=r?-1:1;if(a(e))return t+o*e;var s=e.charAt(0),c=o*Number(e.substr(1));if("M"===s)return l.incrementMonth(t,c,i);if("L"===s)return Math.log(Math.pow(10,t)+c)/Math.LN10;if("D"===s){var u="D2"===e?B:j,f=t+.01*o,d=l.roundUp(l.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(e)},S.tickFirst=function(t){var e=t.r2l||Number,r=l.simpleMap(t.range,e),i=r[1]<r[0],o=i?Math.floor:Math.ceil,s=1.0001*r[0]-1e-4*r[1],c=t.dtick,u=e(t.tick0);if(a(c)){var f=o((s-u)/c)*c+u;return"category"!==t.type&&"multicategory"!==t.type||(f=l.constrain(f,0,t._categories.length-1)),f}var d=c.charAt(0),p=Number(c.substr(1));if("M"===d){for(var h,g,v,m=0,y=u;m<10;){if(((h=S.tickIncrement(y,c,i,t.calendar))-s)*(y-s)<=0)return i?Math.min(y,h):Math.max(y,h);g=(s-(y+h)/2)/(h-y),v=d+(Math.abs(Math.round(g))||1)*p,y=S.tickIncrement(y,v,g<0?!i:i,t.calendar),m++}return l.error("tickFirst did not converge",t),y}if("L"===d)return Math.log(o((Math.pow(10,s)-u)/p)*p+u)/Math.LN10;if("D"===d){var x="D2"===c?B:j,b=l.roundUp(l.mod(s,1),x,i);return Math.floor(s)+Math.log(n.round(Math.pow(10,b),1))/Math.LN10}throw"unrecognized dtick "+String(c)},S.tickText=function(t,e,r,n){var i,o=U(t,e),s="array"===t.tickmode,c=r||s,u=t.type,f="category"===u?t.d2l_noadd:t.d2l;if(s&&Array.isArray(t.ticktext)){var d=l.simpleMap(t.range,t.r2l),p=Math.abs(d[1]-d[0])/1e4;for(i=0;i<t.ticktext.length&&!(Math.abs(e-f(t.tickvals[i]))<p);i++);if(i<t.ticktext.length)return o.text=String(t.ticktext[i]),o}function h(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 g=r?"never":"none"!==t.exponentformat&&h(t.showexponent)?"hide":"";if("date"===u?function(t,e,r,n){var i=t._tickround,o=r&&t.hoverformat||S.getTickFormat(t);n&&(i=a(i)?4:{y:"m",m:"d",d:"M",M:"S",S:4}[i]);var s,c=l.formatDate(e.x,o,i,t._dateFormat,t.calendar,t._extraFormat),u=c.indexOf("\n");-1!==u&&(s=c.substr(u+1),c=c.substr(0,u));n&&("00:00:00"===c||"00:00"===c?(c=s,s=""):8===c.length&&(c=c.replace(/:00$/,"")));s&&(r?"d"===i?c+=", "+s:c=s+(c?", "+c:""):t._inCalcTicks&&s===t._prevDateHead||(c+="<br>"+s,t._prevDateHead=s));e.text=c}(t,o,r,c):"log"===u?function(t,e,r,n,i){var o=t.dtick,s=e.x,c=t.tickformat,u="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)e.text=Y(Math.pow(10,s),t,i,n);else if(a(o)||"D"===u&&l.mod(s+.01,1)<.1){var f=Math.round(s),d=Math.abs(f),p=t.exponentformat;"power"===p||Z(p)&&X(f)?(e.text=0===f?1:1===f?"10":"10<sup>"+(f>1?"":_)+d+"</sup>",e.fontSize*=1.25):("e"===p||"E"===p)&&d>2?e.text="1"+p+(f>0?"+":_)+d:(e.text=Y(Math.pow(10,s),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,l.mod(s,1)))),e.fontSize*=.75}if("D1"===t.dtick){var h=String(e.text).charAt(0);"0"!==h&&"1"!==h||("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*(s<0?.5:.25)))}}(t,o,0,c,g):"category"===u?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r="");e.text=String(r)}(t,o):"multicategory"===u?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):ot(t)?function(t,e,r,n,a){if("radians"!==t.thetaunit||r)e.text=Y(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){var r=1;for(;!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=Y(l.deg2rad(e.x),t,a,n);else{var s=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["<sup>",o[0],"</sup>","\u2044","<sub>",o[1],"</sub>","\u03c0"].join(""),s&&(e.text=_+e.text)}}}}(t,o,r,c,g):function(t,e,r,n,a){"never"===a?a="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(a="hide");e.text=Y(e.x,t,a,n)}(t,o,0,c,g),n||(t.tickprefix&&!h(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!h(t.showticksuffix)&&(o.text+=t.ticksuffix)),"boundaries"===t.tickson||t.showdividers){var v=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};o.xbnd=[v(o.x-.5),v(o.x+t.dtick-.5)]}return o},S.hoverLabelText=function(t,e,r){if(r!==w&&r!==e)return S.hoverLabelText(t,e)+" - "+S.hoverLabelText(t,r);var n="log"===t.type&&e<=0,a=S.tickText(t,t.c2l(n?-e:e),"hover").text;return n?0===e?"0":_+a:a};var G=["f","p","n","\u03bc","m","","k","M","G","T"];function Z(t){return"SI"===t||"B"===t}function X(t){return t>14||t<-15}function Y(t,e,r,n){var i=t<0,o=e._tickround,s=r||e.exponentformat||"B",c=e._tickexponent,u=S.getTickFormat(e),f=e.separatethousands;if(n){var d={exponentformat:s,dtick:"none"===e.showexponent?e.dtick:a(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};q(d),o=(Number(d._tickround)||0)+4,c=d._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return e._numFormat(u)(t).replace(/-/g,_);var p,h=Math.pow(10,-o)/2;if("none"===s&&(c=0),(t=Math.abs(t))<h)t="0",i=!1;else{if(t+=h,c&&(t*=Math.pow(10,-c),o+=c),0===o)t=String(Math.floor(t));else if(o<0){t=(t=String(Math.round(t))).substr(0,t.length+o);for(var g=o;g<0;g++)t+="0"}else{var v=(t=String(t)).indexOf(".")+1;v&&(t=t.substr(0,v+o).replace(/\.?0+$/,""))}t=l.numSeparate(t,e._separators,f)}c&&"hide"!==s&&(Z(s)&&X(c)&&(s="power"),p=c<0?_+-c:"power"!==s?"+"+c:String(c),"e"===s||"E"===s?t+=s+p:"power"===s?t+="\xd710<sup>"+p+"</sup>":"B"===s&&9===c?t+="B":Z(s)&&(t+=G[c/3+5]));return i?_+t:t}function W(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(U(t,l.interp(n[o],.5),o));return r}function $(t){return[t.text,t.x,t.axInfo,t.font,t.fontSize,t.fontColor].join("_")}function Q(t){var e=t.title.font.size,r=(t.title.text.match(s.BR_TAG_ALL)||[]).length;return t.title.hasOwnProperty("standoff")?r?e*(M+r*A):e*M:r?e*(r+1)*A:e}function J(t,e){var r=t.l2p(e);return r>1&&r<t._length-1}function K(t){var e=n.select(t),r=e.select(".text-math-group");return r.empty()?e.select("text"):r}function tt(t){return t._id+".automargin"}function et(t){return tt(t)+".mirror"}function rt(t){return t._id+".rangeslider"}function nt(t,e){for(var r=0;r<e.length;r++)-1===t.indexOf(e[r])&&t.push(e[r])}function at(t,e,r){var n,a,i=[],o=[],s=t.layout;for(n=0;n<e.length;n++)i.push(S.getFromId(t,e[n]));for(n=0;n<r.length;n++)o.push(S.getFromId(t,r[n]));var c=Object.keys(d),u=["anchor","domain","overlaying","position","side","tickangle","editType"],f=["linear","log"];for(n=0;n<c.length;n++){var p=c[n],h=i[0][p],g=o[0][p],v=!0,m=!1,y=!1;if("_"!==p.charAt(0)&&"function"!=typeof h&&-1===u.indexOf(p)){for(a=1;a<i.length&&v;a++){var x=i[a][p];"type"===p&&-1!==f.indexOf(h)&&-1!==f.indexOf(x)&&h!==x?m=!0:x!==h&&(v=!1)}for(a=1;a<o.length&&v;a++){var b=o[a][p];"type"===p&&-1!==f.indexOf(g)&&-1!==f.indexOf(b)&&g!==b?y=!0:o[a][p]!==g&&(v=!1)}v&&(m&&(s[i[0]._name].type="linear"),y&&(s[o[0]._name].type="linear"),it(s,p,i,o,t._fullLayout._dfltTitle))}}for(n=0;n<t._fullLayout.annotations.length;n++){var _=t._fullLayout.annotations[n];-1!==e.indexOf(_.xref)&&-1!==r.indexOf(_.yref)&&l.swapAttrs(s.annotations[n],["?"])}}function it(t,e,r,n,a){var i,o=l.nestedProperty,s=o(t[r[0]._name],e).get(),c=o(t[n[0]._name],e).get();for("title"===e&&(s&&s.text===a.x&&(s.text=a.y),c&&c.text===a.y&&(c.text=a.x)),i=0;i<r.length;i++)o(t,r[i]._name+"."+e).set(c);for(i=0;i<n.length;i++)o(t,n[i]._name+"."+e).set(s)}function ot(t){return"angularaxis"===t._id}S.getTickFormat=function(t){var e,r,n,a,i,o,l,s;function c(t){return"string"!=typeof t?t:Number(t.replace("M",""))*v}function u(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 f(t,e){var r=null===e[0],n=null===e[1],a=u(t,e[0])>=0,i=u(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,i=n.dtickrange,o=void 0,l=void 0,s=void 0,o=c||function(t){return t},l=i[0],s=i[1],(!l&&"number"!=typeof l||o(l)<=o(a))&&(!s&&"number"!=typeof s||o(s)>=o(a)))){r=n;break}break;case"log":for(e=0;e<t.tickformatstops.length;e++)if((n=t.tickformatstops[e]).enabled&&f(t.dtick,n.dtickrange)){r=n;break}}return r?r.value:t.tickformat},S.getSubplots=function(t,e){var r=t._fullLayout._subplots,n=r.cartesian.concat(r.gl2d||[]),a=e?S.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},S.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},S.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:""},l=S.list(t,"x",!0),s=S.list(t,"y",!0),c=[];for(r=0;r<l.length;r++)for(c.push({x:l[r],y:o}),a=0;a<s.length;a++)0===r&&c.push({x:i,y:s[a]}),c.push({x:l[r],y:s[a]});var u=e._clips.selectAll(".axesclip").data(c,function(t){return t.x._id+t.y._id});u.enter().append("clipPath").classed("axesclip",!0).attr("id",function(t){return"clip"+e._uid+t.x._id+t.y._id}).append("rect"),u.exit().remove(),u.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})})}},S.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:S.listIds(t);return l.syncOrAsync(a.map(function(e){return function(){if(e){var n=S.getFromId(t,e),a=S.drawOne(t,n,r);return n._r=n.range.slice(),n._rl=l.simpleMap(n._r,n.r2l),a}}}))},S.drawOne=function(t,e,r){var n,a,s;r=r||{},e.setScale();var d=t._fullLayout,p=e._id,h=p.charAt(0),g=S.counterLetter(p),v=d._plots[e._mainSubplot];if(v){var m=v[h+"axislayer"],y=e._mainLinePosition,x=e._mainMirrorPosition,b=e._vals=S.calcTicks(e),_=[e.mirror,y,x].join("_");for(n=0;n<b.length;n++)b[n].axInfo=_;e._selections={},e._tickAngles&&(e._prevTickAngles=e._tickAngles),e._tickAngles={},e._depth=null;var w={};if(e.visible){var k,T,M=S.makeTransFn(e);if("boundaries"===e.tickson){var C=function(t,e){var r,n=[],a=function(t,e){var r=t.xbnd[e];null!==r&&n.push(l.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);T=S.clipEnds(e,C),k="inside"===e.ticks?T:C}else T=S.clipEnds(e,b),k="inside"===e.ticks?T:b;var O=e._gridVals=T,P=function(t,e){var r,n,a=[],i=function(t,e){var r=t.xbnd[e];null!==r&&a.push(l.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=e._subplotsWith,z={};for(n=0;n<D.length;n++){a=D[n];var R=(s=d._plots[a])[g+"axis"],E=R._mainAxis._id;if(!z[E]){z[E]=1;var I="x"===h?"M0,"+R._offset+"v"+R._length:"M"+R._offset+",0h"+R._length;S.drawGrid(t,e,{vals:O,counterAxis:R,layer:s.gridlayer.select("."+p),path:I,transFn:M}),S.drawZeroLine(t,e,{counterAxis:R,layer:s.zerolinelayer,path:I,transFn:M})}}}var F=S.getTickSigns(e),N=[];if(e.ticks){var j,B,H,V=S.makeTickPath(e,y,F[2]);if(e._anchorAxis&&e.mirror&&!0!==e.mirror?(j=S.makeTickPath(e,x,F[3]),B=V+j):(j="",B=V),e.showdividers&&"outside"===e.ticks&&"boundaries"===e.tickson){var q={};for(n=0;n<P.length;n++)q[P[n].x]=1;H=function(t){return q[t.x]?j:B}}else H=B;S.drawTicks(t,e,{vals:k,layer:m,path:H,transFn:M}),"allticks"===e.mirror&&(N=Object.keys(e._linepositions||{}))}for(n=0;n<N.length;n++){a=N[n],s=d._plots[a];var U=e._linepositions[a]||[],G=S.makeTickPath(e,U[0],F[0])+S.makeTickPath(e,U[1],F[1]);S.drawTicks(t,e,{vals:k,layer:s[h+"axislayer"],path:G,transFn:M})}var Z=[];if(Z.push(function(){return S.drawLabels(t,e,{vals:b,layer:m,transFn:M,labelFns:S.makeLabelFns(e,y)})}),"multicategory"===e.type){var X={x:2,y:10}[h];Z.push(function(){var r={x:"height",y:"width"}[h],n=J()[r]+X+(e._tickAngles[p+"tick"]?e.tickfont.size*A:0);return S.drawLabels(t,e,{vals:W(e,b),layer:m,cls:p+"tick2",repositionOnUpdate:!0,secondary:!0,transFn:M,labelFns:S.makeLabelFns(e,y+n*F[4])})}),Z.push(function(){return e._depth=F[4]*(J("tick2")[e.side]-y),function(t,e,r){var n=e._id+"divider",a=r.vals,i=r.layer.selectAll("path."+n).data(a,$);i.exit().remove(),i.enter().insert("path",":first-child").classed(n,1).classed("crisp",1).call(u.stroke,e.dividercolor).style("stroke-width",f.crispRound(t,e.dividerwidth,1)+"px"),i.attr("transform",r.transFn).attr("d",r.path)}(t,e,{vals:P,layer:m,path:S.makeTickPath(e,y,F[4],e._depth),transFn:M})})}else e.title.hasOwnProperty("standoff")&&Z.push(function(){e._depth=F[4]*(J()[e.side]-y)});var Y=o.getComponentMethod("rangeslider","isVisible")(e);return Z.push(function(){var r,n,a,l,s=e.side.charAt(0),c=L[e.side].charAt(0),u=S.getPxPosition(t,e),f="outside"===e.ticks?e.ticklen:0;if((e.automargin||Y)&&("multicategory"===e.type?r=J("tick2"):(r=J(),"x"===h&&"b"===s&&(e._depth=Math.max(r.width>0?r.bottom-u:0,f)))),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1];if("x"===h){if("b"===s?n[s]=e._depth:(n[s]=e._depth=Math.max(r.width>0?u-r.top:0,f),p.reverse()),r.width>0){var v=r.right-(e._offset+e._length);v>0&&(n.xr=1,n.r=v);var m=e._offset-r.left;m>0&&(n.xl=0,n.l=m)}}else if("l"===s?n[s]=e._depth=Math.max(r.height>0?u-r.left:0,f):(n[s]=e._depth=Math.max(r.height>0?r.right-u:0,f),p.reverse()),r.height>0){var y=r.bottom-(e._offset+e._length);y>0&&(n.yb=0,n.b=y);var x=e._offset-r.top;x>0&&(n.yt=1,n.t=x)}n[g]="free"===e.anchor?e.position:e._anchorAxis.domain[p[0]],e.title.text!==d._dfltTitle[h]&&(n[s]+=Q(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[c]=e.linewidth,e.mirror&&!0!==e.mirror&&(a[c]+=f),!0===e.mirror||"ticks"===e.mirror?a[g]=e._anchorAxis.domain[p[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(a[g]=[e._counterDomainMin,e._counterDomainMax][p[1]]))}Y&&(l=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),i.autoMargin(t,tt(e),n),i.autoMargin(t,et(e),a),i.autoMargin(t,rt(e),l)}),r.skipTitle||Y&&"bottom"===e.side||Z.push(function(){return function(t,e){var r,n=t._fullLayout,a=e._id,i=a.charAt(0),o=e.title.font.size;if(e.title.hasOwnProperty("standoff"))r=e._depth+e.title.standoff+Q(e);else{if("multicategory"===e.type)r=e._depth;else{r=10+1.5*o+(e.linewidth?e.linewidth-1:0)}r+="x"===i?"top"===e.side?o*(e.showticklabels?1:0):o*(e.showticklabels?1.5:.5):"right"===e.side?o*(e.showticklabels?1:.5):o*(e.showticklabels?.5:0)}var l,s,u,d,p=S.getPxPosition(t,e);"x"===i?(s=e._offset+e._length/2,u="top"===e.side?p-r:p+r):(u=e._offset+e._length/2,s="right"===e.side?p+r:p-r,l={rotate:"-90",offset:0});if("multicategory"!==e.type){var h=e._selections[e._id+"tick"];if(d={selection:h,side:e.side},h&&h.node()&&h.node().parentNode){var g=f.getTranslate(h.node().parentNode);d.offsetLeft=g.x,d.offsetTop=g.y}e.title.hasOwnProperty("standoff")&&(d.pad=0)}return c.draw(t,a+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[i],avoid:d,transform:l,attributes:{x:s,y:u,"text-anchor":"middle"}})}(t,e)}),l.syncOrAsync(Z)}}function J(t){var r=p+(t||"tick");return w[r]||(w[r]=function(t,e){var r,n,a,i;t._selections[e].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,t._selections[e].each(function(){var t=K(this),e=f.bBox(t.node().parentNode);r=Math.min(r,e.top),n=Math.max(n,e.bottom),a=Math.min(a,e.left),i=Math.max(i,e.right)})):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(e,r)),w[r]}},S.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})),t.side&&a.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),a},S.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))+")"}},S.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},S.makeLabelFns=function(t,e,r){var n=t._id.charAt(0),i="boundaries"!==t.tickson&&"outside"===t.ticks,o=0,s=0;if(i&&(o+=t.ticklen),r&&"outside"===t.ticks){var c=l.deg2rad(r);o=t.ticklen*Math.cos(c)+1,s=t.ticklen*Math.sin(c)}t.showticklabels&&(i||t.showline)&&(o+=.2*t.tickfont.size);var u,f,d,p,h={labelStandoff:o+=(t.linewidth||1)/2,labelShift:s};return"x"===n?(p="bottom"===t.side?1:-1,u=s*p,f=e+o*p,d="bottom"===t.side?1:-.2,h.xFn=function(t){return t.dx+u},h.yFn=function(t){return t.dy+f+t.fontSize*d},h.anchorFn=function(t,e){return a(e)&&0!==e&&180!==e?e*p<0?"end":"start":"middle"},h.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side?-n:0}):"y"===n&&(p="right"===t.side?1:-1,u=o,f=-s*p,d=90===Math.abs(t.tickangle)?.5:0,h.xFn=function(t){return t.dx+e+(u+t.fontSize*d)*p},h.yFn=function(t){return t.dy+f+t.fontSize*T},h.anchorFn=function(e,r){return a(r)&&90===Math.abs(r)?"middle":"right"===t.side?"start":"end"},h.heightFn=function(e,r,n){return(r*="left"===t.side?1:-1)<-30?-n:r<30?-.5*n:0}),h},S.drawTicks=function(t,e,r){r=r||{};var n=e._id+"tick",a=r.layer.selectAll("path."+n).data(e.ticks?r.vals:[],$);a.exit().remove(),a.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(u.stroke,e.tickcolor).style("stroke-width",f.crispRound(t,e.tickwidth,1)+"px").attr("d",r.path),a.attr("transform",r.transFn)},S.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&&S.shouldShowZeroLine(t,e,i))for(var o="array"===e.tickmode,l=0;l<a.length;l++){var s=a[l].x;if(o?!s:Math.abs(s)<e.dtick/100){if(a=a.slice(0,l).concat(a.slice(l+1)),!o)break;l--}}var c=r.layer.selectAll("path."+n).data(a,$);c.exit().remove(),c.enter().append("path").classed(n,1).classed("crisp",!1!==r.crisp),e._gw=f.crispRound(t,e.gridwidth,1),c.attr("transform",r.transFn).attr("d",r.path).call(u.stroke,e.gridcolor||"#ddd").style("stroke-width",e._gw+"px"),"function"==typeof r.path&&c.attr("d",r.path)},S.drawZeroLine=function(t,e,r){r=r||r;var n=e._id+"zl",a=S.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 O.idSort(t.id,e.id)})}),i.attr("transform",r.transFn).attr("d",r.path).call(u.stroke,e.zerolinecolor||u.defaultLine).style("stroke-width",f.crispRound(t,e.zerolinewidth,e._gw||1)+"px")},S.drawLabels=function(t,e,r){r=r||{};var i=t._fullLayout,o=e._id,c=o.charAt(0),u=r.cls||o+"tick",d=r.vals,p=r.labelFns,h=r.secondary?0:e.tickangle,g=(e._prevTickAngles||{})[u],v=r.layer.selectAll("g."+u).data(e.showticklabels?d:[],$),m=[];function y(t,e){t.each(function(t){var i=n.select(this),o=i.select(".text-math-group"),l=p.anchorFn(t,e),c=r.transFn.call(i.node(),t)+(a(e)&&0!=+e?" rotate("+e+","+p.xFn(t)+","+(p.yFn(t)-t.fontSize/2)+")":""),u=s.lineCount(i),d=A*t.fontSize,h=p.heightFn(t,a(e)?+e:0,(u-1)*d);if(h&&(c+=" translate(0, "+h+")"),o.empty())i.select("text").attr({transform:c,"text-anchor":l});else{var g=f.bBox(o.node()).width*{end:-.5,start:.5}[l];o.attr("transform",c+(g?"translate("+g+",0)":""))}})}v.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(s.positionText,p.xFn(e),p.yFn(e)).call(f.font,e.font,e.fontSize,e.fontColor).text(e.text).call(s.convertToTspans,t),t._promises[a]?m.push(t._promises.pop().then(function(){y(r,h)})):y(r,h)}),v.exit().remove(),r.repositionOnUpdate&&v.each(function(t){n.select(this).select("text").call(s.positionText,p.xFn(t),p.yFn(t))}),y(v,g+1?g:h);var x=null;e._selections&&(e._selections[u]=v);var b=[function(){return m.length&&Promise.all(m)}];e.automargin&&i._redrawFromAutoMarginCount&&90===g?(x=90,b.push(function(){y(v,g)})):b.push(function(){if(y(v,h),d.length&&"x"===c&&!a(h)&&("log"!==e.type||"D"!==String(e.dtick).charAt(0))){x=0;var t,n=0,i=[];if(v.each(function(t){n=Math.max(n,t.fontSize);var r=e.l2p(t.x),a=K(this),o=f.bBox(a.node());i.push({top:0,bottom:10,height:10,left:r-o.width/2,right:r+o.width/2+2,width:o.width+2})}),"boundaries"!==e.tickson&&!e.showdividers||r.secondary){var o=d.length,s=Math.abs((d[o-1].x-d[0].x)*e._m)/(o-1)<2.5*n||"multicategory"===e.type;for(t=0;t<i.length-1;t++)if(l.bBoxIntersect(i[t],i[t+1])){x=s?90:30;break}}else{var u=2;for(e.ticks&&(u+=e.tickwidth/2),t=0;t<i.length;t++){var p=d[t].xbnd,g=i[t];if(null!==p[0]&&g.left-e.l2p(p[0])<u||null!==p[1]&&e.l2p(p[1])-g.right<u){x=90;break}}}x&&y(v,x)}}),e._tickAngles&&b.push(function(){e._tickAngles[u]=null===x?a(h)?h:0:x});var _=l.syncOrAsync(b);return _&&_.then&&t._promises.push(_),_},S.getPxPosition=function(t,e){var r,n=t._fullLayout._size,a=e._id.charAt(0),i=e.side;return"free"!==e.anchor?r=e._anchorAxis:"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},S.shouldShowZeroLine=function(t,e,r){var n=l.simpleMap(e.range,e.r2l);return n[0]*n[1]<=0&&e.zeroline&&("linear"===e.type||"-"===e.type)&&(J(e,0)||!function(t,e,r,n){var a=r._mainAxis;if(!a)return;var i=t._fullLayout,o=e._id.charAt(0),l=S.counterLetter(e._id),s=e._offset+(Math.abs(n[0])<Math.abs(n[1])==("x"===o)?0:e._length);function c(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-s)<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}var u=i._plots[r._mainSubplot];if(!(u.mainplotinfo||u).overlays.length)return c(r);for(var f=S.list(t,l),d=0;d<f.length;d++){var p=f[d];if(p._mainAxis===a&&c(p))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 l=r[i];if(!0===l.visible&&l.xaxis+l.yaxis===n){if(o.traceIs(l,"bar-like")&&l.orientation==={x:"h",y:"v"}[a])return!0;if(l.fill&&l.fill.charAt(l.fill.length-1)===a)return!0}}return!1}(t,e))},S.clipEnds=function(t,e){return e.filter(function(e){return J(t,e.x)})},S.allowAutoMargin=function(t){for(var e=S.list(t,"",!0),r=0;r<e.length;r++){var n=e[r];n.automargin&&(i.allowAutoMargin(t,tt(n)),n.mirror&&i.allowAutoMargin(t,et(n))),o.getComponentMethod("rangeslider","isVisible")(n)&&i.allowAutoMargin(t,rt(n))}},S.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,l=t._fullData[e[r]].yaxis;if(o&&l){for(n=0;n<a.length;n++)-1===a[n].x.indexOf(o)&&-1===a[n].y.indexOf(l)||i.push(n);if(i.length){var s,c=a[i[0]];if(i.length>1)for(n=1;n<i.length;n++)s=a[i[n]],nt(c.x,s.x),nt(c.y,s.y);nt(c.x,[o]),nt(c.y,[l])}else a.push({x:[o],y:[l]})}}return a}(t,e),n=0;n<r.length;n++)at(t,r[n].x,r[n].y)}},{"../../components/color":42,"../../components/drawing":63,"../../components/titles":129,"../../constants/alignment":136,"../../constants/numerical":139,"../../lib":159,"../../lib/svg_text_utils":180,"../../plots/plots":235,"../../registry":243,"./autorange":202,"./axis_autotype":204,"./axis_ids":206,"./clean_ticks":208,"./layout_attributes":215,"./set_convert":221,d3:7,"fast-isnumeric":9}],204:[function(t,e,r){"use strict";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,l={},s=0;s<t.length;s+=r){var c=t[Math.round(s)],u=String(c);l[u]||(l[u]=1,a.isDateTime(c,e)&&(i+=1),n(c)&&(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={},l=0;l<t.length;l+=e){var s=t[Math.round(l)],c=String(s);o[c]||(o[c]=1,"boolean"==typeof s?n++:a.cleanNumber(s)!==i?r++:"string"==typeof s&&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":139,"../../lib":159,"fast-isnumeric":9}],205:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("./layout_attributes"),o=t("./tick_value_defaults"),l=t("./tick_mark_defaults"),s=t("./tick_label_defaults"),c=t("./category_order_defaults"),u=t("./line_grid_defaults"),f=t("./set_convert");e.exports=function(t,e,r,d,p){var h=d.letter,g=d.font||{},v=d.splomStash||{},m=r("visible",!d.visibleDflt),y=e.type;"date"===y&&n.getComponentMethod("calendars","handleDefaults")(t,e,"calendar",d.calendar);f(e,p);var x=!e.isValidRange(t.range);x&&d.reverseDflt&&(x="reversed"),!r("autorange",x)||"linear"!==y&&"-"!==y||r("rangemode"),r("range"),e.cleanRange(),c(t,e,r,d),"category"===y||d.noHover||r("hoverformat");var b=r("color"),_=b!==i.color.dflt?b:g.color,w=v.label||p._dfltTitle[h];if(s(t,e,r,y,d,{pass:1}),!m)return e;r("title.text",w),a.coerceFont(r,"title.font",{family:g.family,size:Math.round(1.2*g.size),color:_}),o(t,e,r,y),s(t,e,r,y,d,{pass:2}),l(t,e,r,d),u(t,e,r,{dfltColor:b,bgColor:d.bgColor,showGrid:d.showGrid,attributes:i}),(e.showline||e.ticks)&&r("mirror"),d.automargin&&r("automargin");var k,T="multicategory"===e.type;d.noTickson||"category"!==e.type&&!T||!e.ticks&&!e.showgrid||(T&&(k="boundaries"),r("tickson",k));T&&(r("showdividers")&&(r("dividercolor"),r("dividerwidth")));return e}},{"../../lib":159,"../../registry":243,"./category_order_defaults":207,"./layout_attributes":215,"./line_grid_defaults":217,"./set_convert":221,"./tick_label_defaults":222,"./tick_mark_defaults":223,"./tick_value_defaults":224}],206:[function(t,e,r){"use strict";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),l=new Array(o.length);for(i=0;i<o.length;i++){var s=o[i];l[i]=a[s.charAt(0)+"axis"+s.substr(1)]}if(!n){var c=a._subplots.gl3d||[];for(i=0;i<c.length;i++){var u=a[c[i]];e?l.push(u[e+"axis"]):l.push(u.xaxis,u.yaxis,u.zaxis)}}return l},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 l=e.scene;"scene"===l.substr(0,5)&&(o=i[l][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":243,"./constants":209}],207:[function(t,e,r){"use strict";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 l,s=r("categoryorder",a);"array"===s&&(l=r("categoryarray")),o||"array"!==s||(s=e.categoryorder="trace"),"trace"===s?e._initialCategories=[]:"array"===s?e._initialCategories=l.slice():(l=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 l=e.data[n];l[i+"axis"]===t._id&&r.push(l)}for(n=0;n<r.length;n++){var s=r[n][i];for(a=0;a<s.length;a++){var c=s[a];null!=c&&(o[c]=1)}}return Object.keys(o)}(e,n).sort(),"category ascending"===s?e._initialCategories=l:"category descending"===s&&(e._initialCategories=l.reverse()))}}},{}],208:[function(t,e,r){"use strict";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,l=a?i:1;if(!t)return l;if(n(t))return(t=Number(t))<=0?l:o?Math.max(1,Math.round(t)):a?Math.max(.1,t):t;if("string"!=typeof t||!a&&!r)return l;var s=t.charAt(0),c=t.substr(1);return(c=n(c)?Number(c):0)<=0||!(a&&"M"===s&&c===Math.round(c)||r&&"L"===s||r&&"D"===s&&(1===c||2===c))?l: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":139,"../../lib":159,"fast-isnumeric":9}],209:[function(t,e,r){"use strict";var n=t("../../lib/regex").counter;e.exports={idRegex:{x:n("x"),y:n("y")},attrRegex:n("[xy]axis"),xAxisMatch:n("xaxis"),yAxisMatch:n("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,BENDPX:1.5,REDRAWDELAY:50,SELECTDELAY:100,SELECTID:"-select",DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"}}},{"../../lib/regex":174}],210:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./axis_ids").id2name,i=t("./scale_zoom"),o=t("./autorange").makePadFn,l=t("./autorange").concatExtremes,s=t("../../constants/numerical").ALMOST_EQUAL,c=t("../../constants/alignment").FROM_BL;function u(t,e,r,n,i){var o,l,s,c,u="range"!==i,f=n[a(e)].type,d=[];for(l=0;l<r.length;l++)if((s=r[l])!==e&&(c=n[a(s)]).type===f)if(c.fixedrange){if(u&&c.anchor){n[a(c.anchor)].fixedrange&&d.push(s)}}else d.push(s);for(o=0;o<t.length;o++)if(t[o][e]){var p=t[o],h=[];for(l=0;l<d.length;l++)p[s=d[l]]||h.push(s);return{linkableAxes:h,thisGroup:p}}return{linkableAxes:d,thisGroup:null}}function f(t,e,r,n,a){var i,o,l,s,c;null===e?((e={})[r]=1,c=t.length,t.push(e)):c=t.indexOf(e);var u=Object.keys(e);for(i=0;i<t.length;i++)if(l=t[i],i!==c&&l[n]){var f=l[n];for(o=0;o<u.length;o++)l[s=u[o]]=f*a*e[s];return void t.splice(c,1)}if(1!==a)for(o=0;o<u.length;o++)e[u[o]]*=a;e[n]=1}function d(t,e){var r=t._inputDomain,n=c[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){var i,o,l,s,c=a.allAxisIds,d=a.layoutOut,p=a.scaleanchorDflt,h=a.constrainDflt,g=d._axisConstraintGroups,v=d._axisMatchGroups,m=e._id,y=m.charAt(0),x=((d._splomAxes||{})[y]||{})[m]||{},b=e._id,_=b.charAt(0),w=r("constrain",h);if(n.coerce(t,e,{constraintoward:{valType:"enumerated",values:"x"===_?["left","center","right"]:["bottom","middle","top"],dflt:"x"===_?"center":"middle"}},"constraintoward"),!t.matches&&!x.matches||e.fixedrange||(o=u(v,b,c,d),i=n.coerce(t,e,{matches:{valType:"enumerated",values:o.linkableAxes||[],dflt:x.matches}},"matches")),i||e.fixedrange&&"domain"!==w||!t.scaleanchor&&!p||(s=u(g,b,c,d,w),l=n.coerce(t,e,{scaleanchor:{valType:"enumerated",values:s.linkableAxes||[]}},"scaleanchor",p)),i?(delete e.constrain,f(v,o.thisGroup,b,i,1)):-1!==c.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 k=r("scaleratio");k||(k=e.scaleratio=1),f(g,s.thisGroup,b,l,k)}else-1!==c.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,c,u,f,p,h=t._fullLayout,g=h._axisConstraintGroups||[];for(e=0;e<g.length;e++){var v=g[e],m=Object.keys(v),y=1/0,x=0,b=1/0,_={},w={},k=!1;for(r=0;r<m.length;r++)w[n=m[r]]=c=h[a(n)],c._inputDomain?c.domain=c._inputDomain.slice():c._inputDomain=c.domain.slice(),c._inputRange||(c._inputRange=c.range.slice()),c.setScale(),_[n]=u=Math.abs(c._m)/v[n],y=Math.min(y,u),"domain"!==c.constrain&&c._constraintShrinkable||(b=Math.min(b,u)),delete c._constraintShrinkable,x=Math.max(x,u),"domain"===c.constrain&&(k=!0);if(!(y>s*x)||k)for(r=0;r<m.length;r++)if(u=_[n=m[r]],f=(c=w[n]).constrain,u!==b||"domain"===f)if(p=u/b,"range"===f)i(c,p);else{var T=c._inputDomain,M=(c.domain[1]-c.domain[0])/(T[1]-T[0]),A=(c.r2l(c.range[1])-c.r2l(c.range[0]))/(c.r2l(c._inputRange[1])-c.r2l(c._inputRange[0]));if((p/=M)*A<1){c.domain=c._input.domain=T.slice(),i(c,p);continue}if(A<1&&(c.range=c._input.range=c._inputRange.slice(),p*=A),c.autorange){var L=c.r2l(c.range[0]),S=c.r2l(c.range[1]),C=(L+S)/2,O=C,P=C,D=Math.abs(S-C),z=C-D*p*1.0001,R=C+D*p*1.0001,E=o(c);d(c,p);var I,F,N=Math.abs(c._m),j=l(t,c),B=j.min,H=j.max;for(F=0;F<B.length;F++)(I=B[F].val-E(B[F])/N)>z&&I<O&&(O=I);for(F=0;F<H.length;F++)(I=H[F].val+E(H[F])/N)<R&&I>P&&(P=I);p/=(P-O)/(2*D),O=c.l2r(O),P=c.l2r(P),c.range=c._input.range=L<S?[O,P]:[P,O]}d(c,p)}}},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":136,"../../constants/numerical":139,"../../lib":159,"./autorange":202,"./axis_ids":206,"./scale_zoom":219}],211:[function(t,e,r){"use strict";var n=t("d3"),a=t("tinycolor2"),i=t("has-passive-events"),o=t("../../registry"),l=t("../../lib"),s=t("../../lib/svg_text_utils"),c=t("../../components/color"),u=t("../../components/drawing"),f=t("../../components/fx"),d=t("./axes"),p=t("../../lib/setcursor"),h=t("../../components/dragelement"),g=t("../../constants/alignment").FROM_TL,v=t("../../lib/clear_gl_canvases"),m=t("../../plot_api/subroutines").redrawReglTraces,y=t("../plots"),x=t("./axis_ids").getFromId,b=t("./select").prepSelect,_=t("./select").clearSelect,w=t("./select").selectOnClick,k=t("./scale_zoom"),T=t("./constants"),M=T.MINDRAG,A=T.MINZOOM,L=!0;function S(t,e,r,n){var a=l.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(p,n),a.node()}function C(t,e,r,a,i,o,l){var s=S(t,"rect",e,r);return n.select(s).call(u.setRect,a,i,o,l),s}function O(t,e){for(var r=0;r<t.length;r++)if(!t[r].fixedrange)return e;return""}function P(t,e,r,n,a){for(var i=0;i<t.length;i++){var o=t[i];if(!o.fixedrange){var l=o._rl[0],s=o._rl[1]-l;n[o._name+".range[0]"]=o.l2r(l+s*e),n[o._name+".range[1]"]=o.l2r(l+s*r)}}if(a&&a.length){var c=(e+(1-r))/2;P(a,c,1-c,n,[])}}function D(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 z(t){return 1-(t>=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function R(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 E(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function I(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 j(t){L&&t.data&&t._context.showTips&&(l.notifier(l._(t,"Double-click to zoom back out"),"long"),L=!1)}function B(t){return"lasso"===t||"select"===t}function H(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,A)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function V(t,e,r,n){for(var a,i,o,s,c=!1,u={},f={},d=0;d<e.length;d++){var p=e[d];for(a in r)if(p[a]){for(o in p)("x"===o.charAt(0)?r:n)[o]||(u[o]=a);for(i in n)p[i]&&(c=!0)}for(i in n)if(p[i])for(s in p)("x"===s.charAt(0)?r:n)[s]||(f[s]=i)}c&&(l.extendFlat(u,f),f={});var h={},g=[];for(o in u){var v=x(t,o);g.push(v),h[v._id]=v}var m={},y=[];for(s in f){var b=x(t,s);y.push(b),m[b._id]=b}return{xaHash:h,yaHash:m,xaxes:g,yaxes:y,xLinks:u,yLinks:f,isSubplotConstrained:c}}function q(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 U(t){var e=[];for(var r in t)e.push(t[r]);return e}e.exports={makeDragBox:function(t,e,r,i,c,p,L,S){var F,G,Z,X,Y,W,$,Q,J,K,tt,et,rt,nt,at,it,ot,lt,st,ct,ut,ft=t._fullLayout._zoomlayer,dt=L+S==="nsew",pt=1===(L+S).length;function ht(){if(F=e.xaxis,G=e.yaxis,J=F._length,K=G._length,$=F._offset,Q=G._offset,(Z={})[F._id]=F,(X={})[G._id]=G,L&&S)for(var r=e.overlays,n=0;n<r.length;n++){var a=r[n].xaxis;Z[a._id]=a;var i=r[n].yaxis;X[i._id]=i}Y=U(Z),W=U(X),rt=O(Y,S),nt=O(W,L),at=!nt&&!rt,tt=V(t,t._fullLayout._axisConstraintGroups,Z,X),et=V(t,t._fullLayout._axisMatchGroups,Z,X),it=S||tt.isSubplotConstrained||et.isSubplotConstrained,ot=L||tt.isSubplotConstrained||et.isSubplotConstrained;var o=t._fullLayout;lt=o._has("scattergl"),st=o._has("splom"),ct=o._has("svg")}ht();var gt=function(t,e,r){return t?"nsew"===t?r?"":"pan"===e?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}(nt+rt,t._fullLayout.dragmode,dt),vt=C(e,L+S+"drag",gt,r,i,c,p);if(at&&!dt)return vt.onmousedown=null,vt.style.pointerEvents="none",vt;var mt,yt,xt,bt,_t,wt,kt,Tt,Mt,At,Lt={element:vt,gd:t,plotinfo:e};function St(){Lt.plotinfo.selection=!1,_(t)}function Ct(r,a){var i=t._fullLayout.clickmode;if(N(t),2!==r||pt||function(){if(!t._transitioningWithDuration){var e=t._context.doubleClick,r=[];rt&&(r=r.concat(Y)),nt&&(r=r.concat(W)),et.xaxes&&(r=r.concat(et.xaxes)),et.yaxes&&(r=r.concat(et.yaxes));var n,a,i,l={};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||(l[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(W)):r=r.concat(Y)),a=0;a<r.length;a++)(n=r[a]).fixedrange||(n._rangeInitial?(i=n._rangeInitial,l[n._name+".range[0]"]=i[0],l[n._name+".range[1]"]=i[1]):l[n._name+".autorange"]=!0);t.emit("plotly_doubleclick",null),o.call("_guiRelayout",t,l)}}(),dt)i.indexOf("select")>-1&&w(a,t,Y,W,e.id,Lt),i.indexOf("event")>-1&&f.click(t,a,e.id);else if(1===r&&pt){var l=L?G:F,c="s"===L||"w"===S?0:1,u=l._name+".range["+c+"]",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))}(l,c),p="left",h="middle";if(l.fixedrange)return;L?(h="n"===L?"top":"bottom","right"===l.side&&(p="right")):"e"===S&&(p="right"),t._context.showAxisRangeEntryBoxes&&n.select(vt).call(s.makeEditable,{gd:t,immediate:!0,background:t._fullLayout.paper_bgcolor,text:String(d),fill:l.tickfont?l.tickfont.color:"#444",horizontalAlign:p,verticalAlign:h}).on("edit",function(e){var r=l.d2r(e);void 0!==r&&o.call("_guiRelayout",t,u,r)})}}function Ot(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(J,e+mt)),a=Math.max(0,Math.min(K,r+yt)),i=Math.abs(n-mt),o=Math.abs(a-yt);function l(){kt="",xt.r=xt.l,xt.t=xt.b,Mt.attr("d","M0,0Z")}if(xt.l=Math.min(mt,n),xt.r=Math.max(mt,n),xt.t=Math.min(yt,a),xt.b=Math.max(yt,a),tt.isSubplotConstrained)i>A||o>A?(kt="xy",i/J>o/K?(o=i*K/J,yt>a?xt.t=yt-o:xt.b=yt+o):(i=o*J/K,mt>n?xt.l=mt-i:xt.r=mt+i),Mt.attr("d",H(xt))):l();else if(et.isSubplotConstrained)if(i>A||o>A){kt="xy";var s=Math.min(xt.l/J,(K-xt.b)/K),c=Math.max(xt.r/J,(K-xt.t)/K);xt.l=s*J,xt.r=c*J,xt.b=(1-s)*K,xt.t=(1-c)*K,Mt.attr("d",H(xt))}else l();else!nt||o<Math.min(Math.max(.6*i,M),A)?i<M||!rt?l():(xt.t=0,xt.b=K,kt="x",Mt.attr("d",function(t,e){return"M"+(t.l-.5)+","+(e-A-.5)+"h-3v"+(2*A+1)+"h3ZM"+(t.r+.5)+","+(e-A-.5)+"h3v"+(2*A+1)+"h-3Z"}(xt,yt))):!rt||i<Math.min(.6*o,A)?(xt.l=0,xt.r=J,kt="y",Mt.attr("d",function(t,e){return"M"+(e-A-.5)+","+(t.t-.5)+"v-3h"+(2*A+1)+"v3ZM"+(e-A-.5)+","+(t.b+.5)+"v3h"+(2*A+1)+"v-3Z"}(xt,mt))):(kt="xy",Mt.attr("d",H(xt)));xt.w=xt.r-xt.l,xt.h=xt.b-xt.t,kt&&(At=!0),t._dragged=At,I(Tt,Mt,xt,_t,wt,bt),Pt(),t.emit("plotly_relayouting",ut),wt=!0}function Pt(){ut={},"xy"!==kt&&"x"!==kt||(P(Y,xt.l/J,xt.r/J,ut,tt.xaxes),Nt("x",ut)),"xy"!==kt&&"y"!==kt||(P(W,(K-xt.b)/K,(K-xt.t)/K,ut,tt.yaxes),Nt("y",ut))}function Dt(){Pt(),N(t),Bt(),j(t)}Lt.prepFn=function(e,r,n){var i=Lt.dragmode,o=t._fullLayout.dragmode;o!==i&&(Lt.dragmode=o),ht(),at||(dt?e.shiftKey?"pan"===o?o="zoom":B(o)||(o="pan"):e.ctrlKey&&(o="pan"):o="pan"),Lt.minDrag="lasso"===o?1:void 0,B(o)?(Lt.xaxes=Y,Lt.yaxes=W,b(e,r,n,Lt,o)):(Lt.clickFn=Ct,B(i)&&St(),at||("zoom"===o?(Lt.moveFn=Ot,Lt.doneFn=Dt,Lt.minDrag=1,function(e,r,n){var i=vt.getBoundingClientRect();mt=r-i.left,yt=n-i.top,xt={l:mt,r:mt,w:0,t:yt,b:yt,h:0},bt=t._hmpixcount?t._hmlumcount/t._hmpixcount:a(t._fullLayout.plot_bgcolor).getLuminance(),wt=!1,kt="xy",At=!1,Tt=R(ft,bt,$,Q,_t="M0,0H"+J+"V"+K+"H0V0"),Mt=E(ft,$,Q)}(0,r,n)):"pan"===o&&(Lt.moveFn=Ft,Lt.doneFn=Bt))),t._fullLayout._redrag=function(){var e=t._dragdata;e&&e.element===vt&&(B(t._fullLayout.dragmode)||(ht(),Ht([0,0,J,K]),Lt.moveFn(e.dx,e.dy)))}},h.init(Lt);var zt=[0,0,J,K],Rt=null,Et=T.REDRAWDELAY,It=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&&(D(Y,e),Nt("x")),nt&&(D(W,r),Nt("y")),Ht([rt?-e:0,nt?-r:0,J,K]),jt(),void t.emit("plotly_relayouting",ut);if(tt.isSubplotConstrained&&rt&&nt){var n="w"===rt==("n"===nt)?1:-1,a=(e/J+n*r/K)/2;e=a*J,r=n*a*K}"w"===rt?e=s(Y,0,e):"e"===rt?e=s(Y,1,-e):rt||(e=0),"n"===nt?r=s(W,1,r):"s"===nt?r=s(W,0,-r):nt||(r=0);var i="w"===rt?e:0,o="n"===nt?r:0;if(tt.isSubplotConstrained){var l;if(!rt&&1===nt.length){for(l=0;l<Y.length;l++)Y[l].range=Y[l]._r.slice(),k(Y[l],1-r/K);i=(e=r*J/K)/2}if(!nt&&1===rt.length){for(l=0;l<W.length;l++)W[l].range=W[l]._r.slice(),k(W[l],1-e/J);o=(r=e*K/J)/2}}Nt("x"),Nt("y"),Ht([i,o,J-e,K-r]),jt(),t.emit("plotly_relayouting",ut)}function s(t,e,r){for(var n,a,i=1-e,o=0;o<t.length;o++){var l=t[o];if(!l.fixedrange){n=l,a=l._rl[i]+(l._rl[e]-l._rl[i])/z(r/l._length);var s=l.l2r(a);!1!==s&&void 0!==s&&(l.range[e]=s)}}return n._length*(n._rl[e]-a)/(n._rl[e]-n._rl[i])}}function Nt(t,e){for(var r=et.isSubplotConstrained?{x:W,y:Y}[t]:et[t+"axes"],n=et.isSubplotConstrained?{x:Y,y:W}[t]:[],a=0;a<r.length;a++){var i=r[a],o=i._id,l=et.xLinks[o]||et.yLinks[o],s=n[0]||Z[l]||X[l];s&&(e?(e[i._name+".range[0]"]=e[s._name+".range[0]"],e[i._name+".range[1]"]=e[s._name+".range[1]"]):i.range=s.range.slice())}}function jt(){var e,r=[];function n(t){for(e=0;e<t.length;e++)t[e].fixedrange||r.push(t[e]._id)}for(it&&(n(Y),n(tt.xaxes),n(et.xaxes)),ot&&(n(W),n(tt.yaxes),n(et.yaxes)),ut={},e=0;e<r.length;e++){var a=r[e],i=x(t,a);d.drawOne(t,i,{skipTitle:!0}),ut[i._name+".range[0]"]=i.range[0],ut[i._name+".range[1]"]=i.range[1]}d.redrawComponents(t,r)}function Bt(){Ht([0,0,J,K]),l.syncOrAsync([y.previousPromises,function(){t._fullLayout._replotting=!1,o.call("_guiRelayout",t,ut)}],t)}function Ht(e){var r,n,a,i,s=t._fullLayout,c=s._plots,f=s._subplots.cartesian;if(st&&o.subplotsRegistry.splom.drag(t),lt)for(r=0;r<f.length;r++)if(a=(n=c[f[r]]).xaxis,i=n.yaxis,n._scene){var d=l.simpleMap(a.range,a.r2l),p=l.simpleMap(i.range,i.r2l);n._scene.update({range:[d[0],p[0],d[1],p[1]]})}if((st||lt)&&(v(t),m(t)),ct){var h=e[2]/F._length,g=e[3]/G._length;for(r=0;r<f.length;r++){a=(n=c[f[r]]).xaxis,i=n.yaxis;var y,x,b,_,w=it&&!a.fixedrange&&Z[a._id],k=ot&&!i.fixedrange&&X[i._id];if(w?(y=h,b=S?e[0]:Ut(a,y)):et.xaHash[a._id]?(y=h,b=e[0]*a._length/F._length):et.yaHash[a._id]?(y=g,b="ns"===nt?-e[1]*a._length/G._length:Ut(a,y,{n:"top",s:"bottom"}[nt])):b=qt(a,y=Vt(a,h,g)),k?(x=g,_=L?e[1]:Ut(i,x)):et.yaHash[i._id]?(x=g,_=e[1]*i._length/G._length):et.xaHash[i._id]?(x=h,_="ew"===rt?-e[0]*i._length/F._length:Ut(i,x,{e:"right",w:"left"}[rt])):_=qt(i,x=Vt(i,h,g)),y||x){y||(y=1),x||(x=1);var T=a._offset-b/y,M=i._offset-_/x;n.clipRect.call(u.setTranslate,b,_).call(u.setScale,y,x),n.plot.call(u.setTranslate,T,M).call(u.setScale,1/y,1/x),y===n.xScaleFactor&&x===n.yScaleFactor||(u.setPointGroupScale(n.zoomScalePts,y,x),u.setTextPointsScale(n.zoomScaleTxt,y,x)),u.hideOutsideRangePoints(n.clipOnAxisFalseTraces,n),n.xScaleFactor=y,n.yScaleFactor=x}}}}function Vt(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 qt(t,e){return e?(t.range=t._r.slice(),k(t,e),Ut(t,e)):0}function Ut(t,e,r){return t._length*(1-e)*g[r||t.constraintoward||"middle"]}return L.length*S.length!=1&&q(vt,function(e){if(t._context._scrollZoom.cartesian||t._fullLayout._enablescrollzoom){if(St(),t._transitioningWithDuration)return e.preventDefault(),void e.stopPropagation();ht(),clearTimeout(Rt);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=It.draglayer.select(".nsewdrag").node().getBoundingClientRect(),o=(e.clientX-i.left)/i.width,s=(i.bottom-e.clientY)/i.height;if(it){for(S||(o=.5),n=0;n<Y.length;n++)c(Y[n],o,a);Nt("x"),zt[2]*=a,zt[0]+=zt[2]*o*(1/a-1)}if(ot){for(L||(s=.5),n=0;n<W.length;n++)c(W[n],s,a);Nt("y"),zt[3]*=a,zt[1]+=zt[3]*(1-s)*(1/a-1)}Ht(zt),jt(),t.emit("plotly_relayouting",ut),Rt=setTimeout(function(){zt=[0,0,J,K],Bt()},Et),e.preventDefault()}else l.log("Did not find wheel motion attributes: ",e)}function c(t,e,r){if(!t.fixedrange){var n=l.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)})}}}),vt},makeDragger:S,makeRectDragger:C,makeZoombox:R,makeCorners:E,updateZoombox:I,xyCorners:H,transitionZoombox:F,removeZoombox:N,showDoubleClickNotifier:j,attachWheelEventHandler:q}},{"../../components/color":42,"../../components/dragelement":60,"../../components/drawing":63,"../../components/fx":80,"../../constants/alignment":136,"../../lib":159,"../../lib/clear_gl_canvases":148,"../../lib/setcursor":178,"../../lib/svg_text_utils":180,"../../plot_api/subroutines":194,"../../registry":243,"../plots":235,"./axes":203,"./axis_ids":206,"./constants":209,"./scale_zoom":219,"./select":220,d3:7,"has-passive-events":12,tinycolor2:25}],212:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/fx"),i=t("../../components/dragelement"),o=t("../../lib/setcursor"),l=t("./dragbox").makeDragBox,s=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,c=n.yaxis;if(!n.mainplot){var u=l(t,n,o._offset,c._offset,o._length,c._length,"ns","ew");u.onmousemove=function(e){t._fullLayout._rehover=function(){t._fullLayout._hoversubplot===r&&t._fullLayout._plots[r]&&a.hover(t,e,r)},a.hover(t,e,r),t._fullLayout._lasthover=u,t._fullLayout._hoversubplot=r},u.onmouseout=function(e){t._dragging||(t._fullLayout._hoversubplot=null,i.unhover(t,e))},t._context.showAxisDragHandles&&(l(t,n,o._offset-s,c._offset-s,s,s,"n","w"),l(t,n,o._offset+o._length,c._offset-s,s,s,"n","e"),l(t,n,o._offset-s,c._offset+c._length,s,s,"s","w"),l(t,n,o._offset+o._length,c._offset+c._length,s,s,"s","e"))}if(t._context.showAxisDragHandles){if(r===o._mainSubplot){var f=o._mainLinePosition;"top"===o.side&&(f-=s),l(t,n,o._offset+.1*o._length,f,.8*o._length,s,"","ew"),l(t,n,o._offset,f,.1*o._length,s,"","w"),l(t,n,o._offset+.9*o._length,f,.1*o._length,s,"","e")}if(r===c._mainSubplot){var d=c._mainLinePosition;"right"!==c.side&&(d-=s),l(t,n,d,c._offset+.1*c._length,s,.8*c._length,"ns",""),l(t,n,d,c._offset+.9*c._length,s,.1*c._length,"s",""),l(t,n,d,c._offset,s,.1*c._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":60,"../../components/fx":80,"../../lib/setcursor":178,"./constants":209,"./dragbox":211,d3:7}],213:[function(t,e,r){"use strict";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,l=o.idRegex,s=r._subplots,c=s.xaxis,u=s.yaxis,f=s.cartesian,d=r._has("cartesian")||r._has("gl2d"),p=0;p<i.length;p++){var h=i[p];if(a.isPlainObject(h)){var g=h.xref,v=h.yref,m=l.x.test(g),y=l.y.test(v);if(m||y){d||a.pushUnique(r._basePlotModules,o);var x=!1;m&&-1===c.indexOf(g)&&(c.push(g),x=!0),y&&-1===u.indexOf(v)&&(u.push(v),x=!0),x&&m&&y&&f.push(g+v)}}}}}},{"../../lib":159,"../../registry":243}],214:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../lib"),o=t("../plots"),l=t("../../components/drawing"),s=t("../get_data").getModuleCalcData,c=t("./axis_ids"),u=t("./constants"),f=t("../../constants/xmlns_namespaces"),d=i.ensureSingle;function p(t,e,r){return i.ensureSingle(t,e,r,function(t){t.datum(r)})}function h(t,e,r,i,o){for(var c,f,d,p=u.traceLayerClasses,h=t._fullLayout,g=h._modules,v=[],m=[],y=0;y<g.length;y++){var x=(c=g[y]).name,b=a.modules[x].categories;if(b.svg){var _=c.layerName||x+"layer",w=c.plot;d=(f=s(r,w))[0],r=f[1],d.length&&v.push({i:p.indexOf(_),className:_,plotMethod:w,cdModule:d}),b.zoomScale&&m.push("."+_)}}v.sort(function(t,e){return t.i-e.i});var k=e.plot.selectAll("g.mlayer").data(v,function(t){return t.className});if(k.enter().append("g").attr("class",function(t){return t.className}).classed("mlayer",!0).classed("rangeplot",e.isRangePlot),k.exit().remove(),k.order(),k.each(function(r){var a=n.select(this),s=r.className;r.plotMethod(t,e,r.cdModule,a,i,o),-1===u.clipOnAxisFalseQuery.indexOf("."+s)&&l.setClipUrl(a,e.layerClipId,t)}),h._has("scattergl")&&(c=a.getModule("scattergl"),d=s(r,c)[0],c.plot(t,e,d)),!t._context.staticPlot&&(e._hasClipOnAxisFalse&&(e.clipOnAxisFalseTraces=e.plot.selectAll(u.clipOnAxisFalseQuery.join(",")).selectAll(".trace")),m.length)){var T=e.plot.selectAll(m.join(",")).selectAll(".trace");e.zoomScalePts=T.selectAll("path.point"),e.zoomScaleTxt=T.selectAll(".textpoint")}}function g(t,e){var r=e.plotgroup,n=e.id,a=u.layerValue2layerClass[e.xaxis.layer],i=u.layerValue2layerClass[e.yaxis.layer],o=t._fullLayout._hasOnlyLargeSploms;if(e.mainplot){var l=e.mainplotinfo,s=l.plotgroup,f=n+"-x",h=n+"-y";e.gridlayer=l.gridlayer,e.zerolinelayer=l.zerolinelayer,d(l.overlinesBelow,"path",f),d(l.overlinesBelow,"path",h),d(l.overaxesBelow,"g",f),d(l.overaxesBelow,"g",h),e.plot=d(l.overplot,"g",n),d(l.overlinesAbove,"path",f),d(l.overlinesAbove,"path",h),d(l.overaxesAbove,"g",f),d(l.overaxesAbove,"g",h),e.xlines=s.select(".overlines-"+a).select("."+f),e.ylines=s.select(".overlines-"+i).select("."+h),e.xaxislayer=s.select(".overaxes-"+a).select("."+f),e.yaxislayer=s.select(".overaxes-"+i).select("."+h)}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 g=d(r,"g","layer-subplot");e.shapelayer=d(g,"g","shapelayer"),e.imagelayer=d(g,"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||(p(e.gridlayer,"g",e.xaxis._id),p(e.gridlayer,"g",e.yaxis._id),e.gridlayer.selectAll("g").map(function(t){return t[0]}).sort(c.idSort)),e.xlines.style("fill","none").classed("crisp",!0),e.ylines.style("fill","none").classed("crisp",!0)}function v(t,e){if(t){var r={};for(var a in t.each(function(t){var a=t[0];n.select(this).remove(),m(a,e),r[a]=!0}),e._plots)for(var i=e._plots[a].overlays||[],o=0;o<i.length;o++){var l=i[o];r[l.id]&&l.plot.selectAll(".trace").remove()}}}function m(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=u.idRegex,r.attrRegex=u.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,l=o.xaxis,s=o.yaxis,f=o.cartesian,d=f.concat(o.gl2d||[]),p={},h={};for(r=0;r<d.length;r++){var g=d[r].split("y");p[g[0]]=1,h["y"+g[1]]=1}for(r=0;r<l.length;r++)p[n=l[r]]||(a=(t[c.id2name(n)]||{}).anchor,u.idRegex.y.test(a)||(a="y"),f.push(n+a),d.push(n+a),h[a]||(h[a]=1,i.pushUnique(s,a)));for(r=0;r<s.length;r++)h[a=s[r]]||(n=(t[c.id2name(a)]||{}).anchor,u.idRegex.x.test(n)||(n="x"),f.push(n+a),d.push(n+a),p[n]||(p[n]=1,i.pushUnique(l,n)));if(!d.length){for(var v in n="",a="",t){if(u.attrRegex.test(v))"x"===v.charAt(0)?(!n||+v.substr(5)<+n.substr(5))&&(n=v):(!a||+v.substr(5)<+a.substr(5))&&(a=v)}n=n?c.name2id(n):"x",a=a?c.name2id(a):"y",l.push(n),s.push(a),f.push(n+a)}},r.plot=function(t,e,r,n){var a,i=t._fullLayout,o=i._subplots.cartesian,l=t.calcdata;if(!Array.isArray(e))for(e=[],a=0;a<l.length;a++)e.push(a);for(a=0;a<o.length;a++){for(var s,c=o[a],u=i._plots[c],f=[],d=0;d<l.length;d++){var p=l[d],g=p[0].trace;g.xaxis+g.yaxis===c&&((-1!==e.indexOf(g.index)||g.carpet)&&(s&&s[0].trace.xaxis+s[0].trace.yaxis===c&&-1!==["tonextx","tonexty","tonext"].indexOf(g.fill)&&-1===f.indexOf(s)&&f.push(s),f.push(p)),s=p)}h(t,u,f,r,n)}},r.clean=function(t,e,r,n){var a,i,o,l=n._plots||{},s=e._plots||{},u=n._subplots||{};if(n._hasOnlyLargeSploms&&!e._hasOnlyLargeSploms)for(o in l)(a=l[o]).plotgroup&&a.plotgroup.remove();var f=n._has&&n._has("gl"),d=e._has&&e._has("gl");if(f&&!d)for(o in l)(a=l[o])._scene&&a._scene.destroy();if(u.xaxis&&u.yaxis){var p=c.listIds({_fullLayout:n});for(i=0;i<p.length;i++){var h=p[i];e[c.id2name(h)]||n._infolayer.selectAll(".g-"+h+"title").remove()}}var g=n._has&&n._has("cartesian"),y=e._has&&e._has("cartesian");if(g&&!y)v(n._cartesianlayer.selectAll(".subplot"),n),n._defs.selectAll(".axesclip").remove(),delete n._axisConstraintGroups;else if(u.cartesian)for(i=0;i<u.cartesian.length;i++){var x=u.cartesian[i];if(!s[x]){var b="."+x+",."+x+"-x,."+x+"-y";n._cartesianlayer.selectAll(b).remove(),m(x,n)}}},r.drawFramework=function(t){var e=t._fullLayout,r=function(t){var e,r,n,a,i,o,l=t._fullLayout,s=l._subplots.cartesian,c=s.length,u=[],f=[];for(e=0;e<c;e++){n=s[e],a=l._plots[n],i=a.xaxis,o=a.yaxis;var d=i._mainAxis,p=o._mainAxis,h=d._id+p._id,g=l._plots[h];a.overlays=[],h!==n&&g?(a.mainplot=h,a.mainplotinfo=g,f.push(n)):(a.mainplot=void 0,a.mainPlotinfo=void 0,u.push(n))}for(e=0;e<f.length;e++)n=f[e],(a=l._plots[n]).mainplotinfo.overlays.push(a);var v=u.concat(f),m=new Array(c);for(e=0;e<c;e++){n=v[e],a=l._plots[n],i=a.xaxis,o=a.yaxis;var y=[n,i.layer,o.layer,i.overlaying||"",o.overlaying||""];for(r=0;r<a.overlays.length;r++)y.push(a.overlays[r].id);m[e]=y}return m}(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(v,e),a.each(function(r){var a=r[0],i=e._plots[a];i.plotgroup=n.select(this),g(t,i),i.draglayer=d(e._draggers,"g",a)})},r.rangePlot=function(t,e,r){g(t,e),h(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:f.svg,"xlink:href":t,preserveAspectRatio:"none",x:0,y:0,width:this.width,height:this.height})})},r.updateFx=t("./graph_interact").updateFx},{"../../components/drawing":63,"../../constants/xmlns_namespaces":140,"../../lib":159,"../../registry":243,"../get_data":231,"../plots":235,"./attributes":201,"./axis_ids":206,"./constants":209,"./graph_interact":212,"./layout_attributes":215,"./layout_defaults":216,"./transition_axes":225,d3:7}],215:[function(t,e,r){"use strict";var n=t("../font_attributes"),a=t("../../components/color/attributes"),i=t("../../components/drawing/attributes").dash,o=t("../../lib/extend").extendFlat,l=t("../../plot_api/plot_template").templatedArray,s=(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"}),standoff:{valType:"number",min:0,editType:"ticks"},editType:"ticks"},type:{valType:"enumerated",values:["-","linear","log","date","category","multicategory"],dflt:"-",editType:"calc",_noTemplating:!0},autorange:{valType:"enumerated",values:[!0,!1,"reversed"],dflt:!0,editType:"axrange",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"plot"},range:{valType:"info_array",items:[{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0},{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0}],editType:"axrange",impliedEdits:{autorange:!1},anim:!0},fixedrange:{valType:"boolean",dflt:!1,editType:"calc"},scaleanchor:{valType:"enumerated",values:[s.idRegex.x.toString(),s.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:[s.idRegex.x.toString(),s.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:l("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",s.idRegex.x.toString(),s.idRegex.y.toString()],editType:"plot"},side:{valType:"enumerated",values:["top","bottom","left","right"],editType:"plot"},overlaying:{valType:"enumerated",values:["free",s.idRegex.x.toString(),s.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":41,"../../components/drawing/attributes":62,"../../constants/docs":137,"../../lib/extend":154,"../../plot_api/plot_template":193,"../font_attributes":229,"./constants":209}],216:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../components/color"),i=t("../../plot_api/plot_template"),o=t("../layout_attributes"),l=t("./layout_attributes"),s=t("./type_defaults"),c=t("./axis_defaults"),u=t("./constraints").handleConstraintDefaults,f=t("./position_defaults"),d=t("./axis_ids"),p=d.id2name,h=d.name2id,g=t("./constants").AX_ID_PATTERN,v=t("../../registry"),m=v.traceIs,y=v.getComponentMethod;function x(t,e,r){Array.isArray(t[e])?t[e].push(r):t[e]=[r]}e.exports=function(t,e,r){var d,v,b={},_={},w={},k={},T={},M={},A={},L={},S={},C={};for(d=0;d<r.length;d++){var O=r[d];if(m(O,"cartesian")||m(O,"gl2d")){var P,D;if(O.xaxis)P=p(O.xaxis),x(b,P,O);else if(O.xaxes)for(v=0;v<O.xaxes.length;v++)x(b,p(O.xaxes[v]),O);if(O.yaxis)D=p(O.yaxis),x(b,D,O);else if(O.yaxes)for(v=0;v<O.yaxes.length;v++)x(b,p(O.yaxes[v]),O);if("funnel"===O.type?"h"===O.orientation?(P&&(_[P]=!0),D&&(A[D]=!0)):D&&(w[D]=!0):"image"===O.type?(D&&(L[D]=!0),P&&(L[P]=!0)):(D&&(T[D]=!0,M[D]=!0),m(O,"carpet")&&("carpet"!==O.type||O._cheater)||P&&(k[P]=!0)),"carpet"===O.type&&O._cheater&&P&&(_[P]=!0),m(O,"2dMap")&&(S[P]=!0,S[D]=!0),m(O,"oriented"))C["h"===O.orientation?D:P]=!0}}var z=e._subplots,R=z.xaxis,E=z.yaxis,I=n.simpleMap(R,p),F=n.simpleMap(E,p),N=I.concat(F),j=a.background;R.length&&E.length&&(j=n.coerce(t,e,o,"plot_bgcolor"));var B,H,V,q,U,G=a.combine(j,e.paper_bgcolor);function Z(){var t=b[B]||[];U._traceIndices=t.map(function(t){return t._expandedIndex}),U._annIndices=[],U._shapeIndices=[],U._imgIndices=[],U._subplotsWith=[],U._counterAxes=[],U._name=U._attr=B,U._id=H}function X(t,e){return n.coerce(q,U,l,t,e)}function Y(t,e){return n.coerce2(q,U,l,t,e)}function W(t){return"x"===t?E:R}function $(e,r){for(var n="x"===e?I:F,a=[],i=0;i<n.length;i++){var o=n[i];o===r||(t[o]||{}).overlaying||a.push(h(o))}return a}var Q={x:W("x"),y:W("y")},J=Q.x.concat(Q.y),K={},tt=[];function et(){var t=q.matches;g.test(t)&&-1===J.indexOf(t)&&(K[t]=q.type,tt=Object.keys(K))}for(d=0;d<N.length;d++){B=N[d],H=h(B),V=B.charAt(0),n.isPlainObject(t[B])||(t[B]={}),q=t[B],U=i.newContainer(e,B,V+"axis"),Z();var rt="x"===V&&!k[B]&&_[B]||"y"===V&&!T[B]&&w[B],nt="y"===V&&(!M[B]&&A[B]||L[B]),at={letter:V,font:e.font,outerTicks:S[B],showGrid:!C[B],data:b[B]||[],bgColor:G,calendar:e.calendar,automargin:!0,visibleDflt:rt,reverseDflt:nt,splomStash:((e._splomAxes||{})[V]||{})[H]};X("uirevision",e.uirevision),s(q,U,X,at),c(q,U,X,at,e);var it=Y("spikecolor"),ot=Y("spikethickness"),lt=Y("spikedash"),st=Y("spikemode"),ct=Y("spikesnap");X("showspikes",!!(it||ot||lt||st||ct))||(delete U.spikecolor,delete U.spikethickness,delete U.spikedash,delete U.spikemode,delete U.spikesnap),f(q,U,X,{letter:V,counterAxes:Q[V],overlayableAxes:$(V,B),grid:e.grid}),X("title.standoff"),et(),U._input=q}for(d=0;d<tt.length;){H=tt[d++],V=(B=p(H)).charAt(0),n.isPlainObject(t[B])||(t[B]={}),q=t[B],U=i.newContainer(e,B,V+"axis"),Z();var ut={letter:V,font:e.font,outerTicks:S[B],showGrid:!C[B],data:[],bgColor:G,calendar:e.calendar,automargin:!0,visibleDflt:!1,reverseDflt:!1,splomStash:((e._splomAxes||{})[V]||{})[H]};X("uirevision",e.uirevision),U.type=K[H]||"linear",c(q,U,X,ut,e),f(q,U,X,{letter:V,counterAxes:Q[V],overlayableAxes:$(V,B),grid:e.grid}),X("fixedrange"),et(),U._input=q}var ft=y("rangeslider","handleDefaults"),dt=y("rangeselector","handleDefaults");for(d=0;d<I.length;d++)B=I[d],q=t[B],U=e[B],ft(t,e,B),"date"===U.type&&dt(q,U,e,F,U.calendar),X("fixedrange");for(d=0;d<F.length;d++){B=F[d],q=t[B],U=e[B];var pt=e[p(U.anchor)];X("fixedrange",y("rangeslider","isVisible")(pt))}var ht=e._axisConstraintGroups=[],gt=e._axisMatchGroups=[],vt=J.concat(tt),mt=N.concat(n.simpleMap(tt,p));for(d=0;d<mt.length;d++){var yt,xt;V=(B=mt[d]).charAt(0),q=t[B],U=e[B],yt="y"===V&&!q.hasOwnProperty("scaleanchor")&&L[B]?U.anchor:void 0,xt=!q.hasOwnProperty("constrain")&&L[B]?"domain":void 0,u(q,U,X,{allAxisIds:vt,layoutOut:e,scaleanchorDflt:yt,constrainDflt:xt})}for(d=0;d<gt.length;d++){var bt=gt[d],_t=null,wt=null;for(H in bt)(U=e[p(H)]).matches||(_t=U.range,wt=U.autorange);if(null===_t||null===wt)for(H in bt){_t=(U=e[p(H)]).range,wt=U.autorange;break}for(H in bt)(U=e[p(H)]).matches&&(U.range=_t.slice(),U.autorange=wt),U._matchGroup=bt;if(ht.length)for(H in bt)for(v=0;v<ht.length;v++){var kt=ht[v];for(var Tt in kt)H===Tt&&(n.warn("Axis "+Tt+" is set with both a *scaleanchor* and *matches* constraint; ignoring the scale constraint."),delete kt[Tt],Object.keys(kt).length<2&&ht.splice(v,1))}}}},{"../../components/color":42,"../../lib":159,"../../plot_api/plot_template":193,"../../registry":243,"../layout_attributes":233,"./axis_defaults":205,"./axis_ids":206,"./constants":209,"./constraints":210,"./layout_attributes":215,"./position_defaults":218,"./type_defaults":226}],217:[function(t,e,r){"use strict";var n=t("tinycolor2").mix,a=t("../../components/color/attributes").lightFraction,i=t("../../lib");e.exports=function(t,e,r,o){var l=(o=o||{}).dfltColor;function s(r,n){return i.coerce2(t,e,o.attributes,r,n)}var c=s("linecolor",l),u=s("linewidth");r("showline",o.showLine||!!c||!!u)||(delete e.linecolor,delete e.linewidth);var f=s("gridcolor",n(l,o.bgColor,o.blend||a).toRgbString()),d=s("gridwidth");if(r("showgrid",o.showGrid||!!f||!!d)||(delete e.gridcolor,delete e.gridwidth),!o.noZeroLine){var p=s("zerolinecolor",l),h=s("zerolinewidth");r("zeroline",o.showGrid||!!p||!!h)||(delete e.zerolinecolor,delete e.zerolinewidth)}}},{"../../components/color/attributes":41,"../../lib":159,tinycolor2:25}],218:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib");e.exports=function(t,e,r,i){var o,l,s,c,u=i.counterAxes||[],f=i.overlayableAxes||[],d=i.letter,p=i.grid;p&&(l=p._domains[d][p._axisMap[e._id]],o=p._anchors[e._id],l&&(s=p[d+"side"].split(" ")[0],c=p.domain[d]["right"===s||"top"===s?1:0])),l=l||[0,1],o=o||(n(t.position)?"free":u[0]||"free"),s=s||("x"===d?"bottom":"left"),c=c||0,"free"===a.coerce(t,e,{anchor:{valType:"enumerated",values:["free"].concat(u),dflt:o}},"anchor")&&r("position",c),a.coerce(t,e,{side:{valType:"enumerated",values:"x"===d?["bottom","top"]:["left","right"],dflt:s}},"side");var h=!1;if(f.length&&(h=a.coerce(t,e,{overlaying:{valType:"enumerated",values:[!1].concat(f),dflt:!1}},"overlaying")),!h){var g=r("domain",l);g[0]>g[1]-1/4096&&(e.domain=l),a.noneOrAll(t.domain,e.domain,l)}return r("layer"),e}},{"../../lib":159,"fast-isnumeric":9}],219:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var 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":136}],220:[function(t,e,r){"use strict";var n=t("polybooljs"),a=t("../../registry"),i=t("../../components/color"),o=t("../../components/fx"),l=t("../../lib"),s=t("../../lib/polygon"),c=t("../../lib/throttle"),u=t("../../components/fx/helpers").makeEventData,f=t("./axis_ids").getFromId,d=t("../../lib/clear_gl_canvases"),p=t("../../plot_api/subroutines").redrawReglTraces,h=t("./constants"),g=h.MINSELECT,v=s.filter,m=s.tester;function y(t){return t._id}function x(t,e,r,n,a,i,o){var l,s,c,u,f,d,p,h,g,v=e._hoverdata,m=e._fullLayout.clickmode.indexOf("event")>-1,y=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(v)){k(t,e,i);var x=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}}(v,l=M(e,r,n,a));if(x.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}(l,x):function(t){var e,r,n,a=0;for(n=0;n<t.length;n++)if(e=t[n],(r=e.cd[0].trace).selectedpoints){if(r.selectedpoints.length>1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(l)&&(d=L(x))){for(o&&o.remove(),g=0;g<l.length;g++)(s=l[g])._module.selectPoints(s,!1);S(e,l),T(i),m&&e.emit("plotly_deselect",null)}else{for(p=t.shiftKey&&(void 0!==d?d:L(x)),c=function(t,e,r){return{pointNumber:t,searchInfo:e,subtract:r}}(x.pointNumber,x.searchInfo,p),u=w(i.selectionDefs.concat([c])),g=0;g<l.length;g++)if(f=C(l[g]._module.selectPoints(l[g],u),l[g]),y.length)for(var b=0;b<f.length;b++)y.push(f[b]);else y=f;S(e,l,h={points:y}),c&&i&&i.selectionDefs.push(c),o&&A(i.mergedPolygons,o),m&&e.emit("plotly_selected",h)}}}function b(t){return"pointNumber"in t&&"searchInfo"in t}function _(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=b(t[0])?0:t[0][0][0],n=r,a=b(t[0])?0:t[0][0][1],i=a,o=0;o<t.length;o++)if(b(t[o]))e.push(_(t[o]));else{var l=s.tester(t[o]);l.subtract=t[o].subtract,e.push(l),r=Math.min(r,l.xmin),n=Math.max(n,l.xmax),a=Math.min(a,l.ymin),i=Math.max(i,l.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 k(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||T(r),i||(O(e),n._lastSelectedSubplot=a.id)}function T(t){var e=t.plotinfo;e.selection={},e.selection.selectionDefs=t.selectionDefs=[],e.selection.mergedPolygons=t.mergedPolygons=[]}function M(t,e,r,n){var a,i,o,l=[],s=e.map(y),c=r.map(y);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[s[0]]&&i._yaxes[c[0]]){var u=p(i._module,a,e[0],r[0]);u.scene=t._fullLayout._splomScenes[i.uid],l.push(u)}else if("sankey"===i.type){var d=p(i._module,a,e[0],r[0]);l.push(d)}else{if(-1===s.indexOf(i.xaxis))continue;if(-1===c.indexOf(i.yaxis))continue;l.push(p(i._module,a,f(t,i.xaxis),f(t,i.yaxis)))}else l.push(p(i._module,a,e[0],r[0]));return l;function p(t,e,r,n){return{_module:t,cd:e,xaxis:r,yaxis:n}}}function A(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 L(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,l;for(n=0;n<e.length;n++){var s=e[n].cd[0].trace._fullInput,c=t._fullLayout._tracePreGUI[s.uid]||{};void 0===c.selectedpoints&&(c.selectedpoints=s._input.selectedpoints||null)}if(r){var u=r.points||[];for(n=0;n<e.length;n++)(l=e[n].cd[0].trace)._input.selectedpoints=l._fullInput.selectedpoints=[],l._fullInput!==l&&(l.selectedpoints=[]);for(n=0;n<u.length;n++){var f=u[n],h=f.data,g=f.fullData;f.pointIndices?([].push.apply(h.selectedpoints,f.pointIndices),l._fullInput!==l&&[].push.apply(g.selectedpoints,f.pointIndices)):(h.selectedpoints.push(f.pointIndex),l._fullInput!==l&&g.selectedpoints.push(f.pointIndex))}}else for(n=0;n<e.length;n++)delete(l=e[n].cd[0].trace).selectedpoints,delete l._input.selectedpoints,l._fullInput!==l&&delete l._fullInput.selectedpoints;var v=!1;for(n=0;n<e.length;n++){l=(o=(i=e[n]).cd)[0].trace,a.traceIs(l,"regl")&&(v=!0);var m=i._module,y=m.styleOnSelect||m.style;y&&(y(t,o,o[0].node3),o[0].nodeRangePlot3&&y(t,o,o[0].nodeRangePlot3))}v&&(d(t),p(t))}function C(t,e){if(Array.isArray(t))for(var r=e.cd,n=e.cd[0].trace,a=0;a<t.length;a++)t[a]=u(t[a],n,r);return t}function O(t){var e=(t._fullLayout||{})._zoomlayer;e&&e.selectAll(".select-outline").remove()}e.exports={prepSelect:function(t,e,r,a,s){var u,f,d,p,y,b,_,L=a.gd,O=L._fullLayout,P=O._zoomlayer,D=a.element.getBoundingClientRect(),z=a.plotinfo,R=z.xaxis._offset,E=z.yaxis._offset,I=e-D.left,F=r-D.top,N=I,j=F,B="M"+I+","+F,H=a.xaxes[0]._length,V=a.yaxes[0]._length,q=a.xaxes.concat(a.yaxes),U=t.altKey;k(t,L,a),"lasso"===s&&(u=v([[I,F]],h.BENDPX));var G=P.selectAll("path.select-outline-"+z.id).data([1,2]);G.enter().append("path").attr("class",function(t){return"select-outline select-outline-"+t+" select-outline-"+z.id}).attr("transform","translate("+R+", "+E+")").attr("d",B+"Z");var Z,X=P.append("path").attr("class","zoombox-corners").style({fill:i.background,stroke:i.defaultLine,"stroke-width":1}).attr("transform","translate("+R+", "+E+")").attr("d","M0,0Z"),Y=O._uid+h.SELECTID,W=[],$=M(L,a.xaxes,a.yaxes,a.subplot);function Q(t,e){return"log"===t.type?t.p2d(e):t.p2r(e)}function J(t){var e="y"===t._id.charAt(0)?1:0;return function(r){return Q(t,r[e])}}function K(t,e){return t-e}Z=z.fillRangeItems?z.fillRangeItems:"select"===s?function(t,e){var r=t.range={};for(y=0;y<q.length;y++){var n=q[y],a=n._id.charAt(0);r[n._id]=[Q(n,e[a+"min"]),Q(n,e[a+"max"])].sort(K)}}:function(t,e,r){var n=t.lassoPoints={};for(y=0;y<q.length;y++){var a=q[y];n[a._id]=r.filtered.map(J(a))}},a.moveFn=function(t,e){N=Math.max(0,Math.min(H,t+I)),j=Math.max(0,Math.min(V,e+F));var r=Math.abs(N-I),i=Math.abs(j-F);if("select"===s){var o=O.selectdirection;"h"===(o="any"===O.selectdirection?i<Math.min(.6*r,g)?"h":r<Math.min(.6*i,g)?"v":"d":O.selectdirection)?((p=[[I,0],[I,V],[N,V],[N,0]]).xmin=Math.min(I,N),p.xmax=Math.max(I,N),p.ymin=Math.min(0,V),p.ymax=Math.max(0,V),X.attr("d","M"+p.xmin+","+(F-g)+"h-4v"+2*g+"h4ZM"+(p.xmax-1)+","+(F-g)+"h4v"+2*g+"h-4Z")):"v"===o?((p=[[0,F],[0,j],[H,j],[H,F]]).xmin=Math.min(0,H),p.xmax=Math.max(0,H),p.ymin=Math.min(F,j),p.ymax=Math.max(F,j),X.attr("d","M"+(I-g)+","+p.ymin+"v-4h"+2*g+"v4ZM"+(I-g)+","+(p.ymax-1)+"v4h"+2*g+"v-4Z")):"d"===o&&((p=[[I,F],[I,j],[N,j],[N,F]]).xmin=Math.min(I,N),p.xmax=Math.max(I,N),p.ymin=Math.min(F,j),p.ymax=Math.max(F,j),X.attr("d","M0,0Z"))}else"lasso"===s&&(u.addPt([N,j]),p=u.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,p,U),p.subtract=U,f=w(a.selectionDefs.concat([p]))):(d=[p],f=m(p)),A(d,G),c.throttle(Y,h.SELECTDELAY,function(){var t;W=[];var e,r=[];for(y=0;y<$.length;y++)if(e=(b=$[y])._module.selectPoints(b,f),r.push(e),t=C(e,b),W.length)for(var n=0;n<t.length;n++)W.push(t[n]);else W=t;S(L,$,_={points:W}),Z(_,p,u),a.gd.emit("plotly_selecting",_)})},a.clickFn=function(t,e){var r=O.clickmode;X.remove(),c.done(Y).then(function(){if(c.clear(Y),2===t){for(G.remove(),y=0;y<$.length;y++)(b=$[y])._module.selectPoints(b,!1);S(L,$),T(a),L.emit("plotly_deselect",null)}else r.indexOf("select")>-1&&x(e,L,a.xaxes,a.yaxes,a.subplot,a,G),"event"===r&&L.emit("plotly_selected",void 0);o.click(L,e)}).catch(l.error)},a.doneFn=function(){X.remove(),c.done(Y).then(function(){c.clear(Y),a.gd.emit("plotly_selected",_),p&&a.selectionDefs&&(p.subtract=U,a.selectionDefs.push(p),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,d)),a.doneFnCompleted&&a.doneFnCompleted(W)}).catch(l.error)}},clearSelect:O,selectOnClick:x}},{"../../components/color":42,"../../components/fx":80,"../../components/fx/helpers":77,"../../lib":159,"../../lib/clear_gl_canvases":148,"../../lib/polygon":171,"../../lib/throttle":181,"../../plot_api/subroutines":194,"../../registry":243,"./axis_ids":206,"./constants":209,polybooljs:16}],221:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../../lib"),o=i.cleanNumber,l=i.ms2DateTime,s=i.dateTime2ms,c=i.ensureNumber,u=i.isArrayOrTypedArray,f=t("../../constants/numerical"),d=f.FP_SAFE,p=f.BADNUM,h=f.LOG_CLIP,g=t("./constants"),v=t("./axis_ids");function m(t){return Math.pow(10,t)}function y(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",f=r.charAt(0);function x(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*h*Math.abs(n-a))}return p}function b(e,r,n){var o=s(e,n||t.calendar);if(o===p){if(!a(e))return p;e=+e;var l=Math.floor(10*i.mod(e+.05,1)),c=Math.round(e-l/10);o=s(new Date(c))+l/10}return o}function _(e,r,n){return l(e,r,n||t.calendar)}function w(e){return t._categories[Math.round(e)]}function k(e){if(y(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 p}function T(e){if(t._categoriesMap)return t._categoriesMap[e]}function M(t){var e=T(t);return void 0!==e?e:a(t)?+t:void 0}function A(e){return a(e)?n.round(t._b+t._m*e,2):p}function L(e){return(e-t._b)/t._m}t.c2l="log"===t.type?x:c,t.l2c="log"===t.type?m:c,t.l2p=A,t.p2l=L,t.c2p="log"===t.type?function(t,e){return A(x(t,e))}:A,t.p2c="log"===t.type?function(t){return m(L(t))}:L,-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=c,t.d2p=t.r2p=function(e){return t.l2p(o(e))},t.p2d=t.p2r=L,t.cleanPos=c):"log"===t.type?(t.d2r=t.d2l=function(t,e){return x(o(t),e)},t.r2d=t.r2c=function(t){return m(o(t))},t.d2c=t.r2l=o,t.c2d=t.l2r=c,t.c2r=x,t.l2d=m,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return m(L(t))},t.r2p=function(e){return t.l2p(o(e))},t.p2r=L,t.cleanPos=c):"date"===t.type?(t.d2r=t.r2d=i.identity,t.d2c=t.r2c=t.d2l=t.r2l=b,t.c2d=t.c2r=t.l2d=t.l2r=_,t.d2p=t.r2p=function(e,r,n){return t.l2p(b(e,0,n))},t.p2d=t.p2r=function(t,e,r){return _(L(t),e,r)},t.cleanPos=function(e){return i.cleanDate(e,p,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=k,t.r2d=t.c2d=t.l2d=w,t.d2r=t.d2l_noadd=M,t.r2c=function(e){var r=M(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=c,t.r2l=M,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return w(L(t))},t.r2p=t.d2p,t.p2r=L,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:c(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=w,t.d2r=t.d2l_noadd=M,t.r2c=function(e){var r=M(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=T,t.l2r=t.c2r=c,t.r2l=M,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return w(L(t))},t.r2p=t.d2p,t.p2r=L,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:c(t)},t.setupMultiCategory=function(n){var a,o,l=t._traceIndices,s=e._axisMatchGroups;if(s&&s.length&&0===t._categories.length)for(a=0;a<s.length;a++){var c=s[a];if(c[r])for(var d in c)if(d!==r){var p=e[v.id2name(d)];l=l.concat(p._traceIndices)}}var h=[[0,{}],[0,{}]],g=[];for(a=0;a<l.length;a++){var m=n[l[a]];if(f in m){var x=m[f],b=m._length||i.minRowLength(x);if(u(x[0])&&u(x[1]))for(o=0;o<b;o++){var _=x[0][o],w=x[1][o];y(_)&&y(w)&&(g.push([_,w]),_ in h[0][1]||(h[0][1][_]=h[0][0]++),w in h[1][1]||(h[1][1][w]=h[1][0]++))}}}for(g.sort(function(t,e){var r=h[0][1],n=r[t[0]]-r[e[0]];if(n)return n;var a=h[1][1];return a[t[1]]-a[e[1]]}),a=0;a<g.length;a++)k(g[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,l=i.nestedProperty(t,e).get();if(o=(o="date"===t.type?i.dfltRange(t.calendar):"y"===f?g.DFLTRANGEY:r.dfltRange||g.DFLTRANGEX).slice(),"tozero"!==t.rangemode&&"nonnegative"!==t.rangemode||(o[0]=0),l&&2===l.length)for("date"!==t.type||t.autorange||(l[0]=i.cleanDate(l[0],p,t.calendar),l[1]=i.cleanDate(l[1],p,t.calendar)),n=0;n<2;n++)if("date"===t.type){if(!i.isDateTime(l[n],t.calendar)){t[e]=o;break}if(t.r2l(l[0])===t.r2l(l[1])){var s=i.constrain(t.r2l(l[0]),i.MIN_MS+1e3,i.MAX_MS-1e3);l[0]=t.l2r(s-1e3),l[1]=t.l2r(s+1e3);break}}else{if(!a(l[n])){if(!a(l[1-n])){t[e]=o;break}l[n]=l[1-n]*(n?10:.1)}if(l[n]<-d?l[n]=-d:l[n]>d&&(l[n]=d),l[0]===l[1]){var c=Math.max(1,Math.abs(1e-6*l[0]));l[0]-=c,l[1]+=c}}else i.nestedProperty(t,e).set(o)},t.setScale=function(r){var n=e._size;if(t.overlaying){var a=v.getFromId({_fullLayout:e},t.overlaying);t.domain=a.domain}var i=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(i);var l=t.r2l(t[i][0],o),s=t.r2l(t[i][1],o);if("y"===f?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(l-s),t._b=-t._m*s):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(s-l),t._b=-t._m*l),!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,l,s=t.type,c="date"===s&&e[r+"calendar"];if(r in e){if(n=e[r],l=e._length||i.minRowLength(n),i.isTypedArray(n)&&("linear"===s||"log"===s)){if(l===n.length)return n;if(n.subarray)return n.subarray(0,l)}if("multicategory"===s)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]=T([a,i])}return r}(n,l);for(a=new Array(l),o=0;o<l;o++)a[o]=t.d2c(n[o],0,c)}else{var u=r+"0"in e?t.d2c(e[r+"0"],0,c):0,f=e["d"+r]?Number(e["d"+r]):1;for(n=e[{x:"y",y:"x"}[r]],l=e._length||n.length,a=new Array(l),o=0;o<l;o++)a[o]=u+o*f}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[f],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 l=a[o];if(l[r]){i=!0;var s=null,c=null;for(var u in l){var f=e[v.id2name(u)];if(f._categories){s=f._categories,c=f._categoriesMap;break}}s&&c?(t._categories=s,t._categoriesMap=c):n();break}}i||n()}else n();if(t._initialCategories)for(var d=0;d<t._initialCategories.length;d++)k(t._initialCategories[d])},t.sortByInitialCategories=function(){var n=[];if(t._categories=[],t._categoriesMap={},t._initialCategories)for(var a=0;a<t._initialCategories.length;a++)k(t._initialCategories[a]);n=n.concat(t._traceIndices);var i=t._matchGroup;for(var o in i)if(r!==o){var l=e[v.id2name(o)];l._categories=t._categories,l._categoriesMap=t._categoriesMap,n=n.concat(l._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":139,"../../lib":159,"./axis_ids":206,"./constants":209,d3:7,"fast-isnumeric":9}],222:[function(t,e,r){"use strict";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 l(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,s,c,u){u&&1!==u.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,c),u&&2!==u.pass||function(t,e,r,s,c){var u=o(t);r("tickprefix")&&r("showtickprefix",u);r("ticksuffix",c.tickSuffixDflt)&&r("showticksuffix",u);if(r("showticklabels")){var f=c.font||{},d=e.color,p=d&&d!==a.color.dflt?d:f.color;if(n.coerceFont(r,"tickfont",{family:f.family,size:f.size,color:p}),r("tickangle"),"category"!==s){var h=r("tickformat"),g=t.tickformatstops;Array.isArray(g)&&g.length&&i(t,e,{name:"tickformatstops",inclusionAttr:"enabled",handleItemDefaults:l}),h||"date"===s||(r("showexponent",u),r("exponentformat"),r("separatethousands"))}}}(t,e,r,s,c)}},{"../../lib":159,"../array_container_defaults":199,"./layout_attributes":215}],223:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r,i){var o=n.coerce2(t,e,a,"ticklen"),l=n.coerce2(t,e,a,"tickwidth"),s=n.coerce2(t,e,a,"tickcolor",e.color);r("ticks",i.outerTicks||o||l||s?"outside":"")||(delete e.ticklen,delete e.tickwidth,delete e.tickcolor)}},{"../../lib":159,"./layout_attributes":215}],224:[function(t,e,r){"use strict";var n=t("./clean_ticks");e.exports=function(t,e,r,a){var i;"array"!==t.tickmode||"log"!==a&&"date"!==a?i=r("tickmode",Array.isArray(t.tickvals)?"array":t.dtick?"linear":"auto"):i=e.tickmode="auto";if("auto"===i)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 if("multicategory"!==a){void 0===r("tickvals")?e.tickmode="auto":r("ticktext")}}},{"./clean_ticks":208}],225:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../lib"),o=t("../../components/drawing"),l=t("./axes");e.exports=function(t,e,r,s){var c=t._fullLayout;if(0!==e.length){var u,f,d,p;s&&(u=s());var h=n.ease(r.easing);return t._transitionData._interruptCallbacks.push(function(){return window.cancelAnimationFrame(p),p=null,function(){for(var r={},n=0;n<e.length;n++){var i=e[n],o=i.plotinfo.xaxis,l=i.plotinfo.yaxis;i.xr0&&(r[o._name+".range"]=i.xr0.slice()),i.yr0&&(r[l._name+".range"]=i.yr0.slice())}return a.call("relayout",t,r).then(function(){for(var t=0;t<e.length;t++)g(e[t].plotinfo)})}()}),f=Date.now(),p=window.requestAnimationFrame(function n(){d=Date.now();for(var i=Math.min(1,(d-f)/r.duration),o=h(i),l=0;l<e.length;l++)v(e[l],o);d-f>r.duration?(function(){for(var r={},n=0;n<e.length;n++){var i=e[n],o=i.plotinfo.xaxis,l=i.plotinfo.yaxis;i.xr1&&(r[o._name+".range"]=i.xr1.slice()),i.yr1&&(r[l._name+".range"]=i.yr1.slice())}u&&u(),a.call("relayout",t,r).then(function(){for(var t=0;t<e.length;t++)g(e[t].plotinfo)})}(),p=window.cancelAnimationFrame(n)):p=window.requestAnimationFrame(n)}),Promise.resolve()}function g(t){var e=t.xaxis,r=t.yaxis;c._defs.select("#"+t.clipId+"> rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,t)}function v(e,r){var n=e.plotinfo,a=n.xaxis,s=n.yaxis,c=a._length,u=s._length,f=!!e.xr1,d=!!e.yr1,p=[];if(f){var h=i.simpleMap(e.xr0,a.r2l),g=i.simpleMap(e.xr1,a.r2l),v=h[1]-h[0],m=g[1]-g[0];p[0]=(h[0]*(1-r)+r*g[0]-h[0])/(h[1]-h[0])*c,p[2]=c*(1-r+r*m/v),a.range[0]=a.l2r(h[0]*(1-r)+r*g[0]),a.range[1]=a.l2r(h[1]*(1-r)+r*g[1])}else p[0]=0,p[2]=c;if(d){var y=i.simpleMap(e.yr0,s.r2l),x=i.simpleMap(e.yr1,s.r2l),b=y[1]-y[0],_=x[1]-x[0];p[1]=(y[1]*(1-r)+r*x[1]-y[1])/(y[0]-y[1])*u,p[3]=u*(1-r+r*_/b),s.range[0]=a.l2r(y[0]*(1-r)+r*x[0]),s.range[1]=s.l2r(y[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=u;l.drawOne(t,a,{skipTitle:!0}),l.drawOne(t,s,{skipTitle:!0}),l.redrawComponents(t,[a._id,s._id]);var w=f?c/p[2]:1,k=d?u/p[3]:1,T=f?p[0]:0,M=d?p[1]:0,A=f?p[0]/p[2]*c:0,L=d?p[1]/p[3]*u:0,S=a._offset-A,C=s._offset-L;n.clipRect.call(o.setTranslate,T,M).call(o.setScale,1/w,1/k),n.plot.call(o.setTranslate,S,C).call(o.setScale,w,k),o.setPointGroupScale(n.zoomScalePts,1/w,1/k),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/k)}l.redrawComponents(t)}},{"../../components/drawing":63,"../../lib":159,"../../registry":243,"./axes":203,d3:7}],226:[function(t,e,r){"use strict";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,l){"-"===r("type",(l.splomStash||{}).type)&&(!function(t,e){if("-"!==t.type)return;var r,l=t._id,s=l.charAt(0);-1!==l.indexOf("scene")&&(l=s);var c=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,l,s);if(!c)return;if("histogram"===c.type&&s==={v:"y",h:"x"}[c.orientation||"v"])return void(t.type="linear");var u=s+"calendar",f=c[u],d={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};"box"===c.type&&c._hasPreCompStats&&s==={h:"x",v:"y"}[c.orientation||"v"]&&(d.noMultiCategory=!0);if(o(c,s)){var p=i(c),h=[];for(r=0;r<e.length;r++){var g=e[r];n(g,"box-violin")&&(g[s+"axis"]||s)===l&&(void 0!==g[p]?h.push(g[p][0]):void 0!==g.name?h.push(g.name):h.push("text"),g[u]!==f&&(f=void 0))}t.type=a(h,f,d)}else if("splom"===c.type){var v=c.dimensions,m=v[c._axesDim[l]];m.visible&&(t.type=a(m.values,f,d))}else t.type=a(c[s]||[c[s+"0"]],f,d)}(e,l.data),"-"===e.type?e.type="linear":t.type=e.type)}},{"../../registry":243,"./axis_autotype":204}],227:[function(t,e,r){"use strict";var n=t("../registry"),a=t("../lib");function i(t,e,r){var n,i,o,l=!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&&(l=!0),o[e.prop]=i,{changed:l,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 s(i,function(t,e,n){r.push({type:"layout",prop:t,value:n})},"",0),r}function l(t,e){var r,n,i,o,l=[];if(n=e[0],i=e[1],r=e[2],o={},"string"==typeof n)o[n]=i;else{if(!a.isPlainObject(n))return l;o=n,void 0===r&&(r=i)}return void 0===r&&(r=null),s(o,function(e,n,a){var i,o;if(Array.isArray(a)){o=a.slice();var s=Math.min(o.length,t.data.length);r&&(s=Math.min(s,r.length)),i=[];for(var c=0;c<s;c++)i[c]=r?r[c]:c}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 u=o;o=[];for(var f=0;f<i.length;f++)o[f]=u}o.length=Math.min(i.length,o.length)}l.push({type:"data",prop:e,traces:i,value:o})},"",0),l}function s(t,e,r,n){Object.keys(t).forEach(function(i){var o=t[i];if("_"!==i[0]){var l=r+(n>0?".":"")+i;a.isPlainObject(o)?s(o,e,l,n+1):e(l,i,o)}})}r.manageCommandObserver=function(t,e,n,o){var l={},s=!0;e&&e._commandObserver&&(l=e._commandObserver),l.cache||(l.cache={}),l.lookupTable={};var c=r.hasSimpleAPICommandBindings(t,n,l.lookupTable);if(e&&e._commandObserver){if(c)return l;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,l}if(c){i(t,c,l.cache),l.check=function(){if(s){var e=i(t,c,l.cache);return e.changed&&o&&void 0!==l.lookupTable[e.value]&&(l.disable(),Promise.resolve(o({value:e.value,type:c.type,prop:c.prop,traces:c.traces,index:l.lookupTable[e.value]})).then(l.enable,l.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f<u.length;f++)t._internalOn(u[f],l.check);l.remove=function(){for(var e=0;e<u.length;e++)t._removeInternalListener(u[e],l.check)}}else a.log("Unable to automatically bind plot updates to API command"),l.lookupTable={},l.remove=function(){};return l.disable=function(){s=!1},l.enable=function(){s=!0},e&&(e._commandObserver=l),l},r.hasSimpleAPICommandBindings=function(t,e,n){var a,i,o=e.length;for(a=0;a<o;a++){var l,s=e[a],c=s.method,u=s.args;if(Array.isArray(u)||(u=[]),!c)return!1;var f=r.computeAPICommandBindings(t,c,u);if(1!==f.length)return!1;if(i){if((l=f[0]).type!==i.type)return!1;if(l.prop!==i.prop)return!1;if(Array.isArray(i.traces)){if(!Array.isArray(l.traces))return!1;l.traces.sort();for(var d=0;d<i.traces.length;d++)if(i.traces[d]!==l.traces[d])return!1}else if(l.prop!==i.prop)return!1}else i=f[0],Array.isArray(i.traces)&&i.traces.sort();var p=(l=f[0]).value;if(Array.isArray(p)){if(1!==p.length)return!1;p=p[0]}n&&(n[p]=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 l=0;l<r.length;l++)o.push(r[l]);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=l(t,r);break;case"relayout":n=o(t,r);break;case"update":n=l(t,[r[0],r[2]]).concat(o(t,[r[1]]));break;case"animate":n=function(t,e){return Array.isArray(e[0])&&1===e[0].length&&-1!==["string","number"].indexOf(typeof e[0][0])?[{type:"layout",prop:"_currentFrame",value:e[0][0].toString()}]:[]}(0,r);break;default:n=[]}return n}},{"../lib":159,"../registry":243}],228:[function(t,e,r){"use strict";var n=t("../lib/extend").extendFlat;r.attributes=function(t,e){e=e||{};var r={valType:"info_array",editType:(t=t||{}).editType,items:[{valType:"number",min:0,max:1,editType:t.editType},{valType:"number",min:0,max:1,editType:t.editType}],dflt:[0,1]},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 l=r("domain.column");void 0!==l&&(l<o.columns?a=o._domains.x[l]:delete t.domain.column);var s=r("domain.row");void 0!==s&&(s<o.rows?i=o._domains.y[s]:delete t.domain.row)}var c=r("domain.x",a),u=r("domain.y",i);c[0]<c[1]||(t.domain.x=a.slice()),u[0]<u[1]||(t.domain.y=i.slice())}},{"../lib/extend":154}],229:[function(t,e,r){"use strict";e.exports=function(t){var e=t.editType,r=t.colorEditType;void 0===r&&(r=e);var n={family:{valType:"string",noBlank:!0,strict:!0,editType:e},size:{valType:"number",min:1,editType:e},color:{valType:"color",editType:r},editType:e};return t.arrayOk&&(n.family.arrayOk=!0,n.size.arrayOk=!0,n.color.arrayOk=!0),n}},{}],230:[function(t,e,r){"use strict";e.exports={_isLinkedToArray:"frames_entry",group:{valType:"string"},name:{valType:"string"},traces:{valType:"any"},baseframe:{valType:"string"},data:{valType:"any"},layout:{valType:"any"}}},{}],231:[function(t,e,r){"use strict";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=[],l=0;l<t.length;l++){var s=t[l];s[0].trace[i]===r&&o.push(s)}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 l=t[o],s=l[0].trace;!0===s.visible&&0!==s._length&&(s._module.plot===r?a.push(l):i.push(l))}return[a,i]},r.getSubplotData=function(t,e,r){if(!n.subplotsRegistry[e])return[];var i,o,l,s=n.subplotsRegistry[e].attr,c=[];if("gl2d"===e){var u=r.match(a);o="x"+u[1],l="y"+u[2]}for(var f=0;f<t.length;f++)i=t[f],"gl2d"===e&&n.traceIs(i,"gl2d")?i[s[0]]===o&&i[s[1]]===l&&c.push(i):i[s]===r&&c.push(i);return c}},{"../registry":243,"./cartesian/constants":209}],232:[function(t,e,r){"use strict";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])))}},{}],233:[function(t,e,r){"use strict";var n=t("./font_attributes"),a=t("./animation_attributes"),i=t("../components/color/attributes"),o=t("./pad_attributes"),l=t("../lib/extend").extendFlat,s=n({editType:"calc"});s.family.dflt='"Open Sans", verdana, arial, sans-serif',s.size.dflt=12,s.color.dflt=i.defaultLine,e.exports={font:s,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:l(o({editType:"layoutstyle"}),{}),editType:"layoutstyle"},uniformtext:{mode:{valType:"enumerated",values:[!1,"hide","show"],dflt:!1,editType:"plot"},minsize:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"},autosize:{valType:"boolean",dflt:!1,editType:"none"},width:{valType:"number",min:10,dflt:700,editType:"plot"},height:{valType:"number",min:10,dflt:450,editType:"plot"},margin:{l:{valType:"number",min:0,dflt:80,editType:"plot"},r:{valType:"number",min:0,dflt:80,editType:"plot"},t:{valType:"number",min:0,dflt:100,editType:"plot"},b:{valType:"number",min:0,dflt:80,editType:"plot"},pad:{valType:"number",min:0,dflt:0,editType:"plot"},autoexpand:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},paper_bgcolor:{valType:"color",dflt: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:l({},a.transition,{editType:"none"}),_deprecated:{title:{valType:"string",editType:"layoutstyle"},titlefont:n({editType:"layoutstyle"})}}},{"../components/color/attributes":41,"../lib/extend":154,"./animation_attributes":198,"./font_attributes":229,"./pad_attributes":234}],234:[function(t,e,r){"use strict";e.exports=function(t){var e=t.editType;return{t:{valType:"number",dflt:0,editType:e},r:{valType:"number",dflt:0,editType:e},b:{valType:"number",dflt:0,editType:e},l:{valType:"number",dflt:0,editType:e},editType:e}}},{}],235:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../registry"),o=t("../plot_api/plot_schema"),l=t("../plot_api/plot_template"),s=t("../lib"),c=t("../components/color"),u=t("../constants/numerical").BADNUM,f=t("./cartesian/axis_ids"),d=t("./animation_attributes"),p=t("./frame_attributes"),h=t("../plots/get_data").getModuleCalcData,g=s.relinkPrivateKeys,v=s._,m=e.exports={};s.extendFlat(m,i),m.attributes=t("./attributes"),m.attributes.type.values=m.allTypes,m.fontAttrs=t("./font_attributes"),m.layoutAttributes=t("./layout_attributes"),m.fontWeight="normal";var y=m.transformsRegistry,x=t("./command");m.executeAPICommand=x.executeAPICommand,m.computeAPICommandBindings=x.computeAPICommandBindings,m.manageCommandObserver=x.manageCommandObserver,m.hasSimpleAPICommandBindings=x.hasSimpleAPICommandBindings,m.redrawText=function(t){var e=(t=s.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(m.previousPromises(t))},300)})},m.resize=function(t){var e;t=s.getGraphDiv(t);var r=new Promise(function(r,n){t&&!s.isHidden(t)||n(new Error("Resize must be passed a displayed plot div element.")),t._redrawTimer&&clearTimeout(t._redrawTimer),t._resolveResize&&(e=t._resolveResize),t._resolveResize=r,t._redrawTimer=setTimeout(function(){if(!t.layout||t.layout.width&&t.layout.height||s.isHidden(t))r(t);else{delete t.layout.width,delete t.layout.height;var e=t.changed;t.autoplay=!0,i.call("relayout",t,{autosize:!0}).then(function(){t.changed=e,t._resolveResize===r&&(delete t._resolveResize,r(t))})}},100)});return e&&e(r),r},m.previousPromises=function(t){if((t._promises||[]).length)return Promise.all(t._promises).then(function(){t._promises=[]})},m.addLinks=function(t){if(t._context.showLink||t._context.showSources){var e=t._fullLayout,r=s.ensureSingle(e._paper,"text","js-plot-link-container",function(t){t.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:c.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"),l=r.select(".js-link-spacer"),u=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(){m.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),l.text(o.text()&&u.text()?" - ":"")}},m.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=m.graphJson(t,!1,"keepdata"),a.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1};var b=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],_=["year","month","dayMonth","dayMonthYear"];function w(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 l=0;l<2;l++){for(var s=t._context.locales,c=0;c<2;c++){var u=(s[r]||{}).format;if(u&&(o(u),n))break;s=i.localeRegistry}var f=r.split("-")[0];if(n||f===r)break;r=f}return n||o(i.localeRegistry.en.format),a}function k(t,e){var r={_fullLayout:e},n="x"===t._id.charAt(0),a=t._mainAxis._anchorAxis,i="",o="",l="";if(a&&(l=a._mainAxis._id,i=n?t._id+l:l+t._id),!i||!e._plots[i]){i="";for(var s=t._counterAxes,c=0;c<s.length;c++){var u=s[c],d=n?t._id+u:u+t._id;o||(o=d);var p=f.getFromId(r,u);if(l&&p.overlaying===l){i=d;break}}}return i||o}function T(t){var e=t.transforms;if(Array.isArray(e)&&e.length)for(var r=0;r<e.length;r++){var n=e[r],a=n._module||y[n.type];if(a&&a.makesData)return!0}return!1}function M(t,e,r,n){for(var a=t.transforms,i=[t],o=0;o<a.length;o++){var l=a[o],s=y[l.type];s&&s.transform&&(i=s.transform(i,{transform:l,fullTrace:t,fullData:e,layout:r,fullLayout:n,transformIndex:o}))}return i}function A(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={})}m.supplyDefaults=function(t,e){var r=e&&e.skipUpdateCalc,a=t._fullLayout||{};if(a._skipDefaults)delete a._skipDefaults;else{var o,l=t._fullLayout={},c=t.layout||{},u=t._fullData||[],f=t._fullData=[],d=t.data||[],p=t.calcdata||[],h=t._context||{};t._transitionData||m.createTransitionData(t),l._dfltTitle={plot:v(t,"Click to enter Plot title"),x:v(t,"Click to enter X axis title"),y:v(t,"Click to enter Y axis title"),colorbar:v(t,"Click to enter Colorscale title"),annotation:v(t,"new text")},l._traceWord=v(t,"trace");var y=w(t,b);if(l._mapboxAccessToken=h.mapboxAccessToken,a._initialAutoSizeIsDone){var x=a.width,k=a.height;m.supplyLayoutGlobalDefaults(c,l,y),c.width||(l.width=x),c.height||(l.height=k),m.sanitizeMargins(l)}else{m.supplyLayoutGlobalDefaults(c,l,y);var T=!c.width||!c.height,M=l.autosize,L=h.autosizable;T&&(M||L)?m.plotAutoSize(t,c,l):T&&m.sanitizeMargins(l),!M&&T&&(c.width=l.width,c.height=l.height)}l._d3locale=function(t,e){return t.decimal=e.charAt(0),t.thousands=e.charAt(1),n.locale(t)}(y,l.separators),l._extraFormat=w(t,_),l._initialAutoSizeIsDone=!0,l._dataLength=d.length,l._modules=[],l._visibleModules=[],l._basePlotModules=[];var S=l._subplots=function(){var t,e,r=i.collectableSubplotTypes,n={};if(!r){r=[];var a=i.subplotsRegistry;for(var o in a){var l=a[o],c=l.attr;if(c&&(r.push(o),Array.isArray(c)))for(e=0;e<c.length;e++)s.pushUnique(r,c[e])}}for(t=0;t<r.length;t++)n[r[t]]=[];return n}(),C=l._splomAxes={x:{},y:{}},O=l._splomSubplots={};l._splomGridDflt={},l._scatterStackOpts={},l._firstScatter={},l._alignmentOpts={},l._colorAxes={},l._requestRangeslider={},l._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 l=i.length,c=new Array(a),u={};function f(t,e){c[e]=t,u[t]=1}function d(t,e){if(t&&"string"==typeof t&&!u[t])return f(t,e),!0}for(r=0;r<a;r++){var p=e[r].uid;"number"==typeof p&&(p=String(p)),d(p,r)||(r<l&&d(i[r].uid,r)||f(s.randstr(u),r))}return c}(u,d),l._globalTransforms=(t._context||{}).globalTransforms,m.supplyDataDefaults(d,f,c,l);var P=Object.keys(C.x),D=Object.keys(C.y);if(P.length>1&&D.length>1){for(i.getComponentMethod("grid","sizeDefaults")(c,l),o=0;o<P.length;o++)s.pushUnique(S.xaxis,P[o]);for(o=0;o<D.length;o++)s.pushUnique(S.yaxis,D[o]);for(var z in O)s.pushUnique(S.cartesian,z)}if(l._has=m._hasPlotType.bind(l),u.length===f.length)for(o=0;o<f.length;o++)g(f[o],u[o]);m.supplyLayoutModuleDefaults(c,l,f,t._transitionData);var R=l._visibleModules,E=[];for(o=0;o<R.length;o++){var I=R[o].crossTraceDefaults;I&&s.pushUnique(E,I)}for(o=0;o<E.length;o++)E[o](f,l);l._hasOnlyLargeSploms=1===l._basePlotModules.length&&"splom"===l._basePlotModules[0].name&&P.length>15&&D.length>15&&0===l.shapes.length&&0===l.images.length,l._hasCartesian=l._has("cartesian"),l._hasGeo=l._has("geo"),l._hasGL3D=l._has("gl3d"),l._hasGL2D=l._has("gl2d"),l._hasTernary=l._has("ternary"),l._hasPie=l._has("pie"),m.linkSubplots(f,l,u,a),m.cleanPlot(f,l,u,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)}(f,l),g(l,a),i.getComponentMethod("colorscale","crossTraceDefaults")(f,l),l._preGUI||(l._preGUI={}),l._tracePreGUI||(l._tracePreGUI={});var F,N=l._tracePreGUI,j={};for(F in N)j[F]="old";for(o=0;o<f.length;o++)j[F=f[o]._fullInput.uid]||(N[F]={}),j[F]="new";for(F in j)"old"===j[F]&&delete N[F];A(l),i.getComponentMethod("rangeslider","makeData")(l),r||p.length!==f.length||m.supplyDefaultsUpdateCalc(p,f)}},m.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,l,c,u=i._arrayAttrs;for(o=0;o<u.length;o++)l=u[o],c=s.nestedProperty(i,l).get().slice(),s.nestedProperty(n,l).set(c)}a.trace=n}}},m.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=[])},m._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},m.cleanPlot=function(t,e,r,n){var a,i,o=n._basePlotModules||[];for(a=0;a<o.length;a++){var l=o[a];l.clean&&l.clean(t,e,r,n)}var s=n._has&&n._has("gl"),c=e._has&&e._has("gl");s&&!c&&void 0!==n._glcontainer&&(n._glcontainer.selectAll(".gl-canvas").remove(),n._glcontainer.selectAll(".no-webgl").remove(),n._glcanvas=null);var u=!!n._infolayer;t:for(a=0;a<r.length;a++){var f=r[a].uid;for(i=0;i<t.length;i++){if(f===t[i].uid)continue t}u&&n._infolayer.select(".cb"+f).remove()}},m.linkSubplots=function(t,e,r,n){var a,o,l=n._plots||{},c=e._plots={},u=e._subplots,d={_fullData:t,_fullLayout:e},p=u.cartesian.concat(u.gl2d||[]);for(a=0;a<p.length;a++){var h,g=p[a],v=l[g],m=f.getFromId(d,g,"x"),y=f.getFromId(d,g,"y");for(v?h=c[g]=v:(h=c[g]={}).id=g,m._counterAxes.push(y._id),y._counterAxes.push(m._id),m._subplotsWith.push(g),y._subplotsWith.push(g),h.xaxis=m,h.yaxis=y,h._hasClipOnAxisFalse=!1,o=0;o<t.length;o++){var x=t[o];if(x.xaxis===h.xaxis._id&&x.yaxis===h.yaxis._id&&!1===x.cliponaxis){h._hasClipOnAxisFalse=!0;break}}}var b,_=f.list(d,null,!0);for(a=0;a<_.length;a++){var w=null;(b=_[a]).overlaying&&(w=f.getFromId(d,b.overlaying))&&w.overlaying&&(b.overlaying=!1,w=null),b._mainAxis=w||b,w&&(b.domain=w.domain.slice()),b._anchorAxis="free"===b.anchor?null:f.getFromId(d,b.anchor)}for(a=0;a<_.length;a++)if((b=_[a])._counterAxes.sort(f.idSort),b._subplotsWith.sort(s.subplotSort),b._mainSubplot=k(b,e),b._counterAxes.length&&(b.spikemode&&-1!==b.spikemode.indexOf("across")||b.automargin&&b.mirror&&"free"!==b.anchor||i.getComponentMethod("rangeslider","isVisible")(b))){var T=1,M=0;for(o=0;o<b._counterAxes.length;o++){var A=f.getFromId(d,b._counterAxes[o]);T=Math.min(T,A.domain[0]),M=Math.max(M,A.domain[1])}T<M&&(b._counterDomainMin=T,b._counterDomainMax=M)}},m.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++){s.nestedProperty(t,"_input."+e[n]).get()||s.nestedProperty(t,e[n]).set(null)}},m.supplyDataDefaults=function(t,e,r,n){var a,o,c,u=n._modules,f=n._visibleModules,d=n._basePlotModules,p=0,h=0;function v(t){e.push(t);var r=t._module;r&&(s.pushUnique(u,r),!0===t.visible&&s.pushUnique(f,r),s.pushUnique(d,t._module.basePlotModule),p++,!1!==t._input.visible&&h++)}n._transformModules=[];var y={},x=[],b=(r.template||{}).data||{},_=l.traceTemplater(b);for(a=0;a<t.length;a++){if(c=t[a],(o=_.newTrace(c)).uid=n._traceUids[a],m.supplyTraceDefaults(c,o,h,n,a),o.index=a,o._input=c,o._expandedIndex=p,o.transforms&&o.transforms.length)for(var w=!1!==c.visible&&!1===o.visible,k=M(o,e,r,n),T=0;T<k.length;T++){var A=k[T],L={_template:o._template,type:o.type,uid:o.uid+T};w&&!1===A.visible&&delete A.visible,m.supplyTraceDefaults(A,L,p,n,a),g(L,A),L.index=a,L._input=c,L._fullInput=o,L._expandedIndex=p,L._expandedInput=A,v(L)}else o._fullInput=o,o._expandedInput=o,v(o);i.traceIs(o,"carpetAxis")&&(y[o.carpet]=o),i.traceIs(o,"carpetDependent")&&x.push(a)}for(a=0;a<x.length;a++)if((o=e[x[a]]).visible){var S=y[o.carpet];o._carpet=S,S&&S.visible?(o.xaxis=S.xaxis,o.yaxis=S.yaxis):o.visible=!1}},m.supplyAnimationDefaults=function(t){var e;t=t||{};var r={};function n(e,n){return s.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]=m.supplyAnimationFrameDefaults(t.frame[e]||{});else r.frame=m.supplyAnimationFrameDefaults(t.frame||{});if(Array.isArray(t.transition))for(r.transition=[],e=0;e<t.transition.length;e++)r.transition[e]=m.supplyAnimationTransitionDefaults(t.transition[e]||{});else r.transition=m.supplyAnimationTransitionDefaults(t.transition||{});return r},m.supplyAnimationFrameDefaults=function(t){var e={};function r(r,n){return s.coerce(t||{},e,d.frame,r,n)}return r("duration"),r("redraw"),e},m.supplyAnimationTransitionDefaults=function(t){var e={};function r(r,n){return s.coerce(t||{},e,d.transition,r,n)}return r("duration"),r("easing"),e},m.supplyFrameDefaults=function(t){var e={};function r(r,n){return s.coerce(t,e,p,r,n)}return r("group"),r("name"),r("traces"),r("baseframe"),r("data"),r("layout"),e},m.supplyTraceDefaults=function(t,e,r,n,a){var o,l=n.colorway||c.defaults,u=l[r%l.length];function f(r,n){return s.coerce(t,e,m.attributes,r,n)}var d=f("visible");f("type"),f("name",n._traceWord+" "+a),f("uirevision",n.uirevision);var p=m.getModule(e);if(e._module=p,p){var h=p.basePlotModule,g=h.attr,v=h.attributes;if(g&&v){var y=n._subplots,x="";if(d||"gl2d"!==h.name){if(Array.isArray(g))for(o=0;o<g.length;o++){var b=g[o],_=s.coerce(t,e,v,b);y[b]&&s.pushUnique(y[b],_),x+=_}else x=s.coerce(t,e,v,g);y[h.name]&&s.pushUnique(y[h.name],x)}}}return d&&(f("customdata"),f("ids"),f("meta"),i.traceIs(e,"showLegend")?(s.coerce(t,e,p.attributes.showlegend?p.attributes:m.attributes,"showlegend"),f("legendgroup"),e._dfltShowLegend=!0):e._dfltShowLegend=!1,p&&p.supplyDefaults(t,e,u,n),i.traceIs(e,"noOpacity")||f("opacity"),i.traceIs(e,"notLegendIsolatable")&&(e.visible=!!e.visible),i.traceIs(e,"noHover")||(e.hovertemplate||s.coerceHoverinfo(t,e,n),"parcats"!==e.type&&i.getComponentMethod("fx","supplyDefaults")(t,e,u,n)),p&&p.selectPoints&&f("selectedpoints"),m.supplyTransformDefaults(t,e,n)),e},m.hasMakesDataTransform=T,m.supplyTransformDefaults=function(t,e,r){if(e._length||T(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),l=e.transforms=[],c=0;c<o.length;c++){var u,f=o[c],d=f.type,p=y[d],h=!(f._module&&f._module===p),g=p&&"function"==typeof p.transform;p||s.warn("Unrecognized transform type "+d+"."),p&&p.supplyDefaults&&(h||g)?((u=p.supplyDefaults(f,e,r,t)).type=d,u._module=p,s.pushUnique(a,p)):u=s.extendFlat({},f),l.push(u)}}},m.supplyLayoutGlobalDefaults=function(t,e,r){function n(r,n){return s.coerce(t,e,m.layoutAttributes,r,n)}var a=t.template;s.isPlainObject(a)&&(e.template=a,e._template=a.layout,e._dataTemplate=a.data);var o=s.coerceFont(n,"font");n("title.text",e._dfltTitle.plot),s.coerceFont(n,"title.font",{family:o.family,size:Math.round(1.4*o.size),color:o.color}),n("title.xref"),n("title.yref"),n("title.x"),n("title.y"),n("title.xanchor"),n("title.yanchor"),n("title.pad.t"),n("title.pad.r"),n("title.pad.b"),n("title.pad.l"),n("uniformtext.mode")&&n("uniformtext.minsize"),n("autosize",!(t.width&&t.height)),n("width"),n("height"),n("margin.l"),n("margin.r"),n("margin.t"),n("margin.b"),n("margin.pad"),n("margin.autoexpand"),t.width&&t.height&&m.sanitizeMargins(e),i.getComponentMethod("grid","sizeDefaults")(t,e),n("paper_bgcolor"),n("separators",r.decimal+r.thousands),n("hidesources"),n("colorway"),n("datarevision");var l=n("uirevision");n("editrevision",l),n("selectionrevision",l),n("modebar.orientation"),n("modebar.bgcolor",c.addOpacity(e.paper_bgcolor,.5));var u=c.contrast(c.rgb(e.modebar.bgcolor));n("modebar.color",c.addOpacity(u,.3)),n("modebar.activecolor",c.addOpacity(u,.7)),n("modebar.uirevision",l),n("meta"),s.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)},m.plotAutoSize=function(t,e,r){var n,i,o=t._context||{},l=o.frameMargins,c=s.isPlotDiv(t);if(c&&t.emit("plotly_autosize"),o.fillFrame)n=window.innerWidth,i=window.innerHeight,document.body.style.overflow="hidden";else{var u=c?window.getComputedStyle(t):{};if(n=parseFloat(u.width)||parseFloat(u.maxWidth)||r.width,i=parseFloat(u.height)||parseFloat(u.maxHeight)||r.height,a(l)&&l>0){var f=1-2*l;n=Math.round(f*n),i=Math.round(f*i)}}var d=m.layoutAttributes.width.min,p=m.layoutAttributes.height.min;n<d&&(n=d),i<p&&(i=p);var h=!e.width&&Math.abs(r.width-n)>1,g=!e.height&&Math.abs(r.height-i)>1;(g||h)&&(h&&(r.width=n),g&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),m.sanitizeMargins(r)},m.supplyLayoutModuleDefaults=function(t,e,r,n){var a,o,l,c=i.componentsRegistry,u=e._basePlotModules,f=i.subplotsRegistry.cartesian;for(a in c)(l=c[a]).includeBasePlot&&l.includeBasePlot(t,e);for(var d in u.length||u.push(f),e._has("cartesian")&&(i.getComponentMethod("grid","contentDefaults")(t,e),f.finalizeSubplots(t,e)),e._subplots)e._subplots[d].sort(s.subplotSort);for(o=0;o<u.length;o++)(l=u[o]).supplyLayoutDefaults&&l.supplyLayoutDefaults(t,e,r);var p=e._modules;for(o=0;o<p.length;o++)(l=p[o]).supplyLayoutDefaults&&l.supplyLayoutDefaults(t,e,r);var h=e._transformModules;for(o=0;o<h.length;o++)(l=h[o]).supplyLayoutDefaults&&l.supplyLayoutDefaults(t,e,r,n);for(a in c)(l=c[a]).supplyLayoutDefaults&&l.supplyLayoutDefaults(t,e,r)},m.purge=function(t){var e=t._fullLayout||{};void 0!==e._glcontainer&&(e._glcontainer.selectAll(".gl-canvas").remove(),e._glcontainer.remove(),e._glcanvas=null),e._modeBar&&e._modeBar.destroy(),t._transitionData&&(t._transitionData._interruptCallbacks&&(t._transitionData._interruptCallbacks.length=0),t._transitionData._animationRaf&&window.cancelAnimationFrame(t._transitionData._animationRaf)),s.clearThrottle(),s.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()},m.style=function(t){var e,r=t._fullLayout._visibleModules,n=[];for(e=0;e<r.length;e++){var a=r[e];a.style&&s.pushUnique(n,a.style)}for(e=0;e<n.length;e++)n[e](t)},m.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))}},m.clearAutoMarginIds=function(t){t._fullLayout._pushmarginIds={}},m.allowAutoMargin=function(t,e){t._fullLayout._pushmarginIds[e]=1},m.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 l=n.margin;o=Math.min(12,l.l,l.r,l.t,l.b)}r.l+r.r>.5*n.width&&(s.log("Margin push",e,"is too big in x, dropping"),r.l=r.r=0),r.b+r.t>.5*n.height&&(s.log("Margin push",e,"is too big in y, dropping"),r.b=r.t=0);var c=void 0!==r.xl?r.xl:r.x,u=void 0!==r.xr?r.xr:r.x,f=void 0!==r.yt?r.yt:r.y,d=void 0!==r.yb?r.yb:r.y;a[e]={l:{val:c,size:r.l+o},r:{val:u,size:r.r+o},b:{val:d,size:r.b+o},t:{val:f,size:r.t+o}},i[e]=1}else delete a[e],delete i[e];if(!n._replotting)return m.doAutoMargin(t)}},m.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),A(e);var r=e._size,n=e.margin,o=s.extendFlat({},r),l=n.l,c=n.r,u=n.t,f=n.b,d=e.width,p=e.height,h=e._pushmargin,g=e._pushmarginIds;if(!1!==e.margin.autoexpand){for(var v in h)g[v]||delete h[v];for(var y in h.base={l:{val:0,size:l},r:{val:1,size:c},t:{val:1,size:u},b:{val:0,size:f}},h){var x=h[y].l||{},b=h[y].b||{},_=x.val,w=x.size,k=b.val,T=b.size;for(var M in h){if(a(w)&&h[M].r){var L=h[M].r.val,S=h[M].r.size;if(L>_){var C=(w*L+(S-d)*_)/(L-_),O=(S*(1-_)+(w-d)*(1-L))/(L-_);C>=0&&O>=0&&d-(C+O)>0&&C+O>l+c&&(l=C,c=O)}}if(a(T)&&h[M].t){var P=h[M].t.val,D=h[M].t.size;if(P>k){var z=(T*P+(D-p)*k)/(P-k),R=(D*(1-k)+(T-p)*(1-P))/(P-k);z>=0&&R>=0&&p-(R+z)>0&&z+R>f+u&&(f=z,u=R)}}}}}if(r.l=Math.round(l),r.r=Math.round(c),r.t=Math.round(u),r.b=Math.round(f),r.p=Math.round(n.pad),r.w=Math.round(d)-r.l-r.r,r.h=Math.round(p)-r.t-r.b,!e._replotting&&m.didMarginChange(o,r)){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var E=3*(1+Object.keys(g).length);if(e._redrawFromAutoMarginCount<E)return i.call("plot",t);s.warn("Too many auto-margin redraws.")}};var L=["l","r","t","b","p","w","h"];function S(t,e,r){var n=!1;var a=[m.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,m.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,l=0;function s(){return o++,function(){var e;l++,n||l!==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(s),setTimeout(s())})}],o=s.syncOrAsync(a,t);return o&&o.then||(o=Promise.resolve()),o.then(function(){return t})}m.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},m.graphJson=function(t,e,r,n,a){(a&&e&&!t._fullData||a&&!e&&!t._fullLayout)&&m.supplyDefaults(t);var i=a?t._fullData:t.data,o=a?t._fullLayout:t.layout,l=(t._transitionData||{})._frames;function c(t){if("function"==typeof t)return null;if(s.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&&!s.isPlainObject(t.stream))continue}else if("keepall"!==r&&"string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0)continue;a[e]=c(t[e])}return a}return Array.isArray(t)?t.map(c):s.isTypedArray(t)?s.simpleMap(t,s.identity):s.isJSDate(t)?s.ms2DateTimeLocal(+t):t}var u={data:(i||[]).map(function(t){var r=c(t);return e&&delete r.fit,r})};return e||(u.layout=c(o)),t.framework&&t.framework.isPolar&&(u=t.framework.getConfig()),l&&(u.frames=c(l)),"object"===n?u:JSON.stringify(u)},m.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 l=(i[n.index]||{}).name,s=a.name;i[n.index]=o[s]=a,s!==l&&(delete o[l],o[s]=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()},m.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 l=o[e.toString()];if(!l)return!1;for(var s=[l],c=[l.name];l.baseframe&&(l=o[l.baseframe.toString()])&&-1===c.indexOf(l.name);)s.push(l),c.push(l.name);for(var u={};l=s.pop();)if(l.layout&&(u.layout=m.extendLayout(u.layout,l.layout)),l.data){if(u.data||(u.data=[]),!(n=l.traces))for(n=[],r=0;r<l.data.length;r++)n[r]=r;for(u.traces||(u.traces=[]),r=0;r<l.data.length;r++)null!=(a=n[r])&&(-1===(i=u.traces.indexOf(a))&&(i=u.data.length,u.traces[i]=a),u.data[i]=m.extendTrace(u.data[i],l.data[r]))}return u},m.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)}},m.extendObjectWithContainers=function(t,e,r){var n,a,i,o,l,c,u,f=s.extendDeepNoArrays({},e||{}),d=s.expandObjectPaths(f),p={};if(r&&r.length)for(i=0;i<r.length;i++)void 0===(a=(n=s.nestedProperty(d,r[i])).get())?s.nestedProperty(p,r[i]).set(null):(n.set(null),s.nestedProperty(p,r[i]).set(a));if(t=s.extendDeepNoArrays(t||{},d),r&&r.length)for(i=0;i<r.length;i++)if(c=s.nestedProperty(p,r[i]).get()){for(u=(l=s.nestedProperty(t,r[i])).get(),Array.isArray(u)||(u=[],l.set(u)),o=0;o<c.length;o++){var h=c[o];u[o]=null===h?null:m.extendObjectWithContainers(u[o],h)}l.set(u)}return t},m.dataArrayContainers=["transforms","dimensions"],m.layoutArrayContainers=i.layoutArrayContainers,m.extendTrace=function(t,e){return m.extendObjectWithContainers(t,e,m.dataArrayContainers)},m.extendLayout=function(t,e){return m.extendObjectWithContainers(t,e,m.layoutArrayContainers)},m.transition=function(t,e,r,n,a,i){var o={redraw:a.redraw},l={},c=[];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 u=i[o],f=t._fullData[u]._module;if(f){if(f.animatable){var d=f.basePlotModule.name;l[d]||(l[d]=[]),l[d].push(u)}t.data[i[o]]=m.extendTrace(t.data[i[o]],e[o])}}var p=s.expandObjectPaths(s.extendDeepNoArrays({},r)),h=/^[xy]axis[0-9]*$/;for(var g in p)h.test(g)&&delete p[g].range;m.extendLayout(t.layout,p),delete t.calcdata,m.supplyDefaults(t),m.doCalcdata(t);var v=s.expandObjectPaths(r);if(v){var y=t._fullLayout._plots;for(var x in y){var b=y[x],_=b.xaxis,w=b.yaxis,k=_.range.slice(),T=w.range.slice(),M=null,A=null,L=null,S=null;Array.isArray(v[_._name+".range"])?M=v[_._name+".range"].slice():Array.isArray((v[_._name]||{}).range)&&(M=v[_._name].range.slice()),Array.isArray(v[w._name+".range"])?A=v[w._name+".range"].slice():Array.isArray((v[w._name]||{}).range)&&(A=v[w._name].range.slice()),k&&M&&(_.r2l(k[0])!==_.r2l(M[0])||_.r2l(k[1])!==_.r2l(M[1]))&&(L={xr0:k,xr1:M}),T&&A&&(w.r2l(T[0])!==w.r2l(A[0])||w.r2l(T[1])!==w.r2l(A[1]))&&(S={yr0:T,yr1:A}),(L||S)&&c.push(s.extendFlat({plotinfo:b},L,S))}}return Promise.resolve()},o.runFn=function(e){var n,a,o=t._fullLayout._basePlotModules,u=c.length;if(r)for(a=0;a<o.length;a++)o[a].transitionAxes&&o[a].transitionAxes(t,c,i,e);for(var f in u?((n=s.extendFlat({},i)).duration=0,delete l.cartesian):n=i,l){var d=l[f];t._fullData[d[0]]._module.basePlotModule.plot(t,d,n,e)}},S(t,i,o)},m.transitionFromReact=function(t,e,r,n){var a=t._fullLayout,i=a.transition,o={},l=[];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 c=t[i],u=c.xaxis,f=c.yaxis,d=n[u._name].range.slice(),p=n[f._name].range.slice(),h=u.range.slice(),g=f.range.slice();u.setScale(),f.setScale();var v=null,m=null;u.r2l(d[0])===u.r2l(h[0])&&u.r2l(d[1])===u.r2l(h[1])||(v={xr0:d,xr1:h}),f.r2l(p[0])===f.r2l(g[0])&&f.r2l(p[1])===f.r2l(g[1])||(m={yr0:p,yr1:g}),(v||m)&&l.push(s.extendFlat({plotinfo:c},v,m))}return Promise.resolve()},o.runFn=function(r){for(var n,a,o,c=t._fullData,u=t._fullLayout._basePlotModules,f=[],d=0;d<c.length;d++)f.push(d);function p(){for(var e=0;e<u.length;e++)u[e].transitionAxes&&u[e].transitionAxes(t,l,n,r)}function h(){for(var e=0;e<u.length;e++)u[e].plot(t,o,a,r)}l.length&&e.anim?"traces first"===i.ordering?(n=s.extendFlat({},i,{duration:0}),o=f,a=i,setTimeout(p,i.duration),h()):(n=i,o=null,a=s.extendFlat({},i,{duration:0}),setTimeout(h,n.duration),p()):l.length?(n=i,p()):e.anim&&(o=f,a=i,h())},S(t,i,o)},m.doCalcdata=function(t,e){var r,n,a,l,c=f.list(t),d=t._fullData,p=t._fullLayout,h=new Array(d.length),g=(t.calcdata||[]).slice();for(t.calcdata=h,p._numBoxes=0,p._numViolins=0,p._violinScaleGroupStats={},t._hmpixcount=0,t._hmlumcount=0,p._piecolormap={},p._sunburstcolormap={},p._treemapcolormap={},p._funnelareacolormap={},a=0;a<d.length;a++)Array.isArray(e)&&-1===e.indexOf(a)&&(h[a]=g[a]);for(a=0;a<d.length;a++)(r=d[a])._arrayAttrs=o.findArrayAttributes(r),r._extremes={};var v=p._subplots.polar||[];for(a=0;a<v.length;a++)c.push(p[v[a]].radialaxis,p[v[a]].angularaxis);for(var m in p._colorAxes){var x=p[m];!1!==x.cauto&&(delete x.cmin,delete x.cmax)}var b=!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(l=0;l<r.transforms.length;l++){var i=r.transforms[l];(n=y[i.type])&&n.calcTransform&&(r._hasCalcTransform=!0,b=!0,n.calcTransform(t,r,i))}}}function w(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(l=o.length-1;l>=0;l--)if(o[l].enabled){r._indexToPoints=o[l]._indexToPoints;break}n&&n.calc&&(i=n.calc(t,r))}Array.isArray(i)&&i[0]||(i=[{x:u,y:u}]),i[0].t||(i[0].t={}),i[0].trace=r,h[e]=i}}for(O(c,d,p),a=0;a<d.length;a++)w(a,!0);for(a=0;a<d.length;a++)_(a);for(b&&O(c,d,p),a=0;a<d.length;a++)w(a,!0);for(a=0;a<d.length;a++)w(a,!1);P(t);var k=function(t,e){var r,n,a,o,l,c=[];function u(t,r,n){var a=r._id.charAt(0);if("histogram2dcontour"===t){var i=r._counterAxes[0],o=f.getFromId(e,i),l="x"===a||"x"===i&&"category"===o.type,s="y"===a||"y"===i&&"category"===o.type;return function(t,e){return 0===t||0===e?-1:l&&t===n[e].length-1?-1:s&&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 s.aggNums(Math.min,null,t)},max:function(t){return s.aggNums(Math.max,null,t)},sum:function(t){return s.aggNums(function(t,e){return t+e},null,t)},total:function(t){return s.aggNums(function(t,e){return t+e},null,t)},mean:function(t){return s.mean(t)},median:function(t){return s.median(t)}};for(r=0;r<t.length;r++){var p=t[r];if("category"===p.type){var h=p.categoryorder.match(C);if(h){var g=h[1],v=h[2],m=[];for(n=0;n<p._categories.length;n++)m.push([p._categories[n],[]]);for(n=0;n<p._traceIndices.length;n++){var y=p._traceIndices[n],x=e._fullData[y],b=p._id.charAt(0);if(!0===x.visible){var _=x.type;i.traceIs(x,"histogram")&&(delete x._xautoBinFinished,delete x._yautoBinFinished);var w=e.calcdata[y];for(a=0;a<w.length;a++){var k,T,M,A=w[a];if("splom"===_){var L=x._axesDim[p._id];if("y"===b){var S=x._diag[L][0];S&&(p=e._fullLayout[f.id2name(S)])}var O=A.trace.dimensions[L].values;for(o=0;o<O.length;o++)for(k=O[o],T=p._categoriesMap[k],l=0;l<A.trace.dimensions.length;l++)if(l!==L){var P=A.trace.dimensions[l];m[T][1].push(P.values[o])}}else if("scattergl"===_){for(o=0;o<A.t.x.length;o++)"x"===b&&(k=A.t.x[o],T=k,M=A.t.y[o]),"y"===b&&(k=A.t.y[o],T=k,M=A.t.x[o]),m[T][1].push(M);A.t&&A.t._scene&&delete A.t._scene.dirty}else if(A.hasOwnProperty("z")){M=A.z;var D=u(x.type,p,M);for(o=0;o<M.length;o++)for(l=0;l<M[o].length;l++)(T=D(l,o))+1&&m[T][1].push(M[o][l])}else for("x"===b?(k=A.p+1?A.p:A.x,M=A.s||A.v||A.y):"y"===b&&(k=A.p+1?A.p:A.y,M=A.s||A.v||A.x),Array.isArray(M)||(M=[M]),o=0;o<M.length;o++)m[k][1].push(M[o])}}}p._categoriesValue=m;var z=[];for(n=0;n<m.length;n++)z.push([m[n][0],d[g](m[n][1])]);z.sort(function(t,e){return t[1]-e[1]}),p._categoriesAggregatedValue=z,p._initialCategories=z.map(function(t){return t[0]}),"descending"===v&&p._initialCategories.reverse(),c=c.concat(p.sortByInitialCategories())}}}return c}(c,t);if(k.length){for(p._numBoxes=0,p._numViolins=0,a=0;a<k.length;a++)w(k[a],!0);for(a=0;a<k.length;a++)w(k[a],!1);P(t)}i.getComponentMethod("fx","calc")(t),i.getComponentMethod("errorbars","calc")(t)};var C=/(total|sum|min|max|mean|median) (ascending|descending)/;function O(t,e,r){var n,a,i,o={};for(n=0;n<t.length;n++)i=(a=t[n])._id,a.clearCalc(),"multicategory"===a.type&&a.setupMultiCategory(e),o[a._id]=1;var l=r._axisMatchGroups||[];for(n=0;n<l.length;n++)for(i in l[n])o[i]||(a=r[f.id2name(i)]).clearCalc()}function P(t){var e,r,n,a=t._fullLayout,i=a._visibleModules,o={};for(r=0;r<i.length;r++){var l=i[r],c=l.crossTraceCalc;if(c){var u=l.basePlotModule.name;o[u]?s.pushUnique(o[u],c):o[u]=[c]}}for(n in o){var f=o[n],d=a._subplots[n];if(Array.isArray(d))for(e=0;e<d.length;e++){var p=d[e],h="cartesian"===n?a._plots[p]:a[p];for(r=0;r<f.length;r++)f[r](t,h,p)}else for(r=0;r<f.length;r++)f[r](t)}}m.rehover=function(t){t._fullLayout._rehover&&t._fullLayout._rehover()},m.redrag=function(t){t._fullLayout._redrag&&t._fullLayout._redrag()},m.generalUpdatePerTraceModule=function(t,e,r,n){var a,i=e.traceHash,o={};for(a=0;a<r.length;a++){var l=r[a],c=l[0].trace;c.visible&&(o[c.type]=o[c.type]||[],o[c.type].push(l))}for(var u in i)if(!o[u]){var f=i[u][0];f[0].trace.visible=!1,o[u]=[f]}for(var d in o){var p=o[d];p[0][0].trace._module.plot(t,e,s.filterVisible(p),n)}e.traceHash=o},m.plotBasePlot=function(t,e,r,n,a){var o=i.getModule(t),l=h(e.calcdata,o)[0];o.plot(e,l,n,a)},m.cleanBasePlot=function(t,e,r,n,a){var i=a._has&&a._has(t),o=r._has&&r._has(t);i&&!o&&a["_"+t+"layer"].selectAll("g.trace").remove()}},{"../components/color":42,"../constants/numerical":139,"../lib":159,"../plot_api/plot_schema":192,"../plot_api/plot_template":193,"../plots/get_data":231,"../registry":243,"./animation_attributes":198,"./attributes":200,"./cartesian/axis_ids":206,"./command":227,"./font_attributes":229,"./frame_attributes":230,"./layout_attributes":233,d3:7,"fast-isnumeric":9}],236:[function(t,e,r){"use strict";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":154,"../../../traces/scatter/attributes":283}],237:[function(t,e,r){"use strict";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(" "),l=a({},n.domain,{});function s(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:s(0,{range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},domain:l,orientation:{valType:"number"}}),angularaxis:s(0,{range:{valType:"info_array",items:[{valType:"number",dflt:0},{valType:"number",dflt:360}]},domain:l}),layout:{direction:{valType:"enumerated",values:["clockwise","counterclockwise"]},orientation:{valType:"angle"}}},"plot","nested")},{"../../../lib/extend":154,"../../../plot_api/edit_types":186,"../../cartesian/layout_attributes":215}],238:[function(t,e,r){"use strict";(e.exports=t("./micropolar")).manager=t("./micropolar_manager")},{"./micropolar":239,"./micropolar_manager":240}],239:[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,l,s={data:[],layout:{}},c={},u={},f=n.dispatch("hover"),d={};return d.render=function(c){return function(c){e=c||e;var f=s.data,d=s.layout;("string"==typeof e||e.nodeName)&&(e=n.select(e)),e.datum(f).each(function(e,s){var c=e.slice();u={data:o.util.cloneJson(c),layout:o.util.cloneJson(d)};var f=0;c.forEach(function(t,e){t.color||(t.color=d.defaultColorRange[f],f=(f+1)%d.defaultColorRange.length),t.strokeColor||(t.strokeColor="LinePlot"===t.geometry?t.color:n.rgb(t.color).darker().toString()),u.data[e].color=t.color,u.data[e].strokeColor=t.strokeColor,u.data[e].strokeDash=t.strokeDash,u.data[e].strokeSize=t.strokeSize});var p=c.filter(function(t,e){var r=t.visible;return"undefined"==typeof r||!0===r}),h=!1,g=p.map(function(t,e){return h=h||"undefined"!=typeof t.groupId,t});if(h){var v=n.nest().key(function(t,e){return"undefined"!=typeof t.groupId?t.groupId:"unstacked"}).entries(g),m=[],y=v.map(function(t,e){if("unstacked"===t.key)return t.values;var r=t.values[0].r.map(function(t,e){return 0});return t.values.forEach(function(t,e,n){t.yStack=[r],m.push(r),r=o.util.sumArrays(t.r,r)}),t.values});p=n.merge(y)}p.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 x=Math.min(d.width-d.margin.left-d.margin.right,d.height-d.margin.top-d.margin.bottom)/2;x=Math.max(10,x);var b,_=[d.margin.left+x,d.margin.top+x];b=h?[0,n.max(o.util.sumArrays(o.util.arrayLast(p).r[0],o.util.arrayLast(m)))]:n.extent(o.util.flattenArray(p.map(function(t,e){return t.r}))),d.radialAxis.domain!=o.DATAEXTENT&&(b[0]=0),r=n.scale.linear().domain(d.radialAxis.domain!=o.DATAEXTENT&&d.radialAxis.domain?d.radialAxis.domain:b).range([0,x]),u.layout.radialAxis.domain=r.domain();var w,k=o.util.flattenArray(p.map(function(t,e){return t.t})),T="string"==typeof k[0];T&&(k=o.util.deduplicate(k),w=k.slice(),k=n.range(k.length),p=p.map(function(t,e){var r=t;return t.t=[k],h&&(r.yStack=t.yStack),r}));var M=p.filter(function(t,e){return"LinePlot"===t.geometry||"DotPlot"===t.geometry}).length===p.length,A=null===d.needsEndSpacing?T||!M:d.needsEndSpacing,L=d.angularAxis.domain&&d.angularAxis.domain!=o.DATAEXTENT&&!T&&d.angularAxis.domain[0]>=0?d.angularAxis.domain:n.extent(k),S=Math.abs(k[1]-k[0]);M&&!T&&(S=0);var C=L.slice();A&&T&&(C[1]+=S);var O=d.angularAxis.ticksCount||4;O>8&&(O=O/(O/8)+O%8),d.angularAxis.ticksStep&&(O=(C[1]-C[0])/O);var P=d.angularAxis.ticksStep||(C[1]-C[0])/(O*(d.minorTicks+1));w&&(P=Math.max(Math.round(P),1)),C[2]||(C[2]=P);var D=n.range.apply(this,C);if(D=D.map(function(t,e){return parseFloat(t.toPrecision(12))}),l=n.scale.linear().domain(C.slice(0,2)).range("clockwise"===d.direction?[0,360]:[360,0]),u.layout.angularAxis.domain=l.domain(),u.layout.angularAxis.endPadding=A?S:0,"undefined"==typeof(t=n.select(this).select("svg.chart-root"))||t.empty()){var z=(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"),R=this.appendChild(this.ownerDocument.importNode(z.documentElement,!0));t=n.select(R)}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 E,I=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){E=t.select(".legend-group").attr({transform:"translate("+[x,d.margin.top]+")"}).style({display:"block"});var j=p.map(function(t,e){var r=o.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend="undefined"==typeof t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});o.Legend().config({data:p.map(function(t,e){return t.name||"Element"+e}),legendConfig:a({},o.Legend.defaultConfig().legendConfig,{container:E,elements:j,reverseOrder:d.legend.reverseOrder})})();var B=E.node().getBBox();x=Math.min(d.width-B.width-d.margin.left-d.margin.right,d.height-d.margin.top-d.margin.bottom)/2,x=Math.max(10,x),_=[d.margin.left+x,d.margin.top+x],r.range([0,x]),u.layout.radialAxis.domain=r.domain(),E.attr("transform","translate("+[_[0]+x,_[1]-x]+")")}else E=t.select(".legend-group").style({display:"none"});t.attr({width:d.width,height:d.height}).style({opacity:d.opacity}),I.attr("transform","translate("+_+")").style({cursor:"crosshair"});var H=[(d.width-(d.margin.left+d.margin.right+2*x+(B?B.width:0)))/2,(d.height-(d.margin.top+d.margin.bottom+2*x))/2];if(H[0]=Math.max(0,H[0]),H[1]=Math.max(0,H[1]),t.select(".outer-group").attr("transform","translate("+H+")"),d.title&&d.title.text){var V=t.select("g.title-group text").style(N).text(d.title.text),q=V.node().getBBox();V.attr({x:_[0]-q.width/2,y:_[1]-x-20})}var U=t.select(".radial.axis-group");if(d.radialAxis.gridLinesVisible){var G=U.selectAll("circle.grid-circle").data(r.ticks(5));G.enter().append("circle").attr({class:"grid-circle"}).style(F),G.attr("r",r),G.exit().remove()}U.select("circle.outside-circle").attr({r:x}).style(F);var Z=t.select("circle.background-circle").attr({r:x}).style({fill:d.backgroundColor,stroke:d.stroke});function X(t,e){return l(t)%360+d.orientation}if(d.radialAxis.visible){var Y=n.svg.axis().scale(r).ticks(5).tickSize(5);U.call(Y).attr({transform:"rotate("+d.radialAxis.orientation+")"}),U.selectAll(".domain").style(F),U.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"]]+")"}}),U.selectAll("g>line").style({stroke:"black"})}var W=t.select(".angular.axis-group").selectAll("g.angular-tick").data(D),$=W.enter().append("g").classed("angular-tick",!0);W.attr({transform:function(t,e){return"rotate("+X(t)+")"}}).style({display:d.angularAxis.visible?"block":"none"}),W.exit().remove(),$.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),$.selectAll(".minor").style({stroke:d.minorTickColor}),W.select("line.grid-line").attr({x1:d.tickLength?x-d.tickLength:0,x2:x}).style({display:d.angularAxis.gridLinesVisible?"block":"none"}),$.append("text").classed("axis-text",!0).style(N);var Q=W.select("text.axis-text").attr({x:x+d.labelOffset,dy:i+"em",transform:function(t,e){var r=X(t),n=x+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&&Q.text(function(t,e){return e%(d.minorTicks+1)!=0?"":d.angularAxis.rewriteTicks(this.textContent,e)});var J=n.max(I.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));E.attr({transform:"translate("+[x+J,d.margin.top]+")"});var K=t.select("g.geometry-group").selectAll("g").size()>0,tt=t.select("g.geometry-group").selectAll("g.geometry").data(p);if(tt.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),tt.exit().remove(),p[0]||K){var et=[];p.forEach(function(t,e){var n={};n.radialScale=r,n.angularScale=l,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"undefined"!=typeof t.data.groupId||"unstacked"}).entries(et),nt=[];rt.forEach(function(t,e){"unstacked"===t.key?nt=nt.concat(t.values.map(function(t,e){return[t]})):nt.push(t.values)}),nt.forEach(function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map(function(t,e){return a(o[r].defaultConfig(),t)});o[r]().config(n)()})}var at,it,ot=t.select(".guides-group"),lt=t.select(".tooltips-group"),st=o.tooltipPanel().config({container:lt,fontSize:8})(),ct=o.tooltipPanel().config({container:lt,fontSize:8})(),ut=o.tooltipPanel().config({container:lt,hasTick:!0})();if(!T){var ft=ot.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});I.on("mousemove.angular-guide",function(t,e){var r=o.util.getMousePos(Z).angle;ft.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-d.orientation)%360;at=l.invert(n);var a=o.util.convertToCartesian(x+12,r+180);st.text(o.util.round(at)).move([a[0]+_[0],a[1]+_[1]])}).on("mouseout.angular-guide",function(t,e){ot.select("line").style({opacity:0})})}var dt=ot.select("circle").style({stroke:"grey",fill:"none"});I.on("mousemove.radial-guide",function(t,e){var n=o.util.getMousePos(Z).radius;dt.attr({r:n}).style({opacity:.5}),it=r.invert(o.util.getMousePos(Z).radius);var a=o.util.convertToCartesian(n,d.radialAxis.orientation);ct.text(o.util.round(it)).move([a[0]+_[0],a[1]+_[1]])}).on("mouseout.radial-guide",function(t,e){dt.style({opacity:0}),ut.hide(),st.hide(),ct.hide()}),t.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(e,r){var a=n.select(this),i=this.style.fill,l="black",s=this.style.opacity||1;if(a.attr({"data-opacity":s}),i&&"none"!==i){a.attr({"data-fill":i}),l=n.hsl(i).darker().toString(),a.style({fill:l,opacity:1});var c={t:o.util.round(e[0]),r:o.util.round(e[1])};T&&(c.t=w[e[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),d=t.node().getBoundingClientRect(),p=[f.left+f.width/2-H[0]-d.left,f.top+f.height/2-H[1]-d.top];ut.config({color:l}).text(u),ut.move(p)}else i=this.style.stroke||"black",a.attr({"data-stroke":i}),l=n.hsl(i).darker().toString(),a.style({stroke:l,opacity:1})}).on("mousemove.tooltip",function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ut.show()}).on("mouseout.tooltip",function(t,e){ut.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")})})})}(c),this},d.config=function(t){if(!arguments.length)return s;var e=o.util.cloneJson(t);return e.data.forEach(function(t,e){s.data[e]||(s.data[e]={}),a(s.data[e],o.Axis.defaultConfig().data[0]),a(s.data[e],t)}),a(s.layout,o.Axis.defaultConfig().layout),a(s.layout,e.layout),this},d.getLiveConfig=function(){return u},d.getinputConfig=function(){return c},d.radialScale=function(t){return r},d.angularScale=function(t){return l},d.svg=function(){return t},n.rebind(d,f,"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 l={t:i,r:o};return r&&(l.name=r),l},o.util.ensureArray=function(t,e){if("undefined"==typeof t)return null;var r=[].concat(t);return n.range(e).map(function(t,e){return r[e]||r[0]})},o.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=o.util.ensureArray(t[e],r)}),t},o.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},o.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},o.util.sumArrays=function(t,e){return n.zip(t,e).map(function(t,e){return n.sum(t)})},o.util.arrayLast=function(t){return t[t.length-1]},o.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},o.util.flattenArray=function(t){for(var e=[];!o.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},o.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},o.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},o.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},o.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],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("undefined"!=typeof t)return t[e]},t);"undefined"!=typeof i&&(e.reduce(function(t,r,n){if("undefined"!=typeof t)return n===e.length-1&&delete t[r],t[r]},t),r.reduce(function(t,e,n){return"undefined"==typeof t[e]&&(t[e]={}),n===r.length-1&&(t[e]=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])}),l=e.angularScale,s=e.radialScale.domain()[0],c={bar:function(r,a,i){var o=t[i].data,s=e.radialScale(r[1])-e.radialScale(0),c=e.radialScale(r[2]||0),u=o.barWidth;n.select(this).attr({class:"mark bar",d:"M"+[[s+c,-u/2],[s+c,u/2],[c,u/2],[c,-u/2]].join("L")+"Z",transform:function(t,r){return"rotate("+(e.orientation+l(t[0]))+")"}})}};c.dot=function(r,a,i){var o=r[2]?[r[0],r[1]+r[2]]:r,l=n.svg.symbol().size(t[i].data.dotSize).type(t[i].data.dotType)(r,a);n.select(this).attr({class:"mark dot",d:l,transform:function(t,r){var n,a,i,l=(n=function(t,r){var n=e.radialScale(t[1]),a=(e.angularScale(t[0])+e.orientation)*Math.PI/180;return{r:n,t:a}}(o),a=n.r*Math.cos(n.t),i=n.r*Math.sin(n.t),{x:a,y:i});return"translate("+[l.x,l.y]+")"}})};var u=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});c.line=function(r,a,i){var l=r[2]?o[i].map(function(t,e){return[t[0],t[1]+t[2]]}):o[i];if(n.select(this).each(c.dot).style({opacity:function(e,r){return+t[i].data.dotVisible},fill:h.stroke(r,a,i)}).attr({class:"mark dot"}),!(a>0)){var s=n.select(this.parentNode).selectAll("path.line").data([0]);s.enter().insert("path"),s.attr({class:"line",d:u(l),transform:function(t,r){return"rotate("+(e.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return h.fill(r,a,i)},"fill-opacity":0,stroke:function(t,e){return h.stroke(r,a,i)},"stroke-width":function(t,e){return h["stroke-width"](r,a,i)},"stroke-dasharray":function(t,e){return h["stroke-dasharray"](r,a,i)},opacity:function(t,e){return h.opacity(r,a,i)},display:function(t,e){return h.display(r,a,i)}})}};var f=e.angularScale.range(),d=Math.abs(f[1]-f[0])/o[0].length*Math.PI/180,p=n.svg.arc().startAngle(function(t){return-d/2}).endAngle(function(t){return d/2}).innerRadius(function(t){return e.radialScale(s+(t[2]||0))}).outerRadius(function(t){return e.radialScale(s+(t[2]||0))+e.radialScale(t[1])});c.arc=function(t,r,a){n.select(this).attr({class:"mark arc",d:p,transform:function(t,r){return"rotate("+(e.orientation+l(t[0])+90)+")"}})};var h={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"undefined"==typeof t[n].data.visible||t[n].data.visible?"block":"none"}},g=n.select(this).selectAll("g.layer").data(o);g.enter().append("g").attr({class:"layer"});var v=g.selectAll("path.mark").data(function(t,e){return t});v.enter().append("path").attr({class:"mark"}),v.style(h).each(c[e.geometryType]),v.exit().remove(),g.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||"undefined"==typeof e.elements[r].visibleInLegend)}),e.reverseOrder&&(o=o.reverse());var l=e.container;("string"==typeof l||l.nodeName)&&(l=n.select(l));var s=o.map(function(t,e){return t.color}),c=e.fontSize,u=null==e.isContinuous?"number"==typeof o[0]:e.isContinuous,f=u?e.height:c*o.length,d=l.classed("legend-group",!0).selectAll("svg").data([0]),p=d.enter().append("svg").attr({width:300,height:f+c,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});p.append("g").classed("legend-axis",!0),p.append("g").classed("legend-marks",!0);var h=n.range(o.length),g=n.scale[u?"linear":"ordinal"]().domain(h).range(s),v=n.scale[u?"linear":"ordinal"]().domain(h)[u?"range":"rangePoints"]([0,f]);if(u){var m=d.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(s);m.enter().append("stop"),m.attr({offset:function(t,e){return e/(s.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 y=d.select(".legend-marks").selectAll("path.legend-mark").data(o);y.enter().append("path").classed("legend-mark",!0),y.attr({transform:function(t,e){return"translate("+[c/2,v(e)+c/2]+")"},d:function(t,e){var r,a,i,o=t.symbol;return i=3*(a=c),"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 g(e)}}),y.exit().remove()}var x=n.svg.axis().scale(v).orient("right"),b=d.select("g.legend-axis").attr({transform:"translate("+[u?e.colorBandWidth:c,c/2]+")"}).call(x);return b.selectAll(".domain").style({fill:"none",stroke:"none"}),b.selectAll("line").style({fill:"none",stroke:u?e.textColor:"none"}),b.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},l="tooltip-"+o.tooltipPanel.uid++,s=10,c=function(){var n=(t=i.container.selectAll("g."+l).data([0])).enter().append("g").classed(l,!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+s,dy:.3*+i.fontSize}),c};return c.text=function(a){var o=n.hsl(i.color).l,l=o>=.5?"#aaa":"white",u=o>=.5?"black":"white",f=a||"";e.style({fill:u,"font-size":i.fontSize+"px"}).text(f);var d=i.padding,p=e.node().getBBox(),h={fill:i.color,stroke:l,"stroke-width":"2px"},g=p.width+2*d+s,v=p.height+2*d;return r.attr({d:"M"+[[s,-v/2],[s,-v/4],[i.hasTick?0:s,0],[s,v/4],[s,v/2],[g,v/2],[g,-v/2]].join("L")+"Z"}).style(h),t.attr({transform:"translate("+[s,-v/2+2*d]+")"}),t.style({display:"block"}),c},c.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),c},c.hide=function(){if(t)return t.style({display:"none"}),c},c.show=function(){if(t)return t.style({display:"block"}),c},c.config=function(t){return a(i,t),c},c},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 l=a({},t.layout);if([[l,["plot_bgcolor"],["backgroundColor"]],[l,["showlegend"],["showLegend"]],[l,["radialaxis"],["radialAxis"]],[l,["angularaxis"],["angularAxis"]],[l.angularaxis,["showline"],["gridLinesVisible"]],[l.angularaxis,["showticklabels"],["labelsVisible"]],[l.angularaxis,["nticks"],["ticksCount"]],[l.angularaxis,["tickorientation"],["tickOrientation"]],[l.angularaxis,["ticksuffix"],["ticksSuffix"]],[l.angularaxis,["range"],["domain"]],[l.angularaxis,["endpadding"],["endPadding"]],[l.radialaxis,["showline"],["gridLinesVisible"]],[l.radialaxis,["tickorientation"],["tickOrientation"]],[l.radialaxis,["ticksuffix"],["ticksSuffix"]],[l.radialaxis,["range"],["domain"]],[l.angularAxis,["showline"],["gridLinesVisible"]],[l.angularAxis,["showticklabels"],["labelsVisible"]],[l.angularAxis,["nticks"],["ticksCount"]],[l.angularAxis,["tickorientation"],["tickOrientation"]],[l.angularAxis,["ticksuffix"],["ticksSuffix"]],[l.angularAxis,["range"],["domain"]],[l.angularAxis,["endpadding"],["endPadding"]],[l.radialAxis,["showline"],["gridLinesVisible"]],[l.radialAxis,["tickorientation"],["tickOrientation"]],[l.radialAxis,["ticksuffix"],["ticksSuffix"]],[l.radialAxis,["range"],["domain"]],[l.font,["outlinecolor"],["outlineColor"]],[l.legend,["traceorder"],["reverseOrder"]],[l,["labeloffset"],["labelOffset"]],[l,["defaultcolorrange"],["defaultColorRange"]]].forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e?("undefined"!=typeof l.tickLength&&(l.angularaxis.ticklen=l.tickLength,delete l.tickLength),l.tickColor&&(l.angularaxis.tickcolor=l.tickColor,delete l.tickColor)):(l.angularAxis&&"undefined"!=typeof l.angularAxis.ticklen&&(l.tickLength=l.angularAxis.ticklen),l.angularAxis&&"undefined"!=typeof l.angularAxis.tickcolor&&(l.tickColor=l.angularAxis.tickcolor)),l.legend&&"boolean"!=typeof l.legend.reverseOrder&&(l.legend.reverseOrder="normal"!=l.legend.reverseOrder),l.legend&&"boolean"==typeof l.legend.traceorder&&(l.legend.traceorder=l.legend.traceorder?"reversed":"normal",delete l.legend.reverseOrder),l.margin&&"undefined"!=typeof l.margin.t){var s=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};n.entries(l.margin).forEach(function(t,e){u[c[s.indexOf(t.key)]]=t.value}),l.margin=u}e&&(delete l.needsEndSpacing,delete l.minorTickColor,delete l.minorTicks,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksStep,delete l.angularaxis.rewriteTicks,delete l.angularaxis.nticks,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksStep,delete l.radialaxis.rewriteTicks,delete l.radialaxis.nticks),r.layout=l}return r}};return t}},{"../../../constants/alignment":136,"../../../lib":159,d3:7}],240:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../../lib"),i=t("../../../components/color"),o=t("./micropolar"),l=t("./undo_manager"),s=a.extendDeepAll,c=e.exports={};c.framework=function(t){var e,r,a,i,u,f=new l;function d(r,l){return l&&(u=l),n.select(n.select(u).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),e=e?s(e,r):r,a||(a=o.Axis()),i=o.adapter.plotly().convert(e),a.config(i).render(u),t.data=e.data,t.layout=e.layout,c.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,f.add({undo:function(){n&&a(n)},redo:function(){a(t)}}),r=o.util.cloneJson(i)},d.undo=function(){f.undo()},d.redo=function(){f.redo()},d},c.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=s(o,t.layout)}},{"../../../components/color":42,"../../../lib":159,"./micropolar":239,"./undo_manager":241,d3:7}],241:[function(t,e,r){"use strict";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?this:(e.splice(r+1,e.length-r),e.push(t),r=e.length-1,this)},setCallback:function(e){t=e},undo:function(){var n=e[r];return n?(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}}}},{}],242:[function(t,e,r){"use strict";['Variables are inserted using %{variable}, for example "y: %{y}".','Numbers are formatted using d3-format\'s syntax %{variable:d3-format}, for example "Price: %{y:$.2f}".',t("../constants/docs").FORMAT_LINK,"for details on the formatting syntax.",'Dates are formatted using d3-time-format\'s syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}".',t("../constants/docs").DATE_FORMAT_LINK,"for details on the date formatting syntax."].join(" ");function n(t){var e=t.description?" "+t.description:"",r=t.keys||[];if(r.length>0){for(var n=[],a=0;a<r.length;a++)n[a]="`"+r[a]+"`";e+="Finally, the template string has access to ",e=1===r.length?"variable "+n[0]:"variables "+n.slice(0,-1).join(", ")+" and "+n.slice(-1)+"."}return e}r.hovertemplateAttrs=function(t,e){t=t||{};n(e=e||{});var r={valType:"string",dflt:"",editType:t.editType||"none"};return!1!==t.arrayOk&&(r.arrayOk=!0),r},r.texttemplateAttrs=function(t,e){t=t||{};n(e=e||{});var r={valType:"string",dflt:"",editType:t.editType||"calc"};return!1!==t.arrayOk&&(r.arrayOk=!0),r}},{"../constants/docs":137}],243:[function(t,e,r){"use strict";var n=t("./lib/loggers"),a=t("./lib/noop"),i=t("./lib/push_unique"),o=t("./lib/is_plain_object"),l=t("./lib/dom").addStyleRule,s=t("./lib/extend"),c=t("./plots/attributes"),u=t("./plots/layout_attributes"),f=s.extendFlat,d=s.extendDeepAll;function p(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])return void n.log("Plot type "+e+" already registered.");for(var a in m(t),r.subplotsRegistry[e]=t,r.componentsRegistry)b(a,t.name)}(t.basePlotModule);for(var o={},s=0;s<a.length;s++)o[a[s]]=!0,r.allCategories[a[s]]=!0;for(var c in r.modules[e]={_module:t,categories:o},i&&Object.keys(i).length&&(r.modules[e].meta=i),r.allTypes.push(e),r.componentsRegistry)y(c,e);t.layoutAttributes&&f(r.traceLayoutAttributes,t.layoutAttributes);var u=t.basePlotModule,d=u.name;if("mapbox"===d){var p=u.constants.styleRules;for(var h in p)l(".js-plotly-plot .plotly .mapboxgl-"+h,p[h])}"geo"!==d&&"mapbox"!==d||void 0===typeof window||void 0!==window.PlotlyGeoAssets||(window.PlotlyGeoAssets={topojson:{}})}}function h(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),m(t)),r.modules)y(e,n);for(var a in r.subplotsRegistry)b(e,a);for(var o in r.transformsRegistry)x(e,o);t.schema&&t.schema.layout&&d(u,t.schema.layout)}function g(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 l 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)x(l,t.name)}function v(t){var e=t.name,n=e.split("-")[0],a=t.dictionary,i=t.format,o=a&&Object.keys(a).length,l=i&&Object.keys(i).length,s=r.localeRegistry,c=s[e];if(c||(s[e]=c={}),n!==e){var u=s[n];u||(s[n]=u={}),o&&u.dictionary===c.dictionary&&(u.dictionary=a),l&&u.format===c.format&&(u.format=i)}o&&(c.dictionary=a),l&&(c.format=i)}function m(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 y(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 x(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 b(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 l=n.subplots[o];i&&l&&d(i,l)}}function _(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":p(n);break;case"transform":g(n);break;case"component":h(n);break;case"locale":v(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[_(t)];return!!e&&e._module},r.traceIs=function(t,e){if("various"===(t=_(t)))return!1;var a=r.modules[t];return a||(t&&"area"!==t&&n.log("Unrecognized trace type "+t+"."),a=r.modules[c.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":152,"./lib/extend":154,"./lib/is_plain_object":160,"./lib/loggers":163,"./lib/noop":168,"./lib/push_unique":172,"./plots/attributes":200,"./plots/layout_attributes":233}],244:[function(t,e,r){"use strict";var n=t("../registry"),a=t("../lib"),i=a.extendFlat,o=a.extendDeep;function l(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,s=t.data,c=t.layout,u=o([],s),f=o({},c,l(e.tileClass)),d=t._context||{};if(e.width&&(f.width=e.width),e.height&&(f.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){f.annotations=[];var p=Object.keys(f);for(r=0;r<p.length;r++)a=p[r],["xaxis","yaxis","zaxis"].indexOf(a.slice(0,5))>-1&&(f[p[r]].title={text:""});for(r=0;r<u.length;r++){var h=u[r];h.showscale=!1,h.marker&&(h.marker.showscale=!1),n.traceIs(h,"pie-like")&&(h.textposition="none")}}if(Array.isArray(e.annotations))for(r=0;r<e.annotations.length;r++)f.annotations.push(e.annotations[r]);var g=Object.keys(f).filter(function(t){return t.match(/^scene\d*$/)});if(g.length){var v={};for("thumbnail"===e.tileClass&&(v={title:{text:""},showaxeslabels:!1,showticklabels:!1,linetickenable:!1}),r=0;r<g.length;r++){var m=f[g[r]];m.xaxis||(m.xaxis={}),m.yaxis||(m.yaxis={}),m.zaxis||(m.zaxis={}),i(m.xaxis,v),i(m.yaxis,v),i(m.zaxis,v),m._scene=null}}var y=document.createElement("div");e.tileClass&&(y.className=e.tileClass);var x={gd:y,td:y,layout:f,data:u,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&&(x.config.setBackground=e.setBackground||"opaque"),x.gd.defaultLayout=l(e.tileClass),x}},{"../lib":159,"../registry":243}],245:[function(t,e,r){"use strict";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(l,s){r&&r._snapshotInProgress&&s(new Error("Snapshotting already in progress.")),n.isIE()&&"svg"!==e.format&&s(new Error(o.MSG_IE_BAD_FORMAT)),r&&(r._snapshotInProgress=!0);var c=a(t,e),u=e.filename||t.fn||"newplot";u+="."+e.format,c.then(function(t){return r&&(r._snapshotInProgress=!1),i(t,u,e.format)}).then(function(t){l(t)}).catch(function(t){r&&(r._snapshotInProgress=!1),s(t)})})}},{"../lib":159,"../plot_api/to_image":196,"./filesaver":246,"./helpers":247}],246:[function(t,e,r){"use strict";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(l,s){var c,u;if(n.isIE9orBelow()&&s(new Error("IE < 10 unsupported")),n.isSafari()){var f="svg"===r?",":";base64,";return a.octetStream(f+encodeURIComponent(t)),l(e)}return n.isIE()?(c=a.createBlob(t,"svg"),window.navigator.msSaveBlob(c,e),c=null,l(e)):o?(c=a.createBlob(t,r),u=a.createObjectURL(c),i.href=u,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),a.revokeObjectURL(u),c=null,l(e)):void s(new Error("download error"))})}},{"../lib":159,"./helpers":247}],247:[function(t,e,r){"use strict";var n=t("../registry");r.getDelay=function(t){return t._has&&(t._has("gl3d")||t._has("gl2d")||t._has("mapbox"))?500:0},r.getRedrawFunc=function(t){return function(){var e=t._fullLayout||{};!(e._has&&e._has("polar"))&&t.data&&t.data[0]&&t.data[0].r||n.getComponentMethod("colorbar","draw")(t)}},r.encodeSVG=function(t){return"data:image/svg+xml,"+encodeURIComponent(t)};var 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":243}],248:[function(t,e,r){"use strict";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":244,"./download":245,"./helpers":247,"./svgtoimg":249,"./toimage":250,"./tosvg":251}],249:[function(t,e,r){"use strict";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 l=window.Image,s=t.svg,c=t.format||"png";if(n.isIE()&&"svg"!==c){var u=new Error(i.MSG_IE_BAD_FORMAT);return o(u),t.promise?r:e.emit("error",u)}var f,d,p=t.canvas,h=t.scale||1,g=t.width||300,v=t.height||150,m=h*g,y=h*v,x=p.getContext("2d"),b=new l;"svg"===c||n.isIE9orBelow()||n.isSafari()?d=i.encodeSVG(s):(f=i.createBlob(s,"svg"),d=i.createObjectURL(f)),p.width=m,p.height=y,b.onload=function(){var r;switch(f=null,i.revokeObjectURL(d),"svg"!==c&&x.drawImage(b,0,0,m,y),c){case"jpeg":r=p.toDataURL("image/jpeg");break;case"png":r=p.toDataURL("image/png");break;case"webp":r=p.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)},b.onerror=function(r){if(f=null,i.revokeObjectURL(d),o(r),!t.promise)return e.emit("error",r)},b.src=d});return t.promise?r:e}},{"../lib":159,"./helpers":247,events:6}],250:[function(t,e,r){"use strict";var n=t("events").EventEmitter,a=t("../registry"),i=t("../lib"),o=t("./helpers"),l=t("./cloneplot"),s=t("./tosvg"),c=t("./svgtoimg");e.exports=function(t,e){var r=new n,u=l(t,{format:"png"}),f=u.gd;f.style.position="absolute",f.style.left="-5000px",document.body.appendChild(f);var d=o.getRedrawFunc(f);return a.call("plot",f,u.data,u.layout,u.config).then(d).then(function(){var t=o.getDelay(f._fullLayout);setTimeout(function(){var t=s(f),n=document.createElement("canvas");n.id=i.randstr(),(r=c({format:e.format,width:f._fullLayout.width,height:f._fullLayout.height,canvas:n,emitter:r,svg:t})).clean=function(){f&&document.body.removeChild(f)}},t)}).catch(function(t){r.emit("error",t)}),r}},{"../lib":159,"../registry":243,"./cloneplot":244,"./helpers":247,"./svgtoimg":249,"./tosvg":251,events:6}],251:[function(t,e,r){"use strict";var n=t("d3"),a=t("../lib"),i=t("../components/drawing"),o=t("../components/color"),l=t("../constants/xmlns_namespaces"),s=/"/g,c=new RegExp('("TOBESTRIPPED)|(TOBESTRIPPED")',"g");e.exports=function(t,e,r){var u,f=t._fullLayout,d=f._paper,p=f._toppaper,h=f.width,g=f.height;d.insert("rect",":first-child").call(i.setRect,0,0,h,g).call(o.fill,f.paper_bgcolor);var v=f._basePlotModules||[];for(u=0;u<v.length;u++){var m=v[u];m.toSVG&&m.toSVG(t)}if(p){var y=p.node().childNodes,x=Array.prototype.slice.call(y);for(u=0;u<x.length;u++){var b=x[u];b.childNodes.length&&d.node().appendChild(b)}}if(f._draggers&&f._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(s,"TOBESTRIPPED"))}else t.remove()}),f._gradientUrlQueryParts){var _=[];for(var w in f._gradientUrlQueryParts)_.push(w);_.length&&d.selectAll(_.join(",")).each(function(){var t=n.select(this),e=this.style.fill;e&&-1!==e.indexOf("url(")&&t.style("fill",e.replace(s,"TOBESTRIPPED"));var r=this.style.stroke;r&&-1!==r.indexOf("url(")&&t.style("stroke",r.replace(s,"TOBESTRIPPED"))})}"pdf"!==e&&"eps"!==e||d.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width",0),d.node().setAttributeNS(l.xmlns,"xmlns",l.svg),d.node().setAttributeNS(l.xmlns,"xmlns:xlink",l.xlink),"svg"===e&&r&&(d.attr("width",r*h),d.attr("height",r*g),d.attr("viewBox","0 0 "+h+" "+g));var k=(new window.XMLSerializer).serializeToString(d.node());return k=function(t){var e=n.select("body").append("div").style({display:"none"}).html(""),r=t.replace(/(&[^;]*;)/gi,function(t){return"<"===t?"<":"&rt;"===t?">":-1!==t.indexOf("<")||-1!==t.indexOf(">")?"":e.html(t).text()});return e.remove(),r}(k),k=(k=k.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),a.isIE()&&(k=(k=(k=k.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),k}},{"../components/color":42,"../components/drawing":63,"../constants/xmlns_namespaces":140,"../lib":159,d3:7}],252:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;r<t.length;r++)t[r].i=r;n.mergeArray(e.text,t,"tx"),n.mergeArray(e.hovertext,t,"htx");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":159}],253:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),a=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../../plots/template_attributes").texttemplateAttrs,o=t("../../components/colorscale/attributes"),l=t("../../plots/font_attributes"),s=t("./constants"),c=t("../../lib/extend").extendFlat,u=l({editType:"calc",arrayOk:!0,colorEditType:"style"}),f=c({},n.marker.line.width,{dflt:0}),d=c({width:f,editType:"calc"},o("marker.line")),p=c({line:d,editType:"calc"},o("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,texttemplate:i({editType:"plot"},{keys:s.eventDataKeys}),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:c({},u,{}),insidetextfont:c({},u,{}),outsidetextfont:c({},u,{}),constraintext:{valType:"enumerated",values:["inside","outside","both","none"],dflt:"both",editType:"calc"},cliponaxis:c({},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:p,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":49,"../../lib/extend":154,"../../plots/font_attributes":229,"../../plots/template_attributes":242,"../scatter/attributes":283,"./constants":255}],254:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/calc"),o=t("./arrays_to_calcdata"),l=t("../scatter/calc_selection");e.exports=function(t,e){var r,s,c=n.getFromId(t,e.xaxis||"x"),u=n.getFromId(t,e.yaxis||"y");"h"===e.orientation?(r=c.makeCalcdata(e,"x"),s=u.makeCalcdata(e,"y")):(r=u.makeCalcdata(e,"y"),s=c.makeCalcdata(e,"x"));for(var f=Math.min(s.length,r.length),d=new Array(f),p=0;p<f;p++)d[p]={p:s[p],s:r[p]},e.ids&&(d[p].id=String(e.ids[p]));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),l(d,e),d}},{"../../components/colorscale/calc":50,"../../components/colorscale/helpers":53,"../../plots/cartesian/axes":203,"../scatter/calc_selection":285,"./arrays_to_calcdata":252}],255:[function(t,e,r){"use strict";e.exports={TEXTPAD:3,eventDataKeys:["value","label"]}},{}],256:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib").isArrayOrTypedArray,i=t("../../constants/numerical").BADNUM,o=t("../../registry"),l=t("../../plots/cartesian/axes"),s=t("../../plots/cartesian/axis_ids").getAxisGroup,c=t("./sieve.js");function u(t,e,r,o,u){if(o.length){var b,_,w,k;switch(function(t,e){var r,i;for(r=0;r<e.length;r++){var o,l=e[r],s=l[0].trace,c="funnel"===s.type?s._base:s.base,u="h"===s.orientation?s.xcalendar:s.ycalendar,f="category"===t.type||"multicategory"===t.type?function(){return null}:t.d2c;if(a(c)){for(i=0;i<Math.min(c.length,l.length);i++)o=f(c[i],0,u),n(o)?(l[i].b=+o,l[i].hasB=1):l[i].b=0;for(;i<l.length;i++)l[i].b=0}else{o=f(c,0,u);var d=n(o);for(o=d?o:0,i=0;i<l.length;i++)l[i].b=o,d&&(l[i].hasB=1)}}}(r,o),u.mode){case"overlay":f(e,r,o,u);break;case"group":for(b=[],_=[],w=0;w<o.length;w++)void 0===(k=o[w])[0].trace.offset?_.push(k):b.push(k);_.length&&function(t,e,r,n,a){var o=new c(n,{sepNegVal:!1,overlapNoMerge:!a.norm});(function(t,e,r,n){for(var a=t._fullLayout,i=r.positions,o=r.distinctPositions,l=r.minDiff,c=r.traces,u=c.length,f=i.length!==o.length,d=l*(1-n.gap),v=s(a,e._id)+c[0][0].trace.orientation,m=a._alignmentOpts[v]||{},y=0;y<u;y++){var x,b,_=c[y],w=_[0].trace,k=m[w.alignmentgroup]||{},T=Object.keys(k.offsetGroups||{}).length,M=(x=T?d/T:f?d/u:d)*(1-(n.groupgap||0));b=T?((2*w._offsetIndex+1-T)*x-M)/2:f?((2*y+1-u)*x-M)/2:-M/2;var A=_[0].t;A.barwidth=M,A.poffset=b,A.bargroupwidth=d,A.bardelta=l}r.binWidth=c[0][0].t.barwidth/100,p(r),h(e,r),g(e,r,f)})(t,e,o,a),function(t){for(var e=t.traces,r=0;r<e.length;r++){var n=e[r],a=n[0].trace;if(void 0===a.base)for(var o=new c([n],{sepNegVal:!0,overlapNoMerge:!0}),l=0;l<n.length;l++){var s=n[l];if(s.p!==i){var u=o.put(s.p,s.b+s.s);u&&(s.b=u)}}}}(o),a.norm?(m(o),y(r,o,a)):v(r,o)}(t,e,r,_,u),b.length&&f(e,r,b,u);break;case"stack":case"relative":for(b=[],_=[],w=0;w<o.length;w++)void 0===(k=o[w])[0].trace.base?_.push(k):b.push(k);_.length&&function(t,e,r,n,a){var o=new c(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,s,c,u,f=x(t),d=e.traces;for(s=0;s<d.length;s++)if(n=d[s],"funnel"===(a=n[0].trace).type)for(c=0;c<n.length;c++)(u=n[c]).s!==i&&e.put(u.p,-.5*u.s);for(s=0;s<d.length;s++){n=d[s],a=n[0].trace,o="funnel"===a.type;var p=[];for(c=0;c<n.length;c++)if((u=n[c]).s!==i){var h;h=o?u.s:u.s+u.b;var g=e.put(u.p,h),v=g+h;u.b=g,u[f]=v,r.norm||(p.push(v),u.hasB&&p.push(g))}r.norm||(a._extremes[t._id]=l.findExtremes(t,p,{tozero:!0,padded:!0}))}}(r,o,a);for(var s=0;s<n.length;s++)for(var u=n[s],f=0;f<u.length;f++){var p=u[f];if(p.s!==i){var h=p.b+p.s===o.get(p.p,p.s);h&&(p._outmost=!0)}}a.norm&&y(r,o,a)}(0,e,r,_,u),b.length&&f(e,r,b,u)}!function(t,e){var r,a,i,o=x(e),l={},s=1/0,c=-1/0;for(r=0;r<t.length;r++)for(i=t[r],a=0;a<i.length;a++){var u=i[a].p;n(u)&&(s=Math.min(s,u),c=Math.max(c,u))}var f=1e4/(c-s),d=l.round=function(t){return String(Math.round(f*(t-s)))};for(r=0;r<t.length;r++){(i=t[r])[0].t.extents=l;var p=i[0].t.poffset,h=Array.isArray(p);for(a=0;a<i.length;a++){var g=i[a],v=g[o]-g.w/2;if(n(v)){var m=g[o]+g.w/2,y=d(g.p);l[y]?l[y]=[Math.min(v,l[y][0]),Math.max(m,l[y][1])]:l[y]=[v,m]}g.p0=g.p+(h?p[a]:p),g.p1=g.p0+g.w,g.s0=g.b,g.s1=g.s0+g.s}}}(o,e)}}function f(t,e,r,n){for(var a=0;a<r.length;a++){var i=r[a],o=new c([i],{sepNegVal:!1,overlapNoMerge:!n.norm});d(t,o,n),n.norm?(m(o),y(e,o,n)):v(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)),l=-o/2,s=0;s<a.length;s++){var c=a[s][0].t;c.barwidth=o,c.poffset=l,c.bargroupwidth=i,c.bardelta=n}e.binWidth=a[0][0].t.barwidth/100,p(e),h(t,e),g(t,e)}function p(t){var e,r,i=t.traces;for(e=0;e<i.length;e++){var o,l=i[e],s=l[0],c=s.trace,u=s.t,f=c._offset||c.offset,d=u.poffset;if(a(f)){for(o=Array.prototype.slice.call(f,0,l.length),r=0;r<o.length;r++)n(o[r])||(o[r]=d);for(r=o.length;r<l.length;r++)o.push(d);u.poffset=o}else void 0!==f&&(u.poffset=f);var p=c._width||c.width,h=u.barwidth;if(a(p)){var g=Array.prototype.slice.call(p,0,l.length);for(r=0;r<g.length;r++)n(g[r])||(g[r]=h);for(r=g.length;r<l.length;r++)g.push(h);if(u.barwidth=g,void 0===f){for(o=[],r=0;r<l.length;r++)o.push(d+(h-g[r])/2);u.poffset=o}}else void 0!==p&&(u.barwidth=p,void 0===f&&(u.poffset=d+(h-p)/2))}}function h(t,e){for(var r=e.traces,n=x(t),a=0;a<r.length;a++)for(var i=r[a],o=i[0].t,l=o.poffset,s=Array.isArray(l),c=o.barwidth,u=Array.isArray(c),f=0;f<i.length;f++){var d=i[f],p=d.w=u?c[f]:c;d[n]=d.p+(s?l[f]:l)+p/2}}function g(t,e,r){var n=e.traces,a=e.minDiff/2;l.minDtick(t,e.minDiff,e.distinctPositions[0],r);for(var i=0;i<n.length;i++){var o,s,c,u,f=n[i],d=f[0],p=d.trace,h=[];for(u=0;u<f.length;u++)s=(o=f[u]).p-a,c=o.p+a,h.push(s,c);if(p.width||p.offset){var g=d.t,v=g.poffset,m=g.barwidth,y=Array.isArray(v),x=Array.isArray(m);for(u=0;u<f.length;u++){o=f[u];var b=y?v[u]:v,_=x?m[u]:m;c=(s=o.p+b)+_,h.push(s,c)}}p._extremes[t._id]=l.findExtremes(t,h,{padded:!1})}}function v(t,e){for(var r=e.traces,n=x(t),a=0;a<r.length;a++){for(var i=r[a],o=i[0].trace,s=[],c=!0,u=0;u<i.length;u++){var f=i[u],d=f.b,p=d+f.s;f[n]=p,s.push(p),f.hasB&&s.push(d),f.hasB&&f.b>0&&f.s>0||(c=!1)}o._extremes[t._id]=l.findExtremes(t,s,{tozero:!c,padded:!0})}}function m(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 y(t,e,r){var a=e.traces,o=x(t),s="fraction"===r.norm?1:100,c=s/1e9,u=t.l2c(t.c2l(0)),f="stack"===r.mode?s:u;function d(e){return n(t.c2l(e))&&(e<u-c||e>f+c||!n(u))}for(var p=0;p<a.length;p++){for(var h=a[p],g=h[0].trace,v=[],m=!0,y=!1,b=0;b<h.length;b++){var _=h[b];if(_.s!==i){var w=Math.abs(s/e.get(_.p,_.s));_.b*=w,_.s*=w;var k=_.b,T=k+_.s;_[o]=T,v.push(T),y=y||d(T),_.hasB&&(v.push(k),y=y||d(k)),_.hasB&&_.b>0&&_.s>0||(m=!1)}}g._extremes[t._id]=l.findExtremes(t,v,{tozero:!m,padded:y})}}function x(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,l=t.calcdata,s=[],c=[],f=0;f<i.length;f++){var d=i[f];!0===d.visible&&o.traceIs(d,"bar")&&d.xaxis===r._id&&d.yaxis===n._id&&("h"===d.orientation?s.push(l[f]):c.push(l[f]))}var p={mode:a.barmode,norm:a.barnorm,gap:a.bargap,groupgap:a.bargroupgap};u(t,r,n,c,p),u(t,n,r,s,p)},setGroupPositions:u}},{"../../constants/numerical":139,"../../lib":159,"../../plots/cartesian/axes":203,"../../plots/cartesian/axis_ids":206,"../../registry":243,"./sieve.js":266,"fast-isnumeric":9}],257:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../components/color"),i=t("../../registry"),o=t("../scatter/xy_defaults"),l=t("./style_defaults"),s=t("../../plots/cartesian/axis_ids").getAxisGroup,c=t("./attributes"),u=n.coerceFont;function f(t,e,r,n){var a=e.orientation,i=e[{v:"x",h:"y"}[a]+"axis"],o=s(r,i)+a,l=r._alignmentOpts||{},c=n("alignmentgroup"),u=l[o];u||(u=l[o]={});var f=u[c];f?f.traces.push(e):f=u[c]={traces:[e],alignmentIndex:Object.keys(u).length,offsetGroups:{}};var d=n("offsetgroup"),p=f.offsetGroups,h=p[d];d&&(h||(h=p[d]={offsetIndex:Object.keys(p).length}),e._offsetIndex=h.offsetIndex)}function d(t,e,r,a,i,o){var l=!(!1===(o=o||{}).moduleHasSelected),s=!(!1===o.moduleHasUnselected),c=!(!1===o.moduleHasConstrain),f=!(!1===o.moduleHasCliponaxis),d=!(!1===o.moduleHasTextangle),p=!(!1===o.moduleHasInsideanchor),h=!!o.hasPathbar,g=Array.isArray(i)||"auto"===i,v=g||"inside"===i,m=g||"outside"===i;if(v||m){var y=u(a,"textfont",r.font),x=n.extendFlat({},y),b=!(t.textfont&&t.textfont.color);if(b&&delete x.color,u(a,"insidetextfont",x),h){var _=n.extendFlat({},y);b&&delete _.color,u(a,"pathbar.textfont",_)}m&&u(a,"outsidetextfont",y),l&&a("selected.textfont.color"),s&&a("unselected.textfont.color"),c&&a("constraintext"),f&&a("cliponaxis"),d&&a("textangle"),a("texttemplate")}v&&p&&a("insidetextanchor")}e.exports={supplyDefaults:function(t,e,r,s){function u(r,a){return n.coerce(t,e,c,r,a)}if(o(t,e,s,u)){u("orientation",e.x&&!e.y?"h":"v"),u("base"),u("offset"),u("width"),u("text"),u("hovertext"),u("hovertemplate");var f=u("textposition");d(t,0,s,u,f,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),l(t,e,u,r,s);var p=(e.marker.line||{}).color,h=i.getComponentMethod("errorbars","supplyDefaults");h(t,e,p||a.defaultLine,{axis:"y"}),h(t,e,p||a.defaultLine,{axis:"x",inherit:"y"}),n.coerceSelectionMarkerOpacity(e,u)}else e.visible=!1},crossTraceDefaults:function(t,e){var r;function a(t){return n.coerce(r._input,r,c,t)}if("group"===e.barmode)for(var i=0;i<t.length;i++)"bar"===(r=t[i]).type&&(r._input,f(0,r,e,a))},handleGroupingDefaults:f,handleText:d}},{"../../components/color":42,"../../lib":159,"../../plots/cartesian/axis_ids":206,"../../registry":243,"../scatter/xy_defaults":309,"./attributes":253,"./style_defaults":268}],258:[function(t,e,r){"use strict";e.exports=function(t,e,r){return t.x="xVal"in e?e.xVal:e.x,t.y="yVal"in e?e.yVal:e.y,e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),"h"===r.orientation?(t.label=t.y,t.value=t.x):(t.label=t.x,t.value=t.y),t}},{}],259:[function(t,e,r){"use strict";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":159,"fast-isnumeric":9,tinycolor2:25}],260:[function(t,e,r){"use strict";var n=t("../../components/fx"),a=t("../../registry"),i=t("../../components/color"),o=t("../../lib").fillText,l=t("./helpers").getLineWidth,s=t("../../plots/cartesian/axes").hoverLabelText;function c(t,e,r,a){var i,l,c,u,f,d,p,h=t.cd,g=h[0].trace,v=h[0].t,m="closest"===a,y="waterfall"===g.type,x=t.maxHoverDistance,b=t.maxSpikeDistance;function _(t){return t[c]-t.w/2}function w(t){return t[c]+t.w/2}var k=m?_:function(t){return Math.min(_(t),t.p-v.bardelta/2)},T=m?w:function(t){return Math.max(w(t),t.p+v.bardelta/2)};function M(t,e){return n.inbox(t-i,e-i,x+Math.min(1,Math.abs(e-t)/p)-1)}function A(t){return M(k(t),T(t))}function L(t){var e=l,r=t.b,a=t[u];if(y){var i=Math.abs(t.rawS)||0;e>0?a+=i:e<0&&(a-=i)}return n.inbox(r-e,a-e,x+(a-e)/(a-r)-1)}"h"===g.orientation?(i=r,l=e,c="y",u="x",f=L,d=A):(i=e,l=r,c="x",u="y",d=L,f=A);var S=t[c+"a"],C=t[u+"a"];p=Math.abs(S.r2c(S.range[1])-S.r2c(S.range[0]));var O=n.getDistanceFunction(a,f,d,function(t){return(f(t)+d(t))/2});if(n.getClosest(h,O,t),!1!==t.index){m||(k=function(t){return Math.min(_(t),t.p-v.bargroupwidth/2)},T=function(t){return Math.max(w(t),t.p+v.bargroupwidth/2)});var P=h[t.index],D=g.base?P.b+P.s:P.s;t[u+"0"]=t[u+"1"]=C.c2p(P[u],!0),t[u+"LabelVal"]=D;var z=v.extents[v.extents.round(P.p)];return t[c+"0"]=S.c2p(m?k(P):z[0],!0),t[c+"1"]=S.c2p(m?T(P):z[1],!0),t[c+"LabelVal"]=P.p,t.labelLabel=s(S,t[c+"LabelVal"]),t.valueLabel=s(C,t[u+"LabelVal"]),t.spikeDistance=(L(P)+function(t){return M(_(t),w(t))}(P))/2+b-x,t[c+"Spike"]=S.c2p(P.p,!0),o(P,g,t),t.hovertemplate=g.hovertemplate,t}}function u(t,e){var r=e.mcc||t.marker.color,n=e.mlcc||t.marker.line.color,a=l(t,e);return i.opacity(r)?r:i.opacity(n)&&a?n:void 0}e.exports={hoverPoints:function(t,e,r,n){var i=c(t,e,r,n);if(i){var o=i.cd,l=o[0].trace,s=o[i.index];return i.color=u(l,s),a.getComponentMethod("errorbars","hoverInfo")(s,l,i),[i]}},hoverOnBars:c,getTraceColor:u}},{"../../components/color":42,"../../components/fx":80,"../../lib":159,"../../plots/cartesian/axes":203,"../../registry":243,"./helpers":259}],261:[function(t,e,r){"use strict";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,eventData:t("./event_data"),selectPoints:t("./select"),moduleType:"trace",name:"bar",basePlotModule:t("../../plots/cartesian"),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},{"../../plots/cartesian":214,"../scatter/marker_colorbar":301,"./arrays_to_calcdata":252,"./attributes":253,"./calc":254,"./cross_trace_calc":256,"./defaults":257,"./event_data":258,"./hover":260,"./layout_attributes":262,"./layout_defaults":263,"./plot":264,"./select":265,"./style":267}],262:[function(t,e,r){"use strict";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"}}},{}],263:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/cartesian/axes"),i=t("../../lib"),o=t("./layout_attributes");e.exports=function(t,e,r){function l(r,n){return i.coerce(t,e,o,r,n)}for(var s=!1,c=!1,u=!1,f={},d=l("barmode"),p=0;p<r.length;p++){var h=r[p];if(n.traceIs(h,"bar")&&h.visible){if(s=!0,"group"===d){var g=h.xaxis+h.yaxis;f[g]&&(u=!0),f[g]=!0}if(h.visible&&"histogram"===h.type)"category"!==a.getFromId({_fullLayout:e},h["v"===h.orientation?"xaxis":"yaxis"]).type&&(c=!0)}}s?("overlay"!==d&&l("barnorm"),l("bargap",c&&!u?0:.2),l("bargroupgap")):delete e.barmode}},{"../../lib":159,"../../plots/cartesian/axes":203,"../../registry":243,"./layout_attributes":262}],264:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../../lib"),o=t("../../lib/svg_text_utils"),l=t("../../components/color"),s=t("../../components/drawing"),c=t("../../registry"),u=t("../../plots/cartesian/axes").tickText,f=t("./uniform_text"),d=f.recordMinTextSize,p=f.clearMinTextSize,h=t("./style"),g=t("./helpers"),v=t("./constants"),m=t("./attributes"),y=m.text,x=m.textposition,b=t("../../components/fx/helpers").appendArrayPointValue,_=v.TEXTPAD;function w(t){return t.id}function k(t){if(t.ids)return w}function T(t,e){return t<e?1:-1}function M(t,e,r,n){var a;return!e.uniformtext.mode&&A(r)?(n&&(a=n()),t.transition().duration(r.duration).ease(r.easing).each("end",function(){a&&a()}).each("interrupt",function(){a&&a()})):t}function A(t){return t&&t.duration>0}function L(t){return"auto"===t?0:t}function S(t,e){var r=Math.PI/180*e,n=Math.abs(Math.sin(r)),a=Math.abs(Math.cos(r));return{x:t.width*a+t.height*n,y:t.width*n+t.height*a}}function C(t,e,r,n,a,i){var o=!!i.isHorizontal,l=!!i.constrained,s=i.angle||0,c=i.anchor||"end",u="end"===c,f="start"===c,d=((i.leftToRight||0)+1)/2,p=1-d,h=a.width,g=a.height,v=Math.abs(e-t),m=Math.abs(n-r),y=v>2*_&&m>2*_?_:0;v-=2*y,m-=2*y;var x=L(s);"auto"!==s||h<=v&&g<=m||!(h>v||g>m)||(h>m||g>v)&&h<g==v<m||(x+=90);var b=S(a,x),w=1;l&&(w=Math.min(1,v/b.x,m/b.y));var k=a.left*p+a.right*d,M=(a.top+a.bottom)/2,A=(t+_)*p+(e-_)*d,C=(r+n)/2,O=0,P=0;if(f||u){var D=(o?b.x:b.y)/2,z=o?T(t,e):T(r,n);o?f?(A=t+z*y,O=-z*D):(A=e-z*y,O=z*D):f?(C=r+z*y,P=-z*D):(C=n-z*y,P=z*D)}return{textX:k,textY:M,targetX:A,targetY:C,anchorX:O,anchorY:P,scale:w,rotate:x}}e.exports={plot:function(t,e,r,f,v,m){var w=e.xaxis,O=e.yaxis,P=t._fullLayout;v||(v={mode:P.barmode,norm:P.barmode,gap:P.bargap,groupgap:P.bargroupgap},p("bar",P));var D=i.makeTraceGroups(f,r,"trace bars").each(function(r){var c=n.select(this),f=r[0].trace,p="waterfall"===f.type,D="funnel"===f.type,z="bar"===f.type||D,R=0;p&&f.connector.visible&&"between"===f.connector.mode&&(R=f.connector.line.width/2);var E="h"===f.orientation,I=A(v),F=i.ensureSingle(c,"g","points"),N=k(f),j=F.selectAll("g.point").data(i.identity,N);j.enter().append("g").classed("point",!0),j.exit().remove(),j.each(function(c,p){var k,A,D=n.select(this),F=function(t,e,r,n){var a=[],i=[],o=n?e:r,l=n?r:e;return a[0]=o.c2p(t.s0,!0),i[0]=l.c2p(t.p0,!0),a[1]=o.c2p(t.s1,!0),i[1]=l.c2p(t.p1,!0),n?[a,i]:[i,a]}(c,w,O,E),N=F[0][0],j=F[0][1],B=F[1][0],H=F[1][1],V=0==(E?j-N:H-B);if(V&&z&&g.getLineWidth(f,c)&&(V=!1),V||(V=!(a(N)&&a(j)&&a(B)&&a(H))),c.isBlank=V,V&&(E?j=N:H=B),R&&!V&&(E?(N-=T(N,j)*R,j+=T(N,j)*R):(B-=T(B,H)*R,H+=T(B,H)*R)),"waterfall"===f.type){if(!V){var q=f[c.dir].marker;k=q.line.width,A=q.color}}else k=g.getLineWidth(f,c),A=c.mc||f.marker.color;function U(t){var e=n.round(k/2%1,2);return 0===v.gap&&0===v.groupgap?n.round(Math.round(t)-e,2):t}if(!t._context.staticPlot){var G=l.opacity(A)<1||k>.01?U:function(t,e,r){return r&&t===e?t:Math.abs(t-e)>=2?U(t):t>e?Math.ceil(t):Math.floor(t)};N=G(N,j,E),j=G(j,N,E),B=G(B,H,!E),H=G(H,B,!E)}var Z=M(i.ensureSingle(D,"path"),P,v,m);if(Z.style("vector-effect","non-scaling-stroke").attr("d","M"+N+","+B+"V"+H+"H"+j+"V"+B+"Z").call(s.setClipUrl,e.layerClipId,t),!P.uniformtext.mode&&I){var X=s.makePointStyleFns(f);s.singlePointStyle(c,Z,f,X,t)}!function(t,e,r,n,a,l,c,f,p,v,m){var w,k=e.xaxis,A=e.yaxis,O=t._fullLayout;function P(e,r,n){var a=i.ensureSingle(e,"text").text(r).attr({class:"bartext bartext-"+w,"text-anchor":"middle","data-notex":1}).call(s.font,n).call(o.convertToTspans,t);return a}var D=n[0].trace,z="h"===D.orientation,R=function(t,e,r,n,a){var o,l=e[0].trace;return o=l.texttemplate?function(t,e,r,n,a){var o=e[0].trace,l=i.castOption(o,r,"texttemplate");if(!l)return"";var s,c,f,d,p="waterfall"===o.type,h="funnel"===o.type;function g(t){return u(d,+t,!0).text}"h"===o.orientation?(s="y",c=a,f="x",d=n):(s="x",c=n,f="y",d=a);var v,m=e[r],y={};y.label=m.p,y.labelLabel=y[s+"Label"]=(v=m.p,u(c,v,!0).text);var x=i.castOption(o,m.i,"text");(0===x||x)&&(y.text=x),y.value=m.s,y.valueLabel=y[f+"Label"]=g(m.s);var _={};b(_,o,m.i),p&&(y.delta=+m.rawS||m.s,y.deltaLabel=g(y.delta),y.final=m.v,y.finalLabel=g(y.final),y.initial=y.final-y.delta,y.initialLabel=g(y.initial)),h&&(y.value=m.s,y.valueLabel=g(y.value),y.percentInitial=m.begR,y.percentInitialLabel=i.formatPercent(m.begR),y.percentPrevious=m.difR,y.percentPreviousLabel=i.formatPercent(m.difR),y.percentTotal=m.sumR,y.percenTotalLabel=i.formatPercent(m.sumR));var w=i.castOption(o,m.i,"customdata");return w&&(y.customdata=w),i.texttemplateString(l,y,t._d3locale,_,y,o._meta||{})}(t,e,r,n,a):l.textinfo?function(t,e,r,n){var a=t[0].trace,o="h"===a.orientation,l="waterfall"===a.type,s="funnel"===a.type;function c(t){var e=o?r:n;return u(e,+t,!0).text}var f,d,p=a.textinfo,h=t[e],g=p.split("+"),v=[],m=function(t){return-1!==g.indexOf(t)};if(m("label")&&v.push((d=t[e].p,u(o?n:r,d,!0).text)),m("text")&&(0===(f=i.castOption(a,h.i,"text"))||f)&&v.push(f),l){var y=+h.rawS||h.s,x=h.v,b=x-y;m("initial")&&v.push(c(b)),m("delta")&&v.push(c(y)),m("final")&&v.push(c(x))}if(s){m("value")&&v.push(c(h.s));var _=0;m("percent initial")&&_++,m("percent previous")&&_++,m("percent total")&&_++;var w=_>1;m("percent initial")&&(f=i.formatPercent(h.begR),w&&(f+=" of initial"),v.push(f)),m("percent previous")&&(f=i.formatPercent(h.difR),w&&(f+=" of previous"),v.push(f)),m("percent total")&&(f=i.formatPercent(h.sumR),w&&(f+=" of total"),v.push(f))}return v.join("<br>")}(e,r,n,a):g.getValue(l.text,r),g.coerceString(y,o)}(O,n,a,k,A);w=function(t,e){var r=g.getValue(t.textposition,e);return g.coerceEnumerated(x,r)}(D,a);var E="stack"===v.mode||"relative"===v.mode,I=n[a],F=!E||I._outmost;if(R&&"none"!==w&&(!I.isBlank&&l!==c&&f!==p||"auto"!==w&&"inside"!==w)){var N=O.font,j=h.getBarColor(n[a],D),B=h.getInsideTextFont(D,a,N,j),H=h.getOutsideTextFont(D,a,N),V=r.datum();z?"log"===k.type&&V.s0<=0&&(l=k.range[0]<k.range[1]?0:k._length):"log"===A.type&&V.s0<=0&&(f=A.range[0]<A.range[1]?A._length:0);var q,U,G,Z,X,Y=Math.abs(c-l)-2*_,W=Math.abs(p-f)-2*_;if("outside"===w&&(F||I.hasB||(w="inside")),"auto"===w)if(F){w="inside",X=i.ensureUniformFontSize(t,B),q=P(r,R,X),U=s.bBox(q.node()),G=U.width,Z=U.height;var $=G>0&&Z>0,Q=G<=Y&&Z<=W,J=G<=W&&Z<=Y,K=z?Y>=G*(W/Z):W>=Z*(Y/G);$&&(Q||J||K)?w="inside":(w="outside",q.remove(),q=null)}else w="inside";if(!q){X=i.ensureUniformFontSize(t,"outside"===w?H:B);var tt=(q=P(r,R,X)).attr("transform");if(q.attr("transform",""),U=s.bBox(q.node()),G=U.width,Z=U.height,q.attr("transform",tt),G<=0||Z<=0)return void q.remove()}var et,rt,nt=D.textangle;"outside"===w?(rt="both"===D.constraintext||"outside"===D.constraintext,et=function(t,e,r,n,a,i){var o,l=!!i.isHorizontal,s=!!i.constrained,c=i.angle||0,u=a.width,f=a.height,d=Math.abs(e-t),p=Math.abs(n-r);o=l?p>2*_?_:0:d>2*_?_:0;var h=1;s&&(h=l?Math.min(1,p/f):Math.min(1,d/u));var g=L(c),v=S(a,g),m=(l?v.x:v.y)/2,y=(a.left+a.right)/2,x=(a.top+a.bottom)/2,b=(t+e)/2,w=(r+n)/2,k=0,M=0,A=l?T(e,t):T(r,n);return l?(b=e-A*o,k=A*m):(w=n+A*o,M=-A*m),{textX:y,textY:x,targetX:b,targetY:w,anchorX:k,anchorY:M,scale:h,rotate:g}}(l,c,f,p,U,{isHorizontal:z,constrained:rt,angle:nt})):(rt="both"===D.constraintext||"inside"===D.constraintext,et=C(l,c,f,p,U,{isHorizontal:z,constrained:rt,angle:nt,anchor:D.insidetextanchor})),et.fontSize=X.size,d(D.type,et,O),I.transform=et,M(q,O,v,m).attr("transform",i.getTextTransform(et))}else r.select("text").remove()}(t,e,D,r,p,N,j,B,H,v,m),e.layerClipId&&s.hideOutsideRangePoint(c,D.select("text"),w,O,f.xcalendar,f.ycalendar)});var B=!1===f.cliponaxis;s.setClipUrl(c,B?null:e.layerClipId,t)});c.getComponentMethod("errorbars","plot")(t,D,e,v)},toMoveInsideBar:C}},{"../../components/color":42,"../../components/drawing":63,"../../components/fx/helpers":77,"../../lib":159,"../../lib/svg_text_utils":180,"../../plots/cartesian/axes":203,"../../registry":243,"./attributes":253,"./constants":255,"./helpers":259,"./style":267,"./uniform_text":269,d3:7,"fast-isnumeric":9}],265:[function(t,e,r){"use strict";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),l=r.c2p(n?t.p0:t.s0,!0),s=r.c2p(n?t.p1:t.s1,!0);return a?[(i+o)/2,(l+s)/2]:n?[o,(l+s)/2]:[(i+o)/2,s]}e.exports=function(t,e){var r,a=t.cd,i=t.xaxis,o=t.yaxis,l=a[0].trace,s="funnel"===l.type,c="h"===l.orientation,u=[];if(!1===e)for(r=0;r<a.length;r++)a[r].selected=0;else for(r=0;r<a.length;r++){var f=a[r],d="ct"in f?f.ct:n(f,i,o,c,s);e.contains(d,!1,r,t)?(u.push({pointNumber:r,x:i.c2d(f.x),y:o.c2d(f.y)}),f.selected=1):f.selected=0}return u}},{}],266:[function(t,e,r){"use strict";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 l=t[o],s=0;s<l.length;s++){var c=l[s];c.p!==a&&i.push(c.p)}l[0]&&l[0].width1&&(r=Math.min(l[0].width1,r))}this.positions=i;var u=n(i);this.distinctPositions=u.vals,1===u.vals.length&&r!==1/0?this.minDiff=r:this.minDiff=Math.min(u.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":139,"../../lib":159}],267:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/color"),i=t("../../components/drawing"),o=t("../../lib"),l=t("../../registry"),s=t("./uniform_text").resizeText,c=t("./attributes"),u=c.textfont,f=c.insidetextfont,d=c.outsidetextfont,p=t("./helpers");function h(t,e,r){i.pointStyle(t.selectAll("path"),e,r),g(t,e,r)}function g(t,e,r){t.selectAll("text").each(function(t){var a=n.select(this),l=o.ensureUniformFontSize(r,v(a,t,e,r));i.font(a,l)})}function v(t,e,r,n){var a=n._fullLayout.font,i=r.textfont;if(t.classed("bartext-inside")){var o=_(e,r);i=y(r,e.i,a,o)}else t.classed("bartext-outside")&&(i=x(r,e.i,a));return i}function m(t,e,r){return b(u,t.textfont,e,r)}function y(t,e,r,n){var i=m(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}),b(f,t.insidetextfont,e,i)}function x(t,e,r){var n=m(t,e,r);return b(d,t.outsidetextfont,e,n)}function b(t,e,r,n){e=e||{};var a=p.getValue(e.family,r),i=p.getValue(e.size,r),o=p.getValue(e.color,r);return{family:p.coerceString(t.family,a,n.family),size:p.coerceNumber(t.size,i,n.size),color:p.coerceColor(t.color,o,n.color)}}function _(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");s(t,e,"bar");var 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){h(n.select(this),e[0].trace,t)}),l.getComponentMethod("errorbars","style")(e)},styleTextPoints:g,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,l=n.select(this);if(t.selected){a=o.ensureUniformFontSize(r,v(l,t,e,r));var s=e.selected.textfont&&e.selected.textfont.color;s&&(a.color=s),i.font(l,a)}else i.selectedTextStyle(l,e)})}(t.selectAll("text"),e,r)}(r,a,t):(h(r,a,t),l.getComponentMethod("errorbars","style")(r))},getInsideTextFont:y,getOutsideTextFont:x,getBarColor:_,resizeText:s}},{"../../components/color":42,"../../components/drawing":63,"../../lib":159,"../../registry":243,"./attributes":253,"./helpers":259,"./uniform_text":269,d3:7}],268:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,l){r("marker.color",o),a(t,"marker")&&i(t,e,l,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(t,"marker.line")&&i(t,e,l,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":42,"../../components/colorscale/defaults":52,"../../components/colorscale/helpers":53}],269:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib");function i(t){return"_"+t+"Text_minsize"}e.exports={recordMinTextSize:function(t,e,r){if(r.uniformtext.mode){var n=i(t),a=r.uniformtext.minsize,o=e.scale*e.fontSize;e.hide=o<a,r[n]=r[n]||1/0,e.hide||(r[n]=Math.min(r[n],Math.max(o,a)))}},clearMinTextSize:function(t,e){e[i(t)]=void 0},resizeText:function(t,e,r){var i=t._fullLayout,o=i["_"+r+"Text_minsize"];if(o){var l,s="hide"===i.uniformtext.mode;switch(r){case"funnelarea":case"pie":case"sunburst":l="g.slice";break;case"treemap":l="g.slice, g.pathbar";break;default:l="g.points > g.point"}e.selectAll(l).each(function(t){var e=t.transform;e&&(e.scale=s&&e.hide?0:o/e.fontSize,n.select(this).select("text").attr("transform",a.getTextTransform(e)))})}}}},{"../../lib":159,d3:7}],270:[function(t,e,r){"use strict";var n=t("../../plots/attributes"),a=t("../../plots/domain").attributes,i=t("../../plots/font_attributes"),o=t("../../components/color/attributes"),l=t("../../plots/template_attributes").hovertemplateAttrs,s=t("../../plots/template_attributes").texttemplateAttrs,c=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:"plot"},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:c({},n.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:l({},{keys:["label","color","value","percent","text"]}),texttemplate:s({editType:"plot"},{keys:["label","color","value","percent","text"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:c({},u,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:c({},u,{}),outsidetextfont:c({},u,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},title:{text:{valType:"string",dflt:"",editType:"plot"},font:c({},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:c({},u,{}),titleposition:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"calc"}}}},{"../../components/color/attributes":41,"../../lib/extend":154,"../../plots/attributes":200,"../../plots/domain":228,"../../plots/font_attributes":229,"../../plots/template_attributes":242}],271:[function(t,e,r){"use strict";var n=t("../../plots/plots");r.name="pie",r.plot=function(t,e,a,i){n.plotBasePlot(r.name,t,e,a,i)},r.clean=function(t,e,a,i){n.cleanBasePlot(r.name,t,e,a,i)}},{"../../plots/plots":235}],272:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("tinycolor2"),i=t("../../components/color"),o={};function l(t){return function(e,r){return!!e&&(!!(e=a(e)).isValid()&&(e=i.addOpacity(e,e.getAlpha()),t[r]||(t[r]=e),e))}}function s(t,e){var r,n=JSON.stringify(t),i=e[n];if(!i){for(i=t.slice(),r=0;r<t.length;r++)i.push(a(t[r]).lighten(20).toHexString());for(r=0;r<t.length;r++)i.push(a(t[r]).darken(20).toHexString());e[n]=i}return i}e.exports={calc:function(t,e){var r,a,i=[],o=t._fullLayout,s=o.hiddenlabels||[],c=e.labels,u=e.marker.colors||[],f=e.values,d=e._length,p=e._hasValues&&d;if(e.dlabel)for(c=new Array(d),r=0;r<d;r++)c[r]=String(e.label0+r*e.dlabel);var h={},g=l(o["_"+e.type+"colormap"]),v=0,m=!1;for(r=0;r<d;r++){var y,x,b;if(p){if(y=f[r],!n(y))continue;if((y=+y)<0)continue}else y=1;void 0!==(x=c[r])&&""!==x||(x=r);var _=h[x=String(x)];void 0===_?(h[x]=i.length,(b=-1!==s.indexOf(x))||(v+=y),i.push({v:y,label:x,color:g(u[r],x),i:r,pts:[r],hidden:b})):(m=!0,(a=i[_]).v+=y,a.pts.push(r),a.hidden||(v+=y),!1===a.color&&u[r]&&(a.color=g(u[r],x)))}return("funnelarea"===e.type?m:e.sort)&&i.sort(function(t,e){return e.v-t.v}),i[0]&&(i[0].vTotal=v),i},crossTraceCalc:function(t,e){var r=(e||{}).type;r||(r="pie");var n=t._fullLayout,a=t.calcdata,i=n[r+"colorway"],l=n["_"+r+"colormap"];n["extend"+r+"colors"]&&(i=s(i,o));for(var c=0,u=0;u<a.length;u++){var f=a[u];if(f[0].trace.type===r)for(var d=0;d<f.length;d++){var p=f[d];!1===p.color&&(l[p.label]?p.color=l[p.label]:(l[p.label]=p.color=i[c%i.length],c++))}}},makePullColorFn:l,generateExtendedColors:s}},{"../../components/color":42,"fast-isnumeric":9,tinycolor2:25}],273:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("./attributes"),o=t("../../plots/domain").defaults,l=t("../bar/defaults").handleText;function s(t,e){var r=Array.isArray(t),i=a.isArrayOrTypedArray(e),o=Math.min(r?t.length:1/0,i?e.length:1/0);if(isFinite(o)||(o=0),o&&i){for(var l,s=0;s<o;s++){var c=e[s];if(n(c)&&c>0){l=!0;break}}l||(o=0)}return{hasLabels:r,hasValues:i,len:o}}e.exports={handleLabelsAndValues:s,supplyDefaults:function(t,e,r,n){function c(r,n){return a.coerce(t,e,i,r,n)}var u=s(c("labels"),c("values")),f=u.len;if(e._hasLabels=u.hasLabels,e._hasValues=u.hasValues,!e._hasLabels&&e._hasValues&&(c("label0"),c("dlabel")),f){e._length=f,c("marker.line.width")&&c("marker.line.color"),c("marker.colors"),c("scalegroup");var d,p=c("text"),h=c("texttemplate");if(h||(d=c("textinfo",Array.isArray(p)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),h||d&&"none"!==d){var g=c("textposition");l(t,e,n,c,g,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(g)||"auto"===g||"outside"===g)&&c("automargin"),("inside"===g||"auto"===g||Array.isArray(g))&&c("insidetextorientation")}o(e,n,c);var v=c("hole");if(c("title.text")){var m=c("title.position",v?"middle center":"top center");v||"middle center"!==m||(e.title.position="top center"),a.coerceFont(c,"title.font",n.font)}c("sort"),c("direction"),c("rotation"),c("pull")}else e.visible=!1}}},{"../../lib":159,"../../plots/domain":228,"../bar/defaults":257,"./attributes":270,"fast-isnumeric":9}],274:[function(t,e,r){"use strict";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":77}],275:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;r<e.length;r++){var n=t[e[r]];if(n||0===n||""===n)return n}},r.castOption=function(t,e){return Array.isArray(t)?r.getFirstFilled(t,e):t||void 0}},{"../../lib":159}],276:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults").supplyDefaults,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":270,"./base_plot":271,"./calc":272,"./defaults":273,"./layout_attributes":277,"./layout_defaults":278,"./plot":279,"./style":280,"./style_one":281}],277:[function(t,e,r){"use strict";e.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{}],278:[function(t,e,r){"use strict";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":159,"./layout_attributes":277}],279:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plots/plots"),i=t("../../components/fx"),o=t("../../components/color"),l=t("../../components/drawing"),s=t("../../lib"),c=t("../../lib/svg_text_utils"),u=t("../bar/uniform_text"),f=u.recordMinTextSize,d=u.clearMinTextSize,p=t("./helpers"),h=t("./event_data"),g=t("../../lib").isValidTextValue;function v(t,e,r){var a=r[0],o=a.trace,l=a.cx,c=a.cy;"_hasHoverLabel"in o||(o._hasHoverLabel=!1),"_hasHoverEvent"in o||(o._hasHoverEvent=!1),t.on("mouseover",function(t){var r=e._fullLayout,u=e._fullData[o.index];if(!e._dragging&&!1!==r.hovermode){var f=u.hoverinfo;if(Array.isArray(f)&&(f=i.castHoverinfo({hoverinfo:[p.castOption(f,t.pts)],_module:o._module},r,0)),"all"===f&&(f="label+text+value+percent+name"),u.hovertemplate||"none"!==f&&"skip"!==f&&f){var d=t.rInscribed||0,g=l+t.pxmid[0]*(1-d),v=c+t.pxmid[1]*(1-d),m=r.separators,y=[];if(f&&-1!==f.indexOf("label")&&y.push(t.label),t.text=p.castOption(u.hovertext||u.text,t.pts),f&&-1!==f.indexOf("text")){var x=t.text;s.isValidTextValue(x)&&y.push(x)}t.value=t.v,t.valueLabel=p.formatPieValue(t.v,m),f&&-1!==f.indexOf("value")&&y.push(t.valueLabel),t.percent=t.v/a.vTotal,t.percentLabel=p.formatPiePercent(t.percent,m),f&&-1!==f.indexOf("percent")&&y.push(t.percentLabel);var b=u.hoverlabel,_=b.font;i.loneHover({trace:o,x0:g-d*a.r,x1:g+d*a.r,y:v,text:y.join("<br>"),name:u.hovertemplate||-1!==f.indexOf("name")?u.name:void 0,idealAlign:t.pxmid[0]<0?"left":"right",color:p.castOption(b.bgcolor,t.pts)||t.color,borderColor:p.castOption(b.bordercolor,t.pts),fontFamily:p.castOption(_.family,t.pts),fontSize:p.castOption(_.size,t.pts),fontColor:p.castOption(_.color,t.pts),nameLength:p.castOption(b.namelength,t.pts),textAlign:p.castOption(b.align,t.pts),hovertemplate:p.castOption(u.hovertemplate,t.pts),hovertemplateLabels:t,eventData:[h(t,u)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:e}),o._hasHoverLabel=!0}o._hasHoverEvent=!0,e.emit("plotly_hover",{points:[h(t,u)],event:n.event})}}),t.on("mouseout",function(t){var r=e._fullLayout,a=e._fullData[o.index],l=n.select(this).datum();o._hasHoverEvent&&(t.originalEvent=n.event,e.emit("plotly_unhover",{points:[h(l,a)],event:n.event}),o._hasHoverEvent=!1),o._hasHoverLabel&&(i.loneUnhover(r._hoverlayer.node()),o._hasHoverLabel=!1)}),t.on("click",function(t){var r=e._fullLayout,a=e._fullData[o.index];e._dragging||!1===r.hovermode||(e._hoverdata=[h(t,a)],i.click(e,n.event))})}function m(t,e,r){var n=p.castOption(t.insidetextfont.color,e.pts);!n&&t._input.textfont&&(n=p.castOption(t._input.textfont.color,e.pts));var a=p.castOption(t.insidetextfont.family,e.pts)||p.castOption(t.textfont.family,e.pts)||r.family,i=p.castOption(t.insidetextfont.size,e.pts)||p.castOption(t.textfont.size,e.pts)||r.size;return{color:n||o.contrast(e.color),family:a,size:i}}function y(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 o=l.tester.append("text").attr("data-notex",1).text(i).call(l.font,n.title.font).call(c.convertToTspans,e),u=l.bBox(o.node(),!0);r.titleBox={width:u.width,height:u.height},o.remove()}}function x(t,e,r){var n=r.r||e.rpx1,a=e.rInscribed;if(e.startangle===e.stopangle)return{rCenter:1-a,scale:0,rotate:0,textPosAngle:0};var i,o=e.ring,l=1===o&&Math.abs(e.startangle-e.stopangle)===2*Math.PI,s=e.halfangle,c=e.midangle,u=r.trace.insidetextorientation,f="horizontal"===u,d="tangential"===u,p="radial"===u,h="auto"===u,g=[];if(!h){var v,m=function(r,a){if(function(t,e){var r=t.startangle,n=t.stopangle;return r>e&&e>n||r<e&&e<n}(e,r)){var l=Math.abs(r-e.startangle),s=Math.abs(r-e.stopangle),c=l<s?l:s;(i="tan"===a?_(t,n,o,c,0):b(t,n,o,c,Math.PI/2)).textPosAngle=r,g.push(i)}};if(f||d){for(v=4;v>=-4;v-=2)m(Math.PI*v,"tan");for(v=4;v>=-4;v-=2)m(Math.PI*(v+1),"tan")}if(f||p){for(v=4;v>=-4;v-=2)m(Math.PI*(v+1.5),"rad");for(v=4;v>=-4;v-=2)m(Math.PI*(v+.5),"rad")}}if(l||h||f){var y=Math.sqrt(t.width*t.width+t.height*t.height);if((i={scale:a*n*2/y,rCenter:1-a,rotate:0}).textPosAngle=(e.startangle+e.stopangle)/2,i.scale>=1)return i;g.push(i)}(h||p)&&((i=b(t,n,o,s,c)).textPosAngle=(e.startangle+e.stopangle)/2,g.push(i)),(h||d)&&((i=_(t,n,o,s,c)).textPosAngle=(e.startangle+e.stopangle)/2,g.push(i));for(var x=0,w=0,k=0;k<g.length;k++){var T=g[k].scale;if(w<T&&(w=T,x=k),!h&&w>=1)break}return g[x]}function b(t,e,r,n,a){var i=t.width/t.height,o=T(i,n,e,r);return{scale:2*o/t.height,rCenter:w(i,o/e),rotate:k(a)}}function _(t,e,r,n,a){var i=t.height/t.width,o=T(i,n,e,r);return{scale:2*o/t.width,rCenter:w(i,o/e),rotate:k(a+Math.PI/2)}}function w(t,e){return Math.cos(e)-t*e}function k(t){return(180/Math.PI*t+720)%180-90}function T(t,e,r,n){var a=t+1/(2*Math.tan(e));return r*Math.min(1/(Math.sqrt(a*a+.5)+a),n/(Math.sqrt(t*t+n/2)+t))}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 A(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 L(t,e){var r,n,a,i=t.trace,o={x:t.cx,y:t.cy},l={tx:0,ty:0};l.ty+=i.title.font.size,a=C(i),-1!==i.title.position.indexOf("top")?(o.y-=(1+a)*t.r,l.ty-=t.titleBox.height):-1!==i.title.position.indexOf("bottom")&&(o.y+=(1+a)*t.r);var s,c,u=(s=t.r,c=t.trace.aspectratio,s/(void 0===c?1:c)),f=e.w*(i.domain.x[1]-i.domain.x[0])/2;return-1!==i.title.position.indexOf("left")?(f+=u,o.x-=(1+a)*u,l.tx+=t.titleBox.width/2):-1!==i.title.position.indexOf("center")?f*=2:-1!==i.title.position.indexOf("right")&&(f+=u,o.x+=(1+a)*u,l.tx-=t.titleBox.width/2),r=f/t.titleBox.width,n=S(t,e)/t.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:l.tx,ty:l.ty}}function S(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 C(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 O(t,e){for(var r=[],n=0;n<t.length;n++){var a=t[n][0],i=a.trace,o=i.domain,l=e.w*(o.x[1]-o.x[0]),s=e.h*(o.y[1]-o.y[0]);i.title.text&&"middle center"!==i.title.position&&(s-=S(a,e));var c=l/2,u=s/2;"funnelarea"!==i.type||i.scalegroup||(u/=i.aspectratio),a.r=Math.min(c,u)/(1+C(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])-s/2,i.title.text&&-1!==i.title.position.indexOf("bottom")&&(a.cy-=S(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,l=e[i];for(n=0;n<t.length;n++)if(r=t[n][0],(a=r.trace).scalegroup===l){var s;if("pie"===a.type)s=r.r*r.r;else if("funnelarea"===a.type){var c,u;a.aspectratio>1?(c=r.r,u=c/a.aspectratio):(u=r.r,c=u*a.aspectratio),c*=(1+a.baseratio)/2,s=c*u}o=Math.min(o,s/r.vTotal)}for(n=0;n<t.length;n++)if(r=t[n][0],(a=r.trace).scalegroup===l){var f=o*r.vTotal;"funnelarea"===a.type&&(f/=(1+a.baseratio)/2,f/=a.aspectratio),r.r=Math.sqrt(f)}}}(t,r)}function P(t,e){return[t*Math.sin(e),-t*Math.cos(e)]}function D(t,e,r){var n=t._fullLayout,a=r.trace,i=a.texttemplate,o=a.textinfo;if(!i&&o&&"none"!==o){var l,c=o.split("+"),u=function(t){return-1!==c.indexOf(t)},f=u("label"),d=u("text"),h=u("value"),v=u("percent"),m=n.separators;if(l=f?[e.label]:[],d){var y=p.getFirstFilled(a.text,e.pts);g(y)&&l.push(y)}h&&l.push(p.formatPieValue(e.v,m)),v&&l.push(p.formatPiePercent(e.v/r.vTotal,m)),e.text=l.join("<br>")}if(i){var x=s.castOption(a,e.i,"texttemplate");if(x){var b=function(t){return{label:t.label,value:t.v,valueLabel:p.formatPieValue(t.v,n.separators),percent:t.v/r.vTotal,percentLabel:p.formatPiePercent(t.v/r.vTotal,n.separators),color:t.color,text:t.text,customdata:s.castOption(a,t.i,"customdata")}}(e),_=p.getFirstFilled(a.text,e.pts);(g(_)||""===_)&&(b.text=_),e.text=s.texttemplateString(x,b,t._fullLayout._d3locale,b,a._meta||{})}else e.text=""}}function z(t,e){var r=t.rotate,n=t.scale;n>1&&(n=1);var a=r*Math.PI/180,i=Math.cos(a),o=Math.sin(a),l=(e.left+e.right)/2,s=(e.top+e.bottom)/2;t.textX=l*i-s*o,t.textY=l*o+s*i,t.noCenter=!0}e.exports={plot:function(t,e){var r=t._fullLayout,i=r._size;d("pie",r),y(e,t),O(e,i);var u=s.makeTraceGroups(r._pielayer,e,"trace").each(function(e){var u=n.select(this),d=e[0],h=d.trace;!function(t){var e,r,n,a=t[0],i=a.r,o=a.trace,l=o.rotation*Math.PI/180,s=2*Math.PI/a.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(e=0;e<t.length&&t[e].hidden;e++);if(e===t.length)return;l+=s*t[e].v,s*=-1,c="px1",u="px0"}for(n=P(i,l),e=0;e<t.length;e++)(r=t[e]).hidden||(r[c]=n,r.startangle=l,l+=s*r.v/2,r.pxmid=P(i,l),r.midangle=l,l+=s*r.v/2,n=P(i,l),r.stopangle=l,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-o.hole,r.rInscribed=M(r,a))}(e),u.attr("stroke-linejoin","round"),u.each(function(){var g=n.select(this).selectAll("g.slice").data(e);g.enter().append("g").classed("slice",!0),g.exit().remove();var y=[[[],[]],[[],[]]],b=!1;g.each(function(a,i){if(a.hidden)n.select(this).selectAll("path,g").remove();else{a.pointNumber=a.i,a.curveNumber=h.index,y[a.pxmid[1]<0?0:1][a.pxmid[0]<0?0:1].push(a);var o=d.cx,u=d.cy,g=n.select(this),_=g.selectAll("path.surface").data([a]);if(_.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),g.call(v,t,e),h.pull){var w=+p.castOption(h.pull,a.pts)||0;w>0&&(o+=w*a.pxmid[0],u+=w*a.pxmid[1])}a.cxFinal=o,a.cyFinal=u;var k=h.hole;if(a.v===d.vTotal){var T="M"+(o+a.px0[0])+","+(u+a.px0[1])+O(a.px0,a.pxmid,!0,1)+O(a.pxmid,a.px0,!0,1)+"Z";k?_.attr("d","M"+(o+k*a.px0[0])+","+(u+k*a.px0[1])+O(a.px0,a.pxmid,!1,k)+O(a.pxmid,a.px0,!1,k)+"Z"+T):_.attr("d",T)}else{var M=O(a.px0,a.px1,!0,1);if(k){var L=1-k;_.attr("d","M"+(o+k*a.px1[0])+","+(u+k*a.px1[1])+O(a.px1,a.px0,!1,k)+"l"+L*a.px0[0]+","+L*a.px0[1]+M+"Z")}else _.attr("d","M"+o+","+u+"l"+a.px0[0]+","+a.px0[1]+M+"Z")}D(t,a,d);var S=p.castOption(h.textposition,a.pts),C=g.selectAll("g.slicetext").data(a.text&&"none"!==S?[0]:[]);C.enter().append("g").classed("slicetext",!0),C.exit().remove(),C.each(function(){var g=s.ensureSingle(n.select(this),"text","",function(t){t.attr("data-notex",1)}),v=s.ensureUniformFontSize(t,"outside"===S?function(t,e,r){var n=p.castOption(t.outsidetextfont.color,e.pts)||p.castOption(t.textfont.color,e.pts)||r.color,a=p.castOption(t.outsidetextfont.family,e.pts)||p.castOption(t.textfont.family,e.pts)||r.family,i=p.castOption(t.outsidetextfont.size,e.pts)||p.castOption(t.textfont.size,e.pts)||r.size;return{color:n,family:a,size:i}}(h,a,r.font):m(h,a,r.font));g.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(l.font,v).call(c.convertToTspans,t);var y,_=l.bBox(g.node());if("outside"===S)y=A(_,a);else if(y=x(_,a,d),"auto"===S&&y.scale<1){var w=s.ensureUniformFontSize(t,h.outsidetextfont);g.call(l.font,w),y=A(_=l.bBox(g.node()),a)}var k=y.textPosAngle,T=void 0===k?a.pxmid:P(d.r,k);if(y.targetX=o+T[0]*y.rCenter+(y.x||0),y.targetY=u+T[1]*y.rCenter+(y.y||0),z(y,_),y.outside){var M=y.targetY;a.yLabelMin=M-_.height/2,a.yLabelMid=M,a.yLabelMax=M+_.height/2,a.labelExtraX=0,a.labelExtraY=0,b=!0}y.fontSize=v.size,f(h.type,y,r),e[i].transform=y,g.attr("transform",s.getTextTransform(y))})}function O(t,e,r,n){var i=n*(e[0]-t[0]),o=n*(e[1]-t[1]);return"a"+n*d.r+","+n*d.r+" 0 "+a.largeArc+(r?" 1 ":" 0 ")+i+","+o}});var _=n.select(this).selectAll("g.titletext").data(h.title.text?[0]:[]);if(_.enter().append("g").classed("titletext",!0),_.exit().remove(),_.each(function(){var e,r=s.ensureSingle(n.select(this),"text","",function(t){t.attr("data-notex",1)}),a=h.title.text;h._meta&&(a=s.templateString(a,h._meta)),r.text(a).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(l.font,h.title.font).call(c.convertToTspans,t),e="middle center"===h.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}}(d):L(d,i),r.attr("transform","translate("+e.x+","+e.y+")"+(e.scale<1?"scale("+e.scale+")":"")+"translate("+e.tx+","+e.ty+")")}),b&&function(t,e){var r,n,a,i,o,l,s,c,u,f,d,h,g;function v(t,e){return t.pxmid[1]-e.pxmid[1]}function m(t,e){return e.pxmid[1]-t.pxmid[1]}function y(t,r){r||(r={});var a,c,u,d,h,g,v=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),m=n?t.yLabelMin:t.yLabelMax,y=n?t.yLabelMax:t.yLabelMin,x=t.cyFinal+o(t.px0[1],t.px1[1]),b=v-m;if(b*s>0&&(t.labelExtraY=b),Array.isArray(e.pull))for(c=0;c<f.length;c++)(u=f[c])===t||(p.castOption(e.pull,t.pts)||0)>=(p.castOption(e.pull,u.pts)||0)||((t.pxmid[1]-u.pxmid[1])*s>0?(d=u.cyFinal+o(u.px0[1],u.px1[1]),(b=d-m-t.labelExtraY)*s>0&&(t.labelExtraY+=b)):(y+t.labelExtraY-x)*s>0&&(a=3*l*Math.abs(c-f.indexOf(t)),h=u.cxFinal+i(u.px0[0],u.px1[0]),(g=h+a-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*l>0&&(t.labelExtraX+=g)))}for(n=0;n<2;n++)for(a=n?v:m,o=n?Math.max:Math.min,s=n?1:-1,r=0;r<2;r++){for(i=r?Math.max:Math.min,l=r?1:-1,(c=t[n][r]).sort(a),u=t[1-n][r],f=u.concat(c),h=[],d=0;d<c.length;d++)void 0!==c[d].yLabelMid&&h.push(c[d]);for(g=!1,d=0;n&&d<u.length;d++)if(void 0!==u[d].yLabelMid){g=u[d];break}for(d=0;d<h.length;d++){var x=d&&h[d-1];g&&!d&&(x=g),y(h[d],x)}}}(y,h),function(t,e){t.each(function(t){var r=n.select(this);if(t.labelExtraX||t.labelExtraY){var a=r.select("g.slicetext text");t.transform.targetX+=t.labelExtraX,t.transform.targetY+=t.labelExtraY,a.attr("transform",s.getTextTransform(t.transform));var i=t.cxFinal+t.pxmid[0],l=t.cyFinal+t.pxmid[1],c="M"+i+","+l,u=(t.yLabelMax-t.yLabelMin)*(t.pxmid[0]<0?-1:1)/4;if(t.labelExtraX){var f=t.labelExtraX*t.pxmid[1]/t.pxmid[0],d=t.yLabelMid+t.labelExtraY-(t.cyFinal+t.pxmid[1]);Math.abs(f)>Math.abs(d)?c+="l"+d*t.pxmid[0]/t.pxmid[1]+","+d+"H"+(i+t.labelExtraX+u):c+="l"+t.labelExtraX+","+f+"v"+(d-f)+"h"+u}else c+="V"+(t.yLabelMid+t.labelExtraY)+"h"+u;s.ensureSingle(r,"path","textline").call(o.stroke,e.outsidetextfont.color).attr({"stroke-width":Math.min(2,e.outsidetextfont.size/8),d:c,fill:"none"})}else r.select("path.textline").remove()})}(g,h),b&&h.automargin){var w=l.bBox(u.node()),k=h.domain,T=i.w*(k.x[1]-k.x[0]),M=i.h*(k.y[1]-k.y[0]),S=(.5*T-d.r)/i.w,C=(.5*M-d.r)/i.h;a.autoMargin(t,"pie."+h.uid+".automargin",{xl:k.x[0]-S,xr:k.x[1]+S,yb:k.y[0]-C,yt:k.y[1]+C,l:Math.max(d.cx-d.r-w.left,0),r:Math.max(w.right-(d.cx+d.r),0),b:Math.max(w.bottom-(d.cy+d.r),0),t:Math.max(d.cy-d.r-w.top,0),pad:5})}})});setTimeout(function(){u.selectAll("tspan").each(function(){var t=n.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)},formatSliceLabel:D,transformInsideText:x,determineInsideTextFont:m,positionTitleOutside:L,prerenderTitles:y,layoutAreas:O,attachFxHandlers:v,computeTransform:z}},{"../../components/color":42,"../../components/drawing":63,"../../components/fx":80,"../../lib":159,"../../lib/svg_text_utils":180,"../../plots/plots":235,"../bar/uniform_text":269,"./event_data":274,"./helpers":275,d3:7}],280:[function(t,e,r){"use strict";var n=t("d3"),a=t("./style_one"),i=t("../bar/uniform_text").resizeText;e.exports=function(t){var e=t._fullLayout._pielayer.selectAll(".trace");i(t,e,"pie"),e.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)})})}},{"../bar/uniform_text":269,"./style_one":281,d3:7}],281:[function(t,e,r){"use strict";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,l=a(i.width,e.pts)||0;t.style("stroke-width",l).call(n.fill,e.color).call(n.stroke,o)}},{"../../components/color":42,"./helpers":275}],282:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;r<t.length;r++)t[r].i=r;n.mergeArray(e.text,t,"tx"),n.mergeArray(e.texttemplate,t,"txt"),n.mergeArray(e.hovertext,t,"htx"),n.mergeArray(e.customdata,t,"data"),n.mergeArray(e.textposition,t,"tp"),e.textfont&&(n.mergeArrayCastPositive(e.textfont.size,t,"ts"),n.mergeArray(e.textfont.color,t,"tc"),n.mergeArray(e.textfont.family,t,"tf"));var 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":159}],283:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").texttemplateAttrs,a=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../../components/colorscale/attributes"),o=t("../../plots/font_attributes"),l=t("../../components/drawing/attributes").dash,s=t("../../components/drawing"),c=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"},texttemplate:n({},{}),hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"],editType:"calc"},hoveron:{valType:"flaglist",flags:["points","fills"],editType:"style"},hovertemplate:a({},{keys:c.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({},l,{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"},i("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"},i("marker",{anim:!0})),selected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},unselected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0,editType:"calc"},textfont:o({editType:"calc",colorEditType:"style",arrayOk:!0}),r:{valType:"data_array",editType:"calc"},t:{valType:"data_array",editType:"calc"}}},{"../../components/colorscale/attributes":49,"../../components/drawing":63,"../../components/drawing/attributes":62,"../../lib/extend":154,"../../plots/font_attributes":229,"../../plots/template_attributes":242,"./constants":287}],284:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../plots/cartesian/axes"),o=t("../../constants/numerical").BADNUM,l=t("./subtypes"),s=t("./colorscale_calc"),c=t("./arrays_to_calcdata"),u=t("./calc_selection");function f(t,e,r,n,a,o,s){var c=e._length,u=t._fullLayout,f=r._id,d=n._id,p=u._firstScatter[h(e)]===e.uid,v=(g(e,u,r,n)||{}).orientation,m=e.fill;r._minDtick=0,n._minDtick=0;var y={padded:!0},x={padded:!0};s&&(y.ppad=x.ppad=s);var b=c<2||a[0]!==a[c-1]||o[0]!==o[c-1];b&&("tozerox"===m||"tonextx"===m&&(p||"h"===v))?y.tozero=!0:(e.error_y||{}).visible||"tonexty"!==m&&"tozeroy"!==m&&(l.hasMarkers(e)||l.hasText(e))||(y.padded=!1,y.ppad=0),b&&("tozeroy"===m||"tonexty"===m&&(p||"v"===v))?x.tozero=!0:"tonextx"!==m&&"tozerox"!==m||(x.padded=!1),f&&(e._extremes[f]=i.findExtremes(r,a,y)),d&&(e._extremes[d]=i.findExtremes(n,o,x))}function d(t,e){if(l.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 s={type:"linear"};i.setConvert(s);for(var c=s.makeCalcdata(t.marker,"size"),u=new Array(e),f=0;f<e;f++)u[f]=r(c[f]);return u}return r(n.size)}}function p(t,e){var r=h(e),n=t._firstScatter;n[r]||(n[r]=e.uid)}function h(t){var e=t.stackgroup;return t.xaxis+t.yaxis+t.type+(e?"-"+e:"")}function g(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,l,h,v,m,y,x=t._fullLayout,b=i.getFromId(t,e.xaxis||"x"),_=i.getFromId(t,e.yaxis||"y"),w=b.makeCalcdata(e,"x"),k=_.makeCalcdata(e,"y"),T=e._length,M=new Array(T),A=e.ids,L=g(e,x,b,_),S=!1;p(x,e);var C,O="x",P="y";for(L?(a.pushUnique(L.traceIndices,e._expandedIndex),(r="v"===L.orientation)?(P="s",C="x"):(O="s",C="y"),m="interpolate"===L.stackgaps):f(t,e,b,_,w,k,d(e,T)),l=0;l<T;l++){var D=M[l]={},z=n(w[l]),R=n(k[l]);z&&R?(D[O]=w[l],D[P]=k[l]):L&&(r?z:R)?(D[C]=r?w[l]:k[l],D.gap=!0,m?(D.s=o,S=!0):D.s=0):D[O]=D[P]=o,A&&(D.id=String(A[l]))}if(c(M,e),s(t,e),u(M,e),L){for(l=0;l<M.length;)M[l][C]===o?M.splice(l,1):l++;if(a.sort(M,function(t,e){return t[C]-e[C]||t.i-e.i}),S){for(l=0;l<M.length-1&&M[l].gap;)l++;for((y=M[l].s)||(y=M[l].s=0),h=0;h<l;h++)M[h].s=y;for(v=M.length-1;v>l&&M[v].gap;)v--;for(y=M[v].s,h=M.length-1;h>v;h--)M[h].s=y;for(;l<v;)if(M[++l].gap){for(h=l+1;M[h].gap;)h++;for(var E=M[l-1][C],I=M[l-1].s,F=(M[h].s-I)/(M[h][C]-E);l<h;)M[l].s=I+(M[l][C]-E)*F,l++}}}return M},calcMarkerSize:d,calcAxisExpansion:f,setFirstScatter:p,getStackOpts:g}},{"../../constants/numerical":139,"../../lib":159,"../../plots/cartesian/axes":203,"./arrays_to_calcdata":282,"./calc_selection":285,"./colorscale_calc":286,"./subtypes":307,"fast-isnumeric":9}],285:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){n.isArrayOrTypedArray(e.selectedpoints)&&n.tagSelected(t,e)}},{"../../lib":159}],286:[function(t,e,r){"use strict";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":50,"../../components/colorscale/helpers":53,"./subtypes":307}],287:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20,eventDataKeys:[]}},{}],288:[function(t,e,r){"use strict";var n=t("./calc");function a(t,e,r,n,a,i,o){a[n]=!0;var l={i:null,gap:!0,s:0};if(l[o]=r,t.splice(e,0,l),e&&r===t[e-1][o]){var s=t[e-1];l.s=s.s,l.i=s.i,l.gap=s.gap}else i&&(l.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,l=t._fullLayout._scatterStackOpts[o];if(l){var s,c,u,f,d,p,h,g,v,m,y,x,b,_,w,k=t.calcdata;for(var T in l){var M=(m=l[T]).traceIndices;if(M.length){for(y="interpolate"===m.stackgaps,x=m.groupnorm,"v"===m.orientation?(b="x",_="y"):(b="y",_="x"),w=new Array(M.length),s=0;s<w.length;s++)w[s]=!1;p=k[M[0]];var A=new Array(p.length);for(s=0;s<p.length;s++)A[s]=p[s][b];for(s=1;s<M.length;s++){for(d=k[M[s]],c=u=0;c<d.length;c++){for(h=d[c][b];h>A[u]&&u<A.length;u++)a(d,c,A[u],s,w,y,b),c++;if(h!==A[u]){for(f=0;f<s;f++)a(k[M[f]],u,h,f,w,y,b);A.splice(u,0,h)}u++}for(;u<A.length;u++)a(d,c,A[u],s,w,y,b),c++}var L=A.length;for(c=0;c<p.length;c++){for(g=p[c][_]=p[c].s,s=1;s<M.length;s++)(d=k[M[s]])[0].trace._rawLength=d[0].trace._length,d[0].trace._length=L,g+=d[c].s,d[c][_]=g;if(x)for(v=("fraction"===x?g:g/100)||1,s=0;s<M.length;s++){var S=k[M[s]][c];S[_]/=v,S.sNorm=S.s/v}}for(s=0;s<M.length;s++){var C=(d=k[M[s]])[0].trace,O=n.calcMarkerSize(C,C._rawLength),P=Array.isArray(O);if(O&&w[s]||P){var D=O;for(O=new Array(L),c=0;c<L;c++)O[c]=d[c].gap?0:P?D[d[c].i]:D}var z=new Array(L),R=new Array(L);for(c=0;c<L;c++)z[c]=d[c].x,R[c]=d[c].y;n.calcAxisExpansion(t,C,r,i,z,R,O),d[0].t.orientation=m.orientation}}}}}},{"./calc":284}],289:[function(t,e,r){"use strict";e.exports=function(t){for(var e=0;e<t.length;e++){var r=t[e];if("scatter"===r.type){var n=r.fill;if("none"!==n&&"toself"!==n&&(r.opacity=void 0,"tonexty"===n||"tonextx"===n))for(var 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}}}}}},{}],290:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("./attributes"),o=t("./constants"),l=t("./subtypes"),s=t("./xy_defaults"),c=t("./stack_defaults"),u=t("./marker_defaults"),f=t("./line_defaults"),d=t("./line_shape_defaults"),p=t("./text_defaults"),h=t("./fillcolor_defaults");e.exports=function(t,e,r,g){function v(r,a){return n.coerce(t,e,i,r,a)}var m=s(t,e,g,v);if(m||(e.visible=!1),e.visible){var y=c(t,e,g,v),x=!y&&m<o.PTS_LINESONLY?"lines+markers":"lines";v("text"),v("hovertext"),v("mode",x),l.hasLines(e)&&(f(t,e,r,g,v),d(t,e,v),v("connectgaps"),v("line.simplify")),l.hasMarkers(e)&&u(t,e,r,g,v,{gradient:!0}),l.hasText(e)&&(v("texttemplate"),p(t,e,g,v));var b=[];(l.hasMarkers(e)||l.hasText(e))&&(v("cliponaxis"),v("marker.maxdisplayed"),b.push("points")),v("fill",y?y.fillDflt:"none"),"none"!==e.fill&&(h(t,e,r,v),l.hasLines(e)||d(t,e,v));var _=(e.line||{}).color,w=(e.marker||{}).color;"tonext"!==e.fill&&"toself"!==e.fill||b.push("fills"),v("hoveron",b.join("+")||"points"),"fills"!==e.hoveron&&v("hovertemplate");var k=a.getComponentMethod("errorbars","supplyDefaults");k(t,e,_||w||r,{axis:"y"}),k(t,e,_||w||r,{axis:"x",inherit:"y"}),n.coerceSelectionMarkerOpacity(e,v)}}},{"../../lib":159,"../../registry":243,"./attributes":283,"./constants":287,"./fillcolor_defaults":291,"./line_defaults":296,"./line_shape_defaults":298,"./marker_defaults":302,"./stack_defaults":305,"./subtypes":307,"./text_defaults":308,"./xy_defaults":309}],291:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../lib").isArrayOrTypedArray;e.exports=function(t,e,r,i){var o=!1;if(e.marker){var l=e.marker.color,s=(e.marker.line||{}).color;l&&!a(l)?o=l:s&&!a(s)&&(o=s)}i("fillcolor",n.addOpacity((e.line||{}).color||o||r,.5))}},{"../../components/color":42,"../../lib":159}],292:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes");e.exports=function(t,e,r){var a={},i={_fullLayout:r},o=n.getFromTrace(i,e,"x"),l=n.getFromTrace(i,e,"y");return a.xLabel=n.tickText(o,t.x,!0).text,a.yLabel=n.tickText(l,t.y,!0).text,a}},{"../../plots/cartesian/axes":203}],293:[function(t,e,r){"use strict";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,l=e.mlcc||((t.marker||{}).line||{}).color;return(i=o&&n.opacity(o)?o:l&&n.opacity(l)&&(e.mlw||((t.marker||{}).line||{}).width)?l:"")?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":42,"./subtypes":307}],294:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../components/fx"),i=t("../../registry"),o=t("./get_trace_color"),l=t("../../components/color"),s=n.fillText;e.exports=function(t,e,r,c){var u=t.cd,f=u[0].trace,d=t.xa,p=t.ya,h=d.c2p(e),g=p.c2p(r),v=[h,g],m=f.hoveron||"",y=-1!==f.mode.indexOf("markers")?3:.5;if(-1!==m.indexOf("points")){var x=function(t){var e=Math.max(y,t.mrc||0),r=d.c2p(t.x)-h,n=p.c2p(t.y)-g;return Math.max(Math.sqrt(r*r+n*n)-e,1-y/e)},b=a.getDistanceFunction(c,function(t){var e=Math.max(3,t.mrc||0),r=1-1/e,n=Math.abs(d.c2p(t.x)-h);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(p.c2p(t.y)-g);return n<e?r*n/e:n-e+r},x);if(a.getClosest(u,b,t),!1!==t.index){var _=u[t.index],w=d.c2p(_.x,!0),k=p.c2p(_.y,!0),T=_.mrc||1;t.index=_.i;var M=u[0].t.orientation,A=M&&(_.sNorm||_.s),L="h"===M?A:_.x,S="v"===M?A:_.y;return n.extendFlat(t,{color:o(f,_),x0:w-T,x1:w+T,xLabelVal:L,y0:k-T,y1:k+T,yLabelVal:S,spikeDistance:x(_),hovertemplate:f.hovertemplate}),s(_,f,t),i.getComponentMethod("errorbars","hoverInfo")(_,f,t),[t]}}if(-1!==m.indexOf("fills")&&f._polygons){var C,O,P,D,z,R,E,I,F,N=f._polygons,j=[],B=!1,H=1/0,V=-1/0,q=1/0,U=-1/0;for(C=0;C<N.length;C++)(P=N[C]).contains(v)&&(B=!B,j.push(P),q=Math.min(q,P.ymin),U=Math.max(U,P.ymax));if(B){var G=((q=Math.max(q,0))+(U=Math.min(U,p._length)))/2;for(C=0;C<j.length;C++)for(D=j[C].pts,O=1;O<D.length;O++)(I=D[O-1][1])>G!=(F=D[O][1])>=G&&(R=D[O-1][0],E=D[O][0],F-I&&(z=R+(E-R)*(G-I)/(F-I),H=Math.min(H,z),V=Math.max(V,z)));H=Math.max(H,0),V=Math.min(V,d._length);var Z=l.defaultLine;return l.opacity(f.fillcolor)?Z=f.fillcolor:l.opacity((f.line||{}).color)&&(Z=f.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:H,x1:V,y0:G,y1:G,color:Z,hovertemplate:!1}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":42,"../../components/fx":80,"../../lib":159,"../../registry":243,"./get_trace_color":293}],295:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:t("./attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("./cross_trace_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./cross_trace_calc"),arraysToCalcdata:t("./arrays_to_calcdata"),plot:t("./plot"),colorbar:t("./marker_colorbar"),formatLabels:t("./format_labels"),style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":214,"./arrays_to_calcdata":282,"./attributes":283,"./calc":284,"./cross_trace_calc":288,"./cross_trace_defaults":289,"./defaults":290,"./format_labels":292,"./hover":294,"./marker_colorbar":301,"./plot":303,"./select":304,"./style":306,"./subtypes":307}],296:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,l,s){var c=(t.marker||{}).color;(l("line.color",r),a(t,"line"))?i(t,e,o,l,{prefix:"line.",cLetter:"c"}):l("line.color",!n(c)&&c||r);l("line.width"),(s||{}).noDash||l("line.dash")}},{"../../components/colorscale/defaults":52,"../../components/colorscale/helpers":53,"../../lib":159}],297:[function(t,e,r){"use strict";var n=t("../../constants/numerical"),a=n.BADNUM,i=n.LOG_CLIP,o=i+.5,l=i-.5,s=t("../../lib"),c=s.segmentsIntersect,u=s.constrain,f=t("./constants");e.exports=function(t,e){var r,n,i,d,p,h,g,v,m,y,x,b,_,w,k,T,M,A,L=e.xaxis,S=e.yaxis,C="log"===L.type,O="log"===S.type,P=L._length,D=S._length,z=e.connectGaps,R=e.baseTolerance,E=e.shape,I="linear"===E,F=e.fill&&"none"!==e.fill,N=[],j=f.minTolerance,B=t.length,H=new Array(B),V=0;function q(r){var n=t[r];if(!n)return!1;var i=e.linearized?L.l2p(n.x):L.c2p(n.x),s=e.linearized?S.l2p(n.y):S.c2p(n.y);if(i===a){if(C&&(i=L.c2p(n.x,!0)),i===a)return!1;O&&s===a&&(i*=Math.abs(L._m*D*(L._m>0?o:l)/(S._m*P*(S._m>0?o:l)))),i*=1e3}if(s===a){if(O&&(s=S.c2p(n.y,!0)),s===a)return!1;s*=1e3}return[i,s]}function U(t,e,r,n){var a=r-t,i=n-e,o=.5-t,l=.5-e,s=a*a+i*i,c=a*o+i*l;if(c>0&&c<s){var u=o*i-l*a;if(u*u<s)return!0}}function G(t,e){var r=t[0]/P,n=t[1]/D,a=Math.max(0,-r,r-1,-n,n-1);return a&&void 0!==M&&U(r,n,M,A)&&(a=0),a&&e&&U(r,n,e[0]/P,e[1]/D)&&(a=0),(1+f.toleranceGrowth*a)*R}function Z(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}var X,Y,W,$,Q,J,K,tt=f.maxScreensAway,et=-P*tt,rt=P*(1+tt),nt=-D*tt,at=D*(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[u(t[0],et,rt),u(t[1],nt,at)]}function lt(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 st(t,e,r){return function(n,a){var i=ot(n),o=ot(a),l=[];if(i&&o&<(i,o))return l;i&&l.push(i),o&&l.push(o);var c=2*s.constrain((n[t]+a[t])/2,e,r)-((i||n)[t]+(o||a)[t]);c&&((i&&o?c>0==i[t]>o[t]?i:o:i||o)[t]+=c);return l}}function ct(t){var e=t[0],r=t[1],n=e===H[V-1][0],a=r===H[V-1][1];if(!n||!a)if(V>1){var i=e===H[V-2][0],o=r===H[V-2][1];n&&(e===et||e===rt)&&i?o?V--:H[V-1]=t:a&&(r===nt||r===at)&&o?i?V--:H[V-1]=t:H[V++]=t}else H[V++]=t}function ut(t){H[V-1][0]!==t[0]&&H[V-1][1]!==t[1]&&ct([W,$]),ct(t),Q=null,W=$=0}function ft(t){if(M=t[0]/P,A=t[1]/D,X=t[0]<et?et:t[0]>rt?rt:0,Y=t[1]<nt?nt:t[1]>at?at:0,X||Y){if(V)if(Q){var e=K(Q,t);e.length>1&&(ut(e[0]),H[V++]=e[1])}else J=K(H[V-1],t)[0],H[V++]=J;else H[V++]=[X||t[0],Y||t[1]];var r=H[V-1];X&&Y&&(r[0]!==X||r[1]!==Y)?(Q&&(W!==X&&$!==Y?ct(W&&$?(n=Q,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]):[W||X,$||Y]):W&&$&&ct([W,$])),ct([X,Y])):W-X&&$-Y&&ct([X||W,Y||$]),Q=t,W=X,$=Y}else Q&&ut(K(Q,t)[0]),H[V++]=t;var n,a,i,o}for("linear"===E||"spline"===E?K=function(t,e){for(var r=[],n=0,a=0;a<4;a++){var i=it[a],o=c(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&&Z(o,t)<Z(r[0],t)?r.unshift(o):r.push(o),n++)}return r}:"hv"===E||"vh"===E?K=function(t,e){var r=[],n=ot(t),a=ot(e);return n&&a&<(n,a)?r:(n&&r.push(n),a&&r.push(a),r)}:"hvh"===E?K=st(0,et,rt):"vhv"===E&&(K=st(1,nt,at)),r=0;r<B;r++)if(n=q(r)){for(V=0,Q=null,ft(n),r++;r<B;r++){if(!(d=q(r))){if(z)continue;break}if(I&&e.simplify){var dt=q(r+1);if(y=Z(d,n),F&&(0===V||V===B-1)||!(y<G(d,dt)*j)){for(v=[(d[0]-n[0])/y,(d[1]-n[1])/y],p=n,x=y,b=w=k=0,g=!1,i=d,r++;r<t.length;r++){if(h=dt,dt=q(r+1),!h){if(z)continue;break}if(T=(m=[h[0]-n[0],h[1]-n[1]])[0]*v[1]-m[1]*v[0],w=Math.min(w,T),(k=Math.max(k,T))-w>G(h,dt))break;i=h,(_=m[0]*v[0]+m[1]*v[1])>x?(x=_,d=h,g=!1):_<b&&(b=_,p=h,g=!0)}if(g?(ft(d),i!==p&&ft(p)):(p!==n&&ft(p),i!==d&&ft(d)),ft(i),r>=t.length||!h)break;ft(h),n=h}}else ft(d)}Q&&ct([W||Q[0],$||Q[1]]),N.push(H.slice(0,V))}return N}},{"../../constants/numerical":139,"../../lib":159,"./constants":287}],298:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],299:[function(t,e,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};e.exports=function(t,e,r){var a,i,o,l,s,c={},u=!1,f=-1,d=0,p=-1;for(i=0;i<r.length;i++)(o=(a=r[i][0].trace).stackgroup||"")?o in c?s=c[o]:(s=c[o]=d,d++):a.fill in n&&p>=0?s=p:(s=p=d,d++),s<f&&(u=!0),a._groupIndex=f=s;var h=r.slice();u&&h.sort(function(t,e){var r=t[0].trace,n=e[0].trace;return r._groupIndex-n._groupIndex||r.index-n.index});var g={};for(i=0;i<h.length;i++)o=(a=h[i][0].trace).stackgroup||"",!0===a.visible?(a._nexttrace=null,a.fill in n&&(l=g[o],a._prevtrace=l||null,l&&(l._nexttrace=a)),a._ownfill=a.fill&&("tozero"===a.fill.substr(0,6)||"toself"===a.fill||"to"===a.fill.substr(0,2)&&!a._prevtrace),g[o]=a):a._prevtrace=a._nexttrace=a._ownfill=null;return h}},{}],300:[function(t,e,r){"use strict";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":9}],301:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],302:[function(t,e,r){"use strict";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,l,s,c){var u=o.isBubble(t),f=(t.line||{}).color;(c=c||{},f&&(r=f),s("marker.symbol"),s("marker.opacity",u?.7:1),s("marker.size"),s("marker.color",r),a(t,"marker")&&i(t,e,l,s,{prefix:"marker.",cLetter:"c"}),c.noSelect||(s("selected.marker.color"),s("unselected.marker.color"),s("selected.marker.size"),s("unselected.marker.size")),c.noLine||(s("marker.line.color",f&&!Array.isArray(f)&&e.marker.color!==f?f:u?n.background:n.defaultLine),a(t,"marker.line")&&i(t,e,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",u?1:0)),u&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient)&&("none"!==s("marker.gradient.type")&&s("marker.gradient.color"))}},{"../../components/color":42,"../../components/colorscale/defaults":52,"../../components/colorscale/helpers":53,"./subtypes":307}],303:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../lib"),o=i.ensureSingle,l=i.identity,s=t("../../components/drawing"),c=t("./subtypes"),u=t("./line_points"),f=t("./link_traces"),d=t("../../lib/polygon").tester;function p(t,e,r,f,p,h,g){var v;!function(t,e,r,a,o){var l=r.xaxis,s=r.yaxis,u=n.extent(i.simpleMap(l.range,l.r2c)),f=n.extent(i.simpleMap(s.range,s.r2c)),d=a[0].trace;if(!c.hasMarkers(d))return;var p=d.marker.maxdisplayed;if(0===p)return;var h=a.filter(function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=f[0]&&t.y<=f[1]}),g=Math.ceil(h.length/p),v=0;o.forEach(function(t,r){var n=t[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r<e&&v++});var m=Math.round(v*g/3+Math.floor(v/3)*g/7.1);a.forEach(function(t){delete t.vis}),h.forEach(function(t,e){0===Math.round((e+m)%g)&&(t.vis=!0)})}(0,e,r,f,p);var m=!!g&&g.duration>0;function y(t){return m?t.transition():t}var x=r.xaxis,b=r.yaxis,_=f[0].trace,w=_.line,k=n.select(h),T=o(k,"g","errorbars"),M=o(k,"g","lines"),A=o(k,"g","points"),L=o(k,"g","text");if(a.getComponentMethod("errorbars","plot")(t,T,r,g),!0===_.visible){var S,C;y(k).style("opacity",_.opacity);var O=_.fill.charAt(_.fill.length-1);"x"!==O&&"y"!==O&&(O=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=k;var P,D,z="",R=[],E=_._prevtrace;E&&(z=E._prevRevpath||"",C=E._nextFill,R=E._polygons);var I,F,N,j,B,H,V,q="",U="",G=[],Z=i.noop;if(S=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(C&&C.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(I=s.steps(w.shape),F=s.steps(w.shape.split("").reverse().join(""))):I=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]?s.smoothclosed(t.slice(1),w.smoothing):s.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},N=function(t){return F(t.reverse())},G=u(f,{xaxis:x,yaxis:b,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:_.fill}),V=_._polygons=new Array(G.length),v=0;v<G.length;v++)_._polygons[v]=d(G[v]);G.length&&(j=G[0][0],H=(B=G[G.length-1])[B.length-1]),Z=function(t){return function(e){if(P=I(e),D=N(e),q?O?(q+="L"+P.substr(1),U=D+"L"+U.substr(1)):(q+="Z"+P,U=D+"Z"+U):(q=P,U=D),c.hasLines(_)&&e.length>1){var r=n.select(this);if(r.datum(f),t)y(r.style("opacity",0).attr("d",P).call(s.lineGroupStyle)).style("opacity",1);else{var a=y(r);a.attr("d",P),s.singleLineStyle(f,a)}}}}}var X=M.selectAll(".js-line").data(G);y(X.exit()).style("opacity",0).remove(),X.each(Z(!1)),X.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(Z(!0)),s.setClipUrl(X,r.layerClipId,t),G.length?(S?(S.datum(f),j&&H&&(O?("y"===O?j[1]=H[1]=b.c2p(0,!0):"x"===O&&(j[0]=H[0]=x.c2p(0,!0)),y(S).attr("d","M"+H+"L"+j+"L"+q.substr(1)).call(s.singleFillStyle)):y(S).attr("d",q+"Z").call(s.singleFillStyle))):C&&("tonext"===_.fill.substr(0,6)&&q&&z?("tonext"===_.fill?y(C).attr("d",q+"Z"+z+"Z").call(s.singleFillStyle):y(C).attr("d",q+"L"+z.substr(1)+"Z").call(s.singleFillStyle),_._polygons=_._polygons.concat(R)):(W(C),_._polygons=null)),_._prevRevpath=U,_._prevPolygons=V):(S?W(S):C&&W(C),_._polygons=_._prevRevpath=_._prevPolygons=null),A.datum(f),L.datum(f),function(e,a,i){var o,u=i[0].trace,f=c.hasMarkers(u),d=c.hasText(u),p=tt(u),h=et,g=et;if(f||d){var v=l,_=u.stackgroup,w=_&&"infer zero"===t._fullLayout._scatterStackOpts[x._id+b._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?v=w?Q:$:_&&!w&&(v=J),f&&(h=v),d&&(g=v)}var k,T=(o=e.selectAll("path.point").data(h,p)).enter().append("path").classed("point",!0);m&&T.call(s.pointStyle,u,t).call(s.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),f&&(k=s.makePointStyleFns(u)),o.each(function(e){var a=n.select(this),i=y(a);s.translatePoint(e,i,x,b)?(s.singlePointStyle(e,i,u,k,t),r.layerClipId&&s.hideOutsideRangePoint(e,i,x,b,u.xcalendar,u.ycalendar),u.customdata&&a.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):i.remove()}),m?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(g,p)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each(function(t){var e=n.select(this),a=y(e.select("text"));s.translatePoint(t,a,x,b)?r.layerClipId&&s.hideOutsideRangePoint(t,e,x,b,u.xcalendar,u.ycalendar):e.remove()}),o.selectAll("text").call(s.textPointStyle,u,t).each(function(t){var e=x.c2p(t.x),r=b.c2p(t.y);n.select(this).selectAll("tspan.line").each(function(){y(n.select(this)).attr({x:e,y:r})})}),o.exit().remove()}(A,L,f);var Y=!1===_.cliponaxis?null:r.layerClipId;s.setClipUrl(A,Y,t),s.setClipUrl(L,Y,t)}function W(t){y(t).attr("d","M0,0Z")}function $(t){return t.filter(function(t){return!t.gap&&t.vis})}function Q(t){return t.filter(function(t){return t.vis})}function J(t){return t.filter(function(t){return!t.gap})}function K(t){return t.id}function tt(t){if(t.ids)return K}function et(){return!1}}e.exports=function(t,e,r,a,i,c){var u,d,h=!i,g=!!i&&i.duration>0,v=f(t,e,r);((u=a.selectAll("g.trace").data(v,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),u.order(),function(t,e,r){e.each(function(e){var a=o(n.select(this),"g","fills");s.setClipUrl(a,r.layerClipId,t);var i=e[0].trace,c=[];i._ownfill&&c.push("_ownFill"),i._nexttrace&&c.push("_nextFill");var u=a.selectAll("g").data(c,l);u.enter().append("g"),u.exit().each(function(t){i[t]=null}).remove(),u.order().each(function(t){i[t]=o(n.select(this),"path","js-fill")})})}(t,u,e),g)?(c&&(d=c()),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){p(t,n,e,r,v,this,i)})})):u.each(function(r,n){p(t,n,e,r,v,this,i)});h&&u.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":63,"../../lib":159,"../../lib/polygon":171,"../../registry":243,"./line_points":297,"./link_traces":299,"./subtypes":307,d3:7}],304:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,a,i,o,l=t.cd,s=t.xaxis,c=t.yaxis,u=[],f=l[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===e)for(r=0;r<l.length;r++)l[r].selected=0;else for(r=0;r<l.length;r++)a=l[r],i=s.c2p(a.x),o=c.c2p(a.y),null!==a.i&&e.contains([i,o],!1,r,t)?(u.push({pointNumber:a.i,x:s.c2d(a.x),y:c.c2d(a.y)}),a.selected=1):a.selected=0;return u}},{"./subtypes":307}],305:[function(t,e,r){"use strict";var n=["orientation","groupnorm","stackgaps"];e.exports=function(t,e,r,a){var i=r._scatterStackOpts,o=a("stackgroup");if(o){var l=e.xaxis+e.yaxis,s=i[l];s||(s=i[l]={});var c=s[o],u=!1;c?c.traces.push(e):(c=s[o]={traceIndices:[],traces:[e]},u=!0);for(var f={orientation:e.x&&!e.y?"h":"v"},d=0;d<n.length;d++){var p=n[d],h=p+"Found";if(!c[h]){var g=void 0!==t[p],v="orientation"===p;if((g||u)&&(c[p]=a(p,f[p]),v&&(c.fillDflt="h"===c[p]?"tonextx":"tonexty"),g&&(c[h]=!0,!u&&(delete c.traces[0][p],v))))for(var m=0;m<c.traces.length-1;m++){var y=c.traces[m];y._input.fill!==y.fill&&(y.fill=c.fillDflt)}}}return c}}},{}],306:[function(t,e,r){"use strict";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 l(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){l(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:l,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),l(r,n,t))}}},{"../../components/drawing":63,"../../registry":243,d3:7}],307:[function(t,e,r){"use strict";var n=t("../../lib");e.exports={hasLines:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("lines")},hasMarkers:function(t){return t.visible&&(t.mode&&-1!==t.mode.indexOf("markers")||"splom"===t.type)},hasText:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("text")},isBubble:function(t){return n.isPlainObject(t.marker)&&n.isArrayOrTypedArray(t.marker.size)}}},{"../../lib":159}],308:[function(t,e,r){"use strict";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":159}],309:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry");e.exports=function(t,e,r,i){var o,l=i("x"),s=i("y");if(a.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],r),l){var c=n.minRowLength(l);s?o=Math.min(c,n.minRowLength(s)):(o=c,i("y0"),i("dy"))}else{if(!s)return 0;o=n.minRowLength(s),i("x0"),i("dx")}return e._length=o,o}},{"../../lib":159,"../../registry":243}]},{},[4])(4)});