text: (window.webpackJsonp=window.webpackJsonp||[]).push([[6],{897:
  /*!*********************************************************!*\
    !*** ./node_modules/plotly.js/dist/plotly-basic.min.js ***!
    \*********************************************************/
  /*! no static exports found */
  /*! all exports used */
  /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){(function(t,r){e.exports=function e(t,r,n){function a(o,l){if(!r[o]){if(!t[o]){if(i)return i(o,!0);var s=new Error("Cannot find module '"+o+"'");throw s.code="MODULE_NOT_FOUND",s}var c=r[o]={exports:{}};t[o][0].call(c.exports,(function(e){return a(t[o][1][e]||e)}),c,c.exports,e,t,r,n)}return r[o].exports}for(var i=!1,o=0;o<n.length;o++)a(n[o]);return a}({1:[function(e,t,r){"use strict";var n=e("../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', verdana, arial, sans-serif;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":168}],2:[function(e,t,r){"use strict";t.exports=e("../src/traces/bar")},{"../src/traces/bar":272}],3:[function(e,t,r){"use strict";t.exports=e("../src/core")},{"../src/core":150}],4:[function(e,t,r){"use strict";var n=e("./core");n.register([e("./bar"),e("./pie")]),t.exports=n},{"./bar":2,"./core":3,"./pie":5}],5:[function(e,t,r){"use strict";t.exports=e("../src/traces/pie")},{"../src/traces/pie":287}],6:[function(e,t,r){var n=Object.create||function(e){var t=function(){};return t.prototype=e,new t},a=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return r},i=Function.prototype.bind||function(e){var t=this;return function(){return t.apply(e,arguments)}};function o(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=n(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}t.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(e){l=!1}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function f(e,t,r,a){var i,o,l;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');if((o=e._events)?(o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),l=o[t]):(o=e._events=n(null),e._eventsCount=0),l){if("function"==typeof l?l=o[t]=a?[r,l]:[l,r]:a?l.unshift(r):l.push(r),!l.warned&&(i=u(e))&&i>0&&l.length>i){l.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+l.length+' "'+String(t)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=l.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",s.name,s.message)}}else l=o[t]=r,++e._eventsCount;return e}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 e=new Array(arguments.length),t=0;t<e.length;++t)e[t]=arguments[t];this.listener.apply(this.target,e)}}function p(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},a=i.call(d,n);return a.listener=r,n.wrapFn=a,a}function h(e,t,r){var n=e._events;if(!n)return[];var a=n[t];return a?"function"==typeof a?r?[a.listener||a]:[a]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(a):v(a,a.length):[]}function g(e){var t=this._events;if(t){var r=t[e];if("function"==typeof r)return 1;if(r)return r.length}return 0}function v(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}l?Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||e!=e)throw new TypeError('"defaultMaxListeners" must be a positive number');s=e}}):o.defaultMaxListeners=s,o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(e){var t,r,n,a,i,o,l="error"===e;if(o=this._events)l=l&&null==o.error;else if(!l)return!1;if(l){if(arguments.length>1&&(t=arguments[1]),t instanceof Error)throw t;var s=new Error('Unhandled "error" event. ('+t+")");throw s.context=t,s}if(!(r=o[e]))return!1;var c="function"==typeof r;switch(n=arguments.length){case 1:!function(e,t,r){if(t)e.call(r);else for(var n=e.length,a=v(e,n),i=0;i<n;++i)a[i].call(r)}(r,c,this);break;case 2:!function(e,t,r,n){if(t)e.call(r,n);else for(var a=e.length,i=v(e,a),o=0;o<a;++o)i[o].call(r,n)}(r,c,this,arguments[1]);break;case 3:!function(e,t,r,n,a){if(t)e.call(r,n,a);else for(var i=e.length,o=v(e,i),l=0;l<i;++l)o[l].call(r,n,a)}(r,c,this,arguments[1],arguments[2]);break;case 4:!function(e,t,r,n,a,i){if(t)e.call(r,n,a,i);else for(var o=e.length,l=v(e,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(e,t,r,n){if(t)e.apply(r,n);else for(var a=e.length,i=v(e,a),o=0;o<a;++o)i[o].apply(r,n)}(r,c,this,a)}return!0},o.prototype.addListener=function(e,t){return f(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return f(this,e,t,!0)},o.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.on(e,p(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(e,p(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,a,i,o,l;if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');if(!(a=this._events))return this;if(!(r=a[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=n(null):(delete a[e],a.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){l=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(var r=t,n=r+1,a=e.length;n<a;r+=1,n+=1)e[r]=e[n];e.pop()}(r,i),1===r.length&&(a[e]=r[0]),a.removeListener&&this.emit("removeListener",e,l||t)}return this},o.prototype.removeAllListeners=function(e){var t,r,i;if(!(r=this._events))return this;if(!r.removeListener)return 0===arguments.length?(this._events=n(null),this._eventsCount=0):r[e]&&(0==--this._eventsCount?this._events=n(null):delete r[e]),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(t=r[e]))this.removeListener(e,t);else if(t)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this},o.prototype.listeners=function(e){return h(this,e,!0)},o.prototype.rawListeners=function(e){return h(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},o.prototype.listenerCount=g,o.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],7:[function(e,t,r){!function(){var e={version:"3.5.17"},r=[].slice,n=function(e){return r.call(e)},a=this.document;function i(e){return e&&(e.ownerDocument||e.document||e).documentElement}function o(e){return e&&(e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView)}if(a)try{n(a.documentElement.childNodes)[0].nodeType}catch(e){n=function(e){for(var t=e.length,r=new Array(t);t--;)r[t]=e[t];return r}}if(Date.now||(Date.now=function(){return+new Date}),a)try{a.createElement("DIV").style.setProperty("opacity",0,"")}catch(e){var l=this.Element.prototype,s=l.setAttribute,c=l.setAttributeNS,u=this.CSSStyleDeclaration.prototype,f=u.setProperty;l.setAttribute=function(e,t){s.call(this,e,t+"")},l.setAttributeNS=function(e,t,r){c.call(this,e,t,r+"")},u.setProperty=function(e,t,r){f.call(this,e,t+"",r)}}function d(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function p(e){return null===e?NaN:+e}function h(e){return!isNaN(e)}function g(e){return{left:function(t,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=t.length);n<a;){var i=n+a>>>1;e(t[i],r)<0?n=i+1:a=i}return n},right:function(t,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=t.length);n<a;){var i=n+a>>>1;e(t[i],r)>0?a=i:n=i+1}return n}}}e.ascending=d,e.descending=function(e,t){return t<e?-1:t>e?1:t>=e?0:NaN},e.min=function(e,t){var r,n,a=-1,i=e.length;if(1===arguments.length){for(;++a<i;)if(null!=(n=e[a])&&n>=n){r=n;break}for(;++a<i;)null!=(n=e[a])&&r>n&&(r=n)}else{for(;++a<i;)if(null!=(n=t.call(e,e[a],a))&&n>=n){r=n;break}for(;++a<i;)null!=(n=t.call(e,e[a],a))&&r>n&&(r=n)}return r},e.max=function(e,t){var r,n,a=-1,i=e.length;if(1===arguments.length){for(;++a<i;)if(null!=(n=e[a])&&n>=n){r=n;break}for(;++a<i;)null!=(n=e[a])&&n>r&&(r=n)}else{for(;++a<i;)if(null!=(n=t.call(e,e[a],a))&&n>=n){r=n;break}for(;++a<i;)null!=(n=t.call(e,e[a],a))&&n>r&&(r=n)}return r},e.extent=function(e,t){var r,n,a,i=-1,o=e.length;if(1===arguments.length){for(;++i<o;)if(null!=(n=e[i])&&n>=n){r=a=n;break}for(;++i<o;)null!=(n=e[i])&&(r>n&&(r=n),a<n&&(a=n))}else{for(;++i<o;)if(null!=(n=t.call(e,e[i],i))&&n>=n){r=a=n;break}for(;++i<o;)null!=(n=t.call(e,e[i],i))&&(r>n&&(r=n),a<n&&(a=n))}return[r,a]},e.sum=function(e,t){var r,n=0,a=e.length,i=-1;if(1===arguments.length)for(;++i<a;)h(r=+e[i])&&(n+=r);else for(;++i<a;)h(r=+t.call(e,e[i],i))&&(n+=r);return n},e.mean=function(e,t){var r,n=0,a=e.length,i=-1,o=a;if(1===arguments.length)for(;++i<a;)h(r=p(e[i]))?n+=r:--o;else for(;++i<a;)h(r=p(t.call(e,e[i],i)))?n+=r:--o;if(o)return n/o},e.quantile=function(e,t){var r=(e.length-1)*t+1,n=Math.floor(r),a=+e[n-1],i=r-n;return i?a+i*(e[n]-a):a},e.median=function(t,r){var n,a=[],i=t.length,o=-1;if(1===arguments.length)for(;++o<i;)h(n=p(t[o]))&&a.push(n);else for(;++o<i;)h(n=p(r.call(t,t[o],o)))&&a.push(n);if(a.length)return e.quantile(a.sort(d),.5)},e.variance=function(e,t){var r,n,a=e.length,i=0,o=0,l=-1,s=0;if(1===arguments.length)for(;++l<a;)h(r=p(e[l]))&&(o+=(n=r-i)*(r-(i+=n/++s)));else for(;++l<a;)h(r=p(t.call(e,e[l],l)))&&(o+=(n=r-i)*(r-(i+=n/++s)));if(s>1)return o/(s-1)},e.deviation=function(){var t=e.variance.apply(this,arguments);return t?Math.sqrt(t):t};var v=g(d);function m(e){return e.length}e.bisectLeft=v.left,e.bisect=e.bisectRight=v.right,e.bisector=function(e){return g(1===e.length?function(t,r){return d(e(t),r)}:e)},e.shuffle=function(e,t,r){(i=arguments.length)<3&&(r=e.length,i<2&&(t=0));for(var n,a,i=r-t;i;)a=Math.random()*i--|0,n=e[i+t],e[i+t]=e[a+t],e[a+t]=n;return e},e.permute=function(e,t){for(var r=t.length,n=new Array(r);r--;)n[r]=e[t[r]];return n},e.pairs=function(e){for(var t=0,r=e.length-1,n=e[0],a=new Array(r<0?0:r);t<r;)a[t]=[n,n=e[++t]];return a},e.transpose=function(t){if(!(i=t.length))return[];for(var r=-1,n=e.min(t,m),a=new Array(n);++r<n;)for(var i,o=-1,l=a[r]=new Array(i);++o<i;)l[o]=t[o][r];return a},e.zip=function(){return e.transpose(arguments)},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t},e.values=function(e){var t=[];for(var r in e)t.push(e[r]);return t},e.entries=function(e){var t=[];for(var r in e)t.push({key:r,value:e[r]});return t},e.merge=function(e){for(var t,r,n,a=e.length,i=-1,o=0;++i<a;)o+=e[i].length;for(r=new Array(o);--a>=0;)for(t=(n=e[a]).length;--t>=0;)r[--o]=n[t];return r};var y=Math.abs;function x(e,t){for(var r in t)Object.defineProperty(e.prototype,r,{value:t[r],enumerable:!1})}function b(){this._=Object.create(null)}function _(e){return"__proto__"==(e+="")||"\0"===e[0]?"\0"+e:e}function w(e){return"\0"===(e+="")[0]?e.slice(1):e}function k(e){return _(e)in this._}function T(e){return(e=_(e))in this._&&delete this._[e]}function M(){var e=[];for(var t in this._)e.push(w(t));return e}function A(){var e=0;for(var t in this._)++e;return e}function L(){for(var e in this._)return!1;return!0}function S(){this._=Object.create(null)}function C(e){return e}function O(e,t,r){return function(){var n=r.apply(t,arguments);return n===t?e:n}}function P(e,t){if(t in e)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var r=0,n=D.length;r<n;++r){var a=D[r]+t;if(a in e)return a}}e.range=function(e,t,r){if(arguments.length<3&&(r=1,arguments.length<2&&(t=e,e=0)),(t-e)/r==1/0)throw new Error("infinite range");var n,a=[],i=function(e){for(var t=1;e*t%1;)t*=10;return t}(y(r)),o=-1;if(e*=i,t*=i,(r*=i)<0)for(;(n=e+r*++o)>t;)a.push(n/i);else for(;(n=e+r*++o)<t;)a.push(n/i);return a},e.map=function(e,t){var r=new b;if(e instanceof b)e.forEach((function(e,t){r.set(e,t)}));else if(Array.isArray(e)){var n,a=-1,i=e.length;if(1===arguments.length)for(;++a<i;)r.set(a,e[a]);else for(;++a<i;)r.set(t.call(e,n=e[a],a),n)}else for(var o in e)r.set(o,e[o]);return r},x(b,{has:k,get:function(e){return this._[_(e)]},set:function(e,t){return this._[_(e)]=t},remove:T,keys:M,values:function(){var e=[];for(var t in this._)e.push(this._[t]);return e},entries:function(){var e=[];for(var t in this._)e.push({key:w(t),value:this._[t]});return e},size:A,empty:L,forEach:function(e){for(var t in this._)e.call(this,w(t),this._[t])}}),e.nest=function(){var t,r,n={},a=[],i=[];function o(e,i,l){if(l>=a.length)return r?r.call(n,i):t?i.sort(t):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 e?(c=e(),u=function(t,r){c.set(t,o(e,r,l))}):(c={},u=function(t,r){c[t]=o(e,r,l)}),g.forEach(u),c}return n.map=function(e,t){return o(t,e,0)},n.entries=function(t){return function e(t,r){if(r>=a.length)return t;var n=[],o=i[r++];return t.forEach((function(t,a){n.push({key:t,values:e(a,r)})})),o?n.sort((function(e,t){return o(e.key,t.key)})):n}(o(e.map,t,0),0)},n.key=function(e){return a.push(e),n},n.sortKeys=function(e){return i[a.length-1]=e,n},n.sortValues=function(e){return t=e,n},n.rollup=function(e){return r=e,n},n},e.set=function(e){var t=new S;if(e)for(var r=0,n=e.length;r<n;++r)t.add(e[r]);return t},x(S,{has:k,add:function(e){return this._[_(e+="")]=!0,e},remove:T,values:M,size:A,empty:L,forEach:function(e){for(var t in this._)e.call(this,w(t))}}),e.behavior={},e.rebind=function(e,t){for(var r,n=1,a=arguments.length;++n<a;)e[r=arguments[n]]=O(e,t,t[r]);return e};var D=["webkit","ms","moz","Moz","o","O"];function z(){}function E(){}function R(e){var t=[],r=new b;function n(){for(var r,n=t,a=-1,i=n.length;++a<i;)(r=n[a].on)&&r.apply(this,arguments);return e}return n.on=function(n,a){var i,o=r.get(n);return arguments.length<2?o&&o.on:(o&&(o.on=null,t=t.slice(0,i=t.indexOf(o)).concat(t.slice(i+1)),r.remove(n)),a&&t.push(r.set(n,{on:a})),e)},n}function I(){e.event.preventDefault()}function F(){for(var t,r=e.event;t=r.sourceEvent;)r=t;return r}function N(t){for(var r=new E,n=0,a=arguments.length;++n<a;)r[arguments[n]]=R(r);return r.of=function(n,a){return function(i){try{var o=i.sourceEvent=e.event;i.target=t,e.event=i,r[i.type].apply(n,a)}finally{e.event=o}}},r}e.dispatch=function(){for(var e=new E,t=-1,r=arguments.length;++t<r;)e[arguments[t]]=R(e);return e},E.prototype.on=function(e,t){var r=e.indexOf("."),n="";if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e)return arguments.length<2?this[e].on(n):this[e].on(n,t);if(2===arguments.length){if(null==t)for(e in this)this.hasOwnProperty(e)&&this[e].on(n,null);return this}},e.event=null,e.requote=function(e){return e.replace(H,"\\$&")};var H=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,B={}.__proto__?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)e[r]=t[r]};function j(e){return B(e,G),e}var V=function(e,t){return t.querySelector(e)},q=function(e,t){return t.querySelectorAll(e)},U=function(e,t){var r=e.matches||e[P(e,"matchesSelector")];return(U=function(e,t){return r.call(e,t)})(e,t)};"function"==typeof Sizzle&&(V=function(e,t){return Sizzle(e,t)[0]||null},q=Sizzle,U=Sizzle.matchesSelector),e.selection=function(){return e.select(a.documentElement)};var G=e.selection.prototype=[];function Z(e){return"function"==typeof e?e:function(){return V(e,this)}}function X(e){return"function"==typeof e?e:function(){return q(e,this)}}G.select=function(e){var t,r,n,a,i=[];e=Z(e);for(var o=-1,l=this.length;++o<l;){i.push(t=[]),t.parentNode=(n=this[o]).parentNode;for(var s=-1,c=n.length;++s<c;)(a=n[s])?(t.push(r=e.call(a,a.__data__,s,o)),r&&"__data__"in a&&(r.__data__=a.__data__)):t.push(null)}return j(i)},G.selectAll=function(e){var t,r,a=[];e=X(e);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(t=n(e.call(r,r.__data__,s,i))),t.parentNode=r);return j(a)};var Y="http://www.w3.org/1999/xhtml",W={svg:"http://www.w3.org/2000/svg",xhtml:Y,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function J(t,r){return t=e.ns.qualify(t),null==r?t.local?function(){this.removeAttributeNS(t.space,t.local)}:function(){this.removeAttribute(t)}:"function"==typeof r?t.local?function(){var e=r.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}:function(){var e=r.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}:t.local?function(){this.setAttributeNS(t.space,t.local,r)}:function(){this.setAttribute(t,r)}}function $(e){return e.trim().replace(/\s+/g," ")}function Q(t){return new RegExp("(?:^|\\s+)"+e.requote(t)+"(?:\\s+|$)","g")}function K(e){return(e+"").trim().split(/^|\s+/)}function ee(e,t){var r=(e=K(e).map(te)).length;return"function"==typeof t?function(){for(var n=-1,a=t.apply(this,arguments);++n<r;)e[n](this,a)}:function(){for(var n=-1;++n<r;)e[n](this,t)}}function te(e){var t=Q(e);return function(r,n){if(a=r.classList)return n?a.add(e):a.remove(e);var a=r.getAttribute("class")||"";n?(t.lastIndex=0,t.test(a)||r.setAttribute("class",$(a+" "+e))):r.setAttribute("class",$(a.replace(t," ")))}}function re(e,t,r){return null==t?function(){this.style.removeProperty(e)}:"function"==typeof t?function(){var n=t.apply(this,arguments);null==n?this.style.removeProperty(e):this.style.setProperty(e,n,r)}:function(){this.style.setProperty(e,t,r)}}function ne(e,t){return null==t?function(){delete this[e]}:"function"==typeof t?function(){var r=t.apply(this,arguments);null==r?delete this[e]:this[e]=r}:function(){this[e]=t}}function ae(t){return"function"==typeof t?t:(t=e.ns.qualify(t)).local?function(){return this.ownerDocument.createElementNS(t.space,t.local)}:function(){var e=this.ownerDocument,r=this.namespaceURI;return r===Y&&e.documentElement.namespaceURI===Y?e.createElement(t):e.createElementNS(r,t)}}function ie(){var e=this.parentNode;e&&e.removeChild(this)}function oe(e){return{__data__:e}}function le(e){return function(){return U(this,e)}}function se(e,t){for(var r=0,n=e.length;r<n;r++)for(var a,i=e[r],o=0,l=i.length;o<l;o++)(a=i[o])&&t(a,o,r);return e}function ce(e){return B(e,ue),e}e.ns={prefix:W,qualify:function(e){var t=e.indexOf(":"),r=e;return t>=0&&"xmlns"!==(r=e.slice(0,t))&&(e=e.slice(t+1)),W.hasOwnProperty(r)?{space:W[r],local:e}:e}},G.attr=function(t,r){if(arguments.length<2){if("string"==typeof t){var n=this.node();return(t=e.ns.qualify(t)).local?n.getAttributeNS(t.space,t.local):n.getAttribute(t)}for(r in t)this.each(J(r,t[r]));return this}return this.each(J(t,r))},G.classed=function(e,t){if(arguments.length<2){if("string"==typeof e){var r=this.node(),n=(e=K(e)).length,a=-1;if(t=r.classList){for(;++a<n;)if(!t.contains(e[a]))return!1}else for(t=r.getAttribute("class");++a<n;)if(!Q(e[a]).test(t))return!1;return!0}for(t in e)this.each(ee(t,e[t]));return this}return this.each(ee(e,t))},G.style=function(e,t,r){var n=arguments.length;if(n<3){if("string"!=typeof e){for(r in n<2&&(t=""),e)this.each(re(r,e[r],t));return this}if(n<2){var a=this.node();return o(a).getComputedStyle(a,null).getPropertyValue(e)}r=""}return this.each(re(e,t,r))},G.property=function(e,t){if(arguments.length<2){if("string"==typeof e)return this.node()[e];for(t in e)this.each(ne(t,e[t]));return this}return this.each(ne(e,t))},G.text=function(e){return arguments.length?this.each("function"==typeof e?function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}:null==e?function(){this.textContent=""}:function(){this.textContent=e}):this.node().textContent},G.html=function(e){return arguments.length?this.each("function"==typeof e?function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}:null==e?function(){this.innerHTML=""}:function(){this.innerHTML=e}):this.node().innerHTML},G.append=function(e){return e=ae(e),this.select((function(){return this.appendChild(e.apply(this,arguments))}))},G.insert=function(e,t){return e=ae(e),t=Z(t),this.select((function(){return this.insertBefore(e.apply(this,arguments),t.apply(this,arguments)||null)}))},G.remove=function(){return this.each(ie)},G.data=function(e,t){var r,n,a=-1,i=this.length;if(!arguments.length){for(e=new Array(i=(r=this[0]).length);++a<i;)(n=r[a])&&(e[a]=n.__data__);return e}function o(e,r){var n,a,i,o=e.length,u=r.length,f=Math.min(o,u),d=new Array(u),p=new Array(u),h=new Array(o);if(t){var g,v=new b,m=new Array(o);for(n=-1;++n<o;)(a=e[n])&&(v.has(g=t.call(a,a.__data__,n))?h[n]=a:v.set(g,a),m[n]=g);for(n=-1;++n<u;)(a=v.get(g=t.call(r,i=r[n],n)))?!0!==a&&(d[n]=a,a.__data__=i):p[n]=oe(i),v.set(g,!0);for(n=-1;++n<o;)n in m&&!0!==v.get(m[n])&&(h[n]=e[n])}else{for(n=-1;++n<f;)a=e[n],i=r[n],a?(a.__data__=i,d[n]=a):p[n]=oe(i);for(;n<u;++n)p[n]=oe(r[n]);for(;n<o;++n)h[n]=e[n]}p.update=d,p.parentNode=d.parentNode=h.parentNode=e.parentNode,l.push(p),s.push(d),c.push(h)}var l=ce([]),s=j([]),c=j([]);if("function"==typeof e)for(;++a<i;)o(r=this[a],e.call(r,r.parentNode.__data__,a));else for(;++a<i;)o(r=this[a],e);return s.enter=function(){return l},s.exit=function(){return c},s},G.datum=function(e){return arguments.length?this.property("__data__",e):this.property("__data__")},G.filter=function(e){var t,r,n,a=[];"function"!=typeof e&&(e=le(e));for(var i=0,o=this.length;i<o;i++){a.push(t=[]),t.parentNode=(r=this[i]).parentNode;for(var l=0,s=r.length;l<s;l++)(n=r[l])&&e.call(n,n.__data__,l,i)&&t.push(n)}return j(a)},G.order=function(){for(var e=-1,t=this.length;++e<t;)for(var r,n=this[e],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},G.sort=function(e){e=function(e){return arguments.length||(e=d),function(t,r){return t&&r?e(t.__data__,r.__data__):!t-!r}}.apply(this,arguments);for(var t=-1,r=this.length;++t<r;)this[t].sort(e);return this.order()},G.each=function(e){return se(this,(function(t,r,n){e.call(t,t.__data__,r,n)}))},G.call=function(e){var t=n(arguments);return e.apply(t[0]=this,t),this},G.empty=function(){return!this.node()},G.node=function(){for(var e=0,t=this.length;e<t;e++)for(var r=this[e],n=0,a=r.length;n<a;n++){var i=r[n];if(i)return i}return null},G.size=function(){var e=0;return se(this,(function(){++e})),e};var ue=[];function fe(t,r,a){var i="__on"+t,o=t.indexOf("."),l=pe;o>0&&(t=t.slice(0,o));var s=de.get(t);function c(){var e=this[i];e&&(this.removeEventListener(t,e,e.$),delete this[i])}return s&&(t=s,l=he),o?r?function(){var e=l(r,n(arguments));c.call(this),this.addEventListener(t,this[i]=e,e.$=a),e._=r}:c:r?z:function(){var r,n=new RegExp("^__on([^.]+)"+e.requote(t)+"$");for(var a in this)if(r=a.match(n)){var i=this[a];this.removeEventListener(r[1],i,i.$),delete this[a]}}}e.selection.enter=ce,e.selection.enter.prototype=ue,ue.append=G.append,ue.empty=G.empty,ue.node=G.node,ue.call=G.call,ue.size=G.size,ue.select=function(e){for(var t,r,n,a,i,o=[],l=-1,s=this.length;++l<s;){n=(a=this[l]).update,o.push(t=[]),t.parentNode=a.parentNode;for(var c=-1,u=a.length;++c<u;)(i=a[c])?(t.push(n[c]=r=e.call(a.parentNode,i.__data__,c,l)),r.__data__=i.__data__):t.push(null)}return j(o)},ue.insert=function(e,t){return arguments.length<2&&(t=function(e){var t,r;return function(n,a,i){var o,l=e[i].update,s=l.length;for(i!=r&&(r=i,t=0),a>=t&&(t=a+1);!(o=l[t])&&++t<s;);return o}}(this)),G.insert.call(this,e,t)},e.select=function(e){var t;return"string"==typeof e?(t=[V(e,a)]).parentNode=a.documentElement:(t=[e]).parentNode=i(e),j([t])},e.selectAll=function(e){var t;return"string"==typeof e?(t=n(q(e,a))).parentNode=a.documentElement:(t=n(e)).parentNode=null,j([t])},G.on=function(e,t,r){var n=arguments.length;if(n<3){if("string"!=typeof e){for(r in n<2&&(t=!1),e)this.each(fe(r,e[r],t));return this}if(n<2)return(n=this.node()["__on"+e])&&n._;r=!1}return this.each(fe(e,t,r))};var de=e.map({mouseenter:"mouseover",mouseleave:"mouseout"});function pe(t,r){return function(n){var a=e.event;e.event=n,r[0]=this.__data__;try{t.apply(this,r)}finally{e.event=a}}}function he(e,t){var r=pe(e,t);return function(e){var t=e.relatedTarget;t&&(t===this||8&t.compareDocumentPosition(this))||r.call(this,e)}}a&&de.forEach((function(e){"on"+e in a&&de.remove(e)}));var ge,ve=0;function me(t){var r=".dragsuppress-"+ ++ve,n="click"+r,a=e.select(o(t)).on("touchmove"+r,I).on("dragstart"+r,I).on("selectstart"+r,I);if(null==ge&&(ge=!("onselectstart"in t)&&P(t.style,"userSelect")),ge){var l=i(t).style,s=l[ge];l[ge]="none"}return function(e){if(a.on(r,null),ge&&(l[ge]=s),e){var t=function(){a.on(n,null)};a.on(n,(function(){I(),t()}),!0),setTimeout(t,0)}}}e.mouse=function(e){return xe(e,F())};var ye=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function xe(t,r){r.changedTouches&&(r=r.changedTouches[0]);var n=t.ownerSVGElement||t;if(n.createSVGPoint){var a=n.createSVGPoint();if(ye<0){var i=o(t);if(i.scrollX||i.scrollY){var l=(n=e.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important"))[0][0].getScreenCTM();ye=!(l.f||l.e),n.remove()}}return ye?(a.x=r.pageX,a.y=r.pageY):(a.x=r.clientX,a.y=r.clientY),[(a=a.matrixTransform(t.getScreenCTM().inverse())).x,a.y]}var s=t.getBoundingClientRect();return[r.clientX-s.left-t.clientLeft,r.clientY-s.top-t.clientTop]}function be(){return e.event.changedTouches[0].identifier}e.touch=function(e,t,r){if(arguments.length<3&&(r=t,t=F().changedTouches),t)for(var n,a=0,i=t.length;a<i;++a)if((n=t[a]).identifier===r)return xe(e,n)},e.behavior.drag=function(){var t=N(i,"drag","dragstart","dragend"),r=null,n=l(z,e.mouse,o,"mousemove","mouseup"),a=l(be,e.touch,C,"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=this,u=e.event.target.correspondingElement||e.event.target,f=c.parentNode,d=t.of(c,arguments),p=0,h=n(),g=".drag"+(null==h?"":"-"+h),v=e.select(i(u)).on(o+g,(function(){var e,t,r=a(f,h);r&&(e=r[0]-y[0],t=r[1]-y[1],p|=e|t,y=r,d({type:"drag",x:r[0]+s[0],y:r[1]+s[1],dx:e,dy:t}))})).on(l+g,(function(){a(f,h)&&(v.on(o+g,null).on(l+g,null),m(p),d({type:"dragend"}))})),m=me(u),y=a(f,h);s=r?[(s=r.apply(c,arguments)).x-y[0],s.y-y[1]]:[0,0],d({type:"dragstart"})}}return i.origin=function(e){return arguments.length?(r=e,i):r},e.rebind(i,t,"on")},e.touches=function(e,t){return arguments.length<2&&(t=F().touches),t?n(t).map((function(t){var r=xe(e,t);return r.identifier=t.identifier,r})):[]};var _e=1e-6,we=1e-12,ke=Math.PI,Te=2*ke,Me=Te-_e,Ae=ke/2,Le=ke/180,Se=180/ke;function Ce(e){return e>0?1:e<0?-1:0}function Oe(e,t,r){return(t[0]-e[0])*(r[1]-e[1])-(t[1]-e[1])*(r[0]-e[0])}function Pe(e){return e>1?0:e<-1?ke:Math.acos(e)}function De(e){return e>1?Ae:e<-1?-Ae:Math.asin(e)}function ze(e){return((e=Math.exp(e))+1/e)/2}function Ee(e){return(e=Math.sin(e/2))*e}var Re=Math.SQRT2;e.interpolateZoom=function(e,t){var r,n,a=e[0],i=e[1],o=e[2],l=t[0],s=t[1],c=t[2],u=l-a,f=s-i,d=u*u+f*f;if(d<we)n=Math.log(c/o)/Re,r=function(e){return[a+e*u,i+e*f,o*Math.exp(Re*e*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)/Re,r=function(e){var t,r=e*n,l=ze(v),s=o/(2*p)*(l*(t=Re*r+v,((t=Math.exp(2*t))-1)/(t+1))-function(e){return((e=Math.exp(e))-1/e)/2}(v));return[a+s*u,i+s*f,o*l/ze(Re*r+v)]}}return r.duration=1e3*n,r},e.behavior.zoom=function(){var t,r,n,i,l,s,c,u,f,d={x:0,y:0,k:1},p=[960,500],h=Ne,g=250,v=0,m="mousedown.zoom",y="mousemove.zoom",x="mouseup.zoom",b="touchstart.zoom",_=N(w,"zoomstart","zoom","zoomend");function w(e){e.on(m,P).on(Fe+".zoom",z).on("dblclick.zoom",E).on(b,D)}function k(e){return[(e[0]-d.x)/d.k,(e[1]-d.y)/d.k]}function T(e){d.k=Math.max(h[0],Math.min(h[1],e))}function M(e,t){t=function(e){return[e[0]*d.k+d.x,e[1]*d.k+d.y]}(t),d.x+=e[0]-t[0],d.y+=e[1]-t[1]}function A(t,n,a,i){t.__chart__={x:d.x,y:d.y,k:d.k},T(Math.pow(2,i)),M(r=n,a),t=e.select(t),g>0&&(t=t.transition().duration(g)),t.call(w.event)}function L(){c&&c.domain(s.range().map((function(e){return(e-d.x)/d.k})).map(s.invert)),f&&f.domain(u.range().map((function(e){return(e-d.y)/d.k})).map(u.invert))}function S(e){v++||e({type:"zoomstart"})}function C(e){L(),e({type:"zoom",scale:d.k,translate:[d.x,d.y]})}function O(e){--v||(e({type:"zoomend"}),r=null)}function P(){var t=this,r=_.of(t,arguments),n=0,a=e.select(o(t)).on(y,(function(){n=1,M(e.mouse(t),i),C(r)})).on(x,(function(){a.on(y,null).on(x,null),l(n),O(r)})),i=k(e.mouse(t)),l=me(t);al.call(t),S(r)}function D(){var t,r=this,n=_.of(r,arguments),a={},i=0,o=".zoom-"+e.event.changedTouches[0].identifier,s="touchmove"+o,c="touchend"+o,u=[],f=e.select(r),p=me(r);function h(){var n=e.touches(r);return t=d.k,n.forEach((function(e){e.identifier in a&&(a[e.identifier]=k(e))})),n}function g(){var t=e.event.target;e.select(t).on(s,v).on(c,y),u.push(t);for(var n=e.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),I()}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=e.touches(r);al.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*t)}l=null,M(o,s),C(n)}function y(){if(e.event.touches.length){for(var t=e.event.changedTouches,r=0,i=t.length;r<i;++r)delete a[t[r].identifier];for(var l in a)return void h()}e.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):(al.call(this),t=k(r=n||e.mouse(this)),S(a)),i=setTimeout((function(){i=null,O(a)}),50),I(),T(Math.pow(2,.002*Ie())*d.k),M(r,t),C(a)}function E(){var t=e.mouse(this),r=Math.log(d.k)/Math.LN2;A(this,t,k(t),e.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}return Fe||(Fe="onwheel"in a?(Ie=function(){return-e.event.deltaY*(e.event.deltaMode?120:1)},"wheel"):"onmousewheel"in a?(Ie=function(){return e.event.wheelDelta},"mousewheel"):(Ie=function(){return-e.event.detail},"MozMousePixelScroll")),w.event=function(t){t.each((function(){var t=_.of(this,arguments),n=d;ll?e.select(this).transition().each("start.zoom",(function(){d=this.__chart__||{x:0,y:0,k:1},S(t)})).tween("zoom:zoom",(function(){var a=p[0],i=p[1],o=r?r[0]:a/2,l=r?r[1]:i/2,s=e.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(e){var r=s(e),n=a/r[2];this.__chart__=d={x:o-r[0]*n,y:l-r[1]*n,k:n},C(t)}})).each("interrupt.zoom",(function(){O(t)})).each("end.zoom",(function(){O(t)})):(this.__chart__=d,S(t),C(t),O(t))}))},w.translate=function(e){return arguments.length?(d={x:+e[0],y:+e[1],k:d.k},L(),w):[d.x,d.y]},w.scale=function(e){return arguments.length?(d={x:d.x,y:d.y,k:null},T(+e),L(),w):d.k},w.scaleExtent=function(e){return arguments.length?(h=null==e?Ne:[+e[0],+e[1]],w):h},w.center=function(e){return arguments.length?(n=e&&[+e[0],+e[1]],w):n},w.size=function(e){return arguments.length?(p=e&&[+e[0],+e[1]],w):p},w.duration=function(e){return arguments.length?(g=+e,w):g},w.x=function(e){return arguments.length?(c=e,s=e.copy(),d={x:0,y:0,k:1},w):c},w.y=function(e){return arguments.length?(f=e,u=e.copy(),d={x:0,y:0,k:1},w):f},e.rebind(w,_,"on")};var Ie,Fe,Ne=[0,1/0];function He(){}function Be(e,t,r){return this instanceof Be?(this.h=+e,this.s=+t,void(this.l=+r)):arguments.length<2?e instanceof Be?new Be(e.h,e.s,e.l):at(""+e,it,Be):new Be(e,t,r)}e.color=He,He.prototype.toString=function(){return this.rgb()+""},e.hsl=Be;var je=Be.prototype=new He;function Ve(e,t,r){var n,a;function i(e){return Math.round(255*function(e){return e>360?e-=360:e<0&&(e+=360),e<60?n+(a-n)*e/60:e<180?a:e<240?n+(a-n)*(240-e)/60:n}(e))}return e=isNaN(e)?0:(e%=360)<0?e+360:e,t=isNaN(t)||t<0?0:t>1?1:t,n=2*(r=r<0?0:r>1?1:r)-(a=r<=.5?r*(1+t):r+t-r*t),new Ke(i(e+120),i(e),i(e-120))}function qe(t,r,n){return this instanceof qe?(this.h=+t,this.c=+r,void(this.l=+n)):arguments.length<2?t instanceof qe?new qe(t.h,t.c,t.l):function(e,t,r){return e>0?new qe(Math.atan2(r,t)*Se,Math.sqrt(t*t+r*r),e):new qe(NaN,NaN,e)}(t instanceof Ze?t.l:(t=ot((t=e.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new qe(t,r,n)}je.brighter=function(e){return e=Math.pow(.7,arguments.length?e:1),new Be(this.h,this.s,this.l/e)},je.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),new Be(this.h,this.s,e*this.l)},je.rgb=function(){return Ve(this.h,this.s,this.l)},e.hcl=qe;var Ue=qe.prototype=new He;function Ge(e,t,r){return isNaN(e)&&(e=0),isNaN(t)&&(t=0),new Ze(r,Math.cos(e*=Le)*t,Math.sin(e)*t)}function Ze(e,t,r){return this instanceof Ze?(this.l=+e,this.a=+t,void(this.b=+r)):arguments.length<2?e instanceof Ze?new Ze(e.l,e.a,e.b):e instanceof qe?Ge(e.h,e.c,e.l):ot((e=Ke(e)).r,e.g,e.b):new Ze(e,t,r)}Ue.brighter=function(e){return new qe(this.h,this.c,Math.min(100,this.l+Xe*(arguments.length?e:1)))},Ue.darker=function(e){return new qe(this.h,this.c,Math.max(0,this.l-Xe*(arguments.length?e:1)))},Ue.rgb=function(){return Ge(this.h,this.c,this.l).rgb()},e.lab=Ze;var Xe=18,Ye=Ze.prototype=new He;function We(e,t,r){var n=(e+16)/116,a=n+t/500,i=n-r/200;return new Ke(Qe(3.2404542*(a=.95047*Je(a))-1.5371385*(n=1*Je(n))-.4985314*(i=1.08883*Je(i))),Qe(-.969266*a+1.8760108*n+.041556*i),Qe(.0556434*a-.2040259*n+1.0572252*i))}function Je(e){return e>.206893034?e*e*e:(e-4/29)/7.787037}function $e(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29}function Qe(e){return Math.round(255*(e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055))}function Ke(e,t,r){return this instanceof Ke?(this.r=~~e,this.g=~~t,void(this.b=~~r)):arguments.length<2?e instanceof Ke?new Ke(e.r,e.g,e.b):at(""+e,Ke,Ve):new Ke(e,t,r)}function et(e){return new Ke(e>>16,e>>8&255,255&e)}function tt(e){return et(e)+""}Ye.brighter=function(e){return new Ze(Math.min(100,this.l+Xe*(arguments.length?e:1)),this.a,this.b)},Ye.darker=function(e){return new Ze(Math.max(0,this.l-Xe*(arguments.length?e:1)),this.a,this.b)},Ye.rgb=function(){return We(this.l,this.a,this.b)},e.rgb=Ke;var rt=Ke.prototype=new He;function nt(e){return e<16?"0"+Math.max(0,e).toString(16):Math.min(255,e).toString(16)}function at(e,t,r){var n,a,i,o=0,l=0,s=0;if(n=/([a-z]+)\((.*)\)/.exec(e=e.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 t(st(a[0]),st(a[1]),st(a[2]))}return(i=ct.get(e))?t(i.r,i.g,i.b):(null==e||"#"!==e.charAt(0)||isNaN(i=parseInt(e.slice(1),16))||(4===e.length?(o=(3840&i)>>4,o|=o>>4,l=240&i,l|=l>>4,s=15&i,s|=s<<4):7===e.length&&(o=(16711680&i)>>16,l=(65280&i)>>8,s=255&i)),t(o,l,s))}function it(e,t,r){var n,a,i=Math.min(e/=255,t/=255,r/=255),o=Math.max(e,t,r),l=o-i,s=(o+i)/2;return l?(a=s<.5?l/(o+i):l/(2-o-i),n=e==o?(t-r)/l+(t<r?6:0):t==o?(r-e)/l+2:(e-t)/l+4,n*=60):(n=NaN,a=s>0&&s<1?0:n),new Be(n,a,s)}function ot(e,t,r){var n=$e((.4124564*(e=lt(e))+.3575761*(t=lt(t))+.1804375*(r=lt(r)))/.95047),a=$e((.2126729*e+.7151522*t+.072175*r)/1);return Ze(116*a-16,500*(n-a),200*(a-$e((.0193339*e+.119192*t+.9503041*r)/1.08883)))}function lt(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function st(e){var t=parseFloat(e);return"%"===e.charAt(e.length-1)?Math.round(2.55*t):t}rt.brighter=function(e){e=Math.pow(.7,arguments.length?e:1);var t=this.r,r=this.g,n=this.b,a=30;return t||r||n?(t&&t<a&&(t=a),r&&r<a&&(r=a),n&&n<a&&(n=a),new Ke(Math.min(255,t/e),Math.min(255,r/e),Math.min(255,n/e))):new Ke(a,a,a)},rt.darker=function(e){return new Ke((e=Math.pow(.7,arguments.length?e:1))*this.r,e*this.g,e*this.b)},rt.hsl=function(){return it(this.r,this.g,this.b)},rt.toString=function(){return"#"+nt(this.r)+nt(this.g)+nt(this.b)};var ct=e.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 ut(e){return"function"==typeof e?e:function(){return e}}function ft(e){return function(t,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=null),dt(t,r,e,n)}}function dt(t,r,a,i){var o={},l=e.dispatch("beforesend","progress","load","error"),s={},c=new XMLHttpRequest,u=null;function f(){var e,t=c.status;if(!t&&function(e){var t=e.responseType;return t&&"text"!==t?e.response:e.responseText}(c)||t>=200&&t<300||304===t){try{e=a.call(o,c)}catch(e){return void l.error.call(o,e)}l.load.call(o,e)}else l.error.call(o,c)}return this.XDomainRequest&&!("withCredentials"in c)&&/^(http(s)?:)?\/\//.test(t)&&(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=f:c.onreadystatechange=function(){c.readyState>3&&f()},c.onprogress=function(t){var r=e.event;e.event=t;try{l.progress.call(o,c)}finally{e.event=r}},o.header=function(e,t){return e=(e+"").toLowerCase(),arguments.length<2?s[e]:(null==t?delete s[e]:s[e]=t+"",o)},o.mimeType=function(e){return arguments.length?(r=null==e?null:e+"",o):r},o.responseType=function(e){return arguments.length?(u=e,o):u},o.response=function(e){return a=e,o},["get","post"].forEach((function(e){o[e]=function(){return o.send.apply(o,[e].concat(n(arguments)))}})),o.send=function(e,n,a){if(2===arguments.length&&"function"==typeof n&&(a=n,n=null),c.open(e,t,!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(e){a(null,e)})),l.beforesend.call(o,c),c.send(null==n?null:n),o},o.abort=function(){return c.abort(),o},e.rebind(o,l,"on"),null==i?o:o.get(function(e){return 1===e.length?function(t,r){e(null==t?r:null)}:e}(i))}ct.forEach((function(e,t){ct.set(e,et(t))})),e.functor=ut,e.xhr=ft(C),e.dsv=function(e,t){var r=new RegExp('["'+e+"\n]"),n=e.charCodeAt(0);function a(e,r,n){arguments.length<3&&(n=r,r=null);var a=dt(e,t,null==r?i:o(r),n);return a.row=function(e){return arguments.length?a.response(null==(r=e)?i:o(e)):r},a}function i(e){return a.parse(e.responseText)}function o(e){return function(t){return a.parse(t.responseText,e)}}function l(t){return t.map(s).join(e)}function s(e){return r.test(e)?'"'+e.replace(/\"/g,'""')+'"':e}return a.parse=function(e,t){var r;return a.parseRows(e,(function(e,n){if(r)return r(e,n-1);var a=new Function("d","return {"+e.map((function(e,t){return JSON.stringify(e)+": d["+t+"]"})).join(",")+"}");r=t?function(e,r){return t(a(e),r)}:a}))},a.parseRows=function(e,t){var r,a,i={},o={},l=[],s=e.length,c=0,u=0;function f(){if(c>=s)return o;if(a)return a=!1,i;var t=c;if(34===e.charCodeAt(t)){for(var r=t;r++<s;)if(34===e.charCodeAt(r)){if(34!==e.charCodeAt(r+1))break;++r}return c=r+2,13===(l=e.charCodeAt(r+1))?(a=!0,10===e.charCodeAt(r+2)&&++c):10===l&&(a=!0),e.slice(t+1,r).replace(/""/g,'"')}for(;c<s;){var l,u=1;if(10===(l=e.charCodeAt(c++)))a=!0;else if(13===l)a=!0,10===e.charCodeAt(c)&&(++c,++u);else if(l!==n)continue;return e.slice(t,c-u)}return e.slice(t)}for(;(r=f())!==o;){for(var d=[];r!==i&&r!==o;)d.push(r),r=f();t&&null==(d=t(d,u++))||l.push(d)}return l},a.format=function(t){if(Array.isArray(t[0]))return a.formatRows(t);var r=new S,n=[];return t.forEach((function(e){for(var t in e)r.has(t)||n.push(r.add(t))})),[n.map(s).join(e)].concat(t.map((function(t){return n.map((function(e){return s(t[e])})).join(e)}))).join("\n")},a.formatRows=function(e){return e.map(l).join("\n")},a},e.csv=e.dsv(",","text/csv"),e.tsv=e.dsv("\t","text/tab-separated-values");var pt,ht,gt,vt,mt=this[P(this,"requestAnimationFrame")]||function(e){setTimeout(e,17)};function yt(e,t,r){var n=arguments.length;n<2&&(t=0),n<3&&(r=Date.now());var a=r+t,i={c:e,t:a,n:null};return ht?ht.n=i:pt=i,ht=i,gt||(vt=clearTimeout(vt),gt=1,mt(xt)),i}function xt(){var e=bt(),t=_t()-e;t>24?(isFinite(t)&&(clearTimeout(vt),vt=setTimeout(xt,t)),gt=0):(gt=1,mt(xt))}function bt(){for(var e=Date.now(),t=pt;t;)e>=t.t&&t.c(e-t.t)&&(t.c=null),t=t.n;return e}function _t(){for(var e,t=pt,r=1/0;t;)t.c?(t.t<r&&(r=t.t),t=(e=t).n):t=e?e.n=t.n:pt=t.n;return ht=e,r}function wt(e,t){return t-(e?Math.ceil(Math.log(e)/Math.LN10):1)}e.timer=function(){yt.apply(this,arguments)},e.timer.flush=function(){bt(),_t()},e.round=function(e,t){return t?Math.round(e*(t=Math.pow(10,t)))/t:Math.round(e)};var kt=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map((function(e,t){var r=Math.pow(10,3*y(8-t));return{scale:t>8?function(e){return e/r}:function(e){return e*r},symbol:e}}));function Tt(t){var r=t.decimal,n=t.thousands,a=t.grouping,i=t.currency,o=a&&n?function(e,t){for(var r=e.length,i=[],o=0,l=a[0],s=0;r>0&&l>0&&(s+l+1>t&&(l=Math.max(1,t-s)),i.push(e.substring(r-=l,r+l)),!((s+=l+1)>t));)l=a[o=(o+1)%a.length];return i.reverse().join(n)}:C;return function(t){var n=Mt.exec(t),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=At.get(h)||Lt;var b=u&&d;return function(t){var n=m;if(y&&t%1)return"";var i=t<0||0===t&&1/t<0?(t=-t,"-"):"-"===s?"":s;if(g<0){var c=e.formatPrefix(t,p);t=c.scale(t),n=c.symbol+m}else t*=g;var _,w,k=(t=h(t,p)).lastIndexOf(".");if(k<0){var T=x?t.lastIndexOf("e"):-1;T<0?(_=t,w=""):(_=t.substring(0,T),w=t.substring(T))}else _=t.substring(0,k),w=r+t.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,t=_+w,("<"===l?i+t+A:">"===l?A+i+t:"^"===l?A.substring(0,M>>=1)+i+t+A.substring(M):i+(b?t:A+t))+n}}}e.formatPrefix=function(t,r){var n=0;return(t=+t)&&(t<0&&(t*=-1),r&&(t=e.round(t,wt(t,r))),n=1+Math.floor(1e-12+Math.log(t)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),kt[8+n/3]};var Mt=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,At=e.map({b:function(e){return e.toString(2)},c:function(e){return String.fromCharCode(e)},o:function(e){return e.toString(8)},x:function(e){return e.toString(16)},X:function(e){return e.toString(16).toUpperCase()},g:function(e,t){return e.toPrecision(t)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},r:function(t,r){return(t=e.round(t,wt(t,r))).toFixed(Math.max(0,Math.min(20,wt(t*(1+1e-15),r))))}});function Lt(e){return e+""}var St=e.time={},Ct=Date;function Ot(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}Ot.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(){Pt.setUTCDate.apply(this._,arguments)},setDay:function(){Pt.setUTCDay.apply(this._,arguments)},setFullYear:function(){Pt.setUTCFullYear.apply(this._,arguments)},setHours:function(){Pt.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Pt.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Pt.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Pt.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Pt.setUTCSeconds.apply(this._,arguments)},setTime:function(){Pt.setTime.apply(this._,arguments)}};var Pt=Date.prototype;function Dt(e,t,r){function n(t){var r=e(t),n=i(r,1);return t-r<n-t?r:n}function a(r){return t(r=e(new Ct(r-1)),1),r}function i(e,r){return t(e=new Ct(+e),r),e}function o(e,n,i){var o=a(e),l=[];if(i>1)for(;o<n;)r(o)%i||l.push(new Date(+o)),t(o,1);else for(;o<n;)l.push(new Date(+o)),t(o,1);return l}e.floor=e,e.round=n,e.ceil=a,e.offset=i,e.range=o;var l=e.utc=zt(e);return l.floor=l,l.round=zt(n),l.ceil=zt(a),l.offset=zt(i),l.range=function(e,t,r){try{Ct=Ot;var n=new Ot;return n._=e,o(n,t,r)}finally{Ct=Date}},e}function zt(e){return function(t,r){try{Ct=Ot;var n=new Ot;return n._=t,e(n,r)._}finally{Ct=Date}}}function Et(t){var r=t.dateTime,n=t.date,a=t.time,i=t.periods,o=t.days,l=t.shortDays,s=t.months,c=t.shortMonths;function u(e){var t=e.length;function r(r){for(var n,a,i,o=[],l=-1,s=0;++l<t;)37===e.charCodeAt(l)&&(o.push(e.slice(s,l)),null!=(a=Rt[n=e.charAt(++l)])&&(n=e.charAt(++l)),(i=_[n])&&(n=i(r,null==a?"e"===n?" ":"0":a)),o.push(n),s=l+1);return o.push(e.slice(s,l)),o.join("")}return r.parse=function(t){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null};if(f(r,e,t,0)!=t.length)return null;"p"in r&&(r.H=r.H%12+12*r.p);var n=null!=r.Z&&Ct!==Ot,a=new(n?Ot:Ct);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 e},r}function f(e,t,r,n){for(var a,i,o,l=0,s=t.length,c=r.length;l<s;){if(n>=c)return-1;if(37===(a=t.charCodeAt(l++))){if(o=t.charAt(l++),!(i=w[o in Rt?t.charAt(l++):o])||(n=i(e,r,n))<0)return-1}else if(a!=r.charCodeAt(n++))return-1}return n}u.utc=function(e){var t=u(e);function r(e){try{var r=new(Ct=Ot);return r._=e,t(r)}finally{Ct=Date}}return r.parse=function(e){try{Ct=Ot;var r=t.parse(e);return r&&r._}finally{Ct=Date}},r.toString=t.toString,r},u.multi=u.utc.multi=rr;var d=e.map(),p=Ht(o),h=Bt(o),g=Ht(l),v=Bt(l),m=Ht(s),y=Bt(s),x=Ht(c),b=Bt(c);i.forEach((function(e,t){d.set(e.toLowerCase(),t)}));var _={a:function(e){return l[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return c[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:u(r),d:function(e,t){return Nt(e.getDate(),t,2)},e:function(e,t){return Nt(e.getDate(),t,2)},H:function(e,t){return Nt(e.getHours(),t,2)},I:function(e,t){return Nt(e.getHours()%12||12,t,2)},j:function(e,t){return Nt(1+St.dayOfYear(e),t,3)},L:function(e,t){return Nt(e.getMilliseconds(),t,3)},m:function(e,t){return Nt(e.getMonth()+1,t,2)},M:function(e,t){return Nt(e.getMinutes(),t,2)},p:function(e){return i[+(e.getHours()>=12)]},S:function(e,t){return Nt(e.getSeconds(),t,2)},U:function(e,t){return Nt(St.sundayOfYear(e),t,2)},w:function(e){return e.getDay()},W:function(e,t){return Nt(St.mondayOfYear(e),t,2)},x:u(n),X:u(a),y:function(e,t){return Nt(e.getFullYear()%100,t,2)},Y:function(e,t){return Nt(e.getFullYear()%1e4,t,4)},Z:er,"%":function(){return"%"}},w={a:function(e,t,r){g.lastIndex=0;var n=g.exec(t.slice(r));return n?(e.w=v.get(n[0].toLowerCase()),r+n[0].length):-1},A:function(e,t,r){p.lastIndex=0;var n=p.exec(t.slice(r));return n?(e.w=h.get(n[0].toLowerCase()),r+n[0].length):-1},b:function(e,t,r){x.lastIndex=0;var n=x.exec(t.slice(r));return n?(e.m=b.get(n[0].toLowerCase()),r+n[0].length):-1},B:function(e,t,r){m.lastIndex=0;var n=m.exec(t.slice(r));return n?(e.m=y.get(n[0].toLowerCase()),r+n[0].length):-1},c:function(e,t,r){return f(e,_.c.toString(),t,r)},d:Yt,e:Yt,H:Jt,I:Jt,j:Wt,L:Kt,m:Xt,M:$t,p:function(e,t,r){var n=d.get(t.slice(r,r+=2).toLowerCase());return null==n?-1:(e.p=n,r)},S:Qt,U:Vt,w:jt,W:qt,x:function(e,t,r){return f(e,_.x.toString(),t,r)},X:function(e,t,r){return f(e,_.X.toString(),t,r)},y:Gt,Y:Ut,Z:Zt,"%":tr};return u}St.year=Dt((function(e){return(e=St.day(e)).setMonth(0,1),e}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e){return e.getFullYear()})),St.years=St.year.range,St.years.utc=St.year.utc.range,St.day=Dt((function(e){var t=new Ct(2e3,0);return t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t}),(function(e,t){e.setDate(e.getDate()+t)}),(function(e){return e.getDate()-1})),St.days=St.day.range,St.days.utc=St.day.utc.range,St.dayOfYear=function(e){var t=St.year(e);return Math.floor((e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach((function(e,t){t=7-t;var r=St[e]=Dt((function(e){return(e=St.day(e)).setDate(e.getDate()-(e.getDay()+t)%7),e}),(function(e,t){e.setDate(e.getDate()+7*Math.floor(t))}),(function(e){var r=St.year(e).getDay();return Math.floor((St.dayOfYear(e)+(r+t)%7)/7)-(r!==t)}));St[e+"s"]=r.range,St[e+"s"].utc=r.utc.range,St[e+"OfYear"]=function(e){var r=St.year(e).getDay();return Math.floor((St.dayOfYear(e)+(r+t)%7)/7)}})),St.week=St.sunday,St.weeks=St.sunday.range,St.weeks.utc=St.sunday.utc.range,St.weekOfYear=St.sundayOfYear;var Rt={"-":"",_:" ",0:"0"},It=/^\s*\d+/,Ft=/^%/;function Nt(e,t,r){var n=e<0?"-":"",a=(n?-e:e)+"",i=a.length;return n+(i<r?new Array(r-i+1).join(t)+a:a)}function Ht(t){return new RegExp("^(?:"+t.map(e.requote).join("|")+")","i")}function Bt(e){for(var t=new b,r=-1,n=e.length;++r<n;)t.set(e[r].toLowerCase(),r);return t}function jt(e,t,r){It.lastIndex=0;var n=It.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function Vt(e,t,r){It.lastIndex=0;var n=It.exec(t.slice(r));return n?(e.U=+n[0],r+n[0].length):-1}function qt(e,t,r){It.lastIndex=0;var n=It.exec(t.slice(r));return n?(e.W=+n[0],r+n[0].length):-1}function Ut(e,t,r){It.lastIndex=0;var n=It.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function Gt(e,t,r){It.lastIndex=0;var n,a=It.exec(t.slice(r,r+2));return a?(e.y=(n=+a[0])+(n>68?1900:2e3),r+a[0].length):-1}function Zt(e,t,r){return/^[+-]\d{4}$/.test(t=t.slice(r,r+5))?(e.Z=-t,r+5):-1}function Xt(e,t,r){It.lastIndex=0;var n=It.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function Yt(e,t,r){It.lastIndex=0;var n=It.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function Wt(e,t,r){It.lastIndex=0;var n=It.exec(t.slice(r,r+3));return n?(e.j=+n[0],r+n[0].length):-1}function Jt(e,t,r){It.lastIndex=0;var n=It.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function $t(e,t,r){It.lastIndex=0;var n=It.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function Qt(e,t,r){It.lastIndex=0;var n=It.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function Kt(e,t,r){It.lastIndex=0;var n=It.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function er(e){var t=e.getTimezoneOffset(),r=t>0?"-":"+",n=y(t)/60|0,a=y(t)%60;return r+Nt(n,"0",2)+Nt(a,"0",2)}function tr(e,t,r){Ft.lastIndex=0;var n=Ft.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function rr(e){for(var t=e.length,r=-1;++r<t;)e[r][0]=this(e[r][0]);return function(t){for(var r=0,n=e[r];!n[1](t);)n=e[++r];return n[0](t)}}e.locale=function(e){return{numberFormat:Tt(e),timeFormat:Et(e)}};var nr=e.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 ar(){}e.format=nr.numberFormat,e.geo={},ar.prototype={s:0,t:0,add:function(e){or(e,this.t,ir),or(ir.s,this.s,this),this.s?this.t+=ir.t:this.s=ir.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var ir=new ar;function or(e,t,r){var n=r.s=e+t,a=n-e,i=n-a;r.t=e-i+(t-a)}function lr(e,t){e&&cr.hasOwnProperty(e.type)&&cr[e.type](e,t)}e.geo.stream=function(e,t){e&&sr.hasOwnProperty(e.type)?sr[e.type](e,t):lr(e,t)};var sr={Feature:function(e,t){lr(e.geometry,t)},FeatureCollection:function(e,t){for(var r=e.features,n=-1,a=r.length;++n<a;)lr(r[n].geometry,t)}},cr={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var r=e.coordinates,n=-1,a=r.length;++n<a;)e=r[n],t.point(e[0],e[1],e[2])},LineString:function(e,t){ur(e.coordinates,t,0)},MultiLineString:function(e,t){for(var r=e.coordinates,n=-1,a=r.length;++n<a;)ur(r[n],t,0)},Polygon:function(e,t){fr(e.coordinates,t)},MultiPolygon:function(e,t){for(var r=e.coordinates,n=-1,a=r.length;++n<a;)fr(r[n],t)},GeometryCollection:function(e,t){for(var r=e.geometries,n=-1,a=r.length;++n<a;)lr(r[n],t)}};function ur(e,t,r){var n,a=-1,i=e.length-r;for(t.lineStart();++a<i;)n=e[a],t.point(n[0],n[1],n[2]);t.lineEnd()}function fr(e,t){var r=-1,n=e.length;for(t.polygonStart();++r<n;)ur(e[r],t,1);t.polygonEnd()}e.geo.area=function(t){return dr=0,e.geo.stream(t,Mr),dr};var dr,pr,hr,gr,vr,mr,yr,xr,br,_r,wr,kr,Tr=new ar,Mr={sphere:function(){dr+=4*ke},point:z,lineStart:z,lineEnd:z,polygonStart:function(){Tr.reset(),Mr.lineStart=Ar},polygonEnd:function(){var e=2*Tr;dr+=e<0?4*ke+e:e,Mr.lineStart=Mr.lineEnd=Mr.point=z}};function Ar(){var e,t,r,n,a;function i(e,t){t=t*Le/2+ke/4;var i=(e*=Le)-r,o=i>=0?1:-1,l=o*i,s=Math.cos(t),c=Math.sin(t),u=a*c,f=n*s+u*Math.cos(l),d=u*o*Math.sin(l);Tr.add(Math.atan2(d,f)),r=e,n=s,a=c}Mr.point=function(o,l){Mr.point=i,r=(e=o)*Le,n=Math.cos(l=(t=l)*Le/2+ke/4),a=Math.sin(l)},Mr.lineEnd=function(){i(e,t)}}function Lr(e){var t=e[0],r=e[1],n=Math.cos(r);return[n*Math.cos(t),n*Math.sin(t),Math.sin(r)]}function Sr(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Cr(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function Or(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Pr(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Dr(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function zr(e){return[Math.atan2(e[1],e[0]),De(e[2])]}function Er(e,t){return y(e[0]-t[0])<_e&&y(e[1]-t[1])<_e}e.geo.bounds=function(){var t,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,Mr.polygonStart()},polygonEnd:function(){Mr.polygonEnd(),d.point=p,d.lineStart=g,d.lineEnd=v,Tr<0?(t=-(n=180),r=-(a=90)):c>_e?a=90:c<-_e&&(r=-90),f[0]=t,f[1]=n}};function p(e,i){u.push(f=[t=e,n=e]),i<r&&(r=i),i>a&&(a=i)}function h(e,o){var l=Lr([e*Le,o*Le]);if(s){var c=Cr(s,l),u=Cr([c[1],-c[0],0],c);Dr(u),u=zr(u);var f=e-i,d=f>0?1:-1,h=u[0]*Se*d,g=y(f)>180;if(g^(d*i<h&&h<d*e))(v=u[1]*Se)>a&&(a=v);else if(g^(d*i<(h=(h+360)%360-180)&&h<d*e)){var v;(v=-u[1]*Se)<r&&(r=v)}else o<r&&(r=o),o>a&&(a=o);g?e<i?_(t,e)>_(t,n)&&(n=e):_(e,n)>_(t,n)&&(t=e):n>=t?(e<t&&(t=e),e>n&&(n=e)):e>i?_(t,e)>_(t,n)&&(n=e):_(e,n)>_(t,n)&&(t=e)}else p(e,o);s=l,i=e}function g(){d.point=h}function v(){f[0]=t,f[1]=n,d.point=p,s=null}function m(e,t){if(s){var r=e-i;c+=y(r)>180?r+(r>0?360:-360):r}else o=e,l=t;Mr.point(e,t),h(e,t)}function x(){Mr.lineStart()}function b(){m(o,l),Mr.lineEnd(),y(c)>_e&&(t=-(n=180)),f[0]=t,f[1]=n,s=null}function _(e,t){return(t-=e)<0?t+360:t}function w(e,t){return e[0]-t[0]}function k(e,t){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}return function(i){if(a=n=-(t=r=1/0),u=[],e.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,t=p[0],n=g[1])}return u=f=null,t===1/0||r===1/0?[[NaN,NaN],[NaN,NaN]]:[[t,r],[n,a]]}}(),e.geo.centroid=function(t){pr=hr=gr=vr=mr=yr=xr=br=_r=wr=kr=0,e.geo.stream(t,Rr);var r=_r,n=wr,a=kr,i=r*r+n*n+a*a;return i<we&&(r=yr,n=xr,a=br,hr<_e&&(r=gr,n=vr,a=mr),(i=r*r+n*n+a*a)<we)?[NaN,NaN]:[Math.atan2(n,r)*Se,De(a/Math.sqrt(i))*Se]};var Rr={sphere:z,point:Ir,lineStart:Nr,lineEnd:Hr,polygonStart:function(){Rr.lineStart=Br},polygonEnd:function(){Rr.lineStart=Nr}};function Ir(e,t){e*=Le;var r=Math.cos(t*=Le);Fr(r*Math.cos(e),r*Math.sin(e),Math.sin(t))}function Fr(e,t,r){gr+=(e-gr)/++pr,vr+=(t-vr)/pr,mr+=(r-mr)/pr}function Nr(){var e,t,r;function n(n,a){n*=Le;var i=Math.cos(a*=Le),o=i*Math.cos(n),l=i*Math.sin(n),s=Math.sin(a),c=Math.atan2(Math.sqrt((c=t*s-r*l)*c+(c=r*o-e*s)*c+(c=e*l-t*o)*c),e*o+t*l+r*s);hr+=c,yr+=c*(e+(e=o)),xr+=c*(t+(t=l)),br+=c*(r+(r=s)),Fr(e,t,r)}Rr.point=function(a,i){a*=Le;var o=Math.cos(i*=Le);e=o*Math.cos(a),t=o*Math.sin(a),r=Math.sin(i),Rr.point=n,Fr(e,t,r)}}function Hr(){Rr.point=Ir}function Br(){var e,t,r,n,a;function i(e,t){e*=Le;var i=Math.cos(t*=Le),o=i*Math.cos(e),l=i*Math.sin(e),s=Math.sin(t),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&&-Pe(p)/d,g=Math.atan2(d,p);_r+=h*c,wr+=h*u,kr+=h*f,hr+=g,yr+=g*(r+(r=o)),xr+=g*(n+(n=l)),br+=g*(a+(a=s)),Fr(r,n,a)}Rr.point=function(o,l){e=o,t=l,Rr.point=i,o*=Le;var s=Math.cos(l*=Le);r=s*Math.cos(o),n=s*Math.sin(o),a=Math.sin(l),Fr(r,n,a)},Rr.lineEnd=function(){i(e,t),Rr.lineEnd=Hr,Rr.point=Ir}}function jr(e,t){function r(r,n){return r=e(r,n),t(r[0],r[1])}return e.invert&&t.invert&&(r.invert=function(r,n){return(r=t.invert(r,n))&&e.invert(r[0],r[1])}),r}function Vr(){return!0}function qr(e,t,r,n,a){var i=[],o=[];if(e.forEach((function(e){if(!((t=e.length-1)<=0)){var t,r=e[0],n=e[t];if(Er(r,n)){a.lineStart();for(var l=0;l<t;++l)a.point((r=e[l])[0],r[1]);a.lineEnd()}else{var s=new Gr(r,e,null,!0),c=new Gr(r,null,s,!1);s.o=c,i.push(s),o.push(c),s=new Gr(n,e,null,!1),c=new Gr(n,null,s,!0),s.o=c,i.push(s),o.push(c)}}})),o.sort(t),Ur(i),Ur(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 Ur(e){if(t=e.length){for(var t,r,n=0,a=e[0];++n<t;)a.n=r=e[n],r.p=a,a=r;a.n=r=e[0],r.p=a}}function Gr(e,t,r,n){this.x=e,this.z=t,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}function Zr(t,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=e.merge(l);var t=function(e,t){var r=e[0],n=e[1],a=[Math.sin(r),-Math.cos(r),0],i=0,o=0;Tr.reset();for(var l=0,s=t.length;l<s;++l){var c=t[l],u=c.length;if(u)for(var f=c[0],d=f[0],p=f[1]/2+ke/4,h=Math.sin(p),g=Math.cos(p),v=1;;){v===u&&(v=0);var m=(e=c[v])[0],y=e[1]/2+ke/4,x=Math.sin(y),b=Math.cos(y),_=m-d,w=_>=0?1:-1,k=w*_,T=k>ke,M=h*x;if(Tr.add(Math.atan2(M*w*Math.sin(k),g*b+M*Math.cos(k))),i+=T?_+w*Te:_,T^d>=r^m>=r){var A=Cr(Lr(f),Lr(e));Dr(A);var L=Cr(a,A);Dr(L);var S=(T^_>=0?-1:1)*De(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=e}}return(i<-_e||i<_e&&Tr<-_e)^1&o}(c,g);l.length?(x||(o.polygonStart(),x=!0),qr(l,Wr,t,n,o)):t&&(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(e,r){var n=i(e,r);t(e=n[0],r=n[1])&&o.point(e,r)}function d(e,t){var r=i(e,t);s.point(r[0],r[1])}function p(){u.point=d,s.lineStart()}function h(){u.point=f,s.lineEnd()}var g,v,m=Yr(),y=r(m),x=!1;function b(e,t){v.push([e,t]);var r=i(e,t);y.point(r[0],r[1])}function _(){y.lineStart(),v=[]}function w(){b(v[0][0],v[0][1]),y.lineEnd();var e,t=y.clean(),r=m.buffer(),n=r.length;if(v.pop(),g.push(v),v=null,n)if(1&t){var a,i=-1;if((n=(e=r[0]).length-1)>0){for(x||(o.polygonStart(),x=!0),o.lineStart();++i<n;)o.point((a=e[i])[0],a[1]);o.lineEnd()}}else n>1&&2&t&&r.push(r.pop().concat(r.shift())),l.push(r.filter(Xr))}return u}}function Xr(e){return e.length>1}function Yr(){var e,t=[];return{lineStart:function(){t.push(e=[])},point:function(t,r){e.push([t,r])},lineEnd:z,buffer:function(){var r=t;return t=[],e=null,r},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function Wr(e,t){return((e=e.x)[0]<0?e[1]-Ae-_e:Ae-e[1])-((t=t.x)[0]<0?t[1]-Ae-_e:Ae-t[1])}var Jr=Zr(Vr,(function(e){var t,r=NaN,n=NaN,a=NaN;return{lineStart:function(){e.lineStart(),t=1},point:function(i,o){var l=i>0?ke:-ke,s=y(i-r);y(s-ke)<_e?(e.point(r,n=(n+o)/2>0?Ae:-Ae),e.point(a,n),e.lineEnd(),e.lineStart(),e.point(l,n),e.point(i,n),t=0):a!==l&&s>=ke&&(y(r-a)<_e&&(r-=a*_e),y(i-l)<_e&&(i-=l*_e),n=function(e,t,r,n){var a,i,o=Math.sin(e-r);return y(o)>_e?Math.atan((Math.sin(t)*(i=Math.cos(n))*Math.sin(r)-Math.sin(n)*(a=Math.cos(t))*Math.sin(e))/(a*i*o)):(t+n)/2}(r,n,i,o),e.point(a,n),e.lineEnd(),e.lineStart(),e.point(l,n),t=0),e.point(r=i,n=o),a=l},lineEnd:function(){e.lineEnd(),r=n=NaN},clean:function(){return 2-t}}}),(function(e,t,r,n){var a;if(null==e)a=r*Ae,n.point(-ke,a),n.point(0,a),n.point(ke,a),n.point(ke,0),n.point(ke,-a),n.point(0,-a),n.point(-ke,-a),n.point(-ke,0),n.point(-ke,a);else if(y(e[0]-t[0])>_e){var i=e[0]<t[0]?ke:-ke;a=r*i/2,n.point(-i,a),n.point(0,a),n.point(i,a)}else n.point(t[0],t[1])}),[-ke,-ke/2]);function $r(e){var t=Math.cos(e),r=t>0,n=y(t)>_e;return Zr(a,(function(e){var t,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?ke:-ke),d):0;if(!t&&(c=s=g)&&e.lineStart(),g!==s&&(p=i(t,h),(Er(t,p)||Er(h,p))&&(h[0]+=_e,h[1]+=_e,g=a(h[0],h[1]))),g!==s)u=0,g?(e.lineStart(),p=i(h,t),e.point(p[0],p[1])):(p=i(t,h),e.point(p[0],p[1]),e.lineEnd()),t=p;else if(n&&t&&r^g){var m;v&l||!(m=i(h,t,!0))||(u=0,r?(e.lineStart(),e.point(m[0][0],m[0][1]),e.point(m[1][0],m[1][1]),e.lineEnd()):(e.point(m[1][0],m[1][1]),e.lineEnd(),e.lineStart(),e.point(m[0][0],m[0][1])))}!g||t&&Er(t,h)||e.point(h[0],h[1]),t=h,s=g,l=v},lineEnd:function(){s&&e.lineEnd(),t=null},clean:function(){return u|(c&&s)<<1}}}),Pn(e,6*Le),r?[0,-e]:[-ke,e-ke]);function a(e,r){return Math.cos(e)*Math.cos(r)>t}function i(e,r,n){var a=[1,0,0],i=Cr(Lr(e),Lr(r)),o=Sr(i,i),l=i[0],s=o-l*l;if(!s)return!n&&e;var c=t*o/s,u=-t*l/s,f=Cr(a,i),d=Pr(a,c);Or(d,Pr(i,u));var p=f,h=Sr(d,p),g=Sr(p,p),v=h*h-g*(Sr(d,d)-1);if(!(v<0)){var m=Math.sqrt(v),x=Pr(p,(-h-m)/g);if(Or(x,d),x=zr(x),!n)return x;var b,_=e[0],w=r[0],k=e[1],T=r[1];w<_&&(b=_,_=w,w=b);var M=w-_,A=y(M-ke)<_e;if(!A&&T<k&&(b=k,k=T,T=b),A||M<_e?A?k+T>0^x[1]<(y(x[0]-_)<_e?k:T):k<=x[1]&&x[1]<=T:M>ke^(_<=x[0]&&x[0]<=w)){var L=Pr(p,(-h+m)/g);return Or(L,d),[x,zr(L)]}}}function o(t,n){var a=r?e:ke-e,i=0;return t<-a?i|=1:t>a&&(i|=2),n<-a?i|=4:n>a&&(i|=8),i}}function Qr(e,t,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=e-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=t-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}}}}}}function Kr(t,r,n,a){return function(s){var c,u,f,d,p,h,g,v,m,y,x,b=s,_=Yr(),w=Qr(t,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=e.merge(c);var r=function(e){for(var t=0,r=u.length,n=e[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&&Oe(c,i,e)>0&&++t:i[1]<=n&&Oe(c,i,e)<0&&--t,c=i;return 0!==t}([t,a]),n=x&&r,i=c.length;(n||i)&&(s.polygonStart(),n&&(s.lineStart(),T(null,null,1,s),s.lineEnd()),i&&qr(c,o,r,T,s),s.polygonEnd()),c=u=f=null}};function T(e,o,s,c){var u=0,f=0;if(null==e||(u=i(e,s))!==(f=i(o,s))||l(e,o)<0^s>0)do{c.point(0===u||3===u?t:n,u>1?a:r)}while((u=(u+s+4)%4)!==f);else c.point(o[0],o[1])}function M(e,i){return t<=e&&e<=n&&r<=i&&i<=a}function A(e,t){M(e,t)&&s.point(e,t)}function L(e,t){var r=M(e=Math.max(-1e9,Math.min(1e9,e)),t=Math.max(-1e9,Math.min(1e9,t)));if(u&&f.push([e,t]),y)d=e,p=t,h=r,y=!1,r&&(s.lineStart(),s.point(e,t));else if(r&&m)s.point(e,t);else{var n={a:{x:g,y:v},b:{x:e,y:t}};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(e,t),x=!1)}g=e,v=t,m=r}return k};function i(e,a){return y(e[0]-t)<_e?a>0?0:3:y(e[0]-n)<_e?a>0?2:1:y(e[1]-r)<_e?a>0?1:0:a>0?3:2}function o(e,t){return l(e.x,t.x)}function l(e,t){var r=i(e,1),n=i(t,1);return r!==n?r-n:0===r?t[1]-e[1]:1===r?e[0]-t[0]:2===r?e[1]-t[1]:t[0]-e[0]}}function en(e){var t=0,r=ke/3,n=kn(e),a=n(t,r);return a.parallels=function(e){return arguments.length?n(t=e[0]*ke/180,r=e[1]*ke/180):[t/ke*180,r/ke*180]},a}function tn(e,t){var r=Math.sin(e),n=(r+Math.sin(t))/2,a=1+r*(2*n-r),i=Math.sqrt(a)/n;function o(e,t){var r=Math.sqrt(a-2*n*Math.sin(t))/n;return[r*Math.sin(e*=n),i-r*Math.cos(e)]}return o.invert=function(e,t){var r=i-t;return[Math.atan2(e,r)/n,De((a-(e*e+r*r)*n*n)/(2*n))]},o}e.geo.clipExtent=function(){var e,t,r,n,a,i,o={stream:function(e){return a&&(a.valid=!1),(a=i(e)).valid=!0,a},extent:function(l){return arguments.length?(i=Kr(e=+l[0][0],t=+l[0][1],r=+l[1][0],n=+l[1][1]),a&&(a.valid=!1,a=null),o):[[e,t],[r,n]]}};return o.extent([[0,0],[960,500]])},(e.geo.conicEqualArea=function(){return en(tn)}).raw=tn,e.geo.albers=function(){return e.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},e.geo.albersUsa=function(){var t,r,n,a,i=e.geo.albers(),o=e.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l=e.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s={point:function(e,r){t=[e,r]}};function c(e){var i=e[0],o=e[1];return t=null,r(i,o),t||(n(i,o),t)||a(i,o),t}return c.invert=function(e){var t=i.scale(),r=i.translate(),n=(e[0]-r[0])/t,a=(e[1]-r[1])/t;return(a>=.12&&a<.234&&n>=-.425&&n<-.214?o:a>=.166&&a<.234&&n>=-.214&&n<-.115?l:i).invert(e)},c.stream=function(e){var t=i.stream(e),r=o.stream(e),n=l.stream(e);return{point:function(e,a){t.point(e,a),r.point(e,a),n.point(e,a)},sphere:function(){t.sphere(),r.sphere(),n.sphere()},lineStart:function(){t.lineStart(),r.lineStart(),n.lineStart()},lineEnd:function(){t.lineEnd(),r.lineEnd(),n.lineEnd()},polygonStart:function(){t.polygonStart(),r.polygonStart(),n.polygonStart()},polygonEnd:function(){t.polygonEnd(),r.polygonEnd(),n.polygonEnd()}}},c.precision=function(e){return arguments.length?(i.precision(e),o.precision(e),l.precision(e),c):i.precision()},c.scale=function(e){return arguments.length?(i.scale(e),o.scale(.35*e),l.scale(e),c.translate(i.translate())):i.scale()},c.translate=function(e){if(!arguments.length)return i.translate();var t=i.scale(),u=+e[0],f=+e[1];return r=i.translate(e).clipExtent([[u-.455*t,f-.238*t],[u+.455*t,f+.238*t]]).stream(s).point,n=o.translate([u-.307*t,f+.201*t]).clipExtent([[u-.425*t+_e,f+.12*t+_e],[u-.214*t-_e,f+.234*t-_e]]).stream(s).point,a=l.translate([u-.205*t,f+.212*t]).clipExtent([[u-.214*t+_e,f+.166*t+_e],[u-.115*t-_e,f+.234*t-_e]]).stream(s).point,c},c.scale(1070)};var rn,nn,an,on,ln,sn,cn={point:z,lineStart:z,lineEnd:z,polygonStart:function(){nn=0,cn.lineStart=un},polygonEnd:function(){cn.lineStart=cn.lineEnd=cn.point=z,rn+=y(nn/2)}};function un(){var e,t,r,n;function a(e,t){nn+=n*e-r*t,r=e,n=t}cn.point=function(i,o){cn.point=a,e=r=i,t=n=o},cn.lineEnd=function(){a(e,t)}}var fn={point:function(e,t){e<an&&(an=e),e>ln&&(ln=e),t<on&&(on=t),t>sn&&(sn=t)},lineStart:z,lineEnd:z,polygonStart:z,polygonEnd:z};function dn(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+-2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}var pn,hn={point:gn,lineStart:vn,lineEnd:mn,polygonStart:function(){hn.lineStart=yn},polygonEnd:function(){hn.point=gn,hn.lineStart=vn,hn.lineEnd=mn}};function gn(e,t){gr+=e,vr+=t,++mr}function vn(){var e,t;function r(r,n){var a=r-e,i=n-t,o=Math.sqrt(a*a+i*i);yr+=o*(e+r)/2,xr+=o*(t+n)/2,br+=o,gn(e=r,t=n)}hn.point=function(n,a){hn.point=r,gn(e=n,t=a)}}function mn(){hn.point=gn}function yn(){var e,t,r,n;function a(e,t){var a=e-r,i=t-n,o=Math.sqrt(a*a+i*i);yr+=o*(r+e)/2,xr+=o*(n+t)/2,br+=o,_r+=(o=n*e-r*t)*(r+e),wr+=o*(n+t),kr+=3*o,gn(r=e,n=t)}hn.point=function(i,o){hn.point=a,gn(e=r=i,t=n=o)},hn.lineEnd=function(){a(e,t)}}function xn(e){var t=.5,r=Math.cos(30*Le),n=16;function a(e){return(n?o:i)(e)}function i(t){return _n(t,(function(r,n){r=e(r,n),t.point(r[0],r[1])}))}function o(t){var r,a,i,o,s,c,u,f,d,p,h,g,v={point:m,lineStart:y,lineEnd:b,polygonStart:function(){t.polygonStart(),v.lineStart=_},polygonEnd:function(){t.polygonEnd(),v.lineStart=y}};function m(r,n){r=e(r,n),t.point(r[0],r[1])}function y(){f=NaN,v.point=x,t.lineStart()}function x(r,a){var i=Lr([r,a]),o=e(r,a);l(f,d,u,p,h,g,f=o[0],d=o[1],u=r,p=i[0],h=i[1],g=i[2],n,t),t.point(f,d)}function b(){v.point=m,t.lineEnd()}function _(){y(),v.point=w,v.lineEnd=k}function w(e,t){x(r=e,t),a=f,i=d,o=p,s=h,c=g,v.point=x}function k(){l(f,d,u,p,h,g,a,i,r,o,s,c,n,t),v.lineEnd=b,b()}return v}function l(n,a,i,o,s,c,u,f,d,p,h,g,v,m){var x=u-n,b=f-a,_=x*x+b*b;if(_>4*t&&v--){var w=o+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)<_e||y(i-d)<_e?(i+d)/2:Math.atan2(k,w),S=e(L,A),C=S[0],O=S[1],P=C-n,D=O-a,z=b*P-x*D;(z*z/_>t||y((x*P+b*D)/_-.5)>.3||o*p+s*h+c*g<r)&&(l(n,a,i,o,s,c,C,O,L,w/=M,k/=M,T,v,m),m.point(C,O),l(C,O,L,w,k,T,u,f,d,p,h,g,v,m))}}return a.precision=function(e){return arguments.length?(n=(t=e*e)>0&&16,a):Math.sqrt(t)},a}function bn(e){this.stream=e}function _n(e,t){return{point:t,sphere:function(){e.sphere()},lineStart:function(){e.lineStart()},lineEnd:function(){e.lineEnd()},polygonStart:function(){e.polygonStart()},polygonEnd:function(){e.polygonEnd()}}}function wn(e){return kn((function(){return e}))()}function kn(t){var r,n,a,i,o,l,s=xn((function(e,t){return[(e=r(e,t))[0]*c+i,o-e[1]*c]})),c=150,u=480,f=250,d=0,p=0,h=0,g=0,v=0,m=Jr,y=C,x=null,b=null;function _(e){return[(e=a(e[0]*Le,e[1]*Le))[0]*c+i,o-e[1]*c]}function w(e){return(e=a.invert((e[0]-i)/c,(o-e[1])/c))&&[e[0]*Se,e[1]*Se]}function k(){a=jr(n=Ln(h,g,v),r);var e=r(d,p);return i=u-e[0]*c,o=f+e[1]*c,T()}function T(){return l&&(l.valid=!1,l=null),_}return _.stream=function(e){return l&&(l.valid=!1),(l=Tn(m(n,s(y(e))))).valid=!0,l},_.clipAngle=function(e){return arguments.length?(m=null==e?(x=e,Jr):$r((x=+e)*Le),T()):x},_.clipExtent=function(e){return arguments.length?(b=e,y=e?Kr(e[0][0],e[0][1],e[1][0],e[1][1]):C,T()):b},_.scale=function(e){return arguments.length?(c=+e,k()):c},_.translate=function(e){return arguments.length?(u=+e[0],f=+e[1],k()):[u,f]},_.center=function(e){return arguments.length?(d=e[0]%360*Le,p=e[1]%360*Le,k()):[d*Se,p*Se]},_.rotate=function(e){return arguments.length?(h=e[0]%360*Le,g=e[1]%360*Le,v=e.length>2?e[2]%360*Le:0,k()):[h*Se,g*Se,v*Se]},e.rebind(_,s,"precision"),function(){return r=t.apply(this,arguments),_.invert=r.invert&&w,k()}}function Tn(e){return _n(e,(function(t,r){e.point(t*Le,r*Le)}))}function Mn(e,t){return[e,t]}function An(e,t){return[e>ke?e-Te:e<-ke?e+Te:e,t]}function Ln(e,t,r){return e?t||r?jr(Cn(e),On(t,r)):Cn(e):t||r?On(t,r):An}function Sn(e){return function(t,r){return[(t+=e)>ke?t-Te:t<-ke?t+Te:t,r]}}function Cn(e){var t=Sn(e);return t.invert=Sn(-e),t}function On(e,t){var r=Math.cos(e),n=Math.sin(e),a=Math.cos(t),i=Math.sin(t);function o(e,t){var o=Math.cos(t),l=Math.cos(e)*o,s=Math.sin(e)*o,c=Math.sin(t),u=c*r+l*n;return[Math.atan2(s*a-u*i,l*r-c*n),De(u*a+s*i)]}return o.invert=function(e,t){var o=Math.cos(t),l=Math.cos(e)*o,s=Math.sin(e)*o,c=Math.sin(t),u=c*a-s*i;return[Math.atan2(s*a+c*i,l*r+u*n),De(u*r-l*n)]},o}function Pn(e,t){var r=Math.cos(e),n=Math.sin(e);return function(a,i,o,l){var s=o*t;null!=a?(a=Dn(r,a),i=Dn(r,i),(o>0?a<i:a>i)&&(a+=o*Te)):(a=e+o*Te,i=e-.5*s);for(var c,u=a;o>0?u>i:u<i;u-=s)l.point((c=zr([r,-n*Math.cos(u),-n*Math.sin(u)]))[0],c[1])}}function Dn(e,t){var r=Lr(t);r[0]-=e,Dr(r);var n=Pe(-r[1]);return((-r[2]<0?-n:n)+2*Math.PI-_e)%(2*Math.PI)}function zn(t,r,n){var a=e.range(t,r-_e,n).concat(r);return function(e){return a.map((function(t){return[e,t]}))}}function En(t,r,n){var a=e.range(t,r-_e,n).concat(r);return function(e){return a.map((function(t){return[t,e]}))}}function Rn(e){return e.source}function In(e){return e.target}e.geo.path=function(){var t,r,n,a,i,o=4.5;function l(t){return t&&("function"==typeof o&&a.pointRadius(+o.apply(this,arguments)),i&&i.valid||(i=n(a)),e.geo.stream(t,i)),a.result()}function s(){return i=null,l}return l.area=function(t){return rn=0,e.geo.stream(t,n(cn)),rn},l.centroid=function(t){return gr=vr=mr=yr=xr=br=_r=wr=kr=0,e.geo.stream(t,n(hn)),kr?[_r/kr,wr/kr]:br?[yr/br,xr/br]:mr?[gr/mr,vr/mr]:[NaN,NaN]},l.bounds=function(t){return ln=sn=-(an=on=1/0),e.geo.stream(t,n(fn)),[[an,on],[ln,sn]]},l.projection=function(e){return arguments.length?(n=(t=e)?e.stream||function(e){var t=xn((function(t,r){return e([t*Se,r*Se])}));return function(e){return Tn(t(e))}}(e):C,s()):t},l.context=function(e){return arguments.length?(a=null==(r=e)?new function(){var e=dn(4.5),t=[],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=dn(t),r},result:function(){if(t.length){var e=t.join("");return t=[],e}}};function n(r,n){t.push("M",r,",",n,e)}function a(e,n){t.push("M",e,",",n),r.point=i}function i(e,r){t.push("L",e,",",r)}function o(){r.point=n}function l(){t.push("Z")}return r}:new function(e){var t=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(e){return t=e,r},result:z};function n(r,n){e.moveTo(r+t,n),e.arc(r,n,t,0,Te)}function a(t,n){e.moveTo(t,n),r.point=i}function i(t,r){e.lineTo(t,r)}function o(){r.point=n}function l(){e.closePath()}return r}(e),"function"!=typeof o&&a.pointRadius(o),s()):r},l.pointRadius=function(e){return arguments.length?(o="function"==typeof e?e:(a.pointRadius(+e),+e),l):o},l.projection(e.geo.albersUsa()).context(null)},e.geo.transform=function(e){return{stream:function(t){var r=new bn(t);for(var n in e)r[n]=e[n];return r}}},bn.prototype={point:function(e,t){this.stream.point(e,t)},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()}},e.geo.projection=wn,e.geo.projectionMutator=kn,(e.geo.equirectangular=function(){return wn(Mn)}).raw=Mn.invert=Mn,e.geo.rotation=function(e){function t(t){return(t=e(t[0]*Le,t[1]*Le))[0]*=Se,t[1]*=Se,t}return e=Ln(e[0]%360*Le,e[1]*Le,e.length>2?e[2]*Le:0),t.invert=function(t){return(t=e.invert(t[0]*Le,t[1]*Le))[0]*=Se,t[1]*=Se,t},t},An.invert=Mn,e.geo.circle=function(){var e,t,r=[0,0],n=6;function a(){var e="function"==typeof r?r.apply(this,arguments):r,n=Ln(-e[0]*Le,-e[1]*Le,0).invert,a=[];return t(null,null,1,{point:function(e,t){a.push(e=n(e,t)),e[0]*=Se,e[1]*=Se}}),{type:"Polygon",coordinates:[a]}}return a.origin=function(e){return arguments.length?(r=e,a):r},a.angle=function(r){return arguments.length?(t=Pn((e=+r)*Le,n*Le),a):e},a.precision=function(r){return arguments.length?(t=Pn(e*Le,(n=+r)*Le),a):n},a.angle(90)},e.geo.distance=function(e,t){var r,n=(t[0]-e[0])*Le,a=e[1]*Le,i=t[1]*Le,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)},e.geo.graticule=function(){var t,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 e.range(Math.ceil(a/g)*g,n,g).map(f).concat(e.range(Math.ceil(s/v)*v,l,v).map(d)).concat(e.range(Math.ceil(r/p)*p,t,p).filter((function(e){return y(e%g)>_e})).map(c)).concat(e.range(Math.ceil(o/h)*h,i,h).filter((function(e){return y(e%v)>_e})).map(u))}return x.lines=function(){return b().map((function(e){return{type:"LineString",coordinates:e}}))},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(e){return arguments.length?x.majorExtent(e).minorExtent(e):x.minorExtent()},x.majorExtent=function(e){return arguments.length?(a=+e[0][0],n=+e[1][0],s=+e[0][1],l=+e[1][1],a>n&&(e=a,a=n,n=e),s>l&&(e=s,s=l,l=e),x.precision(m)):[[a,s],[n,l]]},x.minorExtent=function(e){return arguments.length?(r=+e[0][0],t=+e[1][0],o=+e[0][1],i=+e[1][1],r>t&&(e=r,r=t,t=e),o>i&&(e=o,o=i,i=e),x.precision(m)):[[r,o],[t,i]]},x.step=function(e){return arguments.length?x.majorStep(e).minorStep(e):x.minorStep()},x.majorStep=function(e){return arguments.length?(g=+e[0],v=+e[1],x):[g,v]},x.minorStep=function(e){return arguments.length?(p=+e[0],h=+e[1],x):[p,h]},x.precision=function(e){return arguments.length?(m=+e,c=zn(o,i,90),u=En(r,t,m),f=zn(s,l,90),d=En(a,n,m),x):m},x.majorExtent([[-180,-90+_e],[180,90-_e]]).minorExtent([[-180,-80-_e],[180,80+_e]])},e.geo.greatArc=function(){var t,r,n=Rn,a=In;function i(){return{type:"LineString",coordinates:[t||n.apply(this,arguments),r||a.apply(this,arguments)]}}return i.distance=function(){return e.geo.distance(t||n.apply(this,arguments),r||a.apply(this,arguments))},i.source=function(e){return arguments.length?(n=e,t="function"==typeof e?null:e,i):n},i.target=function(e){return arguments.length?(a=e,r="function"==typeof e?null:e,i):a},i.precision=function(){return arguments.length?i:0},i},e.geo.interpolate=function(e,t){return r=e[0]*Le,n=e[1]*Le,a=t[0]*Le,i=t[1]*Le,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(Ee(i-n)+o*s*Ee(a-r))),g=1/Math.sin(h),(v=h?function(e){var t=Math.sin(e*=h)*g,r=Math.sin(h-e)*g,n=r*u+t*d,a=r*f+t*p,i=r*l+t*c;return[Math.atan2(a,n)*Se,Math.atan2(i,Math.sqrt(n*n+a*a))*Se]}:function(){return[r*Se,n*Se]}).distance=h,v;var r,n,a,i,o,l,s,c,u,f,d,p,h,g,v},e.geo.length=function(t){return pn=0,e.geo.stream(t,Fn),pn};var Fn={sphere:z,point:z,lineStart:function(){var e,t,r;function n(n,a){var i=Math.sin(a*=Le),o=Math.cos(a),l=y((n*=Le)-e),s=Math.cos(l);pn+=Math.atan2(Math.sqrt((l=o*Math.sin(l))*l+(l=r*i-t*o*s)*l),t*i+r*o*s),e=n,t=i,r=o}Fn.point=function(a,i){e=a*Le,t=Math.sin(i*=Le),r=Math.cos(i),Fn.point=n},Fn.lineEnd=function(){Fn.point=Fn.lineEnd=z}},lineEnd:z,polygonStart:z,polygonEnd:z};function Nn(e,t){function r(t,r){var n=Math.cos(t),a=Math.cos(r),i=e(n*a);return[i*a*Math.sin(t),i*Math.sin(r)]}return r.invert=function(e,r){var n=Math.sqrt(e*e+r*r),a=t(n),i=Math.sin(a),o=Math.cos(a);return[Math.atan2(e*i,n*o),Math.asin(n&&r*i/n)]},r}var Hn=Nn((function(e){return Math.sqrt(2/(1+e))}),(function(e){return 2*Math.asin(e/2)}));(e.geo.azimuthalEqualArea=function(){return wn(Hn)}).raw=Hn;var Bn=Nn((function(e){var t=Math.acos(e);return t&&t/Math.sin(t)}),C);function jn(e,t){var r=Math.cos(e),n=function(e){return Math.tan(ke/4+e/2)},a=e===t?Math.sin(e):Math.log(r/Math.cos(t))/Math.log(n(t)/n(e)),i=r*Math.pow(n(e),a)/a;if(!a)return Un;function o(e,t){i>0?t<-Ae+_e&&(t=-Ae+_e):t>Ae-_e&&(t=Ae-_e);var r=i/Math.pow(n(t),a);return[r*Math.sin(a*e),i-r*Math.cos(a*e)]}return o.invert=function(e,t){var r=i-t,n=Ce(a)*Math.sqrt(e*e+r*r);return[Math.atan2(e,r)/a,2*Math.atan(Math.pow(i/n,1/a))-Ae]},o}function Vn(e,t){var r=Math.cos(e),n=e===t?Math.sin(e):(r-Math.cos(t))/(t-e),a=r/n+e;if(y(n)<_e)return Mn;function i(e,t){var r=a-t;return[r*Math.sin(n*e),a-r*Math.cos(n*e)]}return i.invert=function(e,t){var r=a-t;return[Math.atan2(e,r)/n,a-Ce(n)*Math.sqrt(e*e+r*r)]},i}(e.geo.azimuthalEquidistant=function(){return wn(Bn)}).raw=Bn,(e.geo.conicConformal=function(){return en(jn)}).raw=jn,(e.geo.conicEquidistant=function(){return en(Vn)}).raw=Vn;var qn=Nn((function(e){return 1/e}),Math.atan);function Un(e,t){return[e,Math.log(Math.tan(ke/4+t/2))]}function Gn(e){var t,r=wn(e),n=r.scale,a=r.translate,i=r.clipExtent;return r.scale=function(){var e=n.apply(r,arguments);return e===r?t?r.clipExtent(null):r:e},r.translate=function(){var e=a.apply(r,arguments);return e===r?t?r.clipExtent(null):r:e},r.clipExtent=function(e){var o=i.apply(r,arguments);if(o===r){if(t=null==e){var l=ke*n(),s=a();i([[s[0]-l,s[1]-l],[s[0]+l,s[1]+l]])}}else t&&(o=null);return o},r.clipExtent(null)}(e.geo.gnomonic=function(){return wn(qn)}).raw=qn,Un.invert=function(e,t){return[e,2*Math.atan(Math.exp(t))-Ae]},(e.geo.mercator=function(){return Gn(Un)}).raw=Un;var Zn=Nn((function(){return 1}),Math.asin);(e.geo.orthographic=function(){return wn(Zn)}).raw=Zn;var Xn=Nn((function(e){return 1/(1+e)}),(function(e){return 2*Math.atan(e)}));function Yn(e,t){return[Math.log(Math.tan(ke/4+t/2)),-e]}function Wn(e){return e[0]}function Jn(e){return e[1]}function $n(e){for(var t=e.length,r=[0,1],n=2,a=2;a<t;a++){for(;n>1&&Oe(e[r[n-2]],e[r[n-1]],e[a])<=0;)--n;r[n++]=a}return r.slice(0,n)}function Qn(e,t){return e[0]-t[0]||e[1]-t[1]}(e.geo.stereographic=function(){return wn(Xn)}).raw=Xn,Yn.invert=function(e,t){return[-t,2*Math.atan(Math.exp(e))-Ae]},(e.geo.transverseMercator=function(){var e=Gn(Yn),t=e.center,r=e.rotate;return e.center=function(e){return e?t([-e[1],e[0]]):[(e=t())[1],-e[0]]},e.rotate=function(e){return e?r([e[0],e[1],e.length>2?e[2]+90:90]):[(e=r())[0],e[1],e[2]-90]},r([0,0,90])}).raw=Yn,e.geom={},e.geom.hull=function(e){var t=Wn,r=Jn;if(arguments.length)return n(e);function n(e){if(e.length<3)return[];var n,a=ut(t),i=ut(r),o=e.length,l=[],s=[];for(n=0;n<o;n++)l.push([+a.call(this,e[n],n),+i.call(this,e[n],n),n]);for(l.sort(Qn),n=0;n<o;n++)s.push([l[n][0],-l[n][1]]);var c=$n(l),u=$n(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(e[l[c[n]][2]]);for(n=+f;n<u.length-d;++n)p.push(e[l[u[n]][2]]);return p}return n.x=function(e){return arguments.length?(t=e,n):t},n.y=function(e){return arguments.length?(r=e,n):r},n},e.geom.polygon=function(e){return B(e,Kn),e};var Kn=e.geom.polygon.prototype=[];function ea(e,t,r){return(r[0]-t[0])*(e[1]-t[1])<(r[1]-t[1])*(e[0]-t[0])}function ta(e,t,r,n){var a=e[0],i=r[0],o=t[0]-a,l=n[0]-i,s=e[1],c=r[1],u=t[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 ra(e){var t=e[0],r=e[e.length-1];return!(t[0]-r[0]||t[1]-r[1])}Kn.area=function(){for(var e,t=-1,r=this.length,n=this[r-1],a=0;++t<r;)e=n,n=this[t],a+=e[1]*n[0]-e[0]*n[1];return.5*a},Kn.centroid=function(e){var t,r,n=-1,a=this.length,i=0,o=0,l=this[a-1];for(arguments.length||(e=-1/(6*this.area()));++n<a;)t=l,l=this[n],r=t[0]*l[1]-l[0]*t[1],i+=(t[0]+l[0])*r,o+=(t[1]+l[1])*r;return[i*e,o*e]},Kn.clip=function(e){for(var t,r,n,a,i,o,l=ra(e),s=-1,c=this.length-ra(this),u=this[c-1];++s<c;){for(t=e.slice(),e.length=0,a=this[s],i=t[(n=t.length-l)-1],r=-1;++r<n;)ea(o=t[r],u,a)?(ea(i,u,a)||e.push(ta(i,o,u,a)),e.push(o)):ea(i,u,a)&&e.push(ta(i,o,u,a)),i=o;l&&e.push(e[0]),u=a}return e};var na,aa,ia,oa,la,sa=[],ca=[];function ua(e){var t=sa.pop()||new function(){La(this),this.edge=this.site=this.circle=null};return t.site=e,t}function fa(e){xa(e),ia.remove(e),sa.push(e),La(e)}function da(e){var t=e.circle,r=t.x,n=t.cy,a={x:r,y:n},i=e.P,o=e.N,l=[e];fa(e);for(var s=i;s.circle&&y(r-s.circle.x)<_e&&y(n-s.circle.cy)<_e;)i=s.P,l.unshift(s),fa(s),s=i;l.unshift(s),xa(s);for(var c=o;c.circle&&y(r-c.circle.x)<_e&&y(n-c.circle.cy)<_e;)o=c.N,l.push(c),fa(c),c=o;l.push(c),xa(c);var u,f=l.length;for(u=1;u<f;++u)c=l[u],s=l[u-1],Ta(c.edge,s.site,c.site,a);s=l[0],(c=l[f-1]).edge=wa(s.site,c.site,null,a),ya(s),ya(c)}function pa(e){for(var t,r,n,a,i=e.x,o=e.y,l=ia._;l;)if((n=ha(l,o)-i)>_e)l=l.L;else{if(!((a=i-ga(l,o))>_e)){n>-_e?(t=l.P,r=l):a>-_e?(t=l,r=l.N):t=r=l;break}if(!l.R){t=l;break}l=l.R}var s=ua(e);if(ia.insert(t,s),t||r){if(t===r)return xa(t),r=ua(t.site),ia.insert(s,r),s.edge=r.edge=wa(t.site,s.site),ya(t),void ya(r);if(r){xa(t),xa(r);var c=t.site,u=c.x,f=c.y,d=e.x-u,p=e.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};Ta(r.edge,c,h,b),s.edge=wa(c,e,null,b),r.edge=wa(e,h,null,b),ya(t),ya(r)}else s.edge=wa(t.site,s.site)}}function ha(e,t){var r=e.site,n=r.x,a=r.y,i=a-t;if(!i)return n;var o=e.P;if(!o)return-1/0;var l=(r=o.site).x,s=r.y,c=s-t;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 ga(e,t){var r=e.N;if(r)return ha(r,t);var n=e.site;return n.y===t?n.x:1/0}function va(e){this.site=e,this.edges=[]}function ma(e,t){return t.angle-e.angle}function ya(e){var t=e.P,r=e.N;if(t&&r){var n=t.site,a=e.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>=-we)){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=ca.pop()||new function(){La(this),this.x=this.y=this.arc=this.site=this.cy=null};m.arc=e,m.site=a,m.x=h+o,m.y=v+Math.sqrt(h*h+g*g),m.cy=v,e.circle=m;for(var y=null,x=la._;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}la.insert(y,m),y||(oa=m)}}}}function xa(e){var t=e.circle;t&&(t.P||(oa=t.N),la.remove(t),ca.push(t),La(t),e.circle=null)}function ba(e,t){var r=e.b;if(r)return!0;var n,a,i=e.a,o=t[0][0],l=t[1][0],s=t[0][1],c=t[1][1],u=e.l,f=e.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 e.a=i,e.b=r,!0}function _a(e,t){this.l=e,this.r=t,this.a=this.b=null}function wa(e,t,r,n){var a=new _a(e,t);return na.push(a),r&&Ta(a,e,t,r),n&&Ta(a,t,e,n),aa[e.i].edges.push(new Ma(a,e,t)),aa[t.i].edges.push(new Ma(a,t,e)),a}function ka(e,t,r){var n=new _a(e,null);return n.a=t,n.b=r,na.push(n),n}function Ta(e,t,r,n){e.a||e.b?e.l===r?e.b=n:e.a=n:(e.a=n,e.l=t,e.r=r)}function Ma(e,t,r){var n=e.a,a=e.b;this.edge=e,this.site=t,this.angle=r?Math.atan2(r.y-t.y,r.x-t.x):e.l===t?Math.atan2(a.x-n.x,n.y-a.y):Math.atan2(n.x-a.x,a.y-n.y)}function Aa(){this._=null}function La(e){e.U=e.C=e.L=e.R=e.P=e.N=null}function Sa(e,t){var r=t,n=t.R,a=r.U;a?a.L===r?a.L=n:a.R=n:e._=n,n.U=a,r.U=n,r.R=n.L,r.R&&(r.R.U=r),n.L=r}function Ca(e,t){var r=t,n=t.L,a=r.U;a?a.L===r?a.L=n:a.R=n:e._=n,n.U=a,r.U=n,r.L=n.R,r.L&&(r.L.U=r),n.R=r}function Oa(e){for(;e.L;)e=e.L;return e}function Pa(e,t){var r,n,a,i=e.sort(Da).pop();for(na=[],aa=new Array(e.length),ia=new Aa,la=new Aa;;)if(a=oa,i&&(!a||i.y<a.y||i.y===a.y&&i.x<a.x))i.x===r&&i.y===n||(aa[i.i]=new va(i),pa(i),r=i.x,n=i.y),i=e.pop();else{if(!a)break;da(a.arc)}t&&(function(e){for(var t,r=na,n=Qr(e[0][0],e[0][1],e[1][0],e[1][1]),a=r.length;a--;)(!ba(t=r[a],e)||!n(t)||y(t.a.x-t.b.x)<_e&&y(t.a.y-t.b.y)<_e)&&(t.a=t.b=null,r.splice(a,1))}(t),function(e){for(var t,r,n,a,i,o,l,s,c,u,f=e[0][0],d=e[1][0],p=e[0][1],h=e[1][1],g=aa,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,t=(c=l[++o%s].start()).x,r=c.y,(y(n-t)>_e||y(a-r)>_e)&&(l.splice(o,0,new Ma(ka(i.site,u,y(n-f)<_e&&h-a>_e?{x:f,y:y(t-f)<_e?r:h}:y(a-h)<_e&&d-n>_e?{x:y(r-h)<_e?t:d,y:h}:y(n-d)<_e&&a-p>_e?{x:d,y:y(t-d)<_e?r:p}:y(a-p)<_e&&n-f>_e?{x:y(r-p)<_e?t:f,y:p}:null),i.site,null)),++s)}(t));var o={cells:aa,edges:na};return ia=la=na=aa=null,o}function Da(e,t){return t.y-e.y||t.x-e.x}va.prototype.prepare=function(){for(var e,t=this.edges,r=t.length;r--;)(e=t[r].edge).b&&e.a||t.splice(r,1);return t.sort(ma),t.length},Ma.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}},Aa.prototype={insert:function(e,t){var r,n,a;if(e){if(t.P=e,t.N=e.N,e.N&&(e.N.P=t),e.N=t,e.R){for(e=e.R;e.L;)e=e.L;e.L=t}else e.R=t;r=e}else this._?(e=Oa(this._),t.P=null,t.N=e,e.P=e.L=t,r=e):(t.P=t.N=null,this._=t,r=null);for(t.L=t.R=null,t.U=r,t.C=!0,e=t;r&&r.C;)r===(n=r.U).L?(a=n.R)&&a.C?(r.C=a.C=!1,n.C=!0,e=n):(e===r.R&&(Sa(this,r),r=(e=r).U),r.C=!1,n.C=!0,Ca(this,n)):(a=n.L)&&a.C?(r.C=a.C=!1,n.C=!0,e=n):(e===r.L&&(Ca(this,r),r=(e=r).U),r.C=!1,n.C=!0,Sa(this,n)),r=e.U;this._.C=!1},remove:function(e){e.N&&(e.N.P=e.P),e.P&&(e.P.N=e.N),e.N=e.P=null;var t,r,n,a=e.U,i=e.L,o=e.R;if(r=i?o?Oa(o):i:o,a?a.L===e?a.L=r:a.R=r:this._=r,i&&o?(n=r.C,r.C=e.C,r.L=i,i.U=r,r!==o?(a=r.U,r.U=e.U,e=r.R,a.L=e,r.R=o,o.U=r):(r.U=a,a=r,e=r.R)):(n=e.C,e=r),e&&(e.U=a),!n)if(e&&e.C)e.C=!1;else{do{if(e===this._)break;if(e===a.L){if((t=a.R).C&&(t.C=!1,a.C=!0,Sa(this,a),t=a.R),t.L&&t.L.C||t.R&&t.R.C){t.R&&t.R.C||(t.L.C=!1,t.C=!0,Ca(this,t),t=a.R),t.C=a.C,a.C=t.R.C=!1,Sa(this,a),e=this._;break}}else if((t=a.L).C&&(t.C=!1,a.C=!0,Ca(this,a),t=a.L),t.L&&t.L.C||t.R&&t.R.C){t.L&&t.L.C||(t.R.C=!1,t.C=!0,Sa(this,t),t=a.L),t.C=a.C,a.C=t.L.C=!1,Ca(this,a),e=this._;break}t.C=!0,e=a,a=a.U}while(!e.C);e&&(e.C=!1)}}},e.geom.voronoi=function(e){var t=Wn,r=Jn,n=t,a=r,i=za;if(e)return o(e);function o(e){var t=new Array(e.length),r=i[0][0],n=i[0][1],a=i[1][0],o=i[1][1];return Pa(l(e),i).cells.forEach((function(i,l){var s=i.edges,c=i.site;(t[l]=s.length?s.map((function(e){var t=e.start();return[t.x,t.y]})):c.x>=r&&c.x<=a&&c.y>=n&&c.y<=o?[[r,o],[a,o],[a,n],[r,n]]:[]).point=e[l]})),t}function l(e){return e.map((function(e,t){return{x:Math.round(n(e,t)/_e)*_e,y:Math.round(a(e,t)/_e)*_e,i:t}}))}return o.links=function(e){return Pa(l(e)).edges.filter((function(e){return e.l&&e.r})).map((function(t){return{source:e[t.l.i],target:e[t.r.i]}}))},o.triangles=function(e){var t=[];return Pa(l(e)).cells.forEach((function(r,n){for(var a,i,o,l,s=r.site,c=r.edges.sort(ma),u=-1,f=c.length,d=c[f-1].edge,p=d.l===s?d.r:d.l;++u<f;)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)&&t.push([e[n],e[a.i],e[p.i]])})),t},o.x=function(e){return arguments.length?(n=ut(t=e),o):t},o.y=function(e){return arguments.length?(a=ut(r=e),o):r},o.clipExtent=function(e){return arguments.length?(i=null==e?za:e,o):i===za?null:i},o.size=function(e){return arguments.length?o.clipExtent(e&&[[0,0],e]):i===za?null:i&&i[1]},o};var za=[[-1e6,-1e6],[1e6,1e6]];function Ea(e){return e.x}function Ra(e){return e.y}function Ia(t,r){t=e.rgb(t),r=e.rgb(r);var n=t.r,a=t.g,i=t.b,o=r.r-n,l=r.g-a,s=r.b-i;return function(e){return"#"+nt(Math.round(n+o*e))+nt(Math.round(a+l*e))+nt(Math.round(i+s*e))}}function Fa(e,t){var r,n={},a={};for(r in e)r in t?n[r]=Va(e[r],t[r]):a[r]=e[r];for(r in t)r in e||(a[r]=t[r]);return function(e){for(r in n)a[r]=n[r](e);return a}}function Na(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function Ha(e,t){var r,n,a,i=Ba.lastIndex=ja.lastIndex=0,o=-1,l=[],s=[];for(e+="",t+="";(r=Ba.exec(e))&&(n=ja.exec(t));)(a=n.index)>i&&(a=t.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:Na(r,n)})),i=ja.lastIndex;return i<t.length&&(a=t.slice(i),l[o]?l[o]+=a:l[++o]=a),l.length<2?s[0]?(t=s[0].x,function(e){return t(e)+""}):function(){return t}:(t=s.length,function(e){for(var r,n=0;n<t;++n)l[(r=s[n]).i]=r.x(e);return l.join("")})}e.geom.delaunay=function(t){return e.geom.voronoi().triangles(t)},e.geom.quadtree=function(e,t,r,n,a){var i,o=Wn,l=Jn;if(i=arguments.length)return o=Ea,l=Ra,3===i&&(a=r,n=t,r=t=0),s(e);function s(e){var s,c,u,f,d,p,h,g,v,m=ut(o),x=ut(l);if(null!=t)p=t,h=r,g=n,v=a;else if(g=v=-(p=h=1/0),c=[],u=[],d=e.length,i)for(f=0;f<d;++f)(s=e[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=e[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(e,t,r,n,a,i,o,l){if(!isNaN(r)&&!isNaN(n))if(e.leaf){var s=e.x,c=e.y;if(null!=s)if(y(s-r)+y(c-n)<.01)M(e,t,r,n,a,i,o,l);else{var u=e.point;e.x=e.y=e.point=null,M(e,u,s,c,a,i,o,l),M(e,t,r,n,a,i,o,l)}else e.x=r,e.y=n,e.point=t}else M(e,t,r,n,a,i,o,l)}function M(e,t,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;e.leaf=!1,u?a=s:o=s,f?i=c:l=c,T(e=e.nodes[d]||(e.nodes[d]={leaf:!0,nodes:[],point:null,x:null,y:null}),t,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(e){T(A,e,+m(e,++f),+x(e,f),p,h,g,v)},visit:function(e){!function e(t,r,n,a,i,o){if(!t(r,n,a,i,o)){var l=.5*(n+i),s=.5*(a+o),c=r.nodes;c[0]&&e(t,c[0],n,a,l,s),c[1]&&e(t,c[1],l,a,i,s),c[2]&&e(t,c[2],n,s,l,o),c[3]&&e(t,c[3],l,s,i,o)}}(e,A,p,h,g,v)},find:function(e){return function(e,t,r,n,a,i,o){var l,s=1/0;return function e(c,u,f,d,p){if(!(u>i||f>o||d<n||p<a)){if(h=c.point){var h,g=t-c.x,v=r-c.y,m=g*g+v*v;if(m<s){var y=Math.sqrt(s=m);n=t-y,a=r-y,i=t+y,o=r+y,l=h}}for(var x=c.nodes,b=.5*(u+d),_=.5*(f+p),w=(r>=_)<<1|t>=b,k=w+4;w<k;++w)if(c=x[3&w])switch(3&w){case 0:e(c,u,f,b,_);break;case 1:e(c,b,f,d,_);break;case 2:e(c,u,_,b,p);break;case 3:e(c,b,_,d,p)}}}(e,n,a,i,o),l}(A,e[0],e[1],p,h,g,v)}};if(f=-1,null==t){for(;++f<d;)T(A,e[f],c[f],u[f],p,h,g,v);--f}else e.forEach(A.add);return c=u=e=s=null,A}return s.x=function(e){return arguments.length?(o=e,s):o},s.y=function(e){return arguments.length?(l=e,s):l},s.extent=function(e){return arguments.length?(null==e?t=r=n=a=null:(t=+e[0][0],r=+e[0][1],n=+e[1][0],a=+e[1][1]),s):null==t?null:[[t,r],[n,a]]},s.size=function(e){return arguments.length?(null==e?t=r=n=a=null:(t=r=0,n=+e[0],a=+e[1]),s):null==t?null:[n-t,a-r]},s},e.interpolateRgb=Ia,e.interpolateObject=Fa,e.interpolateNumber=Na,e.interpolateString=Ha;var Ba=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ja=new RegExp(Ba.source,"g");function Va(t,r){for(var n,a=e.interpolators.length;--a>=0&&!(n=e.interpolators[a](t,r)););return n}function qa(e,t){var r,n=[],a=[],i=e.length,o=t.length,l=Math.min(e.length,t.length);for(r=0;r<l;++r)n.push(Va(e[r],t[r]));for(;r<i;++r)a[r]=e[r];for(;r<o;++r)a[r]=t[r];return function(e){for(r=0;r<l;++r)a[r]=n[r](e);return a}}e.interpolate=Va,e.interpolators=[function(e,t){var r=typeof t;return("string"===r?ct.has(t.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(t)?Ia:Ha:t instanceof He?Ia:Array.isArray(t)?qa:"object"===r&&isNaN(t)?Fa:Na)(e,t)}],e.interpolateArray=qa;var Ua=function(){return C},Ga=e.map({linear:Ua,poly:function(e){return function(t){return Math.pow(t,e)}},quad:function(){return Wa},cubic:function(){return Ja},sin:function(){return Qa},exp:function(){return Ka},circle:function(){return ei},elastic:function(e,t){var r;return arguments.length<2&&(t=.45),arguments.length?r=t/Te*Math.asin(1/e):(e=1,r=t/4),function(n){return 1+e*Math.pow(2,-10*n)*Math.sin((n-r)*Te/t)}},back:function(e){return e||(e=1.70158),function(t){return t*t*((e+1)*t-e)}},bounce:function(){return ti}}),Za=e.map({in:C,out:Xa,"in-out":Ya,"out-in":function(e){return Ya(Xa(e))}});function Xa(e){return function(t){return 1-e(1-t)}}function Ya(e){return function(t){return.5*(t<.5?e(2*t):2-e(2-2*t))}}function Wa(e){return e*e}function Ja(e){return e*e*e}function $a(e){if(e<=0)return 0;if(e>=1)return 1;var t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}function Qa(e){return 1-Math.cos(e*Ae)}function Ka(e){return Math.pow(2,10*(e-1))}function ei(e){return 1-Math.sqrt(1-e*e)}function ti(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}function ri(e,t){return t-=e,function(r){return Math.round(e+t*r)}}function ni(e){var t,r,n,a=[e.a,e.b],i=[e.c,e.d],o=ii(a),l=ai(a,i),s=ii(((t=i)[0]+=(n=-l)*(r=a)[0],t[1]+=n*r[1],t))||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]))*Se,this.translate=[e.e,e.f],this.scale=[o,s],this.skew=s?Math.atan2(l,s)*Se:0}function ai(e,t){return e[0]*t[0]+e[1]*t[1]}function ii(e){var t=Math.sqrt(ai(e,e));return t&&(e[0]/=t,e[1]/=t),t}e.ease=function(e){var t=e.indexOf("-"),n=t>=0?e.slice(0,t):e,a=t>=0?e.slice(t+1):"in";return n=Ga.get(n)||Ua,function(e){return function(t){return t<=0?0:t>=1?1:e(t)}}((a=Za.get(a)||C)(n.apply(null,r.call(arguments,1))))},e.interpolateHcl=function(t,r){t=e.hcl(t),r=e.hcl(r);var n=t.h,a=t.c,i=t.l,o=r.h-n,l=r.c-a,s=r.l-i;return 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),function(e){return Ge(n+o*e,a+l*e,i+s*e)+""}},e.interpolateHsl=function(t,r){t=e.hsl(t),r=e.hsl(r);var n=t.h,a=t.s,i=t.l,o=r.h-n,l=r.s-a,s=r.l-i;return 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),function(e){return Ve(n+o*e,a+l*e,i+s*e)+""}},e.interpolateLab=function(t,r){t=e.lab(t),r=e.lab(r);var n=t.l,a=t.a,i=t.b,o=r.l-n,l=r.a-a,s=r.b-i;return function(e){return We(n+o*e,a+l*e,i+s*e)+""}},e.interpolateRound=ri,e.transform=function(t){var r=a.createElementNS(e.ns.prefix.svg,"g");return(e.transform=function(e){if(null!=e){r.setAttribute("transform",e);var t=r.transform.baseVal.consolidate()}return new ni(t?t.matrix:oi)})(t)},ni.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var oi={a:1,b:0,c:0,d:1,e:0,f:0};function li(e){return e.length?e.pop()+",":""}function si(t,r){var n=[],a=[];return t=e.transform(t),r=e.transform(r),function(e,t,r,n){if(e[0]!==t[0]||e[1]!==t[1]){var a=r.push("translate(",null,",",null,")");n.push({i:a-4,x:Na(e[0],t[0])},{i:a-2,x:Na(e[1],t[1])})}else(t[0]||t[1])&&r.push("translate("+t+")")}(t.translate,r.translate,n,a),function(e,t,r,n){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),n.push({i:r.push(li(r)+"rotate(",null,")")-2,x:Na(e,t)})):t&&r.push(li(r)+"rotate("+t+")")}(t.rotate,r.rotate,n,a),function(e,t,r,n){e!==t?n.push({i:r.push(li(r)+"skewX(",null,")")-2,x:Na(e,t)}):t&&r.push(li(r)+"skewX("+t+")")}(t.skew,r.skew,n,a),function(e,t,r,n){if(e[0]!==t[0]||e[1]!==t[1]){var a=r.push(li(r)+"scale(",null,",",null,")");n.push({i:a-4,x:Na(e[0],t[0])},{i:a-2,x:Na(e[1],t[1])})}else 1===t[0]&&1===t[1]||r.push(li(r)+"scale("+t+")")}(t.scale,r.scale,n,a),t=r=null,function(e){for(var t,r=-1,i=a.length;++r<i;)n[(t=a[r]).i]=t.x(e);return n.join("")}}function ci(e,t){return t=(t-=e=+e)||1/t,function(r){return(r-e)/t}}function ui(e,t){return t=(t-=e=+e)||1/t,function(r){return Math.max(0,Math.min(1,(r-e)/t))}}function fi(e){for(var t=e.source,r=e.target,n=function(e,t){if(e===t)return e;for(var r=di(e),n=di(t),a=r.pop(),i=n.pop(),o=null;a===i;)o=a,a=r.pop(),i=n.pop();return o}(t,r),a=[t];t!==n;)t=t.parent,a.push(t);for(var i=a.length;r!==n;)a.splice(i,0,r),r=r.parent;return a}function di(e){for(var t=[],r=e.parent;null!=r;)t.push(e),e=r,r=r.parent;return t.push(e),t}function pi(e){e.fixed|=2}function hi(e){e.fixed&=-7}function gi(e){e.fixed|=4,e.px=e.x,e.py=e.y}function vi(e){e.fixed&=-5}e.interpolateTransform=si,e.layout={},e.layout.bundle=function(){return function(e){for(var t=[],r=-1,n=e.length;++r<n;)t.push(fi(e[r]));return t}},e.layout.chord=function(){var t,r,n,a,i,o,l,s={},c=0;function u(){var s,u,d,p,h,g={},v=[],m=e.range(a),y=[];for(t=[],r=[],s=0,p=-1;++p<a;){for(u=0,h=-1;++h<a;)u+=n[p][h];v.push(u),y.push(e.range(a)),s+=u}for(i&&m.sort((function(e,t){return i(v[e],v[t])})),o&&y.forEach((function(e,t){e.sort((function(e,r){return o(n[t][e],n[t][r])}))})),s=(Te-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)&&t.push(T.value<M.value?{source:M,target:T}:{source:T,target:M})}l&&f()}function f(){t.sort((function(e,t){return l((e.source.value+e.target.value)/2,(t.source.value+t.target.value)/2)}))}return s.matrix=function(e){return arguments.length?(a=(n=e)&&n.length,t=r=null,s):n},s.padding=function(e){return arguments.length?(c=e,t=r=null,s):c},s.sortGroups=function(e){return arguments.length?(i=e,t=r=null,s):i},s.sortSubgroups=function(e){return arguments.length?(o=e,t=null,s):o},s.sortChords=function(e){return arguments.length?(l=e,t&&f(),s):l},s.chords=function(){return t||u(),t},s.groups=function(){return r||u(),r},s},e.layout.force=function(){var t,r,n,a,i,o,l={},s=e.dispatch("start","tick","end"),c=[1,1],u=.9,f=mi,d=yi,p=-30,h=xi,g=.1,v=.64,m=[],y=[];function x(e){return function(t,r,n,a){if(t.point!==e){var i=t.cx-e.x,o=t.cy-e.y,l=a-r,s=i*i+o*o;if(l*l/v<s){if(s<h){var c=t.charge/s;e.px-=i*c,e.py-=o*c}return!0}t.point&&s&&s<h&&(c=t.pointCharge/s,e.px-=i*c,e.py-=o*c)}return!t.charge}}function b(t){t.px=e.event.x,t.py=e.event.y,l.resume()}return l.tick=function(){if((n*=.99)<.005)return t=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 e(t,r,n){var a=0,i=0;if(t.charge=0,!t.leaf)for(var o,l=t.nodes,s=l.length,c=-1;++c<s;)null!=(o=l[c])&&(e(o,r,n),t.charge+=o.charge,a+=o.charge*o.cx,i+=o.charge*o.cy);if(t.point){t.leaf||(t.point.x+=Math.random()-.5,t.point.y+=Math.random()-.5);var u=r*n[t.point.index];t.charge+=t.pointCharge=u,a+=u*t.point.x,i+=u*t.point.y}t.cx=a/t.charge,t.cy=i/t.charge}(r=e.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(e){return arguments.length?(m=e,l):m},l.links=function(e){return arguments.length?(y=e,l):y},l.size=function(e){return arguments.length?(c=e,l):c},l.linkDistance=function(e){return arguments.length?(f="function"==typeof e?e:+e,l):f},l.distance=l.linkDistance,l.linkStrength=function(e){return arguments.length?(d="function"==typeof e?e:+e,l):d},l.friction=function(e){return arguments.length?(u=+e,l):u},l.charge=function(e){return arguments.length?(p="function"==typeof e?e:+e,l):p},l.chargeDistance=function(e){return arguments.length?(h=e*e,l):Math.sqrt(h)},l.gravity=function(e){return arguments.length?(g=+e,l):g},l.theta=function(e){return arguments.length?(v=e*e,l):Math.sqrt(v)},l.alpha=function(e){return arguments.length?(e=+e,n?e>0?n=e:(t.c=null,t.t=NaN,t=null,s.end({type:"end",alpha:n=0})):e>0&&(s.start({type:"start",alpha:n=e}),t=yt(l.tick)),l):n},l.start=function(){var e,t,r,n=m.length,s=y.length,u=c[0],h=c[1];for(e=0;e<n;++e)(r=m[e]).index=e,r.weight=0;for(e=0;e<s;++e)"number"==typeof(r=y[e]).source&&(r.source=m[r.source]),"number"==typeof r.target&&(r.target=m[r.target]),++r.source.weight,++r.target.weight;for(e=0;e<n;++e)r=m[e],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(e=0;e<s;++e)a[e]=+f.call(this,y[e],e);else for(e=0;e<s;++e)a[e]=f;if(i=[],"function"==typeof d)for(e=0;e<s;++e)i[e]=+d.call(this,y[e],e);else for(e=0;e<s;++e)i[e]=d;if(o=[],"function"==typeof p)for(e=0;e<n;++e)o[e]=+p.call(this,m[e],e);else for(e=0;e<n;++e)o[e]=p;function g(r,a){if(!t){for(t=new Array(n),c=0;c<n;++c)t[c]=[];for(c=0;c<s;++c){var i=y[c];t[i.source.index].push(i.target),t[i.target.index].push(i.source)}}for(var o,l=t[e],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=e.behavior.drag().origin(C).on("dragstart.force",pi).on("drag.force",b).on("dragend.force",hi)),!arguments.length)return r;this.on("mouseover.force",gi).on("mouseout.force",vi).call(r)},e.rebind(l,s,"on")};var mi=20,yi=1,xi=1/0;function bi(t,r){return e.rebind(t,r,"sort","children","value"),t.nodes=t,t.links=Ai,t}function _i(e,t){for(var r=[e];null!=(e=r.pop());)if(t(e),(a=e.children)&&(n=a.length))for(var n,a;--n>=0;)r.push(a[n])}function wi(e,t){for(var r=[e],n=[];null!=(e=r.pop());)if(n.push(e),(i=e.children)&&(a=i.length))for(var a,i,o=-1;++o<a;)r.push(i[o]);for(;null!=(e=n.pop());)t(e)}function ki(e){return e.children}function Ti(e){return e.value}function Mi(e,t){return t.value-e.value}function Ai(t){return e.merge(t.map((function(e){return(e.children||[]).map((function(t){return{source:e,target:t}}))})))}e.layout.hierarchy=function(){var e=Mi,t=ki,r=Ti;function n(a){var i,o=[a],l=[];for(a.depth=0;null!=(i=o.pop());)if(l.push(i),(c=t.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 wi(a,(function(t){var n,a;e&&(n=t.children)&&n.sort(e),r&&(a=t.parent)&&(a.value+=t.value)})),l}return n.sort=function(t){return arguments.length?(e=t,n):e},n.children=function(e){return arguments.length?(t=e,n):t},n.value=function(e){return arguments.length?(r=e,n):r},n.revalue=function(e){return r&&(_i(e,(function(e){e.children&&(e.value=0)})),wi(e,(function(e){var t;e.children||(e.value=+r.call(n,e,e.depth)||0),(t=e.parent)&&(t.value+=e.value)}))),e},n},e.layout.partition=function(){var t=e.layout.hierarchy(),r=[1,1];function n(e,n){var a=t.call(this,e,n);return function e(t,r,n,a){var i=t.children;if(t.x=r,t.y=t.depth*a,t.dx=n,t.dy=a,i&&(o=i.length)){var o,l,s,c=-1;for(n=t.value?n/t.value:0;++c<o;)e(l=i[c],r,s=l.value*n,a),r+=s}}(a[0],0,r[0],r[1]/function e(t){var r=t.children,n=0;if(r&&(a=r.length))for(var a,i=-1;++i<a;)n=Math.max(n,e(r[i]));return 1+n}(a[0])),a}return n.size=function(e){return arguments.length?(r=e,n):r},bi(n,t)},e.layout.pie=function(){var t=Number,r=Li,n=0,a=Te,i=0;function o(l){var s,c=l.length,u=l.map((function(e,r){return+t.call(o,e,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=e.sum(u),v=g?(d-c*h)/g:0,m=e.range(c),y=[];return null!=r&&m.sort(r===Li?function(e,t){return u[t]-u[e]}:function(e,t){return r(l[e],l[t])}),m.forEach((function(e){y[e]={data:l[e],value:s=u[e],startAngle:f,endAngle:f+=s*v+h,padAngle:p}})),y}return o.value=function(e){return arguments.length?(t=e,o):t},o.sort=function(e){return arguments.length?(r=e,o):r},o.startAngle=function(e){return arguments.length?(n=e,o):n},o.endAngle=function(e){return arguments.length?(a=e,o):a},o.padAngle=function(e){return arguments.length?(i=e,o):i},o};var Li={};function Si(e){return e.x}function Ci(e){return e.y}function Oi(e,t,r){e.y0=t,e.y=r}e.layout.stack=function(){var t=C,r=zi,n=Ei,a=Oi,i=Si,o=Ci;function l(s,c){if(!(p=s.length))return s;var u=s.map((function(e,r){return t.call(l,e,r)})),f=u.map((function(e){return e.map((function(e,t){return[i.call(l,e,t),o.call(l,e,t)]}))})),d=r.call(l,f,c);u=e.permute(u,d),f=e.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(e){return arguments.length?(t=e,l):t},l.order=function(e){return arguments.length?(r="function"==typeof e?e:Pi.get(e)||zi,l):r},l.offset=function(e){return arguments.length?(n="function"==typeof e?e:Di.get(e)||Ei,l):n},l.x=function(e){return arguments.length?(i=e,l):i},l.y=function(e){return arguments.length?(o=e,l):o},l.out=function(e){return arguments.length?(a=e,l):a},l};var Pi=e.map({"inside-out":function(t){var r,n,a=t.length,i=t.map(Ri),o=t.map(Ii),l=e.range(a).sort((function(e,t){return i[e]-i[t]})),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(t){return e.range(t.length).reverse()},default:zi}),Di=e.map({silhouette:function(e){var t,r,n,a=e.length,i=e[0].length,o=[],l=0,s=[];for(r=0;r<i;++r){for(t=0,n=0;t<a;t++)n+=e[t][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(e){var t,r,n,a,i,o,l,s,c,u=e.length,f=e[0],d=f.length,p=[];for(p[0]=s=c=0,r=1;r<d;++r){for(t=0,a=0;t<u;++t)a+=e[t][r][1];for(t=0,i=0,l=f[r][0]-f[r-1][0];t<u;++t){for(n=0,o=(e[t][r][1]-e[t][r-1][1])/(2*l);n<t;++n)o+=(e[n][r][1]-e[n][r-1][1])/l;i+=o*e[t][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(e){var t,r,n,a=e.length,i=e[0].length,o=1/a,l=[];for(r=0;r<i;++r){for(t=0,n=0;t<a;t++)n+=e[t][r][1];if(n)for(t=0;t<a;t++)e[t][r][1]/=n;else for(t=0;t<a;t++)e[t][r][1]=o}for(r=0;r<i;++r)l[r]=0;return l},zero:Ei});function zi(t){return e.range(t.length)}function Ei(e){for(var t=-1,r=e[0].length,n=[];++t<r;)n[t]=0;return n}function Ri(e){for(var t,r=1,n=0,a=e[0][1],i=e.length;r<i;++r)(t=e[r][1])>a&&(n=r,a=t);return n}function Ii(e){return e.reduce(Fi,0)}function Fi(e,t){return e+t[1]}function Ni(e,t){return Hi(e,Math.ceil(Math.log(t.length)/Math.LN2+1))}function Hi(e,t){for(var r=-1,n=+e[0],a=(e[1]-n)/t,i=[];++r<=t;)i[r]=a*r+n;return i}function Bi(t){return[e.min(t),e.max(t)]}function ji(e,t){return e.value-t.value}function Vi(e,t){var r=e._pack_next;e._pack_next=t,t._pack_prev=e,t._pack_next=r,r._pack_prev=t}function qi(e,t){e._pack_next=t,t._pack_prev=e}function Ui(e,t){var r=t.x-e.x,n=t.y-e.y,a=e.r+t.r;return.999*a*a>r*r+n*n}function Gi(e){if((t=e.children)&&(s=t.length)){var t,r,n,a,i,o,l,s,c=1/0,u=-1/0,f=1/0,d=-1/0;if(t.forEach(Zi),(r=t[0]).x=-r.r,r.y=0,x(r),s>1&&((n=t[1]).x=n.r,n.y=0,x(n),s>2))for(Yi(r,n,a=t[2]),x(a),Vi(r,a),r._pack_prev=a,Vi(a,n),n=r._pack_next,i=3;i<s;i++){Yi(r,n,a=t[i]);var p=0,h=1,g=1;for(o=n._pack_next;o!==n;o=o._pack_next,h++)if(Ui(o,a)){p=1;break}if(1==p)for(l=r._pack_prev;l!==o._pack_prev&&!Ui(l,a);l=l._pack_prev,g++);p?(h<g||h==g&&n.r<r.r?qi(r,n=o):qi(r=l,n),i--):(Vi(r,a),n=a,x(a))}var v=(c+u)/2,m=(f+d)/2,y=0;for(i=0;i<s;i++)(a=t[i]).x-=v,a.y-=m,y=Math.max(y,a.r+Math.sqrt(a.x*a.x+a.y*a.y));e.r=y,t.forEach(Xi)}function x(e){c=Math.min(e.x-e.r,c),u=Math.max(e.x+e.r,u),f=Math.min(e.y-e.r,f),d=Math.max(e.y+e.r,d)}}function Zi(e){e._pack_next=e._pack_prev=e}function Xi(e){delete e._pack_next,delete e._pack_prev}function Yi(e,t,r){var n=e.r+r.r,a=t.x-e.x,i=t.y-e.y;if(n&&(a||i)){var o=t.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=e.x+s*a+c*i,r.y=e.y+s*i-c*a}else r.x=e.x+n,r.y=e.y}function Wi(e,t){return e.parent==t.parent?1:2}function Ji(e){var t=e.children;return t.length?t[0]:e.t}function $i(e){var t,r=e.children;return(t=r.length)?r[t-1]:e.t}function Qi(e,t,r){var n=r/(t.i-e.i);t.c-=n,t.s+=r,e.c+=n,t.z+=r,t.m+=r}function Ki(e,t,r){return e.a.parent===t.parent?e.a:r}function eo(e){return{x:e.x,y:e.y,dx:e.dx,dy:e.dy}}function to(e,t){var r=e.x+t[3],n=e.y+t[0],a=e.dx-t[1]-t[3],i=e.dy-t[0]-t[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 ro(e){var t=e[0],r=e[e.length-1];return t<r?[t,r]:[r,t]}function no(e){return e.rangeExtent?e.rangeExtent():ro(e.range())}function ao(e,t,r,n){var a=r(e[0],e[1]),i=n(t[0],t[1]);return function(e){return i(a(e))}}function io(e,t){var r,n=0,a=e.length-1,i=e[n],o=e[a];return o<i&&(r=n,n=a,a=r,r=i,i=o,o=r),e[n]=t.floor(i),e[a]=t.ceil(o),e}function oo(e){return e?{floor:function(t){return Math.floor(t/e)*e},ceil:function(t){return Math.ceil(t/e)*e}}:lo}e.layout.histogram=function(){var t=!0,r=Number,n=Bi,a=Ni;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=t?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[e.bisect(d,s,1,h)-1]).y+=g,l.push(i[o]));return c}return i.value=function(e){return arguments.length?(r=e,i):r},i.range=function(e){return arguments.length?(n=ut(e),i):n},i.bins=function(e){return arguments.length?(a="number"==typeof e?function(t){return Hi(t,e)}:ut(e),i):a},i.frequency=function(e){return arguments.length?(t=!!e,i):t},i},e.layout.pack=function(){var t,r=e.layout.hierarchy().sort(ji),n=0,a=[1,1];function i(e,i){var o=r.call(this,e,i),l=o[0],s=a[0],c=a[1],u=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(l.x=l.y=0,wi(l,(function(e){e.r=+u(e.value)})),wi(l,Gi),n){var f=n*(t?1:Math.max(2*l.r/s,2*l.r/c))/2;wi(l,(function(e){e.r+=f})),wi(l,Gi),wi(l,(function(e){e.r-=f}))}return function e(t,r,n,a){var i=t.children;if(t.x=r+=a*t.x,t.y=n+=a*t.y,t.r*=a,i)for(var o=-1,l=i.length;++o<l;)e(i[o],r,n,a)}(l,s/2,c/2,t?1:1/Math.max(2*l.r/s,2*l.r/c)),o}return i.size=function(e){return arguments.length?(a=e,i):a},i.radius=function(e){return arguments.length?(t=null==e||"function"==typeof e?e:+e,i):t},i.padding=function(e){return arguments.length?(n=+e,i):n},bi(i,r)},e.layout.tree=function(){var t=e.layout.hierarchy().sort(null).value(null),r=Wi,n=[1,1],a=null;function i(e,i){var c=t.call(this,e,i),u=c[0],f=function(e){for(var t,r={A:null,children:[e]},n=[r];null!=(t=n.pop());)for(var a,i=t.children,o=0,l=i.length;o<l;++o)n.push((i[o]=a={_:i[o],parent:t,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(wi(f,o),f.parent.m=-f.z,_i(f,l),a)_i(u,s);else{var d=u,p=u,h=u;_i(u,(function(e){e.x<d.x&&(d=e),e.x>p.x&&(p=e),e.depth>h.depth&&(h=e)}));var g=r(d,p)/2-d.x,v=n[0]/(p.x+r(p,d)/2+g),m=n[1]/(h.depth||1);_i(u,(function(e){e.x=(e.x+g)*v,e.y=e.depth*m}))}return c}function o(e){var t=e.children,n=e.parent.children,a=e.i?n[e.i-1]:null;if(t.length){!function(e){for(var t,r=0,n=0,a=e.children,i=a.length;--i>=0;)(t=a[i]).z+=r,t.m+=r,r+=t.s+(n+=t.c)}(e);var i=(t[0].z+t[t.length-1].z)/2;a?(e.z=a.z+r(e._,a._),e.m=e.z-i):e.z=i}else a&&(e.z=a.z+r(e._,a._));e.parent.A=function(e,t,n){if(t){for(var a,i=e,o=e,l=t,s=i.parent.children[0],c=i.m,u=o.m,f=l.m,d=s.m;l=$i(l),i=Ji(i),l&&i;)s=Ji(s),(o=$i(o)).a=e,(a=l.z+f-i.z-c+r(l._,i._))>0&&(Qi(Ki(l,e,n),e,a),c+=a,u+=a),f+=l.m,c+=i.m,d+=s.m,u+=o.m;l&&!$i(o)&&(o.t=l,o.m+=f-u),i&&!Ji(s)&&(s.t=i,s.m+=c-d,n=e)}return n}(e,a,e.parent.A||n[0])}function l(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function s(e){e.x*=n[0],e.y=e.depth*n[1]}return i.separation=function(e){return arguments.length?(r=e,i):r},i.size=function(e){return arguments.length?(a=null==(n=e)?s:null,i):a?null:n},i.nodeSize=function(e){return arguments.length?(a=null==(n=e)?null:s,i):a?n:null},bi(i,t)},e.layout.cluster=function(){var t=e.layout.hierarchy().sort(null).value(null),r=Wi,n=[1,1],a=!1;function i(i,o){var l,s=t.call(this,i,o),c=s[0],u=0;wi(c,(function(t){var n=t.children;n&&n.length?(t.x=function(e){return e.reduce((function(e,t){return e+t.x}),0)/e.length}(n),t.y=function(t){return 1+e.max(t,(function(e){return e.y}))}(n)):(t.x=l?u+=r(t,l):0,t.y=0,l=t)}));var f=function e(t){var r=t.children;return r&&r.length?e(r[0]):t}(c),d=function e(t){var r,n=t.children;return n&&(r=n.length)?e(n[r-1]):t}(c),p=f.x-r(f,d)/2,h=d.x+r(d,f)/2;return wi(c,a?function(e){e.x=(e.x-c.x)*n[0],e.y=(c.y-e.y)*n[1]}:function(e){e.x=(e.x-p)/(h-p)*n[0],e.y=(1-(c.y?e.y/c.y:1))*n[1]}),s}return i.separation=function(e){return arguments.length?(r=e,i):r},i.size=function(e){return arguments.length?(a=null==(n=e),i):a?null:n},i.nodeSize=function(e){return arguments.length?(a=null!=(n=e),i):a?n:null},bi(i,t)},e.layout.treemap=function(){var t,r=e.layout.hierarchy(),n=Math.round,a=[1,1],i=null,o=eo,l=!1,s="squarify",c=.5*(1+Math.sqrt(5));function u(e,t){for(var r,n,a=-1,i=e.length;++a<i;)n=(r=e[a]).value*(t<0?0:t),r.area=isNaN(n)||n<=0?0:n}function f(e){var t=e.children;if(t&&t.length){var r,n,a,i=o(e),l=[],c=t.slice(),d=1/0,g="slice"===s?i.dx:"dice"===s?i.dy:"slice-dice"===s?1&e.depth?i.dy:i.dx:Math.min(i.dx,i.dy);for(u(c,i.dx*i.dy/e.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),t.forEach(f)}}function d(e){var t=e.children;if(t&&t.length){var r,n=o(e),a=t.slice(),i=[];for(u(a,n.dx*n.dy/e.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);t.forEach(d)}}function p(e,t){for(var r,n=e.area,a=0,i=1/0,o=-1,l=e.length;++o<l;)(r=e[o].area)&&(r<i&&(i=r),r>a&&(a=r));return t*=t,(n*=n)?Math.max(t*a*c/n,n/(t*i*c)):1/0}function h(e,t,r,a){var i,o=-1,l=e.length,s=r.x,c=r.y,u=t?n(e.area/t):0;if(t==r.dx){for((a||u>r.dy)&&(u=r.dy);++o<l;)(i=e[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=e[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(e){var n=t||r(e),i=n[0];return i.x=i.y=0,i.value?(i.dx=a[0],i.dy=a[1]):i.dx=i.dy=0,t&&r.revalue(i),u([i],i.dx*i.dy/i.value),(t?d:f)(i),l&&(t=n),n}return g.size=function(e){return arguments.length?(a=e,g):a},g.padding=function(e){if(!arguments.length)return i;function t(t){return to(t,e)}var r;return o=null==(i=e)?eo:"function"==(r=typeof e)?function(t){var r=e.call(g,t,t.depth);return null==r?eo(t):to(t,"number"==typeof r?[r,r,r,r]:r)}:"number"===r?(e=[e,e,e,e],t):t,g},g.round=function(e){return arguments.length?(n=e?Math.round:Number,g):n!=Number},g.sticky=function(e){return arguments.length?(l=e,t=null,g):l},g.ratio=function(e){return arguments.length?(c=e,g):c},g.mode=function(e){return arguments.length?(s=e+"",g):s},bi(g,r)},e.random={normal:function(e,t){var r=arguments.length;return r<2&&(t=1),r<1&&(e=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 e+t*r*Math.sqrt(-2*Math.log(a)/a)}},logNormal:function(){var t=e.random.normal.apply(e,arguments);return function(){return Math.exp(t())}},bates:function(t){var r=e.random.irwinHall(t);return function(){return r()/t}},irwinHall:function(e){return function(){for(var t=0,r=0;r<e;r++)t+=Math.random();return t}}},e.scale={};var lo={floor:C,ceil:C};function so(t,r,n,a){var i=[],o=[],l=0,s=Math.min(t.length,r.length)-1;for(t[s]<t[0]&&(t=t.slice().reverse(),r=r.slice().reverse());++l<=s;)i.push(n(t[l-1],t[l])),o.push(a(r[l-1],r[l]));return function(r){var n=e.bisect(t,r,1,s)-1;return o[n](i[n](r))}}function co(t,r){return e.rebind(t,r,"range","rangeRound","interpolate","clamp")}function uo(e,t){return io(e,oo(fo(e,t)[2])),io(e,oo(fo(e,t)[2])),e}function fo(e,t){null==t&&(t=10);var r=ro(e),n=r[1]-r[0],a=Math.pow(10,Math.floor(Math.log(n/t)/Math.LN10)),i=t/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 po(t,r){return e.range.apply(e,fo(t,r))}function ho(t,r,n){var a=fo(t,r);if(n){var i=Mt.exec(n);if(i.shift(),"s"===i[8]){var o=e.formatPrefix(Math.max(y(a[0]),y(a[1])));return i[7]||(i[7]="."+vo(o.scale(a[2]))),i[8]="f",n=e.format(i.join("")),function(e){return n(o.scale(e))+o.symbol}}i[7]||(i[7]="."+function(e,t){var r=vo(t[2]);return e in go?Math.abs(r-vo(Math.max(y(t[0]),y(t[1]))))+ +("e"!==e):r-2*("%"===e)}(i[8],a)),n=i.join("")}else n=",."+vo(a[2])+"f";return e.format(n)}e.scale.linear=function(){return function e(t,r,n,a){var i,o;function l(){var e=Math.min(t.length,r.length)>2?so:ao,l=a?ui:ci;return i=e(t,r,l,n),o=e(r,t,l,Va),s}function s(e){return i(e)}return s.invert=function(e){return o(e)},s.domain=function(e){return arguments.length?(t=e.map(Number),l()):t},s.range=function(e){return arguments.length?(r=e,l()):r},s.rangeRound=function(e){return s.range(e).interpolate(ri)},s.clamp=function(e){return arguments.length?(a=e,l()):a},s.interpolate=function(e){return arguments.length?(n=e,l()):n},s.ticks=function(e){return po(t,e)},s.tickFormat=function(e,r){return ho(t,e,r)},s.nice=function(e){return uo(t,e),l()},s.copy=function(){return e(t,r,n,a)},l()}([0,1],[0,1],Va,!1)};var go={s:1,g:1,p:1,r:1,e:1};function vo(e){return-Math.floor(Math.log(e)/Math.LN10+.01)}e.scale.log=function(){return function t(r,n,a,i){function o(e){return(a?Math.log(e<0?0:e):-Math.log(e>0?0:-e))/Math.log(n)}function l(e){return a?Math.pow(n,e):-Math.pow(n,-e)}function s(e){return r(o(e))}return s.invert=function(e){return l(r.invert(e))},s.domain=function(e){return arguments.length?(a=e[0]>=0,r.domain((i=e.map(Number)).map(o)),s):i},s.base=function(e){return arguments.length?(n=+e,r.domain(i.map(o)),s):n},s.nice=function(){var e=io(i.map(o),a?Math:yo);return r.domain(e),i=e.map(l),s},s.ticks=function(){var e=ro(i),t=[],r=e[0],s=e[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++)t.push(l(c)*d);t.push(l(c))}else for(t.push(l(c));c++<u;)for(d=f-1;d>0;d--)t.push(l(c)*d);for(c=0;t[c]<r;c++);for(u=t.length;t[u-1]>s;u--);t=t.slice(c,u)}return t},s.tickFormat=function(t,r){if(!arguments.length)return mo;arguments.length<2?r=mo:"function"!=typeof r&&(r=e.format(r));var a=Math.max(1,n*t/s.ticks().length);return function(e){var t=e/l(Math.round(o(e)));return t*n<n-.5&&(t*=n),t<=a?r(e):""}},s.copy=function(){return t(r.copy(),n,a,i)},co(s,r)}(e.scale.linear().domain([0,1]),10,!0,[1,10])};var mo=e.format(".0e"),yo={floor:function(e){return-Math.ceil(-e)},ceil:function(e){return-Math.floor(-e)}};function xo(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}e.scale.pow=function(){return function e(t,r,n){var a=xo(r),i=xo(1/r);function o(e){return t(a(e))}return o.invert=function(e){return i(t.invert(e))},o.domain=function(e){return arguments.length?(t.domain((n=e.map(Number)).map(a)),o):n},o.ticks=function(e){return po(n,e)},o.tickFormat=function(e,t){return ho(n,e,t)},o.nice=function(e){return o.domain(uo(n,e))},o.exponent=function(e){return arguments.length?(a=xo(r=e),i=xo(1/r),t.domain(n.map(a)),o):r},o.copy=function(){return e(t.copy(),r,n)},co(o,t)}(e.scale.linear(),1,[0,1])},e.scale.sqrt=function(){return e.scale.pow().exponent(.5)},e.scale.ordinal=function(){return function t(r,n){var a,i,o;function l(e){return i[((a.get(e)||("range"===n.t?a.set(e,r.push(e)):NaN))-1)%i.length]}function s(t,n){return e.range(r.length).map((function(e){return t+n*e}))}return l.domain=function(e){if(!arguments.length)return r;r=[],a=new b;for(var t,i=-1,o=e.length;++i<o;)a.has(t=e[i])||a.set(t,r.push(t));return l[n.t].apply(l,n.a)},l.range=function(e){return arguments.length?(i=e,o=0,n={t:"range",a:arguments},l):i},l.rangePoints=function(e,t){arguments.length<2&&(t=0);var a=e[0],c=e[1],u=r.length<2?(a=(a+c)/2,0):(c-a)/(r.length-1+t);return i=s(a+u*t/2,u),o=0,n={t:"rangePoints",a:arguments},l},l.rangeRoundPoints=function(e,t){arguments.length<2&&(t=0);var a=e[0],c=e[1],u=r.length<2?(a=c=Math.round((a+c)/2),0):(c-a)/(r.length-1+t)|0;return i=s(a+Math.round(u*t/2+(c-a-(r.length-1+t)*u)/2),u),o=0,n={t:"rangeRoundPoints",a:arguments},l},l.rangeBands=function(e,t,a){arguments.length<2&&(t=0),arguments.length<3&&(a=t);var c=e[1]<e[0],u=e[c-0],f=e[1-c],d=(f-u)/(r.length-t+2*a);return i=s(u+d*a,d),c&&i.reverse(),o=d*(1-t),n={t:"rangeBands",a:arguments},l},l.rangeRoundBands=function(e,t,a){arguments.length<2&&(t=0),arguments.length<3&&(a=t);var c=e[1]<e[0],u=e[c-0],f=e[1-c],d=Math.floor((f-u)/(r.length-t+2*a));return i=s(u+Math.round((f-u-(r.length-t)*d)/2),d),c&&i.reverse(),o=Math.round(d*(1-t)),n={t:"rangeRoundBands",a:arguments},l},l.rangeBand=function(){return o},l.rangeExtent=function(){return ro(n.a[0])},l.copy=function(){return t(r,n)},l.domain(r)}([],{t:"range",a:[[]]})},e.scale.category10=function(){return e.scale.ordinal().range(bo)},e.scale.category20=function(){return e.scale.ordinal().range(_o)},e.scale.category20b=function(){return e.scale.ordinal().range(wo)},e.scale.category20c=function(){return e.scale.ordinal().range(ko)};var bo=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(tt),_o=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(tt),wo=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(tt),ko=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(tt);function To(){return 0}e.scale.quantile=function(){return function t(r,n){var a;function i(){var t=0,i=n.length;for(a=[];++t<i;)a[t-1]=e.quantile(r,t/i);return o}function o(t){if(!isNaN(t=+t))return n[e.bisect(a,t)]}return o.domain=function(e){return arguments.length?(r=e.map(p).filter(h).sort(d),i()):r},o.range=function(e){return arguments.length?(n=e,i()):n},o.quantiles=function(){return a},o.invertExtent=function(e){return(e=n.indexOf(e))<0?[NaN,NaN]:[e>0?a[e-1]:r[0],e<a.length?a[e]:r[r.length-1]]},o.copy=function(){return t(r,n)},i()}([],[])},e.scale.quantize=function(){return function e(t,r,n){var a,i;function o(e){return n[Math.max(0,Math.min(i,Math.floor(a*(e-t))))]}function l(){return a=n.length/(r-t),i=n.length-1,o}return o.domain=function(e){return arguments.length?(t=+e[0],r=+e[e.length-1],l()):[t,r]},o.range=function(e){return arguments.length?(n=e,l()):n},o.invertExtent=function(e){return[e=(e=n.indexOf(e))<0?NaN:e/a+t,e+1/a]},o.copy=function(){return e(t,r,n)},l()}(0,1,[0,1])},e.scale.threshold=function(){return function t(r,n){function a(t){if(t<=t)return n[e.bisect(r,t)]}return a.domain=function(e){return arguments.length?(r=e,a):r},a.range=function(e){return arguments.length?(n=e,a):n},a.invertExtent=function(e){return e=n.indexOf(e),[r[e-1],r[e]]},a.copy=function(){return t(r,n)},a}([.5],[0,1])},e.scale.identity=function(){return function e(t){function r(e){return+e}return r.invert=r,r.domain=r.range=function(e){return arguments.length?(t=e.map(r),r):t},r.ticks=function(e){return po(t,e)},r.tickFormat=function(e,r){return ho(t,e,r)},r.copy=function(){return e(t)},r}([0,1])},e.svg={},e.svg.arc=function(){var e=Ao,t=Lo,r=To,n=Mo,a=So,i=Co,o=Oo;function l(){var l=Math.max(0,+e.apply(this,arguments)),c=Math.max(0,+t.apply(this,arguments)),u=a.apply(this,arguments)-Ae,f=i.apply(this,arguments)-Ae,d=Math.abs(f-u),p=u>f?0:1;if(c<l&&(h=c,c=l,l=h),d>=Me)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===Mo?Math.sqrt(l*l+c*c):+n.apply(this,arguments),p||(L*=-1),c&&(L=De(v/c*Math.sin(m))),l&&(A=De(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)<=ke?0:1;if(L&&Po(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)<=ke?0:1;if(A&&Po(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>_e&&(h=Math.min(Math.abs(c-l)/2,+r.apply(this,arguments)))>.001){g=l<c^p?0:1;var z=h,E=h;if(d<ke){var R=null==T?[w,k]:null==b?[y,x]:ta([y,x],[T,M],[b,_],[w,k]),I=y-R[0],F=x-R[1],N=b-R[0],H=_-R[1],B=1/Math.sin(Math.acos((I*N+F*H)/(Math.sqrt(I*I+F*F)*Math.sqrt(N*N+H*H)))/2),j=Math.sqrt(R[0]*R[0]+R[1]*R[1]);E=Math.min(h,(l-j)/(B-1)),z=Math.min(h,(c-j)/(B+1))}if(null!=b){var V=Do(null==T?[w,k]:[T,M],[y,x],c,z,p),q=Do([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^Po(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=Do([y,x],[T,M],l,-E,p),G=Do([w,k],null==b?[y,x]:[b,_],l,-E,p);h===E?S.push("L",G[0],"A",E,",",E," 0 0,",g," ",G[1],"A",l,",",l," 0 ",p^Po(G[1][0],G[1][1],U[1][0],U[1][1]),",",1-p," ",U[1],"A",E,",",E," 0 0,",g," ",U[0]):S.push("L",G[0],"A",E,",",E," 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(e,t){return"M0,"+e+"A"+e+","+e+" 0 1,"+t+" 0,"+-e+"A"+e+","+e+" 0 1,"+t+" 0,"+e}return l.innerRadius=function(t){return arguments.length?(e=ut(t),l):e},l.outerRadius=function(e){return arguments.length?(t=ut(e),l):t},l.cornerRadius=function(e){return arguments.length?(r=ut(e),l):r},l.padRadius=function(e){return arguments.length?(n=e==Mo?Mo:ut(e),l):n},l.startAngle=function(e){return arguments.length?(a=ut(e),l):a},l.endAngle=function(e){return arguments.length?(i=ut(e),l):i},l.padAngle=function(e){return arguments.length?(o=ut(e),l):o},l.centroid=function(){var r=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,n=(+a.apply(this,arguments)+ +i.apply(this,arguments))/2-Ae;return[Math.cos(n)*r,Math.sin(n)*r]},l};var Mo="auto";function Ao(e){return e.innerRadius}function Lo(e){return e.outerRadius}function So(e){return e.startAngle}function Co(e){return e.endAngle}function Oo(e){return e&&e.padAngle}function Po(e,t,r,n){return(e-r)*t-(t-n)*e>0?0:1}function Do(e,t,r,n,a){var i=e[0]-t[0],o=e[1]-t[1],l=(a?n:-n)/Math.sqrt(i*i+o*o),s=l*o,c=-l*i,u=e[0]+s,f=e[1]+c,d=t[0]+s,p=t[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 zo(e){var t=Wn,r=Jn,n=Vr,a=Ro,i=a.key,o=.7;function l(i){var l,s=[],c=[],u=-1,f=i.length,d=ut(t),p=ut(r);function h(){s.push("M",a(e(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(e){return arguments.length?(t=e,l):t},l.y=function(e){return arguments.length?(r=e,l):r},l.defined=function(e){return arguments.length?(n=e,l):n},l.interpolate=function(e){return arguments.length?(i="function"==typeof e?a=e:(a=Eo.get(e)||Ro).key,l):i},l.tension=function(e){return arguments.length?(o=e,l):o},l}e.svg.line=function(){return zo(C)};var Eo=e.map({linear:Ro,"linear-closed":Io,step:function(e){for(var t=0,r=e.length,n=e[0],a=[n[0],",",n[1]];++t<r;)a.push("H",(n[0]+(n=e[t])[0])/2,"V",n[1]);return r>1&&a.push("H",n[0]),a.join("")},"step-before":Fo,"step-after":No,basis:jo,"basis-open":function(e){if(e.length<4)return Ro(e);for(var t,r=[],n=-1,a=e.length,i=[0],o=[0];++n<3;)t=e[n],i.push(t[0]),o.push(t[1]);for(r.push(Vo(Go,i)+","+Vo(Go,o)),--n;++n<a;)t=e[n],i.shift(),i.push(t[0]),o.shift(),o.push(t[1]),Zo(r,i,o);return r.join("")},"basis-closed":function(e){for(var t,r,n=-1,a=e.length,i=a+4,o=[],l=[];++n<4;)r=e[n%a],o.push(r[0]),l.push(r[1]);for(t=[Vo(Go,o),",",Vo(Go,l)],--n;++n<i;)r=e[n%a],o.shift(),o.push(r[0]),l.shift(),l.push(r[1]),Zo(t,o,l);return t.join("")},bundle:function(e,t){var r=e.length-1;if(r)for(var n,a,i=e[0][0],o=e[0][1],l=e[r][0]-i,s=e[r][1]-o,c=-1;++c<=r;)a=c/r,(n=e[c])[0]=t*n[0]+(1-t)*(i+a*l),n[1]=t*n[1]+(1-t)*(o+a*s);return jo(e)},cardinal:function(e,t){return e.length<3?Ro(e):e[0]+Ho(e,Bo(e,t))},"cardinal-open":function(e,t){return e.length<4?Ro(e):e[1]+Ho(e.slice(1,-1),Bo(e,t))},"cardinal-closed":function(e,t){return e.length<3?Io(e):e[0]+Ho((e.push(e[0]),e),Bo([e[e.length-2]].concat(e,[e[1]]),t))},monotone:function(e){return e.length<3?Ro(e):e[0]+Ho(e,function(e){for(var t,r,n,a,i=[],o=function(e){for(var t=0,r=e.length-1,n=[],a=e[0],i=e[1],o=n[0]=Xo(a,i);++t<r;)n[t]=(o+(o=Xo(a=i,i=e[t+1])))/2;return n[t]=o,n}(e),l=-1,s=e.length-1;++l<s;)t=Xo(e[l],e[l+1]),y(t)<_e?o[l]=o[l+1]=0:(a=(r=o[l]/t)*r+(n=o[l+1]/t)*n)>9&&(a=3*t/Math.sqrt(a),o[l]=a*r,o[l+1]=a*n);for(l=-1;++l<=s;)a=(e[Math.min(s,l+1)][0]-e[Math.max(0,l-1)][0])/(6*(1+o[l]*o[l])),i.push([a||0,o[l]*a||0]);return i}(e))}});function Ro(e){return e.length>1?e.join("L"):e+"Z"}function Io(e){return e.join("L")+"Z"}function Fo(e){for(var t=0,r=e.length,n=e[0],a=[n[0],",",n[1]];++t<r;)a.push("V",(n=e[t])[1],"H",n[0]);return a.join("")}function No(e){for(var t=0,r=e.length,n=e[0],a=[n[0],",",n[1]];++t<r;)a.push("H",(n=e[t])[0],"V",n[1]);return a.join("")}function Ho(e,t){if(t.length<1||e.length!=t.length&&e.length!=t.length+2)return Ro(e);var r=e.length!=t.length,n="",a=e[0],i=e[1],o=t[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=e[1],s=2),t.length>1){l=t[1],i=e[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<t.length;c++,s++)i=e[s],l=t[c],n+="S"+(i[0]-l[0])+","+(i[1]-l[1])+","+i[0]+","+i[1]}if(r){var u=e[s];n+="Q"+(i[0]+2*l[0]/3)+","+(i[1]+2*l[1]/3)+","+u[0]+","+u[1]}return n}function Bo(e,t){for(var r,n=[],a=(1-t)/2,i=e[0],o=e[1],l=1,s=e.length;++l<s;)r=i,i=o,o=e[l],n.push([a*(o[0]-r[0]),a*(o[1]-r[1])]);return n}function jo(e){if(e.length<3)return Ro(e);var t=1,r=e.length,n=e[0],a=n[0],i=n[1],o=[a,a,a,(n=e[1])[0]],l=[i,i,i,n[1]],s=[a,",",i,"L",Vo(Go,o),",",Vo(Go,l)];for(e.push(e[r-1]);++t<=r;)n=e[t],o.shift(),o.push(n[0]),l.shift(),l.push(n[1]),Zo(s,o,l);return e.pop(),s.push("L",n),s.join("")}function Vo(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}Eo.forEach((function(e,t){t.key=e,t.closed=/-closed$/.test(e)}));var qo=[0,2/3,1/3,0],Uo=[0,1/3,2/3,0],Go=[0,1/6,2/3,1/6];function Zo(e,t,r){e.push("C",Vo(qo,t),",",Vo(qo,r),",",Vo(Uo,t),",",Vo(Uo,r),",",Vo(Go,t),",",Vo(Go,r))}function Xo(e,t){return(t[1]-e[1])/(t[0]-e[0])}function Yo(e){for(var t,r,n,a=-1,i=e.length;++a<i;)r=(t=e[a])[0],n=t[1]-Ae,t[0]=r*Math.cos(n),t[1]=r*Math.sin(n);return e}function Wo(e){var t=Wn,r=Wn,n=0,a=Jn,i=Vr,o=Ro,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=ut(t),b=ut(n),_=t===r?function(){return d}:ut(r),w=n===a?function(){return p}:ut(a);function k(){h.push("M",o(e(v),u),c,s(e(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(e){return arguments.length?(t=r=e,f):r},f.x0=function(e){return arguments.length?(t=e,f):t},f.x1=function(e){return arguments.length?(r=e,f):r},f.y=function(e){return arguments.length?(n=a=e,f):a},f.y0=function(e){return arguments.length?(n=e,f):n},f.y1=function(e){return arguments.length?(a=e,f):a},f.defined=function(e){return arguments.length?(i=e,f):i},f.interpolate=function(e){return arguments.length?(l="function"==typeof e?o=e:(o=Eo.get(e)||Ro).key,s=o.reverse||o,c=o.closed?"M":"L",f):l},f.tension=function(e){return arguments.length?(u=e,f):u},f}function Jo(e){return e.radius}function $o(e){return[e.x,e.y]}function Qo(){return 64}function Ko(){return"circle"}function el(e){var t=Math.sqrt(e/ke);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}e.svg.line.radial=function(){var e=zo(Yo);return e.radius=e.x,delete e.x,e.angle=e.y,delete e.y,e},Fo.reverse=No,No.reverse=Fo,e.svg.area=function(){return Wo(C)},e.svg.area.radial=function(){var e=Wo(Yo);return e.radius=e.x,delete e.x,e.innerRadius=e.x0,delete e.x0,e.outerRadius=e.x1,delete e.x1,e.angle=e.y,delete e.y,e.startAngle=e.y0,delete e.y0,e.endAngle=e.y1,delete e.y1,e},e.svg.chord=function(){var e=Rn,t=In,r=Jo,n=So,a=Co;function i(r,n){var a,i,c=o(this,e,r,n),u=o(this,t,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(e,t,i,o){var l=t.call(e,i,o),s=r.call(e,l,o),c=n.call(e,l,o)-Ae,u=a.call(e,l,o)-Ae;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(e,t,r){return"A"+e+","+e+" 0 "+ +(r>ke)+",1 "+t}function s(e,t,r,n){return"Q 0,0 "+n}return i.radius=function(e){return arguments.length?(r=ut(e),i):r},i.source=function(t){return arguments.length?(e=ut(t),i):e},i.target=function(e){return arguments.length?(t=ut(e),i):t},i.startAngle=function(e){return arguments.length?(n=ut(e),i):n},i.endAngle=function(e){return arguments.length?(a=ut(e),i):a},i},e.svg.diagonal=function(){var e=Rn,t=In,r=$o;function n(n,a){var i=e.call(this,n,a),o=t.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(t){return arguments.length?(e=ut(t),n):e},n.target=function(e){return arguments.length?(t=ut(e),n):t},n.projection=function(e){return arguments.length?(r=e,n):r},n},e.svg.diagonal.radial=function(){var t=e.svg.diagonal(),r=$o,n=t.projection;return t.projection=function(e){return arguments.length?n(function(e){return function(){var t=e.apply(this,arguments),r=t[0],n=t[1]-Ae;return[r*Math.cos(n),r*Math.sin(n)]}}(r=e)):r},t},e.svg.symbol=function(){var e=Ko,t=Qo;function r(r,n){return(tl.get(e.call(this,r,n))||el)(t.call(this,r,n))}return r.type=function(t){return arguments.length?(e=ut(t),r):e},r.size=function(e){return arguments.length?(t=ut(e),r):t},r};var tl=e.map({circle:el,cross:function(e){var t=Math.sqrt(e/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(e){var t=Math.sqrt(e/(2*nl)),r=t*nl;return"M0,"+-t+"L"+r+",0 0,"+t+" "+-r+",0Z"},square:function(e){var t=Math.sqrt(e)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(e){var t=Math.sqrt(e/rl),r=t*rl/2;return"M0,"+r+"L"+t+","+-r+" "+-t+","+-r+"Z"},"triangle-up":function(e){var t=Math.sqrt(e/rl),r=t*rl/2;return"M0,"+-r+"L"+t+","+r+" "+-t+","+r+"Z"}});e.svg.symbolTypes=tl.keys();var rl=Math.sqrt(3),nl=Math.tan(30*Le);G.transition=function(e){for(var t,r,n=ll||++ul,a=pl(e),i=[],o=sl||{time:Date.now(),ease:$a,delay:0,duration:250},l=-1,s=this.length;++l<s;){i.push(t=[]);for(var c=this[l],u=-1,f=c.length;++u<f;)(r=c[u])&&hl(r,u,a,n,o),t.push(r)}return ol(i,a,n)},G.interrupt=function(e){return this.each(null==e?al:il(pl(e)))};var al=il(pl());function il(e){return function(){var t,r,n;(t=this[e])&&(n=t[r=t.active])&&(n.timer.c=null,n.timer.t=NaN,--t.count?delete t[r]:delete this[e],t.active+=.5,n.event&&n.event.interrupt.call(this,this.__data__,n.index))}}function ol(e,t,r){return B(e,cl),e.namespace=t,e.id=r,e}var ll,sl,cl=[],ul=0;function fl(e,t,r,n){var a=e.id,i=e.namespace;return se(e,"function"==typeof r?function(e,o,l){e[i][a].tween.set(t,n(r.call(e,e.__data__,o,l)))}:(r=n(r),function(e){e[i][a].tween.set(t,r)}))}function dl(e){return null==e&&(e=""),function(){this.textContent=e}}function pl(e){return null==e?"__transition__":"__transition_"+e+"__"}function hl(e,t,r,n,a){var i,o,l,s,c,u=e[r]||(e[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(e,e.__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,yt((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(e,e.__data__,t),c=[],f.tween.forEach((function(r,n){(n=n.call(e,e.__data__,t))&&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(e,o);if(i>=1)return f.event&&f.event.end.call(e,e.__data__,t),--u.count?delete u[n]:delete e[r],1}f||(i=a.time,o=yt((function(e){var t=f.delay;if(o.t=t+i,t<=e)return d(e-t);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:t},a=null,++u.count)}cl.call=G.call,cl.empty=G.empty,cl.node=G.node,cl.size=G.size,e.transition=function(t,r){return t&&t.transition?ll?t.transition(r):t:e.selection().transition(t)},e.transition.prototype=cl,cl.select=function(e){var t,r,n,a=this.id,i=this.namespace,o=[];e=Z(e);for(var l=-1,s=this.length;++l<s;){o.push(t=[]);for(var c=this[l],u=-1,f=c.length;++u<f;)(n=c[u])&&(r=e.call(n,n.__data__,u,l))?("__data__"in n&&(r.__data__=n.__data__),hl(r,u,i,a,n[i][a]),t.push(r)):t.push(null)}return ol(o,i,a)},cl.selectAll=function(e){var t,r,n,a,i,o=this.id,l=this.namespace,s=[];e=X(e);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=e.call(n,n.__data__,d,c),s.push(t=[]);for(var h=-1,g=r.length;++h<g;)(a=r[h])&&hl(a,h,l,o,i),t.push(a)}return ol(s,l,o)},cl.filter=function(e){var t,r,n=[];"function"!=typeof e&&(e=le(e));for(var a=0,i=this.length;a<i;a++){n.push(t=[]);for(var o,l=0,s=(o=this[a]).length;l<s;l++)(r=o[l])&&e.call(r,r.__data__,l,a)&&t.push(r)}return ol(n,this.namespace,this.id)},cl.tween=function(e,t){var r=this.id,n=this.namespace;return arguments.length<2?this.node()[n][r].tween.get(e):se(this,null==t?function(t){t[n][r].tween.remove(e)}:function(a){a[n][r].tween.set(e,t)})},cl.attr=function(t,r){if(arguments.length<2){for(r in t)this.attr(r,t[r]);return this}var n="transform"==t?si:Va,a=e.ns.qualify(t);function i(){this.removeAttribute(a)}function o(){this.removeAttributeNS(a.space,a.local)}return fl(this,"attr."+t,r,a.local?function(e){return null==e?o:(e+="",function(){var t,r=this.getAttributeNS(a.space,a.local);return r!==e&&(t=n(r,e),function(e){this.setAttributeNS(a.space,a.local,t(e))})})}:function(e){return null==e?i:(e+="",function(){var t,r=this.getAttribute(a);return r!==e&&(t=n(r,e),function(e){this.setAttribute(a,t(e))})})})},cl.attrTween=function(t,r){var n=e.ns.qualify(t);return this.tween("attr."+t,n.local?function(e,t){var a=r.call(this,e,t,this.getAttributeNS(n.space,n.local));return a&&function(e){this.setAttributeNS(n.space,n.local,a(e))}}:function(e,t){var a=r.call(this,e,t,this.getAttribute(n));return a&&function(e){this.setAttribute(n,a(e))}})},cl.style=function(e,t,r){var n=arguments.length;if(n<3){if("string"!=typeof e){for(r in n<2&&(t=""),e)this.style(r,e[r],t);return this}r=""}function a(){this.style.removeProperty(e)}return fl(this,"style."+e,t,(function(t){return null==t?a:(t+="",function(){var n,a=o(this).getComputedStyle(this,null).getPropertyValue(e);return a!==t&&(n=Va(a,t),function(t){this.style.setProperty(e,n(t),r)})})}))},cl.styleTween=function(e,t,r){return arguments.length<3&&(r=""),this.tween("style."+e,(function(n,a){var i=t.call(this,n,a,o(this).getComputedStyle(this,null).getPropertyValue(e));return i&&function(t){this.style.setProperty(e,i(t),r)}}))},cl.text=function(e){return fl(this,"text",e,dl)},cl.remove=function(){var e=this.namespace;return this.each("end.transition",(function(){var t;this[e].count<2&&(t=this.parentNode)&&t.removeChild(this)}))},cl.ease=function(t){var r=this.id,n=this.namespace;return arguments.length<1?this.node()[n][r].ease:("function"!=typeof t&&(t=e.ease.apply(e,arguments)),se(this,(function(e){e[n][r].ease=t})))},cl.delay=function(e){var t=this.id,r=this.namespace;return arguments.length<1?this.node()[r][t].delay:se(this,"function"==typeof e?function(n,a,i){n[r][t].delay=+e.call(n,n.__data__,a,i)}:(e=+e,function(n){n[r][t].delay=e}))},cl.duration=function(e){var t=this.id,r=this.namespace;return arguments.length<1?this.node()[r][t].duration:se(this,"function"==typeof e?function(n,a,i){n[r][t].duration=Math.max(1,e.call(n,n.__data__,a,i))}:(e=Math.max(1,e),function(n){n[r][t].duration=e}))},cl.each=function(t,r){var n=this.id,a=this.namespace;if(arguments.length<2){var i=sl,o=ll;try{ll=n,se(this,(function(e,r,i){sl=e[a][n],t.call(e,e.__data__,r,i)}))}finally{sl=i,ll=o}}else se(this,(function(i){var o=i[a][n];(o.event||(o.event=e.dispatch("start","end","interrupt"))).on(t,r)}));return this},cl.transition=function(){for(var e,t,r,n=this.id,a=++ul,i=this.namespace,o=[],l=0,s=this.length;l<s;l++){o.push(e=[]);for(var c,u=0,f=(c=this[l]).length;u<f;u++)(t=c[u])&&hl(t,u,i,a,{time:(r=t[i][n]).time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration}),e.push(t)}return ol(o,i,a)},e.svg.axis=function(){var t,r=e.scale.linear(),a=gl,i=6,o=6,l=3,s=[10],c=null;function u(n){n.each((function(){var n,u=e.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==t?d.tickFormat?d.tickFormat.apply(d,s):C:t,g=u.selectAll(".tick").data(p,d),v=g.enter().insert("g",".domain").attr("class","tick").style("opacity",_e),m=e.transition(g.exit()).style("opacity",_e).remove(),y=e.transition(g.order()).style("opacity",1),x=Math.max(i,0)+l,b=no(d),_=u.selectAll(".domain").data([0]),w=(_.enter().append("path").attr("class","domain"),e.transition(_));v.append("line"),v.append("text");var k,T,M,A,L=v.select("line"),S=y.select("line"),O=g.select("text").text(h),P=v.select("text"),D=y.select("text"),z="top"===a||"left"===a?-1:1;if("bottom"===a||"top"===a?(n=ml,k="x",M="y",T="x2",A="y2",O.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=yl,k="y",M="x",T="y2",A="x2",O.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),P.attr(M,z*x),S.attr(T,0).attr(A,z*i),D.attr(k,0).attr(M,z*x),d.rangeBand){var E=d,R=E.rangeBand()/2;f=d=function(e){return E(e)+R}}else f.rangeBand?f=d:m.call(n,d,f);v.call(n,f,d),y.call(n,d,d)}))}return u.scale=function(e){return arguments.length?(r=e,u):r},u.orient=function(e){return arguments.length?(a=e in vl?e+"":gl,u):a},u.ticks=function(){return arguments.length?(s=n(arguments),u):s},u.tickValues=function(e){return arguments.length?(c=e,u):c},u.tickFormat=function(e){return arguments.length?(t=e,u):t},u.tickSize=function(e){var t=arguments.length;return t?(i=+e,o=+arguments[t-1],u):i},u.innerTickSize=function(e){return arguments.length?(i=+e,u):i},u.outerTickSize=function(e){return arguments.length?(o=+e,u):o},u.tickPadding=function(e){return arguments.length?(l=+e,u):l},u.tickSubdivide=function(){return arguments.length&&u},u};var gl="bottom",vl={top:1,right:1,bottom:1,left:1};function ml(e,t,r){e.attr("transform",(function(e){var n=t(e);return"translate("+(isFinite(n)?n:r(e))+",0)"}))}function yl(e,t,r){e.attr("transform",(function(e){var n=t(e);return"translate(0,"+(isFinite(n)?n:r(e))+")"}))}e.svg.brush=function(){var t,r,n=N(d,"brushstart","brush","brushend"),a=null,i=null,l=[0,0],s=[0,0],c=!0,u=!0,f=bl[0];function d(t){t.each((function(){var t=e.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=t.selectAll(".background").data([0]);r.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),t.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var n=t.selectAll(".resize").data(f,C);n.exit().remove(),n.enter().append("g").attr("class",(function(e){return"resize "+e})).style("cursor",(function(e){return xl[e]})).append("rect").attr("x",(function(e){return/[ew]$/.test(e)?-3:null})).attr("y",(function(e){return/^[ns]/.test(e)?-3:null})).attr("width",6).attr("height",6).style("visibility","hidden"),n.style("display",d.empty()?"none":null);var o,l=e.transition(t),s=e.transition(r);a&&(o=no(a),s.attr("x",o[0]).attr("width",o[1]-o[0]),h(l)),i&&(o=no(i),s.attr("y",o[0]).attr("height",o[1]-o[0]),g(l)),p(l)}))}function p(e){e.selectAll(".resize").attr("transform",(function(e){return"translate("+l[+/e$/.test(e)]+","+s[+/^s/.test(e)]+")"}))}function h(e){e.select(".extent").attr("x",l[0]),e.selectAll(".extent,.n>rect,.s>rect").attr("width",l[1]-l[0])}function g(e){e.select(".extent").attr("y",s[0]),e.selectAll(".extent,.e>rect,.w>rect").attr("height",s[1]-s[0])}function v(){var f,v,m=this,y=e.select(e.event.target),x=n.of(m,arguments),b=e.select(m),_=y.datum(),w=!/^(n|s)$/.test(_)&&a,k=!/^(e|w)$/.test(_)&&i,T=y.classed("extent"),M=me(m),A=e.mouse(m),L=e.select(o(m)).on("keydown.brush",(function(){32==e.event.keyCode&&(T||(f=null,A[0]-=l[1],A[1]-=s[1],T=2),I())})).on("keyup.brush",(function(){32==e.event.keyCode&&2==T&&(A[0]+=l[1],A[1]+=s[1],T=0,I())}));if(e.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 e.event.altKey&&(f=A.slice());function O(){var t=e.mouse(m),r=!1;v&&(t[0]+=v[0],t[1]+=v[1]),T||(e.event.altKey?(f||(f=[(l[0]+l[1])/2,(s[0]+s[1])/2]),A[0]=l[+(t[0]<f[0])],A[1]=s[+(t[1]<f[1])]):f=null),w&&P(t,a,0)&&(h(b),r=!0),k&&P(t,i,1)&&(g(b),r=!0),r&&(p(b),x({type:"brush",mode:T?"move":"resize"}))}function P(e,n,a){var i,o,d=no(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,e[a])):e[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:t=null,v[0]=i,v[1]=o,!0}function D(){O(),b.style("pointer-events","all").selectAll(".resize").style("display",d.empty()?"none":null),e.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),e.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:t,j:r},o=this.__chart__||i;this.__chart__=i,ll?e.select(this).transition().each("start.brush",(function(){t=o.i,r=o.j,l=o.x,s=o.y,a({type:"brushstart"})})).tween("brush:brush",(function(){var e=qa(l,i.x),n=qa(s,i.y);return t=r=null,function(t){l=i.x=e(t),s=i.y=n(t),a({type:"brush",mode:"resize"})}})).each("end.brush",(function(){t=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(e){return arguments.length?(f=bl[!(a=e)<<1|!i],d):a},d.y=function(e){return arguments.length?(f=bl[!a<<1|!(i=e)],d):i},d.clamp=function(e){return arguments.length?(a&&i?(c=!!e[0],u=!!e[1]):a?c=!!e:i&&(u=!!e),d):a&&i?[c,u]:a?c:i?u:null},d.extent=function(e){var n,o,c,u,f;return arguments.length?(a&&(n=e[0],o=e[1],i&&(n=n[0],o=o[0]),t=[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=e[0],u=e[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&&(t?(n=t[0],o=t[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],t=r=null),d},d.empty=function(){return!!a&&l[0]==l[1]||!!i&&s[0]==s[1]},e.rebind(d,n,"on")};var xl={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},bl=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],_l=St.format=nr.timeFormat,wl=_l.utc,kl=wl("%Y-%m-%dT%H:%M:%S.%LZ");function Tl(e){return e.toISOString()}function Ml(t,r,n){function a(e){return t(e)}function i(t,n){var a=(t[1]-t[0])/n,i=e.bisect(Ll,a);return i==Ll.length?[r.year,fo(t.map((function(e){return e/31536e6})),n)[2]]:i?r[a/Ll[i-1]<Ll[i]/a?i-1:i]:[Ol,fo(t,n)[2]]}return a.invert=function(e){return Al(t.invert(e))},a.domain=function(e){return arguments.length?(t.domain(e),a):t.domain().map(Al)},a.nice=function(e,t){var r=a.domain(),n=ro(r),o=null==e?i(n,10):"number"==typeof e&&i(n,e);function l(r){return!isNaN(r)&&!e.range(r,Al(+r+1),t).length}return o&&(e=o[0],t=o[1]),a.domain(io(r,t>1?{floor:function(t){for(;l(t=e.floor(t));)t=Al(t-1);return t},ceil:function(t){for(;l(t=e.ceil(t));)t=Al(+t+1);return t}}:e))},a.ticks=function(e,t){var r=ro(a.domain()),n=null==e?i(r,10):"number"==typeof e?i(r,e):!e.range&&[{range:e},t];return n&&(e=n[0],t=n[1]),e.range(r[0],Al(+r[1]+1),t<1?1:t)},a.tickFormat=function(){return n},a.copy=function(){return Ml(t.copy(),r,n)},co(a,t)}function Al(e){return new Date(e)}_l.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Tl:kl,Tl.parse=function(e){var t=new Date(e);return isNaN(t)?null:t},Tl.toString=kl.toString,St.second=Dt((function(e){return new Ct(1e3*Math.floor(e/1e3))}),(function(e,t){e.setTime(e.getTime()+1e3*Math.floor(t))}),(function(e){return e.getSeconds()})),St.seconds=St.second.range,St.seconds.utc=St.second.utc.range,St.minute=Dt((function(e){return new Ct(6e4*Math.floor(e/6e4))}),(function(e,t){e.setTime(e.getTime()+6e4*Math.floor(t))}),(function(e){return e.getMinutes()})),St.minutes=St.minute.range,St.minutes.utc=St.minute.utc.range,St.hour=Dt((function(e){var t=e.getTimezoneOffset()/60;return new Ct(36e5*(Math.floor(e/36e5-t)+t))}),(function(e,t){e.setTime(e.getTime()+36e5*Math.floor(t))}),(function(e){return e.getHours()})),St.hours=St.hour.range,St.hours.utc=St.hour.utc.range,St.month=Dt((function(e){return(e=St.day(e)).setDate(1),e}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e){return e.getMonth()})),St.months=St.month.range,St.months.utc=St.month.utc.range;var Ll=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Sl=[[St.second,1],[St.second,5],[St.second,15],[St.second,30],[St.minute,1],[St.minute,5],[St.minute,15],[St.minute,30],[St.hour,1],[St.hour,3],[St.hour,6],[St.hour,12],[St.day,1],[St.day,2],[St.week,1],[St.month,1],[St.month,3],[St.year,1]],Cl=_l.multi([[".%L",function(e){return e.getMilliseconds()}],[":%S",function(e){return e.getSeconds()}],["%I:%M",function(e){return e.getMinutes()}],["%I %p",function(e){return e.getHours()}],["%a %d",function(e){return e.getDay()&&1!=e.getDate()}],["%b %d",function(e){return 1!=e.getDate()}],["%B",function(e){return e.getMonth()}],["%Y",Vr]]),Ol={range:function(t,r,n){return e.range(Math.ceil(t/n)*n,+r,n).map(Al)},floor:C,ceil:C};Sl.year=St.year,St.scale=function(){return Ml(e.scale.linear(),Sl,Cl)};var Pl=Sl.map((function(e){return[e[0].utc,e[1]]})),Dl=wl.multi([[".%L",function(e){return e.getUTCMilliseconds()}],[":%S",function(e){return e.getUTCSeconds()}],["%I:%M",function(e){return e.getUTCMinutes()}],["%I %p",function(e){return e.getUTCHours()}],["%a %d",function(e){return e.getUTCDay()&&1!=e.getUTCDate()}],["%b %d",function(e){return 1!=e.getUTCDate()}],["%B",function(e){return e.getUTCMonth()}],["%Y",Vr]]);function zl(e){return JSON.parse(e.responseText)}function El(e){var t=a.createRange();return t.selectNode(a.body),t.createContextualFragment(e.responseText)}Pl.year=St.year.utc,St.scale.utc=function(){return Ml(e.scale.linear(),Pl,Dl)},e.text=ft((function(e){return e.responseText})),e.json=function(e,t){return dt(e,"application/json",zl,t)},e.html=function(e,t){return dt(e,"text/html",El,t)},e.xml=ft((function(e){return e.responseXML})),"object"==typeof t&&t.exports?t.exports=e:this.d3=e}()},{}],8:[function(e,r,n){(function(t,a){
  /*!
   * @overview es6-promise - a tiny implementation of Promises/A+.
   * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
   * @license   Licensed under MIT license
   *            See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
   * @version   v4.2.8+1e68dce6
   */
  !function(e,t){"object"==typeof n&&void 0!==r?r.exports=t():e.ES6Promise=t()}(this,(function(){"use strict";function r(e){return"function"==typeof e}var n=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,o=void 0,l=void 0,s=function(e,t){g[i]=e,g[i+1]=t,2===(i+=2)&&(l?l(v):_())},c="undefined"!=typeof window?window:void 0,u=c||{},f=u.MutationObserver||u.WebKitMutationObserver,d="undefined"==typeof self&&void 0!==t&&"[object process]"==={}.toString.call(t),p="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function h(){var e=setTimeout;return function(){return e(v,1)}}var g=new Array(1e3);function v(){for(var e=0;e<i;e+=2)(0,g[e])(g[e+1]),g[e]=void 0,g[e+1]=void 0;i=0}var m,y,x,b,_=void 0;function w(e,t){var r=this,n=new this.constructor(M);void 0===n[T]&&R(n);var a=r._state;if(a){var i=arguments[a-1];s((function(){return z(a,n,i,r._result)}))}else P(r,n,e,t);return n}function k(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var t=new this(M);return L(t,e),t}d?_=function(){return t.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 e?function(){try{var e=Function("return this")().require("vertx");return void 0!==(o=e.runOnLoop||e.runOnContext)?function(){o(v)}:h()}catch(e){return h()}}():h();var T=Math.random().toString(36).substring(2);function M(){}function A(e,t,n){t.constructor===e.constructor&&n===w&&t.constructor.resolve===k?function(e,t){1===t._state?C(e,t._result):2===t._state?O(e,t._result):P(t,void 0,(function(t){return L(e,t)}),(function(t){return O(e,t)}))}(e,t):void 0===n?C(e,t):r(n)?function(e,t,r){s((function(e){var n=!1,a=function(e,t,r,n){try{e.call(t,r,n)}catch(e){return e}}(r,t,(function(r){n||(n=!0,t!==r?L(e,r):C(e,r))}),(function(t){n||(n=!0,O(e,t))}),e._label);!n&&a&&(n=!0,O(e,a))}),e)}(e,t,n):C(e,t)}function L(e,t){if(e===t)O(e,new TypeError("You cannot resolve a promise with itself"));else if(a=typeof(n=t),null===n||"object"!==a&&"function"!==a)C(e,t);else{var r=void 0;try{r=t.then}catch(t){return void O(e,t)}A(e,t,r)}var n,a}function S(e){e._onerror&&e._onerror(e._result),D(e)}function C(e,t){void 0===e._state&&(e._result=t,e._state=1,0!==e._subscribers.length&&s(D,e))}function O(e,t){void 0===e._state&&(e._state=2,e._result=t,s(S,e))}function P(e,t,r,n){var a=e._subscribers,i=a.length;e._onerror=null,a[i]=t,a[i+1]=r,a[i+2]=n,0===i&&e._state&&s(D,e)}function D(e){var t=e._subscribers,r=e._state;if(0!==t.length){for(var n=void 0,a=void 0,i=e._result,o=0;o<t.length;o+=3)n=t[o],a=t[o+r],n?z(r,n,a,i):a(i);e._subscribers.length=0}}function z(e,t,n,a){var i=r(n),o=void 0,l=void 0,s=!0;if(i){try{o=n(a)}catch(e){s=!1,l=e}if(t===o)return void O(t,new TypeError("A promises callback cannot return that same promise."))}else o=a;void 0!==t._state||(i&&s?L(t,o):!1===s?O(t,l):1===e?C(t,o):2===e&&O(t,o))}var E=0;function R(e){e[T]=E++,e._state=void 0,e._result=void 0,e._subscribers=[]}var I=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(M),this.promise[T]||R(this.promise),n(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?C(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&C(this.promise,this._result))):O(this.promise,new Error("Array Methods must be provided an Array"))}return e.prototype._enumerate=function(e){for(var t=0;void 0===this._state&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var r=this._instanceConstructor,n=r.resolve;if(n===k){var a=void 0,i=void 0,o=!1;try{a=e.then}catch(e){o=!0,i=e}if(a===w&&void 0!==e._state)this._settledAt(e._state,t,e._result);else if("function"!=typeof a)this._remaining--,this._result[t]=e;else if(r===F){var l=new r(M);o?O(l,i):A(l,e,a),this._willSettleAt(l,t)}else this._willSettleAt(new r((function(t){return t(e)})),t)}else this._willSettleAt(n(e),t)},e.prototype._settledAt=function(e,t,r){var n=this.promise;void 0===n._state&&(this._remaining--,2===e?O(n,r):this._result[t]=r),0===this._remaining&&C(n,this._result)},e.prototype._willSettleAt=function(e,t){var r=this;P(e,void 0,(function(e){return r._settledAt(1,t,e)}),(function(e){return r._settledAt(2,t,e)}))},e}(),F=function(){function e(t){this[T]=E++,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 e?function(e,t){try{t((function(t){L(e,t)}),(function(t){O(e,t)}))}catch(t){O(e,t)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(e){return this.then(null,e)},e.prototype.finally=function(e){var t=this.constructor;return r(e)?this.then((function(r){return t.resolve(e()).then((function(){return r}))}),(function(r){return t.resolve(e()).then((function(){throw r}))})):this.then(e,e)},e}();return F.prototype.then=w,F.all=function(e){return new I(this,e).promise},F.race=function(e){var t=this;return n(e)?new t((function(r,n){for(var a=e.length,i=0;i<a;i++)t.resolve(e[i]).then(r,n)})):new t((function(e,t){return t(new TypeError("You must pass an array to race."))}))},F.resolve=k,F.reject=function(e){var t=new this(M);return O(t,e),t},F._setScheduler=function(e){l=e},F._setAsap=function(e){s=e},F._asap=s,F.polyfill=function(){var e=void 0;if(void 0!==a)e=a;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var r=null;try{r=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===r&&!t.cast)return}e.Promise=F},F.Promise=F,F}))}).call(this,e("_process"),void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:25}],9:[function(e,t,r){"use strict";var n=e("is-string-blank");t.exports=function(e){var t=typeof e;if("string"===t){var r=e;if(0==(e=+e)&&n(r))return!1}else if("number"!==t)return!1;return e-e<1}},{"is-string-blank":14}],10:[function(e,t,r){t.exports=function(e,t){var r=t[0],n=t[1],a=t[2],i=t[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 e[0]=1-f-h,e[1]=u+m,e[2]=d-v,e[3]=0,e[4]=u-m,e[5]=1-c-h,e[6]=p+g,e[7]=0,e[8]=d+v,e[9]=p-g,e[10]=1-c-f,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{}],11:[function(e,r,n){(function(t){"use strict";var n,a=e("is-browser");n="function"==typeof t.matchMedia?!t.matchMedia("(hover: none)").matches:a,r.exports=n}).call(this,void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"is-browser":13}],12:[function(e,t,r){"use strict";var n=e("is-browser");t.exports=n&&function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(t){e=!1}return e}()},{"is-browser":13}],13:[function(e,t,r){t.exports=!0},{}],14:[function(e,t,r){"use strict";t.exports=function(e){for(var t,r=e.length,n=0;n<r;n++)if(((t=e.charCodeAt(n))<9||t>13)&&32!==t&&133!==t&&160!==t&&5760!==t&&6158!==t&&(t<8192||t>8205)&&8232!==t&&8233!==t&&8239!==t&&8287!==t&&8288!==t&&12288!==t&&65279!==t)return!1;return!0}},{}],15:[function(e,t,r){var n={left:0,top:0};t.exports=function(e,t,r){t=t||e.currentTarget||e.srcElement,Array.isArray(r)||(r=[0,0]);var a,i=e.clientX||0,o=e.clientY||0,l=(a=t)===window||a===document||a===document.body?n:a.getBoundingClientRect();return r[0]=i-l.left,r[1]=o-l.top,r}},{}],16:[function(e,t,r){t.exports=function(e){var t=[];return e.replace(a,(function(e,r,a){var o=r.toLowerCase();for(a=function(e){var t=e.match(i);return t?t.map(Number):[]}(a),"m"==o&&a.length>2&&(t.push([r].concat(a.splice(0,2))),o="l",r="m"==r?"l":"L");;){if(a.length==n[o])return a.unshift(r),t.push(a);if(a.length<n[o])throw new Error("malformed path data");t.push([r].concat(a.splice(0,n[o])))}})),t};var n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},a=/([astvzqmhlc])([^astvzqmhlc]*)/gi,i=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi},{}],17:[function(e,t,r){
  /*
   * @copyright 2016 Sean Connelly (@voidqk), http://syntheti.cc
   * @license MIT
   * @preserve Project Home: https://github.com/voidqk/polybooljs
   */
  var n,a=e("./lib/build-log"),i=e("./lib/epsilon"),o=e("./lib/intersecter"),l=e("./lib/segment-chainer"),s=e("./lib/segment-selector"),c=e("./lib/geojson"),u=!1,f=i();function d(e,t,r){var a=n.segments(e),i=n.segments(t),o=r(n.combine(a,i));return n.polygon(o)}n={buildLog:function(e){return!0===e?u=a():!1===e&&(u=!1),!1!==u&&u.list},epsilon:function(e){return f.epsilon(e)},segments:function(e){var t=o(!0,f,u);return e.regions.forEach(t.addRegion),{segments:t.calculate(e.inverted),inverted:e.inverted}},combine:function(e,t){return{combined:o(!1,f,u).calculate(e.segments,e.inverted,t.segments,t.inverted),inverted1:e.inverted,inverted2:t.inverted}},selectUnion:function(e){return{segments:s.union(e.combined,u),inverted:e.inverted1||e.inverted2}},selectIntersect:function(e){return{segments:s.intersect(e.combined,u),inverted:e.inverted1&&e.inverted2}},selectDifference:function(e){return{segments:s.difference(e.combined,u),inverted:e.inverted1&&!e.inverted2}},selectDifferenceRev:function(e){return{segments:s.differenceRev(e.combined,u),inverted:!e.inverted1&&e.inverted2}},selectXor:function(e){return{segments:s.xor(e.combined,u),inverted:e.inverted1!==e.inverted2}},polygon:function(e){return{regions:l(e.segments,f,u),inverted:e.inverted}},polygonFromGeoJSON:function(e){return c.toPolygon(n,e)},polygonToGeoJSON:function(e){return c.fromPolygon(n,f,e)},union:function(e,t){return d(e,t,n.selectUnion)},intersect:function(e,t){return d(e,t,n.selectIntersect)},difference:function(e,t){return d(e,t,n.selectDifference)},differenceRev:function(e,t){return d(e,t,n.selectDifferenceRev)},xor:function(e,t){return d(e,t,n.selectXor)}},"object"==typeof window&&(window.PolyBool=n),t.exports=n},{"./lib/build-log":18,"./lib/epsilon":19,"./lib/geojson":20,"./lib/intersecter":21,"./lib/segment-chainer":23,"./lib/segment-selector":24}],18:[function(e,t,r){t.exports=function(){var e,t=0,r=!1;function n(t,r){return e.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),e}return e={list:[],segmentId:function(){return t++},checkIntersection:function(e,t){return n("check",{seg1:e,seg2:t})},segmentChop:function(e,t){return n("div_seg",{seg:e,pt:t}),n("chop",{seg:e,pt:t})},statusRemove:function(e){return n("pop_seg",{seg:e})},segmentUpdate:function(e){return n("seg_update",{seg:e})},segmentNew:function(e,t){return n("new_seg",{seg:e,primary:t})},segmentRemove:function(e){return n("rem_seg",{seg:e})},tempStatus:function(e,t,r){return n("temp_status",{seg:e,above:t,below:r})},rewind:function(e){return n("rewind",{seg:e})},status:function(e,t,r){return n("status",{seg:e,above:t,below:r})},vert:function(t){return t===r?e:(r=t,n("vert",{x:t}))},log:function(e){return"string"!=typeof e&&(e=JSON.stringify(e,!1,"  ")),n("log",{txt:e})},reset:function(){return n("reset")},selected:function(e){return n("selected",{segs:e})},chainStart:function(e){return n("chain_start",{seg:e})},chainRemoveHead:function(e,t){return n("chain_rem_head",{index:e,pt:t})},chainRemoveTail:function(e,t){return n("chain_rem_tail",{index:e,pt:t})},chainNew:function(e,t){return n("chain_new",{pt1:e,pt2:t})},chainMatch:function(e){return n("chain_match",{index:e})},chainClose:function(e){return n("chain_close",{index:e})},chainAddHead:function(e,t){return n("chain_add_head",{index:e,pt:t})},chainAddTail:function(e,t){return n("chain_add_tail",{index:e,pt:t})},chainConnect:function(e,t){return n("chain_con",{index1:e,index2:t})},chainReverse:function(e){return n("chain_rev",{index:e})},chainJoin:function(e,t){return n("chain_join",{index1:e,index2:t})},done:function(){return n("done")}}}},{}],19:[function(e,t,r){t.exports=function(e){"number"!=typeof e&&(e=1e-10);var t={epsilon:function(t){return"number"==typeof t&&(e=t),e},pointAboveOrOnLine:function(t,r,n){var a=r[0],i=r[1],o=n[0],l=n[1],s=t[0];return(o-a)*(t[1]-i)-(l-i)*(s-a)>=-e},pointBetween:function(t,r,n){var a=t[1]-r[1],i=n[0]-r[0],o=t[0]-r[0],l=n[1]-r[1],s=o*i+a*l;return!(s<e||s-(i*i+l*l)>-e)},pointsSameX:function(t,r){return Math.abs(t[0]-r[0])<e},pointsSameY:function(t,r){return Math.abs(t[1]-r[1])<e},pointsSame:function(e,r){return t.pointsSameX(e,r)&&t.pointsSameY(e,r)},pointsCompare:function(e,r){return t.pointsSameX(e,r)?t.pointsSameY(e,r)?0:e[1]<r[1]?-1:1:e[0]<r[0]?-1:1},pointsCollinear:function(t,r,n){var a=t[0]-r[0],i=t[1]-r[1],o=r[0]-n[0],l=r[1]-n[1];return Math.abs(a*l-o*i)<e},linesIntersect:function(t,r,n,a){var i=r[0]-t[0],o=r[1]-t[1],l=a[0]-n[0],s=a[1]-n[1],c=i*s-o*l;if(Math.abs(c)<e)return!1;var u=t[0]-n[0],f=t[1]-n[1],d=(l*f-s*u)/c,p=(i*f-o*u)/c,h={alongA:0,alongB:0,pt:[t[0]+d*i,t[1]+d*o]};return h.alongA=d<=-e?-2:d<e?-1:d-1<=-e?0:d-1<e?1:2,h.alongB=p<=-e?-2:p<e?-1:p-1<=-e?0:p-1<e?1:2,h},pointInsideRegion:function(t,r){for(var n=t[0],a=t[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>e!=o-a>e&&(i-c)*(a-u)/(o-u)+c-n>e&&(l=!l),i=c,o=u}return l}};return t}},{}],20:[function(e,t,r){var n={toPolygon:function(e,t){function r(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function r(t){var r=t.slice(0,t.length-1);return e.segments({inverted:!1,regions:[r]})}for(var n=r(t[0]),a=1;a<t.length;a++)n=e.selectDifference(e.combine(n,r(t[a])));return n}if("Polygon"===t.type)return e.polygon(r(t.coordinates));if("MultiPolygon"===t.type){for(var n=e.segments({inverted:!1,regions:[]}),a=0;a<t.coordinates.length;a++)n=e.selectUnion(e.combine(n,r(t.coordinates[a])));return e.polygon(n)}throw new Error("PolyBool: Cannot convert GeoJSON object to PolyBool polygon")},fromPolygon:function(e,t,r){function n(e,r){return t.pointInsideRegion([.5*(e[0][0]+e[1][0]),.5*(e[0][1]+e[1][1])],r)}function a(e){return{region:e,children:[]}}r=e.polygon(e.segments(r));var i=a(null);function o(e,t){for(var r=0;r<e.children.length;r++)if(n(t,(l=e.children[r]).region))return void o(l,t);var i=a(t);for(r=0;r<e.children.length;r++){var l;n((l=e.children[r]).region,t)&&(i.children.push(l),e.children.splice(r,1),r--)}e.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(e,t){for(var r=0,n=e[e.length-1][0],a=e[e.length-1][1],i=[],o=0;o<e.length;o++){var l=e[o][0],s=e[o][1];i.push([l,s]),r+=s*n-l*a,n=l,a=s}return r<0!==t&&i.reverse(),i.push([i[0][0],i[0][1]]),i}var u=[];function f(e){var t=[c(e.region,!1)];u.push(t);for(var r=0;r<e.children.length;r++)t.push(d(e.children[r]))}function d(e){for(var t=0;t<e.children.length;t++)f(e.children[t]);return c(e.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}}};t.exports=n},{}],21:[function(e,t,r){var n=e("./linked-list");t.exports=function(e,t,r){function a(e,t,n){return{id:r?r.segmentId():-1,start:e,end:t,myFill:{above:n.myFill.above,below:n.myFill.below},otherFill:null}}var i=n.create();function o(e,r){i.insertBefore(e,(function(n){return function(e,r,n,a,i,o){var l=t.pointsCompare(r,i);return 0!==l?l:t.pointsSame(n,o)?0:e!==a?e?1:-1:t.pointAboveOrOnLine(n,a?i:o,a?o:i)?1:-1}(e.isStart,e.pt,r,n.isStart,n.pt,n.other.pt)<0}))}function l(e,t){var r=function(e,t){var r=n.node({isStart:!0,pt:e.start,seg:e,primary:t,other:null,status:null});return o(r,e.end),r}(e,t);return function(e,t,r){var a=n.node({isStart:!1,pt:t.end,seg:t,primary:r,other:e,status:null});e.other=a,o(a,e.pt)}(r,e,t),r}function s(e,t){var n=a(t,e.seg.end,e.seg);return function(e,t){r&&r.segmentChop(e.seg,t),e.other.remove(),e.seg.end=t,e.other.pt=t,o(e.other,e.pt)}(e,t),l(n,e.primary)}function c(a,o){var l=n.create();function c(e){return l.findTransition((function(r){var n,a,i,o,l,s;return n=e,a=r.ev,i=n.seg.start,o=n.seg.end,l=a.seg.start,s=a.seg.end,(t.pointsCollinear(i,l,s)?t.pointsCollinear(o,l,s)||t.pointAboveOrOnLine(o,l,s)?1:-1:t.pointAboveOrOnLine(i,l,s)?1:-1)>0}))}function u(e,n){var a=e.seg,i=n.seg,o=a.start,l=a.end,c=i.start,u=i.end;r&&r.checkIntersection(a,i);var f=t.linesIntersect(o,l,c,u);if(!1===f){if(!t.pointsCollinear(o,l,c))return!1;if(t.pointsSame(o,u)||t.pointsSame(l,c))return!1;var d=t.pointsSame(o,c),p=t.pointsSame(l,u);if(d&&p)return n;var h=!d&&t.pointBetween(o,c,u),g=!p&&t.pointBetween(l,c,u);if(d)return g?s(n,l):s(e,u),n;h&&(p||(g?s(n,l):s(e,u)),s(n,o))}else 0===f.alongA&&(-1===f.alongB?s(e,c):0===f.alongB?s(e,f.pt):1===f.alongB&&s(e,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 e=u(d,h);if(e)return e}return!!g&&u(d,g)}r&&r.tempStatus(d.seg,!!h&&h.seg,!!g&&g.seg);var m,y,x=v();if(x&&(e?(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()),i.getHead()!==d){r&&r.rewind(d.seg);continue}e?(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 e?{addRegion:function(e){for(var n,a,i,o=e[e.length-1],s=0;s<e.length;s++){n=o,o=e[s];var c=t.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(e){return c(e,!1)}}:{calculate:function(e,t,r,n){return e.forEach((function(e){l(a(e.start,e.end,e),!0)})),r.forEach((function(e){l(a(e.start,e.end,e),!1)})),c(t,n)}}}},{"./linked-list":22}],22:[function(e,t,r){t.exports={create:function(){var e={root:{root:!0,next:null},exists:function(t){return null!==t&&t!==e.root},isEmpty:function(){return null===e.root.next},getHead:function(){return e.root.next},insertBefore:function(t,r){for(var n=e.root,a=e.root.next;null!==a;){if(r(a))return t.prev=a.prev,t.next=a,a.prev.next=t,void(a.prev=t);n=a,a=a.next}n.next=t,t.prev=n,t.next=null},findTransition:function(t){for(var r=e.root,n=e.root.next;null!==n&&!t(n);)r=n,n=n.next;return{before:r===e.root?null:r,after:n,insert:function(e){return e.prev=r,e.next=n,r.next=e,null!==n&&(n.prev=e),e}}}};return e},node:function(e){return e.prev=null,e.next=null,e.remove=function(){e.prev.next=e.next,e.next&&(e.next.prev=e.prev),e.prev=null,e.next=null},e}}},{}],23:[function(e,t,r){t.exports=function(e,t,r){var n=[],a=[];return e.forEach((function(e){var i=e.start,o=e.end;if(t.pointsSame(i,o))console.warn("PolyBool: Warning: Zero-length segment detected; your epsilon is probably too small or too large");else{r&&r.chainStart(e);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],t.pointsSame(f,i)){if(T(u,!0,!0))break}else if(t.pointsSame(f,o)){if(T(u,!0,!1))break}else if(t.pointsSame(d,i)){if(T(u,!1,!0))break}else if(t.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 t.pointsCollinear(y,m,h)&&(g?(r&&r.chainRemoveHead(l.index,h),v.shift()):(r&&r.chainRemoveTail(l.index,h),v.pop()),m=y),t.pointsSame(x,h)?(n.splice(p,1),t.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(e,t,r){return c.index=e,c.matches_head=t,c.matches_pt1=r,c===l?(c=s,!1):(c=null,!0)}function M(e){r&&r.chainReverse(e),n[e].reverse()}function A(e,a){var i=n[e],o=n[a],l=i[i.length-1],s=i[i.length-2],c=o[0],u=o[1];t.pointsCollinear(s,l,c)&&(r&&r.chainRemoveTail(e,l),i.pop(),l=s),t.pointsCollinear(l,c,u)&&(r&&r.chainRemoveHead(a,c),o.shift()),r&&r.chainJoin(e,a),n[e]=i.concat(o),n.splice(a,1)}})),a}},{}],24:[function(e,t,r){function n(e,t,r){var n=[];return e.forEach((function(e){var a=(e.myFill.above?8:0)+(e.myFill.below?4:0)+(e.otherFill&&e.otherFill.above?2:0)+(e.otherFill&&e.otherFill.below?1:0);0!==t[a]&&n.push({id:r?r.segmentId():-1,start:e.start,end:e.end,myFill:{above:1===t[a],below:2===t[a]},otherFill:null})})),r&&r.selected(n),n}var a={union:function(e,t){return n(e,[0,2,1,0,2,2,0,0,1,0,1,0,0,0,0,0],t)},intersect:function(e,t){return n(e,[0,0,0,0,0,2,0,2,0,0,1,1,0,2,1,0],t)},difference:function(e,t){return n(e,[0,0,0,0,2,0,2,0,1,1,0,0,0,1,2,0],t)},differenceRev:function(e,t){return n(e,[0,2,1,0,0,0,1,1,0,2,0,2,0,0,0,0],t)},xor:function(e,t){return n(e,[0,2,1,0,2,0,0,1,1,0,0,2,0,1,2,0],t)}};t.exports=a},{}],25:[function(e,t,r){var n,a,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{a="function"==typeof clearTimeout?clearTimeout:l}catch(e){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 e=s(p);f=!0;for(var t=u.length;t;){for(c=u,u=[];++d<t;)c&&c[d].run();d=-1,t=u.length}c=null,f=!1,function(e){if(a===clearTimeout)return clearTimeout(e);if((a===l||!a)&&clearTimeout)return a=clearTimeout,clearTimeout(e);try{a(e)}catch(t){try{return a.call(null,e)}catch(t){return a.call(this,e)}}}(e)}}function g(e,t){this.fun=e,this.array=t}function v(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new g(e,t)),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(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],26:[function(e,t,r){!function(e){var r=/^\s+/,n=/\s+$/,a=0,i=e.round,o=e.min,l=e.max,s=e.random;function c(t,s){if(s=s||{},(t=t||"")instanceof c)return t;if(!(this instanceof c))return new c(t,s);var u=function(t){var a,i,s,c={r:0,g:0,b:0},u=1,f=null,d=null,p=null,h=!1,g=!1;return"string"==typeof t&&(t=function(e){e=e.replace(r,"").replace(n,"").toLowerCase();var t,a=!1;if(L[e])e=L[e],a=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=B.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=B.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=B.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=B.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=B.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=B.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=B.hex8.exec(e))?{r:D(t[1]),g:D(t[2]),b:D(t[3]),a:I(t[4]),format:a?"name":"hex8"}:(t=B.hex6.exec(e))?{r:D(t[1]),g:D(t[2]),b:D(t[3]),format:a?"name":"hex"}:(t=B.hex4.exec(e))?{r:D(t[1]+""+t[1]),g:D(t[2]+""+t[2]),b:D(t[3]+""+t[3]),a:I(t[4]+""+t[4]),format:a?"name":"hex8"}:!!(t=B.hex3.exec(e))&&{r:D(t[1]+""+t[1]),g:D(t[2]+""+t[2]),b:D(t[3]+""+t[3]),format:a?"name":"hex"}}(t)),"object"==typeof t&&(j(t.r)&&j(t.g)&&j(t.b)?(a=t.r,i=t.g,s=t.b,c={r:255*O(a,255),g:255*O(i,255),b:255*O(s,255)},h=!0,g="%"===String(t.r).substr(-1)?"prgb":"rgb"):j(t.h)&&j(t.s)&&j(t.v)?(f=E(t.s),d=E(t.v),c=function(t,r,n){t=6*O(t,360),r=O(r,100),n=O(n,100);var a=e.floor(t),i=t-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]}}(t.h,f,d),h=!0,g="hsv"):j(t.h)&&j(t.s)&&j(t.l)&&(f=E(t.s),p=E(t.l),c=function(e,t,r){var n,a,i;function o(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=O(e,360),t=O(t,100),r=O(r,100),0===t)n=a=i=r;else{var l=r<.5?r*(1+t):r+t-r*t,s=2*r-l;n=o(s,l,e+1/3),a=o(s,l,e),i=o(s,l,e-1/3)}return{r:255*n,g:255*a,b:255*i}}(t.h,f,p),h=!0,g="hsl"),t.hasOwnProperty("a")&&(u=t.a)),u=C(u),{ok:h,format:t.format||g,r:o(255,l(c.r,0)),g:o(255,l(c.g,0)),b:o(255,l(c.b,0)),a:u}}(t);this._originalInput=t,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(e,t,r){e=O(e,255),t=O(t,255),r=O(r,255);var n,a,i=l(e,t,r),s=o(e,t,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 e:n=(t-r)/u+(t<r?6:0);break;case t:n=(r-e)/u+2;break;case r:n=(e-t)/u+4}n/=6}return{h:n,s:a,l:c}}function f(e,t,r){e=O(e,255),t=O(t,255),r=O(r,255);var n,a,i=l(e,t,r),s=o(e,t,r),c=i,u=i-s;if(a=0===i?0:u/i,i==s)n=0;else{switch(i){case e:n=(t-r)/u+(t<r?6:0);break;case t:n=(r-e)/u+2;break;case r:n=(e-t)/u+4}n/=6}return{h:n,s:a,v:c}}function d(e,t,r,n){var a=[z(i(e).toString(16)),z(i(t).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(e,t,r,n){return[z(R(n)),z(i(e).toString(16)),z(i(t).toString(16)),z(i(r).toString(16))].join("")}function h(e,t){t=0===t?0:t||10;var r=c(e).toHsl();return r.s-=t/100,r.s=P(r.s),c(r)}function g(e,t){t=0===t?0:t||10;var r=c(e).toHsl();return r.s+=t/100,r.s=P(r.s),c(r)}function v(e){return c(e).desaturate(100)}function m(e,t){t=0===t?0:t||10;var r=c(e).toHsl();return r.l+=t/100,r.l=P(r.l),c(r)}function y(e,t){t=0===t?0:t||10;var r=c(e).toRgb();return r.r=l(0,o(255,r.r-i(-t/100*255))),r.g=l(0,o(255,r.g-i(-t/100*255))),r.b=l(0,o(255,r.b-i(-t/100*255))),c(r)}function x(e,t){t=0===t?0:t||10;var r=c(e).toHsl();return r.l-=t/100,r.l=P(r.l),c(r)}function b(e,t){var r=c(e).toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,c(r)}function _(e){var t=c(e).toHsl();return t.h=(t.h+180)%360,c(t)}function w(e){var t=c(e).toHsl(),r=t.h;return[c(e),c({h:(r+120)%360,s:t.s,l:t.l}),c({h:(r+240)%360,s:t.s,l:t.l})]}function k(e){var t=c(e).toHsl(),r=t.h;return[c(e),c({h:(r+90)%360,s:t.s,l:t.l}),c({h:(r+180)%360,s:t.s,l:t.l}),c({h:(r+270)%360,s:t.s,l:t.l})]}function T(e){var t=c(e).toHsl(),r=t.h;return[c(e),c({h:(r+72)%360,s:t.s,l:t.l}),c({h:(r+216)%360,s:t.s,l:t.l})]}function M(e,t,r){t=t||6,r=r||30;var n=c(e).toHsl(),a=360/r,i=[c(e)];for(n.h=(n.h-(a*t>>1)+720)%360;--t;)n.h=(n.h+a)%360,i.push(c(n));return i}function A(e,t){t=t||6;for(var r=c(e).toHsv(),n=r.h,a=r.s,i=r.v,o=[],l=1/t;t--;)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 e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var t,r,n,a=this.toRgb();return t=a.r/255,r=a.g/255,n=a.b/255,.2126*(t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=C(e),this._roundA=i(100*this._a)/100,this},toHsv:function(){var e=f(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=f(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=u(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=u(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return d(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,a){var o=[z(i(e).toString(16)),z(i(t).toString(16)),z(i(r).toString(16)),z(R(n))];return a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},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(e){var t="#"+p(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var a=c(e);r="#"+p(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));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(e,t){return e.apply(null,[this].concat([].slice.call(t)))},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(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:E(e[n]));e=r}return c(e,t)},c.equals=function(e,t){return!(!e||!t)&&c(e).toRgbString()==c(t).toRgbString()},c.random=function(){return c.fromRatio({r:s(),g:s(),b:s()})},c.mix=function(e,t,r){r=0===r?0:r||50;var n=c(e).toRgb(),a=c(t).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(t,r){var n=c(t),a=c(r);return(e.max(n.getLuminance(),a.getLuminance())+.05)/(e.min(n.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(e,t,r){var n,a,i=c.readability(e,t);switch(a=!1,(n=function(e){var t,r;return"AA"!==(t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==t&&(t="AA"),"small"!==(r=(e.size||"small").toLowerCase())&&"large"!==r&&(r="small"),{level:t,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(e,t,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<t.length;u++)(n=c.readability(e,t[u]))>s&&(s=n,l=c(t[u]));return c.isReadable(e,l,{level:i,size:o})||!a?l:(r.includeFallbackColors=!1,c.mostReadable(e,["#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(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(L);function C(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function O(t,r){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(t)&&(t="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(t);return t=o(r,l(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function P(e){return o(1,l(0,e))}function D(e){return parseInt(e,16)}function z(e){return 1==e.length?"0"+e:""+e}function E(e){return e<=1&&(e=100*e+"%"),e}function R(t){return e.round(255*parseFloat(t)).toString(16)}function I(e){return D(e)/255}var F,N,H,B=(N="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",H="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+N),rgba:new RegExp("rgba"+H),hsl:new RegExp("hsl"+N),hsla:new RegExp("hsla"+H),hsv:new RegExp("hsv"+N),hsva:new RegExp("hsva"+H),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function j(e){return!!B.CSS_UNIT.exec(e)}void 0!==t&&t.exports?t.exports=c:window.tinycolor=c}(Math)},{}],27:[function(e,t,r){"use strict";t.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}]},{}],28:[function(e,t,r){"use strict";var n=e("./arrow_paths"),a=e("../../plots/font_attributes"),i=e("../../plots/cartesian/constants"),o=e("../../plot_api/plot_template").templatedArray;t.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":202,"../../plots/cartesian/constants":218,"../../plots/font_attributes":240,"./arrow_paths":27}],29:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("./draw").draw;function o(e){var t=e._fullLayout;n.filterVisible(t.annotations).forEach((function(t){var r=a.getFromId(e,t.xref),n=a.getFromId(e,t.yref);t._extremes={},r&&l(t,r),n&&l(t,n)}))}function l(e,t){var r,n=t._id,i=n.charAt(0),o=e[i],l=e["a"+i],s=e[i+"ref"],c=e["a"+i+"ref"],u=e["_"+i+"padplus"],f=e["_"+i+"padminus"],d={x:1,y:-1}[i]*e[i+"shift"],p=3*e.arrowsize*e.arrowwidth||0,h=p+d,g=p-d,v=3*e.startarrowsize*e.arrowwidth||0,m=v+d,y=v-d;if(c===s){var x=a.findExtremes(t,[t.r2c(o)],{ppadplus:h,ppadminus:g}),b=a.findExtremes(t,[t.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(t,[t.r2c(o)],{ppadplus:Math.max(u,h,m),ppadminus:Math.max(f,g,y)});e._extremes[n]=r}t.exports=function(e){var t=e._fullLayout;if(n.filterVisible(t.annotations).length&&e._fullData.length)return n.syncOrAsync([i,o],e)}},{"../../lib":168,"../../plots/cartesian/axes":212,"./draw":34}],30:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("../../plot_api/plot_template").arrayEditor;function o(e,t){var r,n,a,i,o,s,c,u=e._fullLayout.annotations,f=[],d=[],p=[],h=(t||[]).length;for(r=0;r<u.length;r++)if(i=(a=u[r]).clicktoshow){for(n=0;n<h;n++)if(s=(o=t[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(e,t){return"log"===t.type?t.l2r(e):t.d2r(e)}t.exports={hasClickToShow:function(e,t){var r=o(e,t);return r.on.length>0||r.explicitOff.length>0},onClick:function(e,t){var r,l,s=o(e,t),c=s.on,u=s.off.concat(s.explicitOff),f={},d=e._fullLayout.annotations;if(c.length||u.length){for(r=0;r<c.length;r++)(l=i(e.layout,"annotations",d[c[r]])).modifyItem("visible",!0),n.extendFlat(f,l.getUpdateObj());for(r=0;r<u.length;r++)(l=i(e.layout,"annotations",d[u[r]])).modifyItem("visible",!1),n.extendFlat(f,l.getUpdateObj());return a.call("update",e,{},f)}}}},{"../../lib":168,"../../plot_api/plot_template":202,"../../registry":254}],31:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../color");t.exports=function(e,t,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?t.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":168,"../color":43}],32:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib/to_log_range");t.exports=function(e,t,r,i){t=t||{};var o="log"===r&&"linear"===t.type,l="linear"===r&&"log"===t.type;if(o||l)for(var s,c,u=e._fullLayout.annotations,f=t._id.charAt(0),d=0;d<u.length;d++)s=u[d],c="annotations["+d+"].",s[f+"ref"]===t._id&&p(f),s["a"+f+"ref"]===t._id&&p("a"+f);function p(e){var r=s[e],l=null;l=o?a(r,t.range):Math.pow(10,r),n(l)||(l=null),i(c+e,l)}}},{"../../lib/to_log_range":191,"fast-isnumeric":9}],33:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("../../plots/array_container_defaults"),o=e("./common_defaults"),l=e("./attributes");function s(e,t,r){function i(r,a){return n.coerce(e,t,l,r,a)}var s=i("visible"),c=i("clicktoshow");if(s||c){o(e,t,r,i);for(var u=t.showarrow,f=["x","y"],d=[-10,-30],p={_fullLayout:r},h=0;h<2;h++){var g=f[h],v=a.coerceRef(e,t,p,g,"","paper");if("paper"!==v&&a.getFromId(p,v)._annIndices.push(t._index),a.coercePosition(t,p,i,v,g,.5),u){var m="a"+g,y=a.coerceRef(e,t,p,m,"pixel");"pixel"!==y&&y!==v&&(y=t[m]="pixel");var x="pixel"===y?d[h]:.4;a.coercePosition(t,p,i,y,m,x)}i(g+"anchor"),i(g+"shift")}if(n.noneOrAll(e,t,["x","y"]),u&&n.noneOrAll(e,t,["ax","ay"]),c){var b=i("xclick"),_=i("yclick");t._xclick=void 0===b?t.x:a.cleanPosition(b,p,t.xref),t._yclick=void 0===_?t.y:a.cleanPosition(_,p,t.yref)}}}t.exports=function(e,t){i(e,t,{name:"annotations",handleItemDefaults:s})}},{"../../lib":168,"../../plots/array_container_defaults":208,"../../plots/cartesian/axes":212,"./attributes":28,"./common_defaults":31}],34:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../registry"),i=e("../../plots/plots"),o=e("../../lib"),l=e("../../plots/cartesian/axes"),s=e("../color"),c=e("../drawing"),u=e("../fx"),f=e("../../lib/svg_text_utils"),d=e("../../lib/setcursor"),p=e("../dragelement"),h=e("../../plot_api/plot_template").arrayEditor,g=e("./draw_arrow_head");function v(e,t){var r=e._fullLayout.annotations[t]||{},n=l.getFromId(e,r.xref),a=l.getFromId(e,r.yref);n&&n.setScale(),a&&a.setScale(),m(e,r,t,!1,n,a)}function m(e,t,r,i,l,v){var m,y,x=e._fullLayout,b=e._fullLayout._size,_=e._context.edits;i?(m="annotation-"+i,y=i+".annotations"):(m="annotation",y="annotations");var w=h(e.layout,y,t),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(t._input&&!1!==t.visible){var L={x:{},y:{}},S=+t.textangle||0,C=x._infolayer.append("g").classed(m,!0).attr("data-index",String(r)).style("opacity",t.opacity),O=C.append("g").classed("annotation-text-g",!0),P=_[t.showarrow?"annotationTail":"annotationPosition"],D=t.captureevents||_.annotationText||P,z=O.append("g").style("pointer-events",D?"all":null).call(d,"pointer").on("click",(function(){e._dragging=!1,e.emit("plotly_clickannotation",q(n.event))}));t.hovertext&&z.on("mouseover",(function(){var r=t.hoverlabel,n=r.font,a=this.getBoundingClientRect(),i=e.getBoundingClientRect();u.loneHover({x0:a.left-i.left,x1:a.right-i.left,y:(a.top+a.bottom)/2-i.top,text:t.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:e})})).on("mouseout",(function(){u.loneUnhover(x._hoverlayer.node())}));var E=t.borderwidth,R=t.borderpad,I=E+R,F=z.append("rect").attr("class","bg").style("stroke-width",E+"px").call(s.stroke,t.bordercolor).call(s.fill,t.bgcolor),N=t.width||t.height,H=x._topclips.selectAll("#"+A).data(N?[0]:[]);H.enter().append("clipPath").classed("annclip",!0).attr("id",A).append("rect"),H.exit().remove();var B=t.font,j=x._meta?o.templateString(t.text,x._meta):t.text,V=z.append("text").classed("annotation-text",!0).text(j);_.annotationText?V.call(f.makeEditable,{delegate:z,gd:e}).call(U).on("edit",(function(r){t.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",e,M())})):V.call(U)}else n.selectAll("#"+A).remove();function q(e){var n={index:r,annotation:t._input,fullAnnotation:t,event:e};return i&&(n.subplotId=i),n}function U(r){return r.call(c.font,B).attr({"text-anchor":{left:"start",right:"end"}[t.align]||"middle"}),f.convertToTspans(r,e,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=t.width||m,D=t.height||y,R=Math.round(w+2*I),B=Math.round(D+2*I);function j(e,t){return"auto"===t&&(t=e<1/3?"left":e>2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[t]}for(var U=!1,G=["x","y"],Z=0;Z<G.length;Z++){var X,Y,W,J,$,Q=G[Z],K=t[Q+"ref"]||Q,ee=t["a"+Q+"ref"],te={x:l,y:v}[Q],re=(S+("x"===Q?0:-90))*Math.PI/180,ne=R*Math.cos(re),ae=B*Math.sin(re),ie=Math.abs(ne)+Math.abs(ae),oe=t[Q+"anchor"],le=t[Q+"shift"]*("x"===Q?1:-1),se=L[Q];if(te){var ce=te.r2fraction(t[Q]);(ce<0||ce>1)&&(ee===K?((ce=te.r2fraction(t["a"+Q]))<0||ce>1)&&(U=!0):U=!0),X=te._offset+te.r2p(t[Q]),J=.5}else"x"===Q?(W=t[Q],X=b.l+b.w*W):(W=1-t[Q],X=b.t+b.h*W),J=t.showarrow?.5:W;if(t.showarrow){se.head=X;var ue=t["a"+Q];$=ne*j(.5,t.xanchor)-ae*j(.5,t.yanchor),ee===K?(se.tail=te._offset+te.r2p(ue),Y=$):(se.tail=X+ue,Y=$+ue),se.text=se.tail+$;var fe=x["x"===Q?"width":"height"];if("paper"===K&&(se.head=o.constrain(se.head,1,fe-1)),"pixel"===ee){var de=-Math.max(se.tail-3,se.text),pe=Math.min(se.tail+3,se.text)-fe;de>0?(se.tail+=de,se.text+=de):pe>0&&(se.tail-=pe,se.text-=pe)}se.tail+=le,se.head+=le}else Y=$=ie*j(J,oe),se.text=X+$;se.text+=le,$+=le,Y+=le,t["_"+Q+"padplus"]=ie/2+Y,t["_"+Q+"padminus"]=ie/2-Y,t["_"+Q+"size"]=ie,t["_"+Q+"shift"]=$}if(U)z.remove();else{var he=0,ge=0;if("left"!==t.align&&(he=(w-m)*("center"===t.align?.5:1)),"top"!==t.valign&&(ge=(D-y)*("middle"===t.valign?.5:1)),u)n.select("svg").attr({x:I+he-1,y:I+ge}).call(c.setClipUrl,N?A:null,e);else{var ve=I+ge-h.top,me=I+he-h.left;V.call(f.positionText,me,ve).call(c.setClipUrl,N?A:null,e)}H.select("rect").call(c.setRect,I,I,w,D),F.call(c.setRect,E/2,E/2,R-E,B-E),z.call(c.setTranslate,Math.round(L.x.text-R/2),Math.round(L.y.text-B/2)),O.attr({transform:"rotate("+S+","+L.x.text+","+L.y.text+")"});var ye,xe=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"),E=m-.5*P,R=E+P,I=y-.5*D,N=I+D,H=[[E,I,E,N],[E,N,R,N],[R,N,R,I],[R,I,E,I]].map(A);if(!H.reduce((function(e,t){return e^!!o.segmentsIntersect(u,f,u+1e6,f+1e6,t[0],t[1],t[2],t[3])}),!1)){H.forEach((function(e){var t=o.segmentsIntersect(d,h,u,f,e[0],e[1],e[2],e[3]);t&&(d=t.x,h=t.y)}));var B=t.arrowwidth,j=t.arrowcolor,V=t.arrowside,q=C.append("g").style({opacity:s.opacity(j)}).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(j));if(g(U,V,t),_.annotationPosition&&U.node().parentNode&&!i){var G=u,Z=f;if(t.standoff){var X=Math.sqrt(Math.pow(u-d,2)+Math.pow(f-h,2));G+=t.standoff*(d-u)/X,Z+=t.standoff*(h-f)/X}var Y,W,J=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:J.node(),gd:e,prepFn:function(){var e=c.getTranslate(z);Y=e.x,W=e.y,l&&l.autorange&&k(l._name+".autorange",!0),v&&v.autorange&&k(v._name+".autorange",!0)},moveFn:function(e,r){var n=w(Y,W),a=n[0]+e,i=n[1]+r;z.call(c.setTranslate,a,i),T("x",l?l.p2r(l.r2p(t.x)+e):t.x+e/b.w),T("y",v?v.p2r(v.r2p(t.y)+r):t.y-r/b.h),t.axref===t.xref&&T("ax",l.p2r(l.r2p(t.ax)+e)),t.ayref===t.yref&&T("ay",v.p2r(v.r2p(t.ay)+r)),q.attr("transform","translate("+e+","+r+")"),O.attr({transform:"rotate("+S+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",e,M());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}};t.showarrow&&xe(0,0),P&&p.init({element:z.node(),gd:e,prepFn:function(){ye=O.attr("transform")},moveFn:function(e,r){var n="pointer";if(t.showarrow)t.axref===t.xref?T("ax",l.p2r(l.r2p(t.ax)+e)):T("ax",t.ax+e),t.ayref===t.yref?T("ay",v.p2r(v.r2p(t.ay)+r)):T("ay",t.ay+r),xe(e,r);else{if(i)return;var a,o;if(l)a=l.p2r(l.r2p(t.x)+e);else{var s=t._xsize/b.w,c=t.x+(t._xshift-t.xshift)/b.w-s/2;a=p.align(c+e/b.w,s,0,1,t.xanchor)}if(v)o=v.p2r(v.r2p(t.y)+r);else{var u=t._ysize/b.h,f=t.y-(t._yshift+t.yshift)/b.h-u/2;o=p.align(f-r/b.h,u,0,1,t.yanchor)}T("x",a),T("y",o),l&&v||(n=p.getCursor(l?.5:a,v?.5:o,t.xanchor,t.yanchor))}O.attr({transform:"translate("+e+","+r+")"+ye}),d(z,n)},clickFn:function(r,n){t.captureevents&&e.emit("plotly_clickannotation",q(n))},doneFn:function(){d(z),a.call("_guiRelayout",e,M());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}}t.exports={draw:function(e){var t=e._fullLayout;t._infolayer.selectAll(".annotation").remove();for(var r=0;r<t.annotations.length;r++)t.annotations[r].visible&&v(e,r);return i.previousPromises(e)},drawOne:v,drawRaw:m}},{"../../lib":168,"../../lib/setcursor":187,"../../lib/svg_text_utils":189,"../../plot_api/plot_template":202,"../../plots/cartesian/axes":212,"../../plots/plots":246,"../../registry":254,"../color":43,"../dragelement":62,"../drawing":65,"../fx":83,"./draw_arrow_head":35,d3:7}],35:[function(e,t,r){"use strict";var n=e("d3"),a=e("../color"),i=e("./arrow_paths");t.exports=function(e,t,r){var o,l,s,c,u=e.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=t.indexOf("start")>=0,v=t.indexOf("end")>=0,m=f.backoff*p+r.standoff,y=d.backoff*h+r.startstandoff;if("line"===u.nodeName){o={x:+e.attr("x1"),y:+e.attr("y1")},l={x:+e.attr("x2"),y:+e.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,e.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,e.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",e.style("stroke-dasharray",A)}function P(){e.style("stroke-dasharray","0px,100px")}function D(t,i,o,l){t.path&&(t.noRotate&&(o=0),n.select(u.parentNode).append("path").attr({class:e.attr("class"),d:t.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":43,"./arrow_paths":27,d3:7}],36:[function(e,t,r){"use strict";var n=e("./draw"),a=e("./click");t.exports={moduleType:"component",name:"annotations",layoutAttributes:e("./attributes"),supplyLayoutDefaults:e("./defaults"),includeBasePlot:e("../../plots/cartesian/include_components")("annotations"),calcAutorange:e("./calc_autorange"),draw:n.draw,drawOne:n.drawOne,drawRaw:n.drawRaw,hasClickToShow:a.hasClickToShow,onClick:a.onClick,convertCoords:e("./convert_coords")}},{"../../plots/cartesian/include_components":224,"./attributes":28,"./calc_autorange":29,"./click":30,"./convert_coords":32,"./defaults":33,"./draw":34}],37:[function(e,t,r){"use strict";var n=e("../annotations/attributes"),a=e("../../plot_api/edit_types").overrideAll,i=e("../../plot_api/plot_template").templatedArray;t.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":195,"../../plot_api/plot_template":202,"../annotations/attributes":28}],38:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes");function i(e,t){var r=t.fullSceneLayout.domain,i=t.fullLayout._size,o={pdata:null,type:"linear",autorange:!1,range:[-1/0,1/0]};e._xa={},n.extendFlat(e._xa,o),a.setConvert(e._xa),e._xa._offset=i.l+r.x[0]*i.w,e._xa.l2p=function(){return.5*(1+e._pdata[0]/e._pdata[3])*i.w*(r.x[1]-r.x[0])},e._ya={},n.extendFlat(e._ya,o),a.setConvert(e._ya),e._ya._offset=i.t+(1-r.y[1])*i.h,e._ya.l2p=function(){return.5*(1-e._pdata[1]/e._pdata[3])*i.h*(r.y[1]-r.y[0])}}t.exports=function(e){for(var t=e.fullSceneLayout.annotations,r=0;r<t.length;r++)i(t[r],e);e.fullLayout._infolayer.selectAll(".annotation-"+e.id).remove()}},{"../../lib":168,"../../plots/cartesian/axes":212}],39:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("../../plots/array_container_defaults"),o=e("../annotations/common_defaults"),l=e("./attributes");function s(e,t,r,i){function s(r,a){return n.coerce(e,t,l,r,a)}function c(e){var n=e+"axis",i={_fullLayout:{}};return i._fullLayout[n]=r[n],a.coercePosition(t,i,s,e,e,.5)}s("visible")&&(o(e,t,i.fullLayout,s),c("x"),c("y"),c("z"),n.noneOrAll(e,t,["x","y","z"]),t.xref="x",t.yref="y",t.zref="z",s("xanchor"),s("yanchor"),s("xshift"),s("yshift"),t.showarrow&&(t.axref="pixel",t.ayref="pixel",s("ax",-10),s("ay",-30),n.noneOrAll(e,t,["ax","ay"])))}t.exports=function(e,t,r){i(e,t,{name:"annotations",handleItemDefaults:s,fullLayout:r.fullLayout})}},{"../../lib":168,"../../plots/array_container_defaults":208,"../../plots/cartesian/axes":212,"../annotations/common_defaults":31,"./attributes":37}],40:[function(e,t,r){"use strict";var n=e("../annotations/draw").drawRaw,a=e("../../plots/gl3d/project"),i=["x","y","z"];t.exports=function(e){for(var t=e.fullSceneLayout,r=e.dataScale,o=t.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=t[f+"axis"].r2fraction(d);if(p<0||p>1){c=!0;break}}c?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+l+'"]').remove():(s._pdata=a(e.glplot.cameraParams,[t.xaxis.r2l(s.x)*r[0],t.yaxis.r2l(s.y)*r[1],t.zaxis.r2l(s.z)*r[2]]),n(e.graphDiv,s,l,e.id,s._xa,s._ya))}}},{"../../plots/gl3d/project":243,"../annotations/draw":34}],41:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:e("./attributes")}}},layoutAttributes:e("./attributes"),handleDefaults:e("./defaults"),includeBasePlot:function(e,t){var r=n.subplotsRegistry.gl3d;if(r)for(var i=r.attrRegex,o=Object.keys(e),l=0;l<o.length;l++){var s=o[l];i.test(s)&&(e[s].annotations||[]).length&&(a.pushUnique(t._basePlotModules,r),a.pushUnique(t._subplots.gl3d,s))}},convert:e("./convert"),draw:e("./draw")}},{"../../lib":168,"../../registry":254,"./attributes":37,"./convert":38,"./defaults":39,"./draw":40}],42:[function(e,t,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},{}],43:[function(e,t,r){"use strict";var n=e("tinycolor2"),a=e("fast-isnumeric"),i=t.exports={},o=e("./attributes");i.defaults=o.defaults;var l=i.defaultLine=o.defaultLine;i.lightLine=o.lightLine;var s=i.background=o.background;function c(e){if(a(e)||"string"!=typeof e)return e;var t=e.trim();if("rgb"!==t.substr(0,3))return e;var r=t.match(/^rgba?\s*\(([^()]*)\)$/);if(!r)return e;var n=r[1].trim().split(/\s*[\s,]\s*/),i="a"===t.charAt(3)&&4===n.length;if(!i&&3!==n.length)return e;for(var o=0;o<n.length;o++){if(!n[o].length)return e;if(n[o]=Number(n[o]),!(n[o]>=0))return e;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return e}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(e){var t=e.toRgb();return"rgb("+Math.round(t.r)+", "+Math.round(t.g)+", "+Math.round(t.b)+")"},i.rgb=function(e){return i.tinyRGB(n(e))},i.opacity=function(e){return e?n(e).getAlpha():0},i.addOpacity=function(e,t){var r=n(e).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+t+")"},i.combine=function(e,t){var r=n(e).toRgb();if(1===r.a)return n(e).toRgbString();var a=n(t||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(e,t,r){var a=n(e);return 1!==a.getAlpha()&&(a=n(i.combine(e,s))),(a.isDark()?t?a.lighten(t):s:r?a.darken(r):l).toString()},i.stroke=function(e,t){var r=n(t);e.style({stroke:i.tinyRGB(r),"stroke-opacity":r.getAlpha()})},i.fill=function(e,t){var r=n(t);e.style({fill:i.tinyRGB(r),"fill-opacity":r.getAlpha()})},i.clean=function(e){if(e&&"object"==typeof e){var t,r,n,a,o=Object.keys(e);for(t=0;t<o.length;t++)if(a=e[n=o[t]],"color"===n.substr(n.length-5))if(Array.isArray(a))for(r=0;r<a.length;r++)a[r]=c(a[r]);else e[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":42,"fast-isnumeric":9,tinycolor2:26}],44:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/layout_attributes"),a=e("../../plots/font_attributes"),i=e("../../lib/extend").extendFlat,o=e("../../plot_api/edit_types").overrideAll;t.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":163,"../../plot_api/edit_types":195,"../../plots/cartesian/layout_attributes":226,"../../plots/font_attributes":240}],45:[function(e,t,r){"use strict";t.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"}}},{}],46:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plot_api/plot_template"),i=e("../../plots/cartesian/tick_value_defaults"),o=e("../../plots/cartesian/tick_mark_defaults"),l=e("../../plots/cartesian/tick_label_defaults"),s=e("./attributes");t.exports=function(e,t,r){var c=a.newContainer(t,"colorbar"),u=e.colorbar||{};function f(e,t){return n.coerce(u,c,s,e,t)}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":168,"../../plot_api/plot_template":202,"../../plots/cartesian/tick_label_defaults":233,"../../plots/cartesian/tick_mark_defaults":234,"../../plots/cartesian/tick_value_defaults":235,"./attributes":44}],47:[function(e,t,r){"use strict";var n=e("d3"),a=e("tinycolor2"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../plots/cartesian/axes"),s=e("../dragelement"),c=e("../../lib"),u=e("../../lib/extend").extendFlat,f=e("../../lib/setcursor"),d=e("../drawing"),p=e("../color"),h=e("../titles"),g=e("../../lib/svg_text_utils"),v=e("../colorscale/helpers").flipScale,m=e("../../plots/cartesian/axis_defaults"),y=e("../../plots/cartesian/position_defaults"),x=e("../../plots/cartesian/layout_attributes"),b=e("../../constants/alignment"),_=b.LINE_SPACING,w=b.FROM_TL,k=b.FROM_BR,T=e("./constants").cn;t.exports={draw:function(e){var t=e._fullLayout._infolayer.selectAll("g."+T.colorbar).data(function(e){var t,r,n,a,i=e._fullLayout,o=e.calcdata,l=[];function s(e){return u(e,{_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(e,n,t):(t._fillgradient=r.reversescale?v(r.colorscale):r.colorscale,t._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&&((t=s(r.colorbar))._id="cb"+n.uid+(h&&y?"-"+y:""),t._traceIndex=n.index,t._propPrefix=(y?y+".":"")+"colorbar.",t._meta=n._meta,c(),l.push(t))}}for(var x in i._colorAxes)if((r=i[x]).showscale){var b=i._colorAxes[x];(t=s(r.colorbar))._id="cb"+x,t._propPrefix=x+".colorbar.",t._meta=i._meta,a={min:"cmin",max:"cmax"},"heatmap"!==b[0]&&(n=b[1],a.calc=n._module.colorbar.calc),c(),l.push(t)}return l}(e),(function(e){return e._id}));t.enter().append("g").attr("class",(function(e){return e._id})).classed(T.colorbar,!0),t.each((function(t){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(e){e.classed(T.crisp,!0)})),c.ensureSingle(r,"g",T.cbtitleunshift,(function(e){e.append("g").classed(T.cbtitle,!0)})),c.ensureSingle(r,"rect",T.cboutline);var v=function(e,t,r){var o=r._fullLayout,s=o._size,f=t._fillcolor,v=t._line,b=t.title,M=b.side,A=t._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=t._levels,O=function(e,t,r){var n,a,i=t._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(t._fillgradient)l=[0];else if("function"==typeof t._fillcolor){var d=t._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(e){return e-i.size/2}))).push(l[l.length-1]+i.size)}else t._fillcolor&&"string"==typeof t._fillcolor&&(l=[0]);return i.size<0&&(o.reverse(),l.reverse()),{line:o,fill:l}}(0,t,A),P=O.fill,D=O.line,z=Math.round(t.thickness*("fraction"===t.thicknessmode?s.w:1)),E=z/s.w,R=Math.round(t.len*("fraction"===t.lenmode?s.h:1)),I=R/s.h,F=t.xpad/s.w,N=(t.borderwidth+t.outlinewidth)/2,H=t.ypad/s.h,B=Math.round(t.x*s.w+t.xpad),j=t.x-E*({middle:.5,right:1}[t.xanchor]||0),V=t.y+I*(({top:-.5,bottom:.5}[t.yanchor]||0)-.5),q=Math.round(s.h*(1-V)),U=q-R;t._lenFrac=I,t._thickFrac=E,t._xLeftFrac=j,t._yBottomFrac=V;var G=t._axis=function(e,t,r){var n=e._fullLayout,a={type:"linear",range:r,tickmode:t.tickmode,nticks:t.nticks,tick0:t.tick0,dtick:t.dtick,tickvals:t.tickvals,ticktext:t.ticktext,ticks:t.ticks,ticklen:t.ticklen,tickwidth:t.tickwidth,tickcolor:t.tickcolor,showticklabels:t.showticklabels,tickfont:t.tickfont,tickangle:t.tickangle,tickformat:t.tickformat,exponentformat:t.exponentformat,separatethousands:t.separatethousands,showexponent:t.showexponent,showtickprefix:t.showtickprefix,tickprefix:t.tickprefix,showticksuffix:t.showticksuffix,ticksuffix:t.ticksuffix,title:t.title,showline:!0,anchor:"free",side:"right",position:1},i={type:"linear",_id:"y"+t._id},o={letter:"y",font:n.font,noHover:!0,noTickson:!0,calendar:n.calendar};function l(e,t){return c.coerce(a,i,x,e,t)}return m(a,i,l,o,n),y(a,i,l,o),i}(r,t,A);if(G.position=t.x+F+E,-1!==["top","bottom"].indexOf(M)&&(G.title.side=M,G.titlex=t.x+F,G.titley=V+("top"===b.side?I-H:H)),v.color&&"auto"===t.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])/((t.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+H,V+I-H],G.setScale(),e.attr("transform","translate("+Math.round(s.l)+","+Math.round(s.t)+")");var J,$=e.select("."+T.cbtitleunshift).attr("transform","translate(-"+Math.round(s.l)+",-"+Math.round(s.t)+")"),Q=e.select("."+T.cbaxis),K=0;function ee(n,a){var i={propContainer:G,propName:t._propPrefix+"title",traceIndex:t._traceIndex,_meta:t._meta,placeholder:o._dfltTitle.colorbar,containerGroup:e.select("."+T.cbtitle)},l="h"===n.charAt(0)?n.substr(1):"h"+n;e.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 e,r=s.l+(t.x+F)*s.w,n=G.title.font.size;e="top"===M?(1-(V+I-H))*s.h+s.t+3+.75*n:(1-(V+H))*s.h+s.t-3-.25*n,ee(G._id+"title",{attributes:{x:r,y:e,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(M)){var i=e.select("."+T.cbtitle),o=i.select("text"),u=[-t.outlinewidth/2,t.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()}}e.selectAll("."+T.cbfills+",."+T.cblines).attr("transform","translate(0,"+Math.round(s.h*(1-G.domain[1]))+")"),Q.attr("transform","translate(0,"+Math.round(-s.t)+")");var m=e.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(e,t){return e-t}));m.each((function(e,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(t._fillgradient)d.gradient(l,r,t._id,"vertical",t._fillgradient,"fill");else{var s=S(e).replace("e-","");l.attr("fill",a(s).toHexString())}}));var x=e.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(e){n.select(this).attr("d","M"+B+","+(Math.round(G.c2p(e))+v.width/2%1)+"h"+z).call(d.lineGroupStyle,v.width,L(e),v.dash)})),Q.selectAll("g."+G._id+"tick,path").remove();var b=B+z+(t.outlinewidth||0)/2-("outside"===t.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:Q,path:l.makeTickPath(G,b,C),transFn:k}),l.drawLabels(r,G,{vals:w,layer:Q,transFn:k,labelFns:l.makeLabelFns(G,b)})},function(){if(-1===["top","bottom"].indexOf(M)){var e=G.title.font.size,t=G._offset+G._length/2,a=s.l+(G.position||0)*s.w+("right"===G.side?10+e*(G.showticklabels?1:.5):-10-e*(G.showticklabels?.5:0));ee("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:t,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},i.previousPromises,function(){var n=z+t.outlinewidth/2+d.bBox(Q.node()).width;if((J=$.select("text")).node()&&!J.classed(T.jsPlaceholder)){var a,o=$.select(".h"+G._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(M)?d.bBox(o).width:d.bBox($.node()).right-B-s.l,n=Math.max(n,a)}var l=2*t.xpad+n+t.borderwidth+t.outlinewidth/2,c=q-U;e.select("."+T.cbbg).attr({x:B-t.xpad-(t.borderwidth+t.outlinewidth)/2,y:U-N,width:Math.max(l,2),height:Math.max(c+2*N,2)}).call(p.fill,t.bgcolor).call(p.stroke,t.bordercolor).style("stroke-width",t.borderwidth),e.selectAll("."+T.cboutline).attr({x:B,y:U+t.ypad+("top"===M?K:0),width:Math.max(z,2),height:Math.max(c-2*t.ypad-K,2)}).call(p.stroke,t.outlinecolor).style({fill:"none","stroke-width":t.outlinewidth});var u=({center:.5,right:1}[t.xanchor]||0)*l;e.attr("transform","translate("+(s.l-u)+","+s.t+")");var f={},h=w[t.yanchor],g=k[t.yanchor];"pixels"===t.lenmode?(f.y=t.y,f.t=c*h,f.b=c*g):(f.t=f.b=0,f.yt=t.y+t.len*h,f.yb=t.y-t.len*g);var v=w[t.xanchor],m=k[t.xanchor];if("pixels"===t.thicknessmode)f.x=t.x,f.l=l*v,f.r=l*m;else{var y=l-z;f.l=y*v,f.r=y*m,f.xl=t.x-t.thickness*v,f.xr=t.x+t.thickness*m}i.autoMargin(r,t._id,f)}],r)}(r,t,e);v&&v.then&&(e._promises||[]).push(v),e._context.edits.colorbarPosition&&function(e,t,r){var n,a,i,l=r._fullLayout._size;s.init({element:e.node(),gd:r,prepFn:function(){n=e.attr("transform"),f(e)},moveFn:function(r,o){e.attr("transform",n+" translate("+r+","+o+")"),a=s.align(t._xLeftFrac+r/l.w,t._thickFrac,0,1,t.xanchor),i=s.align(t._yBottomFrac-o/l.h,t._lenFrac,0,1,t.yanchor);var c=s.getCursor(a,i,t.xanchor,t.yanchor);f(e,c)},doneFn:function(){if(f(e),void 0!==a&&void 0!==i){var n={};n[t._propPrefix+"x"]=a,n[t._propPrefix+"y"]=i,void 0!==t._traceIndex?o.call("_guiRestyle",r,n,t._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,t,e)})),t.exit().each((function(t){i.autoMargin(e,t._id)})).remove(),t.order()}}},{"../../constants/alignment":145,"../../lib":168,"../../lib/extend":163,"../../lib/setcursor":187,"../../lib/svg_text_utils":189,"../../plots/cartesian/axes":212,"../../plots/cartesian/axis_defaults":214,"../../plots/cartesian/layout_attributes":226,"../../plots/cartesian/position_defaults":229,"../../plots/plots":246,"../../registry":254,"../color":43,"../colorscale/helpers":54,"../dragelement":62,"../drawing":65,"../titles":138,"./constants":45,d3:7,tinycolor2:26}],48:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e){return n.isPlainObject(e.colorbar)}},{"../../lib":168}],49:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"colorbar",attributes:e("./attributes"),supplyDefaults:e("./defaults"),draw:e("./draw").draw,hasColorbar:e("./has_colorbar")}},{"./attributes":44,"./defaults":46,"./draw":47,"./has_colorbar":48}],50:[function(e,t,r){"use strict";var n=e("../colorbar/attributes"),a=e("../../lib/regex").counter,i=e("./scales.js").scales;function o(e){return"`"+e+"`"}Object.keys(i),t.exports=function(e,t){e=e||"";var r,l=(t=t||{}).cLetter||"c",s=("onlyIfNumerical"in t?t.onlyIfNumerical:Boolean(e),"noScale"in t?t.noScale:"marker.line"===e),c="showScaleDflt"in t?t.showScaleDflt:"z"===l,u="string"==typeof t.colorscaleDflt?i[t.colorscaleDflt]:null,f=t.editTypeOverride||"",d=e?e+".":"";"colorAttr"in t?(r=t.colorAttr,t.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"},t.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!==t.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),t.noColorAxis||(x.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),x}},{"../../lib/regex":183,"../colorbar/attributes":44,"./scales.js":58}],51:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("./helpers").extractOpts;t.exports=function(e,t,r){var o,l=e._fullLayout,s=r.vals,c=r.containerStr,u=c?a.nestedProperty(t,c).get():t,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":168,"./helpers":54,"fast-isnumeric":9}],52:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./helpers").hasColorscale,i=e("./helpers").extractOpts;t.exports=function(e,t){function r(e,t){var r=e["_"+t];void 0!==r&&(e[t]=r)}function o(e,a){var o=a.container?n.nestedProperty(e,a.container).get():e;if(o)if(o.coloraxis)o._colorAx=t[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<e.length;l++){var s=e[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 t._colorAxes)o(t[f],{min:"cmin",max:"cmax"})}},{"../../lib":168,"./helpers":54}],53:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("../colorbar/has_colorbar"),o=e("../colorbar/defaults"),l=e("./scales").isValid,s=e("../../registry").traceIs;function c(e,t){var r=t.slice(0,t.length-1);return t?a.nestedProperty(e,r).get()||{}:e}t.exports=function e(t,r,u,f,d){var p=d.prefix,h=d.cLetter,g="_module"in r,v=c(t,p),m=c(r,p),y=c(r._template||{},p)||{},x=function(){return delete t.coloraxis,delete r.coloraxis,e(t,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":168,"../../registry":254,"../colorbar/defaults":46,"../colorbar/has_colorbar":48,"./scales":58,"fast-isnumeric":9}],54:[function(e,t,r){"use strict";var n=e("d3"),a=e("tinycolor2"),i=e("fast-isnumeric"),o=e("../../lib"),l=e("../color"),s=e("./scales").isValid,c=["showscale","autocolorscale","colorscale","reversescale","colorbar"],u=["min","max","mid","auto"];function f(e){var t,r,n,a=e._colorAx,i=a||e,o={};for(r=0;r<c.length;r++)o[n=c[r]]=i[n];if(a)for(t="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||(l="z"+n)in i)&&(o[n]=i[l]);t=l.charAt(0)}return o._sync=function(e,r){var n=-1!==u.indexOf(e)?t+e:e;i[n]=i["_"+n]=r},o}function d(e){for(var t=f(e),r=t.min,n=t.max,a=t.reversescale?p(t.colorscale):t.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(e){for(var t=e.length,r=new Array(t),n=t-1,a=0;n>=0;n--,a++){var i=e[n];r[a]=[1-i[0],i[1]]}return r}function h(e,t){t=t||{};for(var r=e.domain,o=e.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=t.noNumericCheck,v=t.returnArray;return(d=h&&v?p:h?function(e){return g(p(e))}:v?function(e){return i(e)?p(e):a(e).isValid()?e:l.defaultLine}:function(e){return i(e)?g(p(e)):a(e).isValid()?e:l.defaultLine}).domain=p.domain,d.range=function(){return o},d}function g(e){var t={r:e[0],g:e[1],b:e[2],a:e[3]};return a(t).toRgbString()}t.exports={hasColorscale:function(e,t,r){var n=t?o.nestedProperty(e,t).get()||{}:e,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(e,t){return h(d(e),t)}}},{"../../lib":168,"../color":43,"./scales":58,d3:7,"fast-isnumeric":9,tinycolor2:26}],55:[function(e,t,r){"use strict";var n=e("./scales"),a=e("./helpers");t.exports={moduleType:"component",name:"colorscale",attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyLayoutDefaults:e("./layout_defaults"),handleDefaults:e("./defaults"),crossTraceDefaults:e("./cross_trace_defaults"),calc:e("./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":50,"./calc":51,"./cross_trace_defaults":52,"./defaults":53,"./helpers":54,"./layout_attributes":56,"./layout_defaults":57,"./scales":58}],56:[function(e,t,r){"use strict";var n=e("../../lib/extend").extendFlat,a=e("./attributes"),i=e("./scales").scales;t.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":163,"./attributes":50,"./scales":58}],57:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plot_api/plot_template"),i=e("./layout_attributes"),o=e("./defaults");t.exports=function(e,t){function r(r,a){return n.coerce(e,t,i,r,a)}r("colorscale.sequential"),r("colorscale.sequentialminus"),r("colorscale.diverging");var l,s,c=t._colorAxes;function u(e,t){return n.coerce(l,s,i.coloraxis,e,t)}for(var f in c){var d=c[f];if(d[0])l=e[f]||{},(s=a.newContainer(t,f,"coloraxis"))._name=f,o(l,s,t,u,{prefix:"",cLetter:"c"});else{for(var p=0;p<d[2].length;p++)d[2][p]();delete t._colorAxes[f]}}}},{"../../lib":168,"../../plot_api/plot_template":202,"./defaults":53,"./layout_attributes":56}],58:[function(e,t,r){"use strict";var n=e("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(e){var t=0;if(!Array.isArray(e)||e.length<2)return!1;if(!e[0]||!e[e.length-1])return!1;if(0!=+e[0][0]||1!=+e[e.length-1][0])return!1;for(var r=0;r<e.length;r++){var a=e[r];if(2!==a.length||+a[0]<t||!n(a[1]).isValid())return!1;t=+a[0]}return!0}t.exports={scales:a,defaultScale:i,get:function(e,t){if(t||(t=i),!e)return t;function r(){try{e=a[e]||JSON.parse(e)}catch(r){e=t}}return"string"==typeof e&&(r(),"string"==typeof e&&r()),o(e)?e:t},isValid:function(e){return void 0!==a[e]||o(e)}}},{tinycolor2:26}],59:[function(e,t,r){"use strict";t.exports=function(e,t,r,n,a){var i=(e-r)/(n-r),o=i+t/(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}},{}],60:[function(e,t,r){"use strict";var n=e("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];t.exports=function(e,t,r,i){return e="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*e),0,2),t="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*t),0,2),a[t][e]}},{"../../lib":168}],61:[function(e,t,r){"use strict";r.selectMode=function(e){return"lasso"===e||"select"===e},r.drawMode=function(e){return"drawclosedpath"===e||"drawopenpath"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.openMode=function(e){return"drawline"===e||"drawopenpath"===e},r.rectMode=function(e){return"select"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.freeMode=function(e){return"lasso"===e||"drawclosedpath"===e||"drawopenpath"===e},r.selectingOrDrawing=function(e){return r.freeMode(e)||r.rectMode(e)}},{}],62:[function(e,t,r){"use strict";var n=e("mouse-event-offset"),a=e("has-hover"),i=e("has-passive-events"),o=e("../../lib").removeElement,l=e("../../plots/cartesian/constants"),s=t.exports={};s.align=e("./align"),s.getCursor=e("./cursor");var c=e("./unhover");function u(){var e=document.createElement("div");e.className="dragcover";var t=e.style;return t.position="fixed",t.left=0,t.right=0,t.top=0,t.bottom=0,t.zIndex=999999999,t.background="none",document.body.appendChild(e),e}function f(e){return n(e.changedTouches?e.changedTouches[0]:e,document.body)}s.unhover=c.wrapped,s.unhoverRaw=c.raw,s.init=function(e){var t,r,n,c,d,p,h,g,v=e.gd,m=1,y=v._context.doubleClickDelay,x=e.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=e.clampFn||function(e,t,r){return Math.abs(e)<r&&(e=0),Math.abs(t)<r&&(t=0),[e,t]};function _(i){v._dragged=!1,v._dragging=!0;var o=f(i);t=o[0],r=o[1],h=i.target,p=i,g=2===i.buttons||i.ctrlKey,void 0===i.clientX&&void 0===i.clientY&&(i.clientX=t,i.clientY=r),(n=(new Date).getTime())-v._mouseDownTime<y?m+=1:(m=1,v._mouseDownTime=n),e.prepFn&&e.prepFn(i,t,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!==e.dragmode&&(i.preventDefault(),document.addEventListener("mousemove",w),document.addEventListener("touchmove",w,{passive:!1}))}function w(n){n.preventDefault();var a=f(n),i=e.minDrag||l.MINDRAG,o=b(a[0]-t,a[1]-r,i),c=o[0],u=o[1];(c||u)&&(v._dragged=!0,s.unhover(v)),v._dragged&&e.moveFn&&!g&&(v._dragdata={element:x,dx:c,dy:u},e.moveFn(c,u))}function k(t){if(delete v._dragdata,!1!==e.dragmode&&(t.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)e.doneFn&&e.doneFn();else if(e.clickFn&&e.clickFn(m,p),!g){var r;try{r=new MouseEvent("click",t)}catch(e){var n=f(t);(r=document.createEvent("MouseEvents")).initMouseEvent("click",t.bubbles,t.cancelable,t.view,t.detail,t.screenX,t.screenY,n[0],n[1],t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget)}h.dispatchEvent(r)}v._dragging=!1,v._dragged=!1}else v._dragged=!1}},s.coverSlip=u},{"../../lib":168,"../../plots/cartesian/constants":218,"./align":59,"./cursor":60,"./unhover":63,"has-hover":11,"has-passive-events":12,"mouse-event-offset":15}],63:[function(e,t,r){"use strict";var n=e("../../lib/events"),a=e("../../lib/throttle"),i=e("../../lib/dom").getGraphDiv,o=e("../fx/constants"),l=t.exports={};l.wrapped=function(e,t,r){(e=i(e))._fullLayout&&a.clear(e._fullLayout._uid+o.HOVERID),l.raw(e,t,r)},l.raw=function(e,t){var r=e._fullLayout,a=e._hoverdata;t||(t={}),t.target&&!1===n.triggerHandler(e,"plotly_beforehover",t)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,t.target&&a&&e.emit("plotly_unhover",{event:t,points:a}))}},{"../../lib/dom":161,"../../lib/events":162,"../../lib/throttle":190,"../fx/constants":77}],64:[function(e,t,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],65:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("tinycolor2"),o=e("../../registry"),l=e("../color"),s=e("../colorscale"),c=e("../../lib"),u=e("../../lib/svg_text_utils"),f=e("../../constants/xmlns_namespaces"),d=e("../../constants/alignment").LINE_SPACING,p=e("../../constants/interactions").DESELECTDIM,h=e("../../traces/scatter/subtypes"),g=e("../../traces/scatter/make_bubble_size_func"),v=e("../../components/fx/helpers").appendArrayPointValue,m=t.exports={};m.font=function(e,t,r,n){c.isPlainObject(t)&&(n=t.color,r=t.size,t=t.family),t&&e.style("font-family",t),r+1&&e.style("font-size",r+"px"),n&&e.call(l.fill,n)},m.setPosition=function(e,t,r){e.attr("x",t).attr("y",r)},m.setSize=function(e,t,r){e.attr("width",t).attr("height",r)},m.setRect=function(e,t,r,n,a){e.call(m.setPosition,t,r).call(m.setSize,n,a)},m.translatePoint=function(e,t,r,n){var i=r.c2p(e.x),o=n.c2p(e.y);return!!(a(i)&&a(o)&&t.node())&&("text"===t.node().nodeName?t.attr("x",i).attr("y",o):t.attr("transform","translate("+i+","+o+")"),!0)},m.translatePoints=function(e,t,r){e.each((function(e){var a=n.select(this);m.translatePoint(e,a,t,r)}))},m.hideOutsideRangePoint=function(e,t,r,n,a,i){t.attr("display",r.isPtWithinRange(e,a)&&n.isPtWithinRange(e,i)?null:"none")},m.hideOutsideRangePoints=function(e,t){if(t._hasClipOnAxisFalse){var r=t.xaxis,a=t.yaxis;e.each((function(t){var i=t[0].trace,l=i.xcalendar,s=i.ycalendar,c=o.traceIs(i,"bar-like")?".bartext":".point,.textpoint";e.selectAll(c).each((function(e){m.hideOutsideRangePoint(e,n.select(this),r,a,l,s)}))}))}},m.crispRound=function(e,t,r){return t&&a(t)?e._context.staticPlot?t:t<1?1:Math.round(t):r||0},m.singleLineStyle=function(e,t,r,n,a){t.style("fill","none");var i=(((e||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,s=a||i.dash||"";l.stroke(t,n||i.color),m.dashLine(t,s,o)},m.lineGroupStyle=function(e,t,r,a){e.style("fill","none").each((function(e){var i=(((e||[])[0]||{}).trace||{}).line||{},o=t||i.width||0,s=a||i.dash||"";n.select(this).call(l.stroke,r||i.color).call(m.dashLine,s,o)}))},m.dashLine=function(e,t,r){r=+r||0,t=m.dashStyle(t,r),e.style({"stroke-dasharray":t,"stroke-width":r+"px"})},m.dashStyle=function(e,t){t=+t||1;var r=Math.max(t,3);return"solid"===e?e="":"dot"===e?e=r+"px,"+r+"px":"dash"===e?e=3*r+"px,"+3*r+"px":"longdash"===e?e=5*r+"px,"+5*r+"px":"dashdot"===e?e=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===e&&(e=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),e},m.singleFillStyle=function(e){var t=(((n.select(e.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;t&&e.call(l.fill,t)},m.fillGroupStyle=function(e){e.style("stroke-width",0).each((function(e){var t=n.select(this);e[0].trace&&t.call(l.fill,e[0].trace.fillcolor)}))};var y=e("./symbol_defs");m.symbolNames=[],m.symbolFuncs=[],m.symbolNeedLines={},m.symbolNoDot={},m.symbolNoFill={},m.symbolList=[],Object.keys(y).forEach((function(e){var t=y[e],r=t.n;m.symbolList.push(r,e,r+100,e+"-open"),m.symbolNames[r]=e,m.symbolFuncs[r]=t.f,t.needLine&&(m.symbolNeedLines[r]=!0),t.noDot?m.symbolNoDot[r]=!0:m.symbolList.push(r+200,e+"-dot",r+300,e+"-open-dot"),t.noFill&&(m.symbolNoFill[r]=!0)}));var x=m.symbolNames.length;function b(e,t){var r=e%100;return m.symbolFuncs[r](t)+(e>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}m.symbolNumber=function(e){if("string"==typeof e){var t=0;e.indexOf("-open")>0&&(t=100,e=e.replace("-open","")),e.indexOf("-dot")>0&&(t+=200,e=e.replace("-dot","")),(e=m.symbolNames.indexOf(e))>=0&&(e+=t)}return e%100>=x||e>=400?0:Math.floor(Math.max(e,0))};var _={x1:1,x2:0,y1:0,y2:0},w={x1:0,x2:0,y1:1,y2:0},k=n.format("~.1f"),T={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:_},horizontalreversed:{node:"linearGradient",attrs:_,reversed:!0},vertical:{node:"linearGradient",attrs:w},verticalreversed:{node:"linearGradient",attrs:w,reversed:!0}};m.gradient=function(e,t,r,a,o,s){for(var u=o.length,f=T[a],d=new Array(u),p=0;p<u;p++)f.reversed?d[u-1-p]=[k(100*(1-o[p][0])),o[p][1]]:d[p]=[k(100*o[p][0]),o[p][1]];var h=t._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 e=n.select(this);f.attrs&&e.attr(f.attrs),e.attr("id",g);var t=e.selectAll("stop").data(d);t.exit().remove(),t.enter().append("stop"),t.each((function(e){var t=i(e[1]);n.select(this).attr({offset:e[0]+"%","stop-color":l.tinyRGB(t),"stop-opacity":t.getAlpha()})}))})),e.style(s,z(g,t)).style(s+"-opacity",null);var m=function(e){return"."+e.attr("class").replace(/\s/g,".")},y=m(n.select(e.node().parentNode))+">"+m(e);h._gradientUrlQueryParts[y]=1},m.initGradients=function(e){var t=e._fullLayout;c.ensureSingle(t._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),t._gradientUrlQueryParts={}},m.pointStyle=function(e,t,r){if(e.size()){var a=m.makePointStyleFns(t);e.each((function(e){m.singlePointStyle(e,n.select(this),t,a,r)}))}},m.singlePointStyle=function(e,t,r,n,a){var i=r.marker,o=i.line;if(t.style("opacity",n.selectedOpacityFn?n.selectedOpacityFn(e):void 0===e.mo?i.opacity:e.mo),n.ms2mrc){var s;s="various"===e.ms||"various"===i.size?3:n.ms2mrc(e.ms),e.mrc=s,n.selectedSizeFn&&(s=e.mrc=n.selectedSizeFn(e));var u=m.symbolNumber(e.mx||i.symbol)||0;e.om=u%200>=100,t.attr("d",b(u,s))}var f,d,p,h=!1;if(e.so)p=o.outlierwidth,d=o.outliercolor,f=i.outliercolor;else{var g=(o||{}).width;p=(e.mlw+1||g+1||(e.trace?(e.trace.marker.line||{}).width:0)+1)-1||0,d="mlc"in e?e.mlcc=n.lineScale(e.mlc):c.isArrayOrTypedArray(o.color)?l.defaultLine:o.color,c.isArrayOrTypedArray(i.color)&&(f=l.defaultLine,h=!0),f="mc"in e?e.mcc=n.markerScale(e.mc):i.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(e))}if(e.om)t.call(l.stroke,f).style({"stroke-width":(p||1)+"px",fill:"none"});else{t.style("stroke-width",(e.isBlank?0:p)+"px");var v=i.gradient,y=e.mgt;if(y?h=!0:y=v&&v.type,Array.isArray(y)&&(y=y[0],T[y]||(y=0)),y&&"none"!==y){var x=e.mgc;x?h=!0:x=v.color;var _=r.uid;h&&(_+="-"+e.i),m.gradient(t,a,_,y,[[0,x],[1,f]],"fill")}else l.fill(t,f);p&&l.stroke(t,d)}},m.makePointStyleFns=function(e){var t={},r=e.marker;return t.markerScale=m.tryColorscale(r,""),t.lineScale=m.tryColorscale(r,"line"),o.traceIs(e,"symbols")&&(t.ms2mrc=h.isBubble(e)?g(e):function(){return(r.size||6)/2}),e.selectedpoints&&c.extendFlat(t,m.makeSelectedPointStyleFns(e)),t},m.makeSelectedPointStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.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)&&(t.selectedOpacityFn=function(e){var t=void 0===e.mo?a.opacity:e.mo;return e.selected?d?u:t:h?f:p*t});var g=a.color,v=i.color,m=l.color;(v||m)&&(t.selectedColorFn=function(e){var t=e.mcc||g;return e.selected?v||t:m||t});var y=a.size,x=i.size,b=l.size,_=void 0!==x,w=void 0!==b;return o.traceIs(e,"symbols")&&(_||w)&&(t.selectedSizeFn=function(e){var t=e.mrc||y/2;return e.selected?_?x/2:t:w?b/2:t}),t},m.makeSelectedTextStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.textfont||{},i=r.textfont||{},o=n.textfont||{},s=a.color,c=i.color,u=o.color;return t.selectedTextColorFn=function(e){var t=e.tc||s;return e.selected?c||t:u||(c?t:l.addOpacity(t,p))},t},m.selectedPointStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=m.makeSelectedPointStyleFns(t),a=t.marker||{},i=[];r.selectedOpacityFn&&i.push((function(e,t){e.style("opacity",r.selectedOpacityFn(t))})),r.selectedColorFn&&i.push((function(e,t){l.fill(e,r.selectedColorFn(t))})),r.selectedSizeFn&&i.push((function(e,t){var n=t.mx||a.symbol||0,i=r.selectedSizeFn(t);e.attr("d",b(m.symbolNumber(n),i)),t.mrc2=i})),i.length&&e.each((function(e){for(var t=n.select(this),r=0;r<i.length;r++)i[r](t,e)}))}},m.tryColorscale=function(e,t){var r=t?c.nestedProperty(e,t).get():e;if(r){var n=r.color;if((r.colorscale||r._colorAx)&&c.isArrayOrTypedArray(n))return s.makeColorScaleFuncFromTrace(r)}return c.identity};var M={start:1,end:-1,middle:0,bottom:1,top:-1};function A(e,t,r,a){var i=n.select(e.node().parentNode),o=-1!==t.indexOf("top")?"top":-1!==t.indexOf("bottom")?"bottom":"middle",l=-1!==t.indexOf("left")?"end":-1!==t.indexOf("right")?"start":"middle",s=a?a/.8+1:0,c=(u.lineCount(e)-1)*d+1,f=M[l]*s,p=.75*r+M[o]*s+(M[o]-1)*c*r/2;e.attr("text-anchor",l),i.attr("transform","translate("+f+","+p+")")}function L(e,t){var r=e.ts||t.textfont.size;return a(r)&&r>0?r:0}function S(e,t,r,a){var i=e[0]-t[0],o=e[1]-t[1],l=r[0]-t[0],s=r[1]-t[1],c=Math.pow(i*i+o*o,.25),u=Math.pow(l*l+s*s,.25),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(t[0]+(p&&f/p),2),n.round(t[1]+(p&&d/p),2)],[n.round(t[0]-(h&&f/h),2),n.round(t[1]-(h&&d/h),2)]]}m.textPointStyle=function(e,t,r){if(e.size()){var a;if(t.selectedpoints){var i=m.makeSelectedTextStyleFns(t);a=i.selectedTextColorFn}var o=t.texttemplate,l=r._fullLayout;e.each((function(e){var i=n.select(this),s=o?c.extractOption(e,t,"txt","texttemplate"):c.extractOption(e,t,"tx","text");if(s||0===s){if(o){var f=t._module.formatLabels?t._module.formatLabels(e,t,l):{},d={};v(d,t,e.i);var p=t._meta||{};s=c.texttemplateString(s,f,l._d3locale,d,e,p)}var h=e.tp||t.textposition,g=L(e,t),y=a?a(e):e.tc||t.textfont.color;i.call(m.font,e.tf||t.textfont.family,g,y).text(s).call(u.convertToTspans,r).call(A,h,g,e.mrc)}else i.remove()}))}},m.selectedTextStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=m.makeSelectedTextStyleFns(t);e.each((function(e){var a=n.select(this),i=r.selectedTextColorFn(e),o=e.tp||t.textposition,s=L(e,t);l.fill(a,i),A(a,o,s,e.mrc2||e.mrc)}))}},m.smoothopen=function(e,t){if(e.length<3)return"M"+e.join("L");var r,n="M"+e[0],a=[];for(r=1;r<e.length-1;r++)a.push(S(e[r-1],e[r],e[r+1],t));for(n+="Q"+a[0][0]+" "+e[1],r=2;r<e.length-1;r++)n+="C"+a[r-2][1]+" "+a[r-1][0]+" "+e[r];return n+"Q"+a[e.length-3][1]+" "+e[e.length-1]},m.smoothclosed=function(e,t){if(e.length<3)return"M"+e.join("L")+"Z";var r,n="M"+e[0],a=e.length-1,i=[S(e[a],e[0],e[1],t)];for(r=1;r<a;r++)i.push(S(e[r-1],e[r],e[r+1],t));for(i.push(S(e[a-1],e[a],e[0],t)),r=1;r<=a;r++)n+="C"+i[r-1][1]+" "+i[r][0]+" "+e[r];return n+"C"+i[a][1]+" "+i[0][0]+" "+e[0]+"Z"};var C={hv:function(e,t){return"H"+n.round(t[0],2)+"V"+n.round(t[1],2)},vh:function(e,t){return"V"+n.round(t[1],2)+"H"+n.round(t[0],2)},hvh:function(e,t){return"H"+n.round((e[0]+t[0])/2,2)+"V"+n.round(t[1],2)+"H"+n.round(t[0],2)},vhv:function(e,t){return"V"+n.round((e[1]+t[1])/2,2)+"H"+n.round(t[0],2)+"V"+n.round(t[1],2)}},O=function(e,t){return"L"+n.round(t[0],2)+","+n.round(t[1],2)};m.steps=function(e){var t=C[e]||O;return function(e){for(var r="M"+n.round(e[0][0],2)+","+n.round(e[0][1],2),a=1;a<e.length;a++)r+=t(e[a-1],e[a]);return r}},m.makeTester=function(){var e=c.ensureSingleById(n.select("body"),"svg","js-plotly-tester",(function(e){e.attr(f.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})})),t=c.ensureSingle(e,"path","js-reference-point",(function(e){e.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})}));m.tester=e,m.testref=t},m.savedBBoxes={};var P=0;function D(e){var t=e.getAttribute("data-unformatted");if(null!==t)return t+e.getAttribute("data-math")+e.getAttribute("text-anchor")+e.getAttribute("style")}function z(e,t){if(!e)return null;var r=t._context;return"url('"+(r._exportedPlot?"":r._baseUrl||"")+"#"+e+"')"}m.bBox=function(e,t,r){var a,i,o;if(r||(r=D(e)),r){if(a=m.savedBBoxes[r])return c.extendFlat({},a)}else if(1===e.childNodes.length){var l=e.childNodes[0];if(r=D(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)}}t?i=e:(o=m.tester.node(),i=e.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();t||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 P>=1e4&&(m.savedBBoxes={},P=0),r&&(m.savedBBoxes[r]=v),P++,c.extendFlat({},v)},m.setClipUrl=function(e,t,r){e.attr("clip-path",z(t,r))},m.getTranslate=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||0,y:+t[1]||0}},m.setTranslate=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=" translate("+t+", "+r+")").trim(),e[a]("transform",i),i},m.getScale=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||1,y:+t[1]||1}},m.setScale=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+=" scale("+t+", "+r+")").trim(),e[a]("transform",i),i};var E=/\s*sc.*/;m.setPointGroupScale=function(e,t,r){if(t=t||1,r=r||1,e){var n=1===t&&1===r?"":" scale("+t+","+r+")";e.each((function(){var e=(this.getAttribute("transform")||"").replace(E,"");e=(e+=n).trim(),this.setAttribute("transform",e)}))}};var R=/translate\([^)]*\)\s*$/;m.setTextPointsScale=function(e,t,r){e&&e.each((function(){var e,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(R);e=1===t&&1===r?[]:["translate("+o+","+l+")","scale("+t+","+r+")","translate("+-o+","+-l+")"],s&&e.push(s),a.attr("transform",e.join(" "))}}))}},{"../../components/fx/helpers":79,"../../constants/alignment":145,"../../constants/interactions":147,"../../constants/xmlns_namespaces":149,"../../lib":168,"../../lib/svg_text_utils":189,"../../registry":254,"../../traces/scatter/make_bubble_size_func":311,"../../traces/scatter/subtypes":318,"../color":43,"../colorscale":55,"./symbol_defs":66,d3:7,"fast-isnumeric":9,tinycolor2:26}],66:[function(e,t,r){"use strict";var n=e("d3");t.exports={circle:{n:0,f:function(e){var t=n.round(e,2);return"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"}},square:{n:1,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"}},diamond:{n:2,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"Z"}},cross:{n:3,f:function(e){var t=n.round(.4*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H"+t+"V"+r+"H-"+t+"V"+t+"H-"+r+"V-"+t+"H-"+t+"V-"+r+"H"+t+"V-"+t+"H"+r+"Z"}},x:{n:4,f:function(e){var t=n.round(.8*e/Math.sqrt(2),2),r="l"+t+","+t,a="l"+t+",-"+t,i="l-"+t+",-"+t,o="l-"+t+","+t;return"M0,"+t+r+a+i+a+i+o+i+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+","+n.round(e/2,2)+"H"+t+"L0,-"+n.round(e,2)+"Z"}},"triangle-down":{n:6,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+",-"+n.round(e/2,2)+"H"+t+"L0,"+n.round(e,2)+"Z"}},"triangle-left":{n:7,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M"+n.round(e/2,2)+",-"+t+"V"+t+"L-"+n.round(e,2)+",0Z"}},"triangle-right":{n:8,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+n.round(e/2,2)+",-"+t+"V"+t+"L"+n.round(e,2)+",0Z"}},"triangle-ne":{n:9,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+r+",-"+t+"H"+t+"V"+r+"Z"}},"triangle-se":{n:10,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+t+",-"+r+"V"+t+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H-"+t+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+t+","+r+"V-"+t+"H"+r+"Z"}},pentagon:{n:13,f:function(e){var t=n.round(.951*e,2),r=n.round(.588*e,2),a=n.round(-e,2),i=n.round(-.309*e,2);return"M"+t+","+i+"L"+r+","+n.round(.809*e,2)+"H-"+r+"L-"+t+","+i+"L0,"+a+"Z"}},hexagon:{n:14,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+t+"L-"+a+","+r+"V-"+r+"L0,-"+t+"Z"}},hexagon2:{n:15,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+t+",0L"+r+",-"+a+"H-"+r+"L-"+t+",0Z"}},octagon:{n:16,f:function(e){var t=n.round(.924*e,2),r=n.round(.383*e,2);return"M-"+r+",-"+t+"H"+r+"L"+t+",-"+r+"V"+r+"L"+r+","+t+"H-"+r+"L-"+t+","+r+"V-"+r+"Z"}},star:{n:17,f:function(e){var t=1.4*e,r=n.round(.225*t,2),a=n.round(.951*t,2),i=n.round(.363*t,2),o=n.round(.588*t,2),l=n.round(-t,2),s=n.round(-.309*t,2),c=n.round(.118*t,2),u=n.round(.809*t,2);return"M"+r+","+s+"H"+a+"L"+i+","+c+"L"+o+","+u+"L0,"+n.round(.382*t,2)+"L-"+o+","+u+"L-"+i+","+c+"L-"+a+","+s+"H-"+r+"L0,"+l+"Z"}},hexagram:{n:18,f:function(e){var t=n.round(.66*e,2),r=n.round(.38*e,2),a=n.round(.76*e,2);return"M-"+a+",0l-"+r+",-"+t+"h"+a+"l"+r+",-"+t+"l"+r+","+t+"h"+a+"l-"+r+","+t+"l"+r+","+t+"h-"+a+"l-"+r+","+t+"l-"+r+",-"+t+"h-"+a+"Z"}},"star-triangle-up":{n:19,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M-"+t+","+r+o+t+","+r+o+"0,-"+a+o+"-"+t+","+r+"Z"}},"star-triangle-down":{n:20,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M"+t+",-"+r+o+"-"+t+",-"+r+o+"0,"+a+o+t+",-"+r+"Z"}},"star-square":{n:21,f:function(e){var t=n.round(1.1*e,2),r=n.round(2*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",-"+t+a+"-"+t+","+t+a+t+","+t+a+t+",-"+t+a+"-"+t+",-"+t+"Z"}},"star-diamond":{n:22,f:function(e){var t=n.round(1.4*e,2),r=n.round(1.9*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",0"+a+"0,"+t+a+t+",0"+a+"0,-"+t+a+"-"+t+",0Z"}},"diamond-tall":{n:23,f:function(e){var t=n.round(.7*e,2),r=n.round(1.4*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},"diamond-wide":{n:24,f:function(e){var t=n.round(1.4*e,2),r=n.round(.7*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},hourglass:{n:25,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"L"+t+",-"+t+"H-"+t+"Z"},noDot:!0},bowtie:{n:26,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"V-"+t+"L-"+t+","+t+"V-"+t+"Z"},noDot:!0},"circle-cross":{n:27,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(e){var t=n.round(e,2),r=n.round(e/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM0,-"+t+"V"+t+"M-"+t+",0H"+t},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(e){var t=n.round(1.3*e,2),r=n.round(.65*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(e){var t=n.round(1.2*e,2),r=n.round(.85*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(e){var t=n.round(e/2,2),r=n.round(e,2);return"M"+t+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+t+"H-"+r+"m0,-"+r+"H"+r},needLine:!0,noFill:!0},"y-up":{n:37,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+","+a+"L0,0M"+t+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+",-"+a+"L0,0M"+t+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M"+a+","+t+"L0,0M"+a+",-"+t+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+a+","+t+"L0,0M-"+a+",-"+t+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(e){var t=n.round(1.4*e,2);return"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(e){var t=n.round(e,2);return"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t},needLine:!0,noDot:!0,noFill:!0}}},{d3:7}],67:[function(e,t,r){"use strict";t.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"}}}},{}],68:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../registry"),i=e("../../plots/cartesian/axes"),o=e("../../lib"),l=e("./compute_error");function s(e,t,r,a){var s=t["error_"+a]||{},c=[];if(s.visible&&-1!==["linear","log"].indexOf(r.type)){for(var u=l(s),f=0;f<e.length;f++){var d=e[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=t._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)}}t.exports=function(e){for(var t=e.calcdata,r=0;r<t.length;r++){var n=t[r],o=n[0].trace;if(!0===o.visible&&a.traceIs(o,"errorBarsOK")){var l=i.getFromId(e,o.xaxis),c=i.getFromId(e,o.yaxis);s(n,o,l,"x"),s(n,o,c,"y")}}}},{"../../lib":168,"../../plots/cartesian/axes":212,"../../registry":254,"./compute_error":69,"fast-isnumeric":9}],69:[function(e,t,r){"use strict";function n(e,t){return"percent"===e?function(e){return Math.abs(e*t/100)}:"constant"===e?function(){return Math.abs(t)}:"sqrt"===e?function(e){return Math.sqrt(Math.abs(e))}:void 0}t.exports=function(e){var t=e.type,r=e.symmetric;if("data"===t){var a=e.array||[];if(r)return function(e,t){var r=+a[t];return[r,r]};var i=e.arrayminus||[];return function(e,t){var r=+a[t],n=+i[t];return isNaN(r)&&isNaN(n)?[NaN,NaN]:[n||0,r||0]}}var o=n(t,e.value),l=n(t,e.valueminus);return r||void 0===e.valueminus?function(e){var t=o(e);return[t,t]}:function(e){return[l(e),o(e)]}}},{}],70:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../registry"),i=e("../../lib"),o=e("../../plot_api/plot_template"),l=e("./attributes");t.exports=function(e,t,r,s){var c="error_"+s.axis,u=o.newContainer(t,c),f=e[c]||{};function d(e,t){return i.coerce(f,u,l,e,t)}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";s.inherit&&(t["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(t,"gl3d")?0:4))}}},{"../../lib":168,"../../plot_api/plot_template":202,"../../registry":254,"./attributes":67,"fast-isnumeric":9}],71:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plot_api/edit_types").overrideAll,i=e("./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,t.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:o,bar:o,histogram:o,scatter3d:a(l,"calc","nested"),scattergl:a(o,"calc","nested")}},supplyDefaults:e("./defaults"),calc:e("./calc"),makeComputeError:e("./compute_error"),plot:e("./plot"),style:e("./style"),hoverInfo:function(e,t,r){(t.error_y||{}).visible&&(r.yerr=e.yh-e.y,t.error_y.symmetric||(r.yerrneg=e.y-e.ys)),(t.error_x||{}).visible&&(r.xerr=e.xh-e.x,t.error_x.symmetric||(r.xerrneg=e.x-e.xs))}}},{"../../lib":168,"../../plot_api/edit_types":195,"./attributes":67,"./calc":68,"./compute_error":69,"./defaults":70,"./plot":72,"./style":73}],72:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../drawing"),o=e("../../traces/scatter/subtypes");t.exports=function(e,t,r,l){var s=r.xaxis,c=r.yaxis,u=l&&l.duration>0;t.each((function(t){var f,d=t[0].trace,p=d.error_x||{},h=d.error_y||{};d.ids&&(f=function(e){return e.id});var g=o.hasMarkers(d)&&d.marker.maxdisplayed>0;h.visible||p.visible||(t=[]);var v=n.select(this).selectAll("g.errorbar").data(t,f);if(v.exit().remove(),t.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,e),v.each((function(e){var t=n.select(this),r=function(e,t,r){var n={x:t.c2p(e.x),y:r.c2p(e.y)};return void 0!==e.yh&&(n.yh=r.c2p(e.yh),n.ys=r.c2p(e.ys),a(n.ys)||(n.noYS=!0,n.ys=r.c2p(e.ys,!0))),void 0!==e.xh&&(n.xh=t.c2p(e.xh),n.xs=t.c2p(e.xs),a(n.xs)||(n.noXS=!0,n.xs=t.c2p(e.xs,!0))),n}(e,s,c);if(!g||e.vis){var i,o=t.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()?u&&(o=o.transition().duration(l.duration).ease(l.easing)):o=t.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0),o.attr("d",i)}else o.remove();var d=t.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()?u&&(d=d.transition().duration(l.duration).ease(l.easing)):d=t.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0),d.attr("d",i)}else d.remove()}}))}}))}},{"../../traces/scatter/subtypes":318,"../drawing":65,d3:7,"fast-isnumeric":9}],73:[function(e,t,r){"use strict";var n=e("d3"),a=e("../color");t.exports=function(e){e.each((function(e){var t=e[0].trace,r=t.error_y||{},i=t.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":43,d3:7}],74:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("./layout_attributes").hoverlabel,i=e("../../lib/extend").extendFlat;t.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":163,"../../plots/font_attributes":240,"./layout_attributes":84}],75:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry");function i(e,t,r,a){a=a||n.identity,Array.isArray(e)&&(t[0][r]=a(e))}t.exports=function(e){var t=e.calcdata,r=e._fullLayout;function o(e){return function(t){return n.coerceHoverinfo({hoverinfo:t},{_module:e._module},r)}}for(var l=0;l<t.length;l++){var s=t[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":168,"../../registry":254}],76:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("./hover").hover;t.exports=function(e,t,r){var i=n.getComponentMethod("annotations","onClick")(e,e._hoverdata);function o(){e.emit("plotly_click",{points:e._hoverdata,event:t})}void 0!==r&&a(e,t,r,!0),e._hoverdata&&t&&t.target&&(i&&i.then?i.then(o):o(),t.stopImmediatePropagation&&t.stopImmediatePropagation())}},{"../../registry":254,"./hover":80}],77:[function(e,t,r){"use strict";t.exports={YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,HOVERID:"-hover"}},{}],78:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./attributes"),i=e("./hoverlabel_defaults");t.exports=function(e,t,r,o){var l=n.extendFlat({},o.hoverlabel);t.hovertemplate&&(l.namelength=-1),i(e,t,(function(r,i){return n.coerce(e,t,a,r,i)}),l)}},{"../../lib":168,"./attributes":74,"./hoverlabel_defaults":81}],79:[function(e,t,r){"use strict";var n=e("../../lib");r.getSubplot=function(e){return e.subplot||e.xaxis+e.yaxis||e.geo},r.isTraceInSubplots=function(e,t){if("splom"===e.type){for(var n=e.xaxes||[],a=e.yaxes||[],i=0;i<n.length;i++)for(var o=0;o<a.length;o++)if(-1!==t.indexOf(n[i]+a[o]))return!0;return!1}return-1!==t.indexOf(r.getSubplot(e))},r.flat=function(e,t){for(var r=new Array(e.length),n=0;n<e.length;n++)r[n]=t;return r},r.p2c=function(e,t){for(var r=new Array(e.length),n=0;n<e.length;n++)r[n]=e[n].p2c(t);return r},r.getDistanceFunction=function(e,t,n,a){return"closest"===e?a||r.quadrature(t,n):"x"===e.charAt(0)?t:n},r.getClosest=function(e,t,r){if(!1!==r.index)r.index>=0&&r.index<e.length?r.distance=0:r.index=!1;else for(var n=0;n<e.length;n++){var a=t(e[n]);a<=r.distance&&(r.index=n,r.distance=a)}return r},r.inbox=function(e,t,r){return e*t<0||0===e?r:1/0},r.quadrature=function(e,t){return function(r){var n=e(r),a=t(r);return Math.sqrt(n*n+a*a)}},r.makeEventData=function(e,t,n){var a="index"in e?e.index:e.pointNumber,i={data:t._input,fullData:t,curveNumber:t.index,pointNumber:a};if(t._indexToPoints){var o=t._indexToPoints[a];1===o.length?i.pointIndex=o[0]:i.pointIndices=o}else i.pointIndex=a;return t._module.eventData?i=t._module.eventData(i,e,t,n,a):("xVal"in e?i.x=e.xVal:"x"in e&&(i.x=e.x),"yVal"in e?i.y=e.yVal:"y"in e&&(i.y=e.y),e.xa&&(i.xaxis=e.xa),e.ya&&(i.yaxis=e.ya),void 0!==e.zLabelVal&&(i.z=e.zLabelVal)),r.appendArrayPointValue(i,t,a),i},r.appendArrayPointValue=function(e,t,r){var a=t._arrayAttrs;if(a)for(var l=0;l<a.length;l++){var s=a[l],c=i(s);if(void 0===e[c]){var u=o(n.nestedProperty(t,s).get(),r);void 0!==u&&(e[c]=u)}}},r.appendArrayMultiPointValues=function(e,t,r){var a=t._arrayAttrs;if(a)for(var l=0;l<a.length;l++){var s=a[l],c=i(s);if(void 0===e[c]){for(var u=n.nestedProperty(t,s).get(),f=new Array(r.length),d=0;d<r.length;d++)f[d]=o(u,r[d]);e[c]=f}}};var a={ids:"id",locations:"location",labels:"label",values:"value","marker.colors":"color",parents:"parent"};function i(e){return a[e]||e}function o(e,t){return Array.isArray(t)?Array.isArray(e)&&Array.isArray(e[t[0]])?e[t[0]][t[1]]:void 0:e[t]}var l={x:!0,y:!0},s={"x unified":!0,"y unified":!0};r.isUnifiedHover=function(e){return"string"==typeof e&&!!s[e]},r.isXYhover=function(e){return"string"==typeof e&&!!l[e]}},{"../../lib":168}],80:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("tinycolor2"),o=e("../../lib"),l=e("../../lib/events"),s=e("../../lib/svg_text_utils"),c=e("../../lib/override_cursor"),u=e("../drawing"),f=e("../color"),d=e("../dragelement"),p=e("../../plots/cartesian/axes"),h=e("../../registry"),g=e("./helpers"),v=e("./constants"),m=e("../legend/defaults"),y=e("../legend/draw"),x=v.YANGLE,b=Math.PI*x/180,_=1/Math.sin(b),w=Math.cos(b),k=Math.sin(b),T=v.HOVERARROWSIZE,M=v.HOVERTEXTPAD;function A(e){return[e.trace.index,e.index,e.x0,e.y0,e.name,e.attr,e.xa,e.ya||""].join(",")}r.hover=function(e,t,r,i){e=o.getGraphDiv(e),o.throttle(e._fullLayout._uid+v.HOVERID,v.HOVERMINTIME,(function(){!function(e,t,r,i){r||(r="xy");var s=Array.isArray(r)?r:[r],u=e._fullLayout,p=u._plots||[],v=p[r],m=u._has("cartesian");if(v){var y=v.overlays.map((function(e){return e.id}));s=s.concat(y)}for(var x=s.length,b=new Array(x),w=new Array(x),k=!1,T=0;T<x;T++){var M=s[T];if(p[M])k=!0,b[T]=p[M].xaxis,w[T]=p[M].yaxis;else{if(!u[M]||!u[M]._subplot)return void o.warn("Unrecognized subplot: "+M);var L=u[M]._subplot;b[T]=L.xaxis,w[T]=L.yaxis}}var C=t.hovermode||u.hovermode;if(C&&!k&&(C="closest"),-1===["x","y","closest","x unified","y unified"].indexOf(C)||!e.calcdata||e.querySelector(".zoombox")||e._dragging)return d.unhoverRaw(e,t);var E,R,I,F,N,H,B,j,V,q,U,G,Z,X=-1===u.hoverdistance?1/0:u.hoverdistance,Y=-1===u.spikedistance?1/0:u.spikedistance,W=[],J=[],$={hLinePoint:null,vLinePoint:null},Q=!1;if(Array.isArray(t))for(C="array",I=0;I<t.length;I++)(N=e.calcdata[t[I].curveNumber||0])&&(H=N[0].trace,"skip"!==N[0].trace.hoverinfo&&(J.push(N),"h"===H.orientation&&(Q=!0)));else{for(F=0;F<e.calcdata.length;F++)N=e.calcdata[F],"skip"!==(H=N[0].trace).hoverinfo&&g.isTraceInSubplots(H,s)&&(J.push(N),"h"===H.orientation&&(Q=!0));var K,ee;if(t.target){if(!1===l.triggerHandler(e,"plotly_beforehover",t))return;var te=t.target.getBoundingClientRect();if(K=t.clientX-te.left,ee=t.clientY-te.top,K<0||K>b[0]._length||ee<0||ee>w[0]._length)return d.unhoverRaw(e,t)}else K="xpx"in t?t.xpx:b[0]._length/2,ee="ypx"in t?t.ypx:w[0]._length/2;if(t.pointerX=K+b[0]._offset,t.pointerY=ee+w[0]._offset,E="xval"in t?g.flat(s,t.xval):g.p2c(b,K),R="yval"in t?g.flat(s,t.yval):g.p2c(w,ee),!a(E[0])||!a(R[0]))return o.warn("Fx.hover failed",t,e),d.unhoverRaw(e,t)}var re=1/0;function ne(e,r){for(F=0;F<J.length;F++)if((N=J[F])&&N[0]&&N[0].trace&&!0===(H=N[0].trace).visible&&0!==H._length&&-1===["carpet","contourcarpet"].indexOf(H._module.name)){if("splom"===H.type?B=s[j=0]:(B=g.getSubplot(H),j=s.indexOf(B)),V=C,g.isUnifiedHover(V)&&(V=V.charAt(0)),G={cd:N,trace:H,xa:b[j],ya:w[j],maxHoverDistance:X,maxSpikeDistance:Y,index:!1,distance:Math.min(re,X),spikeDistance:1/0,xSpike:void 0,ySpike:void 0,color:f.defaultLine,name:H.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[B]&&(G.subplot=u[B]._subplot),u._splomScenes&&u._splomScenes[H.uid]&&(G.scene=u._splomScenes[H.uid]),Z=W.length,"array"===V){var n=t[F];"pointNumber"in n?(G.index=n.pointNumber,V="closest"):(V="","xval"in n&&(q=n.xval,V="x"),"yval"in n&&(U=n.yval,V=V?"closest":"y"))}else void 0!==e&&void 0!==r?(q=e,U=r):(q=E[j],U=R[j]);if(0!==X)if(H._module&&H._module.hoverPoints){var i=H._module.hoverPoints(G,q,U,V,u._hoverlayer);if(i)for(var l,c=0;c<i.length;c++)l=i[c],a(l.x0)&&a(l.y0)&&W.push(P(l,C))}else o.log("Unrecognized trace type in hover:",H);if("closest"===C&&W.length>Z&&(W.splice(0,Z),re=W[0].distance),m&&0!==Y&&0===W.length){G.distance=Y,G.index=!1;var d=H._module.hoverPoints(G,q,U,"closest",u._hoverlayer);if(d&&(d=d.filter((function(e){return e.spikeDistance<=Y}))),d&&d.length){var p,h=d.filter((function(e){return e.xa.showspikes&&"hovered data"!==e.xa.spikesnap}));if(h.length){var v=h[0];a(v.x0)&&a(v.y0)&&(p=ie(v),(!$.vLinePoint||$.vLinePoint.spikeDistance>p.spikeDistance)&&($.vLinePoint=p))}var y=d.filter((function(e){return e.ya.showspikes&&"hovered data"!==e.ya.spikesnap}));if(y.length){var x=y[0];a(x.x0)&&a(x.y0)&&(p=ie(x),(!$.hLinePoint||$.hLinePoint.spikeDistance>p.spikeDistance)&&($.hLinePoint=p))}}}}}function ae(e,t){for(var r,n=null,a=1/0,i=0;i<e.length;i++)(r=e[i].spikeDistance)<=a&&r<=t&&(n=e[i],a=r);return n}function ie(e){return e?{xa:e.xa,ya:e.ya,x:void 0!==e.xSpike?e.xSpike:(e.x0+e.x1)/2,y:void 0!==e.ySpike?e.ySpike:(e.y0+e.y1)/2,distance:e.distance,spikeDistance:e.spikeDistance,curveNumber:e.trace.index,color:e.color,pointNumber:e.index}:null}ne();var oe={fullLayout:u,container:u._hoverlayer,outerContainer:u._paperdiv,event:t},le=e._spikepoints,se={vLinePoint:$.vLinePoint,hLinePoint:$.hLinePoint};if(e._spikepoints=se,m&&0!==Y&&0!==W.length){var ce=ae(W.filter((function(e){return e.ya.showspikes})),Y);$.hLinePoint=ie(ce);var ue=ae(W.filter((function(e){return e.xa.showspikes})),Y);$.vLinePoint=ie(ue)}if(0===W.length){var fe=d.unhoverRaw(e,t);return!m||null===$.hLinePoint&&null===$.vLinePoint||z(le)&&D(e,$,oe),fe}if(m&&z(le)&&D(e,$,oe),W.sort((function(e,t){return e.distance-t.distance})),g.isXYhover(V)&&0!==W[0].length&&"splom"!==W[0].trace.type){var de=W[0],pe=de.cd[de.index],he="group"===u.boxmode||"group"===u.violinmode,ge=de.xVal,ve=de.xa;"category"===ve.type&&(ge=ve._categoriesMap[ge]),"date"===ve.type&&(ge=ve.d2c(ge)),pe&&pe.t&&pe.t.posLetter===ve._id&&he&&(ge+=pe.t.dPos);var me=de.yVal;"category"===(ve=de.ya).type&&(me=ve._categoriesMap[me]),"date"===ve.type&&(me=ve.d2c(me)),pe&&pe.t&&pe.t.posLetter===ve._id&&he&&(me+=pe.t.dPos),ne(ge,me);var ye={};W=W.filter((function(e){var t=A(e);if(!ye[t])return ye[t]=!0,ye[t]}))}var xe=e._hoverdata,be=[];for(I=0;I<W.length;I++){var _e=W[I],we=g.makeEventData(_e,_e.trace,_e.cd);if(!1!==_e.hovertemplate){var ke=!1;_e.cd[_e.index]&&_e.cd[_e.index].ht&&(ke=_e.cd[_e.index].ht),_e.hovertemplate=ke||_e.trace.hovertemplate||!1}_e.eventData=[we],be.push(we)}e._hoverdata=be;var Te="y"===C&&(J.length>1||W.length>1)||"closest"===C&&Q&&W.length>1,Me=f.combine(u.plot_bgcolor||f.background,u.paper_bgcolor),Ae={hovermode:C,rotateLabels:Te,bgColor:Me,container:u._hoverlayer,outerContainer:u._paperdiv,commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance},Le=S(W,Ae,e);if(g.isUnifiedHover(C)||(function(e,t,r){var n,a,i,o,l,s,c,u=0,f=1,d=e.size(),p=new Array(d),h=0;function g(e){var t=e[0],r=e[e.length-1];if(a=t.pmin-t.pos-t.dp+t.size,i=r.pos+r.dp+r.size-t.pmax,a>.01){for(l=e.length-1;l>=0;l--)e[l].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(l=e.length-1;l>=0;l--)e[l].dp-=i;n=!1}if(n){var c=0;for(o=0;o<e.length;o++)(s=e[o]).pos+s.dp+s.size>t.pmax&&c++;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos>t.pmax-1&&(s.del=!0,c--);for(o=0;o<e.length&&!(c<=0);o++)if((s=e[o]).pos<t.pmin+1)for(s.del=!0,c--,i=2*s.size,l=e.length-1;l>=0;l--)e[l].dp-=i;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos+s.dp+s.size>t.pmax&&(s.del=!0,c--)}}}for(e.each((function(e){var n=e[t],a="x"===n._id.charAt(0),i=n.range;0===h&&i&&i[0]>i[1]!==a&&(f=-1),p[h++]=[{datum:e,traceIndex:e.trace.index,dp:0,pos:e.pos,posref:e.posref,size:e.by*(a?_:1)/2,pmin:0,pmax:a?r.width:r.height}]})),p.sort((function(e,t){return e[0].posref-t[0].posref||f*(t[0].traceIndex-e[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],x=m[0];if((a=y.pos+y.dp+y.size-x.pos-x.dp+x.size)>.01&&y.pmin===x.pmin&&y.pmax===x.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 b=p[o];for(l=b.length-1;l>=0;l--){var w=b[l],k=w.datum;k.offset=w.dp,k.del=w.del}}}(Le,Te?"xa":"ya",u),O(Le,Te)),t.target&&t.target.tagName){var Se=h.getComponentMethod("annotations","hasClickToShow")(e,be);c(n.select(t.target),Se?"pointer":"")}t.target&&!i&&function(e,t,r){if(!r||r.length!==e._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=e._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(e,0,xe)&&(xe&&e.emit("plotly_unhover",{event:t,points:xe}),e.emit("plotly_hover",{event:t,points:e._hoverdata,xaxes:b,yaxes:w,xvals:E,yvals:R}))}(e,t,r,i)}))},r.loneHover=function(e,t){var r=!0;Array.isArray(e)||(r=!1,e=[e]);var a=e.map((function(e){return{color:e.color||f.defaultLine,x0:e.x0||e.x||0,x1:e.x1||e.x||0,y0:e.y0||e.y||0,y1:e.y1||e.y||0,xLabel:e.xLabel,yLabel:e.yLabel,zLabel:e.zLabel,text:e.text,name:e.name,idealAlign:e.idealAlign,borderColor:e.borderColor,fontFamily:e.fontFamily,fontSize:e.fontSize,fontColor:e.fontColor,nameLength:e.nameLength,textAlign:e.textAlign,trace:e.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:e.hovertemplate||!1,eventData:e.eventData||!1,hovertemplateLabels:e.hovertemplateLabels||!1}})),i=n.select(t.container),o=t.outerContainer?n.select(t.outerContainer):i,l={hovermode:"closest",rotateLabels:!1,bgColor:t.bgColor||f.background,container:i,outerContainer:o},s=S(a,l,t.gd),c=0,u=0;return s.sort((function(e,t){return e.y0-t.y0})).each((function(e,r){var n=e.y0-e.by/2;e.offset=n-5<c?c-n+5:0,c=n+e.by+e.offset,r===t.anchorIndex&&(u=e.offset)})).each((function(e){e.offset-=u})),O(s,l.rotateLabels),r?s:s.node()};var L=/<extra>([\s\S]*)<\/extra>/;function S(e,t,r){var a=r._fullLayout,i=t.hovermode,l=t.rotateLabels,c=t.bgColor,d=t.container,p=t.outerContainer,h=t.commonLabelOpts||{},b=t.fontFamily||v.HOVERFONT,_=t.fontSize||v.HOVERFONTSIZE,w=e[0],k=w.xa,L=w.ya,S="y"===i.charAt(0)?"yLabel":"xLabel",O=w[S],P=(String(O)||"").split(" ")[0],D=p.node().getBoundingClientRect(),z=D.top,E=D.width,R=D.height,I=void 0!==O&&w.distance<=t.hoverdistance&&("x"===i||"y"===i);if(I){var F,N,H=!0;for(F=0;F<e.length;F++)if(H&&void 0===e[F].zLabel&&(H=!1),N=e[F].hoverinfo||e[F].trace.hoverinfo){var B=Array.isArray(N)?N:N.split("+");if(-1===B.indexOf("all")&&-1===B.indexOf(i)){I=!1;break}}H&&(I=!1)}var j=d.selectAll("g.axistext").data(I?[0]:[]);function V(e){return e.filter((function(e){return void 0!==e.zLabelVal||(e[S]||"").split(" ")[0]===P}))}if(j.enter().append("g").classed("axistext",!0),j.exit().remove(),j.each((function(){var t=n.select(this),l=o.ensureSingle(t,"path","",(function(e){e.style({"stroke-width":"1px"})})),c=o.ensureSingle(t,"text","",(function(e){e.attr("data-notex",1)})),d=h.bgcolor||f.defaultLine,p=h.bordercolor||f.contrast(d),g=f.contrast(d),v={family:h.font.family||b,size:h.font.size||_,color:h.font.color||g};l.style({fill:d,stroke:p}),c.text(O).call(u.font,v).call(s.positionText,0,0).call(s.convertToTspans,r),t.attr("transform","");var m,y,x=c.node().getBoundingClientRect();if("x"===i){var A="top"===k.side?"-":"";c.attr("text-anchor","middle").call(s.positionText,0,"top"===k.side?z-x.bottom-T-M:z-x.top+T+M),m=k._offset+(w.x0+w.x1)/2,y=L._offset+("top"===k.side?0:L._length);var S=x.width/2+M;m<S?(m=S,l.attr("d","M-"+(S-T)+",0L-"+(S-2*T)+","+A+T+"H"+(M+x.width/2)+"v"+A+(2*M+x.height)+"H-"+S+"V"+A+T+"Z")):m>a.width-S?(m=a.width-S,l.attr("d","M"+(S-T)+",0L"+S+","+A+T+"v"+A+(2*M+x.height)+"H-"+S+"V"+A+T+"H"+(S-2*T)+"Z")):l.attr("d","M0,0L"+T+","+A+T+"H"+(M+x.width/2)+"v"+A+(2*M+x.height)+"H-"+(M+x.width/2)+"V"+A+T+"H-"+T+"Z")}else{var C,P,D;"right"===L.side?(C="start",P=1,D="",m=k._offset+k._length):(C="end",P=-1,D="-",m=k._offset),y=L._offset+(w.y0+w.y1)/2,c.attr("text-anchor",C),l.attr("d","M0,0L"+D+T+","+T+"V"+(M+x.height/2)+"h"+D+(2*M+x.width)+"V-"+(M+x.height/2)+"H"+D+T+"V-"+T+"Z");var E,R=x.height/2,I=z-x.top-R,F="clip"+a._uid+"commonlabel"+L._id;if(m<x.width+2*M+T){E="M-"+(T+M)+"-"+R+"h-"+(x.width-M)+"V"+R+"h"+(x.width-M)+"Z";var N=x.width-m+M;s.positionText(c,N,I),"end"===C&&c.selectAll("tspan").each((function(){var e=n.select(this),t=u.tester.append("text").text(e.text()).call(u.font,v),r=t.node().getBoundingClientRect();Math.round(r.width)<Math.round(x.width)&&e.attr("x",N-r.width),t.remove()}))}else s.positionText(c,P*(M+T),I),E=null;var H=a._topclips.selectAll("#"+F).data(E?[0]:[]);H.enter().append("clipPath").attr("id",F).append("path"),H.exit().remove(),H.select("path").attr("d",E),u.setClipUrl(c,E?F:null,r)}t.attr("transform","translate("+m+","+y+")"),e=V(e)})),g.isUnifiedHover(i)){if(d.selectAll("g.hovertext").remove(),void 0!==O&&w.distance<=t.hoverdistance&&(e=V(e)),0===e.length)return;var q={showlegend:!0,legend:{title:{text:O,font:a.hoverlabel.font},font:a.hoverlabel.font,bgcolor:a.hoverlabel.bgcolor,bordercolor:a.hoverlabel.bordercolor,borderwidth:1,tracegroupgap:7,traceorder:a.legend?a.legend.traceorder:void 0,orientation:"v"}},U={};m(q,U,r._fullData);var G=U.legend;G.entries=[];for(var Z=0;Z<e.length;Z++){var X=C(e[Z],!0,i,a,O),Y=X[0],W=X[1],J=e[Z];J.name=W,J.text=""!==W?W+" : "+Y:Y;var $=J.cd[J.index];$&&($.mc&&(J.mc=$.mc),$.mcc&&(J.mc=$.mcc),$.mlc&&(J.mlc=$.mlc),$.mlcc&&(J.mlc=$.mlcc),$.mlw&&(J.mlw=$.mlw),$.mrc&&(J.mrc=$.mrc),$.dir&&(J.dir=$.dir)),J._distinct=!0,G.entries.push([J])}G.entries.sort((function(e,t){return e[0].trace.index-t[0].trace.index})),G.layer=d,y(r,G);var Q=o.mean(e.map((function(e){return(e.y0+e.y1)/2}))),K=o.mean(e.map((function(e){return(e.x0+e.x1)/2}))),ee=d.select("g.legend"),te=ee.node().getBoundingClientRect();K+=k._offset,Q+=L._offset-te.height/2;var re=te.width+2*M;!(K+re<=E)&&K-re>=0?K-=re:K+=2*M;var ne=te.height+2*M,ae=Q+ne>=R;return ne<=R&&(Q<=z?Q=L._offset+2*M:ae&&(Q=R-ne)),ee.attr("transform","translate("+K+","+Q+")"),ee}var ie=d.selectAll("g.hovertext").data(e,(function(e){return A(e)}));return ie.enter().append("g").classed("hovertext",!0).each((function(){var e=n.select(this);e.append("rect").call(f.fill,f.addOpacity(c,.8)),e.append("text").classed("name",!0),e.append("path").style("stroke-width","1px"),e.append("text").classed("nums",!0).call(u.font,b,_)})),ie.exit().remove(),ie.each((function(e){var t=n.select(this).attr("transform",""),o=e.bgcolor||e.color,d=f.combine(f.opacity(o)?o:f.defaultLine,c),p=f.combine(f.opacity(e.color)?e.color:f.defaultLine,c),h=e.borderColor||f.contrast(d),g=C(e,I,i,a,O,t),v=g[0],m=g[1],y=t.select("text.nums").call(u.font,e.fontFamily||b,e.fontSize||_,e.fontColor||h).text(v).attr("data-notex",1).call(s.positionText,0,0).call(s.convertToTspans,r),w=t.select("text.name"),k=0,A=0;if(m&&m!==v){w.call(u.font,e.fontFamily||b,e.fontSize||_,p).text(m).attr("data-notex",1).call(s.positionText,0,0).call(s.convertToTspans,r);var L=w.node().getBoundingClientRect();k=L.width+2*M,A=L.height+2*M}else w.remove(),t.select("rect").remove();t.select("path").style({fill:d,stroke:h});var S,P,D=y.node().getBoundingClientRect(),F=e.xa._offset+(e.x0+e.x1)/2,N=e.ya._offset+(e.y0+e.y1)/2,H=Math.abs(e.x1-e.x0),B=Math.abs(e.y1-e.y0),j=D.width+T+M+k;if(e.ty0=z-D.top,e.bx=D.width+2*M,e.by=Math.max(D.height+2*M,A),e.anchor="start",e.txwidth=D.width,e.tx2width=k,e.offset=0,l)e.pos=F,S=N+B/2+j<=R,P=N-B/2-j>=0,"top"!==e.idealAlign&&S||!P?S?(N+=B/2,e.anchor="start"):e.anchor="middle":(N-=B/2,e.anchor="end");else if(e.pos=N,S=F+H/2+j<=E,P=F-H/2-j>=0,"left"!==e.idealAlign&&S||!P)if(S)F+=H/2,e.anchor="start";else{e.anchor="middle";var V=j/2,q=F+V-E,U=F-V;q>0&&(F-=q),U<0&&(F+=-U)}else F-=H/2,e.anchor="end";y.attr("text-anchor",e.anchor),k&&w.attr("text-anchor",e.anchor),t.attr("transform","translate("+F+","+N+")"+(l?"rotate("+x+")":""))})),ie}function C(e,t,r,n,a,i){var l="",s="";void 0!==e.nameOverride&&(e.name=e.nameOverride),e.name&&(e.trace._meta&&(e.name=o.templateString(e.name,e.trace._meta)),l=E(e.name,e.nameLength)),void 0!==e.zLabel?(void 0!==e.xLabel&&(s+="x: "+e.xLabel+"<br>"),void 0!==e.yLabel&&(s+="y: "+e.yLabel+"<br>"),"choropleth"!==e.trace.type&&"choroplethmapbox"!==e.trace.type&&(s+=(s?"z: ":"")+e.zLabel)):t&&e[r.charAt(0)+"Label"]===a?s=e[("x"===r.charAt(0)?"y":"x")+"Label"]||"":void 0===e.xLabel?void 0!==e.yLabel&&"scattercarpet"!==e.trace.type&&(s=e.yLabel):s=void 0===e.yLabel?e.xLabel:"("+e.xLabel+", "+e.yLabel+")",!e.text&&0!==e.text||Array.isArray(e.text)||(s+=(s?"<br>":"")+e.text),void 0!==e.extraText&&(s+=(s?"<br>":"")+e.extraText),i&&""===s&&!e.hovertemplate&&(""===l&&i.remove(),s=l);var c=n._d3locale,u=e.hovertemplate||!1,f=e.hovertemplateLabels||e,d=e.eventData[0]||{};return u&&(s=(s=o.hovertemplateString(u,f,c,d,e.trace._meta)).replace(L,(function(t,r){return l=E(r,e.nameLength),""}))),[s,l]}function O(e,t){e.each((function(e){var r=n.select(this);if(e.del)return r.remove();var a=r.select("text.nums"),i=e.anchor,o="end"===i?-1:1,l={start:1,end:-1,middle:0}[i],c=l*(T+M),f=c+l*(e.txwidth+M),d=0,p=e.offset;"middle"===i&&(c-=e.tx2width/2,f+=e.txwidth/2+M),t&&(p*=-k,d=e.offset*w),r.select("path").attr("d","middle"===i?"M-"+(e.bx/2+e.tx2width/2)+","+(p-e.by/2)+"h"+e.bx+"v"+e.by+"h-"+e.bx+"Z":"M0,0L"+(o*T+d)+","+(T+p)+"v"+(e.by/2-T)+"h"+o*e.bx+"v-"+e.by+"H"+(o*T+d)+"V"+(p-T)+"Z");var h=c+d,g=p+e.ty0-e.by/2+M,v=e.textAlign||"auto";"auto"!==v&&("left"===v&&"start"!==i?(a.attr("text-anchor","start"),h="middle"===i?-e.bx/2-e.tx2width/2+M:-e.bx-M):"right"===v&&"end"!==i&&(a.attr("text-anchor","end"),h="middle"===i?e.bx/2-e.tx2width/2-M:e.bx+M)),a.call(s.positionText,h,g),e.tx2width&&(r.select("text.name").call(s.positionText,f+l*M+d,p+e.ty0-e.by/2+M),r.select("rect").call(u.setRect,f+(l-1)*e.tx2width/2+d,p-e.by/2-1,e.tx2width,e.by+2))}))}function P(e,t){var r=e.index,n=e.trace||{},i=e.cd[0],l=e.cd[r]||{};function s(e){return e||a(e)&&0===e}var c=Array.isArray(r)?function(e,t){var a=o.castOption(i,r,e);return s(a)?a:o.extractOption({},n,"",t)}:function(e,t){return o.extractOption(l,n,e,t)};function u(t,r,n){var a=c(r,n);s(a)&&(e[t]=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"),e.posref="y"===t||"closest"===t&&"h"===n.orientation?e.xa._offset+(e.x0+e.x1)/2:e.ya._offset+(e.y0+e.y1)/2,e.x0=o.constrain(e.x0,0,e.xa._length),e.x1=o.constrain(e.x1,0,e.xa._length),e.y0=o.constrain(e.y0,0,e.ya._length),e.y1=o.constrain(e.y1,0,e.ya._length),void 0!==e.xLabelVal&&(e.xLabel="xLabel"in e?e.xLabel:p.hoverLabelText(e.xa,e.xLabelVal),e.xVal=e.xa.c2d(e.xLabelVal)),void 0!==e.yLabelVal&&(e.yLabel="yLabel"in e?e.yLabel:p.hoverLabelText(e.ya,e.yLabelVal),e.yVal=e.ya.c2d(e.yLabelVal)),void 0!==e.zLabelVal&&void 0===e.zLabel&&(e.zLabel=String(e.zLabelVal)),!(isNaN(e.xerr)||"log"===e.xa.type&&e.xerr<=0)){var f=p.tickText(e.xa,e.xa.c2l(e.xerr),"hover").text;void 0!==e.xerrneg?e.xLabel+=" +"+f+" / -"+p.tickText(e.xa,e.xa.c2l(e.xerrneg),"hover").text:e.xLabel+=" ± "+f,"x"===t&&(e.distance+=1)}if(!(isNaN(e.yerr)||"log"===e.ya.type&&e.yerr<=0)){var d=p.tickText(e.ya,e.ya.c2l(e.yerr),"hover").text;void 0!==e.yerrneg?e.yLabel+=" +"+d+" / -"+p.tickText(e.ya,e.ya.c2l(e.yerrneg),"hover").text:e.yLabel+=" ± "+d,"y"===t&&(e.distance+=1)}var h=e.hoverinfo||e.trace.hoverinfo;return h&&"all"!==h&&(-1===(h=Array.isArray(h)?h:h.split("+")).indexOf("x")&&(e.xLabel=void 0),-1===h.indexOf("y")&&(e.yLabel=void 0),-1===h.indexOf("z")&&(e.zLabel=void 0),-1===h.indexOf("text")&&(e.text=void 0),-1===h.indexOf("name")&&(e.name=void 0)),e}function D(e,t,r){var n,a,o=r.container,l=r.fullLayout,s=l._size,c=r.event,d=!!t.hLinePoint,h=!!t.vLinePoint;if(o.selectAll(".spikeline").remove(),h||d){var g=f.combine(l.plot_bgcolor,l.paper_bgcolor);if(d){var v,m,y=t.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(e,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=t.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,E=n.spikemode,R=n.spikethickness,I=n.spikecolor||z,F=p.getPxPosition(e,n);if(-1!==E.indexOf("toaxis")||-1!==E.indexOf("across")){if(-1!==E.indexOf("toaxis")&&(P=F,D=C),-1!==E.indexOf("across")){var N=n._counterDomainMin,H=n._counterDomainMax;"free"===n.anchor&&(N=Math.min(N,n.position),H=Math.max(H,n.position)),P=s.t+(1-H)*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":R,stroke:I,"stroke-dasharray":u.dashStyle(n.spikedash,R)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:S,x2:S,y1:P,y2:D,"stroke-width":R+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==E.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S,cy:F-("top"!==n.side?R:-R),r:R,fill:I}).classed("spikeline",!0)}}}function z(e,t){return!t||t.vLinePoint!==e._spikepoints.vLinePoint||t.hLinePoint!==e._spikepoints.hLinePoint}function E(e,t){return s.plainText(e||"",{len:t,allowedTags:["br","sub","sup","b","i","em"]})}},{"../../lib":168,"../../lib/events":162,"../../lib/override_cursor":179,"../../lib/svg_text_utils":189,"../../plots/cartesian/axes":212,"../../registry":254,"../color":43,"../dragelement":62,"../drawing":65,"../legend/defaults":95,"../legend/draw":96,"./constants":77,"./helpers":79,d3:7,"fast-isnumeric":9,tinycolor2:26}],81:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../color"),i=e("./helpers").isUnifiedHover;t.exports=function(e,t,r,o){function l(e){o.font[e]||(o.font[e]=t.legend?t.legend.font[e]:t.font[e])}o=o||{},t&&i(t.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),t.legend?(o.bgcolor||(o.bgcolor=a.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(o.bgcolor=t.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":168,"../color":43,"./helpers":79}],82:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t,r){function i(r,i){return void 0!==t[r]?t[r]:n.coerce(e,t,a,r,i)}var o,l=i("clickmode");return t._has("cartesian")?l.indexOf("select")>-1?o="closest":(t._isHoriz=function(e,t){for(var r=t._scatterStackOpts||{},n=0;n<e.length;n++){var a=e[n],i=(r[a.xaxis+a.yaxis]||{})[a.stackgroup]||{};if("h"!==a.orientation&&"h"!==i.orientation)return!1}return!0}(r,t),o=t._isHoriz?"y":"x"):o="closest",i("hovermode",o)}},{"../../lib":168,"./layout_attributes":84}],83:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib"),i=e("../dragelement"),o=e("./helpers"),l=e("./layout_attributes"),s=e("./hover");t.exports={moduleType:"component",name:"fx",constants:e("./constants"),schema:{layout:l},attributes:e("./attributes"),layoutAttributes:l,supplyLayoutGlobalDefaults:e("./layout_global_defaults"),supplyDefaults:e("./defaults"),supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(e,t,r){return a.castOption(e,t,"hoverlabel."+r)},castHoverinfo:function(e,t,r){return a.castOption(e,r,"hoverinfo",(function(r){return a.coerceHoverinfo({hoverinfo:r},{_module:e._module},t)}))},hover:s.hover,unhover:i.unhover,loneHover:s.loneHover,loneUnhover:function(e){var t=a.isD3Selection(e)?e:n.select(e);t.selectAll("g.hovertext").remove(),t.selectAll(".spikeline").remove()},click:e("./click")}},{"../../lib":168,"../dragelement":62,"./attributes":74,"./calc":75,"./click":76,"./constants":77,"./defaults":78,"./helpers":79,"./hover":80,"./layout_attributes":84,"./layout_defaults":85,"./layout_global_defaults":86,d3:7}],84:[function(e,t,r){"use strict";var n=e("./constants"),a=e("../../plots/font_attributes")({editType:"none"});a.family.dflt=n.HOVERFONT,a.size.dflt=n.HOVERFONTSIZE,t.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],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":240,"./constants":77}],85:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./helpers").isUnifiedHover,i=e("./layout_attributes"),o=e("./hovermode_defaults"),l=e("./hoverlabel_defaults");t.exports=function(e,t,r){function s(r,a){return n.coerce(e,t,i,r,a)}var c=o(e,t,r);c&&(s("hoverdistance"),s("spikedistance",a(c)?-1:void 0)),"select"===s("dragmode")&&s("selectdirection");var u=t._has("mapbox"),f=t._has("geo"),d=t._basePlotModules.length;"zoom"===t.dragmode&&((u||f)&&1===d||u&&f&&2===d)&&(t.dragmode="pan"),l(e,t,s)}},{"../../lib":168,"./helpers":79,"./hoverlabel_defaults":81,"./hovermode_defaults":82,"./layout_attributes":84}],86:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./hoverlabel_defaults"),i=e("./layout_attributes");t.exports=function(e,t){a(e,t,(function(r,a){return n.coerce(e,t,i,r,a)}))}},{"../../lib":168,"./hoverlabel_defaults":81,"./layout_attributes":84}],87:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../lib/regex").counter,i=e("../../plots/domain").attributes,o=e("../../plots/cartesian/constants").idRegex,l=e("../../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(e,t,r){var n=t[r+"axes"],a=Object.keys((e._splomAxes||{})[r]||{});return Array.isArray(n)?n:a.length?a:void 0}function u(e,t,r,n,a,i){var o=t(e+"gap",r),l=t("domain."+e);t(e+"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(e,t,r,n,a){var i,o=new Array(r);function l(e,r){-1!==t.indexOf(r)&&void 0===n[r]?(o[e]=r,n[r]=e):o[e]=""}if(Array.isArray(e))for(i=0;i<r;i++)l(i,e[i]);else for(l(0,a),i=1;i<r;i++)l(i,a+(i+1));return o}t.exports={moduleType:"component",name:"grid",schema:{layout:{grid:s}},layoutAttributes:s,sizeDefaults:function(e,t){var r=e.grid||{},a=c(t,r,"x"),i=c(t,r,"y");if(e.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(t,"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&&t._splomGridDflt&&(x=t._splomGridDflt.xside,b=t._splomGridDflt.yside),v._domains={x:u("x",T,w,x,y),y:u("y",T,k,b,m,_)}}else delete t.grid}function T(e,t){return n.coerce(r,v,s,e,t)}},contentDefaults:function(e,t){var r=t.grid;if(r&&r._domains){var n,a,i,o,l,s,u,d=e.grid||{},p=t._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(t,d,"x"),T=c(t,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 E=y[L];for(n=S;n!==O;n+=C)if((l=s[E][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":168,"../../lib/regex":183,"../../plot_api/plot_template":202,"../../plots/cartesian/constants":218,"../../plots/domain":239}],88:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/constants"),a=e("../../plot_api/plot_template").templatedArray;t.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":202,"../../plots/cartesian/constants":218}],89:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib/to_log_range");t.exports=function(e,t,r,i){t=t||{};var o="log"===r&&"linear"===t.type,l="linear"===r&&"log"===t.type;if(o||l)for(var s,c,u=e._fullLayout.images,f=t._id.charAt(0),d=0;d<u.length;d++)if(c="images["+d+"].",(s=u[d])[f+"ref"]===t._id){var p=s[f],h=s["size"+f],g=null,v=null;if(o){g=a(p,t.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":191,"fast-isnumeric":9}],90:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("../../plots/array_container_defaults"),o=e("./attributes");function l(e,t,r){function i(r,a){return n.coerce(e,t,o,r,a)}var l=i("source");if(!i("visible",!!l))return t;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(e,t,s,f,"paper");"paper"!==d&&a.getFromId(s,d)._imgIndices.push(t._index),a.coercePosition(t,s,i,d,f,0)}return t}t.exports=function(e,t){i(e,t,{name:"images",handleItemDefaults:l})}},{"../../lib":168,"../../plots/array_container_defaults":208,"../../plots/cartesian/axes":212,"./attributes":88}],91:[function(e,t,r){"use strict";var n=e("d3"),a=e("../drawing"),i=e("../../plots/cartesian/axes"),o=e("../../constants/xmlns_namespaces");t.exports=function(e){var t,r,l=e._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){t=f.xref+f.yref;var d=l._plots[t];if(!d){u.push(f);continue}d.mainplot&&(t=d.mainplot.id),c[t]||(c[t]=[]),c[t].push(f)}else"above"===f.layer?s.push(f):u.push(f)}var p={left:{sizing:"xMin",offset:0},center:{sizing:"xMid",offset:-.5},right:{sizing:"xMax",offset:-1}},h={top:{sizing:"YMin",offset:0},middle:{sizing:"YMid",offset:-.5},bottom:{sizing:"YMax",offset:-1}};function g(t){var r=n.select(this);if(this._imgSrc!==t.source)if(r.attr("xmlns",o.svg),t.source&&"data:"===t.source.slice(0,5))r.attr("xlink:href",t.source),this._imgSrc=t.source;else{var a=new Promise(function(e){var n=new Image;function a(){r.remove(),e()}this.img=n,n.setAttribute("crossOrigin","anonymous"),n.onerror=a,n.onload=function(){var t=document.createElement("canvas");t.width=this.width,t.height=this.height,t.getContext("2d").drawImage(this,0,0);var n=t.toDataURL("image/png");r.attr("xlink:href",n),e()},r.on("error",a),n.src=t.source,this._imgSrc=t.source}.bind(this));e._promises.push(a)}}function v(t){var r=n.select(this),o=i.getFromId(e,t.xref),s=i.getFromId(e,t.yref),c=l._size,u=o?Math.abs(o.l2p(t.sizex)-o.l2p(0)):t.sizex*c.w,f=s?Math.abs(s.l2p(t.sizey)-s.l2p(0)):t.sizey*c.h,d=u*p[t.xanchor].offset,g=f*h[t.yanchor].offset,v=p[t.xanchor].sizing+h[t.yanchor].sizing,m=(o?o.r2p(t.x)+o._offset:t.x*c.w+c.l)+d,y=(s?s.r2p(t.y)+s._offset:c.h-t.y*c.h+c.t)+g;switch(t.sizing){case"fill":v+=" slice";break;case"stretch":v="none"}r.attr({x:m,y:y,width:u,height:f,preserveAspectRatio:v,opacity:t.opacity});var x=(o?o._id:"")+(s?s._id:"");a.setClipUrl(r,x?"clip"+l._uid+x:null,e)}var m=l._imageLowerLayer.selectAll("image").data(u),y=l._imageUpperLayer.selectAll("image").data(s);m.enter().append("image"),y.enter().append("image"),m.exit().remove(),y.exit().remove(),m.each((function(e){g.bind(this)(e),v.bind(this)(e)})),y.each((function(e){g.bind(this)(e),v.bind(this)(e)}));var x=Object.keys(l._plots);for(r=0;r<x.length;r++){t=x[r];var b=l._plots[t];if(b.imagelayer){var _=b.imagelayer.selectAll("image").data(c[t]||[]);_.enter().append("image"),_.exit().remove(),_.each((function(e){g.bind(this)(e),v.bind(this)(e)}))}}}},{"../../constants/xmlns_namespaces":149,"../../plots/cartesian/axes":212,"../drawing":65,d3:7}],92:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"images",layoutAttributes:e("./attributes"),supplyLayoutDefaults:e("./defaults"),includeBasePlot:e("../../plots/cartesian/include_components")("images"),draw:e("./draw"),convertCoords:e("./convert_coords")}},{"../../plots/cartesian/include_components":224,"./attributes":88,"./convert_coords":89,"./defaults":90,"./draw":91}],93:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../color/attributes");t.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":240,"../color/attributes":42}],94:[function(e,t,r){"use strict";t.exports={scrollBarWidth:6,scrollBarMinHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4,scrollBarEnterAttrs:{rx:20,ry:3,width:0,height:0},titlePad:2,textGap:40,itemGap:5}},{}],95:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib"),i=e("../../plot_api/plot_template"),o=e("./attributes"),l=e("../../plots/layout_attributes"),s=e("./helpers");t.exports=function(e,t,r){for(var c=e.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"===t.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(e,t,l,"showlegend",f&&u>1);if(!1!==g||c.uirevision){var v=i.newContainer(t,"legend");if(_("uirevision",t.uirevision),!1!==g){_("bgcolor",t.paper_bgcolor),_("bordercolor"),_("borderwidth"),a.coerceFont(_,"font",t.font);var m,y,x,b=_("orientation");"h"===b?(m=0,n.getComponentMethod("rangeslider","isVisible")(e.xaxis)?(y=1.1,x="bottom"):(y=-.1,x="top")):(m=1.02,y=1,x="auto"),_("traceorder",d),s.isGrouped(t.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",t.font))}}function _(e,t){return a.coerce(c,v,o,e,t)}}},{"../../lib":168,"../../plot_api/plot_template":202,"../../plots/layout_attributes":244,"../../registry":254,"./attributes":93,"./helpers":99}],96:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib/events"),s=e("../dragelement"),c=e("../drawing"),u=e("../color"),f=e("../../lib/svg_text_utils"),d=e("./handle_click"),p=e("./constants"),h=e("../../constants/alignment"),g=h.LINE_SPACING,v=h.FROM_TL,m=h.FROM_BR,y=e("./get_legend_data"),x=e("./style"),b=e("./helpers");function _(e,t,r,n,a){var i=r.data()[0][0].trace,s={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:e.data,layout:e.layout,frames:e._transitionData._frames,config:e._context,fullData:e._fullData,fullLayout:e._fullLayout};i._group&&(s.group=i._group),o.traceIs(i,"pie-like")&&(s.label=r.datum()[0].label),!1!==l.triggerHandler(e,"plotly_legendclick",s)&&(1===n?t._clickTimeout=setTimeout((function(){d(r,e,n)}),e._context.doubleClickDelay):2===n&&(t._clickTimeout&&clearTimeout(t._clickTimeout),e._legendMouseDownTime=0,!1!==l.triggerHandler(e,"plotly_legenddoubleclick",s)&&d(r,e,n)))}function w(e,t,r){var n,i=e.data()[0][0],l=i.trace,s=o.traceIs(l,"pie-like"),u=l.index,d=r._main&&t._context.edits.legendText&&!s,h=r._maxNameLength;r.entries?n=i.text:(n=s?i.label:l.name,l._meta&&(n=a.templateString(n,l._meta)));var g=a.ensureSingle(e,"text","legendtext");g.attr("text-anchor","start").classed("user-select-none",!0).call(c.font,r.font).text(d?k(n,h):n),f.positionText(g,p.textGap,0),d?g.call(f.makeEditable,{gd:t,text:n}).call(M,e,t,r).on("edit",(function(n){this.text(k(n,h)).call(M,e,t,r);var l=i.trace._fullInput||{},s={};if(o.hasTransform(l,"groupby")){var c=o.getTransformIndices(l,"groupby"),f=c[c.length-1],d=a.keyedContainer(l,"transforms["+f+"].styles","target","value.name");d.set(i.trace._group,n),s=d.constructUpdate()}else s.name=n;return o.call("_guiRestyle",t,s,u)})):M(g,e,t,r)}function k(e,t){var r=Math.max(4,t);if(e&&e.trim().length>=r/2)return e;for(var n=r-(e=e||"").length;n>0;n--)e+=" ";return e}function T(e,t){var r,i=t._context.doubleClickDelay,o=1,l=a.ensureSingle(e,"rect","legendtoggle",(function(e){e.style("cursor","pointer").attr("pointer-events","all").call(u.fill,"rgba(0,0,0,0)")}));l.on("mousedown",(function(){(r=(new Date).getTime())-t._legendMouseDownTime<i?o+=1:(o=1,t._legendMouseDownTime=r)})),l.on("mouseup",(function(){if(!t._dragged&&!t._editing){var r=t._fullLayout.legend;(new Date).getTime()-t._legendMouseDownTime>i&&(o=Math.max(o-1,1)),_(t,r,e,o,n.event)}}))}function M(e,t,r,n){n._main||e.attr("data-notex",!0),f.convertToTspans(e,r,(function(){!function(e,t,r){var n=e.data()[0][0];if(r._main&&n&&!n.trace.showlegend)e.remove();else{var a=e.select("g[class*=math-group]"),i=a.node();r||(r=t._fullLayout.legend);var o,l,s=r.borderwidth,u=(n?r:r.title).font.size*g;if(i){var d=c.bBox(i);o=d.height,l=d.width,n?c.setTranslate(a,0,.25*o):c.setTranslate(a,s,.75*o+s)}else{var h=e.select(n?".legendtext":".legendtitletext"),v=f.lineCount(h),m=h.node();o=u*v,l=m?c.bBox(m).width:0;var y=u*((v-1)/2-.3);n?f.positionText(h,p.textGap,-y):f.positionText(h,p.titlePad+s,u+s)}n?(n.lineHeight=u,n.height=Math.max(o,16)+3,n.width=l):(r._titleWidth=l,r._titleHeight=o)}}(t,r,n)}))}function A(e){return a.isRightAnchor(e)?"right":a.isCenterAnchor(e)?"center":"left"}function L(e){return a.isBottomAnchor(e)?"bottom":a.isMiddleAnchor(e)?"middle":"top"}t.exports=function(e,t){var r,l=e._fullLayout,f="legend"+l._uid;if(t?(r=t.layer,f+="-hover"):((t=l.legend||{})._main=!0,r=l._infolayer),r){var d;if(e._legendMouseDownTime||(e._legendMouseDownTime=0),t._main){if(!e.calcdata)return;d=l.showlegend&&y(e.calcdata,t)}else{if(!t.entries)return;d=y(t.entries,t)}var h=l.hiddenlabels||[];if(t._main&&(!l.showlegend||!d.length))return r.selectAll(".legend").remove(),l._topdefs.select("#"+f).remove(),i.autoMargin(e,"legend");var g=a.ensureSingle(r,"g","legend",(function(e){t._main&&e.attr("pointer-events","all")})),k=a.ensureSingleById(l._topdefs,"clipPath",f,(function(e){e.append("rect")})),S=a.ensureSingle(g,"rect","bg",(function(e){e.attr("shape-rendering","crispEdges")}));S.call(u.stroke,t.bordercolor).call(u.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px");var C=a.ensureSingle(g,"g","scrollbox"),O=t.title;if(t._titleWidth=0,t._titleHeight=0,O.text){var P=a.ensureSingle(C,"text","legendtitletext");P.attr("text-anchor","start").classed("user-select-none",!0).call(c.font,O.font).text(O.text),M(P,C,e,t)}var D=a.ensureSingle(g,"rect","scrollbar",(function(e){e.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)})),z=C.selectAll("g.groups").data(d);z.enter().append("g").attr("class","groups"),z.exit().remove();var E=z.selectAll("g.traces").data(a.identity);E.enter().append("g").attr("class","traces"),E.exit().remove(),E.style("opacity",(function(e){var t=e[0].trace;return o.traceIs(t,"pie-like")?-1!==h.indexOf(e[0].label)?.5:1:"legendonly"===t.visible?.5:1})).each((function(){n.select(this).call(w,e,t)})).call(x,e,t).each((function(){t._main&&n.select(this).call(T,e)})),a.syncOrAsync([i.previousPromises,function(){return function(e,t,r,a){var i=e._fullLayout;a||(a=i.legend);var o=i._size,l=b.isVertical(a),s=b.isGrouped(a),u=a.borderwidth,f=2*u,d=p.textGap,h=p.itemGap,g=2*(u+h),v=L(a),m=a.y<0||0===a.y&&"top"===v,y=a.y>1||1===a.y&&"bottom"===v;a._maxHeight=Math.max(m||y?i.height/2:o.h,30);var x=0;a._width=0,a._height=0;var _=function(e){var t=0,r=0,n=e.title.side;return n&&(-1!==n.indexOf("left")&&(t=e._titleWidth),-1!==n.indexOf("top")&&(r=e._titleHeight)),[t,r]}(a);if(l)r.each((function(e){var t=e[0].height;c.setTranslate(this,u+_[0],u+_[1]+a._height+t/2+h),a._height+=t,a._width=Math.max(a._width,e[0].width)})),x=d+a._width,a._width+=h+d+f,a._height+=g,s&&(t.each((function(e,t){c.setTranslate(this,0,t*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var w=A(a),k=a.x<0||0===a.x&&"right"===w,T=a.x>1||1===a.x&&"left"===w,M=y||m,S=i.width/2;a._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(e){var t=e[0].width+d;C=Math.max(C,t),O+=t})),x=null;var P=0;if(s){var D=0,z=0,E=0;t.each((function(){var e=0,t=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;c.setTranslate(this,_[0],_[1]+u+h+n/2+t),t+=n,e=Math.max(e,d+r[0].width)})),D=Math.max(D,t);var r=e+h;r+u+z>a._maxWidth&&(P=Math.max(P,z),z=0,E+=D+a.tracegroupgap,D=t),c.setTranslate(this,z,E),z+=r})),a._width=Math.max(P,z)+u,a._height=E+D+g}else{var R=r.size(),I=O+f+(R-1)*h<a._maxWidth,F=0,N=0,H=0,B=0;r.each((function(e){var t=e[0].height,r=d+e[0].width,n=(I?r:C)+h;n+u+N>a._maxWidth&&(P=Math.max(P,B),N=0,H+=F,a._height+=F,F=0),c.setTranslate(this,_[0]+u+N,_[1]+u+H+t/2+h),B=N+r+h,N+=n,F=Math.max(F,t)})),I?(a._width=N+f,a._height=F+g):(a._width=Math.max(P,B)+f,a._height+=F+g)}}a._width=Math.ceil(Math.max(a._width+_[0],a._titleWidth+2*(u+p.titlePad))),a._height=Math.ceil(Math.max(a._height+_[1],a._titleHeight+2*(u+p.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var j=e._context.edits,V=j.legendText||j.legendPosition;r.each((function(e){var t=n.select(this).select(".legendtoggle"),r=e[0].height,a=V?d:x||d+e[0].width;l||(a+=h/2),c.setRect(t,0,-r/2,a,r)}))}(e,z,E,t)},function(){if(!t._main||!function(e){var t=e._fullLayout.legend,r=A(t),n=L(t);return i.autoMargin(e,"legend",{x:t.x,y:t.y,l:t._width*v[r],r:t._width*m[r],b:t._effHeight*m[n],t:t._effHeight*v[n]})}(e)){var u,d,h,y,x=l._size,b=t.borderwidth,w=x.l+x.w*t.x-v[A(t)]*t._width,T=x.t+x.h*(1-t.y)-v[L(t)]*t._effHeight;if(t._main&&l.margin.autoexpand){var M=w,O=T;w=a.constrain(w,0,l.width-t._width),T=a.constrain(T,0,l.height-t._effHeight),w!==M&&a.log("Constrain legend.x to make legend fit inside graph"),T!==O&&a.log("Constrain legend.y to make legend fit inside graph")}if(t._main&&c.setTranslate(g,w,T),D.on(".drag",null),g.on("wheel",null),!t._main||t._height<=t._maxHeight||e._context.staticPlot){var P=t._effHeight;t._main||(P=t._height),S.attr({width:t._width-b,height:P-b,x:b/2,y:b/2}),c.setTranslate(C,0,0),k.select("rect").attr({width:t._width-2*b,height:P-2*b,x:b,y:b}),c.setClipUrl(C,f,e),c.setRect(D,0,0,0,0),delete t._scrollY}else{var z,E=Math.max(p.scrollBarMinHeight,t._effHeight*t._effHeight/t._height),R=t._effHeight-E-2*p.scrollBarMargin,I=t._height-t._effHeight,F=R/I,N=Math.min(t._scrollY||0,I);S.attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-b,x:b/2,y:b/2}),k.select("rect").attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-2*b,x:b,y:b+N}),c.setClipUrl(C,f,e),j(N,E,F),g.on("wheel",(function(){j(N=a.constrain(t._scrollY+n.event.deltaY/R*I,0,I),E,F),0!==N&&N!==I&&n.event.preventDefault()}));var H=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;"touchstart"===e.type?e.changedTouches[0].clientY:e.clientY,z=N})).on("drag",(function(){var e=n.event.sourceEvent;2===e.buttons||e.ctrlKey||("touchmove"===e.type?e.changedTouches[0].clientY:e.clientY,j(N=function(e,t,r){var n=NaN/F+e;return a.constrain(n,0,I)}(z),E,F))}));D.call(H);var B=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;"touchstart"===e.type&&(e.changedTouches[0].clientY,z=N)})).on("drag",(function(){var e=n.event.sourceEvent;"touchmove"===e.type&&(e.changedTouches[0].clientY,j(N=function(e,t,r){var n=NaN/F+e;return a.constrain(n,0,I)}(z),E,F))}));C.call(B)}e._context.edits.legendPosition&&(g.classed("cursor-move",!0),s.init({element:g.node(),gd:e,prepFn:function(){var e=c.getTranslate(g);h=e.x,y=e.y},moveFn:function(e,r){var n=h+e,a=y+r;c.setTranslate(g,n,a),u=s.align(n,0,x.l,x.l+x.w,t.xanchor),d=s.align(a,0,x.t+x.h,x.t,t.yanchor)},doneFn:function(){void 0!==u&&void 0!==d&&o.call("_guiRelayout",e,{"legend.x":u,"legend.y":d})},clickFn:function(t,n){var a=r.selectAll("g.traces").filter((function(){var e=this.getBoundingClientRect();return n.clientX>=e.left&&n.clientX<=e.right&&n.clientY>=e.top&&n.clientY<=e.bottom}));a.size()>0&&_(e,g,a,t,n)}}))}function j(r,n,a){t._scrollY=e._fullLayout.legend._scrollY=r,c.setTranslate(C,0,-r),c.setRect(D,t._width,p.scrollBarMargin+r*a,p.scrollBarWidth,n),k.select("rect").attr("y",b+r)}}],e)}}},{"../../constants/alignment":145,"../../lib":168,"../../lib/events":162,"../../lib/svg_text_utils":189,"../../plots/plots":246,"../../registry":254,"../color":43,"../dragelement":62,"../drawing":65,"./constants":94,"./get_legend_data":97,"./handle_click":98,"./helpers":99,"./style":101,d3:7}],97:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("./helpers");t.exports=function(e,t){var r,i,o={},l=[],s=!1,c={},u=0,f=0,d=t._main;function p(e,r){if(""!==e&&a.isGrouped(t))-1===l.indexOf(e)?(l.push(e),s=!0,o[e]=[[r]]):o[e].push([r]);else{var n="~~i"+u;l.push(n),o[n]=[[r]],u++}}for(r=0;r<e.length;r++){var h=e[r],g=h[0],v=g.trace,m=v.legendgroup;if(!d||v.visible&&v.showlegend)if(n.traceIs(v,"pie-like"))for(c[m]||(c[m]={}),i=0;i<h.length;i++){var y=h[i].label;c[m][y]||(p(m,{label:y,color:h[i].color,i:h[i].i,trace:v,pts:h[i].pts}),c[m][y]=!0,f=Math.max(f,(y||"").length))}else p(m,g),f=Math.max(f,(v.name||"").length)}if(!l.length)return[];var x,b,_=l.length;if(s&&a.isGrouped(t))for(b=new Array(_),r=0;r<_;r++)x=o[l[r]],b[r]=a.isReversed(t)?x.reverse():x;else{for(b=[new Array(_)],r=0;r<_;r++)x=o[l[r]][0],b[0][a.isReversed(t)?_-r-1:r]=x;_=1}return t._lgroupsLength=_,t._maxNameLength=f,b}},{"../../registry":254,"./helpers":99}],98:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=!0;t.exports=function(e,t,r){var o=t._fullLayout;if(!t._dragged&&!t._editing){var l,s=o.legend.itemclick,c=o.legend.itemdoubleclick;if(1===r&&"toggle"===s&&"toggleothers"===c&&i&&t.data&&t._context.showTips?(n.notifier(n._(t,"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=e.data()[0][0],m=t._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=[],t.calcdata[0].forEach((function(e){T!==e.label&&g.push(e.label)})),t._fullLayout.hiddenlabels&&t._fullLayout.hiddenlabels.length===g.length&&-1===M&&(g=[])),a.call("_guiRelayout",t,"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,E=!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"))){E=!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=!!E||"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 R=d.constructUpdate(),I=Object.keys(R);for(f=0;f<I.length;f++)p=I[f],(b[p]=b[p]||[])[k[u]]=R[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",t,b,_)}}}function F(e,t,r){var n=_.indexOf(e),a=b[t];return a||(a=b[t]=[]),-1===_.indexOf(e)&&(_.push(e),n=_.length-1),a[n]=r,n}function N(e,t){var r=e._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(e._group);void 0===s&&(s=!0),!1!==s&&i.set(e._group,t),k[r.index]=F(r.index,"visible",!1!==r.visible)}else{var c=!1!==r.visible&&t;F(r.index,"visible",c)}}}},{"../../lib":168,"../../registry":254}],99:[function(e,t,r){"use strict";r.isGrouped=function(e){return-1!==(e.traceorder||"").indexOf("grouped")},r.isVertical=function(e){return"h"!==e.orientation},r.isReversed=function(e){return-1!==(e.traceorder||"").indexOf("reversed")}},{}],100:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"legend",layoutAttributes:e("./attributes"),supplyLayoutDefaults:e("./defaults"),draw:e("./draw"),style:e("./style")}},{"./attributes":93,"./defaults":95,"./draw":96,"./style":101}],101:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../registry"),i=e("../../lib"),o=e("../drawing"),l=e("../color"),s=e("../colorscale/helpers").extractOpts,c=e("../../traces/scatter/subtypes"),u=e("../../traces/pie/style_one"),f=e("../../traces/pie/helpers").castOption;function d(e,t){return(t?"radial":"horizontal")+(e?"":"reversed")}t.exports=function(e,t,r){var p=t._fullLayout;r||(r=p.legend);var h="constant"===r.itemsizing,g=function(e,t,r,n){var a;if(e+1)a=e;else{if(!(t&&t.width>0))return 0;a=t.width}return h?n:Math.min(a,r)};function v(e,t,r){var i=e[0].trace,o=i.marker||{},s=o.line||{},c=r?i.visible&&i.type===r:a.traceIs(i,"bar"),u=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(c?[e]:[]);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(e){var t=n.select(this),r=e[0],a=g(r.mlw,o.line,5,2);t.style("stroke-width",a+"px").call(l.fill,r.mc||o.color),a&&l.stroke(t,r.mlc||s.color)}))}function m(e,t,r){var o=e[0],l=o.trace,s=r?l.visible&&l.type===r:a.traceIs(l,r),c=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(s?[e]:[]);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=g(f(d.width,o.pts),d,5,2),h=i.minExtend(l,{marker:{line:{width:p}}});h.marker.line.color=d.color;var v=i.minExtend(o,{trace:h});u(c,v,h)}}e.each((function(e){var t=n.select(this),a=i.ensureSingle(t,"g","layers");a.style("opacity",e[0].trace.opacity);var o=r.valign,l=e[0].lineHeight,s=e[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([e]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([e]).enter().append("g").classed("legendlines",!0);var u=a.selectAll("g.legendsymbols").data([e]);u.enter().append("g").classed("legendsymbols",!0),u.selectAll("g.legendpoints").data([e]).enter().append("g").classed("legendpoints",!0)})).each((function(e){var r,a=e[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(e,c){var u,f=n.select(this),p=s(a),h=p.colorscale,g=p.reversescale;if(h){if(!r){var v=h.length;u=0===c?h[g?v-1:0][1]:1===c?h[g?0:v-1][1]:h[Math.floor((v-1)/2)][1]}}else{var m=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(m)?m[c]||m[0]:m}f.attr("d",e[0]),u?f.call(l.fill,u):f.call((function(e){if(e.size()){var n="legendfill-"+a.uid;o.gradient(e,t,n,d(g,"radial"===r),h,"fill")}}))}))})).each((function(e){var t=e[0].trace,r="waterfall"===t.type;if(e[0]._distinct&&r){var a=e[0].trace[e[0].dir].marker;return e[0].mc=a.color,e[0].mlw=a.line.width,e[0].mlc=a.line.color,v(e,this,"waterfall")}var i=[];t.visible&&r&&(i=e[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 o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),o.exit().remove(),o.each((function(e){var r=n.select(this),a=t[e[0]].marker,i=g(void 0,a.line,5,2);r.attr("d",e[1]).style("stroke-width",i+"px").call(l.fill,a.color),i&&r.call(l.stroke,a.line.color)}))})).each((function(e){v(e,this,"funnel")})).each((function(e){v(e,this)})).each((function(e){var r=e[0].trace,s=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[e]:[]);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 e=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var a=g(void 0,r.line,5,2);e.style("stroke-width",a+"px").call(l.fill,r.fillcolor),a&&l.stroke(e,r.line.color)}else{var c=i.minExtend(r,{marker:{size:h?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});s.call(o.pointStyle,c,t)}}))})).each((function(e){m(e,this,"funnelarea")})).each((function(e){m(e,this,"pie")})).each((function(e){var r,a,l=e[0],u=l.trace,f=u.visible&&u.fill&&"none"!==u.fill,p=c.hasLines(u),h=u.contours,v=!1,m=!1,y=s(u),x=y.colorscale,b=y.reversescale;if(h){var _=h.coloring;"lines"===_?v=!0:p="none"===_||"heatmap"===_||h.showlines,"constraint"===h.type?f="="!==h._operation:"fill"!==_&&"heatmap"!==_||(m=!0)}var w=c.hasMarkers(u)||c.hasText(u)||!(f||m)?"M5,0":p||v?"M5,-2":"M5,-3",k=n.select(this),T=k.select(".legendfill").selectAll("path").data(f||m?[e]:[]);if(T.enter().append("path").classed("js-fill",!0),T.exit().remove(),T.attr("d",w+"h30v6h-30z").call(f?o.fillGroupStyle:function(e){if(e.size()){var r="legendfill-"+u.uid;o.gradient(e,t,r,d(b),x,"fill")}}),p||v){var M=g(void 0,u.line,10,5);a=i.minExtend(u,{line:{width:M}}),r=[i.minExtend(l,{trace:a})]}var A=k.select(".legendlines").selectAll("path").data(p||v?[r]:[]);A.enter().append("path").classed("js-line",!0),A.exit().remove(),A.attr("d",w+(v?"l30,0.0001":"h30")).call(p?o.lineGroupStyle:function(e){if(e.size()){var r="legendline-"+u.uid;o.lineGroupStyle(e),o.gradient(e,t,r,d(b),x,"stroke")}})})).each((function(e){var r,a,l=e[0],s=l.trace,u=c.hasMarkers(s),f=c.hasText(s),d=c.hasLines(s);function p(e,t,r,n){var a=i.nestedProperty(s,e).get(),o=i.isArrayOrTypedArray(a)&&t?t(a):a;if(h&&o&&void 0!==n&&(o=n),r){if(o<r[0])return r[0];if(o>r[1])return r[1]}return o}function g(e){return l._distinct&&l.index&&e[l.index]?e[l.index]:e[0]}if(u||f||d){var v={},m={};if(u){v.mc=p("marker.color",g),v.mx=p("marker.symbol",g),v.mo=p("marker.opacity",i.mean,[.2,1]),v.mlc=p("marker.line.color",g),v.mlw=p("marker.line.width",i.mean,[0,5],2),m.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var y=p("marker.size",i.mean,[2,16],12);v.ms=y,m.marker.size=y}d&&(m.line={width:p("line.width",g,[0,10],5)}),f&&(v.tx="Aa",v.tp=p("textposition",g),v.ts=10,v.tc=p("textfont.color",g),v.tf=p("textfont.family",g)),r=[i.minExtend(l,v)],(a=i.minExtend(s,m)).selectedpoints=null,a.texttemplate=null}var x=n.select(this).select("g.legendpoints"),b=x.selectAll("path.scatterpts").data(u?r:[]);b.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform","translate(20,0)"),b.exit().remove(),b.call(o.pointStyle,a,t),u&&(r[0].mrc=3);var _=x.selectAll("g.pointtext").data(f?r:[]);_.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),_.exit().remove(),_.selectAll("text").call(o.textPointStyle,a,t)})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(t.visible&&"candlestick"===t.type?[e,e]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(e,t){return t?"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(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=g(void 0,i.line,5,2);a.style("stroke-width",o+"px").call(l.fill,i.fillcolor),o&&l.stroke(a,i.line.color)}))})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(t.visible&&"ohlc"===t.type?[e,e]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(e,t){return t?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],s=g(void 0,i.line,5,2);a.style("fill","none").call(o.dashLine,i.line.dash,s),s&&l.stroke(a,i.line.color)}))}))}},{"../../lib":168,"../../registry":254,"../../traces/pie/helpers":286,"../../traces/pie/style_one":292,"../../traces/scatter/subtypes":318,"../color":43,"../colorscale/helpers":54,"../drawing":65,d3:7}],102:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/plots"),i=e("../../plots/cartesian/axis_ids"),o=e("../../fonts/ploticon"),l=e("../shapes/draw").eraseActiveShape,s=e("../../lib"),c=s._,u=t.exports={};function f(e,t){var r,a,o=t.currentTarget,l=o.getAttribute("data-attr"),s=o.getAttribute("data-val")||!0,c=e._fullLayout,u={},f=i.list(e,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",e,u)}function d(e,t){for(var r=t.currentTarget,a=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,o=e._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",e,l)}function p(e,t){for(var r=t.currentTarget.getAttribute("data-attr"),a=e._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",e,o)}function h(e,t){var r=t.currentTarget,n=r._previousVal,a=e._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 g(e,t){for(var r=t.currentTarget,a=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,o=e._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",e,c+".projection.scale",d)}}"reset"===a&&x(e,"geo")}function v(e){var t=e._fullLayout;return!t.hovermode&&(t._has("cartesian")?t._isHoriz?"y":"x":"closest")}function m(e){var t=v(e);n.call("_guiRelayout",e,"hovermode",t)}function y(e,t){for(var r=t.currentTarget.getAttribute("data-val"),a=e._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",e,o)}function x(e,t){for(var r=e._fullLayout,a=r._subplots[t]||[],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",e,i)}u.toImage={name:"toImage",title:function(e){var t=(e._context.toImageButtonOptions||{}).format||"png";return c(e,"png"===t?"Download plot as a png":"Download plot")},icon:o.camera,click:function(e){var t=e._context.toImageButtonOptions,r={format:t.format||"png"};s.notifier(c(e,"Taking snapshot - this may take a few seconds"),"long"),"svg"!==r.format&&s.isIE()&&(s.notifier(c(e,"IE only supports svg.  Changing format to svg."),"long"),r.format="svg"),["filename","width","height","scale"].forEach((function(e){e in t&&(r[e]=t[e])})),n.call("downloadImage",e,r).then((function(t){s.notifier(c(e,"Snapshot succeeded")+" - "+t,"long")})).catch((function(){s.notifier(c(e,"Sorry, there was a problem downloading your snapshot!"),"long")}))}},u.sendDataToCloud={name:"sendDataToCloud",title:function(e){return c(e,"Edit in Chart Studio")},icon:o.disk,click:function(e){a.sendDataToCloud(e)}},u.editInChartStudio={name:"editInChartStudio",title:function(e){return c(e,"Edit in Chart Studio")},icon:o.pencil,click:function(e){a.sendDataToCloud(e)}},u.zoom2d={name:"zoom2d",title:function(e){return c(e,"Zoom")},attr:"dragmode",val:"zoom",icon:o.zoombox,click:f},u.pan2d={name:"pan2d",title:function(e){return c(e,"Pan")},attr:"dragmode",val:"pan",icon:o.pan,click:f},u.select2d={name:"select2d",title:function(e){return c(e,"Box Select")},attr:"dragmode",val:"select",icon:o.selectbox,click:f},u.lasso2d={name:"lasso2d",title:function(e){return c(e,"Lasso Select")},attr:"dragmode",val:"lasso",icon:o.lasso,click:f},u.drawclosedpath={name:"drawclosedpath",title:function(e){return c(e,"Draw closed freeform")},attr:"dragmode",val:"drawclosedpath",icon:o.drawclosedpath,click:f},u.drawopenpath={name:"drawopenpath",title:function(e){return c(e,"Draw open freeform")},attr:"dragmode",val:"drawopenpath",icon:o.drawopenpath,click:f},u.drawline={name:"drawline",title:function(e){return c(e,"Draw line")},attr:"dragmode",val:"drawline",icon:o.drawline,click:f},u.drawrect={name:"drawrect",title:function(e){return c(e,"Draw rectangle")},attr:"dragmode",val:"drawrect",icon:o.drawrect,click:f},u.drawcircle={name:"drawcircle",title:function(e){return c(e,"Draw circle")},attr:"dragmode",val:"drawcircle",icon:o.drawcircle,click:f},u.eraseshape={name:"eraseshape",title:function(e){return c(e,"Erase active shape")},icon:o.eraseshape,click:l},u.zoomIn2d={name:"zoomIn2d",title:function(e){return c(e,"Zoom in")},attr:"zoom",val:"in",icon:o.zoom_plus,click:f},u.zoomOut2d={name:"zoomOut2d",title:function(e){return c(e,"Zoom out")},attr:"zoom",val:"out",icon:o.zoom_minus,click:f},u.autoScale2d={name:"autoScale2d",title:function(e){return c(e,"Autoscale")},attr:"zoom",val:"auto",icon:o.autoscale,click:f},u.resetScale2d={name:"resetScale2d",title:function(e){return c(e,"Reset axes")},attr:"zoom",val:"reset",icon:o.home,click:f},u.hoverClosestCartesian={name:"hoverClosestCartesian",title:function(e){return c(e,"Show closest data on hover")},attr:"hovermode",val:"closest",icon:o.tooltip_basic,gravity:"ne",click:f},u.hoverCompareCartesian={name:"hoverCompareCartesian",title:function(e){return c(e,"Compare data on hover")},attr:"hovermode",val:function(e){return e._fullLayout._isHoriz?"y":"x"},icon:o.tooltip_compare,gravity:"ne",click:f},u.zoom3d={name:"zoom3d",title:function(e){return c(e,"Zoom")},attr:"scene.dragmode",val:"zoom",icon:o.zoombox,click:d},u.pan3d={name:"pan3d",title:function(e){return c(e,"Pan")},attr:"scene.dragmode",val:"pan",icon:o.pan,click:d},u.orbitRotation={name:"orbitRotation",title:function(e){return c(e,"Orbital rotation")},attr:"scene.dragmode",val:"orbit",icon:o["3d_rotate"],click:d},u.tableRotation={name:"tableRotation",title:function(e){return c(e,"Turntable rotation")},attr:"scene.dragmode",val:"turntable",icon:o["z-axis"],click:d},u.resetCameraDefault3d={name:"resetCameraDefault3d",title:function(e){return c(e,"Reset camera to default")},attr:"resetDefault",icon:o.home,click:p},u.resetCameraLastSave3d={name:"resetCameraLastSave3d",title:function(e){return c(e,"Reset camera to last save")},attr:"resetLastSave",icon:o.movie,click:p},u.hoverClosest3d={name:"hoverClosest3d",title:function(e){return c(e,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:o.tooltip_basic,gravity:"ne",click:function(e,t){var r=h(e,t);n.call("_guiRelayout",e,r)}},u.zoomInGeo={name:"zoomInGeo",title:function(e){return c(e,"Zoom in")},attr:"zoom",val:"in",icon:o.zoom_plus,click:g},u.zoomOutGeo={name:"zoomOutGeo",title:function(e){return c(e,"Zoom out")},attr:"zoom",val:"out",icon:o.zoom_minus,click:g},u.resetGeo={name:"resetGeo",title:function(e){return c(e,"Reset")},attr:"reset",val:null,icon:o.autoscale,click:g},u.hoverClosestGeo={name:"hoverClosestGeo",title:function(e){return c(e,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:o.tooltip_basic,gravity:"ne",click:m},u.hoverClosestGl2d={name:"hoverClosestGl2d",title:function(e){return c(e,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:o.tooltip_basic,gravity:"ne",click:m},u.hoverClosestPie={name:"hoverClosestPie",title:function(e){return c(e,"Toggle show closest data on hover")},attr:"hovermode",val:"closest",icon:o.tooltip_basic,gravity:"ne",click:m},u.resetViewSankey={name:"resetSankeyGroup",title:function(e){return c(e,"Reset view")},icon:o.home,click:function(e){for(var t={"node.groups":[],"node.x":[],"node.y":[]},r=0;r<e._fullData.length;r++){var a=e._fullData[r]._viewInitial;t["node.groups"].push(a.node.groups.slice()),t["node.x"].push(a.node.x.slice()),t["node.y"].push(a.node.y.slice())}n.call("restyle",e,t)}},u.toggleHover={name:"toggleHover",title:function(e){return c(e,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:o.tooltip_basic,gravity:"ne",click:function(e,t){var r=h(e,t);r.hovermode=v(e),n.call("_guiRelayout",e,r)}},u.resetViews={name:"resetViews",title:function(e){return c(e,"Reset views")},icon:o.home,click:function(e,t){var r=t.currentTarget;r.setAttribute("data-attr","zoom"),r.setAttribute("data-val","reset"),f(e,t),r.setAttribute("data-attr","resetLastSave"),p(e,t),x(e,"geo"),x(e,"mapbox")}},u.toggleSpikelines={name:"toggleSpikelines",title:function(e){return c(e,"Toggle Spike Lines")},icon:o.spikeline,attr:"_cartesianSpikesEnabled",val:"on",click:function(e){var t=e._fullLayout,r=t._cartesianSpikesEnabled;t._cartesianSpikesEnabled="on"===r?"off":"on",n.call("_guiRelayout",e,function(e){for(var t="on"===e._fullLayout._cartesianSpikesEnabled,r=i.list(e,null,!0),n={},a=0;a<r.length;a++){var o=r[a];n[o._name+".showspikes"]=!!t||o._showSpikeInitial}return n}(e))}},u.resetViewMapbox={name:"resetViewMapbox",title:function(e){return c(e,"Reset view")},attr:"reset",icon:o.home,click:function(e){x(e,"mapbox")}},u.zoomInMapbox={name:"zoomInMapbox",title:function(e){return c(e,"Zoom in")},attr:"zoom",val:"in",icon:o.zoom_plus,click:y},u.zoomOutMapbox={name:"zoomOutMapbox",title:function(e){return c(e,"Zoom out")},attr:"zoom",val:"out",icon:o.zoom_minus,click:y}},{"../../fonts/ploticon":152,"../../lib":168,"../../plots/cartesian/axis_ids":215,"../../plots/plots":246,"../../registry":254,"../shapes/draw":124}],103:[function(e,t,r){"use strict";r.manage=e("./manage")},{"./manage":104}],104:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axis_ids"),a=e("../../traces/scatter/subtypes"),i=e("../../registry"),o=e("../fx/helpers").isUnifiedHover,l=e("./modebar"),s=e("./buttons");t.exports=function(e){var t=e._fullLayout,r=e._context,u=t._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 f,d=r.modeBarButtons;f=Array.isArray(d)&&d.length?function(e){for(var t=0;t<e.length;t++)for(var r=e[t],n=0;n<r.length;n++){var a=r[n];if("string"==typeof a){if(void 0===s[a])throw new Error(["*modeBarButtons* configuration options","invalid button name"].join(" "));e[t][n]=s[a]}}return e}(d):!r.displayModeBar&&r.watermark?[]:function(e){var t=e._fullLayout,r=e._fullData,l=e._context,u=l.modeBarButtonsToRemove,f=l.modeBarButtonsToAdd,d=t._has("cartesian"),p=t._has("gl3d"),h=t._has("geo"),g=t._has("pie"),v=t._has("funnelarea"),m=t._has("gl2d"),y=t._has("ternary"),x=t._has("mapbox"),b=t._has("polar"),_=t._has("sankey"),w=function(e){for(var t=n.list({_fullLayout:e},null,!0),r=0;r<t.length;r++)if(!t[r].fixedrange)return!1;return!0}(t),k=o(t.hovermode),T=[];function M(e){if(e.length){for(var t=[],r=0;r<e.length;r++){var n=e[r];-1===u.indexOf(n)&&t.push(s[n])}T.push(t)}}var A=["toImage"];l.showEditInChartStudio?A.push("editInChartStudio"):l.showSendToCloud&&A.push("sendDataToCloud"),M(A);var L=[],S=[],C=[],O=[];if((d||m||g||v||y)+h+p+x+b>1?(S=["toggleHover"],C=["resetViews"]):h?(L=["zoomInGeo","zoomOutGeo"],S=["hoverClosestGeo"],C=["resetGeo"]):p?(S=["hoverClosest3d"],C=["resetCameraDefault3d","resetCameraLastSave3d"]):x?(L=["zoomInMapbox","zoomOutMapbox"],S=["toggleHover"],C=["resetViewMapbox"]):m?S=["hoverClosestGl2d"]:g?S=["hoverClosestPie"]:_?(S=["hoverClosestCartesian","hoverCompareCartesian"],C=["resetViewSankey"]):S=["toggleHover"],d&&(S=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]),(function(e){for(var t=0;t<e.length;t++)if(!i.traceIs(e[t],"noHover"))return!1;return!0}(r)||k)&&(S=[]),!d&&!m||w||(L=["zoomIn2d","zoomOut2d","autoScale2d"],"resetViews"!==C[0]&&(C=["resetScale2d"])),p?O=["zoom3d","pan3d","orbitRotation","tableRotation"]:(d||m)&&!w||y?O=["zoom2d","pan2d"]:x||h?O=["pan2d"]:b&&(O=["zoom2d"]),function(e){for(var t=!1,r=0;r<e.length&&!t;r++){var n=e[r];n._module&&n._module.selectPoints&&(i.traceIs(n,"scatter-like")?(a.hasMarkers(n)||a.hasText(n))&&(t=!0):i.traceIs(n,"box-violin")&&"all"!==n.boxpoints&&"all"!==n.points||(t=!0))}return t}(r)&&O.push("select2d","lasso2d"),Array.isArray(f)){for(var P=[],D=0;D<f.length;D++){var z=f[D];"string"==typeof z?-1!==c.indexOf(z)&&(t._has("mapbox")||t._has("cartesian"))&&O.push(z):P.push(z)}f=P}return M(O),M(L.concat(C)),M(S),function(e,t){if(t.length)if(Array.isArray(t[0]))for(var r=0;r<t.length;r++)e.push(t[r]);else e.push(t);return e}(T,f)}(e),u?u.update(e,f):t._modeBar=l(e,f)}else u&&(u.destroy(),delete t._modeBar)};var c=["drawline","drawopenpath","drawclosedpath","drawcircle","drawrect","eraseshape"]},{"../../plots/cartesian/axis_ids":215,"../../registry":254,"../../traces/scatter/subtypes":318,"../fx/helpers":79,"./buttons":102,"./modebar":105}],105:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../../lib"),o=e("../../fonts/ploticon"),l=new DOMParser;function s(e){this.container=e.container,this.element=document.createElement("div"),this.update(e.graphInfo,e.buttons),this.container.appendChild(this.element)}var c=s.prototype;c.update=function(e,t){this.graphInfo=e;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",t=t.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(t),c=this.hasLogo!==r.displaylogo,u=this.locale!==r.locale;if(this.locale=r.locale,(s||c||u)&&(this.removeAllButtons(),this.updateButtons(t),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(e){var t=this;this.buttons=e,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach((function(e){var r=t.createGroup();e.forEach((function(e){var n=e.name;if(!n)throw new Error("must provide button 'name' in button config");if(-1!==t.buttonsNames.indexOf(n))throw new Error("button name '"+n+"' is taken");t.buttonsNames.push(n);var a=t.createButton(e);t.buttonElements.push(a),r.appendChild(a)})),t.element.appendChild(r)}))},c.createGroup=function(){var e=document.createElement("div");return e.className="modebar-group",e},c.createButton=function(e){var t=this,r=document.createElement("a");r.setAttribute("rel","tooltip"),r.className="modebar-btn";var a=e.title;void 0===a?a=e.name:"function"==typeof a&&(a=a(this.graphInfo)),(a||0===a)&&r.setAttribute("data-title",a),void 0!==e.attr&&r.setAttribute("data-attr",e.attr);var i=e.val;if(void 0!==i&&("function"==typeof i&&(i=i(this.graphInfo)),r.setAttribute("data-val",i)),"function"!=typeof e.click)throw new Error("must provide button 'click' function in button config");r.addEventListener("click",(function(r){e.click(t.graphInfo,r),t.updateActiveButton(r.currentTarget)})),r.setAttribute("data-toggle",e.toggle||!1),e.toggle&&n.select(r).classed("active",!0);var l=e.icon;return"function"==typeof l?r.appendChild(l()):r.appendChild(this.createIcon(l||o.question)),r.setAttribute("data-gravity",e.gravity||"n"),r},c.createIcon=function(e){var t,r=a(e.height)?Number(e.height):e.ascent-e.descent,n="http://www.w3.org/2000/svg";if(e.path){(t=document.createElementNS(n,"svg")).setAttribute("viewBox",[0,0,e.width,r].join(" ")),t.setAttribute("class","icon");var i=document.createElementNS(n,"path");i.setAttribute("d",e.path),e.transform?i.setAttribute("transform",e.transform):void 0!==e.ascent&&i.setAttribute("transform","matrix(1 0 0 -1 0 "+e.ascent+")"),t.appendChild(i)}return e.svg&&(t=l.parseFromString(e.svg,"application/xml").childNodes[0]),t.setAttribute("height","1em"),t.setAttribute("width","1em"),t},c.updateActiveButton=function(e){var t=this.graphInfo._fullLayout,r=void 0!==e?e.getAttribute("data-attr"):null;this.buttonElements.forEach((function(e){var a=e.getAttribute("data-val")||!0,o=e.getAttribute("data-attr"),l="true"===e.getAttribute("data-toggle"),s=n.select(e);if(l)o===r&&s.classed("active",!s.classed("active"));else{var c=null===o?o:i.nestedProperty(t,o).get();s.classed("active",c===a)}}))},c.hasButtons=function(e){var t=this.buttons;if(!t)return!1;if(e.length!==t.length)return!1;for(var r=0;r<e.length;++r){if(e[r].length!==t[r].length)return!1;for(var n=0;n<e[r].length;n++)if(e[r][n].name!==t[r][n].name)return!1}return!0},c.getLogo=function(){var e=this.createGroup(),t=document.createElement("a");return t.href="https://plotly.com/",t.target="_blank",t.setAttribute("data-title",i._(this.graphInfo,"Produced with Plotly")),t.className="modebar-btn plotlyjsicon modebar-btn--logo",t.appendChild(this.createIcon(o.newplotlylogo)),e.appendChild(t),e},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)},t.exports=function(e,t){var r=e._fullLayout,a=new s({graphInfo:e,container:r._modebardiv.node(),buttons:t});return r._privateplot&&n.select(a.element).append("span").classed("badge-private float--left",!0).text("PRIVATE"),a}},{"../../fonts/ploticon":152,"../../lib":168,d3:7,"fast-isnumeric":9}],106:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../color/attributes"),i=(0,e("../../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"});t.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":202,"../../plots/font_attributes":240,"../color/attributes":42}],107:[function(e,t,r){"use strict";t.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}},{}],108:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../color"),i=e("../../plot_api/plot_template"),o=e("../../plots/array_container_defaults"),l=e("./attributes"),s=e("./constants");function c(e,t,r,a){var i=a.calendar;function o(r,a){return n.coerce(e,t,l.buttons,r,a)}if(o("visible")){var s=o("step");"all"!==s&&(!i||"gregorian"===i||"month"!==s&&"year"!==s?o("stepmode"):t.stepmode="backward",o("count")),o("label")}}t.exports=function(e,t,r,u,f){var d=e.rangeselector||{},p=i.newContainer(t,"rangeselector");function h(e,t){return n.coerce(d,p,l,e,t)}if(h("visible",o(d,p,{name:"buttons",handleItemDefaults:c,calendar:f}).length>0)){var g=function(e,t,r){for(var n=r.filter((function(r){return t[r].anchor===e._id})),a=0,i=0;i<n.length;i++){var o=t[n[i]].domain;o&&(a=Math.max(o[1],a))}return[e.domain[0],a+s.yPad]}(t,r,u);h("x",g[0]),h("y",g[1]),n.noneOrAll(e,t,["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":168,"../../plot_api/plot_template":202,"../../plots/array_container_defaults":208,"../color":43,"./attributes":106,"./constants":107}],109:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../registry"),i=e("../../plots/plots"),o=e("../color"),l=e("../drawing"),s=e("../../lib"),c=e("../../lib/svg_text_utils"),u=e("../../plots/cartesian/axis_ids"),f=e("../../constants/alignment"),d=f.LINE_SPACING,p=f.FROM_TL,h=f.FROM_BR,g=e("./constants"),v=e("./get_update_object");function m(e){return e._id}function y(e,t,r){var n=s.ensureSingle(e,"rect","selector-rect",(function(e){e.attr("shape-rendering","crispEdges")}));n.attr({rx:g.rx,ry:g.ry}),n.call(o.stroke,t.bordercolor).call(o.fill,function(e,t){return t._isActive||t._isHovered?e.activecolor:e.bgcolor}(t,r)).style("stroke-width",t.borderwidth+"px")}function x(e,t,r,n){s.ensureSingle(e,"text","selector-text",(function(e){e.classed("user-select-none",!0).attr("text-anchor","middle")})).call(l.font,t.font).text(function(e,t){return e.label?t?s.templateString(e.label,t):e.label:"all"===e.step?"all":e.count+e.step.charAt(0)}(r,n._fullLayout._meta)).call((function(e){c.convertToTspans(e,n)}))}t.exports=function(e){var t=e._fullLayout._infolayer.selectAll(".rangeselector").data(function(e){for(var t=u.list(e,"x",!0),r=[],n=0;n<t.length;n++){var a=t[n];a.rangeselector&&a.rangeselector.visible&&r.push(a)}return r}(e),m);t.enter().append("g").classed("rangeselector",!0),t.exit().remove(),t.style({cursor:"pointer","pointer-events":"all"}),t.each((function(t){var r=n.select(this),o=t,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(t){var r=n.select(this),i=v(o,t);t._isActive=function(e,t,r){if("all"===t.step)return!0===e.autorange;var n=Object.keys(r);return e.range[0]===r[n[0]]&&e.range[1]===r[n[1]]}(o,t,i),r.call(y,u,t),r.call(x,u,t,e),r.on("click",(function(){e._dragged||a.call("_guiRelayout",e,i)})),r.on("mouseover",(function(){t._isHovered=!0,r.call(y,u,t)})),r.on("mouseout",(function(){t._isHovered=!1,r.call(y,u,t)}))})),function(e,t,r,a,o){var u=0,f=0,v=r.borderwidth;t.each((function(){var e=n.select(this).select(".selector-text"),t=r.font.size*d,a=Math.max(t*c.lineCount(e),16)+3;f=Math.max(f,a)})),t.each((function(){var e=n.select(this),t=e.select(".selector-rect"),a=e.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);e.attr("transform","translate("+(v+u)+","+v+")"),t.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=e._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(e,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+")")}(e,f,u,o._name,r)}))}},{"../../constants/alignment":145,"../../lib":168,"../../lib/svg_text_utils":189,"../../plots/cartesian/axis_ids":215,"../../plots/plots":246,"../../registry":254,"../color":43,"../drawing":65,"./constants":107,"./get_update_object":110,d3:7}],110:[function(e,t,r){"use strict";var n=e("d3");t.exports=function(e,t){var r=e._name,a={};if("all"===t.step)a[r+".autorange"]=!0;else{var i=function(e,t){var r,a=e.range,i=new Date(e.r2l(a[1])),o=t.step,l=t.count;switch(t.stepmode){case"backward":r=e.l2r(+n.time[o].utc.offset(i,-l));break;case"todate":var s=n.time[o].utc.offset(i,-l);r=e.l2r(+n.time[o].utc.ceil(s))}return[r,a[1]]}(e,t);a[r+".range[0]"]=i[0],a[r+".range[1]"]=i[1]}return a}},{d3:7}],111:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"rangeselector",schema:{subplots:{xaxis:{rangeselector:e("./attributes")}}},layoutAttributes:e("./attributes"),handleDefaults:e("./defaults"),draw:e("./draw")}},{"./attributes":106,"./defaults":108,"./draw":109}],112:[function(e,t,r){"use strict";var n=e("../color/attributes");t.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":42}],113:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axis_ids").list,a=e("../../plots/cartesian/autorange").getAutoRange,i=e("./constants");t.exports=function(e){for(var t=n(e,"x",!0),r=0;r<t.length;r++){var o=t[r],l=o[i.name];l&&l.visible&&l.autorange&&(l._input.autorange=!0,l._input.range=l.range=a(e,o))}}},{"../../plots/cartesian/autorange":211,"../../plots/cartesian/axis_ids":215,"./constants":114}],114:[function(e,t,r){"use strict";t.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}},{}],115:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plot_api/plot_template"),i=e("../../plots/cartesian/axis_ids"),o=e("./attributes"),l=e("./oppaxis_attributes");t.exports=function(e,t,r){var s=e[r],c=t[r];if(s.rangeslider||t._requestRangeslider[c._id]){n.isPlainObject(s.rangeslider)||(s.rangeslider={});var u,f,d=s.rangeslider,p=a.newContainer(c,"rangeslider");if(_("visible")){_("bgcolor",t.plot_bgcolor),_("bordercolor"),_("borderwidth"),_("thickness"),_("autorange",!c.isValidRange(d.range)),_("range");var h=t._subplots;if(h)for(var g=h.cartesian.filter((function(e){return e.substr(0,e.indexOf("y"))===i.name2id(r)})).map((function(e){return e.substr(e.indexOf("y"),e.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=t[y];u.range&&b.isValidRange(u.range)&&(x="fixed"),"match"!==w("rangemode",x)&&w("range",b.range.slice())}p._input=d}}function _(e,t){return n.coerce(d,p,o,e,t)}function w(e,t){return n.coerce(u,f,l,e,t)}}},{"../../lib":168,"../../plot_api/plot_template":202,"../../plots/cartesian/axis_ids":215,"./attributes":112,"./oppaxis_attributes":119}],116:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../registry"),i=e("../../plots/plots"),o=e("../../lib"),l=e("../drawing"),s=e("../color"),c=e("../titles"),u=e("../../plots/cartesian"),f=e("../../plots/cartesian/axis_ids"),d=e("../dragelement"),p=e("../../lib/setcursor"),h=e("./constants");function g(e,t,r,n){var a=o.ensureSingle(e,"rect",h.bgClassName,(function(e){e.attr({x:0,y:0,"shape-rendering":"crispEdges"})})),i=n.borderwidth%2==0?n.borderwidth:n.borderwidth-1,s=-n._offsetShift,c=l.crispRound(t,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(e,t,r,n){var a=t._fullLayout;o.ensureSingleById(a._topdefs,"clipPath",n._clipId,(function(e){e.append("rect").attr({x:0,y:0})})).select("rect").attr({width:n._width,height:n._height})}function m(e,t,r,a){var s,c=t.calcdata,d=e.selectAll("g."+h.rangePlotClassName).data(r._subplotsWith,o.identity);d.enter().append("g").attr("class",(function(e){return h.rangePlotClassName+" "+e})).call(l.setClipUrl,a._clipId,t),d.order(),d.exit().remove(),d.each((function(e,o){var l=n.select(this),d=0===o,p=f.getFromId(t,e,"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:t._context};r.rangebreaks&&(v.layout.xaxis.rangebreaks=r.rangebreaks),v.layout[h]={type:p.type,domain:[0,1],range:"match"!==g.rangemode?g.range.slice():p.range.slice(),calendar:p.calendar},p.rangebreaks&&(v.layout[h].rangebreaks=p.rangebreaks),i.supplyDefaults(v);var m=v._fullLayout.xaxis,y=v._fullLayout[h];m.clearCalc(),m.setScale(),y.clearCalc(),y.setScale();var x={id:e,plotgroup:l,xaxis:m,yaxis:y,isRangePlot:!0};d?s=x:(x.mainplot="xy",x.mainplotinfo=s),u.rangePlot(t,x,function(e,t){for(var r=[],n=0;n<e.length;n++){var a=e[n],i=a[0].trace;i.xaxis+i.yaxis===t&&r.push(a)}return r}(c,e))}))}function y(e,t,r,n,a){o.ensureSingle(e,"rect",h.maskMinClassName,(function(e){e.attr({x:0,y:0,"shape-rendering":"crispEdges"})})).attr("height",n._height).call(s.fill,h.maskColor),o.ensureSingle(e,"rect",h.maskMaxClassName,(function(e){e.attr({y:0,"shape-rendering":"crispEdges"})})).attr("height",n._height).call(s.fill,h.maskColor),"match"!==a.rangemode&&(o.ensureSingle(e,"rect",h.maskMinOppAxisClassName,(function(e){e.attr({y:0,"shape-rendering":"crispEdges"})})).attr("width",n._width).call(s.fill,h.maskOppAxisColor),o.ensureSingle(e,"rect",h.maskMaxOppAxisClassName,(function(e){e.attr({y:0,"shape-rendering":"crispEdges"})})).attr("width",n._width).style("border-top",h.maskOppBorder).call(s.fill,h.maskOppAxisColor))}function x(e,t,r,n){t._context.staticPlot||o.ensureSingle(e,"rect",h.slideBoxClassName,(function(e){e.attr({y:0,cursor:h.slideBoxCursor,"shape-rendering":"crispEdges"})})).attr({height:n._height,fill:h.slideBoxFill})}function b(e,t,r,n){var a=o.ensureSingle(e,"g",h.grabberMinClassName),i=o.ensureSingle(e,"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(e){e.attr(l)})).attr(c),o.ensureSingle(i,"rect",h.handleMaxClassName,(function(e){e.attr(l)})).attr(c),!t._context.staticPlot){var u={width:h.grabAreaWidth,x:0,y:0,fill:h.grabAreaFill,cursor:h.grabAreaCursor};o.ensureSingle(a,"rect",h.grabAreaMinClassName,(function(e){e.attr(u)})).attr("height",n._height),o.ensureSingle(i,"rect",h.grabAreaMaxClassName,(function(e){e.attr(u)})).attr("height",n._height)}}t.exports=function(e){for(var t=e._fullLayout,r=t._rangeSliderData,i=0;i<r.length;i++){var l=r[i][h.name];l._clipId=l._id+"-"+t._uid}var s=t._infolayer.selectAll("g."+h.containerClassName).data(r,(function(e){return e._name}));s.exit().each((function(e){var r=e[h.name];t._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=t[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=t._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+")"),l._rl=o.simpleMap(l.range,r.r2l);var S=l._rl[0],C=l._rl[1],O=C-S;if(l.p2d=function(e){return e/l._width*O+S},l.d2p=function(e){return(e-S)/O*l._width},r.rangebreaks){var P=r.locateBreaks(S,C);if(P.length){var D,z,E=0;for(D=0;D<P.length;D++)E+=(z=P[D]).max-z.min;var R=l._width/(C-S-E),I=[-R*S];for(D=0;D<P.length;D++)z=P[D],I.push(I[I.length-1]-R*(z.max-z.min));for(l.d2p=function(e){for(var t=I[0],r=0;r<P.length;r++){var n=P[r];if(e>=n.max)t=I[r+1];else if(e<n.min)break}return t+R*e},D=0;D<P.length;D++)(z=P[D]).pmin=l.d2p(z.min),z.pmax=l.d2p(z.max);l.p2d=function(e){for(var t=I[0],r=0;r<P.length;r++){var n=P[r];if(e>=n.pmax)t=I[r+1];else if(e<n.pmin)break}return(e-t)/R}}}if("match"!==u.rangemode){var F=s.r2l(u.range[0]),N=s.r2l(u.range[1])-F;l.d2pOppAxis=function(e){return(e-F)/N*l._height}}i.call(g,e,r,l).call(v,e,r,l).call(m,e,r,l).call(y,e,r,l,u).call(x,e,r,l).call(b,e,r,l),function(e,t,r,i){var l=e.select("rect."+h.slideBoxClassName).node(),s=e.select("rect."+h.grabAreaMinClassName).node(),c=e.select("rect."+h.grabAreaMaxClassName).node();e.on("mousedown",(function(){var u=n.event,f=u.target,h=u.clientX,g=h-e.node().getBoundingClientRect().left,v=i.d2p(r._rl[0]),m=i.d2p(r._rl[1]),y=d.coverSlip();function x(e){var u,d,x,b=+e.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(e,t,r,n){function i(e){return r.l2r(o.constrain(e,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",t,r._name+".range",[l,s])}))}(0,t,r,i)}y.addEventListener("mousemove",x),y.addEventListener("mouseup",(function e(){y.removeEventListener("mousemove",x),y.removeEventListener("mouseup",e),o.removeElement(y)}))}))}(i,e,r,l),function(e,t,r,n,a,i){var l=h.handleWidth/2;function s(e){return o.constrain(e,0,n._width)}function c(e){return o.constrain(e,0,n._height)}function u(e){return o.constrain(e,-l,n._width+l)}var f=s(n.d2p(r._rl[0])),d=s(n.d2p(r._rl[1]));if(e.select("rect."+h.slideBoxClassName).attr("x",f).attr("width",d-f),e.select("rect."+h.maskMinClassName).attr("width",f),e.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]));e.select("rect."+h.maskMinOppAxisClassName).attr("x",f).attr("height",p).attr("width",d-f),e.select("rect."+h.maskMaxOppAxisClassName).attr("x",f).attr("y",g).attr("height",n._height-g).attr("width",d-f),e.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;e.select("g."+h.grabberMinClassName).attr("transform","translate("+v+",0.5)"),e.select("g."+h.grabberMaxClassName).attr("transform","translate("+m+",0.5)")}(i,0,r,l,s,u),"bottom"===r.side&&c.draw(e,r._id+"title",{propContainer:r,propName:r._name+".title",placeholder:t._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":168,"../../lib/setcursor":187,"../../plots/cartesian":225,"../../plots/cartesian/axis_ids":215,"../../plots/plots":246,"../../registry":254,"../color":43,"../dragelement":62,"../drawing":65,"../titles":138,"./constants":114,d3:7}],117:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axis_ids"),a=e("../../lib/svg_text_utils"),i=e("./constants"),o=e("../../constants/alignment").LINE_SPACING,l=i.name;function s(e){var t=e&&e[l];return t&&t.visible}r.isVisible=s,r.makeData=function(e){var t=n.list({_fullLayout:e},"x",!0),r=e.margin,a=[];if(!e._has("gl2d"))for(var i=0;i<t.length;i++){var o=t[i];if(s(o)){a.push(o);var c=o[l];c._id=l+o._id,c._height=(e.height-r.b-r.t)*c.thickness,c._offsetShift=Math.floor(c.borderwidth/2)}}e._rangeSliderData=a},r.autoMarginOpts=function(e,t){var r=e._fullLayout,n=t[l],s=t._id.charAt(0),c=0,u=0;return"bottom"===t.side&&(c=t._depth,t.title.text!==r._dfltTitle[s]&&(u=1.5*t.title.font.size+10+n._offsetShift,u+=(t.title.text.match(a.BR_TAG_ALL)||[]).length*t.title.font.size*o)),{x:0,y:t._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":145,"../../lib/svg_text_utils":189,"../../plots/cartesian/axis_ids":215,"./constants":114}],118:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./attributes"),i=e("./oppaxis_attributes"),o=e("./helpers");t.exports={moduleType:"component",name:"rangeslider",schema:{subplots:{xaxis:{rangeslider:n.extendFlat({},a,{yaxis:i})}}},layoutAttributes:e("./attributes"),handleDefaults:e("./defaults"),calcAutorange:e("./calc_autorange"),draw:e("./draw"),isVisible:o.isVisible,makeData:o.makeData,autoMarginOpts:o.autoMarginOpts}},{"../../lib":168,"./attributes":112,"./calc_autorange":113,"./defaults":115,"./draw":116,"./helpers":117,"./oppaxis_attributes":119}],119:[function(e,t,r){"use strict";t.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"}},{}],120:[function(e,t,r){"use strict";var n=e("../annotations/attributes"),a=e("../../traces/scatter/attributes").line,i=e("../drawing/attributes").dash,o=e("../../lib/extend").extendFlat,l=e("../../plot_api/plot_template").templatedArray;t.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"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"arraydraw"},editable:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},editType:"arraydraw"})},{"../../lib/extend":163,"../../plot_api/plot_template":202,"../../traces/scatter/attributes":294,"../annotations/attributes":28,"../drawing/attributes":64}],121:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("./constants"),o=e("./helpers");function l(e){return c(e.line.width,e.xsizemode,e.x0,e.x1,e.path,!1)}function s(e){return c(e.line.width,e.ysizemode,e.y0,e.y1,e.path,!0)}function c(e,t,r,a,l,s){var c=e/2,u=s;if("pixel"===t){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(e,t,r,n,a){var l="category"===e.type||"multicategory"===e.type?e.r2c:e.d2c;if(void 0!==t)return[l(t),l(r)];if(n){var s,c,u,f,d=1/0,p=-1/0,h=n.match(i.segmentRE);for("date"===e.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}}t.exports=function(e){var t=e._fullLayout,r=n.filterVisible(t.shapes);if(r.length&&e._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(e,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(e,d.yref),g,v,d.path,i.paramIsY))&&(d._extremes[c._id]=a.findExtremes(c,f,s(d)))}}}},{"../../lib":168,"../../plots/cartesian/axes":212,"./constants":122,"./helpers":131}],122:[function(e,t,r){"use strict";t.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}}},{}],123:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("../../plots/array_container_defaults"),o=e("./attributes"),l=e("./helpers");function s(e,t,r){function i(r,a){return n.coerce(e,t,o,r,a)}if(i("visible")){var s=i("path"),c=i("type",s?"path":"rect");"path"!==t.type&&delete t.path,i("editable"),i("layer"),i("opacity"),i("fillcolor"),i("fillrule"),i("line.width")&&(i("line.color"),i("line.dash"));for(var u=i("xsizemode"),f=i("ysizemode"),d=["x","y"],p=0;p<2;p++){var h,g,v,m=d[p],y=m+"anchor",x="x"===m?u:f,b={_fullLayout:r},_=a.coerceRef(e,t,b,m,"","paper");if("paper"!==_?((h=a.getFromId(b,_))._shapeIndices.push(t._index),v=l.rangeToShapePosition(h),g=l.shapePositionToRange(h)):g=v=n.identity,"path"!==c){var w=m+"0",k=m+"1",T=e[w],M=e[k];e[w]=g(e[w],!0),e[k]=g(e[k],!0),"pixel"===x?(i(w,0),i(k,10)):(a.coercePosition(t,b,i,_,w,.25),a.coercePosition(t,b,i,_,k,.75)),t[w]=v(t[w]),t[k]=v(t[k]),e[w]=T,e[k]=M}if("pixel"===x){var A=e[y];e[y]=g(e[y],!0),a.coercePosition(t,b,i,_,y,.25),t[y]=v(t[y]),e[y]=A}}"path"===c?i("path"):n.noneOrAll(e,t,["x0","x1","y0","y1"])}}t.exports=function(e,t){i(e,t,{name:"shapes",handleItemDefaults:s})}},{"../../lib":168,"../../plots/array_container_defaults":208,"../../plots/cartesian/axes":212,"./attributes":120,"./helpers":131}],124:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib"),i=e("../../plots/cartesian/axes"),o=e("./draw_newshape/helpers").readPaths,l=e("./draw_newshape/display_outlines"),s=e("../../plots/cartesian/handle_outline").clearOutlineControllers,c=e("../color"),u=e("../drawing"),f=e("../../plot_api/plot_template").arrayEditor,d=e("../dragelement"),p=e("../../lib/setcursor"),h=e("./constants"),g=e("./helpers");function v(e){var t=e._fullLayout;for(var r in t._shapeUpperLayer.selectAll("path").remove(),t._shapeLowerLayer.selectAll("path").remove(),t._plots){var n=t._plots[r].shapelayer;n&&n.selectAll("path").remove()}for(var a=0;a<t.shapes.length;a++)t.shapes[a].visible&&x(e,a)}function m(e){return!!e._fullLayout._drawing}function y(e){return!e._context.edits.shapePosition}function x(e,t){e._fullLayout._paperdiv.selectAll('.shapelayer [data-index="'+t+'"]').remove();var r=g.makeOptionsAndPlotinfo(e,t),s=r.options,x=r.plotinfo;function T(r){var T=_(e,s),M={"data-index":t,"fill-rule":s.fillrule,d:T},A=s.opacity,L=s.fillcolor,S=s.line.width?s.line.color:"rgba(0,0,0,0)",C=s.line.width,O=s.line.dash;C||!0!==s.editable||(C=5,O="solid");var P="Z"!==T[T.length-1],D=y(e)&&s.editable&&e._fullLayout._activeShapeIndex===t;D&&(L=P?"rgba(0,0,0,0)":e._fullLayout.activeshape.fillcolor,A=e._fullLayout.activeshape.opacity);var z,E=r.append("path").attr(M).style("opacity",A).call(c.stroke,S).call(c.fill,L).call(u.dashLine,O,C);if(b(E,e,s),(D||e._context.edits.shapePosition)&&(z=f(e.layout,"shapes",s)),D){E.style({cursor:"move"});var R={element:E.node(),plotinfo:x,gd:e,editHelpers:z,isActiveShape:!0},I=o(T,e);l(I,E,R)}else e._context.edits.shapePosition?function(e,t,r,o,l,s){var c,f,v,y,x,k,T,M,A,L,S,C,O,P,D,z,E="pixel"===r.xsizemode,R="pixel"===r.ysizemode,I="line"===r.type,F="path"===r.type,N=s.modifyItem,H=i.getFromId(e,r.xref),B=i.getFromId(e,r.yref),j=g.getDataToPixel(e,H),V=g.getDataToPixel(e,B,!0),q=g.getPixelToData(e,H),U=g.getPixelToData(e,B,!0),G=I?function(){var e=Math.max(r.line.width,10),n=l.append("g").attr("data-index",o);n.append("path").attr("d",t.attr("d")).style({cursor:"move","stroke-width":e,"stroke-opacity":"0"});var a={"fill-opacity":"0"},i=Math.max(e/2,10);return n.append("circle").attr({"data-line-point":"start-point",cx:E?j(r.xanchor)+r.x0:j(r.x0),cy:R?V(r.yanchor)-r.y0:V(r.y0),r:i}).style(a).classed("cursor-grab",!0),n.append("circle").attr({"data-line-point":"end-point",cx:E?j(r.xanchor)+r.x1:j(r.x1),cy:R?V(r.yanchor)-r.y1:V(r.y1),r:i}).style(a).classed("cursor-grab",!0),n}():t,Z={element:G.node(),gd:e,prepFn:function(n){m(e)||(E&&(x=j(r.xanchor)),R&&(k=V(r.yanchor)),"path"===r.type?D=r.path:(c=E?r.x0:j(r.x0),f=R?r.y0:V(r.y0),v=E?r.x1:j(r.x1),y=R?r.y1:V(r.y1)),c<v?(A=c,O="x0",L=v,P="x1"):(A=v,O="x1",L=c,P="x0"),!R&&f<y||R&&f>y?(T=f,S="y0",M=y,C="y1"):(T=y,S="y1",M=f,C="y0"),X(n),J(l,r),function(e,t,r){var n=t.xref,a=t.yref,o=i.getFromId(r,n),l=i.getFromId(r,a),s="";"paper"===n||o.autorange||(s+=n),"paper"===a||l.autorange||(s+=a),u.setClipUrl(e,s?"clip"+r._fullLayout._uid+s:null,r)}(t,r,e),Z.moveFn="move"===z?Y:W,Z.altKey=n.altKey)},doneFn:function(){m(e)||(p(t),$(l),b(t,e,r),n.call("_guiRelayout",e,s.getUpdateObj()))},clickFn:function(){m(e)||$(l)}};function X(r){if(m(e))z=null;else if(I)z="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=Z.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,l=r.clientY-n.top,s=!F&&a>10&&i>10&&!r.shiftKey?d.getCursor(o/a,1-l/i):"move";p(t,s),z=s.split("-")[0]}}function Y(n,a){if("path"===r.type){var i=function(e){return e},o=i,s=i;E?N("xanchor",r.xanchor=q(x+n)):(o=function(e){return q(j(e)+n)},H&&"date"===H.type&&(o=g.encodeDate(o))),R?N("yanchor",r.yanchor=U(k+a)):(s=function(e){return U(V(e)+a)},B&&"date"===B.type&&(s=g.encodeDate(s))),N("path",r.path=w(D,o,s))}else E?N("xanchor",r.xanchor=q(x+n)):(N("x0",r.x0=q(c+n)),N("x1",r.x1=q(v+n))),R?N("yanchor",r.yanchor=U(k+a)):(N("y0",r.y0=U(f+a)),N("y1",r.y1=U(y+a)));t.attr("d",_(e,r)),J(l,r)}function W(n,a){if(F){var i=function(e){return e},o=i,s=i;E?N("xanchor",r.xanchor=q(x+n)):(o=function(e){return q(j(e)+n)},H&&"date"===H.type&&(o=g.encodeDate(o))),R?N("yanchor",r.yanchor=U(k+a)):(s=function(e){return U(V(e)+a)},B&&"date"===B.type&&(s=g.encodeDate(s))),N("path",r.path=w(D,o,s))}else if(I){if("resize-over-start-point"===z){var u=c+n,d=R?f-a:f+a;N("x0",r.x0=E?u:q(u)),N("y0",r.y0=R?d:U(d))}else if("resize-over-end-point"===z){var p=v+n,h=R?y-a:y+a;N("x1",r.x1=E?p:q(p)),N("y1",r.y1=R?h:U(h))}}else{var m=function(e){return-1!==z.indexOf(e)},b=m("n"),G=m("s"),Z=m("w"),X=m("e"),Y=b?T+a:T,W=G?M+a:M,$=Z?A+n:A,Q=X?L+n:L;R&&(b&&(Y=T-a),G&&(W=M-a)),(!R&&W-Y>10||R&&Y-W>10)&&(N(S,r[S]=R?Y:U(Y)),N(C,r[C]=R?W:U(W))),Q-$>10&&(N(O,r[O]=E?$:q($)),N(P,r[P]=E?Q:q(Q)))}t.attr("d",_(e,r)),J(l,r)}function J(e,t){(E||R)&&function(){var r="path"!==t.type,n=e.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=j(E?t.xanchor:a.midRange(r?[t.x0,t.x1]:g.extractPathCoords(t.path,h.paramIsX))),o=V(R?t.yanchor:a.midRange(r?[t.y0,t.y1]:g.extractPathCoords(t.path,h.paramIsY)));if(i=g.roundPositionForSharpStrokeRendering(i,1),o=g.roundPositionForSharpStrokeRendering(o,1),E&&R){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 $(e){e.selectAll(".visual-cue").remove()}d.init(Z),G.node().onmousemove=X}(e,E,s,t,r,z):!0===s.editable&&E.style("pointer-events",P||c.opacity(L)*A<=.5?"stroke":"all");E.node().addEventListener("click",(function(){return function(e,t){if(y(e)){var r=+t.node().getAttribute("data-index");if(r>=0){if(r===e._fullLayout._activeShapeIndex)return void k(e);e._fullLayout._activeShapeIndex=r,e._fullLayout._deactivateShape=k,v(e)}}}(e,E)}))}s._input&&!1!==s.visible&&("below"!==s.layer?T(e._fullLayout._shapeUpperLayer):"paper"===s.xref||"paper"===s.yref?T(e._fullLayout._shapeLowerLayer):x._hadPlotinfo?T((x.mainplotinfo||x).shapelayer):T(e._fullLayout._shapeLowerLayer))}function b(e,t,r){var n=(r.xref+r.yref).replace(/paper/g,"");u.setClipUrl(e,n?"clip"+t._fullLayout._uid+n:null,t)}function _(e,t){var r,n,o,l,s,c,u,f,d=t.type,p=i.getFromId(e,t.xref),v=i.getFromId(e,t.yref),m=e._fullLayout._size;if(p?(r=g.shapePositionToRange(p),n=function(e){return p._offset+p.r2p(r(e,!0))}):n=function(e){return m.l+m.w*e},v?(o=g.shapePositionToRange(v),l=function(e){return v._offset+v.r2p(o(e,!0))}):l=function(e){return m.t+m.h*(1-e)},"path"===d)return p&&"date"===p.type&&(n=g.decodeDate(n)),v&&"date"===v.type&&(l=g.decodeDate(l)),function(e,t,r){var n=e.path,i=e.xsizemode,o=e.ysizemode,l=e.xanchor,s=e.yanchor;return n.replace(h.segmentRE,(function(e){var n=0,c=e.charAt(0),u=h.paramIsX[c],f=h.paramIsY[c],d=h.numParams[c],p=e.substr(1).replace(h.paramRE,(function(e){return u[n]?e="pixel"===i?t(l)+Number(e):t(e):f[n]&&(e="pixel"===o?r(s)-Number(e):r(e)),++n>d&&(e="X"),e}));return n>d&&(p=p.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+e)),c+p}))}(t,n,l);if("pixel"===t.xsizemode){var y=n(t.xanchor);s=y+t.x0,c=y+t.x1}else s=n(t.x0),c=n(t.x1);if("pixel"===t.ysizemode){var x=l(t.yanchor);u=x-t.y0,f=x-t.y1}else u=l(t.y0),f=l(t.y1);if("line"===d)return"M"+s+","+u+"L"+c+","+f;if("rect"===d)return"M"+s+","+u+"H"+c+"V"+f+"H"+s+"Z";var b=(s+c)/2,_=(u+f)/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 w(e,t,r){return e.replace(h.segmentRE,(function(e){var n=0,a=e.charAt(0),i=h.paramIsX[a],o=h.paramIsY[a],l=h.numParams[a];return a+e.substr(1).replace(h.paramRE,(function(e){return n>=l||(i[n]?e=t(e):o[n]&&(e=r(e)),n++),e}))}))}function k(e){y(e)&&e._fullLayout._activeShapeIndex>=0&&(s(e),delete e._fullLayout._activeShapeIndex,v(e))}t.exports={draw:v,drawOne:x,eraseActiveShape:function(e){if(y(e)){s(e);var t=e._fullLayout._activeShapeIndex,r=(e.layout||{}).shapes||[];if(t<r.length){for(var a=[],i=0;i<r.length;i++)i!==t&&a.push(r[i]);delete e._fullLayout._activeShapeIndex,n.call("_guiRelayout",e,{shapes:a})}}}}},{"../../lib":168,"../../lib/setcursor":187,"../../plot_api/plot_template":202,"../../plots/cartesian/axes":212,"../../plots/cartesian/handle_outline":222,"../../registry":254,"../color":43,"../dragelement":62,"../drawing":65,"./constants":122,"./draw_newshape/display_outlines":128,"./draw_newshape/helpers":129,"./helpers":131}],125:[function(e,t,r){"use strict";var n=e("../../drawing/attributes").dash,a=e("../../../lib/extend").extendFlat;t.exports={newshape:{line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:0,dflt:4,editType:"none"},dash:a({},n,{dflt:"solid",editType:"none"}),editType:"none"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"none"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"none"},drawdirection:{valType:"enumerated",values:["ortho","horizontal","vertical","diagonal"],dflt:"diagonal",editType:"none"},editType:"none"},activeshape:{fillcolor:{valType:"color",dflt:"rgb(255,0,255)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}},{"../../../lib/extend":163,"../../drawing/attributes":64}],126:[function(e,t,r){"use strict";t.exports={CIRCLE_SIDES:32,i000:0,i090:8,i180:16,i270:24,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}},{}],127:[function(e,t,r){"use strict";var n=e("../../color");t.exports=function(e,t,r){if(r("newshape.drawdirection"),r("newshape.layer"),r("newshape.fillcolor"),r("newshape.fillrule"),r("newshape.opacity"),r("newshape.line.width")){var a=(e||{}).plot_bgcolor||"#FFF";r("newshape.line.color",n.contrast(a)),r("newshape.line.dash")}r("activeshape.fillcolor"),r("activeshape.opacity")}},{"../../color":43}],128:[function(e,t,r){"use strict";var n=e("../../dragelement"),a=e("../../dragelement/helpers").drawMode,i=e("../../../registry"),o=e("./constants"),l=o.i000,s=o.i090,c=o.i180,u=o.i270,f=e("../../../plots/cartesian/handle_outline").clearOutlineControllers,d=e("./helpers"),p=d.pointsShapeRectangle,h=d.pointsShapeEllipse,g=d.writePaths,v=e("./newshapes");t.exports=function e(t,r,o,d){d||(d=0);var m=o.gd;function y(){e(t,r,o,d++),h(t[0])&&x({redrawing:!0})}function x(e){o.isActiveShape=!1;var t=v(r,o);Object.keys(t).length&&i.call((e||{}).redrawing?"relayout":"_guiRelayout",m,t)}var b,_,w,k,T,M=o.isActiveShape,A=m._fullLayout._zoomlayer,L=o.dragmode;function S(e){w=+e.srcElement.getAttribute("data-i"),k=+e.srcElement.getAttribute("data-j"),b[w][k].moveFn=C}function C(e,r){if(t.length){var n=T[w][k][1],a=T[w][k][2],i=t[w],o=i.length;if(p(i)){for(var l=0;l<o;l++)if(l!==k){var s=i[l];s[1]===i[k][1]&&(s[1]=n+e),s[2]===i[k][2]&&(s[2]=a+r)}if(i[k][1]=n+e,i[k][2]=a+r,!p(i))for(var c=0;c<o;c++)for(var u=0;u<i[c].length;u++)i[c][u]=T[w][c][u]}else i[k][1]=n+e,i[k][2]=a+r;y()}}function O(){x()}function P(e,r){if(2===e){w=+r.srcElement.getAttribute("data-i"),k=+r.srcElement.getAttribute("data-j");var n=t[w];p(n)||h(n)||function(){if(t.length&&t[w]&&t[w].length){for(var e=[],r=0;r<t[w].length;r++)r!==k&&e.push(t[w][r]);e.length>1&&(2!==e.length||"Z"!==e[1][0])&&(0===k&&(e[0][0]="M"),t[w]=e,y(),x())}}()}}function D(e,r){!function(e,r){if(t.length)for(var n=0;n<t.length;n++)for(var a=0;a<t[n].length;a++)for(var i=0;i+2<t[n][a].length;i+=2)t[n][a][i+1]=T[n][a][i+1]+e,t[n][a][i+2]=T[n][a][i+2]+r}(e,r),y()}a(L)?m._fullLayout._drawing=!0:m._fullLayout._activeShapeIndex>=0&&f(m),r.attr("d",g(t)),M&&!d&&(T=function(e,t){for(var r=0;r<t.length;r++){var n=t[r];e[r]=[];for(var a=0;a<n.length;a++){e[r][a]=[];for(var i=0;i<n[a].length;i++)e[r][a][i]=n[a][i]}}return e}([],t),function(e){b=[];for(var r=0;r<t.length;r++){var a=t[r],i=!p(a)&&h(a);b[r]=[];for(var o=0;o<a.length;o++)if("Z"!==a[o][0]&&(!i||o===l||o===s||o===c||o===u)){var f=a[o][1],d=a[o][2],g=e.append("circle").classed("cursor-grab",!0).attr("data-i",r).attr("data-j",o).attr("cx",f).attr("cy",d).attr("r",4).style({"mix-blend-mode":"luminosity",fill:"black",stroke:"white","stroke-width":1});b[r][o]={element:g.node(),gd:m,prepFn:S,doneFn:O,clickFn:P},n.init(b[r][o])}}}(A.append("g").attr("class","outline-controllers")),_=[],t.length&&(_[0]={element:r[0][0],gd:m,prepFn:function(e){(w=+e.srcElement.getAttribute("data-i"))||(w=0),_[w].moveFn=D},doneFn:function(){x()}},n.init(_[0])))}},{"../../../plots/cartesian/handle_outline":222,"../../../registry":254,"../../dragelement":62,"../../dragelement/helpers":61,"./constants":126,"./helpers":129,"./newshapes":130}],129:[function(e,t,r){"use strict";var n=e("parse-svg-path"),a=e("./constants"),i=a.CIRCLE_SIDES,o=a.SQRT2,l=e("../../../plots/cartesian/helpers"),s=l.p2r,c=l.r2p,u=[0,3,4,5,6,1,2],f=[0,3,4,1,2];function d(e,t){return Math.abs(e-t)<=1e-6}function p(e,t){var r=t[1]-e[1],n=t[2]-e[2];return Math.sqrt(r*r+n*n)}r.writePaths=function(e){var t=e.length;if(!t)return"M0,0Z";for(var r="",n=0;n<t;n++)for(var a=e[n].length,i=0;i<a;i++){var o=e[n][i][0];if("Z"===o)r+="Z";else for(var l=e[n][i].length,s=0;s<l;s++){var c=s;"Q"===o||"S"===o?c=f[s]:"C"===o&&(c=u[s]),r+=e[n][i][c],s>0&&s<l-1&&(r+=",")}}return r},r.readPaths=function(e,t,r,a){var o,l,u,f=n(e),d=[],p=-1,h=0,g=0,v=function(){l=h,u=g};v();for(var m=0;m<f.length;m++){var y,x,b,_,w=[],k=f[m][0],T=k;switch(k){case"M":d[++p]=[],h=+f[m][1],g=+f[m][2],w.push([T,h,g]),v();break;case"Q":case"S":y=+f[m][1],b=+f[m][2],h=+f[m][3],g=+f[m][4],w.push([T,h,g,y,b]);break;case"C":y=+f[m][1],b=+f[m][2],x=+f[m][3],_=+f[m][4],h=+f[m][5],g=+f[m][6],w.push([T,h,g,y,b,x,_]);break;case"T":case"L":h=+f[m][1],g=+f[m][2],w.push([T,h,g]);break;case"H":T="L",h=+f[m][1],w.push([T,h,g]);break;case"V":T="L",g=+f[m][1],w.push([T,h,g]);break;case"A":T="L";var M=+f[m][1],A=+f[m][2];+f[m][4]||(M=-M,A=-A);var L=h-M,S=g;for(o=1;o<=i/2;o++){var C=2*Math.PI*o/i;w.push([T,L+M*Math.cos(C),S+A*Math.sin(C)])}break;case"Z":h===l&&g===u||(h=l,g=u,w.push([T,h,g]))}for(var O=(r||{}).domain,P=t._fullLayout._size,D=r&&"pixel"===r.xsizemode,z=r&&"pixel"===r.ysizemode,E=!1===a,R=0;R<w.length;R++){for(o=0;o+2<7;o+=2){var I=w[R][o+1],F=w[R][o+2];void 0!==I&&void 0!==F&&(h=I,g=F,r&&(r.xaxis&&r.xaxis.p2r?(E&&(I-=r.xaxis._offset),I=D?c(r.xaxis,r.xanchor)+I:s(r.xaxis,I)):(E&&(I-=P.l),O?I=O.x[0]+I/P.w:I/=P.w),r.yaxis&&r.yaxis.p2r?(E&&(F-=r.yaxis._offset),F=z?c(r.yaxis,r.yanchor)-F:s(r.yaxis,F)):(E&&(F-=P.t),F=O?O.y[1]-F/P.h:1-F/P.h)),w[R][o+1]=I,w[R][o+2]=F)}d[p].push(w[R].slice())}}return d},r.pointsShapeRectangle=function(e){if(5!==e.length)return!1;for(var t=1;t<3;t++){if(!d(e[0][t]-e[1][t],e[3][t]-e[2][t]))return!1;if(!d(e[0][t]-e[3][t],e[1][t]-e[2][t]))return!1}return!(!d(e[0][1],e[1][1])&&!d(e[0][1],e[3][1])||!(p(e[0],e[1])*p(e[0],e[3])))},r.pointsShapeEllipse=function(e){var t=e.length;if(t!==i+1)return!1;t=i;for(var r=0;r<t;r++){var n=(2*t-r)%t,a=(t/2+n)%t,o=(t/2+r)%t;if(!d(p(e[r],e[o]),p(e[n],e[a])))return!1}return!0},r.handleEllipse=function(e,t,n){if(!e)return[t,n];var a=r.ellipseOver({x0:t[0],y0:t[1],x1:n[0],y1:n[1]}),l=(a.x1+a.x0)/2,s=(a.y1+a.y0)/2,c=(a.x1-a.x0)/2,u=(a.y1-a.y0)/2;c||(c=u/=o),u||(u=c/=o);for(var f=[],d=0;d<i;d++){var p=2*d*Math.PI/i;f.push([l+c*Math.cos(p),s+u*Math.sin(p)])}return f},r.ellipseOver=function(e){var t=e.x0,r=e.y0,n=e.x1,a=e.y1,i=n-t,l=a-r,s=((t-=i)+n)/2,c=((r-=l)+a)/2;return{x0:s-(i*=o),y0:c-(l*=o),x1:s+i,y1:c+l}}},{"../../../plots/cartesian/helpers":223,"./constants":126,"parse-svg-path":16}],130:[function(e,t,r){"use strict";var n=e("../../dragelement/helpers"),a=n.drawMode,i=n.openMode,o=e("./constants"),l=o.i000,s=o.i090,c=o.i180,u=o.i270,f=o.cos45,d=o.sin45,p=e("../../../plots/cartesian/helpers"),h=p.p2r,g=p.r2p,v=e("../../../plots/cartesian/handle_outline").clearSelect,m=e("./helpers"),y=m.readPaths,x=m.writePaths,b=m.ellipseOver;t.exports=function(e,t){if(e.length){var r=e[0][0];if(r){var n=r.getAttribute("d"),o=t.gd,p=o._fullLayout.newshape,m=t.plotinfo,_=m.xaxis,w=m.yaxis,k=!!m.domain||!m.xaxis,T=!!m.domain||!m.yaxis,M=t.isActiveShape,A=t.dragmode,L=(o.layout||{}).shapes||[];if(!a(A)&&void 0!==M){var S=o._fullLayout._activeShapeIndex;if(S<L.length)switch(o._fullLayout.shapes[S].type){case"rect":A="drawrect";break;case"circle":A="drawcircle";break;case"line":A="drawline";break;case"path":var C=L[S].path||"";A="Z"===C[C.length-1]?"drawclosedpath":"drawopenpath"}}var O,P=i(A),D=y(n,o,m,M),z={editable:!0,xref:k?"paper":_._id,yref:T?"paper":w._id,layer:p.layer,opacity:p.opacity,line:{color:p.line.color,width:p.line.width,dash:p.line.dash}};if(P||(z.fillcolor=p.fillcolor,z.fillrule=p.fillrule),1===D.length&&(O=D[0]),O&&"drawrect"===A)z.type="rect",z.x0=O[0][1],z.y0=O[0][2],z.x1=O[2][1],z.y1=O[2][2];else if(O&&"drawline"===A)z.type="line",z.x0=O[0][1],z.y0=O[0][2],z.x1=O[1][1],z.y1=O[1][2];else if(O&&"drawcircle"===A){z.type="circle";var E=O[l][1],R=O[s][1],I=O[c][1],F=O[u][1],N=O[l][2],H=O[s][2],B=O[c][2],j=O[u][2],V=m.xaxis&&("date"===m.xaxis.type||"log"===m.xaxis.type),q=m.yaxis&&("date"===m.yaxis.type||"log"===m.yaxis.type);V&&(E=g(m.xaxis,E),R=g(m.xaxis,R),I=g(m.xaxis,I),F=g(m.xaxis,F)),q&&(N=g(m.yaxis,N),H=g(m.yaxis,H),B=g(m.yaxis,B),j=g(m.yaxis,j));var U=(R+F)/2,G=(N+B)/2,Z=b({x0:U,y0:G,x1:U+(F-R+I-E)/2*f,y1:G+(j-H+B-N)/2*d});V&&(Z.x0=h(m.xaxis,Z.x0),Z.x1=h(m.xaxis,Z.x1)),q&&(Z.y0=h(m.yaxis,Z.y0),Z.y1=h(m.yaxis,Z.y1)),z.x0=Z.x0,z.y0=Z.y0,z.x1=Z.x1,z.y1=Z.y1}else z.type="path",_&&w&&function(e,t,r){var n="date"===t.type,a="date"===r.type;if(!n&&!a)return e;for(var i=0;i<e.length;i++)for(var o=0;o<e[i].length;o++)for(var l=0;l+2<e[i][o].length;l+=2)n&&(e[i][o][l+1]=e[i][o][l+1].replace(" ","_")),a&&(e[i][o][l+2]=e[i][o][l+2].replace(" ","_"))}(D,_,w),z.path=x(D),O=null;v(o);for(var X=t.editHelpers,Y=(X||{}).modifyItem,W=[],J=0;J<L.length;J++){var $=o._fullLayout.shapes[J];if(W[J]=$._input,void 0!==M&&J===o._fullLayout._activeShapeIndex){var Q=z;switch($.type){case"line":case"rect":case"circle":Y("x0",Q.x0),Y("x1",Q.x1),Y("y0",Q.y0),Y("y1",Q.y1);break;case"path":Y("path",Q.path)}}}return void 0===M?(W.push(z),W):X?X.getUpdateObj():{}}}}},{"../../../plots/cartesian/handle_outline":222,"../../../plots/cartesian/helpers":223,"../../dragelement/helpers":61,"./constants":126,"./helpers":129}],131:[function(e,t,r){"use strict";var n=e("./constants"),a=e("../../lib");r.rangeToShapePosition=function(e){return"log"===e.type?e.r2d:function(e){return e}},r.shapePositionToRange=function(e){return"log"===e.type?e.d2r:function(e){return e}},r.decodeDate=function(e){return function(t){return t.replace&&(t=t.replace("_"," ")),e(t)}},r.encodeDate=function(e){return function(t){return e(t).replace(" ","_")}},r.extractPathCoords=function(e,t){var r=[];return e.match(n.segmentRE).forEach((function(e){var i=t[e.charAt(0)].drawn;if(void 0!==i){var o=e.substr(1).match(n.paramRE);!o||o.length<i||r.push(a.cleanNumber(o[i]))}})),r},r.getDataToPixel=function(e,t,n){var a,i=e._fullLayout._size;if(t){var o=r.shapePositionToRange(t);a=function(e){return t._offset+t.r2p(o(e,!0))},"date"===t.type&&(a=r.decodeDate(a))}else a=n?function(e){return i.t+i.h*(1-e)}:function(e){return i.l+i.w*e};return a},r.getPixelToData=function(e,t,n){var a,i=e._fullLayout._size;if(t){var o=r.rangeToShapePosition(t);a=function(e){return o(t.p2r(e-t._offset))}}else a=n?function(e){return 1-(e-i.t)/i.h}:function(e){return(e-i.l)/i.w};return a},r.roundPositionForSharpStrokeRendering=function(e,t){var r=1===Math.round(t%2),n=Math.round(e);return r?n+.5:n},r.makeOptionsAndPlotinfo=function(e,t){var r=e._fullLayout.shapes[t]||{},n=e._fullLayout._plots[r.xref+r.yref];return n?n._hadPlotinfo=!0:(n={},r.xref&&"paper"!==r.xref&&(n.xaxis=e._fullLayout[r.xref+"axis"]),r.yref&&"paper"!==r.yref&&(n.yaxis=e._fullLayout[r.yref+"axis"])),n.xsizemode=r.xsizemode,n.ysizemode=r.ysizemode,n.xanchor=r.xanchor,n.yanchor=r.yanchor,{options:r,plotinfo:n}}},{"../../lib":168,"./constants":122}],132:[function(e,t,r){"use strict";var n=e("./draw");t.exports={moduleType:"component",name:"shapes",layoutAttributes:e("./attributes"),supplyLayoutDefaults:e("./defaults"),supplyDrawNewShapeDefaults:e("./draw_newshape/defaults"),includeBasePlot:e("../../plots/cartesian/include_components")("shapes"),calcAutorange:e("./calc_autorange"),draw:n.draw,drawOne:n.drawOne}},{"../../plots/cartesian/include_components":224,"./attributes":120,"./calc_autorange":121,"./defaults":123,"./draw":124,"./draw_newshape/defaults":127}],133:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../../plots/pad_attributes"),i=e("../../lib/extend").extendDeepAll,o=e("../../plot_api/edit_types").overrideAll,l=e("../../plots/animation_attributes"),s=e("../../plot_api/plot_template").templatedArray,c=e("./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}});t.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":163,"../../plot_api/edit_types":195,"../../plot_api/plot_template":202,"../../plots/animation_attributes":207,"../../plots/font_attributes":240,"../../plots/pad_attributes":245,"./constants":134}],134:[function(e,t,r){"use strict";t.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}},{}],135:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,l=i.steps;function s(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}for(var l=a(e,t,{name:"steps",handleItemDefaults:c}),s=0,u=0;u<l.length;u++)l[u].visible&&s++;if(s<2?t.visible=!1:o("visible")){t._stepCount=s;var f=t._visibleSteps=n.filterVisible(l);(l[o("active")]||{}).visible||(t.active=f[0]._index),o("x"),o("y"),n.noneOrAll(e,t,["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",t.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(e,t){function r(r,a){return n.coerce(e,t,l,r,a)}if("skip"===e.method||Array.isArray(e.args)?r("visible"):t.visible=!1){r("method"),r("args");var a=r("label","step-"+t._index);r("value",a),r("execute")}}t.exports=function(e,t){a(e,t,{name:o,handleItemDefaults:s})}},{"../../lib":168,"../../plots/array_container_defaults":208,"./attributes":133,"./constants":134}],136:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../plots/plots"),i=e("../color"),o=e("../drawing"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../plot_api/plot_template").arrayEditor,u=e("./constants"),f=e("../../constants/alignment"),d=f.LINE_SPACING,p=f.FROM_TL,h=f.FROM_BR;function g(e){return u.autoMarginIdRoot+e._index}function v(e){return e._index}function m(e,t){var r=o.tester.selectAll("g."+u.labelGroupClass).data(t._visibleSteps);r.enter().append("g").classed(u.labelGroupClass,!0);var i=0,c=0;r.each((function(e){var r=b(n.select(this),{step:e},t).node();if(r){var a=o.bBox(r);c=Math.max(c,a.height),i=Math.max(i,a.width)}})),r.remove();var f=t._dims={};f.inputAreaWidth=Math.max(u.railWidth,u.gripHeight);var d=e._fullLayout._size;f.lx=d.l+d.w*t.x,f.ly=d.t+d.h*(1-t.y),"fraction"===t.lenmode?f.outerLength=Math.round(d.w*t.len):f.outerLength=t.len,f.inputAreaStart=0,f.inputAreaLength=Math.round(f.outerLength-t.pad.l-t.pad.r);var v=(f.inputAreaLength-2*u.stepInset)/(t._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,t.currentvalue.visible){var x=o.tester.append("g");r.each((function(e){var r=y(x,t,e.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+t.currentvalue.offset,x.remove()}f.height=f.currentValueTotalHeight+u.tickOffset+t.ticklen+u.labelOffset+f.labelHeight+t.pad.t+t.pad.b;var _="left";l.isRightAnchor(t)&&(f.lx-=f.outerLength,_="right"),l.isCenterAnchor(t)&&(f.lx-=f.outerLength/2,_="center");var w="top";l.isBottomAnchor(t)&&(f.ly-=f.height,w="bottom"),l.isMiddleAnchor(t)&&(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:t.y,b:f.height*h[w],t:f.height*p[w]};"fraction"===t.lenmode?(k.l=0,k.xl=t.x-t.len*p[_],k.r=0,k.xr=t.x+t.len*h[_]):(k.x=t.x,k.l=f.outerLength*p[_],k.r=f.outerLength*h[_]),a.autoMargin(e,g(t),k)}function y(e,t,r){if(t.currentvalue.visible){var n,a,i=t._dims;switch(t.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(e,"text",u.labelClass,(function(e){e.classed("user-select-none",!0).attr({"text-anchor":a,"data-notex":1})})),f=t.currentvalue.prefix?t.currentvalue.prefix:"";if("string"==typeof r)f+=r;else{var p=t.steps[t.active].label,h=t._gd._fullLayout._meta;h&&(p=l.templateString(p,h)),f+=p}t.currentvalue.suffix&&(f+=t.currentvalue.suffix),c.call(o.font,t.currentvalue.font).text(f).call(s.convertToTspans,t._gd);var g=s.lineCount(c),v=(i.currentValueMaxLines+1-g)*t.currentvalue.font.size*d;return s.positionText(c,n,v),c}}function x(e,t,r){l.ensureSingle(e,"rect",u.gripRectClass,(function(n){n.call(T,t,e,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(e,t,r){var n=l.ensureSingle(e,"text",u.labelClass,(function(e){e.classed("user-select-none",!0).attr({"text-anchor":"middle","data-notex":1})})),a=t.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 _(e,t){var r=l.ensureSingle(e,"g",u.labelsClass),a=t._dims,i=r.selectAll("g."+u.labelGroupClass).data(a.labelSteps);i.enter().append("g").classed(u.labelGroupClass,!0),i.exit().remove(),i.each((function(e){var r=n.select(this);r.call(b,e,t),o.setTranslate(r,L(t,e.fraction),u.tickOffset+t.ticklen+t.font.size*d+u.labelOffset+a.currentValueTotalHeight)}))}function w(e,t,r,n,a){var i=Math.round(n*(r._stepCount-1)),o=r._visibleSteps[i]._index;o!==r.active&&k(e,t,r,o,!0,a)}function k(e,t,r,n,i,o){var l=r.active;r.active=n,c(e.layout,u.name,r).applyUpdate("active",n);var s=r.steps[r.active];t.call(A,r,o),t.call(y,r),e.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:i,previousActive:l}),s&&s.method&&i&&(t._nextMethod?(t._nextMethod.step=s,t._nextMethod.doCallback=i,t._nextMethod.doTransition=o):(t._nextMethod={step:s,doCallback:i,doTransition:o},t._nextMethodRaf=window.requestAnimationFrame((function(){var r=t._nextMethod.step;r.method&&(r.execute&&a.executeAPICommand(e,r.method,r.args),t._nextMethod=null,t._nextMethodRaf=null)}))))}function T(e,t,r){var a=r.node(),o=n.select(t);function l(){return r.data()[0]}e.on("mousedown",(function(){var e=l();t.emit("plotly_sliderstart",{slider:e});var s=r.select("."+u.gripRectClass);n.event.stopPropagation(),n.event.preventDefault(),s.call(i.fill,e.activebgcolor);var c=S(e,n.mouse(a)[0]);w(t,r,e,c,!0),e._dragging=!0,o.on("mousemove",(function(){var e=l(),i=S(e,n.mouse(a)[0]);w(t,r,e,i,!1)})),o.on("mouseup",(function(){var e=l();e._dragging=!1,s.call(i.fill,e.bgcolor),o.on("mouseup",null),o.on("mousemove",null),t.emit("plotly_sliderend",{slider:e,step:e.steps[e.active]})}))}))}function M(e,t){var r=e.selectAll("rect."+u.tickRectClass).data(t._visibleSteps),a=t._dims;r.enter().append("rect").classed(u.tickRectClass,!0),r.exit().remove(),r.attr({width:t.tickwidth+"px","shape-rendering":"crispEdges"}),r.each((function(e,r){var l=r%a.labelStride==0,s=n.select(this);s.attr({height:l?t.ticklen:t.minorticklen}).call(i.fill,t.tickcolor),o.setTranslate(s,L(t,r/(t._stepCount-1))-.5*t.tickwidth,(l?u.tickOffset:u.minorTickOffset)+a.currentValueTotalHeight)}))}function A(e,t,r){for(var n=e.select("rect."+u.gripRectClass),a=0,i=0;i<t._stepCount;i++)if(t._visibleSteps[i]._index===t.active){a=i;break}var o=L(t,a/(t._stepCount-1));if(!t._invokingCommand){var l=n;r&&t.transition.duration>0&&(l=l.transition().duration(t.transition.duration).ease(t.transition.easing)),l.attr("transform","translate("+(o-.5*u.gripWidth)+","+t._dims.currentValueTotalHeight+")")}}function L(e,t){var r=e._dims;return r.inputAreaStart+u.stepInset+(r.inputAreaLength-2*u.stepInset)*Math.min(1,Math.max(0,t))}function S(e,t){var r=e._dims;return Math.min(1,Math.max(0,(t-u.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*u.stepInset-2*r.inputAreaStart)))}function C(e,t,r){var n=r._dims,a=l.ensureSingle(e,"rect",u.railTouchRectClass,(function(n){n.call(T,t,e,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(e,t){var r=t._dims,n=r.inputAreaLength-2*u.railInset,a=l.ensureSingle(e,"rect",u.railRectClass);a.attr({width:n,height:u.railWidth,rx:u.railRadius,ry:u.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,t.bordercolor).call(i.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px"),o.setTranslate(a,u.railInset,.5*(r.inputAreaWidth-u.railWidth)+r.currentValueTotalHeight)}t.exports=function(e){var t=e._fullLayout,r=function(e,t){for(var r=e[u.name],n=[],a=0;a<r.length;a++){var i=r[a];i.visible&&(i._gd=t,n.push(i))}return n}(t,e),i=t._infolayer.selectAll("g."+u.containerClassName).data(r.length>0?[0]:[]);function l(t){t._commandObserver&&(t._commandObserver.remove(),delete t._commandObserver),a.autoMargin(e,g(t))}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(e,f)}s.each((function(t){var r=n.select(this);!function(e){var t=e._dims;t.labelSteps=[];for(var r=e._stepCount,n=0;n<r;n+=t.labelStride)t.labelSteps.push({fraction:n/(r-1),step:e._visibleSteps[n]})}(t),a.manageCommandObserver(e,t,t._visibleSteps,(function(t){var n=r.data()[0];n.active!==t.index&&(n._dragging||k(e,r,n,t.index,!1,!0))})),function(e,t,r){(r.steps[r.active]||{}).visible||(r.active=r._visibleSteps[0]._index),t.call(y,r).call(O,r).call(_,r).call(M,r).call(C,e,r).call(x,e,r);var n=r._dims;o.setTranslate(t,n.lx+r.pad.l,n.ly+r.pad.t),t.call(A,r,!1),t.call(y,r)}(e,n.select(this),t)}))}}},{"../../constants/alignment":145,"../../lib":168,"../../lib/svg_text_utils":189,"../../plot_api/plot_template":202,"../../plots/plots":246,"../color":43,"../drawing":65,"./constants":134,d3:7}],137:[function(e,t,r){"use strict";var n=e("./constants");t.exports={moduleType:"component",name:n.name,layoutAttributes:e("./attributes"),supplyLayoutDefaults:e("./defaults"),draw:e("./draw")}},{"./attributes":133,"./constants":134,"./defaults":135,"./draw":136}],138:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib"),s=e("../drawing"),c=e("../color"),u=e("../../lib/svg_text_utils"),f=e("../../constants/interactions"),d=e("../../constants/alignment").OPPOSITE_SIDE,p=/ [XY][0-9]* /;t.exports={draw:function(e,t,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=e._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=e._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-"+t));var E=w.selectAll("text").data(z?[0]:[]);if(E.enter().append("text"),E.text(L).attr("class",t),E.exit().remove(),!z)return w;function R(e){l.syncOrAsync([I,F],e)}function I(t){var r;return _?(r="",_.rotate&&(r+="rotate("+[_.rotate,b.x,b.y]+")"),_.offset&&(r+="translate(0, "+_.offset+")")):r=null,t.attr("transform",r),t.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,e),i.previousPromises(e)}function F(e){var t=n.select(e.node().parentNode);if(x&&x.selection&&x.side&&L){t.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(t.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 e=s.bBox(this);l.bBoxIntersect(c,e,o)&&(p=Math.max(p,i*(e[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];t.attr("transform","translate("+v+")")}}}return E.call(R),D&&(L?E.on(".opacity",null):(T=0,M=!0,E.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)}))),E.call(u.makeEditable,{gd:e}).on("edit",(function(t){void 0!==y?o.call("_guiRestyle",e,v,t,y):o.call("_guiRelayout",e,v,t)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(R)})).on("input",(function(e){this.text(e||" ").call(u.positionText,b.x,b.y)}))),E.classed("js-placeholder",M),w}}},{"../../constants/alignment":145,"../../constants/interactions":147,"../../lib":168,"../../lib/svg_text_utils":189,"../../plots/plots":246,"../../registry":254,"../color":43,"../drawing":65,d3:7,"fast-isnumeric":9}],139:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../color/attributes"),i=e("../../lib/extend").extendFlat,o=e("../../plot_api/edit_types").overrideAll,l=e("../../plots/pad_attributes"),s=e("../../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}});t.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":163,"../../plot_api/edit_types":195,"../../plot_api/plot_template":202,"../../plots/font_attributes":240,"../../plots/pad_attributes":245,"../color/attributes":42}],140:[function(e,t,r){"use strict";t.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:"  "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"◄",right:"►",up:"▲",down:"▼"}}},{}],141:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,l=i.buttons;function s(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}o("visible",a(e,t,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(e,t,["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(e,t){function r(r,a){return n.coerce(e,t,l,r,a)}r("visible","skip"===e.method||Array.isArray(e.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}t.exports=function(e,t){a(e,t,{name:o,handleItemDefaults:s})}},{"../../lib":168,"../../plots/array_container_defaults":208,"./attributes":139,"./constants":140}],142:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../plots/plots"),i=e("../color"),o=e("../drawing"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../plot_api/plot_template").arrayEditor,u=e("../../constants/alignment").LINE_SPACING,f=e("./constants"),d=e("./scrollbox");function p(e){return e._index}function h(e,t){return+e.attr(f.menuIndexAttrName)===t._index}function g(e,t,r,n,a,i,o,l){t.active=o,c(e.layout,f.name,t).applyUpdate("active",o),"buttons"===t.type?m(e,n,null,null,t):"dropdown"===t.type&&(a.attr(f.menuIndexAttrName,"-1"),v(e,n,a,i,t),l||m(e,n,a,i,t))}function v(e,t,r,n,a){var i=l.ensureSingle(t,"g",f.headerClassName,(function(e){e.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,e).call(A,a,d,p),l.ensureSingle(t,"text",f.headerArrowClassName,(function(e){e.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(e,t,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(k,a)})),o.setTranslate(t,s.lx,s.ly)}function m(e,t,r,i,o){r||(r=t).attr("pointer-events","all");var s=function(e){return-1==+e.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,e).call(A,o,b),c.on("click",(function(){n.event.defaultPrevented||(l.execute&&(l.args2&&o.active===s?(g(e,o,0,t,r,i,-1),a.executeAPICommand(e,l.method,l.args2)):(g(e,o,0,t,r,i,s),a.executeAPICommand(e,l.method,l.args))),e.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(e,t,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(e){var t=!!e.hbar,r=!!e.vbar;t&&e.hbar.transition().attr("opacity","0").each("end",(function(){t=!1,r||e.disable()})),r&&e.vbar.transition().attr("opacity","0").each("end",(function(){r=!1,t||e.disable()}))}(i))}function y(e,t,r,n){e.call(x,t).call(b,t,r,n)}function x(e,t){l.ensureSingle(e,"rect",f.itemRectClassName,(function(e){e.attr({rx:f.rx,ry:f.ry,"shape-rendering":"crispEdges"})})).call(i.stroke,t.bordercolor).call(i.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px")}function b(e,t,r,n){var a=l.ensureSingle(e,"text",f.itemTextClassName,(function(e){e.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,t.font).text(i).call(s.convertToTspans,n)}function _(e,t){var r=t.active;e.each((function(e,a){var o=n.select(this);a===r&&t.showactive&&o.select("rect."+f.itemRectClassName).call(i.fill,f.activeColor)}))}function w(e){e.select("rect."+f.itemRectClassName).call(i.fill,f.hoverColor)}function k(e,t){e.select("rect."+f.itemRectClassName).call(i.fill,t.bgcolor)}function T(e,t){var r=t._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(t.buttons));i.enter().append("g").classed(f.dropdownButtonClassName,!0);var c=-1!==["up","down"].indexOf(t.direction);i.each((function(a,i){var l=n.select(this);l.call(y,t,a,e);var d=l.select("."+f.itemTextClassName),p=d.node()&&o.bBox(d.node()).width,h=Math.max(p+f.textPadX,f.minWidth),g=t.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"===t.type&&(c?(r.width1+=f.arrowPadX,r.totalHeight=r.height1):r.totalWidth=r.width1,r.totalWidth+=f.arrowPadX),i.remove();var d=r.totalWidth+t.pad.l+t.pad.r,p=r.totalHeight+t.pad.t+t.pad.b,h=e._fullLayout._size;r.lx=h.l+h.w*t.x,r.ly=h.t+h.h*(1-t.y);var g="left";l.isRightAnchor(t)&&(r.lx-=d,g="right"),l.isCenterAnchor(t)&&(r.lx-=d/2,g="center");var v="top";l.isBottomAnchor(t)&&(r.ly-=p,v="bottom"),l.isMiddleAnchor(t)&&(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(e,M(t),{x:t.x,y:t.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(e){return f.autoMarginIdRoot+e._index}function A(e,t,r,n){n=n||{};var a=e.select("."+f.itemRectClassName),i=e.select("."+f.itemTextClassName),l=t.borderwidth,c=r.index,d=t._dims;o.setTranslate(e,l+r.x,l+r.y);var p=-1!==["up","down"].indexOf(t.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=t.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(e,t){e.attr(f.menuIndexAttrName,t||"-1").selectAll("g."+f.dropdownButtonClassName).remove()}t.exports=function(e){var t=e._fullLayout,r=l.filterVisible(t[f.name]);function i(t){a.autoMargin(e,M(t))}var o=t._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(e){e.style("pointer-events","all")})),u=0;u<r.length;u++){var y=r[u];T(e,y)}var x="updatemenus"+t._uid,b=new d(e,c,x);s.enter().size()&&(c.node().parentNode.appendChild(c.node()),c.call(L)),s.exit().each((function(e){c.call(L),i(e)})).remove(),s.each((function(t){var r=n.select(this),i="dropdown"===t.type?c:null;a.manageCommandObserver(e,t,t.buttons,(function(n){g(e,t,t.buttons[n.index],r,i,b,n.index,!0)})),"dropdown"===t.type?(v(e,r,c,b,t),h(c,t)&&m(e,r,c,b,t)):m(e,r,null,null,t)}))}}},{"../../constants/alignment":145,"../../lib":168,"../../lib/svg_text_utils":189,"../../plot_api/plot_template":202,"../../plots/plots":246,"../color":43,"../drawing":65,"./constants":140,"./scrollbox":144,d3:7}],143:[function(e,t,r){arguments[4][137][0].apply(r,arguments)},{"./attributes":139,"./constants":140,"./defaults":141,"./draw":142,dup:137}],144:[function(e,t,r){"use strict";t.exports=l;var n=e("d3"),a=e("../color"),i=e("../drawing"),o=e("../../lib");function l(e,t,r){this.gd=e,this.container=t,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(e,t,r){var o=this.gd._fullLayout,s=o.width,c=o.height;this.position=e;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,E=v;z+P>s&&(z=s-P);var R=this.container.selectAll("rect.scrollbar-vertical").data(O?[0]:[]);R.exit().on(".drag",null).remove(),R.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,l.barColor),O?(this.vbar=R.attr({rx:l.barRadius,ry:l.barRadius,x:z,y:E,width:P,height:D}),this._vbarYMin=E+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,H=d-.5,B=T?p+A+.5:p+.5,j=o._topdefs.selectAll("#"+I).data(T||O?[0]:[]);if(j.exit().remove(),j.enter().append("clipPath").attr("id",I).append("rect"),T||O?(this._clipRect=j.select("rect").attr({x:Math.floor(F),y:Math.floor(H),width:Math.ceil(N)-Math.floor(F),height:Math.ceil(B)-Math.floor(H)}),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(t,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 e=this.translateX,t=this.translateY;this.hbar&&(e-=n.event.dx),this.vbar&&(t-=n.event.dy),this.setTranslate(e,t)},l.prototype._onBoxWheel=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e+=n.event.deltaY),this.vbar&&(t+=n.event.deltaY),this.setTranslate(e,t)},l.prototype._onBarDrag=function(){var e=this.translateX,t=this.translateY;if(this.hbar){var r=e+this._hbarXMin,a=r+this._hbarTranslateMax;e=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=t+this._vbarYMin,l=i+this._vbarTranslateMax;t=(o.constrain(n.event.y,i,l)-i)/(l-i)*(this.position.h-this._box.h)}this.setTranslate(e,t)},l.prototype.setTranslate=function(e,t){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(e=o.constrain(e||0,0,r),t=o.constrain(t||0,0,n),this.translateX=e,this.translateY=t,this.container.call(i.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-t),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+t-.5)}),this.hbar){var a=e/r;this.hbar.call(i.setTranslate,e+a*this._hbarTranslateMax,t)}if(this.vbar){var l=t/n;this.vbar.call(i.setTranslate,e,t+l*this._vbarTranslateMax)}}},{"../../lib":168,"../color":43,"../drawing":65,d3:7}],145:[function(e,t,r){"use strict";t.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"}}},{}],146:[function(e,t,r){"use strict";t.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"}},{}],147:[function(e,t,r){"use strict";t.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],148:[function(e,t,r){"use strict";t.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"−"}},{}],149:[function(e,t,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}},{}],150:[function(e,t,r){"use strict";r.version=e("./version").version,e("es6-promise").polyfill(),e("../build/plotcss"),e("./fonts/mathjax_config")();for(var n=e("./registry"),a=r.register=n.register,i=e("./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(e("./traces/scatter")),a([e("./components/legend"),e("./components/fx"),e("./components/annotations"),e("./components/annotations3d"),e("./components/shapes"),e("./components/images"),e("./components/updatemenus"),e("./components/sliders"),e("./components/rangeslider"),e("./components/rangeselector"),e("./components/grid"),e("./components/errorbars"),e("./components/colorscale"),e("./components/colorbar")]),a([e("./locale-en"),e("./locale-en-us")]),window.PlotlyLocales&&Array.isArray(window.PlotlyLocales)&&(a(window.PlotlyLocales),delete window.PlotlyLocales),r.Icons=e("./fonts/ploticon"),r.Plots=e("./plots/plots"),r.Fx=e("./components/fx"),r.Snapshot=e("./snapshot"),r.PlotSchema=e("./plot_api/plot_schema"),r.Queue=e("./lib/queue"),r.d3=e("d3")},{"../build/plotcss":1,"./components/annotations":36,"./components/annotations3d":41,"./components/colorbar":49,"./components/colorscale":55,"./components/errorbars":71,"./components/fx":83,"./components/grid":87,"./components/images":92,"./components/legend":100,"./components/rangeselector":111,"./components/rangeslider":118,"./components/shapes":132,"./components/sliders":137,"./components/updatemenus":143,"./fonts/mathjax_config":151,"./fonts/ploticon":152,"./lib/queue":182,"./locale-en":193,"./locale-en-us":192,"./plot_api":197,"./plot_api/plot_schema":201,"./plots/plots":246,"./registry":254,"./snapshot":259,"./traces/scatter":306,"./version":321,d3:7,"es6-promise":8}],151:[function(e,t,r){"use strict";t.exports=function(){"undefined"!=typeof MathJax&&"local"!==(window.PlotlyConfig||{}).MathJaxConfig&&(MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured())}},{}],152:[function(e,t,r){"use strict";t.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)"},drawopenpath:{width:70,height:70,path:"M33.21,85.65a7.31,7.31,0,0,1-2.59-.48c-8.16-3.11-9.27-19.8-9.88-41.3-.1-3.58-.19-6.68-.35-9-.15-2.1-.67-3.48-1.43-3.79-2.13-.88-7.91,2.32-12,5.86L3,32.38c1.87-1.64,11.55-9.66,18.27-6.9,2.13.87,4.75,3.14,5.17,9,.17,2.43.26,5.59.36,9.25a224.17,224.17,0,0,0,1.5,23.4c1.54,10.76,4,12.22,4.48,12.4.84.32,2.79-.46,5.76-3.59L43,80.07C41.53,81.57,37.68,85.64,33.21,85.65ZM74.81,69a11.34,11.34,0,0,0,6.09-6.72L87.26,44.5,74.72,32,56.9,38.35c-2.37.86-5.57,3.42-6.61,6L38.65,72.14l8.42,8.43ZM55,46.27a7.91,7.91,0,0,1,3.64-3.17l14.8-5.3,8,8L76.11,60.6l-.06.19a6.37,6.37,0,0,1-3,3.43L48.25,74.59,44.62,71Zm16.57,7.82A6.9,6.9,0,1,0,64.64,61,6.91,6.91,0,0,0,71.54,54.09Zm-4.05,0a2.85,2.85,0,1,1-2.85-2.85A2.86,2.86,0,0,1,67.49,54.09Zm-4.13,5.22L60.5,56.45,44.26,72.7l2.86,2.86ZM97.83,35.67,84.14,22l-8.57,8.57L89.26,44.24Zm-13.69-8,8,8-2.85,2.85-8-8Z",transform:"matrix(1 0 0 1 -15 -15)"},drawclosedpath:{width:90,height:90,path:"M88.41,21.12a26.56,26.56,0,0,0-36.18,0l-2.07,2-2.07-2a26.57,26.57,0,0,0-36.18,0,23.74,23.74,0,0,0,0,34.8L48,90.12a3.22,3.22,0,0,0,4.42,0l36-34.21a23.73,23.73,0,0,0,0-34.79ZM84,51.24,50.16,83.35,16.35,51.25a17.28,17.28,0,0,1,0-25.47,20,20,0,0,1,27.3,0l4.29,4.07a3.23,3.23,0,0,0,4.44,0l4.29-4.07a20,20,0,0,1,27.3,0,17.27,17.27,0,0,1,0,25.46ZM66.76,47.68h-33v6.91h33ZM53.35,35H46.44V68h6.91Z",transform:"matrix(1 0 0 1 -5 -5)"},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)"},drawline:{width:70,height:70,path:"M60.64,62.3a11.29,11.29,0,0,0,6.09-6.72l6.35-17.72L60.54,25.31l-17.82,6.4c-2.36.86-5.57,3.41-6.6,6L24.48,65.5l8.42,8.42ZM40.79,39.63a7.89,7.89,0,0,1,3.65-3.17l14.79-5.31,8,8L61.94,54l-.06.19a6.44,6.44,0,0,1-3,3.43L34.07,68l-3.62-3.63Zm16.57,7.81a6.9,6.9,0,1,0-6.89,6.9A6.9,6.9,0,0,0,57.36,47.44Zm-4,0a2.86,2.86,0,1,1-2.85-2.85A2.86,2.86,0,0,1,53.32,47.44Zm-4.13,5.22L46.33,49.8,30.08,66.05l2.86,2.86ZM83.65,29,70,15.34,61.4,23.9,75.09,37.59ZM70,21.06l8,8-2.84,2.85-8-8ZM87,80.49H10.67V87H87Z",transform:"matrix(1 0 0 1 -15 -15)"},drawrect:{width:80,height:80,path:"M78,22V79H21V22H78m9-9H12V88H87V13ZM68,46.22H31V54H68ZM53,32H45.22V69H53Z",transform:"matrix(1 0 0 1 -10 -10)"},drawcircle:{width:80,height:80,path:"M50,84.72C26.84,84.72,8,69.28,8,50.3S26.84,15.87,50,15.87,92,31.31,92,50.3,73.16,84.72,50,84.72Zm0-60.59c-18.6,0-33.74,11.74-33.74,26.17S31.4,76.46,50,76.46,83.74,64.72,83.74,50.3,68.6,24.13,50,24.13Zm17.15,22h-34v7.11h34Zm-13.8-13H46.24v34h7.11Z",transform:"matrix(1 0 0 1 -10 -10)"},eraseshape:{width:80,height:80,path:"M82.77,78H31.85L6,49.57,31.85,21.14H82.77a8.72,8.72,0,0,1,8.65,8.77V69.24A8.72,8.72,0,0,1,82.77,78ZM35.46,69.84H82.77a.57.57,0,0,0,.49-.6V29.91a.57.57,0,0,0-.49-.61H35.46L17,49.57Zm32.68-34.7-24,24,5,5,24-24Zm-19,.53-5,5,24,24,5-5Z",transform:"matrix(1 0 0 1 -10 -10)"},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: #3f4f75;} .cls-2 {fill: #80cfbe;} .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>"}}},{}],153:[function(e,t,r){"use strict";r.isLeftAnchor=function(e){return"left"===e.xanchor||"auto"===e.xanchor&&e.x<=1/3},r.isCenterAnchor=function(e){return"center"===e.xanchor||"auto"===e.xanchor&&e.x>1/3&&e.x<2/3},r.isRightAnchor=function(e){return"right"===e.xanchor||"auto"===e.xanchor&&e.x>=2/3},r.isTopAnchor=function(e){return"top"===e.yanchor||"auto"===e.yanchor&&e.y>=2/3},r.isMiddleAnchor=function(e){return"middle"===e.yanchor||"auto"===e.yanchor&&e.y>1/3&&e.y<2/3},r.isBottomAnchor=function(e){return"bottom"===e.yanchor||"auto"===e.yanchor&&e.y<=1/3}},{}],154:[function(e,t,r){"use strict";var n=e("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,l=2*o;function s(e){return Math.abs(e[1]-e[0])>l-1e-14}function c(e,t){return i(t-e,l)}function u(e,t){if(s(t))return!0;var r,n;t[0]<t[1]?(r=t[0],n=t[1]):(r=t[1],n=t[0]),(r=a(r,l))>(n=a(n,l))&&(n+=l);var i=a(e,l),o=i+l;return i>=r&&i<=n||o>=r&&o<=n}function f(e,t,r,n,a,i,c){a=a||0,i=i||0;var u,f,d,p,h,g=s([r,n]);function v(e,t){return[e*Math.cos(t)+a,i-e*Math.sin(t)]}g?(u=0,f=o,d=l):r<n?(u=r,d=n):(u=n,d=r),e<t?(p=e,h=t):(p=t,h=e);var m,y=Math.abs(d-u)<=o?0:1;function x(e,t,r){return"A"+[e,e]+" "+[0,y,r]+" "+v(e,t)}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}t.exports={deg2rad:function(e){return e/180*o},rad2deg:function(e){return e/o*180},angleDelta:c,angleDist:function(e,t){return Math.abs(c(e,t))},isFullCircle:s,isAngleInsideSector:u,isPtInsideSector:function(e,t,r,n){return!!u(t,n)&&(r[0]<r[1]?(a=r[0],i=r[1]):(a=r[1],i=r[0]),e>=a&&e<=i);var a,i},pathArc:function(e,t,r,n,a){return f(null,e,t,r,n,a,0)},pathSector:function(e,t,r,n,a){return f(null,e,t,r,n,a,1)},pathAnnulus:function(e,t,r,n,a,i){return f(e,t,r,n,a,i,1)}}},{"./mod":175}],155:[function(e,t,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(e){return a.isView(e)&&!(e instanceof i)}function l(e){return n(e)||o(e)}function s(e,t,r){if(l(e)){if(l(e[0])){for(var n=r,a=0;a<e.length;a++)n=t(n,e[a].length);return n}return e.length}return 0}r.isTypedArray=o,r.isArrayOrTypedArray=l,r.isArray1D=function(e){return!l(e[0])},r.ensureArray=function(e,t){return n(e)||(e=[]),e.length=t,e},r.concat=function(){var e,t,r,a,i,o,l,s,c=[],u=!0,f=0;for(r=0;r<arguments.length;r++)(o=(a=arguments[r]).length)&&(t?c.push(a):(t=a,i=o),n(a)?e=!1:(u=!1,f?e!==a.constructor&&(e=!1):e=a.constructor),f+=o);if(!f)return[];if(!c.length)return t;if(u)return t.concat.apply(t,c);if(e){for((l=new e(f)).set(t),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<t.length;s++)l[s]=t[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(e){return s(e,Math.max,0)},r.minRowLength=function(e){return s(e,Math.min,1/0)}},{}],156:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../constants/numerical").BADNUM,i=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;t.exports=function(e){return"string"==typeof e&&(e=e.replace(i,"")),n(e)?Number(e):a}},{"../constants/numerical":148,"fast-isnumeric":9}],157:[function(e,t,r){"use strict";t.exports=function(e){var t=e._fullLayout;t._glcanvas&&t._glcanvas.size()&&t._glcanvas.each((function(e){e.regl&&e.regl.clear({color:!0,depth:!0})}))}},{}],158:[function(e,t,r){"use strict";t.exports=function(e){e._responsiveChartHandler&&(window.removeEventListener("resize",e._responsiveChartHandler),delete e._responsiveChartHandler)}},{}],159:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("tinycolor2"),i=e("../plots/attributes"),o=e("../components/colorscale/scales"),l=e("../constants/interactions").DESELECTDIM,s=e("./nested_property"),c=e("./regex").counter,u=e("./mod").modHalf,f=e("./array").isArrayOrTypedArray;function d(e,t){var n=r.valObjectMeta[t.valType];if(t.arrayOk&&f(e))return!0;if(n.validateFunction)return n.validateFunction(e,t);var a={},i=a,o={set:function(e){i=e}};return n.coerceFunction(e,o,a,t),i!==a}r.valObjectMeta={data_array:{coerceFunction:function(e,t,r){f(e)?t.set(e):void 0!==r&&t.set(r)}},enumerated:{coerceFunction:function(e,t,r,n){n.coerceNumber&&(e=+e),-1===n.values.indexOf(e)?t.set(r):t.set(e)},validateFunction:function(e,t){t.coerceNumber&&(e=+e);for(var r=t.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(e))return!0}else if(e===r[n])return!0}return!1}},boolean:{coerceFunction:function(e,t,r){!0===e||!1===e?t.set(e):t.set(r)}},number:{coerceFunction:function(e,t,r,a){!n(e)||void 0!==a.min&&e<a.min||void 0!==a.max&&e>a.max?t.set(r):t.set(+e)}},integer:{coerceFunction:function(e,t,r,a){e%1||!n(e)||void 0!==a.min&&e<a.min||void 0!==a.max&&e>a.max?t.set(r):t.set(+e)}},string:{coerceFunction:function(e,t,r,n){if("string"!=typeof e){var a="number"==typeof e;!0!==n.strict&&a?t.set(String(e)):t.set(r)}else n.noBlank&&!e?t.set(r):t.set(e)}},color:{coerceFunction:function(e,t,r){a(e).isValid()?t.set(e):t.set(r)}},colorlist:{coerceFunction:function(e,t,r){Array.isArray(e)&&e.length&&e.every((function(e){return a(e).isValid()}))?t.set(e):t.set(r)}},colorscale:{coerceFunction:function(e,t,r){t.set(o.get(e,r))}},angle:{coerceFunction:function(e,t,r){"auto"===e?t.set("auto"):n(e)?t.set(u(+e,360)):t.set(r)}},subplotid:{coerceFunction:function(e,t,r,n){var a=n.regex||c(r);"string"==typeof e&&a.test(e)?t.set(e):t.set(r)},validateFunction:function(e,t){var r=t.dflt;return e===r||"string"==typeof e&&!!c(r).test(e)}},flaglist:{coerceFunction:function(e,t,r,n){if("string"==typeof e)if(-1===(n.extras||[]).indexOf(e)){for(var a=e.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?t.set(a.join("+")):t.set(r)}else t.set(e);else t.set(r)}},any:{coerceFunction:function(e,t,r){void 0===e?t.set(r):t.set(e)}},info_array:{coerceFunction:function(e,t,n,a){function i(e,t,n){var a,i={set:function(e){a=e}};return void 0===n&&(n=t.dflt),r.valObjectMeta[t.valType].coerceFunction(e,i,n,t),a}var o=2===a.dimensions||"1-2"===a.dimensions&&Array.isArray(e)&&Array.isArray(e[0]);if(Array.isArray(e)){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:e.length;if(n=Array.isArray(n)?n:[],o)for(l=0;l<y;l++)for(h[l]=[],c=Array.isArray(e[l])?e[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(e[l],g?p[l]:p,n[l]))&&(h[l]=d);t.set(h)}else t.set(n)},validateFunction:function(e,t){if(!Array.isArray(e))return!1;var r=t.items,n=Array.isArray(r),a=2===t.dimensions;if(!t.freeLength&&e.length!==r.length)return!1;for(var i=0;i<e.length;i++)if(a){if(!Array.isArray(e[i])||!t.freeLength&&e[i].length!==r[i].length)return!1;for(var o=0;o<e[i].length;o++)if(!d(e[i][o],n?r[i][o]:r))return!1}else if(!d(e[i],n?r[i]:r))return!1;return!0}}},r.coerce=function(e,t,n,a,i){var o=s(n,a).get(),l=s(e,a),c=s(t,a),u=l.get(),p=t._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(e,t,n,a,i){var o=s(e,a),l=r.coerce(e,t,n,a,i);return null!=o.get()&&l},r.coerceFont=function(e,t,r){var n={};return r=r||{},n.family=e(t+".family",r.family),n.size=e(t+".size",r.size),n.color=e(t+".color",r.color),n},r.coerceHoverinfo=function(e,t,n){var a,o=t._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(e,t,l,"hoverinfo",a)},r.coerceSelectionMarkerOpacity=function(e,t){if(e.marker){var r,n,a=e.marker.opacity;void 0!==a&&(f(a)||e.selected||e.unselected||(r=a,n=l*a),t("selected.marker.opacity",r),t("unselected.marker.opacity",n))}},r.validate=d},{"../components/colorscale/scales":58,"../constants/interactions":147,"../plots/attributes":209,"./array":155,"./mod":175,"./nested_property":176,"./regex":183,"fast-isnumeric":9,tinycolor2:26}],160:[function(e,t,r){"use strict";var n,a,i=e("d3"),o=e("fast-isnumeric"),l=e("./loggers"),s=e("./mod").mod,c=e("../constants/numerical"),u=c.BADNUM,f=c.ONEDAY,d=c.ONEHOUR,p=c.ONEMIN,h=c.ONESEC,g=c.EPOCHJD,v=e("../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 _(e){return e&&v.componentsRegistry.calendars&&"string"==typeof e&&"gregorian"!==e}function w(e,t){return String(e+Math.pow(10,t)).substr(1)}r.dateTick0=function(e,t){return _(e)?t?v.getComponentMethod("calendars","CANONICAL_SUNDAY")[e]:v.getComponentMethod("calendars","CANONICAL_TICK")[e]:t?"2000-01-02":"2000-01-01"},r.dfltRange=function(e){return _(e)?v.getComponentMethod("calendars","DFLTRANGE")[e]:["2000-01-01","2001-01-01"]},r.isJSDate=function(e){return"object"==typeof e&&null!==e&&"function"==typeof e.getTime},r.dateTime2ms=function(e,t){if(r.isJSDate(e)){var i=e.getTimezoneOffset()*p,o=(e.getUTCMinutes()-e.getMinutes())*p+(e.getUTCSeconds()-e.getSeconds())*h+(e.getUTCMilliseconds()-e.getMilliseconds());if(o){var l=3*p;i=i-l/2+s(o-i+l/2,l)}return(e=Number(e)-i)>=n&&e<=a?e:u}if("string"!=typeof e&&"number"!=typeof e)return u;e=String(e);var c=_(t),m=e.charAt(0);!c||"G"!==m&&"g"!==m||(e=e.substr(1),t="");var w=c&&"chinese"===t.substr(0,7),k=e.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")(t);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(e){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||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(e,t){return r.dateTime2ms(e,t)!==u};var k=90*f,T=3*d,M=5*p;function A(e,t,r,n,a){if((t||r||n||a)&&(e+=" "+w(t,2)+":"+w(r,2),(n||a)&&(e+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;e+="."+w(a,i)}return e}r.ms2DateTime=function(e,t,r){if("number"!=typeof e||!(e>=n&&e<=a))return u;t||(t=0);var i,o,l,c,y,x,b=Math.floor(10*s(e+.05,1)),w=Math.round(e-b/10);if(_(r)){var L=Math.floor(w/f)+g,S=Math.floor(s(e,f));try{i=v.getComponentMethod("calendars","getCal")(r).fromJD(L).formatDate("yyyy-mm-dd")}catch(e){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=t<k?Math.floor(S/d):0,l=t<k?Math.floor(S%d/p):0,c=t<T?Math.floor(S%p/h):0,y=t<M?S%h*10+b:0}else x=new Date(w),i=m("%Y-%m-%d")(x),o=t<k?x.getUTCHours():0,l=t<k?x.getUTCMinutes():0,c=t<T?x.getUTCSeconds():0,y=t<M?10*x.getUTCMilliseconds()+b:0;return A(i,o,l,c,y)},r.ms2DateTimeLocal=function(e){if(!(e>=n+f&&e<=a-f))return u;var t=Math.floor(10*s(e+.05,1)),r=new Date(Math.round(e-t/10));return A(i.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+t)},r.cleanDate=function(e,t,n){if(e===u)return t;if(r.isJSDate(e)||"number"==typeof e&&isFinite(e)){if(_(n))return l.error("JS Dates and milliseconds are incompatible with world calendars",e),t;if(!(e=r.ms2DateTimeLocal(+e))&&void 0!==t)return t}else if(!r.isDateTime(e,n))return l.error("unrecognized date",e),t;return e};var L=/%\d?f/g;function S(e,t,r,n){e=e.replace(L,(function(e){var r=Math.min(+e.charAt(1)||6,6);return(t/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(t+.05));if(_(n))try{e=v.getComponentMethod("calendars","worldCalFmt")(e,t,n)}catch(e){return"Invalid"}return r(e)(a)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(e,t,r,n,a,i){if(a=_(a)&&a,!t)if("y"===r)t=i.year;else if("m"===r)t=i.month;else{if("d"!==r)return function(e,t){var r=s(e+.05,f),n=w(Math.floor(r/d),2)+":"+w(s(Math.floor(r/p),60),2);if("M"!==t){o(t)||(t=0);var a=(100+Math.min(s(e/h,60),C[t])).toFixed(t).substr(1);t>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(e,r)+"\n"+S(i.dayMonthYear,e,n,a);t=i.dayMonth+"\n"+i.year}return S(t,e,n,a)};var O=3*f;r.incrementMonth=function(e,t,r){r=_(r)&&r;var n=s(e,f);if(e=Math.round(e-n),r)try{var a=Math.round(e/f)+g,i=v.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return t%12?i.add(o,t,"m"):i.add(o,t/12,"y"),(o.toJD()-g)*f+n}catch(t){l.error("invalid ms "+e+" in calendar "+r)}var c=new Date(e+O);return c.setUTCMonth(c.getUTCMonth()+t)+n-O},r.findExactDates=function(e,t){for(var r,n,a=0,i=0,l=0,s=0,c=_(t)&&v.getComponentMethod("calendars","getCal")(t),u=0;u<e.length;u++)if(n=e[u],o(n)){if(!(n%f))if(c)try{1===(r=c.fromJD(n/f+g)).day()?1===r.month()?a++:i++:l++}catch(e){}else 1===(r=new Date(n)).getUTCDate()?0===r.getUTCMonth()?a++:i++:l++}else s++;l+=i+=a;var d=e.length-s;return{exactYears:a/d,exactMonths:i/d,exactDays:l/d}}},{"../constants/numerical":148,"../registry":254,"./loggers":172,"./mod":175,d3:7,"fast-isnumeric":9}],161:[function(e,t,r){"use strict";var n=e("d3"),a=e("./loggers");function i(e){var t=e&&e.parentNode;t&&t.removeChild(e)}function o(e,t,r){var n="plotly.js-style-"+e,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(t+"{"+r+"}",0):o.addRule?o.addRule(t,r,0):a.warn("addStyleRule failed")}t.exports={getGraphDiv:function(e){var t;if("string"==typeof e){if(null===(t=document.getElementById(e)))throw new Error("No DOM element with id '"+e+"' exists on the page.");return t}if(null==e)throw new Error("DOM element provided is null or undefined");return e},isPlotDiv:function(e){var t=n.select(e);return t.node()instanceof HTMLElement&&t.size()&&t.classed("js-plotly-plot")},removeElement:i,addStyleRule:function(e,t){o("global",e,t)},addRelatedStyleRule:o,deleteRelatedStyleRule:function(e){var t="plotly.js-style-"+e,r=document.getElementById(t);r&&i(r)}}},{"./loggers":172,d3:7}],162:[function(e,t,n){"use strict";var a=e("events").EventEmitter,i={init:function(e){if(e._ev instanceof a)return e;var t=new a,n=new a;return e._ev=t,e._internalEv=n,e.on=t.on.bind(t),e.once=t.once.bind(t),e.removeListener=t.removeListener.bind(t),e.removeAllListeners=t.removeAllListeners.bind(t),e._internalOn=n.on.bind(n),e._internalOnce=n.once.bind(n),e._removeInternalListener=n.removeListener.bind(n),e._removeAllInternalListeners=n.removeAllListeners.bind(n),e.emit=function(a,i){void 0!==r&&r(e).trigger(a,i),t.emit(a,i),n.emit(a,i)},e},triggerHandler:function(e,t,n){var a,i;void 0!==r&&(a=r(e).triggerHandler(t,n));var o=e._ev;if(!o)return a;var l,s=o._events[t];if(!s)return a;function c(e){return e.listener?(o.removeListener(t,e.listener),e.fired?void 0:(e.fired=!0,e.listener.apply(o,[n]))):e.apply(o,[n])}for(s=Array.isArray(s)?s:[s],l=0;l<s.length-1;l++)c(s[l]);return i=c(s[l]),void 0!==a?a:i},purge:function(e){return delete e._ev,delete e.on,delete e.once,delete e.removeListener,delete e.removeAllListeners,delete e.emit,delete e._ev,delete e._internalEv,delete e._internalOn,delete e._internalOnce,delete e._removeInternalListener,delete e._removeAllInternalListeners,e}};t.exports=i},{events:6}],163:[function(e,t,r){"use strict";var n=e("./is_plain_object.js"),a=Array.isArray;function i(e,t,r,o){var l,s,c,u,f,d,p=e[0],h=e.length;if(2===h&&a(p)&&a(e[1])&&0===p.length){if(function(e,t){var r,n;for(r=0;r<e.length;r++){if(null!==(n=e[r])&&"object"==typeof n)return!1;void 0!==n&&(t[r]=n)}return!0}(e[1],p))return p;p.splice(0,p.length)}for(var g=1;g<h;g++)for(s in l=e[g])c=p[s],u=l[s],o&&a(u)?p[s]=u:t&&u&&(n(u)||(f=a(u)))?(f?(f=!1,d=c&&a(c)?c:[]):d=c&&n(c)?c:{},p[s]=i([d,u],t,r,o)):(void 0!==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":169}],164:[function(e,t,r){"use strict";t.exports=function(e){for(var t={},r=[],n=0,a=0;a<e.length;a++){var i=e[a];1!==t[i]&&(t[i]=1,r[n++]=i)}return r}},{}],165:[function(e,t,r){"use strict";function n(e){return!0===e.visible}function a(e){var t=e[0].trace;return!0===t.visible&&0!==t._length}t.exports=function(e){for(var t,r=(t=e,Array.isArray(t)&&Array.isArray(t[0])&&t[0][0]&&t[0][0].trace?a:n),i=[],o=0;o<e.length;o++){var l=e[o];r(l)&&i.push(l)}return i}},{}],166:[function(e,t,r){"use strict";var n,a,i,o=e("./mod").mod;function l(e,t,r,n,a,i,o,l){var s=r-e,c=a-e,u=o-a,f=n-t,d=i-t,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:e+s*g,y:t+f*g}}function s(e,t,r,n,a){var i=n*e+a*t;if(i<0)return n*n+a*a;if(i>r){var o=n-e,l=a-t;return o*o+l*l}var s=n*t-a*e;return s*s/r}r.segmentsIntersect=l,r.segmentDistance=function(e,t,r,n,a,i,o,c){if(l(e,t,r,n,a,i,o,c))return 0;var u=r-e,f=n-t,d=o-a,p=c-i,h=u*u+f*f,g=d*d+p*p,v=Math.min(s(u,f,h,a-e,i-t),s(u,f,h,o-e,c-t),s(d,p,g,e-a,t-i),s(d,p,g,r-a,n-i));return Math.sqrt(v)},r.getTextLocation=function(e,t,r,l){if(e===a&&l===i||(n={},a=e,i=l),n[r])return n[r];var s=e.getPointAtLength(o(r-l/2,t)),c=e.getPointAtLength(o(r+l/2,t)),u=Math.atan((c.y-s.y)/(c.x-s.x)),f=e.getPointAtLength(o(r,t)),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(e,t,r){var n,a,i=t.left,o=t.right,l=t.top,s=t.bottom,c=0,u=e.getTotalLength(),f=u;function d(t){var r=e.getPointAtLength(t);0===t?n=r:t===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(e,t,r,n){for(var a,i,o,l=(n=n||{}).pathLength||e.getTotalLength(),s=n.tolerance||.001,c=n.iterationLimit||30,u=e.getPointAtLength(0)[r]>e.getPointAtLength(l)[r]?-1:1,f=0,d=0,p=l;f<c;){if(a=(d+p)/2,o=(i=e.getPointAtLength(a))[r]-t,Math.abs(o)<s)return i;u*o>0?p=a:d=a,f++}return i}},{"./mod":175}],167:[function(e,t,r){"use strict";t.exports=function(e){return e}},{}],168:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../constants/numerical"),o=i.FP_SAFE,l=i.BADNUM,s=t.exports={};s.nestedProperty=e("./nested_property"),s.keyedContainer=e("./keyed_container"),s.relativeAttr=e("./relative_attr"),s.isPlainObject=e("./is_plain_object"),s.toLogRange=e("./to_log_range"),s.relinkPrivateKeys=e("./relink_private");var c=e("./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=e("./mod");s.mod=u.mod,s.modHalf=u.modHalf;var f=e("./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=e("./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=e("./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=e("./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=e("./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=e("./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=e("./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=e("./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=e("./extend");s.extendFlat=x.extendFlat,s.extendDeep=x.extendDeep,s.extendDeepAll=x.extendDeepAll,s.extendDeepNoArrays=x.extendDeepNoArrays;var b=e("./loggers");s.log=b.log,s.warn=b.warn,s.error=b.error;var _=e("./regex");s.counterRegex=_.counter;var w=e("./throttle");s.throttle=w.throttle,s.throttleDone=w.done,s.clearThrottle=w.clear;var k=e("./dom");function T(e){var t={};for(var r in e)for(var n=e[r],a=0;a<n.length;a++)t[n[a]]=+r;return t}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=e("./clear_responsive"),s.makeTraceGroups=e("./make_trace_groups"),s._=e("./localize"),s.notifier=e("./notifier"),s.filterUnique=e("./filter_unique"),s.filterVisible=e("./filter_visible"),s.pushUnique=e("./push_unique"),s.cleanNumber=e("./clean_number"),s.ensureNumber=function(e){return a(e)?(e=Number(e))<-o||e>o?l:a(e)?Number(e):l:l},s.isIndex=function(e,t){return!(void 0!==t&&e>=t)&&a(e)&&e>=0&&e%1==0},s.noop=e("./noop"),s.identity=e("./identity"),s.repeat=function(e,t){for(var r=new Array(t),n=0;n<t;n++)r[n]=e;return r},s.swapAttrs=function(e,t,r,n){r||(r="x"),n||(n="y");for(var a=0;a<t.length;a++){var i=t[a],o=s.nestedProperty(e,i.replace("?",r)),l=s.nestedProperty(e,i.replace("?",n)),c=o.get();o.set(l.get()),l.set(c)}},s.raiseToTop=function(e){e.parentNode.appendChild(e)},s.cancelTransition=function(e){return e.transition().duration(0)},s.constrain=function(e,t,r){return t>r?Math.max(r,Math.min(t,e)):Math.max(t,Math.min(r,e))},s.bBoxIntersect=function(e,t,r){return r=r||0,e.left<=t.right+r&&t.left<=e.right+r&&e.top<=t.bottom+r&&t.top<=e.bottom+r},s.simpleMap=function(e,t,r,n){for(var a=e.length,i=new Array(a),o=0;o<a;o++)i[o]=t(e[o],r,n);return i},s.randstr=function e(t,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 t&&t[c]||f!==1/0&&f>=Math.pow(2,r)?a>10?(s.warn("randstr failed uniqueness"),c):e(t,r,n,(a||0)+1):c},s.OptionControl=function(e,t){e||(e={}),t||(t="opt");var r={optionList:[],_newoption:function(n){n[t]=e,r[n.name]=n,r.optionList.push(n)}};return r["_"+t]=e,r},s.smooth=function(e,t){if((t=Math.round(t)||0)<2)return e;var r,n,a,i,o=e.length,l=2*o,s=2*t-1,c=new Array(s),u=new Array(o);for(r=0;r<s;r++)c[r]=(1-Math.cos(Math.PI*(r+1)/t))/(2*t);for(r=0;r<o;r++){for(i=0,n=0;n<s;n++)(a=r+n+1-t)<-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+=e[a]*c[n];u[r]=i}return u},s.syncOrAsync=function(e,t,r){var n;function a(){return s.syncOrAsync(e,t,r)}for(;e.length;)if((n=(0,e.splice(0,1)[0])(t))&&n.then)return n.then(a).then(void 0,s.promiseError);return r&&r(t)},s.stripTrailingSlash=function(e){return"/"===e.substr(-1)?e.substr(0,e.length-1):e},s.noneOrAll=function(e,t,r){if(e){var n,a=!1,i=!0;for(n=0;n<r.length;n++)null!=e[r[n]]?a=!0:i=!1;if(a&&!i)for(n=0;n<r.length;n++)e[r[n]]=t[r[n]]}},s.mergeArray=function(e,t,r,n){var a="function"==typeof n;if(s.isArrayOrTypedArray(e))for(var i=Math.min(e.length,t.length),o=0;o<i;o++){var l=e[o];t[o][r]=a?n(l):l}},s.mergeArrayCastPositive=function(e,t,r){return s.mergeArray(e,t,r,(function(e){var t=+e;return isFinite(t)&&t>0?t:0}))},s.fillArray=function(e,t,r,n){if(n=n||s.identity,s.isArrayOrTypedArray(e))for(var a=0;a<t.length;a++)t[a][r]=n(e[a])},s.castOption=function(e,t,r,n){n=n||s.identity;var a=s.nestedProperty(e,r).get();return s.isArrayOrTypedArray(a)?Array.isArray(t)&&s.isArrayOrTypedArray(a[t[0]])?n(a[t[0]][t[1]]):n(a[t]):a},s.extractOption=function(e,t,r,n){if(r in e)return e[r];var a=s.nestedProperty(t,n).get();return Array.isArray(a)?void 0:a},s.tagSelected=function(e,t,r){var n,a,i=t.selectedpoints,o=t._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<e.length&&(e[f].selected=1)}}},s.selIndices2selPoints=function(e){var t=e.selectedpoints,r=e._indexToPoints;if(r){for(var n=T(r),a=[],i=0;i<t.length;i++){var o=t[i];if(s.isIndex(o)){var l=n[o];s.isIndex(l)&&a.push(l)}}return a}return t},s.getTargetArray=function(e,t){var r=t.target;if("string"==typeof r&&r){var n=s.nestedProperty(e,r).get();return!!Array.isArray(n)&&n}return!!Array.isArray(r)&&r},s.minExtend=function(e,t){var r={};"object"!=typeof t&&(t={});var n,a,i,o=Object.keys(e);for(n=0;n<o.length;n++)i=e[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(e[a],t[a]):i);for(o=Object.keys(t),n=0;n<o.length;n++)"object"==typeof(i=t[a=o[n]])&&a in r&&"object"==typeof r[a]||(r[a]=i);return r},s.titleCase=function(e){return e.charAt(0).toUpperCase()+e.substr(1)},s.containsAny=function(e,t){for(var r=0;r<t.length;r++)if(-1!==e.indexOf(t[r]))return!0;return!1},s.isIE=function(){return void 0!==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(e){return e&&"function"==typeof e.classed},s.ensureSingle=function(e,t,r,n){var a=e.select(t+(r?"."+r:""));if(a.size())return a;var i=e.append(t);return r&&i.classed(r,!0),n&&i.call(n),i},s.ensureSingleById=function(e,t,r,n){var a=e.select(t+"#"+r);if(a.size())return a;var i=e.append(t).attr("id",r);return n&&i.call(n),i},s.objectFromPath=function(e,t){for(var r,n=e.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]=t:r[l]={},r=r[l]):(i===n.length-1?r[o]=t:r[o]={},r=r[o])}return a};var L=/^([^\[\.]+)\.(.+)?/,S=/^([^\.]+)\[([0-9]+)\](\.)?(.+)?/;s.expandObjectPaths=function(e){var t,r,n,a,i,o,l;if("object"==typeof e&&!Array.isArray(e))for(r in e)e.hasOwnProperty(r)&&((t=r.match(L))?(a=e[r],n=t[1],delete e[r],e[n]=s.extendDeepNoArrays(e[n]||{},s.objectFromPath(r,s.expandObjectPaths(a))[n])):(t=r.match(S))?(a=e[r],n=t[1],i=parseInt(t[2]),delete e[r],e[n]=e[n]||[],"."===t[3]?(l=t[4],o=e[n][i]=e[n][i]||{},s.extendDeepNoArrays(o,s.objectFromPath(l,s.expandObjectPaths(a)))):e[n][i]=s.expandObjectPaths(a)):e[r]=s.expandObjectPaths(e[r]));return e},s.numSeparate=function(e,t,r){if(r||(r=!1),"string"!=typeof t||0===t.length)throw new Error("Separator string required for formatting!");"number"==typeof e&&(e=String(e));var n=/(\d+)(\d{3})/,a=t.charAt(0),i=t.charAt(1),o=e.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(e,t){var r={};return e.replace(s.TEMPLATE_STRING_REGEX,(function(e,n){var a;return C.test(n)?a=t[n]:(r[n]=r[n]||s.nestedProperty(t,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(e,t,r){var a=this,i=arguments;t||(t={});var o={};return e.replace(s.TEMPLATE_STRING_REGEX,(function(e,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=e),a.count===a.max&&s.warn("Too many "+a.name+" warnings - additional warnings will be suppressed"),a.count++,e;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 t.hasOwnProperty(l+"Label")&&(f=t[l+"Label"]);return f}))}s.subplotSort=function(e,t){for(var r=Math.min(e.length,t.length)+1,n=0,a=0,i=0;i<r;i++){var o=e.charCodeAt(i)||0,l=t.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 E=2e9;s.seedPseudoRandom=function(){E=2e9},s.pseudoRandom=function(){var e=E;return E=(69069*E+1)%4294967296,Math.abs(E-e)<429496729?s.pseudoRandom():E/4294967296},s.fillText=function(e,t,r){var n=Array.isArray(r)?function(e){r.push(e)}:function(e){r.text=e},a=s.extractOption(e,t,"htx","hovertext");if(s.isValidTextValue(a))return n(a);var i=s.extractOption(e,t,"tx","text");return s.isValidTextValue(i)?n(i):void 0},s.isValidTextValue=function(e){return e||0===e},s.formatPercent=function(e,t){t=t||0;for(var r=(Math.round(100*e*Math.pow(10,t))*Math.pow(.1,t)).toFixed(t)+"%",n=0;n<t;n++)-1!==r.indexOf(".")&&(r=(r=r.replace("0%","%")).replace(".%","%"));return r},s.isHidden=function(e){var t=window.getComputedStyle(e).display;return!t||"none"===t},s.getTextTransform=function(e){var t=e.noCenter,r=e.textX,n=e.textY,a=e.targetX,i=e.targetY,o=e.anchorX||0,l=e.anchorY||0,s=e.rotate,c=e.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+(t?"":" "+r+" "+n)+")":"")},s.ensureUniformFontSize=function(e,t){var r=s.extendFlat({},t);return r.size=Math.max(t.size,e._fullLayout.uniformtext.minsize||0),r}},{"../constants/numerical":148,"./anchor_utils":153,"./angles":154,"./array":155,"./clean_number":156,"./clear_responsive":158,"./coerce":159,"./dates":160,"./dom":161,"./extend":163,"./filter_unique":164,"./filter_visible":165,"./geometry2d":166,"./identity":167,"./is_plain_object":169,"./keyed_container":170,"./localize":171,"./loggers":172,"./make_trace_groups":173,"./matrix":174,"./mod":175,"./nested_property":176,"./noop":177,"./notifier":178,"./push_unique":181,"./regex":183,"./relative_attr":184,"./relink_private":185,"./search":186,"./stats":188,"./throttle":190,"./to_log_range":191,d3:7,"fast-isnumeric":9}],169:[function(e,t,r){"use strict";t.exports=function(e){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(e):"[object Object]"===Object.prototype.toString.call(e)&&Object.getPrototypeOf(e)===Object.prototype}},{}],170:[function(e,t,r){"use strict";var n=e("./nested_property"),a=/^\w*$/;t.exports=function(e,t,r,i){var o,l,s;r=r||"name",i=i||"value";var c={};t&&t.length?(s=n(e,t),l=s.get()):l=e,t=t||"";var u={};if(l)for(o=0;o<l.length;o++)u[l[o][r]]=o;var f=a.test(i),d={set:function(e,t){var a=null===t?4:0;if(!l){if(!s||4===a)return;l=[],s.set(l)}var o=u[e];if(void 0===o){if(4===a)return;a|=3,o=l.length,u[e]=o}else t!==(f?l[o][i]:n(l[o],i).get())&&(a|=2);var p=l[o]=l[o]||{};return p[r]=e,f?p[i]=t:n(p,i).set(t),null!==t&&(a&=-5),c[o]=c[o]|a,d},get:function(e){if(l){var t=u[e];return void 0===t?void 0:f?l[t][i]:n(l[t],i).get()}},rename:function(e,t){var n=u[e];return void 0===n||(c[n]=1|c[n],u[t]=n,delete u[e],l[n][r]=t),d},remove:function(e){var t=u[e];if(void 0===t)return d;var a=l[t];if(Object.keys(a).length>2)return c[t]=2|c[t],d.set(e,null);if(f){for(o=t;o<l.length;o++)c[o]=3|c[o];for(o=t;o<l.length;o++)u[l[o][r]]--;l.splice(t,1),delete u[e]}else n(a,i).set(null),c[t]=6|c[t];return d},constructUpdate:function(){for(var e,a,o={},s=Object.keys(c),u=0;u<s.length;u++)a=s[u],e=t+"["+a+"]",l[a]?(1&c[a]&&(o[e+"."+r]=l[a][r]),2&c[a]&&(o[e+"."+i]=f?4&c[a]?null:l[a][i]:4&c[a]?null:n(l[a],i).get())):o[e]=null;return o}};return d}},{"./nested_property":176}],171:[function(e,t,r){"use strict";var n=e("../registry");t.exports=function(e,t){for(var r=e._context.locale,a=0;a<2;a++){for(var i=e._context.locales,o=0;o<2;o++){var l=(i[r]||{}).dictionary;if(l){var s=l[t];if(s)return s}i=n.localeRegistry}var c=r.split("-")[0];if(c===r)break;r=c}return t}},{"../registry":254}],172:[function(e,t,r){"use strict";var n=e("../plot_api/plot_config").dfltConfig,a=e("./notifier"),i=t.exports={};function o(e,t){if(e&&e.apply)try{return void e.apply(console,t)}catch(e){}for(var r=0;r<t.length;r++)try{e(t[r])}catch(e){console.log(t[r])}}i.log=function(){var e;if(n.logging>1){var t=["LOG:"];for(e=0;e<arguments.length;e++)t.push(arguments[e]);o(console.trace||console.log,t)}if(n.notifyOnLogging>1){var r=[];for(e=0;e<arguments.length;e++)r.push(arguments[e]);a(r.join("<br>"),"long")}},i.warn=function(){var e;if(n.logging>0){var t=["WARN:"];for(e=0;e<arguments.length;e++)t.push(arguments[e]);o(console.trace||console.log,t)}if(n.notifyOnLogging>0){var r=[];for(e=0;e<arguments.length;e++)r.push(arguments[e]);a(r.join("<br>"),"stick")}},i.error=function(){var e;if(n.logging>0){var t=["ERROR:"];for(e=0;e<arguments.length;e++)t.push(arguments[e]);o(console.error,t)}if(n.notifyOnLogging>0){var r=[];for(e=0;e<arguments.length;e++)r.push(arguments[e]);a(r.join("<br>"),"stick")}}},{"../plot_api/plot_config":200,"./notifier":178}],173:[function(e,t,r){"use strict";var n=e("d3");t.exports=function(e,t,r){var a=e.selectAll("g."+r.replace(/\s/g,".")).data(t,(function(e){return e[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=e.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(e){e[0][i]=n.select(this)})),a}},{d3:7}],174:[function(e,t,r){"use strict";r.init2dArray=function(e,t){for(var r=new Array(e),n=0;n<e;n++)r[n]=new Array(t);return r},r.transposeRagged=function(e){var t,r,n=0,a=e.length;for(t=0;t<a;t++)n=Math.max(n,e[t].length);var i=new Array(n);for(t=0;t<n;t++)for(i[t]=new Array(a),r=0;r<a;r++)i[t][r]=e[r][t];return i},r.dot=function(e,t){if(!e.length||!t.length||e.length!==t.length)return null;var n,a,i=e.length;if(e[0].length)for(n=new Array(i),a=0;a<i;a++)n[a]=r.dot(e[a],t);else if(t[0].length){var o=r.transposeRagged(t);for(n=new Array(o.length),a=0;a<o.length;a++)n[a]=r.dot(e,o[a])}else for(n=0,a=0;a<i;a++)n+=e[a]*t[a];return n},r.translationMatrix=function(e,t){return[[1,0,e],[0,1,t],[0,0,1]]},r.rotationMatrix=function(e){var t=e*Math.PI/180;return[[Math.cos(t),-Math.sin(t),0],[Math.sin(t),Math.cos(t),0],[0,0,1]]},r.rotationXYMatrix=function(e,t,n){return r.dot(r.dot(r.translationMatrix(t,n),r.rotationMatrix(e)),r.translationMatrix(-t,-n))},r.apply2DTransform=function(e){return function(){var t=arguments;3===t.length&&(t=t[0]);var n=1===arguments.length?t[0]:[t[0],t[1]];return r.dot(e,[n[0],n[1],1]).slice(0,2)}},r.apply2DTransform2=function(e){var t=r.apply2DTransform(e);return function(e){return t(e.slice(0,2)).concat(t(e.slice(2,4)))}}},{}],175:[function(e,t,r){"use strict";t.exports={mod:function(e,t){var r=e%t;return r<0?r+t:r},modHalf:function(e,t){return Math.abs(e)>t/2?e-Math.round(e/t)*t:e}}},{}],176:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./array").isArrayOrTypedArray;function i(e,t){return function(){var r,n,o,l,s,c=e;for(l=0;l<t.length-1;l++){if(-1===(r=t[l])){for(n=!0,o=[],s=0;s<c.length;s++)o[s]=i(c[s],t.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[t[l]]))return o}}t.exports=function(e,t){if(n(t))t=String(t);else if("string"!=typeof t||"[-1]"===t.substr(t.length-4))throw"bad property string";for(var r,a,o,l=0,c=t.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 e?function(e,t,r){return{set:function(){throw"bad container"},get:function(){},astr:t,parts:r,obj:e}}(e,t,c):{set:s(e,c,t),get:i(e,c),astr:t,parts:c,obj:e}};var o=/(^|\.)args\[/;function l(e,t){return void 0===e||null===e&&!t.match(o)}function s(e,t,r){return function(n){var i,o,s=e,d="",p=[[e,d]],h=l(n,r);for(o=0;o<t.length-1;o++){if("number"==typeof(i=t[o])&&!a(s))throw"array index but container is not an array";if(-1===i){if(h=!u(s,t.slice(o+1),n,r))break;return}if(!f(s,i,t[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===t.length-1&&(delete s[t[o]],Array.isArray(s)&&+t[o]==s.length-1))for(;s.length&&void 0===s[s.length-1];)s.pop()}else s[t[o]]=n}}function c(e,t){var r=t;return n(t)?r="["+t+"]":e&&(r="."+t),e+r}function u(e,t,r,n){var i,o=a(r),c=!0,u=r,d=n.replace("-1",0),p=!o&&l(r,d),h=t[0];for(i=0;i<e.length;i++)d=n.replace("-1",i),o&&(p=l(u=r[i%r.length],d)),p&&(c=!1),f(e,i,h,p)&&s(e[i],t,n.replace("-1",i))(u);return c}function f(e,t,r,n){if(void 0===e[t]){if(n)return!1;e[t]="number"==typeof r?[]:{}}return!0}},{"./array":155,"fast-isnumeric":9}],177:[function(e,t,r){"use strict";t.exports=function(){}},{}],178:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=[];t.exports=function(e,t){if(-1===i.indexOf(e)){i.push(e);var r=1e3;a(t)?r=t:"long"===t&&(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(e){var a=n.select(this);a.append("button").classed("notifier-close",!0).html("&times;").on("click",(function(){a.transition().call(l)}));for(var i=a.append("p"),o=e.split(/<br\s*\/?>/g),s=0;s<o.length;s++)s&&i.append("br"),i.append("span").text(o[s]);"stick"===t?a.transition().duration(350).style("opacity",1):a.transition().duration(700).style("opacity",1).transition().delay(r).call(l)}))}function l(e){e.duration(700).style("opacity",0).each("end",(function(e){var t=i.indexOf(e);-1!==t&&i.splice(t,1),n.select(this).remove()}))}}},{d3:7,"fast-isnumeric":9}],179:[function(e,t,r){"use strict";var n=e("./setcursor"),a="data-savedcursor";t.exports=function(e,t){var r=e.attr(a);if(t){if(!r){for(var i=(e.attr("class")||"").split(" "),o=0;o<i.length;o++){var l=i[o];0===l.indexOf("cursor-")&&e.attr(a,l.substr(7)).classed(l,!1)}e.attr(a)||e.attr(a,"!!")}n(e,t)}else r&&(e.attr(a,null),"!!"===r?n(e):n(e,r))}},{"./setcursor":187}],180:[function(e,t,r){"use strict";var n=e("./matrix").dot,a=e("../constants/numerical").BADNUM,i=t.exports={};i.tester=function(e){var t,r=e.slice(),n=r[0][0],i=n,o=r[0][1],l=o;for(r.push(r[0]),t=1;t<r.length;t++)n=Math.min(n,r[t][0]),i=Math.max(i,r[t][0]),o=Math.min(o,r[t][1]),l=Math.max(l,r[t][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(e){return e[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(e){return e[1]===r[0][1]}));var u=!0,f=r[0];for(t=1;t<r.length;t++)if(f[0]!==r[t][0]||f[1]!==r[t][1]){u=!1;break}return{xmin:n,xmax:i,ymin:o,ymax:l,pts:r,contains:c?function(e,t){var r=e[0],c=e[1];return!(r===a||r<n||r>i||c===a||c<o||c>l||t&&s(e))}:function(e,t){var s=e[0],c=e[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||!t;c<=h&&s!==p&&y++}return y%2==1},isRect:c,degenerate:u}},i.isSegmentBent=function(e,t,r,a){var i,o,l,s=e[t],c=[e[r][0]-s[0],e[r][1]-s[1]],u=n(c,c),f=Math.sqrt(u),d=[-c[1]/f,c[0]/f];for(i=t+1;i<r;i++)if(o=[e[i][0]-s[0],e[i][1]-s[1]],(l=n(o,c))<0||l>u||Math.abs(n(o,d))>a)return!0;return!1},i.filter=function(e,t){var r=[e[0]],n=0,a=0;function o(o){e.push(o);var l=r.length,s=n;r.splice(a+1);for(var c=s+1;c<e.length;c++)(c===e.length-1||i.isSegmentBent(e,s,c+1,t))&&(r.push(e[c]),r.length<l-2&&(n=c,a=r.length-1),s=c)}return e.length>1&&o(e.pop()),{addPt:o,raw:e,filtered:r}}},{"../constants/numerical":148,"./matrix":174}],181:[function(e,t,r){"use strict";t.exports=function(e,t){if(t instanceof RegExp){for(var r=t.toString(),n=0;n<e.length;n++)if(e[n]instanceof RegExp&&e[n].toString()===r)return e;e.push(t)}else!t&&0!==t||-1!==e.indexOf(t)||e.push(t);return e}},{}],182:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plot_api/plot_config").dfltConfig,i={add:function(e,t,r,n,i){var o,l;e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},l=e.undoQueue.index,e.autoplay?e.undoQueue.inSequence||(e.autoplay=!1):(!e.undoQueue.sequence||e.undoQueue.beginSequence?(o={undo:{calls:[],args:[]},redo:{calls:[],args:[]}},e.undoQueue.queue.splice(l,e.undoQueue.queue.length-l,o),e.undoQueue.index+=1):o=e.undoQueue.queue[l-1],e.undoQueue.beginSequence=!1,o&&(o.undo.calls.unshift(t),o.undo.args.unshift(r),o.redo.calls.push(n),o.redo.args.push(i)),e.undoQueue.queue.length>a.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--))},startSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},stopSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},undo:function(e){var t,r;if(e.framework&&e.framework.isPolar)e.framework.undo();else if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index<=0)){for(e.undoQueue.index--,t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r<t.undo.calls.length;r++)i.plotDo(e,t.undo.calls[r],t.undo.args[r]);e.undoQueue.inSequence=!1,e.autoplay=!1}},redo:function(e){var t,r;if(e.framework&&e.framework.isPolar)e.framework.redo();else if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index>=e.undoQueue.queue.length)){for(t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r<t.redo.calls.length;r++)i.plotDo(e,t.redo.calls[r],t.redo.args[r]);e.undoQueue.inSequence=!1,e.autoplay=!1,e.undoQueue.index++}},plotDo:function(e,t,r){e.autoplay=!0,r=function(e,t){for(var r,a=[],i=0;i<t.length;i++)r=t[i],a[i]=r===e?r:"object"==typeof r?Array.isArray(r)?n.extendDeep([],r):n.extendDeepAll({},r):r;return a}(e,r),t.apply(null,r)}};t.exports=i},{"../lib":168,"../plot_api/plot_config":200}],183:[function(e,t,r){"use strict";r.counter=function(e,t,r,n){var a=(t||"")+(r?"":"$"),i=!1===n?"":"^";return"xy"===e?new RegExp(i+"x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?"+a):new RegExp(i+e+"([2-9]|[1-9][0-9]+)?"+a)}},{}],184:[function(e,t,r){"use strict";var n=/^(.*)(\.[^\.\[\]]+|\[\d\])$/,a=/^[^\.\[\]]+$/;t.exports=function(e,t){for(;t;){var r=e.match(n);if(r)e=r[1];else{if(!e.match(a))throw new Error("bad relativeAttr call:"+[e,t]);e=""}if("^"!==t.charAt(0))break;t=t.slice(1)}return e&&"["!==t.charAt(0)?e+"."+t:e+t}},{}],185:[function(e,t,r){"use strict";var n=e("./array").isArrayOrTypedArray,a=e("./is_plain_object");t.exports=function e(t,r){for(var i in r){var o=r[i],l=t[i];if(l!==o)if("_"===i.charAt(0)||"function"==typeof o){if(i in t)continue;t[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])&&e(l[c],o[c])}else a(o)&&a(l)&&(e(l,o),Object.keys(l).length||delete t[i])}}},{"./array":155,"./is_plain_object":169}],186:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./loggers"),i=e("./identity");function o(e,t){return e<t}function l(e,t){return e<=t}function s(e,t){return e>t}function c(e,t){return e>=t}r.findBin=function(e,t,r){if(n(t.start))return r?Math.ceil((e-t.start)/t.size-1e-9)-1:Math.floor((e-t.start)/t.size+1e-9);var i,u,f=0,d=t.length,p=0,h=d>1?(t[d-1]-t[0])/(d-1):1;for(u=h>=0?r?o:l:r?c:s,e+=1e-9*h*(r?-1:1)*(h>=0?1:-1);f<d&&p++<100;)u(t[i=Math.floor((f+d)/2)],e)?f=i+1:d=i;return p>90&&a.log("Long binary search..."),f-1},r.sorterAsc=function(e,t){return e-t},r.sorterDes=function(e,t){return t-e},r.distinctVals=function(e){var t=e.slice();t.sort(r.sorterAsc);for(var n=t.length-1,a=t[n]-t[0]||1,i=a/(n||1)/1e4,o=[t[0]],l=0;l<n;l++)t[l+1]>t[l]+i&&(a=Math.min(a,t[l+1]-t[l]),o.push(t[l+1]));return{vals:o,minDiff:a}},r.roundUp=function(e,t,r){for(var n,a=0,i=t.length-1,o=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;a<i&&o++<100;)t[n=c((a+i)/2)]<=e?a=n+l:i=n-s;return t[a]},r.sort=function(e,t){for(var r=0,n=0,a=1;a<e.length;a++){var i=t(e[a],e[a-1]);if(i<0?r=1:i>0&&(n=1),r&&n)return e.sort(t)}return n?e:e.reverse()},r.findIndexOfMin=function(e,t){t=t||i;for(var r,n=1/0,a=0;a<e.length;a++){var o=t(e[a]);o<n&&(n=o,r=a)}return r}},{"./identity":167,"./loggers":172,"fast-isnumeric":9}],187:[function(e,t,r){"use strict";t.exports=function(e,t){(e.attr("class")||"").split(" ").forEach((function(t){0===t.indexOf("cursor-")&&e.classed(t,!1)})),t&&e.classed("cursor-"+t,!0)}},{}],188:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./array").isArrayOrTypedArray;r.aggNums=function(e,t,i,o){var l,s;if((!o||o>i.length)&&(o=i.length),n(t)||(t=!1),a(i[0])){for(s=new Array(o),l=0;l<o;l++)s[l]=r.aggNums(e,t,i[l]);i=s}for(l=0;l<o;l++)n(t)?n(i[l])&&(t=e(+t,+i[l])):t=i[l];return t},r.len=function(e){return r.aggNums((function(e){return e+1}),0,e)},r.mean=function(e,t){return t||(t=r.len(e)),r.aggNums((function(e,t){return e+t}),0,e)/t},r.midRange=function(e){if(void 0!==e&&0!==e.length)return(r.aggNums(Math.max,null,e)+r.aggNums(Math.min,null,e))/2},r.variance=function(e,t,a){return t||(t=r.len(e)),n(a)||(a=r.mean(e,t)),r.aggNums((function(e,t){return e+Math.pow(t-a,2)}),0,e)/t},r.stdev=function(e,t,n){return Math.sqrt(r.variance(e,t,n))},r.median=function(e){var t=e.slice().sort();return r.interp(t,.5)},r.interp=function(e,t){if(!n(t))throw"n should be a finite number";if((t=t*e.length-.5)<0)return e[0];if(t>e.length-1)return e[e.length-1];var r=t%1;return r*e[Math.ceil(t)]+(1-r)*e[Math.floor(t)]}},{"./array":155,"fast-isnumeric":9}],189:[function(e,t,r){"use strict";var n=e("d3"),a=e("../lib"),i=e("../constants/xmlns_namespaces"),o=e("../constants/alignment").LINE_SPACING;function l(e,t){return e.node().getBoundingClientRect()[t]}var s=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(e,t,M){var A=e.text(),S=!e.attr("data-notex")&&"undefined"!=typeof MathJax&&A.match(s),C=n.select(e.node().parentNode);if(!C.empty()){var O=e.attr("class")?e.attr("class").split(" ")[0]:"text";return O+="-math",C.selectAll("svg."+O).remove(),C.selectAll("g."+O+"-group").remove(),e.style("display",null).attr({"data-unformatted":A,"data-math":"N"}),S?(t&&t._promises||[]).push(new Promise((function(t){e.style("display","none");var r=parseInt(e.node().style.fontSize,10),i={fontSize:r};!function(e,t,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":t.fontSize+"px"}).text(e.replace(c,"\\lt ").replace(u,"\\gt ")),MathJax.Hub.Typeset(s.node())}),(function(){var t=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.",e),r();else{var o=s.select("svg").node().getBoundingClientRect();r(s.select(".MathJax_SVG"),t,o)}if(s.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==l&&(MathJax.Hub.processSectionDelay=l),MathJax.Hub.Config(o)}))}(S[2],i,(function(n,a,i){C.selectAll("svg."+O).remove(),C.selectAll("g."+O+"-group").remove();var o=n&&n.select("svg");if(!o||!o.node())return P(),void t();var s=C.append("g").classed(O+"-group",!0).attr({"pointer-events":"none","data-unformatted":A,"data-math":"Y"});s.node().appendChild(o.node()),a&&a.node()&&o.node().insertBefore(a.node().cloneNode(!0),o.node().firstChild),o.attr({class:O,height:i.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var c=e.node().style.fill||"black",u=o.select("g");u.attr({fill:c,stroke:c});var f=l(u,"width"),d=l(u,"height"),p=+e.attr("x")-f*{start:0,middle:.5,end:1}[e.attr("text-anchor")||"start"],h=-(r||l(e,"height"))/4;"y"===O[0]?(s.attr({transform:"rotate("+[-90,+e.attr("x"),+e.attr("y")]+") translate("+[-f/2,h-d/2]+")"}),o.attr({x:+e.attr("x"),y:+e.attr("y")})):"l"===O[0]?o.attr({x:e.attr("x"),y:h-d/2}):"a"===O[0]&&0!==O.indexOf("atitle")?o.attr({x:0,y:h}):o.attr({x:p,y:+e.attr("y")+h-d/2}),M&&M.call(e,s),t(s)}))}))):P(),e}function P(){C.empty()||(O=e.attr("class")+"-math",C.select("svg."+O).remove()),e.text("").style("white-space","pre"),function(e,t){t=t.replace(g," ");var r,l=!1,s=[],c=-1;function u(){c++;var t=document.createElementNS(i.svg,"tspan");n.select(t).attr({class:"line",dy:c*o+"em"}),e.appendChild(t),r=t;var a=s;if(s=[{node:t}],a.length>1)for(var l=1;l<a.length;l++)M(a[l])}function M(e){var t,a=e.type,o={};if("a"===a){t="a";var l=e.target,c=e.href,u=e.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 t="tspan";e.style&&(o.style=e.style);var f=document.createElementNS(i.svg,t);if("sup"===a||"sub"===a){A(r,"​"),r.appendChild(f);var h=document.createElementNS(i.svg,"tspan");A(h,"​"),n.select(h).attr("dy",p[a]),o.dy=d[a],r.appendChild(f),r.appendChild(h)}else r.appendChild(f);n.select(f).attr(o),r=e.node=f,s.push(e)}function A(e,t){e.appendChild(document.createTextNode(t))}function S(e){if(1!==s.length){var n=s.pop();e!==n.type&&a.log("Start tag <"+n.type+"> doesnt match end tag <"+e+">. Pretending it did match.",t),r=s[s.length-1].node}else a.log("Ignoring unexpected end tag </"+e+">.",t)}y.test(t)?u():(r=e,s=[{node:e}]);for(var C=t.split(v),O=0;O<C.length;O++){var P=C[O],D=P.match(m),z=D&&D[2].toLowerCase(),E=f[z];if("br"===z)u();else if(void 0===E)A(r,L(P));else if(D[1])S(z);else{var R=D[4],I={type:z},F=k(R,x);if(F?(F=F.replace(T,"$1 fill:"),E&&(F+=";"+E)):E&&(F=E),F&&(I.style=F),"a"===z){l=!0;var N=k(R,b);if(N){var H=document.createElement("a");H.href=N,-1!==h.indexOf(H.protocol)&&(I.href=encodeURI(decodeURI(N)),I.target=k(R,_)||"_blank",I.popup=k(R,w))}}M(I)}}return l}(e.node(),A)&&e.style("pointer-events","all"),r.positionText(e),M&&M.call(e)}};var c=/(<|&lt;|&#60;)/g,u=/(>|&gt;|&#62;)/g,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=["http:","https:","mailto:","",void 0,":"],g=r.NEWLINES=/(\r\n?|\n)/g,v=/(<[^<>]*>)/,m=/<(\/?)([^ >]*)(\s+(.*))?>/i,y=/<br(\s+.*)?>/i;r.BR_TAG_ALL=/<br(\s+.*)?>/gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,b=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,_=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,w=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function k(e,t){if(!e)return null;var r=e.match(t),n=r&&(r[3]||r[4]);return n&&L(n)}var T=/(^|;)\s*color:/;r.plainText=function(e,t){for(var r=void 0!==(t=t||{}).len&&-1!==t.len?t.len:1/0,n=void 0!==t.allowedTags?t.allowedTags:["br"],a="...".length,i=e.split(v),o=[],l="",s=0,c=0;c<i.length;c++){var u=i[c],f=u.match(m),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 M={mu:"μ",amp:"&",lt:"<",gt:">",nbsp:" ",times:"×",plusmn:"±",deg:"°"},A=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function L(e){return e.replace(A,(function(e,t){return("#"===t.charAt(0)?function(e){if(!(e>1114111)){var t=String.fromCodePoint;if(t)return t(e);var r=String.fromCharCode;return e<=65535?r(e):r(55232+(e>>10),e%1024+56320)}}("x"===t.charAt(1)?parseInt(t.substr(2),16):parseInt(t.substr(1),10)):M[t])||e}))}function S(e,t,r){var n,a,i,o=r.horizontalAlign,l=r.verticalAlign||"top",s=e.node().getBoundingClientRect(),c=t.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=L,r.sanitizeHTML=function(e){e=e.replace(g," ");for(var t=document.createElement("p"),r=t,a=[],i=e.split(v),o=0;o<i.length;o++){var l=i[o],s=l.match(m),c=s&&s[2].toLowerCase();if(c in f)if(s[1])a.length&&(r=a.pop());else{var u=s[4],d=k(u,x),p=d?{style:d}:{};if("a"===c){var y=k(u,b);if(y){var w=document.createElement("a");if(w.href=y,-1!==h.indexOf(w.protocol)){p.href=encodeURI(decodeURI(y));var T=k(u,_);T&&(p.target=T)}}}var M=document.createElement(c);r.appendChild(M),n.select(M).attr(p),r=M,a.push(M)}else r.appendChild(document.createTextNode(L(l)))}return t.innerHTML},r.lineCount=function(e){return e.selectAll("tspan.line").size()||1},r.positionText=function(e,t,r){return e.each((function(){var e=n.select(this);function a(t,r){return void 0===r?null===(r=e.attr(t))&&(e.attr(t,0),r=0):e.attr(t,r),r}var i=a("x",t),o=a("y",r);"text"===this.nodeName&&e.selectAll("tspan.line").attr({x:i,y:o})}))},r.makeEditable=function(e,t){var r=t.gd,a=t.delegate,i=n.dispatch("edit","input","cancel"),o=a||e;if(e.style({"pointer-events":a?"none":"all"}),1!==e.size())throw new Error("boo");function l(){!function(){var a=n.select(r).select(".svg-container"),o=a.append("div"),l=e.node().style,c=parseFloat(l.fontSize||12),u=t.text;void 0===u&&(u=e.attr("data-unformatted")),o.classed("plugin-editable editable",!0).style({position:"absolute","font-family":l.fontFamily||"Arial","font-size":c,color:t.fill||l.fill||"black",opacity:1,"background-color":t.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(S(e,a,t)).on("blur",(function(){r._editing=!1,e.text(this.textContent).style({opacity:1});var t,a=n.select(this).attr("class");(t=a?"."+a.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(e.node().parentNode).select(t).style({opacity:0});var o=this.textContent;n.select(this).transition().duration(0).remove(),n.select(document).on("mouseup",null),i.edit.call(e,o)})).on("focus",(function(){var e=this;r._editing=!0,n.select(document).on("mouseup",(function(){if(n.event.target===e)return!1;document.activeElement===o.node()&&o.node().blur()}))})).on("keyup",(function(){27===n.event.which?(r._editing=!1,e.style({opacity:1}),n.select(this).style({opacity:0}).on("blur",(function(){return!1})).transition().remove(),i.cancel.call(e,this.textContent)):(i.input.call(e,this.textContent),n.select(this).call(S(e,a,t)))})).on("keydown",(function(){13===n.event.which&&this.blur()})).call(s)}(),e.style({opacity:0});var a,l=o.attr("class");(a=l?"."+l.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(e.node().parentNode).select(a).style({opacity:0})}function s(e){var t=e.node(),r=document.createRange();r.selectNodeContents(t);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),t.focus()}return t.immediate?l():o.on("click",l),n.rebind(e,i,"on")}},{"../constants/alignment":145,"../constants/xmlns_namespaces":149,"../lib":168,d3:7}],190:[function(e,t,r){"use strict";var n={};function a(e){e&&null!==e.timer&&(clearTimeout(e.timer),e.timer=null)}r.throttle=function(e,t,r){var i=n[e],o=Date.now();if(!i){for(var l in n)n[l].ts<o-6e4&&delete n[l];i=n[e]={ts:0,timer:null}}function s(){r(),i.ts=Date.now(),i.onDone&&(i.onDone(),i.onDone=null)}a(i),o>i.ts+t?s():i.timer=setTimeout((function(){s(),i.timer=null}),t)},r.done=function(e){var t=n[e];return t&&t.timer?new Promise((function(e){var r=t.onDone;t.onDone=function(){r&&r(),e(),t.onDone=null}})):Promise.resolve()},r.clear=function(e){if(e)a(n[e]),delete n[e];else for(var t in n)r.clear(t)}},{}],191:[function(e,t,r){"use strict";var n=e("fast-isnumeric");t.exports=function(e,t){if(e>0)return Math.log(e)/Math.LN10;var r=Math.log(Math.min(t[0],t[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(t[0],t[1]))/Math.LN10-6),r}},{"fast-isnumeric":9}],192:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],193:[function(e,t,r){"use strict";t.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"}}},{}],194:[function(e,t,r){"use strict";var n=e("../registry");t.exports=function(e){for(var t,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=e.split("[")[0],l=0;l<i.length;l++)if((r=e.match(i[l]))&&0===r.index){t=r[0];break}if(t||(t=a[a.indexOf(o)]),!t)return!1;var s=e.substr(t.length);return s?!!(r=s.match(/^\[(0|[1-9][0-9]*)\](\.(.+))?$/))&&{array:t,index:Number(r[1]),property:r[3]||""}:{array:t,index:"",property:""}}},{"../registry":254}],195:[function(e,t,r){"use strict";var n=e("../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(e){for(var t={},r=0;r<e.length;r++)t[e[r]]=!1;return t}function f(e,t,r){var n=a({},e);for(var o in n){var l=n[o];i(l)&&(n[o]=d(l,t,0,o))}return"from-root"===r&&(n.editType=t),n}function d(e,t,r,n){if(e.valType){var i=a({},e);if(i.editType=t,Array.isArray(e.items)){i.items=new Array(e.items.length);for(var o=0;o<e.items.length;o++)i.items[o]=d(e.items[o],t)}return i}return f(e,t,"_"===n.charAt(0)?"nested":"from-root")}t.exports={traces:o,layout:l,traceFlags:function(){return u(s)},layoutFlags:function(){return u(c)},update:function(e,t){var r=t.editType;if(r&&"none"!==r)for(var n=r.split("+"),a=0;a<n.length;a++)e[n[a]]=!0},overrideAll:f}},{"../lib":168}],196:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("gl-mat4/fromQuat"),i=e("../registry"),o=e("../lib"),l=e("../plots/plots"),s=e("../plots/cartesian/axis_ids"),c=e("../components/color"),u=s.cleanId,f=s.getFromTrace,d=i.traceIs;function p(e,t){var r=e[t],n=t.charAt(0);r&&"paper"!==r&&(e[t]=u(r,n))}function h(e){function t(t,r){var n=e[t],a=e.title&&e.title[r];n&&!a&&(e.title||(e.title={}),e.title[r]=e[t],delete e[t])}e&&("string"!=typeof e.title&&"number"!=typeof e.title||(e.title={text:e.title}),t("titlefont","font"),t("titleposition","position"),t("titleside","side"),t("titleoffset","offset"))}function g(e){if(!o.isPlainObject(e))return!1;var t=e.name;return delete e.name,delete e.showlegend,("string"==typeof t||"number"==typeof t)&&String(t)}function v(e,t,r,n){if(r&&!n)return e;if(n&&!r)return t;if(!e.trim())return t;if(!t.trim())return e;var a,i=Math.min(e.length,t.length);for(a=0;a<i&&e.charAt(a)===t.charAt(a);a++);return e.substr(0,a).trim()}function m(e){var t="middle",r="center";return"string"==typeof e&&(-1!==e.indexOf("top")?t="top":-1!==e.indexOf("bottom")&&(t="bottom"),-1!==e.indexOf("left")?r="left":-1!==e.indexOf("right")&&(r="right")),t+" "+r}function y(e,t){return t in e&&"object"==typeof e[t]&&0===Object.keys(e[t]).length}r.clearPromiseQueue=function(e){Array.isArray(e._promises)&&e._promises.length>0&&o.log("Clearing previous rejected promises from queue."),e._promises=[]},r.cleanLayout=function(e){var t,n;e||(e={}),e.xaxis1&&(e.xaxis||(e.xaxis=e.xaxis1),delete e.xaxis1),e.yaxis1&&(e.yaxis||(e.yaxis=e.yaxis1),delete e.yaxis1),e.scene1&&(e.scene||(e.scene=e.scene1),delete e.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(e);for(t=0;t<g.length;t++){var v=g[t];if(i&&i.test(v)){var m=e[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(e[v].radialaxis);else if(f&&f.test(v)){var x=e[v];h(x.aaxis),h(x.baxis),h(x.caxis)}else if(d&&d.test(v)){var b=e[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(e.annotations)?e.annotations.length:0;for(t=0;t<L;t++){var S=e.annotations[t];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(e.shapes)?e.shapes.length:0;for(t=0;t<C;t++){var O=e.shapes[t];o.isPlainObject(O)&&(p(O,"xref"),p(O,"yref"))}var P=e.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(e),"rotate"===e.dragmode&&(e.dragmode="orbit"),c.clean(e),e.template&&e.template.layout&&r.cleanLayout(e.template.layout),e},r.cleanData=function(e){for(var t=0;t<e.length;t++){var n,a=e[t];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[t%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(e){var t;if(o.swapAttrs(e,["?","?0","d?","?bins","nbins?","autobin?","?src","error_?"]),Array.isArray(e.z)&&Array.isArray(e.z[0])&&(e.transpose?delete e.transpose:e.transpose=!0),e.error_x&&e.error_y){var r=e.error_y,n="copy_ystyle"in r?r.copy_ystyle:!(r.color||r.thickness||r.width);o.swapAttrs(e,["error_?.copy_ystyle"]),n&&o.swapAttrs(e,["error_?.color","error_?.thickness","error_?.width"])}if("string"==typeof e.hoverinfo){var a=e.hoverinfo.split("+");for(t=0;t<a.length;t++)"x"===a[t]?a[t]="y":"y"===a[t]&&(a[t]="x");e.hoverinfo=a.join("+")}},r.coerceTraceIndices=function(e,t){if(n(t))return[t];if(!Array.isArray(t)||!t.length)return e.data.map((function(e,t){return t}));if(Array.isArray(t)){for(var r=[],a=0;a<t.length;a++)o.isIndex(t[a],e.data.length)?r.push(t[a]):o.warn("trace index (",t[a],") is not a number or is out of bounds");return r}return t},r.manageArrayContainers=function(e,t,r){var a=e.obj,i=e.parts,l=i.length,s=i[l-1],c=n(s);if(c&&null===t){var u=i.slice(0,l-1).join(".");o.nestedProperty(a,u).get().splice(s,1)}else c&&void 0===e.get()?(void 0===e.get()&&(r[e.astr]=null),e.set(t)):e.set(t)};var x=/(\.[^\[\]\.]+|\[[^\[\]\.]+\])$/;function b(e){var t=e.search(x);if(t>0)return e.substr(0,t)}r.hasParent=function(e,t){for(var r=b(t);r;){if(r in e)return!0;r=b(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(e,t,r){for(var n=0;n<t.length;n++)for(var a=e._fullData[n],i=0;i<3;i++){var l=f(e,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(e.layout,u).set(null)}}}},{"../components/color":43,"../lib":168,"../plots/cartesian/axis_ids":215,"../plots/plots":246,"../registry":254,"fast-isnumeric":9,"gl-mat4/fromQuat":10}],197:[function(e,t,r){"use strict";var n=e("./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=e("./to_image"),r.validate=e("./validate"),r.downloadImage=e("../snapshot/download");var a=e("./template_api");r.makeTemplate=a.makeTemplate,r.validateTemplate=a.validateTemplate},{"../snapshot/download":256,"./plot_api":199,"./template_api":204,"./to_image":205,"./validate":206}],198:[function(e,t,r){"use strict";var n=e("../lib/is_plain_object"),a=e("../lib/noop"),i=e("../lib/loggers"),o=e("../lib/search").sorterAsc,l=e("../registry");r.containerArrayMatch=e("./container_array_match");var s=r.isAddVal=function(e){return"add"===e||n(e)},c=r.isRemoveVal=function(e){return null===e||"remove"===e};r.applyContainerArrayChanges=function(e,t,r,n,u){var f=t.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=e.layout,m=e._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))t.set(null);else{if(!Array.isArray(y))return i.warn("Unrecognized full array edit value",f,y),!0;t.set(y)}return!g&&(d(v,m),p(e),!0)}var x,b,_,w,k,T,M,A,L=Object.keys(r).map(Number).sort(o),S=t.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||t.set(C):t.set(null),g)return!1;if(d(v,m),h!==a){var E;if(-1===D)E=L;else{for(z=Math.max(C.length,z),E=[],x=0;x<L.length&&!((_=L[x])>=D);x++)E.push(_);for(x=D;x<z;x++)E.push(x)}for(x=0;x<E.length;x++)h(e,E[x])}else p(e);return!0}},{"../lib/is_plain_object":169,"../lib/loggers":172,"../lib/noop":177,"../lib/search":186,"../registry":254,"./container_array_match":194}],199:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("has-hover"),o=e("../lib"),l=o.nestedProperty,s=e("../lib/events"),c=e("../lib/queue"),u=e("../registry"),f=e("./plot_schema"),d=e("../plots/plots"),p=e("../plots/polar/legacy"),h=e("../plots/cartesian/axes"),g=e("../components/drawing"),v=e("../components/color"),m=e("../plots/cartesian/graph_interact").initInteractions,y=e("../constants/xmlns_namespaces"),x=e("../lib/svg_text_utils"),b=e("../plots/cartesian/select").clearSelect,_=e("./plot_config").dfltConfig,w=e("./manage_arrays"),k=e("./helpers"),T=e("./subroutines"),M=e("./edit_types"),A=e("../plots/cartesian/constants").AX_NAME_PATTERN,L=0;function S(e){var t=e._fullLayout;t._redrawFromAutoMarginCount?t._redrawFromAutoMarginCount--:e.emit("plotly_afterplot")}function C(e,t){try{e._fullLayout._paper.style("background",t)}catch(e){o.error(e)}}function O(e,t){C(e,v.combine(t,"white"))}function P(e,t){if(!e._context){e._context=o.extendDeep({},_);var r=n.select("base");e._context._baseUrl=r.size()&&r.attr("href")?window.location.href.split("#")[0]:""}var a,l,s,c=e._context;if(t){for(l=Object.keys(t),a=0;a<l.length;a++)"editable"!==(s=l[a])&&"edits"!==s&&s in c&&("setBackground"===s&&"opaque"===t[s]?c[s]=O:c[s]=t[s]);t.plot3dPixelRatio&&!c.plotGlPixelRatio&&(c.plotGlPixelRatio=c.plot3dPixelRatio);var u=t.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(t.edits)for(l=Object.keys(t.edits),a=0;a<l.length;a++)(s=l[a])in c.edits&&(c.edits[s]=t.edits[s]);c._exportedPlot=t._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=C),c._hasZeroHeight=c._hasZeroHeight||0===e.clientHeight,c._hasZeroWidth=c._hasZeroWidth||0===e.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 D(e,t){var r,n,a=t+1,i=[];for(r=0;r<e.length;r++)(n=e[r])<0?i.push(a+n):i.push(n);return i}function z(e,t,r){var n,a;for(n=0;n<t.length;n++){if((a=t[n])!==parseInt(a,10))throw new Error("all values in "+r+" must be integers");if(a>=e.data.length||a<-e.data.length)throw new Error(r+" must be valid indices for gd.data.");if(t.indexOf(a,n+1)>-1||a>=0&&t.indexOf(-e.data.length+a)>-1||a<0&&t.indexOf(e.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function E(e,t,r){if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("currentIndices is a required argument.");if(Array.isArray(t)||(t=[t]),z(e,t,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&z(e,r,"newIndices"),void 0!==r&&t.length!==r.length)throw new Error("current and new indices must be of equal length.")}function R(e,t,r,n,i){!function(e,t,r,n){var a=o.isPlainObject(n);if(!Array.isArray(e.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(t))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var i in z(e,r,"indices"),t){if(!Array.isArray(t[i])||t[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!==t[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")}}(e,t,r,n);for(var s=function(e,t,r,n){var i,s,c,u,f,d=o.isPlainObject(n),p=[];for(var h in Array.isArray(r)||(r=[r]),r=D(r,e.data.length-1),t)for(var g=0;g<r.length;g++){if(i=e.data[r[g]],s=(c=l(i,h)).get(),u=t[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}(e,t,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 I(e,t){var r=new e.constructor(e.length+t.length);return r.set(e),r.set(t,e.length),r}function F(e,t,n,a){e=o.getGraphDiv(e),k.clearPromiseQueue(e);var i={};if("string"==typeof t)i[t]=n;else{if(!o.isPlainObject(t))return o.warn("Restyle fail.",t,n,a),Promise.reject();i=o.extendFlat({},t),void 0===a&&(a=n)}Object.keys(i).length&&(e.changed=!0);var l=k.coerceTraceIndices(e,a),s=j(e,i,l),u=s.flags;u.calc&&(e.calcdata=void 0),u.clearAxisTypes&&k.clearAxisTypes(e,l,{});var f=[];u.fullReplot?f.push(r.plot):(f.push(d.previousPromises),d.supplyDefaults(e),u.markerSize&&(d.doCalcdata(e),G(f)),u.style&&f.push(T.doTraceStyle),u.colorbars&&f.push(T.doColorBars),f.push(S)),f.push(d.rehover,d.redrag),c.add(e,F,[e,s.undoit,s.traces],F,[e,s.redoit,s.traces]);var p=o.syncOrAsync(f,e);return p&&p.then||(p=Promise.resolve()),p.then((function(){return e.emit("plotly_restyle",s.eventData),e}))}function N(e){return void 0===e?null:e}function H(e,t){return t?function(t,r,n){var a=l(t,r),i=a.set;return a.set=function(t){B((n||"")+r,a.get(),t,e),i(t)},a}:l}function B(e,t,r,n){if(Array.isArray(t)||Array.isArray(r))for(var a=Array.isArray(t)?t:[],i=Array.isArray(r)?r:[],l=Math.max(a.length,i.length),s=0;s<l;s++)B(e+"["+s+"]",a[s],i[s],n);else if(o.isPlainObject(t)||o.isPlainObject(r)){var c=o.isPlainObject(t)?t:{},u=o.isPlainObject(r)?r:{},f=o.extendFlat({},c,u);for(var d in f)B(e+"."+d,c[d],u[d],n)}else void 0===n[e]&&(n[e]=N(t))}function j(e,t,r){var n,a=e._fullLayout,i=e._fullData,s=e.data,c=a._guiEditing,p=H(a._preGUI,c),g=o.extendDeepAll({},t);V(t);var v,m=M.traceFlags(),y={},x={};function b(){return r.map((function(){}))}function _(e){var t=h.id2name(e);-1===v.indexOf(t)&&v.push(t)}function w(e){return"LAYOUT"+e+".autorange"}function T(e){return"LAYOUT"+e+".range"}function A(e){for(var t=e;t<i.length;t++)if(i[t]._input===s[e])return i[t]}function L(n,i,o){if(Array.isArray(n))n.forEach((function(e){L(e,i,o)}));else if(!(n in t)&&!k.hasParent(t,n)){var l;if("LAYOUT"===n.substr(0,6))l=p(e.layout,n.replace("LAYOUT",""));else{var u=r[o];l=H(a._tracePreGUI[A(u)._fullInput.uid],c)(s[u],n)}n in x||(x[n]=b()),void 0===x[n][o]&&(x[n][o]=N(l.get())),void 0!==i&&l.set(i)}}function S(e){return function(t){return i[t][e]}}function C(e){return function(t,n){return!1===t?i[r[n]][e]:null}}for(var O in t){if(k.hasParent(t,O))throw new Error("cannot set "+O+" and a parent attribute simultaneously");var P,D,z,E,R,I,F=t[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]),E=(z=H(a._tracePreGUI[D._fullInput.uid],c)(P,O)).get(),void 0!==(R=Array.isArray(F)?F[n%F.length]:F)){var B=z.parts[z.parts.length-1],j=O.substr(0,O.length-B.length-1),q=j?j+".":"",U=j?l(D,j).get():D;if((I=f.getTraceValObject(D,z.parts))&&I.impliedEdits&&null!==R)for(var G in I.impliedEdits)L(o.relativeAttr(O,G),I.impliedEdits[G],n);else if("thicknessmode"!==B&&"lenmode"!==B||E===R||"fraction"!==R&&"pixels"!==R||!U){if("type"===O&&("pie"===R!=("pie"===E)||"funnelarea"===R!=("funnelarea"===E))){var Z="x",X="y";"bar"!==R&&"bar"!==E||"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"===E||"funnelarea"===E?(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,J="top"===W||"bottom"===W;if("thicknessmode"===B){var $=J?Y.h:Y.w;L(q+"thickness",U.thickness*("fraction"===R?1/$:$),n)}else{var Q=J?Y.w:Y.h;L(q+"len",U.len*("fraction"===R?1/Q:Q),n)}}if(x[O][n]=N(E),-1!==["swapxy","swapxyaxes","orientation","orientationaxes"].indexOf(O)){if("orientation"===O){z.set(R);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,R,x),m.calc=!0):(I?I.arrayOk&&!u.traceIs(D,"regl")&&(o.isArrayOrTypedArray(R)||o.isArrayOrTypedArray(E))?m.calc=!0:M.update(m,I):m.calc=!0,z.set(R))}if(-1!==["swapxyaxes","orientationaxes"].indexOf(O)&&h.swap(e,r),"orientationaxes"===O){var ee=l(e.layout,"hovermode");"x"===ee.get()?ee.set("y"):"y"===ee.get()?ee.set("x"):"x unified"===ee.get()?ee.set("y unified"):"y unified"===ee.get()&&ee.set("x unified")}if(-1!==["orientation","type"].indexOf(O)){for(v=[],n=0;n<r.length;n++){var te=s[r[n]];u.traceIs(te,"cartesian")&&(_(te.xaxis||"x"),_(te.yaxis||"y"))}L(v.map(w),!0,0),L(v.map(T),[0,1],0)}}else z=p(e.layout,O.replace("LAYOUT","")),x[O]=[N(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 V(e){var t,r,n,a=o.counterRegex("axis",".title",!1,!1),i=/colorbar\.title$/,l=Object.keys(e);for(t=0;t<l.length;t++)r=l[t],n=e[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(t,r){e[r]=e[t],delete e[t]}}function q(e,t,r){if(e=o.getGraphDiv(e),k.clearPromiseQueue(e),e.framework&&e.framework.isPolar)return Promise.resolve(e);var n={};if("string"==typeof t)n[t]=r;else{if(!o.isPlainObject(t))return o.warn("Relayout fail.",t,r),Promise.reject();n=o.extendFlat({},t)}Object.keys(n).length&&(e.changed=!0);var a=W(e,n),i=a.flags;i.calc&&(e.calcdata=void 0);var l=[d.previousPromises];i.layoutReplot?l.push(T.layoutReplot):Object.keys(n).length&&(U(e,i,a)||d.supplyDefaults(e),i.legend&&l.push(T.doLegend),i.layoutstyle&&l.push(T.layoutStyles),i.axrange&&G(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(S)),l.push(d.rehover,d.redrag),c.add(e,q,[e,a.undoit],q,[e,a.redoit]);var s=o.syncOrAsync(l,e);return s&&s.then||(s=Promise.resolve(e)),s.then((function(){return e.emit("plotly_relayout",a.eventData),e}))}function U(e,t,r){var n=e._fullLayout;if(!t.axrange)return!1;for(var a in t)if("axrange"!==a&&t[a])return!1;for(var i in r.rangesAltered){var o=h.id2name(i),l=e.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 G(e,t){var r=t?function(e){var r=[],n=!0;for(var a in t){var i=h.getFromId(e,a);if(r.push(a),i._matchGroup)for(var o in i._matchGroup)t[o]||r.push(o);i.automargin&&(n=!1)}return h.draw(e,r,{skipTitle:n})}:function(e){return h.draw(e,"redraw")};e.push(b,T.doAutoRangeAndConstraints,r,T.drawData,T.finalDraw)}var Z=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,X=/^[xyz]axis[0-9]*\.autorange$/,Y=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function W(e,t){var r,n,a,i=e.layout,s=e._fullLayout,c=s._guiEditing,d=H(s._preGUI,c),p=Object.keys(t),g=h.list(e),v=o.extendDeepAll({},t),m={};for(V(t),p=Object.keys(t),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);t[b]||(t[b]=t[p[n]])}delete t[p[n]]}var _=M.layoutFlags(),T={},L={};function S(e,r){if(Array.isArray(e))e.forEach((function(e){S(e,r)}));else if(!(e in t)&&!k.hasParent(t,e)){var n=d(i,e);e in L||(L[e]=N(n.get())),void 0!==r&&n.set(r)}}var C,O={};function P(e){var t=h.name2id(e.split(".")[0]);return O[t]=1,t}for(var D in t){if(k.hasParent(t,D))throw new Error("cannot set "+D+" and a parent attribute simultaneously");for(var z=d(i,D),E=t[D],R=z.parts.length-1;R>0&&"string"!=typeof z.parts[R];)R--;var I=z.parts[R],F=z.parts[R-1]+"."+I,B=z.parts.slice(0,R).join("."),j=l(e.layout,B).get(),q=l(s,B).get(),U=z.get();if(void 0!==E){T[D]=E,L[D]="reverse"===I?E:N(U);var G=f.getLayoutValObject(s,z.parts);if(G&&G.impliedEdits&&null!==E)for(var W in G.impliedEdits)S(o.relativeAttr(D,W),G.impliedEdits[W]);if(-1!==["width","height"].indexOf(D))if(E){S("autosize",null);var $="height"===D?"width":"height";S($,s[$])}else s[D]=e._initialAutoSize[D];else if("autosize"===D)S("width",E?null:s.width),S("height",E?null:s.height);else if(F.match(Z))P(F),l(s,B+"._inputRange").set(null);else if(F.match(X)){P(F),l(s,B+"._inputRange").set(null);var Q=l(s,B).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else F.match(Y)&&l(s,B+"._inputDomain").set(null);if("type"===I){var K=j,ee="linear"===q.type&&"log"===E,te="log"===q.type&&"linear"===E;if(ee||te){if(K&&K.range)if(q.autorange)ee&&(K.range=K.range[1]>K.range[0]?[1,2]:[2,1]);else{var re=K.range[0],ne=K.range[1];ee?(re<=0&&ne<=0&&S(B+".autorange",!0),re<=0?re=ne/1e6:ne<=0&&(ne=re/1e6),S(B+".range[0]",Math.log(re)/Math.LN10),S(B+".range[1]",Math.log(ne)/Math.LN10)):(S(B+".range[0]",Math.pow(10,re)),S(B+".range[1]",Math.pow(10,ne)))}else S(B+".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")(e,q,E,S),u.getComponentMethod("images","convertCoords")(e,q,E,S)}else S(B+".autorange",!0),S(B+".range",null);l(s,B+"._inputRange").set(null)}else if(I.match(A)){var ae=l(s,D).get(),ie=(E||{}).type;ie&&"-"!==ie||(ie="linear"),u.getComponentMethod("annotations","convertCoords")(e,ae,ie,S),u.getComponentMethod("images","convertCoords")(e,ae,ie,S)}var oe=w.containerArrayMatch(D);if(oe){r=oe.array,n=oe.index;var le=oe.property,se=G||{editType:"calc"};""!==n&&""===le&&(w.isAddVal(E)?L[D]=null:w.isRemoveVal(E)?L[D]=(l(i,r).get()||[])[n]:o.warn("unrecognized full object value",t)),M.update(_,se),m[r]||(m[r]={});var ce=m[r][n];ce||(ce=m[r][n]={}),ce[le]=E,delete t[D]}else"reverse"===I?(j.range?j.range.reverse():(S(B+".autorange",!0),j.range=[1,0]),q.autorange?_.calc=!0:_.plot=!0):(s._has("scatter-like")&&s._has("regl")&&"dragmode"===D&&("lasso"===E||"select"===E)&&"lasso"!==U&&"select"!==U||s._has("gl2d")?_.plot=!0:G?M.update(_,G):_.calc=!0,z.set(E))}}for(r in m)w.applyContainerArrayChanges(e,d(i,r),m[r],_,d)||(_.plot=!0);var ue=s._axisConstraintGroups||[];for(C in O)for(n=0;n<ue.length;n++){var fe=ue[n];if(fe[C])for(var de in _.calc=!0,fe)O[de]||(h.getFromId(e,de)._constraintShrinkable=!0)}return(J(e)||t.height||t.width)&&(_.plot=!0),(_.plot||_.calc)&&(_.layoutReplot=!0),{flags:_,rangesAltered:O,undoit:L,redoit:T,eventData:v}}function J(e){var t=e._fullLayout,r=t.width,n=t.height;return e.layout.autosize&&d.plotAutoSize(e,e.layout,t),t.width!==r||t.height!==n}function $(e,t,n,a){if(e=o.getGraphDiv(e),k.clearPromiseQueue(e),e.framework&&e.framework.isPolar)return Promise.resolve(e);o.isPlainObject(t)||(t={}),o.isPlainObject(n)||(n={}),Object.keys(t).length&&(e.changed=!0),Object.keys(n).length&&(e.changed=!0);var i=k.coerceTraceIndices(e,a),l=j(e,o.extendFlat({},t),i),s=l.flags,u=W(e,o.extendFlat({},n)),f=u.flags;(s.calc||f.calc)&&(e.calcdata=void 0),s.clearAxisTypes&&k.clearAxisTypes(e,i,n);var p=[];f.layoutReplot?p.push(T.layoutReplot):s.fullReplot?p.push(r.plot):(p.push(d.previousPromises),U(e,f,u)||d.supplyDefaults(e),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&&G(p,u.rangesAltered),f.ticks&&p.push(T.doTicksRelayout),f.modebar&&p.push(T.doModeBar),f.camera&&p.push(T.doCamera),p.push(S)),p.push(d.rehover,d.redrag),c.add(e,$,[e,l.undoit,u.undoit,l.traces],$,[e,l.redoit,u.redoit,l.traces]);var h=o.syncOrAsync(p,e);return h&&h.then||(h=Promise.resolve(e)),h.then((function(){return e.emit("plotly_update",{data:l.eventData,layout:u.eventData}),e}))}function Q(e){return function(t){t._fullLayout._guiEditing=!0;var r=e.apply(null,arguments);return t._fullLayout._guiEditing=!1,r}}var K=[{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"}],ee=[{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 te(e,t){for(var r=0;r<t.length;r++){var n=t[r],a=e.match(n.pattern);if(a)return{head:a[1],attr:n.attr}}}function re(e,t){var r=l(t,e).get();if(void 0!==r)return r;var n=e.split(".");for(n.pop();n.length>1;)if(n.pop(),void 0!==(r=l(t,n.join(".")+".uirevision").get()))return r;return t.uirevision}function ne(e,t){for(var r=0;r<t.length;r++)if(t[r]._fullInput.uid===e)return r;return-1}function ae(e,t,r){for(var n=0;n<t.length;n++)if(t[n].uid===e)return n;return!t[r]||t[r].uid?-1:r}function ie(e,t){var r=o.isPlainObject(e),n=Array.isArray(e);return r||n?(r&&o.isPlainObject(t)||n&&Array.isArray(t))&&JSON.stringify(e)===JSON.stringify(t):e===t}function oe(e,t,r,n){var a,i,s,c=n.getValObject,u=n.flags,f=n.immutable,d=n.inArray,p=n.arrayIndex;function h(){var e=a.editType;d&&-1!==e.indexOf("arraydraw")?o.pushUnique(u.arrays[d],p):(M.update(u,a),"none"!==e&&u.nChanges++,n.transition&&a.anim&&u.nChangesAnim++,(Z.test(s)||X.test(s))&&(u.rangesAltered[r[0]]=1),Y.test(s)&&l(t,"_inputDomain").set(null),"datarevision"===i&&(u.newDataRevision=1))}function g(e){return"data_array"===e.valType||e.arrayOk}for(i in e){if(u.calc&&!n.transition)return;var v=e[i],m=t[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=t.tickmode;if("auto"===x||"array"===x||!x)continue}if(("range"!==i||!t.autorange)&&("zmin"!==i&&"zmax"!==i||"contourcarpet"!==t.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=e[A],S=t[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++)oe(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)?oe(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 t)if(!(i in e)&&"_"!==i.charAt(0)&&"function"!=typeof t[i]){if(g(a=c(r.concat(i)))&&Array.isArray(t[i]))return void(u.calc=!0);h()}}function le(e){var t=n.select(e),r=e._fullLayout;if(r._container=t.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"),e.emit("plotly_framework")}r.animate=function(e,t,r){if(e=o.getGraphDiv(e),!o.isPlotDiv(e))throw new Error("This element is not a Plotly plot: "+e+". It's likely that you've failed to create a plot before animating it. For more details, see https://plotly.com/javascript/animations/");var n=e._transitionData;n._frameQueue||(n._frameQueue=[]);var a=(r=d.supplyAnimationDefaults(r)).transition,i=r.frame;function l(e){return Array.isArray(a)?e>=a.length?a[0]:a[e]:a}function s(e){return Array.isArray(i)?e>=i.length?i[0]:i[e]:i}function c(e,t){var r=0;return function(){if(e&&++r===t)return e()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,u){var f,p,h=0;function g(e){return Array.isArray(a)?h>=a.length?e.transitionOpts=a[h]:e.transitionOpts=a[0]:e.transitionOpts=a,h++,e}var v=[],m=null==t,y=Array.isArray(t);if(m||y||!o.isPlainObject(t)){if(m||-1!==["string","number"].indexOf(typeof t))for(f=0;f<n._frames.length;f++)(p=n._frames[f])&&(m||String(p.group)===String(t))&&v.push({type:"byname",name:String(p.name),data:g({name:p.name})});else if(y)for(f=0;f<t.length;f++){var x=t[f];-1!==["number","string"].indexOf(typeof x)?(x=String(x),v.push({type:"byname",name:x,data:g({name:x})})):o.isPlainObject(x)&&v.push({type:"object",data:g(o.extendFlat({},x))})}}else v.push({type:"object",data:g(o.extendFlat({},t))});for(f=0;f<v.length;f++)if("byname"===(p=v[f]).type&&!n._frameHash[p.data.name])return o.warn('animate failure: frame not found: "'+p.data.name+'"'),void u();-1!==["next","immediate"].indexOf(r.mode)&&function(){if(0!==n._frameQueue.length){for(;n._frameQueue.length;){var t=n._frameQueue.pop();t.onInterrupt&&t.onInterrupt()}e.emit("plotly_animationinterrupted",[])}}(),"reverse"===r.direction&&v.reverse();var b=e._fullLayout._currentFrame;if(b&&r.fromcurrent){var _=-1;for(f=0;f<v.length;f++)if("byname"===(p=v[f]).type&&p.name===b){_=f;break}if(_>0&&_<v.length-1){var w=[];for(f=0;f<v.length;f++)p=v[f],("byname"!==v[f].type||f>_)&&w.push(p);v=w}}v.length>0?function(t){if(0!==t.length){for(var a=0;a<t.length;a++){var o;o="byname"===t[a].type?d.computeFrame(e,t[a].name):t[a].data;var f=s(a),p=l(a);p.duration=Math.min(p.duration,f.duration);var h={frame:o,name:t[a].name,frameOpts:f,transitionOpts:p};a===t.length-1&&(h.onComplete=c(i,2),h.onInterrupt=u),n._frameQueue.push(h)}"immediate"===r.mode&&(n._lastFrameAt=-1/0),n._animationRaf||function(){e.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var t=function(){n._animationRaf=window.requestAnimationFrame(t),Date.now()-n._lastFrameAt>n._timeToNext&&function(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var t=n._currentFrame=n._frameQueue.shift();if(t){var r=t.name?t.name.toString():null;e._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=t.frameOpts.duration,d.transition(e,t.frame.data,t.frame.layout,k.coerceTraceIndices(e,t.frame.traces),t.frameOpts,t.transitionOpts).then((function(){t.onComplete&&t.onComplete()})),e.emit("plotly_animatingframe",{name:r,frame:t.frame,animation:{frame:t.frameOpts,transition:t.transitionOpts}})}else e.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}()};t()}()}}(v):(e.emit("plotly_animated"),i())}))},r.addFrames=function(e,t,r){if(e=o.getGraphDiv(e),null==t)return Promise.resolve();if(!o.isPlotDiv(e))throw new Error("This element is not a Plotly plot: "+e+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var n,a,i,l,s=e._transitionData._frames,u=e._transitionData._frameHash;if(!Array.isArray(t))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+t);var f=s.length+2*t.length,p=[],h={};for(n=t.length-1;n>=0;n--)if(o.isPlainObject(t[n])){var g=t[n].name,v=(u[g]||h[g]||{}).name,m=t[n].name,y=u[v]||h[v];v&&m&&"number"==typeof m&&y&&L<5&&(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.'),5===L&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),h[g]={name:g},p.push({frame:d.supplyFrameDefaults(t[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}p.sort((function(e,t){return e.index>t.index?-1:e.index<t.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 "+e._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=[e,b],M=[e,x];return c&&c.add(e,w,T,k,M),d.modifyFrames(e,x)},r.deleteFrames=function(e,t){if(e=o.getGraphDiv(e),!o.isPlotDiv(e))throw new Error("This element is not a Plotly plot: "+e);var r,n,a=e._transitionData._frames,i=[],l=[];if(!t)for(t=[],r=0;r<a.length;r++)t.push(r);for((t=t.slice()).sort(),r=t.length-1;r>=0;r--)n=t[r],i.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var s=d.modifyFrames,u=d.modifyFrames,f=[e,l],p=[e,i];return c&&c.add(e,s,f,u,p),d.modifyFrames(e,i)},r.addTraces=function e(t,n,a){t=o.getGraphDiv(t);var i,l,s=[],u=r.deleteTraces,f=e,d=[t,s],p=[t,n];for(function(e,t,r){var n,a;if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("traces must be defined.");for(Array.isArray(t)||(t=[t]),n=0;n<t.length;n++)if("object"!=typeof(a=t[n])||Array.isArray(a)||null===a)throw new Error("all values in traces array must be non-array objects");if(void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&r.length!==t.length)throw new Error("if indices is specified, traces.length must equal indices.length")}(t,n,a),Array.isArray(n)||(n=[n]),n=n.map((function(e){return o.extendFlat({},e)})),k.cleanData(n),i=0;i<n.length;i++)t.data.push(n[i]);for(i=0;i<n.length;i++)s.push(-n.length+i);if(void 0===a)return l=r.redraw(t),c.add(t,u,d,f,p),l;Array.isArray(a)||(a=[a]);try{E(t,s,a)}catch(e){throw t.data.splice(t.data.length-n.length,n.length),e}return c.startSequence(t),c.add(t,u,d,f,p),l=r.moveTraces(t,s,a),c.stopSequence(t),l},r.deleteTraces=function e(t,n){t=o.getGraphDiv(t);var a,i,l=[],s=r.addTraces,u=e,f=[t,l,n],d=[t,n];if(void 0===n)throw new Error("indices must be an integer or array of integers.");for(Array.isArray(n)||(n=[n]),z(t,n,"indices"),(n=D(n,t.data.length-1)).sort(o.sorterDes),a=0;a<n.length;a+=1)i=t.data.splice(n[a],1)[0],l.push(i);var p=r.redraw(t);return c.add(t,s,f,u,d),p},r.extendTraces=function e(t,n,a,i){var l=R(t=o.getGraphDiv(t),n,a,i,(function(e,t,r){var n,a;if(o.isTypedArray(e))if(r<0){var i=new e.constructor(0),l=I(e,t);r<0?(n=l,a=i):(n=i,a=l)}else if(n=new e.constructor(r),a=new e.constructor(e.length+t.length-r),r===t.length)n.set(t),a.set(e);else if(r<t.length){var s=t.length-r;n.set(t.subarray(s)),a.set(e),a.set(t.subarray(0,s),e.length)}else{var c=r-t.length,u=e.length-c;n.set(e.subarray(u)),n.set(t,c),a.set(e.subarray(0,u))}else n=e.concat(t),a=r>=0&&r<n.length?n.splice(0,n.length-r):[];return[n,a]})),s=r.redraw(t),u=[t,l.update,a,l.maxPoints];return c.add(t,r.prependTraces,u,e,arguments),s},r.moveTraces=function e(t,n,a){var i,l=[],s=[],u=e,f=e,d=[t=o.getGraphDiv(t),a,n],p=[t,n,a];if(E(t,n,a),n=Array.isArray(n)?n:[n],void 0===a)for(a=[],i=0;i<n.length;i++)a.push(-n.length+i);for(a=Array.isArray(a)?a:[a],n=D(n,t.data.length-1),a=D(a,t.data.length-1),i=0;i<t.data.length;i++)-1===n.indexOf(i)&&l.push(t.data[i]);for(i=0;i<n.length;i++)s.push({newIndex:a[i],trace:t.data[n[i]]});for(s.sort((function(e,t){return e.newIndex-t.newIndex})),i=0;i<s.length;i+=1)l.splice(s[i].newIndex,0,s[i].trace);t.data=l;var h=r.redraw(t);return c.add(t,u,d,f,p),h},r.prependTraces=function e(t,n,a,i){var l=R(t=o.getGraphDiv(t),n,a,i,(function(e,t,r){var n,a;if(o.isTypedArray(e))if(r<=0){var i=new e.constructor(0),l=I(t,e);r<0?(n=l,a=i):(n=i,a=l)}else if(n=new e.constructor(r),a=new e.constructor(e.length+t.length-r),r===t.length)n.set(t),a.set(e);else if(r<t.length){var s=t.length-r;n.set(t.subarray(0,s)),a.set(t.subarray(s)),a.set(e,s)}else{var c=r-t.length;n.set(t),n.set(e.subarray(0,c),t.length),a.set(e.subarray(c))}else n=t.concat(e),a=r>=0&&r<n.length?n.splice(r,n.length):[];return[n,a]})),s=r.redraw(t),u=[t,l.update,a,l.maxPoints];return c.add(t,r.extendTraces,u,e,arguments),s},r.newPlot=function(e,t,n,a){return e=o.getGraphDiv(e),d.cleanPlot([],{},e._fullData||[],e._fullLayout||{}),d.purge(e),r.plot(e,t,n,a)},r.plot=function(e,t,a,i){var l;if(e=o.getGraphDiv(e),s.init(e),o.isPlainObject(t)){var c=t;t=c.data,a=c.layout,i=c.config,l=c.frames}if(!1===s.triggerHandler(e,"plotly_beforeplot",[t,a,i]))return Promise.reject();t||a||o.isPlotDiv(e)||o.warn("Calling Plotly.plot as if redrawing but this container doesn't yet have a plot.",e),P(e,i),a||(a={}),n.select(e).classed("js-plotly-plot",!0),g.makeTester(),Array.isArray(e._promises)||(e._promises=[]);var f=0===(e.data||[]).length&&Array.isArray(t);Array.isArray(t)&&(k.cleanData(t),f?e.data=t:e.data.push.apply(e.data,t),e.empty=!1),e.layout&&!f||(e.layout=k.cleanLayout(a)),d.supplyDefaults(e);var v=e._fullLayout,y=v._has("cartesian");if(!v._has("polar")&&t&&t[0]&&t[0].r)return o.log("Legacy polar charts are deprecated!"),function(e,t,r){var a=n.select(e).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(""),t&&(e.data=t),r&&(e.layout=r),p.manager.fillLayout(e),i.style({width:e._fullLayout.width+"px",height:e._fullLayout.height+"px"}),e.framework=p.manager.framework(e),e.framework({data:e.data,layout:e.layout},i.node()),e.framework.setUndoPoint();var l=e.framework.svg(),s=1,c=e._fullLayout.title?e._fullLayout.title.text:"";""!==c&&c||(s=0);var u=function(){this.call(x.convertToTspans,e)},f=l.select(".title-group text").call(u);if(e._context.edits.titleText){var h=o._(e,"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:e}).on("edit",(function(t){e.framework({layout:{title:{text:t}}}),this.text(t).call(u),this.call(g)})).on("cancel",(function(){var e=this.attr("data-unformatted");this.text(e).call(u)}))};f.call(g)}return e._context.setBackground(e,e._fullLayout.paper_bgcolor),d.addLinks(e),Promise.resolve()}(e,t,a);v._replotting=!0,f&&le(e),e.framework!==le&&(e.framework=le,le(e)),g.initGradients(e),f&&h.saveShowSpikeInitial(e);var b=!e.calcdata||e.calcdata.length!==(e._fullData||[]).length;b&&d.doCalcdata(e);for(var _=0;_<e.calcdata.length;_++)e.calcdata[_][0].trace=e._fullData[_];e._context.responsive?e._responsiveChartHandler||(e._responsiveChartHandler=function(){o.isHidden(e)||d.resize(e)},window.addEventListener("resize",e._responsiveChartHandler)):o.clearResponsive(e);var w=o.extendFlat({},v._size),M=0;function A(){if(d.clearAutoMarginIds(e),T.drawMarginPushers(e),h.allowAutoMargin(e),v._has("pie"))for(var t=e._fullData,r=0;r<t.length;r++){var n=t[r];"pie"===n.type&&n.automargin&&d.allowAutoMargin(e,"pie."+n.uid+".automargin")}return d.doAutoMargin(e),d.previousPromises(e)}function L(){e._transitioning||(T.doAutoRangeAndConstraints(e),f&&h.saveRangeInitial(e),u.getComponentMethod("rangeslider","calcAutorange")(e))}var C=[d.previousPromises,function(){if(l)return r.addFrames(e,l)},function t(){for(var r=v._basePlotModules,n=0;n<r.length;n++)r[n].drawFramework&&r[n].drawFramework(e);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(e){return e.key})),v._glcanvas.enter().append("canvas").attr("class",(function(e){return"gl-canvas gl-canvas-"+e.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([],{},e._fullData,v),d.supplyDefaults(e),v=e._fullLayout,d.doCalcdata(e),M++,t();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(e)},A,function(){if(d.didMarginChange(w,v._size))return o.syncOrAsync([A,T.layoutStyles],e)}];y&&C.push((function(){if(b)return o.syncOrAsync([u.getComponentMethod("shapes","calcAutorange"),u.getComponentMethod("annotations","calcAutorange"),L],e);L()})),C.push(T.layoutStyles),y&&C.push((function(){return h.draw(e,f?"":"redraw")})),C.push(T.drawData,T.finalDraw,m,d.addLinks,d.rehover,d.redrag,d.doAutoMargin,d.previousPromises);var O=o.syncOrAsync(C,e);return O&&O.then||(O=Promise.resolve()),O.then((function(){return S(e),e}))},r.purge=function(e){var t=(e=o.getGraphDiv(e))._fullLayout||{},r=e._fullData||[];return d.cleanPlot([],{},r,t),d.purge(e),s.purge(e),t._container&&t._container.remove(),delete e._context,e},r.react=function(e,t,n,a){var i,s;e=o.getGraphDiv(e),k.clearPromiseQueue(e);var c=e._fullData,p=e._fullLayout;if(o.isPlotDiv(e)&&c&&p){if(o.isPlainObject(t)){var h=t;t=h.data,n=h.layout,a=h.config,i=h.frames}var g=!1;if(a){var v=o.extendDeep({},e._context);e._context=void 0,P(e,a),g=function e(t,r){var n;for(n in t)if("_"!==n.charAt(0)){var a=t[n],i=r[n];if(a!==i)if(o.isPlainObject(a)&&o.isPlainObject(i)){if(e(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(e(a[l],i[l]))return!0}}}}(v,e._context)}e.data=t||[],k.cleanData(e.data),e.layout=n||{},k.cleanLayout(e.layout),function(e,t,r,n){var a,i,s,c,u,f,d,p,h=n._preGUI,g=[],v={};for(a in h){if(u=te(a,K)){if(i=u.attr||u.head+".uirevision",(c=(s=l(n,i).get())&&re(i,t))&&c===s&&(null===(f=h[a])&&(f=void 0),ie(p=(d=l(t,a)).get(),f))){void 0===p&&"autorange"===a.substr(a.length-9)&&g.push(a.substr(0,a.length-10)),d.set(N(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(t,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=ne(_,r);if(M<0){delete b[_];break}var A=ae(_,e,(w=r[M]._fullInput).index);if(A<0){delete b[_];break}T=e[A]}if(u=te(a,ee)){if(u.attr?c=(s=l(n,u.attr).get())&&re(u.attr,t):(s=w.uirevision,void 0===(c=T.uirevision)&&(c=t.uirevision)),c&&c===s&&(null===(f=k[a])&&(f=void 0),ie(p=(d=l(T,a)).get(),f))){d.set(N(l(w,a).get()));continue}}else o.warn("unrecognized GUI edit: "+a+" in trace uid "+_);delete k[a]}}}(e.data,e.layout,c,p),d.supplyDefaults(e,{skipUpdateCalc:!0});var m=e._fullData,y=e._fullLayout,x=void 0===y.datarevision,b=y.transition,_=function(e,t,r,n,a){var i=M.layoutFlags();return i.arrays={},i.rangesAltered={},i.nChanges=0,i.nChangesAnim=0,oe(t,r,[],{getValObject:function(e){return f.getLayoutValObject(r,e)},flags:i,immutable:n,transition:a,gd:e}),(i.plot||i.calc)&&(i.layoutReplot=!0),a&&i.nChanges&&i.nChangesAnim&&(i.anim=i.nChanges===i.nChangesAnim?"all":"some"),i}(e,p,y,x,b),w=_.newDataRevision,A=function(e,t,r,n,a,i){var o=t.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(e){var t=f.getTraceValObject(s,e);return!s._module.animatable&&t.anim&&(t.anim=!1),t},flags:c,immutable:n,transition:a,newDataRevision:i,gd:e},p={};for(l=0;l<t.length;l++)if(r[l]){if(s=r[l]._fullInput,d.hasMakesDataTransform(s)&&(s=r[l]),p[s.uid])continue;p[s.uid]=1,oe(t[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}(e,c,m,x,b,w);J(e)&&(_.layoutReplot=!0),A.calc||_.calc?e.calcdata=void 0:d.supplyDefaultsUpdateCalc(e.calcdata,m);var L=[];if(i&&(e._transitionData={},d.createTransitionData(e),L.push((function(){return r.addFrames(e,i)}))),y.transition&&!g&&(A.anim||_.anim))d.doCalcdata(e),T.doAutoRangeAndConstraints(e),L.push((function(){return d.transitionFromReact(e,A,_,p)}));else if(A.fullReplot||_.layoutReplot||g)e._fullLayout._skipDefaults=!0,L.push(r.plot);else{for(var C in _.arrays){var O=_.arrays[C];if(O.length){var D=u.getComponentMethod(C,"drawOne");if(D!==o.noop)for(var z=0;z<O.length;z++)D(e,O[z]);else{var E=u.getComponentMethod(C,"draw");if(E===o.noop)throw new Error("cannot draw components: "+C);E(e)}}}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&&G(L),_.ticks&&L.push(T.doTicksRelayout),_.modebar&&L.push(T.doModeBar),_.camera&&L.push(T.doCamera),L.push(S)}L.push(d.rehover,d.redrag),(s=o.syncOrAsync(L,e))&&s.then||(s=Promise.resolve(e))}else s=r.newPlot(e,t,n,a);return s.then((function(){return e.emit("plotly_react",{data:t,layout:n}),e}))},r.redraw=function(e){if(e=o.getGraphDiv(e),!o.isPlotDiv(e))throw new Error("This element is not a Plotly plot: "+e);return k.cleanData(e.data),k.cleanLayout(e.layout),e.calcdata=void 0,r.plot(e).then((function(){return e.emit("plotly_redraw"),e}))},r.relayout=q,r.restyle=F,r.setPlotConfig=function(e){return o.extendFlat(_,e)},r.update=$,r._guiRelayout=Q(q),r._guiRestyle=Q(F),r._guiUpdate=Q($),r._storeDirectGUIEdit=function(e,t,r){for(var n in r)B(n,l(e,n).get(),r[n],t)}},{"../components/color":43,"../components/drawing":65,"../constants/xmlns_namespaces":149,"../lib":168,"../lib/events":162,"../lib/queue":182,"../lib/svg_text_utils":189,"../plots/cartesian/axes":212,"../plots/cartesian/constants":218,"../plots/cartesian/graph_interact":221,"../plots/cartesian/select":231,"../plots/plots":246,"../plots/polar/legacy":249,"../registry":254,"./edit_types":195,"./helpers":196,"./manage_arrays":198,"./plot_config":200,"./plot_schema":201,"./subroutines":203,d3:7,"fast-isnumeric":9,"has-hover":11}],200:[function(e,t,r){"use strict";var n={staticPlot:{valType:"boolean",dflt:!1},plotlyServerURL:{valType:"string",dflt:""},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 e(t,r){for(var n in t){var a=t[n];a.valType?r[n]=a.dflt:(r[n]||(r[n]={}),e(a,r[n]))}}(n,a),t.exports={configAttributes:n,dfltConfig:a}},{}],201:[function(e,t,r){"use strict";var n=e("../registry"),a=e("../lib"),i=e("../plots/attributes"),o=e("../plots/layout_attributes"),l=e("../plots/frame_attributes"),s=e("../plots/animation_attributes"),c=e("./plot_config").configAttributes,u=e("../plots/polar/legacy/area_attributes"),f=e("../plots/polar/legacy/axis_attributes"),d=e("./edit_types"),p=a.extendFlat,h=a.extendDeepAll,g=a.isPlainObject,v=a.isArrayOrTypedArray,m=a.nestedProperty,y=a.valObjectMeta,x=["_isSubplotObj","_isLinkedToArray","_arrayAttrRegexps","_deprecated"];function b(e,t,r){if(!e)return!1;if(e._isLinkedToArray)if(_(t[r]))r++;else if(r<t.length)return!1;for(;r<t.length;r++){var n=e[t[r]];if(!g(n))break;if(e=n,r===t.length-1)break;if(e._isLinkedToArray){if(!_(t[++r]))return!1}else if("info_array"===e.valType){var a=t[++r];if(!_(a))return!1;var i=e.items;if(Array.isArray(i)){if(a>=i.length)return!1;if(2===e.dimensions){if(r++,t.length===r)return e;var o=t[r];if(!_(o))return!1;e=i[a][o]}else e=i[a]}else e=i}}return e}function _(e){return e===Math.round(e)&&e>=0}function w(e){return function(e){r.crawl(e,(function(e,t,n){r.isValObject(e)?"data_array"===e.valType?(e.role="data",n[t+"src"]={valType:"string",editType:"none"}):!0===e.arrayOk&&(n[t+"src"]={valType:"string",editType:"none"}):g(e)&&(e.role="object")}))}(e),function(e){r.crawl(e,(function(e,t,r){if(e){var n=e._isLinkedToArray;n&&(delete e._isLinkedToArray,r[t]={items:{}},r[t].items[n]=e,r[t].role="object")}}))}(e),function(e){!function e(t){for(var r in t)if(g(t[r]))e(t[r]);else if(Array.isArray(t[r]))for(var n=0;n<t[r].length;n++)e(t[r][n]);else t[r]instanceof RegExp&&(t[r]=t[r].toString())}(e)}(e),e}function k(e,t,r){var n=m(e,r),a=h({},t.layoutAttributes);a._isSubplotObj=!0,n.set(a)}function T(e,t,r){var n=m(e,r);n.set(h(n.get()||{},t))}r.IS_SUBPLOT_OBJ="_isSubplotObj",r.IS_LINKED_TO_ARRAY="_isLinkedToArray",r.DEPRECATED="_deprecated",r.UNDERSCORE_ATTRS=x,r.get=function(){var e={};n.allTypes.concat("area").forEach((function(t){e[t]=function(e){var t,a;"area"===e?(t={attributes:u},a={}):a=(t=n.modules[e]._module).basePlotModule;var o={type:null},l=h({},i),s=h({},t.attributes);r.crawl(s,(function(e,t,r,n,a){m(l,a).set(void 0),void 0===e&&m(s,a).set(void 0)})),h(o,l),n.traceIs(e,"noOpacity")&&delete o.opacity,n.traceIs(e,"showLegend")||(delete o.showlegend,delete o.legendgroup),n.traceIs(e,"noHover")&&(delete o.hoverinfo,delete o.hoverlabel),t.selectPoints||delete o.selectedpoints,h(o,s),a.attributes&&h(o,a.attributes),o.type=e;var c={meta:t.meta||{},categories:t.categories||{},animatable:Boolean(t.animatable),type:e,attributes:w(o)};if(t.layoutAttributes){var f={};h(f,t.layoutAttributes),c.layoutAttributes=w(f)}return t.animatable||r.crawl(c,(function(e){r.isValObject(e)&&"anim"in e&&delete e.anim})),c}(t)}));var t={};return Object.keys(n.transformsRegistry).forEach((function(e){t[e]=function(e){var t=n.transformsRegistry[e],r=h({},t.attributes);return Object.keys(n.componentsRegistry).forEach((function(t){var a=n.componentsRegistry[t];a.schema&&a.schema.transforms&&a.schema.transforms[e]&&Object.keys(a.schema.transforms[e]).forEach((function(t){T(r,a.schema.transforms[e][t],t)}))})),{attributes:w(r)}}(e)})),{defs:{valObjects:y,metaKeys:x.concat(["description","role","editType","impliedEdits"]),editType:{traces:d.traces,layout:d.layout},impliedEdits:{}},traces:e,layout:function(){var e,t,r={};for(e in h(r,o),n.subplotsRegistry)if((t=n.subplotsRegistry[e]).layoutAttributes)if(Array.isArray(t.attr))for(var a=0;a<t.attr.length;a++)k(r,t,t.attr[a]);else k(r,t,"subplot"===t.attr?t.name:t.attr);for(e in r=function(e){return p(e,{radialaxis:f.radialaxis,angularaxis:f.angularaxis}),p(e,f.layout),e}(r),n.componentsRegistry){var i=(t=n.componentsRegistry[e]).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"===t.name?h(r,t.layoutAttributes):t.layoutAttributes&&T(r,t.layoutAttributes,t.name)}return{layoutAttributes:w(r)}}(),transforms:t,frames:function(){var e={frames:h({},l)};return w(e),e.frames}(),animation:w(s),config:w(c)}},r.crawl=function(e,t,n,a){var i=n||0;a=a||"",Object.keys(e).forEach((function(n){var o=e[n];if(-1===x.indexOf(n)){var l=(a?a+".":"")+n;t(o,n,e,i,l),r.isValObject(o)||g(o)&&"impliedEdits"!==n&&r.crawl(o,t,i+1,l)}}))},r.isValObject=function(e){return e&&void 0!==e.valType},r.findArrayAttributes=function(e){var t,n,a=[],o=[],l=[];function s(e,r,i,s){o=o.slice(0,s).concat([r]),l=l.slice(0,s).concat([e&&e._isLinkedToArray]),e&&("data_array"===e.valType||!0===e.arrayOk)&&("colorbar"!==o[s-1]||"ticktext"!==r&&"tickvals"!==r)&&function e(t,r,i){var s=t[o[r]],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])&&e(s[u],r+1,c+"["+u+"].")}else g(s)&&e(s,r+1,c+".")}(t,0,"")}t=e,n="",r.crawl(i,s),e._module&&e._module.attributes&&r.crawl(e._module.attributes,s);var c=e.transforms;if(c)for(var u=0;u<c.length;u++){var f=c[u],d=f._module;d&&(n="transforms["+u+"].",t=f,r.crawl(d.attributes,s))}return a},r.getTraceValObject=function(e,t){var r,a,o=t[0],l=1;if("transforms"===o){if(1===t.length)return i.transforms;var s=e.transforms;if(!Array.isArray(s)||!s.length)return!1;var c=t[1];if(!_(c)||c>=s.length)return!1;a=(r=(n.transformsRegistry[s[c].type]||{}).attributes)&&r[t[2]],l=3}else if("area"===e.type)a=u[o];else{var f=e._module;if(f||(f=(n.modules[e.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 b(a,t,l)},r.getLayoutValObject=function(e,t){return b(function(e,t){var r,a,i,l,s=e._basePlotModules;if(s){var c;for(r=0;r<s.length;r++){if((i=s[r]).attrRegex&&i.attrRegex.test(t)){if(i.layoutAttrOverrides)return i.layoutAttrOverrides;!c&&i.layoutAttributes&&(c=i.layoutAttributes)}var u=i.baseLayoutAttrOverrides;if(u&&t in u)return u[t]}if(c)return c}var d=e._modules;if(d)for(r=0;r<d.length;r++)if((l=d[r].layoutAttributes)&&t in l)return l[t];for(a in n.componentsRegistry){if("colorscale"===(i=n.componentsRegistry[a]).name&&0===t.indexOf("coloraxis"))return i.layoutAttributes[t];if(!i.schema&&t===i.name)return i.layoutAttributes}return t in o?o[t]:"radialaxis"===t||"angularaxis"===t?f[t]:f.layout[t]||!1}(e,t[0]),t,1)}},{"../lib":168,"../plots/animation_attributes":207,"../plots/attributes":209,"../plots/frame_attributes":241,"../plots/layout_attributes":244,"../plots/polar/legacy/area_attributes":247,"../plots/polar/legacy/axis_attributes":248,"../registry":254,"./edit_types":195,"./plot_config":200}],202:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plots/attributes"),i={name:{valType:"string",editType:"none"}};function o(e){return e&&"string"==typeof e}function l(e){var t=e.length-1;return"s"!==e.charAt(t)&&n.warn("bad argument to arrayDefaultKey: "+e),e.substr(0,e.length-1)+"defaults"}i.templateitemname={valType:"string",editType:"calc"},r.templatedArray=function(e,t){return t._isLinkedToArray=e,t.name=i.name,t.templateitemname=i.templateitemname,t},r.traceTemplater=function(e){var t,r,i={};for(t in e)r=e[t],Array.isArray(r)&&r.length&&(i[t]=0);return{newTrace:function(o){var l={type:t=n.coerce(o,{},a,"type"),_template:null};if(t in i){r=e[t];var s=i[t]%r.length;i[t]++,l._template=r[s]}return l}}},r.newContainer=function(e,t,r){var a=e._template,i=a&&(a[t]||r&&a[r]);return n.isPlainObject(i)||(i=null),e[t]={_template:i}},r.arrayTemplater=function(e,t,r){var n=e._template,a=n&&n[l(t)],i=n&&n[t];Array.isArray(i)&&i.length||(i=[]);var s={};return{newItem:function(e){var t={name:e.name,_input:e},n=t.templateitemname=e.templateitemname;if(!o(n))return t._template=a,t;for(var l=0;l<i.length;l++){var c=i[l];if(c.name===n)return s[n]=1,t._template=c,t}return t[r]=e[r]||!1,t._template=!1,t},defaultItems:function(){for(var e=[],t=0;t<i.length;t++){var r=i[t],n=r.name;if(o(n)&&!s[n]){var a={_template:r,name:n,_input:{_templateitemname:n}};a.templateitemname=r.templateitemname,e.push(a),s[n]=1}}return e}}},r.arrayDefaultKey=l,r.arrayEditor=function(e,t,r){var a=(n.nestedProperty(e,t).get()||[]).length,i=r._index,o=i>=a&&(r._input||{})._templateitemname;o&&(i=a);var l,s=t+"["+i+"]";function c(){l={},o&&(l[s]={},l[s].templateitemname=o)}function u(e,t){o?n.nestedProperty(l[s],e).set(t):l[s+"."+e]=t}function f(){var e=l;return c(),e}return c(),{modifyBase:function(e,t){l[e]=t},modifyItem:u,getUpdateObj:f,applyUpdate:function(t,r){t&&u(t,r);var a=f();for(var i in a)n.nestedProperty(e,i).set(a[i])}}}},{"../lib":168,"../plots/attributes":209}],203:[function(e,t,r){"use strict";var n=e("d3"),a=e("../registry"),i=e("../plots/plots"),o=e("../lib"),l=e("../lib/clear_gl_canvases"),s=e("../components/color"),c=e("../components/drawing"),u=e("../components/titles"),f=e("../components/modebar"),d=e("../plots/cartesian/axes"),p=e("../constants/alignment"),h=e("../plots/cartesian/constraints"),g=h.enforce,v=h.clean,m=e("../plots/cartesian/autorange").doAutoRange;function y(e,t,r){for(var n=0;n<r.length;n++){var a=r[n][0],i=r[n][1];if(!(a[0]>=e[1]||a[1]<=e[0])&&i[0]<t[1]&&i[1]>t[0])return!0}return!1}function x(e){var t,a,l,u,h,g,v=e._fullLayout,m=v._size,x=m.p,_=d.list(e,"",!0);if(v._paperdiv.style({width:e._context.responsive&&v.autosize&&!e._context._hasZeroWidth&&!e.layout.width?"100%":v.width+"px",height:e._context.responsive&&v.autosize&&!e._context._hasZeroHeight&&!e.layout.height?"100%":v.height+"px"}).selectAll(".main-svg").call(c.setSize,v.width,v.height),e._context.setBackground(e,v.paper_bgcolor),r.drawMainTitle(e),f.manage(e),!v._has("cartesian"))return i.previousPromises(e);function k(e,t,r){var n=e._lw/2;return"x"===e._id.charAt(0)?t?"top"===r?t._offset-x-n:t._offset+t._length+x+n:m.t+m.h*(1-(e.position||0))+n%1:t?"right"===r?t._offset+t._length+x+n:t._offset-x-n:m.l+m.w*(e.position||0)+n%1}for(t=0;t<_.length;t++){var T=(u=_[t])._anchorAxis;u._linepositions={},u._lw=c.crispRound(e,u.linewidth,1),u._mainLinePosition=k(u,T,u.side),u._mainMirrorPosition=u.mirror&&T?k(u,T,p.OPPOSITE_SIDE[u.side]):null}var M=[],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(y(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||(M.push(a),A.push(a))}var E,R,I,F,N,H,B,j,V,q,U,G,Z,X=v._bgLayer.selectAll(".bg").data(M);for(X.enter().append("rect").classed("bg",!0),X.exit().remove(),X.each((function(e){v._plots[e].bg=n.select(this)})),t=0;t<A.length;t++)l=v._plots[A[t]],h=l.xaxis,g=l.yaxis,l.bg&&l.bg.call(c.setRect,h._offset-x,g._offset-x,h._length+2*x,g._length+2*x).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,J=l.clipId="clip"+v._uid+a+"plot",$=o.ensureSingleById(v._clips,"clipPath",J,(function(e){e.classed("plotclip",!0).append("rect")}));l.clipRect=$.select("rect").attr({width:h._length,height:g._length}),c.setTranslate(l.plot,h._offset,g._offset),l._hasClipOnAxisFalse?(Y=null,W=J):(Y=J,W=null),c.setClipUrl(l.plot,Y,e),l.layerClipId=W}function Q(e){return"M"+E+","+e+"H"+R}function K(e){return"M"+h._offset+","+e+"h"+h._length}function ee(e){return"M"+e+","+j+"V"+B}function te(e){return"M"+e+","+g._offset+"v"+g._length}function re(e,t,r){if(!e.showline||a!==e._mainSubplot)return"";if(!e._anchorAxis)return r(e._mainLinePosition);var n=t(e._mainLinePosition);return e.mirror&&(n+=t(e._mainMirrorPosition)),n}for(a in v._plots){l=v._plots[a],h=l.xaxis,g=l.yaxis;var ne="M0,0";b(h,a)&&(N=w(h,"left",g,_),E=h._offset-(N?x+N:0),H=w(h,"right",g,_),R=h._offset+h._length+(H?x+H:0),I=k(h,g,"bottom"),F=k(h,g,"top"),!(Z=!h._anchorAxis||a!==h._mainSubplot)||"allticks"!==h.mirror&&"all"!==h.mirror||(h._linepositions[a]=[I,F]),ne=re(h,Q,K),Z&&h.showline&&("all"===h.mirror||"allticks"===h.mirror)&&(ne+=Q(I)+Q(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",ne);var ae="M0,0";b(g,a)&&(U=w(g,"bottom",h,_),B=g._offset+g._length+(U?x:0),G=w(g,"top",h,_),j=g._offset-(G?x:0),V=k(g,h,"left"),q=k(g,h,"right"),!(Z=!g._anchorAxis||a!==g._mainSubplot)||"allticks"!==g.mirror&&"all"!==g.mirror||(g._linepositions[a]=[V,q]),ae=re(g,ee,te),Z&&g.showline&&("all"===g.mirror||"allticks"===g.mirror)&&(ae+=ee(V)+ee(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",ae)}return d.makeClipPaths(e),i.previousPromises(e)}function b(e,t){return(e.ticks||e.showline)&&(t===e._mainSubplot||"all"===e.mirror||"allticks"===e.mirror)}function _(e,t,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[t];return r.side===t?n.domain[a]===e.domain[a]:r.mirror&&n.domain[1-a]===e.domain[1-a]}function w(e,t,r,n){if(_(e,t,r))return r._lw;for(var a=0;a<n.length;a++){var i=n[a];if(i._mainAxis===r._mainAxis&&_(e,t,i))return i._lw}return 0}r.layoutStyles=function(e){return o.syncOrAsync([i.doAutoMargin,x],e)},r.drawMainTitle=function(e){var t=e._fullLayout,r=function(e){var t=e.title,r="middle";return o.isRightAnchor(t)?r="end":o.isLeftAnchor(t)&&(r="start"),r}(t),n=function(e){var t=e.title,r="0em";return o.isTopAnchor(t)?r=p.CAP_SHIFT+"em":o.isMiddleAnchor(t)&&(r=p.MID_SHIFT+"em"),r}(t);u.draw(e,"gtitle",{propContainer:t,propName:"title.text",placeholder:t._dfltTitle.plot,attributes:{x:function(e,t){var r=e.title,n=e._size,a=0;switch("start"===t?a=r.pad.l:"end"===t&&(a=-r.pad.r),r.xref){case"paper":return n.l+n.w*r.x+a;case"container":default:return e.width*r.x+a}}(t,r),y:function(e,t){var r=e.title,n=e._size,a=0;if("0em"!==t&&t?t===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 e.height-e.height*r.y+a}}(t,n),"text-anchor":r,dy:n}})},r.doTraceStyle=function(e){var t,n=e.calcdata,o=[];for(t=0;t<n.length;t++){var s=n[t],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(t=0;t<o.length;t++){var h=o[t];h.fn(e,h.cd0)}l(e),r.redrawReglTraces(e)}return i.style(e),a.getComponentMethod("legend","draw")(e),i.previousPromises(e)},r.doColorBars=function(e){return a.getComponentMethod("colorbar","draw")(e),i.previousPromises(e)},r.layoutReplot=function(e){var t=e.layout;return e.layout=void 0,a.call("plot",e,"",t)},r.doLegend=function(e){return a.getComponentMethod("legend","draw")(e),i.previousPromises(e)},r.doTicksRelayout=function(e){return d.draw(e,"redraw"),e._fullLayout._hasOnlyLargeSploms&&(a.subplotsRegistry.splom.updateGrid(e),l(e),r.redrawReglTraces(e)),r.drawMainTitle(e),i.previousPromises(e)},r.doModeBar=function(e){var t=e._fullLayout;f.manage(e);for(var r=0;r<t._basePlotModules.length;r++){var n=t._basePlotModules[r].updateFx;n&&n(e)}return i.previousPromises(e)},r.doCamera=function(e){for(var t=e._fullLayout,r=t._subplots.gl3d,n=0;n<r.length;n++){var a=t[r[n]];a._scene.setViewport(a)}},r.drawData=function(e){var t=e._fullLayout;l(e);for(var n=t._basePlotModules,o=0;o<n.length;o++)n[o].plot(e);return r.redrawReglTraces(e),i.style(e),a.getComponentMethod("shapes","draw")(e),a.getComponentMethod("annotations","draw")(e),a.getComponentMethod("images","draw")(e),t._replotting=!1,i.previousPromises(e)},r.redrawReglTraces=function(e){var t=e._fullLayout;if(t._has("regl")){var r,n,a=e._fullData,i=[],l=[];for(t._hasOnlyLargeSploms&&t._splomGrid.draw(),r=0;r<a.length;r++){var s=a[r];!0===s.visible&&0!==s._length&&("splom"===s.type?t._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=t._plots[i[r]])._scene&&n._scene.draw();for(r=0;r<l.length;r++)(n=t[l[r]]._subplot)._scene&&n._scene.draw()}},r.doAutoRangeAndConstraints=function(e){for(var t,r,n=e._fullLayout,a=d.list(e,"",!0),i=n._axisMatchGroups||[],l={},s=0;s<a.length;s++)t=a[s],v(e,t),m(e,t),l[t._id]=1;g(e);e:for(var c=0;c<i.length;c++){var u,f=i[c],p=null;for(u in f)if(l[(t=d.getFromId(e,u))._id]){if(!1===t.autorange)continue e;r=o.simpleMap(t.range,t.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)(t=d.getFromId(e,u)).range=o.simpleMap(p,t.l2r),t._input.range=t.range.slice(),t.setScale()}},r.finalDraw=function(e){a.getComponentMethod("rangeslider","draw")(e),a.getComponentMethod("rangeselector","draw")(e)},r.drawMarginPushers=function(e){a.getComponentMethod("legend","draw")(e),a.getComponentMethod("rangeselector","draw")(e),a.getComponentMethod("sliders","draw")(e),a.getComponentMethod("updatemenus","draw")(e),a.getComponentMethod("colorbar","draw")(e)}},{"../components/color":43,"../components/drawing":65,"../components/modebar":103,"../components/titles":138,"../constants/alignment":145,"../lib":168,"../lib/clear_gl_canvases":157,"../plots/cartesian/autorange":211,"../plots/cartesian/axes":212,"../plots/cartesian/constraints":219,"../plots/plots":246,"../registry":254,d3:7}],204:[function(e,t,r){"use strict";var n=e("../lib"),a=n.isPlainObject,i=e("./plot_schema"),o=e("../plots/plots"),l=e("../plots/attributes"),s=e("./plot_template"),c=e("./plot_config").dfltConfig;function u(e,t){e=n.extendDeep({},e);var r,i,o=Object.keys(e).sort();function l(t,r,n){if(a(r)&&a(t))u(t,r);else if(Array.isArray(r)&&Array.isArray(t)){var o=s.arrayTemplater({_template:e},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=e[c];if(c in t?l(d,t[c],c):t[c]=d,f(c)===c)for(var p in t){var h=f(p);p===h||h!==c||p in e||l(d,t[p],c)}}}function f(e){return e.replace(/[0-9]+$/,"")}function d(e,t,r,i,o){var l=o&&r(o);for(var c in e){var u=e[c],p=g(e,c,i),h=g(e,c,o),v=r(h);if(!v){var m=f(c);m!==c&&(v=r(h=g(e,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,t,r,p,h);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,t,r,g(u,x,p),g(u,x,h)),x++,b[k]=1);else if(!y){var T=g(e,s.arrayDefaultKey(c),i),M=g(u,x,p);d(w,t,r,M,g(u,x,h));var A=n.nestedProperty(t,M);n.nestedProperty(t,T).set(A.get()),A.set(null),y=!0}}}else n.nestedProperty(t,p).set(u)}}function p(e,t){return i.getLayoutValObject(e,n.nestedProperty({},t).parts)}function h(e,t){return i.getTraceValObject(e,n.nestedProperty({},t).parts)}function g(e,t,r){return r?Array.isArray(e)?r+"["+t+"]":r+"."+t:t}function v(e){for(var t=0;t<e.length;t++)if(a(e[t]))return!0}function m(e){var t;switch(e.code){case"data":t="The template has no key data.";break;case"layout":t="The template has no key layout.";break;case"missing":t=e.path?"There are no templates for item "+e.path+" with name "+e.templateitemname:"There are no templates for trace "+e.index+", of type "+e.traceType+".";break;case"unused":t=e.path?"The template item at "+e.path+" was not used in constructing the plot.":e.dataCount?"Some of the templates of type "+e.traceType+" were not used. The template has "+e.templateCount+" traces, the data only has "+e.dataCount+" of this type.":"The template has "+e.templateCount+" traces of type "+e.traceType+" but there are none in the data.";break;case"reused":t="Some of the templates of type "+e.traceType+" were used more than once. The template has "+e.templateCount+" traces, the data has "+e.dataCount+" of this type."}return e.msg=t,e}r.makeTemplate=function(e){e=n.isPlainObject(e)?e:n.getGraphDiv(e),e=n.extendDeep({_context:c},{data:e.data,layout:e.layout}),o.supplyDefaults(e);var t=e.data||[],r=e.layout||{};r._basePlotModules=e._fullLayout._basePlotModules,r._modules=e._fullLayout._modules;var i={data:{},layout:{}};t.forEach((function(e){var t={};d(e,t,h.bind(null,e));var r=n.coerce(e,{},l,"type"),a=i.data[r];a||(a=i.data[r]=[]),a.push(t)})),d(r,i.layout,p.bind(null,r)),delete i.layout.template;var s=r.template;if(a(s)){var f,g,v,m,y,x,b=s.layout;a(b)&&u(b,i.layout);var _=s.data;if(a(_)){for(g in i.data)if(v=_[g],Array.isArray(v)){for(x=(y=i.data[g]).length,m=v.length,f=0;f<x;f++)u(v[f%m],y[f]);for(f=x;f<m;f++)y.push(n.extendDeep({},v[f]))}for(g in _)g in i.data||(i.data[g]=n.extendDeep([],_[g]))}}return i},r.validateTemplate=function(e,t){var r=n.extendDeep({},{_context:c,data:e.data,layout:e.layout}),i=r.layout||{};a(t)||(t=i.template||{});var l=t.layout,s=t.data,u=[];r.layout=i,r.layout.template=t,o.supplyDefaults(r);var d=r._fullLayout,p=r._fullData,h={};if(a(l)?(function e(t,r){for(var n in t)if("_"!==n.charAt(0)&&a(t[n])){var i,o=f(n),l=[];for(i=0;i<r.length;i++)l.push(g(t,n,r[i])),o!==n&&l.push(g(t,o,r[i]));for(i=0;i<l.length;i++)h[l[i]]=1;e(t[n],l)}}(d,["layout"]),function e(t,r){for(var n in t)if(-1===n.indexOf("defaults")&&a(t[n])){var i=g(t,n,r);h[i]?e(t[n],i):u.push({code:"unused",path:i})}}(l,"layout")):u.push({code:"layout"}),a(s)){for(var y,x={},b=0;b<p.length;b++){var _=p[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 e(t,r){for(var n in t)if("_"!==n.charAt(0)){var i=t[n],o=g(t,n,r);a(i)?(Array.isArray(t)&&!1===i._template&&i.templateitemname&&u.push({code:"missing",path:o,templateitemname:i.templateitemname}),e(i,o)):Array.isArray(i)&&v(i)&&e(i,o)}}({data:p,layout:d},""),u.length)return u.map(m)}},{"../lib":168,"../plots/attributes":209,"../plots/plots":246,"./plot_config":200,"./plot_schema":201,"./plot_template":202}],205:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./plot_api"),i=e("../plots/plots"),o=e("../lib"),l=e("../snapshot/helpers"),s=e("../snapshot/tosvg"),c=e("../snapshot/svgtoimg"),u=e("../version").version,f={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],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}};t.exports=function(e,t){var r,d,p,h;function g(e){return!(e in t)||o.validate(t[e],f[e])}if(t=t||{},o.isPlainObject(e)?(r=e.data||[],d=e.layout||{},p=e.config||{},h={}):(e=o.getGraphDiv(e),r=o.extendDeep([],e.data),d=o.extendDeep({},e.layout),p=e._context,h=e._fullLayout||{}),!g("width")&&null!==t.width||!g("height")&&null!==t.height)throw new Error("Height and width should be pixel values.");if(!g("format"))throw new Error("Image format is not jpeg, png, svg or webp.");var v={};function m(e,r){return o.coerce(t,v,f,e,r)}var y=m("format"),x=m("width"),b=m("height"),_=m("scale"),w=m("setBackground"),k=m("imageDataOnly"),T=document.createElement("div");T.style.position="absolute",T.style.left="-5000px",document.body.appendChild(T);var M=o.extendFlat({},d);x?M.width=x:null===t.width&&n(h.width)&&(M.width=h.width),b?M.height=b:null===t.height&&n(h.height)&&(M.height=h.height);var A=o.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),L=l.getRedrawFunc(T);function S(){return new Promise((function(e){setTimeout(e,l.getDelay(T._fullLayout))}))}function C(){return new Promise((function(e,t){var r=s(T,y,_),n=T._fullLayout.width,f=T._fullLayout.height;function d(){a.purge(T),document.body.removeChild(T)}if("full-json"===y){var p=i.graphJson(T,!1,"keepdata","object",!0,!0);return p.version=u,p=JSON.stringify(p),d(),e(k?p:l.encodeJSON(p))}if(d(),"svg"===y)return e(k?r:l.encodeSVG(r));var h=document.createElement("canvas");h.id=o.randstr(),c({format:y,width:n,height:f,scale:_,canvas:h,svg:r,promise:!0}).then(e).catch(t)}))}return new Promise((function(e,t){a.plot(T,r,M,A).then(L).then(S).then(C).then((function(t){e(function(e){return k?e.replace(l.IMAGE_URL_PREFIX,""):e}(t))})).catch((function(e){t(e)}))}))}},{"../lib":168,"../plots/plots":246,"../snapshot/helpers":258,"../snapshot/svgtoimg":260,"../snapshot/tosvg":262,"../version":321,"./plot_api":199,"fast-isnumeric":9}],206:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plots/plots"),i=e("./plot_schema"),o=e("./plot_config").dfltConfig,l=n.isPlainObject,s=Array.isArray,c=n.isArrayOrTypedArray;function u(e,t,r,a,i,o){o=o||[];for(var f=Object.keys(e),d=0;d<f.length;d++){var v=f[d];if("transforms"!==v){var m=o.slice();m.push(v);var y=e[v],x=t[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,E,R=T[Object.keys(T)[0]],I=[];for(z=0;z<x.length;z++){var F=x[z]._index||z;if((E=m.slice()).push(F),l(y[F])&&l(x[z])){I.push(F);var N=y[F],H=x[z];l(N)&&!1!==N.visible&&!1===H.visible?a.push(p("invisible",i,E)):u(N,H,R,a,i,E)}}for(z=0;z<y.length;z++)(E=m.slice()).push(z),l(y[z])?-1===I.indexOf(z)&&a.push(p("unused",i,E)):a.push(p("object",i,E,y[z]))}else!l(y)&&l(x)?a.push(p("object",i,m,y)):c(y)||!c(x)||w||k?v in t?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}t.exports=function(e,t){var r,c,f=i.get(),d=[],h={_context:n.extendFlat({},o)};s(e)?(h.data=n.extendDeep([],e),r=e):(h.data=[],r=[],d.push(p("array","data"))),l(t)?(h.layout=n.extendDeep({},t),c=t):(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))}var C=h._fullLayout,O=function(e,t){for(var r=e.layout.layoutAttributes,a=0;a<t.length;a++){var i=t[a],o=e.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);return u(c,C,O,d,"layout"),0===d.length?void 0:d};var f={object:function(e,t){return("layout"===e&&""===t?"The layout argument":"data"===e[0]&&""===t?"Trace "+e[1]+" in the data argument":d(e)+"key "+t)+" must be linked to an object container"},array:function(e,t){return("data"===e?"The data argument":d(e)+"key "+t)+" must be linked to an array container"},schema:function(e,t){return d(e)+"key "+t+" is not part of the schema"},unused:function(e,t,r){var n=l(r)?"container":"key";return d(e)+n+" "+t+" did not get coerced"},dynamic:function(e,t,r,n){return[d(e)+"key",t,"(set to '"+r+"')","got reset to","'"+n+"'","during defaults."].join(" ")},invisible:function(e,t){return(t?d(e)+"item "+t:"Trace "+e[1])+" got defaulted to be not visible"},value:function(e,t,r){return[d(e)+"key "+t,"is set to an invalid value ("+r+")"].join(" ")}};function d(e){return s(e)?"In data trace "+e[1]+", ":"In "+e+", "}function p(e,t,r,a,i){var o,l;r=r||"",s(t)?(o=t[0],l=t[1]):(o=t,l=null);var c=function(e){if(!s(e))return String(e);for(var t="",r=0;r<e.length;r++){var n=e[r];"number"==typeof n?t=t.substr(0,t.length-1)+"["+n+"]":t+=n,r<e.length-1&&(t+=".")}return t}(r),u=f[e](t,c,a,i);return n.log(u),{code:e,container:o,trace:l,path:r,astr:c,msg:u}}function h(e,t){var r=m(t),n=r.keyMinusId,a=r.id;return!!(n in e&&e[n]._isSubplotObj&&a)||t in e}function g(e,t){return t in e?e[t]:e[m(t).keyMinusId]}var v=n.counterRegex("([a-z]+)");function m(e){var t=e.match(v);return{keyMinusId:t&&t[1],id:t&&t[2]}}},{"../lib":168,"../plots/plots":246,"./plot_config":200,"./plot_schema":201}],207:[function(e,t,r){"use strict";t.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"}}}},{}],208:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plot_api/plot_template");t.exports=function(e,t,r){var i,o,l=r.name,s=r.inclusionAttr||"visible",c=t[l],u=n.isArrayOrTypedArray(e[l])?e[l]:[],f=t[l]=[],d=a.arrayTemplater(t,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,t,r),f.push(o)}var h=d.defaultItems();for(i=0;i<h.length;i++)(o=h[i])._index=f.length,r.handleItemDefaults({},o,t,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":168,"../plot_api/plot_template":202}],209:[function(e,t,r){"use strict";var n=e("../components/fx/attributes");t.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":74}],210:[function(e,t,r){"use strict";t.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],211:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("../../constants/numerical").FP_SAFE,o=e("../../registry");function l(e,t){var r,n,i=[],o=s(t),l=c(e,t),u=l.min,f=l.max;if(0===u.length||0===f.length)return a.simpleMap(t.range,t.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(t.range){var g=a.simpleMap(t.range,t.r2l);h=g[1]<g[0]}"reversed"===t.autorange&&(h=!0,t.autorange=!0);var v,m,y,x,b,_,w=t.rangemode,k="tozero"===w,T="nonnegative"===w,M=t._length,A=M/10,L=function(e,r){var n=0;if(t.rangebreaks)for(var a=t.locateBreaks(e,r),i=0;i<a.length;i++){var o=a[i];n+=o.max-o.min}return n},S=0;for(r=0;r<u.length;r++)for(v=u[r],n=0;n<f.length;n++)(_=(m=f[n]).val-v.val-L(v.val,m.val))>0&&((b=M-o(v)-o(m))>A?_/b>S&&(y=v,x=m,S=_/b):_/M>S&&(y={val:v.val,pad:0},x={val:m.val,pad:0},S=_/M));if(d===p){var C=d-1,O=d+1;if(k)if(0===d)i=[0,1];else{var P=(d>0?f:u).reduce((function(e,t){return Math.max(e,o(t))}),0),D=d/(1-Math.min(.5,P/M));i=d>0?[0,D]:[D,0]}else i=T?[Math.max(0,C),Math.max(1,O)]:[C,O]}else k?(y.val>=0&&(y={val:0,pad:0}),x.val<=0&&(x={val:0,pad:0})):T&&(y.val-S*o(y)<0&&(y={val:0,pad:0}),x.val<=0&&(x={val:1,pad:0})),S=(x.val-y.val-L(v.val,m.val))/(M-o(y)-o(x)),i=[y.val-S*o(y),x.val+S*o(x)];return h&&i.reverse(),a.simpleMap(i,t.l2r||Number)}function s(e){var t=e._length/20;return"domain"===e.constrain&&e._inputDomain&&(t*=(e._inputDomain[1]-e._inputDomain[0])/(e.domain[1]-e.domain[0])),function(e){return e.pad+(e.extrapad?t:0)}}function c(e,t){var r,n,a,i=t._id,o=e._fullData,l=e._fullLayout,s=[],c=[];function d(e,t){for(r=0;r<t.length;r++){var o=e[t[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,t._traceIndices),d(l.annotations||[],t._annIndices||[]),d(l.shapes||[],t._shapeIndices||[]),{min:s,max:c}}function u(e,t,r,n){d(e,t,r,n,h)}function f(e,t,r,n){d(e,t,r,n,g)}function d(e,t,r,n,a){for(var i=n.tozero,o=n.extrapad,l=!0,s=0;s<e.length&&l;s++){var c=e[s];if(a(c.val,t)&&c.pad>=r&&(c.extrapad||!o)){l=!1;break}a(t,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(e.splice(s,1),s--)}if(l){var u=i&&0===t;e.push({val:t,pad:u?0:r,extrapad:!u&&o})}}function p(e){return n(e)&&Math.abs(e)<i}function h(e,t){return e<=t}function g(e,t){return e>=t}t.exports={getAutoRange:l,makePadFn:s,doAutoRange:function(e,t){if(t.setScale(),t.autorange){t.range=l(e,t),t._r=t.range.slice(),t._rl=a.simpleMap(t._r,t.r2l);var r=t._input,n={};n[t._attr+".range"]=t.range,n[t._attr+".autorange"]=t.autorange,o.call("_storeDirectGUIEdit",e.layout,e._fullLayout._preGUI,n),r.range=t.range.slice(),r.autorange=t.autorange}var i=t._anchorAxis;if(i&&i.rangeslider){var s=i.rangeslider[t._name];s&&"auto"===s.rangemode&&(s.range=l(e,t)),i._input.rangeslider[t._name]=a.extendFlat({},s)}},findExtremes:function(e,t,r){r||(r={}),e._m||e.setScale();var a,o,l,s,c,d,h,g,v,m=[],y=[],x=t.length,b=r.padded||!1,_=r.tozero&&("linear"===e.type||"-"===e.type),w="log"===e.type,k=!1,T=r.vpadLinearized||!1;function M(e){if(Array.isArray(e))return k=!0,function(t){return Math.max(Number(e[t]||0),0)};var t=Math.max(Number(e||0),0);return function(){return t}}var A=M((e._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),L=M((e._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=t[a])<g&&o>0&&(g=o),o>v&&o<i&&(v=o);else for(a=0;a<x;a++)(o=t[a])<g&&o>-i&&(g=o),o>v&&o<i&&(v=o);t=[g,v],x=2}var O={tozero:_,extrapad:b};function P(r){l=t[r],n(l)&&(d=A(r),h=L(r),T?(s=e.c2l(l)-C(r),c=e.c2l(l)+S(r)):(g=l-C(r),v=l+S(r),w&&g<v/10&&(g=v/10),s=e.c2l(g),c=e.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":148,"../../lib":168,"../../registry":254,"fast-isnumeric":9}],212:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../components/titles"),u=e("../../components/color"),f=e("../../components/drawing"),d=e("./layout_attributes"),p=e("./clean_ticks"),h=e("../../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=e("../../constants/alignment"),T=k.MID_SHIFT,M=k.CAP_SHIFT,A=k.LINE_SPACING,L=k.OPPOSITE_SIDE,S=t.exports={};S.setConvert=e("./set_convert");var C=e("./axis_autotype"),O=e("./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=e("./autorange");S.getAutoRange=P.getAutoRange,S.findExtremes=P.findExtremes,S.coerceRef=function(e,t,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(e,t,u,c)},S.coercePosition=function(e,t,r,n,a,i){var o,s;if("paper"===n||"pixel"===n)o=l.ensureNumber,s=r(a,i);else{var c=S.getFromId(t,n);s=r(a,i=c.fraction2r(i)),o=c.cleanPos}e[a]=o(s)},S.cleanPosition=function(e,t,r){return("paper"===r||"pixel"===r?l.ensureNumber:S.getFromId(t,r).cleanPos)(e)},S.redrawComponents=function(e,t){t=t||S.listIds(e);var r=e._fullLayout;function n(n,a,i,l){for(var s=o.getComponentMethod(n,a),c={},u=0;u<t.length;u++)for(var f=r[S.id2name(t[u])][i],d=0;d<f.length;d++){var p=f[d];if(!c[p]&&(s(e,p),c[p]=1,l))return}}n("annotations","drawOne","_annIndices"),n("shapes","drawOne","_shapeIndices"),n("images","draw","_imgIndices",!0)};var D=S.getDataConversions=function(e,t,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(e,t,i);return a?{d2c:a.d2c,c2d:a.c2d}:"ids"===i?{d2c:E,c2d:E}:{d2c:z,c2d:z}};function z(e){return+e}function E(e){return String(e)}S.getDataToCoordFunc=function(e,t,r,n){return D(e,t,r,n).d2c},S.counterLetter=function(e){var t=e.charAt(0);return"x"===t?"y":"y"===t?"x":void 0},S.minDtick=function(e,t,r,n){-1===["log","category","multicategory"].indexOf(e.type)&&n?void 0===e._minDtick?(e._minDtick=t,e._forceTick0=r):e._minDtick&&((e._minDtick/t+1e-6)%1<2e-6&&((r-e._forceTick0)/t%1+1.000001)%1<2e-6?(e._minDtick=t,e._forceTick0=r):((t/e._minDtick+1e-6)%1>2e-6||((r-e._forceTick0)/e._minDtick%1+1.000001)%1>2e-6)&&(e._minDtick=0)):e._minDtick=0},S.saveRangeInitial=function(e,t){for(var r=S.list(e,"",!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||t&&l)&&(i._rangeInitial=i.range.slice(),n=!0)}return n},S.saveShowSpikeInitial=function(e,t){for(var r=S.list(e,"",!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||t&&s)&&(o._showSpikeInitial=o.showspikes,n=!0),"on"!==a||o.showspikes||(a="off")}return e._fullLayout._cartesianSpikesEnabled=a,n},S.autoBin=function(e,t,r,n,i,o){var s,c=l.aggNums(Math.min,null,e),u=l.aggNums(Math.max,null,e);if("category"===t.type||"multicategory"===t.type)return{start:c-.5,end:u+.5,size:Math.max(1,Math.round(o)||1),_dataSpan:u-c};if(i||(i=t.calendar),s="log"===t.type?{type:"linear",range:[c,u]}:{type:t.type,range:l.simpleMap([c,u],t.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(e),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(e)/Math.pow(e.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(e,t,r,n,i){var o=0,l=0,s=0,c=0;function u(t){return(1+100*(t-e)/r.dtick)%100<2}for(var f=0;f<t.length;f++)t[f]%1==0?s++:a(t[f])||c++,u(t[f])&&o++,u(t[f]+r.dtick/2)&&l++;var d=t.length-c;if(s===d&&"date"!==r.type)r.dtick<1?e=n-.5*r.dtick:(e-=.5)+r.dtick<n&&(e+=r.dtick);else if(l<.1*d&&(o>.3*d||u(n)||u(i))){var p=r.dtick/2;e+=e+p<n?p:-p}return e}(x,e,s,c,u))+(1+Math.floor((u-x)/y))*y;else for("M"===s.dtick.charAt(0)&&(x=function(e,t,r,n,a){var i=l.findExactDates(t,a);if(i.exactDays>.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?e=S.tickIncrement(e,"M6","reverse")+1.5*m:i.exactMonths>.8?e=S.tickIncrement(e,"M1","reverse")+15.5*m:e-=m/2;var s=S.tickIncrement(e,r);if(s<=n)return s}return e}(x,e,y,c,i)),v=x;v<=u;)v=S.tickIncrement(v,y,!1,i);return{start:t.c2r(x,0,i),end:t.c2r(v,0,i),size:y,_dataSpan:u-c}},S.prepTicks=function(e){var t=l.simpleMap(e.range,e.r2l);if("auto"===e.tickmode||!e.dtick){var r,n=e.nticks;n||("category"===e.type||"multicategory"===e.type?(r=e.tickfont?1.2*(e.tickfont.size||12):15,n=e._length/r):(r="y"===e._id.charAt(0)?40:80,n=l.constrain(e._length/r,4,9)+1),"radialaxis"===e._name&&(n*=2)),"array"===e.tickmode&&(n*=100),e._roughDTick=(Math.abs(t[1]-t[0])-(e._lBreaks||0))/n,S.autoTicks(e,e._roughDTick),e._minDtick>0&&e.dtick<2*e._minDtick&&(e.dtick=e._minDtick,e.tick0=e.l2r(e._forceTick0))}e.tick0||(e.tick0="date"===e.type?"2000-01-01":0),"date"===e.type&&e.dtick<.1&&(e.dtick=.1),q(e)},S.calcTicks=function(e){S.prepTicks(e);var t=l.simpleMap(e.range,e.r2l);if("array"===e.tickmode)return function(e){var t=e.tickvals,r=e.ticktext,n=new Array(t.length),a=l.simpleMap(e.range,e.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"===e.type?e.d2l_noadd:e.d2l;"log"===e.type&&"L"!==String(e.dtick).charAt(0)&&(e.dtick="L"+Math.pow(10,Math.floor(Math.min(e.range[0],e.range[1]))-1));for(var d=0;d<t.length;d++){var p=f(t[d]);p>s&&p<c&&(void 0===r[d]?n[u]=S.tickText(e,p):n[u]=U(e,p,String(r[d])),u++)}return u<t.length&&n.splice(u,t.length-u),e.rangebreaks&&(n=n.filter((function(t){return e.maskBreaks(t.x)!==w}))),n}(e);e._tmin=S.tickFirst(e);var r=1.0001*t[0]-1e-4*t[1],n=1.0001*t[1]-1e-4*t[0],i=t[1]<t[0];if(e._tmin<r!==i)return[];"category"!==e.type&&"multicategory"!==e.type||(n=i?Math.max(-.5,n):Math.min(e._categories.length-.5,n));var o,s="log"===e.type&&!(a(e.dtick)||"L"===e.dtick.charAt(0));if(function(){var t=null,r=Math.max(1e3,e._length||0);o=[];for(var a=e._tmin;(i?a>=n:a<=n)&&!(o.length>r||a===t);a=S.tickIncrement(a,e.dtick,i,e.calendar)){t=a;var l=!1;s&&a!==(0|a)&&(l=!0),o.push({minor:l,value:a})}}(),e.rangebreaks){if("auto"===e.tickmode)for(var c=0;c<o.length;c++){var u=o[c].value;if(e.maskBreaks(u)===w)for(var f=0;f<e._rangebreaks.length;f++){var d=e._rangebreaks[f];if(u>=d.min&&u<d.max){o[c].value=d.max;break}}}var p=o.length;if(p>2){for(var h,g=2*(e.tickfont?e.tickfont.size:12),v=[],m=i?1:-1,y=i?p-1:0,x=i?0:p-1;m*x<=m*y;x+=m){var b=e.c2p(o[x].value);(void 0===h||Math.abs(b-h)>g)&&(h=b,v.push(o[x]))}o=v.reverse()}}oe(e)&&360===Math.abs(t[1]-t[0])&&o.pop(),e._tmax=(o[o.length-1]||{}).value,e._prevDateHead="",e._inCalcTicks=!0;for(var _=new Array(o.length),k=0;k<o.length;k++){var T=o[k].minor,M=o[k].value;_[k]=S.tickText(e,M,!1,T)}return e._inCalcTicks=!1,_};var R=[2,5,10],I=[1,2,3,6,12],F=[1,2,5,10,15,30],N=[1,2,3,7,14],H=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],B=[-.301,0,.301,.699,1],j=[15,30,45,90,180];function V(e,t,r){return t*l.roundUp(e/t,r)}function q(e){var t=e.dtick;if(e._tickexponent=0,a(t)||"string"==typeof t||(t=1),"category"!==e.type&&"multicategory"!==e.type||(e._tickround=null),"date"===e.type){var r=e.r2l(e.tick0),n=e.l2r(r).replace(/(^-|i)/g,""),i=n.length;if("M"===String(t).charAt(0))i>10||"01-01"!==n.substr(5)?e._tickround="d":e._tickround=+t.substr(1)%12==0?"y":"m";else if(t>=m&&i<=10||t>=15*m)e._tickround="d";else if(t>=x&&i<=16||t>=y)e._tickround="M";else if(t>=b&&i<=19||t>=x)e._tickround="S";else{var o=e.l2r(r+t).replace(/^-/,"").length;e._tickround=Math.max(i,o)-20,e._tickround<0&&(e._tickround=4)}}else if(a(t)||"L"===t.charAt(0)){var l=e.range.map(e.r2d||Number);a(t)||(t=Number(t.substr(1))),e._tickround=2-Math.floor(Math.log(t)/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(e.exponentformat)&&!X(c)?e._tickexponent=3*Math.round((c-1)/3):e._tickexponent=c)}else e._tickround=null}function U(e,t,r){var n=e.tickfont||{};return{x:t,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}S.autoTicks=function(e,t){var r;function n(e){return Math.pow(e,Math.floor(Math.log(t)/Math.LN10))}if("date"===e.type){e.tick0=l.dateTick0(e.calendar);var i=2*t;i>g?(t/=g,r=n(10),e.dtick="M"+12*V(t,r,R)):i>v?(t/=v,e.dtick="M"+V(t,1,I)):i>m?(e.dtick=V(t,m,e._hasDayOfWeekBreaks?[1,7,14]:N),e.tick0=l.dateTick0(e.calendar,!0)):i>y?e.dtick=V(t,y,I):i>x?e.dtick=V(t,x,F):i>b?e.dtick=V(t,b,F):(r=n(10),e.dtick=V(t,r,R))}else if("log"===e.type){e.tick0=0;var o=l.simpleMap(e.range,e.r2l);if(t>.7)e.dtick=Math.ceil(t);else if(Math.abs(o[1]-o[0])<1){var s=1.5*Math.abs((o[1]-o[0])/t);t=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/s,r=n(10),e.dtick="L"+V(t,r,R)}else e.dtick=t>.3?"D2":"D1"}else"category"===e.type||"multicategory"===e.type?(e.tick0=0,e.dtick=Math.ceil(Math.max(t,1))):oe(e)?(e.tick0=0,r=1,e.dtick=V(t,r,j)):(e.tick0=0,r=n(10),e.dtick=V(t,r,R));if(0===e.dtick&&(e.dtick=1),!a(e.dtick)&&"string"!=typeof e.dtick){var c=e.dtick;throw e.dtick=1,"ax.dtick error: "+String(c)}},S.tickIncrement=function(e,t,r,i){var o=r?-1:1;if(a(t))return e+o*t;var s=t.charAt(0),c=o*Number(t.substr(1));if("M"===s)return l.incrementMonth(e,c,i);if("L"===s)return Math.log(Math.pow(10,e)+c)/Math.LN10;if("D"===s){var u="D2"===t?B:H,f=e+.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(t)},S.tickFirst=function(e){var t=e.r2l||Number,r=l.simpleMap(e.range,t),i=r[1]<r[0],o=i?Math.floor:Math.ceil,s=1.0001*r[0]-1e-4*r[1],c=e.dtick,u=t(e.tick0);if(a(c)){var f=o((s-u)/c)*c+u;return"category"!==e.type&&"multicategory"!==e.type||(f=l.constrain(f,0,e._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,e.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,e.calendar),m++}return l.error("tickFirst did not converge",e),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:H,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(e,t,r,n){var i,o=U(e,t),s="array"===e.tickmode,c=r||s,u=e.type,f="category"===u?e.d2l_noadd:e.d2l;if(s&&Array.isArray(e.ticktext)){var d=l.simpleMap(e.range,e.r2l),p=(Math.abs(d[1]-d[0])-(e._lBreaks||0))/1e4;for(i=0;i<e.ticktext.length&&!(Math.abs(t-f(e.tickvals[i]))<p);i++);if(i<e.ticktext.length)return o.text=String(e.ticktext[i]),o}function h(n){if(void 0===n)return!0;if(r)return"none"===n;var a={first:e._tmin,last:e._tmax}[n];return"all"!==n&&t!==a}var g=r?"never":"none"!==e.exponentformat&&h(e.showexponent)?"hide":"";if("date"===u?function(e,t,r,n){var i=e._tickround,o=r&&e.hoverformat||S.getTickFormat(e);n&&(i=a(i)?4:{y:"m",m:"d",d:"M",M:"S",S:4}[i]);var s,c=l.formatDate(t.x,o,i,e._dateFormat,e.calendar,e._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:""):e._inCalcTicks&&s===e._prevDateHead||(c+="<br>"+s,e._prevDateHead=s)),t.text=c}(e,o,r,c):"log"===u?function(e,t,r,n,i){var o=e.dtick,s=t.x,c=e.tickformat,u="string"==typeof o&&o.charAt(0);if("never"===i&&(i=""),n&&"L"!==u&&(o="L3",u="L"),c||"L"===u)t.text=Y(Math.pow(10,s),e,i,n);else if(a(o)||"D"===u&&l.mod(s+.01,1)<.1){var f=Math.round(s),d=Math.abs(f),p=e.exponentformat;"power"===p||Z(p)&&X(f)?(t.text=0===f?1:1===f?"10":"10<sup>"+(f>1?"":_)+d+"</sup>",t.fontSize*=1.25):("e"===p||"E"===p)&&d>2?t.text="1"+p+(f>0?"+":_)+d:(t.text=Y(Math.pow(10,s),e,"","fakehover"),"D1"===o&&"y"===e._id.charAt(0)&&(t.dy-=t.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);t.text=String(Math.round(Math.pow(10,l.mod(s,1)))),t.fontSize*=.75}if("D1"===e.dtick){var h=String(t.text).charAt(0);"0"!==h&&"1"!==h||("y"===e._id.charAt(0)?t.dx-=t.fontSize/4:(t.dy+=t.fontSize/2,t.dx+=(e.range[1]>e.range[0]?1:-1)*t.fontSize*(s<0?.5:.25)))}}(e,o,0,c,g):"category"===u?function(e,t){var r=e._categories[Math.round(t.x)];void 0===r&&(r=""),t.text=String(r)}(e,o):"multicategory"===u?function(e,t,r){var n=Math.round(t.x),a=e._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?t.text=o+" - "+i:(t.text=i,t.text2=o)}(e,o,r):oe(e)?function(e,t,r,n,a){if("radians"!==e.thetaunit||r)t.text=Y(t.x,e,a,n);else{var i=t.x/180;if(0===i)t.text="0";else{var o=function(e){function t(e,t){return Math.abs(e-t)<=1e-6}var r=function(e){for(var r=1;!t(Math.round(e*r)/r,e);)r*=10;return r}(e),n=e*r,a=Math.abs(function e(r,n){return t(n,0)?r:e(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)t.text=Y(l.deg2rad(t.x),e,a,n);else{var s=t.x<0;1===o[1]?1===o[0]?t.text="π":t.text=o[0]+"π":t.text=["<sup>",o[0],"</sup>","⁄","<sub>",o[1],"</sub>","π"].join(""),s&&(t.text=_+t.text)}}}}(e,o,r,c,g):function(e,t,r,n,a){"never"===a?a="":"all"===e.showexponent&&Math.abs(t.x/e.dtick)<1e-6&&(a="hide"),t.text=Y(t.x,e,a,n)}(e,o,0,c,g),n||(e.tickprefix&&!h(e.showtickprefix)&&(o.text=e.tickprefix+o.text),e.ticksuffix&&!h(e.showticksuffix)&&(o.text+=e.ticksuffix)),"boundaries"===e.tickson||e.showdividers){var v=function(t){var r=e.l2p(t);return r>=0&&r<=e._length?t:null};o.xbnd=[v(o.x-.5),v(o.x+e.dtick-.5)]}return o},S.hoverLabelText=function(e,t,r){if(r!==w&&r!==t)return S.hoverLabelText(e,t)+" - "+S.hoverLabelText(e,r);var n="log"===e.type&&t<=0,a=S.tickText(e,e.c2l(n?-t:t),"hover").text;return n?0===t?"0":_+a:a};var G=["f","p","n","μ","m","","k","M","G","T"];function Z(e){return"SI"===e||"B"===e}function X(e){return e>14||e<-15}function Y(e,t,r,n){var i=e<0,o=t._tickround,s=r||t.exponentformat||"B",c=t._tickexponent,u=S.getTickFormat(t),f=t.separatethousands;if(n){var d={exponentformat:s,dtick:"none"===t.showexponent?t.dtick:a(e)&&Math.abs(e)||1,range:"none"===t.showexponent?t.range.map(t.r2d):[0,e||1]};q(d),o=(Number(d._tickround)||0)+4,c=d._tickexponent,t.hoverformat&&(u=t.hoverformat)}if(u)return t._numFormat(u)(e).replace(/-/g,_);var p,h=Math.pow(10,-o)/2;if("none"===s&&(c=0),(e=Math.abs(e))<h)e="0",i=!1;else{if(e+=h,c&&(e*=Math.pow(10,-c),o+=c),0===o)e=String(Math.floor(e));else if(o<0){e=(e=String(Math.round(e))).substr(0,e.length+o);for(var g=o;g<0;g++)e+="0"}else{var v=(e=String(e)).indexOf(".")+1;v&&(e=e.substr(0,v+o).replace(/\.?0+$/,""))}e=l.numSeparate(e,t._separators,f)}return c&&"hide"!==s&&(Z(s)&&X(c)&&(s="power"),p=c<0?_+-c:"power"!==s?"+"+c:String(c),"e"===s||"E"===s?e+=s+p:"power"===s?e+="×10<sup>"+p+"</sup>":"B"===s&&9===c?e+="B":Z(s)&&(e+=G[c/3+5])),i?_+e:e}function W(e,t){for(var r=[],n={},a=0;a<t.length;a++){var i=t[a];n[i.text2]?n[i.text2].push(i.x):n[i.text2]=[i.x]}for(var o in n)r.push(U(e,l.interp(n[o],.5),o));return r}function J(e){return[e.text,e.x,e.axInfo,e.font,e.fontSize,e.fontColor].join("_")}function $(e){var t=e.title.font.size,r=(e.title.text.match(s.BR_TAG_ALL)||[]).length;return e.title.hasOwnProperty("standoff")?r?t*(M+r*A):t*M:r?t*(r+1)*A:t}function Q(e,t){var r=e.l2p(t);return r>1&&r<e._length-1}function K(e){var t=n.select(e),r=t.select(".text-math-group");return r.empty()?t.select("text"):r}function ee(e){return e._id+".automargin"}function te(e){return ee(e)+".mirror"}function re(e){return e._id+".rangeslider"}function ne(e,t){for(var r=0;r<t.length;r++)-1===e.indexOf(t[r])&&e.push(t[r])}function ae(e,t,r){var n,a,i=[],o=[],s=e.layout;for(n=0;n<t.length;n++)i.push(S.getFromId(e,t[n]));for(n=0;n<r.length;n++)o.push(S.getFromId(e,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"),ie(s,p,i,o,e._fullLayout._dfltTitle))}}for(n=0;n<e._fullLayout.annotations.length;n++){var _=e._fullLayout.annotations[n];-1!==t.indexOf(_.xref)&&-1!==r.indexOf(_.yref)&&l.swapAttrs(s.annotations[n],["?"])}}function ie(e,t,r,n,a){var i,o=l.nestedProperty,s=o(e[r[0]._name],t).get(),c=o(e[n[0]._name],t).get();for("title"===t&&(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(e,r[i]._name+"."+t).set(c);for(i=0;i<n.length;i++)o(e,n[i]._name+"."+t).set(s)}function oe(e){return"angularaxis"===e._id}S.getTickFormat=function(e){var t,r,n,a,i,o,l,s;function c(e){return"string"!=typeof e?e:Number(e.replace("M",""))*v}function u(e,t){var r=["L","D"];if(typeof e==typeof t){if("number"==typeof e)return e-t;var n=r.indexOf(e.charAt(0)),a=r.indexOf(t.charAt(0));return n===a?Number(e.replace(/(L|D)/g,""))-Number(t.replace(/(L|D)/g,"")):n-a}return"number"==typeof e?1:-1}function f(e,t){var r=null===t[0],n=null===t[1],a=u(e,t[0])>=0,i=u(e,t[1])<=0;return(r||a)&&(n||i)}if(e.tickformatstops&&e.tickformatstops.length>0)switch(e.type){case"date":case"linear":for(t=0;t<e.tickformatstops.length;t++)if((n=e.tickformatstops[t]).enabled&&(a=e.dtick,o=void 0,void 0,void 0,o=c||function(e){return e},l=(i=n.dtickrange)[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(t=0;t<e.tickformatstops.length;t++)if((n=e.tickformatstops[t]).enabled&&f(e.dtick,n.dtickrange)){r=n;break}}return r?r.value:e.tickformat},S.getSubplots=function(e,t){var r=e._fullLayout._subplots,n=r.cartesian.concat(r.gl2d||[]),a=t?S.findSubplotsWithAxis(n,t):n;return a.sort((function(e,t){var r=e.substr(1).split("y"),n=t.substr(1).split("y");return r[0]===n[0]?+r[1]-+n[1]:+r[0]-+n[0]})),a},S.findSubplotsWithAxis=function(e,t){for(var r=new RegExp("x"===t._id.charAt(0)?"^"+t._id+"y":t._id+"$"),n=[],a=0;a<e.length;a++){var i=e[a];r.test(i)&&n.push(i)}return n},S.makeClipPaths=function(e){var t=e._fullLayout;if(!t._hasOnlyLargeSploms){var r,a,i={_offset:0,_length:t.width,_id:""},o={_offset:0,_length:t.height,_id:""},l=S.list(e,"x",!0),s=S.list(e,"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=t._clips.selectAll(".axesclip").data(c,(function(e){return e.x._id+e.y._id}));u.enter().append("clipPath").classed("axesclip",!0).attr("id",(function(e){return"clip"+t._uid+e.x._id+e.y._id})).append("rect"),u.exit().remove(),u.each((function(e){n.select(this).select("rect").attr({x:e.x._offset||0,y:e.y._offset||0,width:e.x._length||1,height:e.y._length||1})}))}},S.draw=function(e,t,r){var n=e._fullLayout;"redraw"===t&&n._paper.selectAll("g.subplot").each((function(e){var t=e[0],r=n._plots[t],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=t&&"redraw"!==t?t:S.listIds(e);return l.syncOrAsync(a.map((function(t){return function(){if(t){var n=S.getFromId(e,t),a=S.drawOne(e,n,r);return n._r=n.range.slice(),n._rl=l.simpleMap(n._r,n.r2l),a}}})))},S.drawOne=function(e,t,r){var n,a,s;r=r||{},t.setScale();var d=e._fullLayout,p=t._id,h=p.charAt(0),g=S.counterLetter(p),v=d._plots[t._mainSubplot];if(v){var m=v[h+"axislayer"],y=t._mainLinePosition,x=t._mainMirrorPosition,b=t._vals=S.calcTicks(t),_=[t.mirror,y,x].join("_");for(n=0;n<b.length;n++)b[n].axInfo=_;t._selections={},t._tickAngles&&(t._prevTickAngles=t._tickAngles),t._tickAngles={},t._depth=null;var w={};if(t.visible){var k,T,M=S.makeTransFn(t);if("boundaries"===t.tickson){var C=function(e,t){var r,n=[],a=function(e,t){var r=e.xbnd[t];null!==r&&n.push(l.extendFlat({},e,{x:r}))};if(t.length){for(r=0;r<t.length;r++)a(t[r],0);a(t[r-1],1)}return n}(0,b);T=S.clipEnds(t,C),k="inside"===t.ticks?T:C}else T=S.clipEnds(t,b),k="inside"===t.ticks?T:b;var O=t._gridVals=T,P=function(e,t){var r,n,a=[],i=function(e,t){var r=e.xbnd[t];null!==r&&a.push(l.extendFlat({},e,{x:r}))};if(e.showdividers&&t.length){for(r=0;r<t.length;r++){var o=t[r];o.text2!==n&&i(o,0),n=o.text2}i(t[r-1],1)}return a}(t,b);if(!d._hasOnlyLargeSploms){var D=t._subplotsWith,z={};for(n=0;n<D.length;n++){a=D[n];var E=(s=d._plots[a])[g+"axis"],R=E._mainAxis._id;if(!z[R]){z[R]=1;var I="x"===h?"M0,"+E._offset+"v"+E._length:"M"+E._offset+",0h"+E._length;S.drawGrid(e,t,{vals:O,counterAxis:E,layer:s.gridlayer.select("."+p),path:I,transFn:M}),S.drawZeroLine(e,t,{counterAxis:E,layer:s.zerolinelayer,path:I,transFn:M})}}}var F=S.getTickSigns(t),N=[];if(t.ticks){var H,B,j,V=S.makeTickPath(t,y,F[2]);if(t._anchorAxis&&t.mirror&&!0!==t.mirror?(H=S.makeTickPath(t,x,F[3]),B=V+H):(H="",B=V),t.showdividers&&"outside"===t.ticks&&"boundaries"===t.tickson){var q={};for(n=0;n<P.length;n++)q[P[n].x]=1;j=function(e){return q[e.x]?H:B}}else j=B;S.drawTicks(e,t,{vals:k,layer:m,path:j,transFn:M}),"allticks"===t.mirror&&(N=Object.keys(t._linepositions||{}))}for(n=0;n<N.length;n++){a=N[n],s=d._plots[a];var U=t._linepositions[a]||[],G=S.makeTickPath(t,U[0],F[0])+S.makeTickPath(t,U[1],F[1]);S.drawTicks(e,t,{vals:k,layer:s[h+"axislayer"],path:G,transFn:M})}var Z=[];if(Z.push((function(){return S.drawLabels(e,t,{vals:b,layer:m,transFn:M,labelFns:S.makeLabelFns(t,y)})})),"multicategory"===t.type){var X={x:2,y:10}[h];Z.push((function(){var r={x:"height",y:"width"}[h],n=Q()[r]+X+(t._tickAngles[p+"tick"]?t.tickfont.size*A:0);return S.drawLabels(e,t,{vals:W(t,b),layer:m,cls:p+"tick2",repositionOnUpdate:!0,secondary:!0,transFn:M,labelFns:S.makeLabelFns(t,y+n*F[4])})})),Z.push((function(){return t._depth=F[4]*(Q("tick2")[t.side]-y),function(e,t,r){var n=t._id+"divider",a=r.vals,i=r.layer.selectAll("path."+n).data(a,J);i.exit().remove(),i.enter().insert("path",":first-child").classed(n,1).classed("crisp",1).call(u.stroke,t.dividercolor).style("stroke-width",f.crispRound(e,t.dividerwidth,1)+"px"),i.attr("transform",r.transFn).attr("d",r.path)}(e,t,{vals:P,layer:m,path:S.makeTickPath(t,y,F[4],t._depth),transFn:M})}))}else t.title.hasOwnProperty("standoff")&&Z.push((function(){t._depth=F[4]*(Q()[t.side]-y)}));var Y=o.getComponentMethod("rangeslider","isVisible")(t);return Z.push((function(){var r,n,a,l,s=t.side.charAt(0),c=L[t.side].charAt(0),u=S.getPxPosition(e,t),f="outside"===t.ticks?t.ticklen:0;if((t.automargin||Y)&&("multicategory"===t.type?r=Q("tick2"):(r=Q(),"x"===h&&"b"===s&&(t._depth=Math.max(r.width>0?r.bottom-u:0,f)))),t.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]=t._depth:(n[s]=t._depth=Math.max(r.width>0?u-r.top:0,f),p.reverse()),r.width>0){var v=r.right-(t._offset+t._length);v>0&&(n.xr=1,n.r=v);var m=t._offset-r.left;m>0&&(n.xl=0,n.l=m)}}else if("l"===s?n[s]=t._depth=Math.max(r.height>0?u-r.left:0,f):(n[s]=t._depth=Math.max(r.height>0?r.right-u:0,f),p.reverse()),r.height>0){var y=r.bottom-(t._offset+t._length);y>0&&(n.yb=0,n.b=y);var x=t._offset-r.top;x>0&&(n.yt=1,n.t=x)}n[g]="free"===t.anchor?t.position:t._anchorAxis.domain[p[0]],t.title.text!==d._dfltTitle[h]&&(n[s]+=$(t)+(t.title.standoff||0)),t.mirror&&"free"!==t.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[c]=t.linewidth,t.mirror&&!0!==t.mirror&&(a[c]+=f),!0===t.mirror||"ticks"===t.mirror?a[g]=t._anchorAxis.domain[p[1]]:"all"!==t.mirror&&"allticks"!==t.mirror||(a[g]=[t._counterDomainMin,t._counterDomainMax][p[1]]))}Y&&(l=o.getComponentMethod("rangeslider","autoMarginOpts")(e,t)),i.autoMargin(e,ee(t),n),i.autoMargin(e,te(t),a),i.autoMargin(e,re(t),l)})),r.skipTitle||Y&&"bottom"===t.side||Z.push((function(){return function(e,t){var r,n=e._fullLayout,a=t._id,i=a.charAt(0),o=t.title.font.size;t.title.hasOwnProperty("standoff")?r=t._depth+t.title.standoff+$(t):(r="multicategory"===t.type?t._depth:10+1.5*o+(t.linewidth?t.linewidth-1:0),r+="x"===i?"top"===t.side?o*(t.showticklabels?1:0):o*(t.showticklabels?1.5:.5):"right"===t.side?o*(t.showticklabels?1:.5):o*(t.showticklabels?.5:0));var l,s,u,d,p=S.getPxPosition(e,t);if("x"===i?(s=t._offset+t._length/2,u="top"===t.side?p-r:p+r):(u=t._offset+t._length/2,s="right"===t.side?p+r:p-r,l={rotate:"-90",offset:0}),"multicategory"!==t.type){var h=t._selections[t._id+"tick"];if(d={selection:h,side:t.side},h&&h.node()&&h.node().parentNode){var g=f.getTranslate(h.node().parentNode);d.offsetLeft=g.x,d.offsetTop=g.y}t.title.hasOwnProperty("standoff")&&(d.pad=0)}return c.draw(e,a+"title",{propContainer:t,propName:t._name+".title.text",placeholder:n._dfltTitle[i],avoid:d,transform:l,attributes:{x:s,y:u,"text-anchor":"middle"}})}(e,t)})),l.syncOrAsync(Z)}}function Q(e){var r=p+(e||"tick");return w[r]||(w[r]=function(e,t){var r,n,a,i;return e._selections[t].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,e._selections[t].each((function(){var e=K(this),t=f.bBox(e.node().parentNode);r=Math.min(r,t.top),n=Math.max(n,t.bottom),a=Math.min(a,t.left),i=Math.max(i,t.right)}))):(r=0,n=0,a=0,i=0),{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(t,r)),w[r]}},S.getTickSigns=function(e){var t=e._id.charAt(0),r={x:"top",y:"right"}[t],n=e.side===r?1:-1,a=[-1,1,n,-n];return"inside"!==e.ticks==("x"===t)&&(a=a.map((function(e){return-e}))),e.side&&a.push({l:-1,t:-1,r:1,b:1}[e.side.charAt(0)]),a},S.makeTransFn=function(e){var t=e._id.charAt(0),r=e._offset;return"x"===t?function(t){return"translate("+(r+e.l2p(t.x))+",0)"}:function(t){return"translate(0,"+(r+e.l2p(t.x))+")"}},S.makeTickPath=function(e,t,r,n){n=void 0!==n?n:e.ticklen;var a=e._id.charAt(0),i=(e.linewidth||1)/2;return"x"===a?"M0,"+(t+i*r)+"v"+n*r:"M"+(t+i*r)+",0h"+n*r},S.makeLabelFns=function(e,t,r){var n=e._id.charAt(0),i="boundaries"!==e.tickson&&"outside"===e.ticks,o=0,s=0;if(i&&(o+=e.ticklen),r&&"outside"===e.ticks){var c=l.deg2rad(r);o=e.ticklen*Math.cos(c)+1,s=e.ticklen*Math.sin(c)}e.showticklabels&&(i||e.showline)&&(o+=.2*e.tickfont.size);var u,f,d,p,h={labelStandoff:o+=(e.linewidth||1)/2,labelShift:s};return"x"===n?(p="bottom"===e.side?1:-1,u=s*p,f=t+o*p,d="bottom"===e.side?1:-.2,h.xFn=function(e){return e.dx+u},h.yFn=function(e){return e.dy+f+e.fontSize*d},h.anchorFn=function(e,t){return a(t)&&0!==t&&180!==t?t*p<0?"end":"start":"middle"},h.heightFn=function(t,r,n){return r<-60||r>60?-.5*n:"top"===e.side?-n:0}):"y"===n&&(p="right"===e.side?1:-1,u=o,f=-s*p,d=90===Math.abs(e.tickangle)?.5:0,h.xFn=function(e){return e.dx+t+(u+e.fontSize*d)*p},h.yFn=function(e){return e.dy+f+e.fontSize*T},h.anchorFn=function(t,r){return a(r)&&90===Math.abs(r)?"middle":"right"===e.side?"start":"end"},h.heightFn=function(t,r,n){return(r*="left"===e.side?1:-1)<-30?-n:r<30?-.5*n:0}),h},S.drawTicks=function(e,t,r){r=r||{};var n=t._id+"tick",a=r.layer.selectAll("path."+n).data(t.ticks?r.vals:[],J);a.exit().remove(),a.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(u.stroke,t.tickcolor).style("stroke-width",f.crispRound(e,t.tickwidth,1)+"px").attr("d",r.path),a.attr("transform",r.transFn)},S.drawGrid=function(e,t,r){r=r||{};var n=t._id+"grid",a=r.vals,i=r.counterAxis;if(!1===t.showgrid)a=[];else if(i&&S.shouldShowZeroLine(e,t,i))for(var o="array"===t.tickmode,l=0;l<a.length;l++){var s=a[l].x;if(o?!s:Math.abs(s)<t.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,J);c.exit().remove(),c.enter().append("path").classed(n,1).classed("crisp",!1!==r.crisp),t._gw=f.crispRound(e,t.gridwidth,1),c.attr("transform",r.transFn).attr("d",r.path).call(u.stroke,t.gridcolor||"#ddd").style("stroke-width",t._gw+"px"),"function"==typeof r.path&&c.attr("d",r.path)},S.drawZeroLine=function(e,t,r){r=r||r;var n=t._id+"zl",a=S.shouldShowZeroLine(e,t,r.counterAxis),i=r.layer.selectAll("path."+n).data(a?[{x:0,id:t._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(e,t){return O.idSort(e.id,t.id)}))})),i.attr("transform",r.transFn).attr("d",r.path).call(u.stroke,t.zerolinecolor||u.defaultLine).style("stroke-width",f.crispRound(e,t.zerolinewidth,t._gw||1)+"px")},S.drawLabels=function(e,t,r){r=r||{};var i=e._fullLayout,o=t._id,c=o.charAt(0),u=r.cls||o+"tick",d=r.vals,p=r.labelFns,h=r.secondary?0:t.tickangle,g=(t._prevTickAngles||{})[u],v=r.layer.selectAll("g."+u).data(t.showticklabels?d:[],J),m=[];function y(e,t){e.each((function(e){var i=n.select(this),o=i.select(".text-math-group"),l=p.anchorFn(e,t),c=r.transFn.call(i.node(),e)+(a(t)&&0!=+t?" rotate("+t+","+p.xFn(e)+","+(p.yFn(e)-e.fontSize/2)+")":""),u=s.lineCount(i),d=A*e.fontSize,h=p.heightFn(e,a(t)?+t: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(t){var r=n.select(this),a=e._promises.length;r.call(s.positionText,p.xFn(t),p.yFn(t)).call(f.font,t.font,t.fontSize,t.fontColor).text(t.text).call(s.convertToTspans,e),e._promises[a]?m.push(e._promises.pop().then((function(){y(r,h)}))):y(r,h)})),v.exit().remove(),r.repositionOnUpdate&&v.each((function(e){n.select(this).select("text").call(s.positionText,p.xFn(e),p.yFn(e))})),y(v,g+1?g:h);var x=null;t._selections&&(t._selections[u]=v);var b=[function(){return m.length&&Promise.all(m)}];t.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"!==t.type||"D"!==String(t.dtick).charAt(0))){x=0;var e,n=0,i=[];if(v.each((function(e){n=Math.max(n,e.fontSize);var r=t.l2p(e.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"!==t.tickson&&!t.showdividers||r.secondary){var o=d.length,s=Math.abs((d[o-1].x-d[0].x)*t._m)/(o-1)<2.5*n||"multicategory"===t.type;for(e=0;e<i.length-1;e++)if(l.bBoxIntersect(i[e],i[e+1])){x=s?90:30;break}}else{var u=2;for(t.ticks&&(u+=t.tickwidth/2),e=0;e<i.length;e++){var p=d[e].xbnd,g=i[e];if(null!==p[0]&&g.left-t.l2p(p[0])<u||null!==p[1]&&t.l2p(p[1])-g.right<u){x=90;break}}}x&&y(v,x)}})),t._tickAngles&&b.push((function(){t._tickAngles[u]=null===x?a(h)?h:0:x}));var _=l.syncOrAsync(b);return _&&_.then&&e._promises.push(_),_},S.getPxPosition=function(e,t){var r,n=e._fullLayout._size,a=t._id.charAt(0),i=t.side;return"free"!==t.anchor?r=t._anchorAxis:"x"===a?r={_offset:n.t+(1-(t.position||0))*n.h,_length:0}:"y"===a&&(r={_offset:n.l+(t.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(e,t,r){var n=l.simpleMap(t.range,t.r2l);return n[0]*n[1]<=0&&t.zeroline&&("linear"===t.type||"-"===t.type)&&!(t.rangebreaks&&t.maskBreaks(0)===w)&&(Q(t,0)||!function(e,t,r,n){var a=r._mainAxis;if(a){var i=e._fullLayout,o=t._id.charAt(0),l=S.counterLetter(t._id),s=t._offset+(Math.abs(n[0])<Math.abs(n[1])==("x"===o)?0:t._length),c=i._plots[r._mainSubplot];if(!(c.mainplotinfo||c).overlays.length)return p(r);for(var u=S.list(e,l),f=0;f<u.length;f++){var d=u[f];if(d._mainAxis===a&&p(d))return!0}}function p(e){if(!e.showline||!e.linewidth)return!1;var r=Math.max((e.linewidth+t.zerolinewidth)/2,1);function n(e){return"number"==typeof e&&Math.abs(e-s)<r}if(n(e._mainLinePosition)||n(e._mainMirrorPosition))return!0;var a=e._linepositions||{};for(var i in a)if(n(a[i][0])||n(a[i][1]))return!0}}(e,t,r,n)||function(e,t){for(var r=e._fullData,n=t._mainSubplot,a=t._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}(e,t))},S.clipEnds=function(e,t){return t.filter((function(t){return Q(e,t.x)}))},S.allowAutoMargin=function(e){for(var t=S.list(e,"",!0),r=0;r<t.length;r++){var n=t[r];n.automargin&&(i.allowAutoMargin(e,ee(n)),n.mirror&&i.allowAutoMargin(e,te(n))),o.getComponentMethod("rangeslider","isVisible")(n)&&i.allowAutoMargin(e,re(n))}},S.swap=function(e,t){for(var r=function(e,t){var r,n,a=[];for(r=0;r<t.length;r++){var i=[],o=e._fullData[t[r]].xaxis,l=e._fullData[t[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]],ne(c.x,s.x),ne(c.y,s.y);ne(c.x,[o]),ne(c.y,[l])}else a.push({x:[o],y:[l]})}}return a}(e,t),n=0;n<r.length;n++)ae(e,r[n].x,r[n].y)}},{"../../components/color":43,"../../components/drawing":65,"../../components/titles":138,"../../constants/alignment":145,"../../constants/numerical":148,"../../lib":168,"../../lib/svg_text_utils":189,"../../plots/plots":246,"../../registry":254,"./autorange":211,"./axis_autotype":213,"./axis_ids":215,"./clean_ticks":217,"./layout_attributes":226,"./set_convert":232,d3:7,"fast-isnumeric":9}],213:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("../../constants/numerical").BADNUM;t.exports=function(e,t,r){return!(r=r||{}).noMultiCategory&&(o=e,a.isArrayOrTypedArray(o[0])&&a.isArrayOrTypedArray(o[1]))?"multicategory":function(e,t){for(var r=Math.max(1,(e.length-1)/1e3),i=0,o=0,l={},s=0;s<e.length;s+=r){var c=e[Math.round(s)],u=String(c);l[u]||(l[u]=1,a.isDateTime(c,t)&&(i+=1),n(c)&&(o+=1))}return i>2*o}(e,t)?"date":function(e){for(var t=Math.max(1,(e.length-1)/1e3),r=0,n=0,o={},l=0;l<e.length;l+=t){var s=e[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}(e)?"category":function(e){if(!e)return!1;for(var t=0;t<e.length;t++)if(n(e[t]))return!0;return!1}(e)?"linear":"-";var o}},{"../../constants/numerical":148,"../../lib":168,"fast-isnumeric":9}],214:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../registry"),i=e("../../lib"),o=e("../array_container_defaults"),l=e("./layout_attributes"),s=e("./tick_value_defaults"),c=e("./tick_mark_defaults"),u=e("./tick_label_defaults"),f=e("./category_order_defaults"),d=e("./line_grid_defaults"),p=e("./set_convert"),h=e("./constants").WEEKDAY_PATTERN,g=e("./constants").HOUR_PATTERN;function v(e,t,r){function a(r,n){return i.coerce(e,t,l.rangebreaks,r,n)}if(a("enabled")){var o=a("bounds");if(o&&o.length>=2){var s,c,u="";if(2===o.length)for(s=0;s<2;s++)if(c=y(o[s])){u=h;break}var f=a("pattern",u);if(f===h)for(s=0;s<2;s++)(c=y(o[s]))&&(t.bounds[s]=o[s]=c-1);if(f)for(s=0;s<2;s++)switch(c=o[s],f){case h:if(!n(c))return void(t.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(t.enabled=!1);t.bounds[s]=o[s]=c;break;case g:if(!n(c))return void(t.enabled=!1);if((c=+c)<0||c>24)return void(t.enabled=!1);t.bounds[s]=o[s]=c}if(!1===r.autorange){var d=r.range;if(d[0]<d[1]){if(o[0]<d[0]&&o[1]>d[1])return void(t.enabled=!1)}else if(o[0]>d[0]&&o[1]<d[1])return void(t.enabled=!1)}}else{var p=a("values");if(!p||!p.length)return void(t.enabled=!1);a("dvalue")}}}t.exports=function(e,t,r,n,g){var m=n.letter,y=n.font||{},x=n.splomStash||{},b=r("visible",!n.visibleDflt),_=t._template||{},w=t.type||_.type||"-";"date"===w&&a.getComponentMethod("calendars","handleDefaults")(e,t,"calendar",n.calendar),p(t,g);var k=!t.isValidRange(e.range);k&&n.reverseDflt&&(k="reversed"),!r("autorange",k)||"linear"!==w&&"-"!==w||r("rangemode"),r("range"),t.cleanRange(),f(e,t,r,n),"category"===w||n.noHover||r("hoverformat");var T=r("color"),M=T!==l.color.dflt?T:y.color,A=x.label||g._dfltTitle[m];if(u(e,t,r,w,n,{pass:1}),!b)return t;r("title.text",A),i.coerceFont(r,"title.font",{family:y.family,size:Math.round(1.2*y.size),color:M}),s(e,t,r,w),u(e,t,r,w,n,{pass:2}),c(e,t,r,n),d(e,t,r,{dfltColor:T,bgColor:n.bgColor,showGrid:n.showGrid,attributes:l}),(t.showline||t.ticks)&&r("mirror"),n.automargin&&r("automargin");var L,S="multicategory"===w;if(n.noTickson||"category"!==w&&!S||!t.ticks&&!t.showgrid||(S&&(L="boundaries"),r("tickson",L)),S&&r("showdividers")&&(r("dividercolor"),r("dividerwidth")),"date"===w)if(o(e,t,{name:"rangebreaks",inclusionAttr:"enabled",handleItemDefaults:v}),t.rangebreaks.length){for(var C=0;C<t.rangebreaks.length;C++)if(t.rangebreaks[C].pattern===h){t._hasDayOfWeekBreaks=!0;break}if(p(t,g),g._has("scattergl")||g._has("splom"))for(var O=0;O<n.data.length;O++){var P=n.data[O];"scattergl"!==P.type&&"splom"!==P.type||(P.visible=!1,i.warn(P.type+" traces do not work on axes with rangebreaks. Setting trace "+P.index+" to `visible: false`."))}}else delete t.rangebreaks;return t};var m={sun:1,mon:2,tue:3,wed:4,thu:5,fri:6,sat:7};function y(e){if("string"==typeof e)return m[e.substr(0,3).toLowerCase()]}},{"../../lib":168,"../../registry":254,"../array_container_defaults":208,"./category_order_defaults":216,"./constants":218,"./layout_attributes":226,"./line_grid_defaults":228,"./set_convert":232,"./tick_label_defaults":233,"./tick_mark_defaults":234,"./tick_value_defaults":235,"fast-isnumeric":9}],215:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("./constants");r.id2name=function(e){if("string"==typeof e&&e.match(a.AX_ID_PATTERN)){var t=e.substr(1);return"1"===t&&(t=""),e.charAt(0)+"axis"+t}},r.name2id=function(e){if(e.match(a.AX_NAME_PATTERN)){var t=e.substr(5);return"1"===t&&(t=""),e.charAt(0)+t}},r.cleanId=function(e,t){if(e.match(a.AX_ID_PATTERN)&&(!t||e.charAt(0)===t)){var r=e.substr(1).replace(/^0+/,"");return"1"===r&&(r=""),e.charAt(0)+r}},r.list=function(e,t,n){var a=e._fullLayout;if(!a)return[];var i,o=r.listIds(e,t),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]];t?l.push(u[t+"axis"]):l.push(u.xaxis,u.yaxis,u.zaxis)}}return l},r.listIds=function(e,t){var r=e._fullLayout;if(!r)return[];var n=r._subplots;return t?n[t+"axis"]:n.xaxis.concat(n.yaxis)},r.getFromId=function(e,t,n){var a=e._fullLayout;return"x"===n?t=t.replace(/y[0-9]*/,""):"y"===n&&(t=t.replace(/x[0-9]*/,"")),a[r.id2name(t)]},r.getFromTrace=function(e,t,a){var i=e._fullLayout,o=null;if(n.traceIs(t,"gl3d")){var l=t.scene;"scene"===l.substr(0,5)&&(o=i[l][a+"axis"])}else o=r.getFromId(e,t[a+"axis"]||a);return o},r.idSort=function(e,t){var r=e.charAt(0),n=t.charAt(0);return r!==n?r>n?1:-1:+(e.substr(1)||1)-+(t.substr(1)||1)},r.getAxisGroup=function(e,t){for(var r=e._axisMatchGroups,n=0;n<r.length;n++)if(r[n][t])return"g"+n;return t}},{"../../registry":254,"./constants":218}],216:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){if("category"===t.type){var a,i=e.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=t.categoryorder="trace"),"trace"===s?t._initialCategories=[]:"array"===s?t._initialCategories=l.slice():(l=function(e,t){var r,n,a,i=t.dataAttr||e._id.charAt(0),o={};if(t.axData)r=t.axData;else for(r=[],n=0;n<t.data.length;n++){var l=t.data[n];l[i+"axis"]===e._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)}(t,n).sort(),"category ascending"===s?t._initialCategories=l:"category descending"===s&&(t._initialCategories=l.reverse()))}}},{}],217:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("../../constants/numerical").ONEDAY;r.dtick=function(e,t){var r="log"===t,a="date"===t,o="category"===t,l=a?i:1;if(!e)return l;if(n(e))return(e=Number(e))<=0?l:o?Math.max(1,Math.round(e)):a?Math.max(.1,e):e;if("string"!=typeof e||!a&&!r)return l;var s=e.charAt(0),c=e.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:e},r.tick0=function(e,t,r,i){return"date"===t?a.cleanDate(e,a.dateTick0(r)):"D1"!==i&&"D2"!==i?n(e)?Number(e):0:void 0}},{"../../constants/numerical":148,"../../lib":168,"fast-isnumeric":9}],218:[function(e,t,r){"use strict";var n=e("../../lib/regex").counter;t.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]*)$/,HOUR_PATTERN:"hour",WEEKDAY_PATTERN:"day of week",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":183}],219:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./axis_ids").id2name,i=e("./scale_zoom"),o=e("./autorange").makePadFn,l=e("./autorange").concatExtremes,s=e("../../constants/numerical").ALMOST_EQUAL,c=e("../../constants/alignment").FROM_BL;function u(e,t,r,n,i){var o,l,s,c,u="range"!==i,f=n[a(t)].type,d=[];for(l=0;l<r.length;l++)(s=r[l])!==t&&(c=n[a(s)]).type===f&&(c.fixedrange?u&&c.anchor&&n[a(c.anchor)].fixedrange&&d.push(s):d.push(s));for(o=0;o<e.length;o++)if(e[o][t]){var p=e[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(e,t,r,n,a){var i,o,l,s,c;null===t?((t={})[r]=1,c=e.length,e.push(t)):c=e.indexOf(t);var u=Object.keys(t);for(i=0;i<e.length;i++)if(l=e[i],i!==c&&l[n]){var f=l[n];for(o=0;o<u.length;o++)l[s=u[o]]=f*a*t[s];return void e.splice(c,1)}if(1!==a)for(o=0;o<u.length;o++)t[u[o]]*=a;t[n]=1}function d(e,t){var r=e._inputDomain,n=c[e.constraintoward],a=r[0]+(r[1]-r[0])*n;e.domain=e._input.domain=[a+(r[0]-a)/t,a+(r[1]-a)/t],e.setScale()}r.handleConstraintDefaults=function(e,t,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=t._id,y=m.charAt(0),x=((d._splomAxes||{})[y]||{})[m]||{},b=t._id,_=b.charAt(0),w=r("constrain",h);if(n.coerce(e,t,{constraintoward:{valType:"enumerated",values:"x"===_?["left","center","right"]:["bottom","middle","top"],dflt:"x"===_?"center":"middle"}},"constraintoward"),!e.matches&&!x.matches||t.fixedrange||(o=u(v,b,c,d),i=n.coerce(e,t,{matches:{valType:"enumerated",values:o.linkableAxes||[],dflt:x.matches}},"matches")),i||t.fixedrange&&"domain"!==w||!e.scaleanchor&&!p||(s=u(g,b,c,d,w),l=n.coerce(e,t,{scaleanchor:{valType:"enumerated",values:s.linkableAxes||[]}},"scaleanchor",p)),i?(delete t.constrain,f(v,o.thisGroup,b,i,1)):-1!==c.indexOf(e.matches)&&n.warn("ignored "+t._name+'.matches: "'+e.matches+'" to avoid either an infinite loop or because the target axis has fixed range.'),l){var k=r("scaleratio");k||(k=t.scaleratio=1),f(g,s.thisGroup,b,l,k)}else-1!==c.indexOf(e.scaleanchor)&&n.warn("ignored "+t._name+'.scaleanchor: "'+e.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(e){var t,r,n,c,u,f,p,h=e._fullLayout,g=h._axisConstraintGroups||[];for(t=0;t<g.length;t++){var v=g[t],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,E=C+D*p*1.0001,R=o(c);d(c,p);var I,F,N=Math.abs(c._m),H=l(e,c),B=H.min,j=H.max;for(F=0;F<B.length;F++)(I=B[F].val-R(B[F])/N)>z&&I<O&&(O=I);for(F=0;F<j.length;F++)(I=j[F].val+R(j[F])/N)<E&&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(e,t){if(t._inputDomain){for(var r=!1,n=t._id,a=e._fullLayout._axisConstraintGroups,i=0;i<a.length;i++)if(a[i][n]){r=!0;break}r&&"domain"===t.constrain||(t._input.domain=t.domain=t._inputDomain,delete t._inputDomain)}}},{"../../constants/alignment":145,"../../constants/numerical":148,"../../lib":168,"./autorange":211,"./axis_ids":215,"./scale_zoom":230}],220:[function(e,t,r){"use strict";var n=e("d3"),a=e("tinycolor2"),i=e("has-passive-events"),o=e("../../registry"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../components/color"),u=e("../../components/drawing"),f=e("../../components/fx"),d=e("./axes"),p=e("../../lib/setcursor"),h=e("../../components/dragelement"),g=e("../../components/dragelement/helpers"),v=g.selectingOrDrawing,m=g.freeMode,y=e("../../constants/alignment").FROM_TL,x=e("../../lib/clear_gl_canvases"),b=e("../../plot_api/subroutines").redrawReglTraces,_=e("../plots"),w=e("./axis_ids").getFromId,k=e("./select").prepSelect,T=e("./select").clearSelect,M=e("./select").selectOnClick,A=e("./scale_zoom"),L=e("./constants"),S=L.MINDRAG,C=L.MINZOOM,O=!0;function P(e,t,r,n){var a=l.ensureSingle(e.draglayer,t,r,(function(t){t.classed("drag",!0).style({fill:"transparent","stroke-width":0}).attr("data-subplot",e.id)}));return a.call(p,n),a.node()}function D(e,t,r,a,i,o,l){var s=P(e,"rect",t,r);return n.select(s).call(u.setRect,a,i,o,l),s}function z(e,t){for(var r=0;r<e.length;r++)if(!e[r].fixedrange)return t;return""}function E(e,t,r,n,a){for(var i=0;i<e.length;i++){var o=e[i];if(!o.fixedrange)if(o.rangebreaks){var l="y"===o._id.charAt(0),s=l?1-t:t,c=l?1-r:r;n[o._name+".range[0]"]=o.l2r(o.p2l(s*o._length)),n[o._name+".range[1]"]=o.l2r(o.p2l(c*o._length))}else{var u=o._rl[0],f=o._rl[1]-u;n[o._name+".range[0]"]=o.l2r(u+f*t),n[o._name+".range[1]"]=o.l2r(u+f*r)}}if(a&&a.length){var d=(t+(1-r))/2;E(a,d,1-d,n,[])}}function R(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(!n.fixedrange)if(n.rangebreaks){var a=n._length,i=(n.p2l(0+t)-n.p2l(0)+(n.p2l(a+t)-n.p2l(a)))/2;n.range=[n.l2r(n._rl[0]-i),n.l2r(n._rl[1]-i)]}else n.range=[n.l2r(n._rl[0]-t/n._m),n.l2r(n._rl[1]-t/n._m)]}}function I(e){return 1-(e>=0?Math.min(e,.9):1/(1/Math.max(e,-.3)+3.222))}function F(e,t,r,n,a){return e.append("path").attr("class","zoombox").style({fill:t>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",a+"Z")}function N(e,t,r){return e.append("path").attr("class","zoombox-corners").style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+t+", "+r+")").attr("d","M0,0Z")}function H(e,t,r,n,a,i){e.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),B(e,t,a,i)}function B(e,t,r,n){r||(e.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),t.transition().style("opacity",1).duration(200))}function j(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function V(e){O&&e.data&&e._context.showTips&&(l.notifier(l._(e,"Double-click to zoom back out"),"long"),O=!1)}function q(e){var t=Math.floor(Math.min(e.b-e.t,e.r-e.l,C)/2);return"M"+(e.l-3.5)+","+(e.t-.5+t)+"h3v"+-t+"h"+t+"v-3h-"+(t+3)+"ZM"+(e.r+3.5)+","+(e.t-.5+t)+"h-3v"+-t+"h"+-t+"v-3h"+(t+3)+"ZM"+(e.r+3.5)+","+(e.b+.5-t)+"h-3v"+t+"h"+-t+"v3h"+(t+3)+"ZM"+(e.l-3.5)+","+(e.b+.5-t)+"h3v"+t+"h"+t+"v3h-"+(t+3)+"Z"}function U(e,t,r,n){for(var a,i,o,s,c=!1,u={},f={},d=0;d<t.length;d++){var p=t[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=w(e,o);g.push(v),h[v._id]=v}var m={},y=[];for(s in f){var x=w(e,s);y.push(x),m[x._id]=x}return{xaHash:h,yaHash:m,xaxes:g,yaxes:y,xLinks:u,yLinks:f,isSubplotConstrained:c}}function G(e,t){if(i){var r=void 0!==e.onwheel?"wheel":"mousewheel";e._onwheel&&e.removeEventListener(r,e._onwheel),e._onwheel=t,e.addEventListener(r,t,{passive:!1})}else void 0!==e.onwheel?e.onwheel=t:void 0!==e.onmousewheel&&(e.onmousewheel=t)}function Z(e){var t=[];for(var r in e)t.push(e[r]);return t}t.exports={makeDragBox:function(e,t,r,i,c,p,g,O){var P,B,X,Y,W,J,$,Q,K,ee,te,re,ne,ae,ie,oe,le,se,ce,ue,fe,de=e._fullLayout._zoomlayer,pe=g+O==="nsew",he=1===(g+O).length;function ge(){if(P=t.xaxis,B=t.yaxis,K=P._length,ee=B._length,$=P._offset,Q=B._offset,(X={})[P._id]=P,(Y={})[B._id]=B,g&&O)for(var r=t.overlays,n=0;n<r.length;n++){var a=r[n].xaxis;X[a._id]=a;var i=r[n].yaxis;Y[i._id]=i}W=Z(X),J=Z(Y),ne=z(W,O),ae=z(J,g),ie=!ae&&!ne,te=U(e,e._fullLayout._axisConstraintGroups,X,Y),re=U(e,e._fullLayout._axisMatchGroups,X,Y),oe=O||te.isSubplotConstrained||re.isSubplotConstrained,le=g||te.isSubplotConstrained||re.isSubplotConstrained;var o=e._fullLayout;se=o._has("scattergl"),ce=o._has("splom"),ue=o._has("svg")}ge();var ve=function(e,t,r){return e?"nsew"===e?"pan"===t?"move":"crosshair":e.toLowerCase()+"-resize":"pointer"}(ae+ne,e._fullLayout.dragmode),me=D(t,g+O+"drag",ve,r,i,c,p);if(ie&&!pe)return me.onmousedown=null,me.style.pointerEvents="none",me;var ye,xe,be,_e,we,ke,Te,Me,Ae,Le,Se={element:me,gd:e,plotinfo:t};function Ce(){Se.plotinfo.selection=!1,T(e)}function Oe(e,r){var a=Se.gd;if(a._fullLayout._activeShapeIndex>=0)a._fullLayout._deactivateShape(a);else{var i=a._fullLayout.clickmode;if(j(a),2!==e||he||je(),pe)i.indexOf("select")>-1&&M(r,a,W,J,t.id,Se),i.indexOf("event")>-1&&f.click(a,r,t.id);else if(1===e&&he){var l=g?B:P,c="s"===g||"w"===O?0:1,u=l._name+".range["+c+"]",d=function(e,t){var r,a=e.range[t],i=Math.abs(a-e.range[1-t]);return"date"===e.type?a:"log"===e.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;g?(h="n"===g?"top":"bottom","right"===l.side&&(p="right")):"e"===O&&(p="right"),a._context.showAxisRangeEntryBoxes&&n.select(me).call(s.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(d),fill:l.tickfont?l.tickfont.color:"#444",horizontalAlign:p,verticalAlign:h}).on("edit",(function(e){var t=l.d2r(e);void 0!==t&&o.call("_guiRelayout",a,u,t)}))}}}function Pe(t,r){if(e._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(K,t+ye)),a=Math.max(0,Math.min(ee,r+xe)),i=Math.abs(n-ye),o=Math.abs(a-xe);function l(){Te="",be.r=be.l,be.t=be.b,Ae.attr("d","M0,0Z")}if(be.l=Math.min(ye,n),be.r=Math.max(ye,n),be.t=Math.min(xe,a),be.b=Math.max(xe,a),te.isSubplotConstrained)i>C||o>C?(Te="xy",i/K>o/ee?(o=i*ee/K,xe>a?be.t=xe-o:be.b=xe+o):(i=o*K/ee,ye>n?be.l=ye-i:be.r=ye+i),Ae.attr("d",q(be))):l();else if(re.isSubplotConstrained)if(i>C||o>C){Te="xy";var s=Math.min(be.l/K,(ee-be.b)/ee),c=Math.max(be.r/K,(ee-be.t)/ee);be.l=s*K,be.r=c*K,be.b=(1-s)*ee,be.t=(1-c)*ee,Ae.attr("d",q(be))}else l();else!ae||o<Math.min(Math.max(.6*i,S),C)?i<S||!ne?l():(be.t=0,be.b=ee,Te="x",Ae.attr("d",function(e,t){return"M"+(e.l-.5)+","+(t-C-.5)+"h-3v"+(2*C+1)+"h3ZM"+(e.r+.5)+","+(t-C-.5)+"h3v"+(2*C+1)+"h-3Z"}(be,xe))):!ne||i<Math.min(.6*o,C)?(be.l=0,be.r=K,Te="y",Ae.attr("d",function(e,t){return"M"+(t-C-.5)+","+(e.t-.5)+"v-3h"+(2*C+1)+"v3ZM"+(t-C-.5)+","+(e.b+.5)+"v3h"+(2*C+1)+"v-3Z"}(be,ye))):(Te="xy",Ae.attr("d",q(be)));be.w=be.r-be.l,be.h=be.b-be.t,Te&&(Le=!0),e._dragged=Le,H(Me,Ae,be,we,ke,_e),De(),e.emit("plotly_relayouting",fe),ke=!0}function De(){fe={},"xy"!==Te&&"x"!==Te||(E(W,be.l/K,be.r/K,fe,te.xaxes),He("x",fe)),"xy"!==Te&&"y"!==Te||(E(J,(ee-be.b)/ee,(ee-be.t)/ee,fe,te.yaxes),He("y",fe))}function ze(){De(),j(e),Ve(),V(e)}Se.prepFn=function(t,r,n){var i=Se.dragmode,o=e._fullLayout.dragmode;o!==i&&(Se.dragmode=o),ge(),ie||(pe?t.shiftKey?"pan"===o?o="zoom":v(o)||(o="pan"):t.ctrlKey&&(o="pan"):o="pan"),m(o)?Se.minDrag=1:Se.minDrag=void 0,v(o)?(Se.xaxes=W,Se.yaxes=J,k(t,r,n,Se,o)):(Se.clickFn=Oe,v(i)&&Ce(),ie||("zoom"===o?(Se.moveFn=Pe,Se.doneFn=ze,Se.minDrag=1,function(t,r,n){var i=me.getBoundingClientRect();ye=r-i.left,xe=n-i.top,be={l:ye,r:ye,w:0,t:xe,b:xe,h:0},_e=e._hmpixcount?e._hmlumcount/e._hmpixcount:a(e._fullLayout.plot_bgcolor).getLuminance(),ke=!1,Te="xy",Le=!1,Me=F(de,_e,$,Q,we="M0,0H"+K+"V"+ee+"H0V0"),Ae=N(de,$,Q)}(0,r,n)):"pan"===o&&(Se.moveFn=Ne,Se.doneFn=Ve))),e._fullLayout._redrag=function(){var t=e._dragdata;if(t&&t.element===me){var r=e._fullLayout.dragmode;v(r)||(ge(),qe([0,0,K,ee]),Se.moveFn(t.dx,t.dy))}}},h.init(Se);var Ee=[0,0,K,ee],Re=null,Ie=L.REDRAWDELAY,Fe=t.mainplot?e._fullLayout._plots[t.mainplot]:t;function Ne(t,r){if(!e._transitioningWithDuration){if(e._fullLayout._replotting=!0,"ew"===ne||"ns"===ae)return ne&&(R(W,t),He("x")),ae&&(R(J,r),He("y")),qe([ne?-t:0,ae?-r:0,K,ee]),Be(),void e.emit("plotly_relayouting",fe);if(te.isSubplotConstrained&&ne&&ae){var n="w"===ne==("n"===ae)?1:-1,a=(t/K+n*r/ee)/2;t=a*K,r=n*a*ee}"w"===ne?t=s(W,0,t):"e"===ne?t=s(W,1,-t):ne||(t=0),"n"===ae?r=s(J,1,r):"s"===ae?r=s(J,0,-r):ae||(r=0);var i="w"===ne?t:0,o="n"===ae?r:0;if(te.isSubplotConstrained){var l;if(!ne&&1===ae.length){for(l=0;l<W.length;l++)W[l].range=W[l]._r.slice(),A(W[l],1-r/ee);i=(t=r*K/ee)/2}if(!ae&&1===ne.length){for(l=0;l<J.length;l++)J[l].range=J[l]._r.slice(),A(J[l],1-t/K);o=(r=t*ee/K)/2}}He("x"),He("y"),qe([i,o,K-t,ee-r]),Be(),e.emit("plotly_relayouting",fe)}function s(e,t,r){for(var n,a,i=1-t,o=0;o<e.length;o++){var l=e[o];if(!l.fixedrange){n=l,a=l._rl[i]+(l._rl[t]-l._rl[i])/I(r/l._length);var s=l.l2r(a);!1!==s&&void 0!==s&&(l.range[t]=s)}}return n._length*(n._rl[t]-a)/(n._rl[t]-n._rl[i])}}function He(e,t){for(var r=re.isSubplotConstrained?{x:J,y:W}[e]:re[e+"axes"],n=re.isSubplotConstrained?{x:W,y:J}[e]:[],a=0;a<r.length;a++){var i=r[a],o=i._id,l=re.xLinks[o]||re.yLinks[o],s=n[0]||X[l]||Y[l];s&&(t?(t[i._name+".range[0]"]=t[s._name+".range[0]"],t[i._name+".range[1]"]=t[s._name+".range[1]"]):i.range=s.range.slice())}}function Be(){var t,r=[];function n(e){for(t=0;t<e.length;t++)e[t].fixedrange||r.push(e[t]._id)}for(oe&&(n(W),n(te.xaxes),n(re.xaxes)),le&&(n(J),n(te.yaxes),n(re.yaxes)),fe={},t=0;t<r.length;t++){var a=r[t],i=w(e,a);d.drawOne(e,i,{skipTitle:!0}),fe[i._name+".range[0]"]=i.range[0],fe[i._name+".range[1]"]=i.range[1]}d.redrawComponents(e,r)}function je(){if(!e._transitioningWithDuration){var t=e._context.doubleClick,r=[];ne&&(r=r.concat(W)),ae&&(r=r.concat(J)),re.xaxes&&(r=r.concat(re.xaxes)),re.yaxes&&(r=r.concat(re.yaxes));var n,a,i,l={};if("reset+autosize"===t)for(t="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){t="reset";break}if("autosize"===t)for(a=0;a<r.length;a++)(n=r[a]).fixedrange||(l[n._name+".autorange"]=!0);else if("reset"===t)for((ne||te.isSubplotConstrained)&&(r=r.concat(te.xaxes)),ae&&!te.isSubplotConstrained&&(r=r.concat(te.yaxes)),te.isSubplotConstrained&&(ne?ae||(r=r.concat(J)):r=r.concat(W)),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);e.emit("plotly_doubleclick",null),o.call("_guiRelayout",e,l)}}function Ve(){qe([0,0,K,ee]),l.syncOrAsync([_.previousPromises,function(){e._fullLayout._replotting=!1,o.call("_guiRelayout",e,fe)}],e)}function qe(t){var r,n,a,i,s=e._fullLayout,c=s._plots,f=s._subplots.cartesian;if(ce&&o.subplotsRegistry.splom.drag(e),se)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((ce||se)&&(x(e),b(e)),ue){var h=t[2]/P._length,v=t[3]/B._length;for(r=0;r<f.length;r++){a=(n=c[f[r]]).xaxis,i=n.yaxis;var m,y,_,w,k=oe&&!a.fixedrange&&X[a._id],T=le&&!i.fixedrange&&Y[i._id];if(k?(m=h,_=O?t[0]:Ze(a,m)):re.xaHash[a._id]?(m=h,_=t[0]*a._length/P._length):re.yaHash[a._id]?(m=v,_="ns"===ae?-t[1]*a._length/B._length:Ze(a,m,{n:"top",s:"bottom"}[ae])):_=Ge(a,m=Ue(a,h,v)),T?(y=v,w=g?t[1]:Ze(i,y)):re.yaHash[i._id]?(y=v,w=t[1]*i._length/B._length):re.xaHash[i._id]?(y=h,w="ew"===ne?-t[0]*i._length/P._length:Ze(i,y,{e:"right",w:"left"}[ne])):w=Ge(i,y=Ue(i,h,v)),m||y){m||(m=1),y||(y=1);var M=a._offset-_/m,A=i._offset-w/y;n.clipRect.call(u.setTranslate,_,w).call(u.setScale,m,y),n.plot.call(u.setTranslate,M,A).call(u.setScale,1/m,1/y),m===n.xScaleFactor&&y===n.yScaleFactor||(u.setPointGroupScale(n.zoomScalePts,m,y),u.setTextPointsScale(n.zoomScaleTxt,m,y)),u.hideOutsideRangePoints(n.clipOnAxisFalseTraces,n),n.xScaleFactor=m,n.yScaleFactor=y}}}}function Ue(e,t,r){return e.fixedrange?0:oe&&te.xaHash[e._id]?t:le&&(te.isSubplotConstrained?te.xaHash:te.yaHash)[e._id]?r:0}function Ge(e,t){return t?(e.range=e._r.slice(),A(e,t),Ze(e,t)):0}function Ze(e,t,r){return e._length*(1-t)*y[r||e.constraintoward||"middle"]}return g.length*O.length!=1&&G(me,(function(t){if(e._context._scrollZoom.cartesian||e._fullLayout._enablescrollzoom){if(Ce(),e._transitioningWithDuration)return t.preventDefault(),void t.stopPropagation();ge(),clearTimeout(Re);var r=-t.deltaY;if(isFinite(r)||(r=t.wheelDelta/10),isFinite(r)){var n,a=Math.exp(-Math.min(Math.max(r,-20),20)/200),i=Fe.draglayer.select(".nsewdrag").node().getBoundingClientRect(),o=(t.clientX-i.left)/i.width,s=(i.bottom-t.clientY)/i.height;if(oe){for(O||(o=.5),n=0;n<W.length;n++)c(W[n],o,a);He("x"),Ee[2]*=a,Ee[0]+=Ee[2]*o*(1/a-1)}if(le){for(g||(s=.5),n=0;n<J.length;n++)c(J[n],s,a);He("y"),Ee[3]*=a,Ee[1]+=Ee[3]*(1-s)*(1/a-1)}qe(Ee),Be(),e.emit("plotly_relayouting",fe),Re=setTimeout((function(){Ee=[0,0,K,ee],Ve()}),Ie),t.preventDefault()}else l.log("Did not find wheel motion attributes: ",t)}function c(e,t,r){if(!e.fixedrange){var n=l.simpleMap(e.range,e.r2l),a=n[0]+(n[1]-n[0])*t;e.range=n.map((function(t){return e.l2r(a+(t-a)*r)}))}}})),me},makeDragger:P,makeRectDragger:D,makeZoombox:F,makeCorners:N,updateZoombox:H,xyCorners:q,transitionZoombox:B,removeZoombox:j,showDoubleClickNotifier:V,attachWheelEventHandler:G}},{"../../components/color":43,"../../components/dragelement":62,"../../components/dragelement/helpers":61,"../../components/drawing":65,"../../components/fx":83,"../../constants/alignment":145,"../../lib":168,"../../lib/clear_gl_canvases":157,"../../lib/setcursor":187,"../../lib/svg_text_utils":189,"../../plot_api/subroutines":203,"../../registry":254,"../plots":246,"./axes":212,"./axis_ids":215,"./constants":218,"./scale_zoom":230,"./select":231,d3:7,"has-passive-events":12,tinycolor2:26}],221:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../components/fx"),i=e("../../components/dragelement"),o=e("../../lib/setcursor"),l=e("./dragbox").makeDragBox,s=e("./constants").DRAGGERSIZE;r.initInteractions=function(e){var t=e._fullLayout;if(e._context.staticPlot)n.select(e).selectAll(".drag").remove();else if(t._has("cartesian")||t._has("splom")){Object.keys(t._plots||{}).sort((function(e,r){if((t._plots[e].mainplot&&!0)===(t._plots[r].mainplot&&!0)){var n=e.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 t._plots[e].mainplot?1:-1})).forEach((function(r){var n=t._plots[r],o=n.xaxis,c=n.yaxis;if(!n.mainplot){var u=l(e,n,o._offset,c._offset,o._length,c._length,"ns","ew");u.onmousemove=function(t){e._fullLayout._rehover=function(){e._fullLayout._hoversubplot===r&&e._fullLayout._plots[r]&&a.hover(e,t,r)},a.hover(e,t,r),e._fullLayout._lasthover=u,e._fullLayout._hoversubplot=r},u.onmouseout=function(t){e._dragging||(e._fullLayout._hoversubplot=null,i.unhover(e,t))},e._context.showAxisDragHandles&&(l(e,n,o._offset-s,c._offset-s,s,s,"n","w"),l(e,n,o._offset+o._length,c._offset-s,s,s,"n","e"),l(e,n,o._offset-s,c._offset+c._length,s,s,"s","w"),l(e,n,o._offset+o._length,c._offset+c._length,s,s,"s","e"))}if(e._context.showAxisDragHandles){if(r===o._mainSubplot){var f=o._mainLinePosition;"top"===o.side&&(f-=s),l(e,n,o._offset+.1*o._length,f,.8*o._length,s,"","ew"),l(e,n,o._offset,f,.1*o._length,s,"","w"),l(e,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(e,n,d,c._offset+.1*c._length,s,.8*c._length,"ns",""),l(e,n,d,c._offset+.9*c._length,s,.1*c._length,"s",""),l(e,n,d,c._offset,s,.1*c._length,"n","")}}}));var o=t._hoverlayer.node();o.onmousemove=function(r){r.target=e._fullLayout._lasthover,a.hover(e,r,t._hoversubplot)},o.onclick=function(t){t.target=e._fullLayout._lasthover,a.click(e,t)},o.onmousedown=function(t){e._fullLayout._lasthover.onmousedown(t)},r.updateFx(e)}},r.updateFx=function(e){var t=e._fullLayout,r="pan"===t.dragmode?"move":"crosshair";o(t._draggers,r)}},{"../../components/dragelement":62,"../../components/fx":83,"../../lib/setcursor":187,"./constants":218,"./dragbox":220,d3:7}],222:[function(e,t,r){"use strict";t.exports={clearOutlineControllers:function(e){var t=e._fullLayout._zoomlayer;t&&t.selectAll(".outline-controllers").remove()},clearSelect:function(e){var t=e._fullLayout._zoomlayer;t&&t.selectAll(".select-outline").remove(),e._fullLayout._drawing=!1}}},{}],223:[function(e,t,r){"use strict";function n(e,t){switch(e.type){case"log":return e.p2d(t);case"date":return e.p2r(t,0,e.calendar);default:return e.p2r(t)}}t.exports={p2r:n,r2p:function(e,t){switch(e.type){case"log":return e.d2p(t);case"date":return e.r2p(t,0,e.calendar);default:return e.r2p(t)}},axValue:function(e){var t="y"===e._id.charAt(0)?1:0;return function(r){return n(e,r[t])}},getTransform:function(e){return"translate("+e.xaxis._offset+","+e.yaxis._offset+")"}}},{}],224:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports=function(e){return function(t,r){var i=t[e];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":168,"../../registry":254}],225:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../registry"),i=e("../../lib"),o=e("../plots"),l=e("../../components/drawing"),s=e("../get_data").getModuleCalcData,c=e("./axis_ids"),u=e("./constants"),f=e("../../constants/xmlns_namespaces"),d=i.ensureSingle;function p(e,t,r){return i.ensureSingle(e,t,r,(function(e){e.datum(r)}))}function h(e,t,r,i,o){for(var c,f,d,p=u.traceLayerClasses,h=e._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(e,t){return e.i-t.i}));var k=t.plot.selectAll("g.mlayer").data(v,(function(e){return e.className}));if(k.enter().append("g").attr("class",(function(e){return e.className})).classed("mlayer",!0).classed("rangeplot",t.isRangePlot),k.exit().remove(),k.order(),k.each((function(r){var a=n.select(this),s=r.className;r.plotMethod(e,t,r.cdModule,a,i,o),-1===u.clipOnAxisFalseQuery.indexOf("."+s)&&l.setClipUrl(a,t.layerClipId,e)})),h._has("scattergl")&&(c=a.getModule("scattergl"),d=s(r,c)[0],c.plot(e,t,d)),!e._context.staticPlot&&(t._hasClipOnAxisFalse&&(t.clipOnAxisFalseTraces=t.plot.selectAll(u.clipOnAxisFalseQuery.join(",")).selectAll(".trace")),m.length)){var T=t.plot.selectAll(m.join(",")).selectAll(".trace");t.zoomScalePts=T.selectAll("path.point"),t.zoomScaleTxt=T.selectAll(".textpoint")}}function g(e,t){var r=t.plotgroup,n=t.id,a=u.layerValue2layerClass[t.xaxis.layer],i=u.layerValue2layerClass[t.yaxis.layer],o=e._fullLayout._hasOnlyLargeSploms;if(t.mainplot){var l=t.mainplotinfo,s=l.plotgroup,f=n+"-x",h=n+"-y";t.gridlayer=l.gridlayer,t.zerolinelayer=l.zerolinelayer,d(l.overlinesBelow,"path",f),d(l.overlinesBelow,"path",h),d(l.overaxesBelow,"g",f),d(l.overaxesBelow,"g",h),t.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),t.xlines=s.select(".overlines-"+a).select("."+f),t.ylines=s.select(".overlines-"+i).select("."+h),t.xaxislayer=s.select(".overaxes-"+a).select("."+f),t.yaxislayer=s.select(".overaxes-"+i).select("."+h)}else if(o)t.xlines=d(r,"path","xlines-above"),t.ylines=d(r,"path","ylines-above"),t.xaxislayer=d(r,"g","xaxislayer-above"),t.yaxislayer=d(r,"g","yaxislayer-above");else{var g=d(r,"g","layer-subplot");t.shapelayer=d(g,"g","shapelayer"),t.imagelayer=d(g,"g","imagelayer"),t.gridlayer=d(r,"g","gridlayer"),t.zerolinelayer=d(r,"g","zerolinelayer"),d(r,"path","xlines-below"),d(r,"path","ylines-below"),t.overlinesBelow=d(r,"g","overlines-below"),d(r,"g","xaxislayer-below"),d(r,"g","yaxislayer-below"),t.overaxesBelow=d(r,"g","overaxes-below"),t.plot=d(r,"g","plot"),t.overplot=d(r,"g","overplot"),t.xlines=d(r,"path","xlines-above"),t.ylines=d(r,"path","ylines-above"),t.overlinesAbove=d(r,"g","overlines-above"),d(r,"g","xaxislayer-above"),d(r,"g","yaxislayer-above"),t.overaxesAbove=d(r,"g","overaxes-above"),t.xlines=r.select(".xlines-"+a),t.ylines=r.select(".ylines-"+i),t.xaxislayer=r.select(".xaxislayer-"+a),t.yaxislayer=r.select(".yaxislayer-"+i)}o||(p(t.gridlayer,"g",t.xaxis._id),p(t.gridlayer,"g",t.yaxis._id),t.gridlayer.selectAll("g").map((function(e){return e[0]})).sort(c.idSort)),t.xlines.style("fill","none").classed("crisp",!0),t.ylines.style("fill","none").classed("crisp",!0)}function v(e,t){if(e){var r={};for(var a in e.each((function(e){var a=e[0];n.select(this).remove(),m(a,t),r[a]=!0})),t._plots)for(var i=t._plots[a].overlays||[],o=0;o<i.length;o++){var l=i[o];r[l.id]&&l.plot.selectAll(".trace").remove()}}}function m(e,t){t._draggers.selectAll("g."+e).remove(),t._defs.select("#clip"+t._uid+e+"plot").remove()}r.name="cartesian",r.attr=["xaxis","yaxis"],r.idRoot=["x","y"],r.idRegex=u.idRegex,r.attrRegex=u.attrRegex,r.attributes=e("./attributes"),r.layoutAttributes=e("./layout_attributes"),r.supplyLayoutDefaults=e("./layout_defaults"),r.transitionAxes=e("./transition_axes"),r.finalizeSubplots=function(e,t){var r,n,a,o=t._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=(e[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=(e[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="",e)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(e,t,r,n){var a,i=e._fullLayout,o=i._subplots.cartesian,l=e.calcdata;if(!Array.isArray(t))for(t=[],a=0;a<l.length;a++)t.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!==t.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(e,u,f,r,n)}},r.clean=function(e,t,r,n){var a,i,o,l=n._plots||{},s=t._plots||{},u=n._subplots||{};if(n._hasOnlyLargeSploms&&!t._hasOnlyLargeSploms)for(o in l)(a=l[o]).plotgroup&&a.plotgroup.remove();var f=n._has&&n._has("gl"),d=t._has&&t._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];t[c.id2name(h)]||n._infolayer.selectAll(".g-"+h+"title").remove()}}var g=n._has&&n._has("cartesian"),y=t._has&&t._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(e){var t=e._fullLayout,r=function(e){var t,r,n,a,i,o,l=e._fullLayout,s=l._subplots.cartesian,c=s.length,u=[],f=[];for(t=0;t<c;t++){n=s[t],i=(a=l._plots[n]).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(t=0;t<f.length;t++)n=f[t],(a=l._plots[n]).mainplotinfo.overlays.push(a);var v=u.concat(f),m=new Array(c);for(t=0;t<c;t++){n=v[t],i=(a=l._plots[n]).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[t]=y}return m}(e),a=t._cartesianlayer.selectAll(".subplot").data(r,String);a.enter().append("g").attr("class",(function(e){return"subplot "+e[0]})),a.order(),a.exit().call(v,t),a.each((function(r){var a=r[0],i=t._plots[a];i.plotgroup=n.select(this),g(e,i),i.draglayer=d(t._draggers,"g",a)}))},r.rangePlot=function(e,t,r){g(e,t),h(e,t,r),o.style(e)},r.toSVG=function(e){var t=e._fullLayout._glimages,r=n.select(e).selectAll(".svg-container");r.filter((function(e,t){return t===r.size()-1})).selectAll(".gl-canvas-context, .gl-canvas-focus").each((function(){var e=this.toDataURL("image/png");t.append("svg:image").attr({xmlns:f.svg,"xlink:href":e,preserveAspectRatio:"none",x:0,y:0,width:this.width,height:this.height})}))},r.updateFx=e("./graph_interact").updateFx},{"../../components/drawing":65,"../../constants/xmlns_namespaces":149,"../../lib":168,"../../registry":254,"../get_data":242,"../plots":246,"./attributes":210,"./axis_ids":215,"./constants":218,"./graph_interact":221,"./layout_attributes":226,"./layout_defaults":227,"./transition_axes":236,d3:7}],226:[function(e,t,r){"use strict";var n=e("../font_attributes"),a=e("../../components/color/attributes"),i=e("../../components/drawing/attributes").dash,o=e("../../lib/extend").extendFlat,l=e("../../plot_api/plot_template").templatedArray,s=(e("../../constants/docs").FORMAT_LINK,e("../../constants/docs").DATE_FORMAT_LINK,e("../../constants/numerical").ONEDAY),c=e("./constants"),u=c.HOUR_PATTERN,f=c.WEEKDAY_PATTERN;t.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:[c.idRegex.x.toString(),c.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:[c.idRegex.x.toString(),c.idRegex.y.toString()],editType:"calc"},rangebreaks:l("rangebreak",{enabled:{valType:"boolean",dflt:!0,editType:"calc"},bounds:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},pattern:{valType:"enumerated",values:[f,u,""],editType:"calc"},values:{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"any",editType:"calc"}},dvalue:{valType:"number",editType:"calc",min:0,dflt:s},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","hovered data"],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",c.idRegex.x.toString(),c.idRegex.y.toString()],editType:"plot"},side:{valType:"enumerated",values:["top","bottom","left","right"],editType:"plot"},overlaying:{valType:"enumerated",values:["free",c.idRegex.x.toString(),c.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":42,"../../components/drawing/attributes":64,"../../constants/docs":146,"../../constants/numerical":148,"../../lib/extend":163,"../../plot_api/plot_template":202,"../font_attributes":240,"./constants":218}],227:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../components/color"),i=e("../../components/fx/helpers").isUnifiedHover,o=e("../../components/fx/hovermode_defaults"),l=e("../../plot_api/plot_template"),s=e("../layout_attributes"),c=e("./layout_attributes"),u=e("./type_defaults"),f=e("./axis_defaults"),d=e("./constraints").handleConstraintDefaults,p=e("./position_defaults"),h=e("./axis_ids"),g=h.id2name,v=h.name2id,m=e("./constants").AX_ID_PATTERN,y=e("../../registry"),x=y.traceIs,b=y.getComponentMethod;function _(e,t,r){Array.isArray(e[t])?e[t].push(r):e[t]=[r]}t.exports=function(e,t,r){var h,y,w={},k={},T={},M={},A={},L={},S={},C={},O={},P={};for(h=0;h<r.length;h++){var D=r[h];if(x(D,"cartesian")||x(D,"gl2d")){var z,E;if(D.xaxis)z=g(D.xaxis),_(w,z,D);else if(D.xaxes)for(y=0;y<D.xaxes.length;y++)_(w,g(D.xaxes[y]),D);if(D.yaxis)E=g(D.yaxis),_(w,E,D);else if(D.yaxes)for(y=0;y<D.yaxes.length;y++)_(w,g(D.yaxes[y]),D);"funnel"===D.type?"h"===D.orientation?(z&&(k[z]=!0),E&&(S[E]=!0)):E&&(T[E]=!0):"image"===D.type?(E&&(C[E]=!0),z&&(C[z]=!0)):(E&&(A[E]=!0,L[E]=!0),x(D,"carpet")&&("carpet"!==D.type||D._cheater)||z&&(M[z]=!0)),"carpet"===D.type&&D._cheater&&z&&(k[z]=!0),x(D,"2dMap")&&(O[z]=!0,O[E]=!0),x(D,"oriented")&&(P["h"===D.orientation?E:z]=!0)}}var R=t._subplots,I=R.xaxis,F=R.yaxis,N=n.simpleMap(I,g),H=n.simpleMap(F,g),B=N.concat(H),j=a.background;I.length&&F.length&&(j=n.coerce(e,t,s,"plot_bgcolor"));var V,q,U,G,Z,X=a.combine(j,t.paper_bgcolor);function Y(){var e=w[V]||[];Z._traceIndices=e.map((function(e){return e._expandedIndex})),Z._annIndices=[],Z._shapeIndices=[],Z._imgIndices=[],Z._subplotsWith=[],Z._counterAxes=[],Z._name=Z._attr=V,Z._id=q}function W(e,t){return n.coerce(G,Z,c,e,t)}function J(e,t){return n.coerce2(G,Z,c,e,t)}function $(e){return"x"===e?F:I}function Q(t,r){for(var n="x"===t?N:H,a=[],i=0;i<n.length;i++){var o=n[i];o===r||(e[o]||{}).overlaying||a.push(v(o))}return a}var K={x:$("x"),y:$("y")},ee=K.x.concat(K.y),te={},re=[];function ne(){var e=G.matches;m.test(e)&&-1===ee.indexOf(e)&&(te[e]=G.type,re=Object.keys(te))}var ae=o(e,t,r),ie=i(ae);for(h=0;h<B.length;h++){V=B[h],q=v(V),U=V.charAt(0),n.isPlainObject(e[V])||(e[V]={}),G=e[V],Z=l.newContainer(t,V,U+"axis"),Y();var oe="x"===U&&!M[V]&&k[V]||"y"===U&&!A[V]&&T[V],le="y"===U&&(!L[V]&&S[V]||C[V]),se={letter:U,font:t.font,outerTicks:O[V],showGrid:!P[V],data:w[V]||[],bgColor:X,calendar:t.calendar,automargin:!0,visibleDflt:oe,reverseDflt:le,splomStash:((t._splomAxes||{})[U]||{})[q]};W("uirevision",t.uirevision),u(G,Z,W,se),f(G,Z,W,se,t);var ce=ie&&U===ae.charAt(0),ue=J("spikecolor",ie?Z.color:void 0),fe=J("spikethickness",ie?1.5:void 0),de=J("spikedash",ie?"dot":void 0),pe=J("spikemode",ie?"across":void 0),he=J("spikesnap",ie?"hovered data":void 0);W("showspikes",!!(ce||ue||fe||de||pe||he))||(delete Z.spikecolor,delete Z.spikethickness,delete Z.spikedash,delete Z.spikemode,delete Z.spikesnap),p(G,Z,W,{letter:U,counterAxes:K[U],overlayableAxes:Q(U,V),grid:t.grid}),W("title.standoff"),ne(),Z._input=G}for(h=0;h<re.length;){q=re[h++],U=(V=g(q)).charAt(0),n.isPlainObject(e[V])||(e[V]={}),G=e[V],Z=l.newContainer(t,V,U+"axis"),Y();var ge={letter:U,font:t.font,outerTicks:O[V],showGrid:!P[V],data:[],bgColor:X,calendar:t.calendar,automargin:!0,visibleDflt:!1,reverseDflt:!1,splomStash:((t._splomAxes||{})[U]||{})[q]};W("uirevision",t.uirevision),Z.type=te[q]||"linear",f(G,Z,W,ge,t),p(G,Z,W,{letter:U,counterAxes:K[U],overlayableAxes:Q(U,V),grid:t.grid}),W("fixedrange"),ne(),Z._input=G}var ve=b("rangeslider","handleDefaults"),me=b("rangeselector","handleDefaults");for(h=0;h<N.length;h++)V=N[h],G=e[V],Z=t[V],ve(e,t,V),"date"===Z.type&&me(G,Z,t,H,Z.calendar),W("fixedrange");for(h=0;h<H.length;h++){V=H[h],G=e[V],Z=t[V];var ye=t[g(Z.anchor)];W("fixedrange",b("rangeslider","isVisible")(ye))}var xe=t._axisConstraintGroups=[],be=t._axisMatchGroups=[],_e=ee.concat(re),we=B.concat(n.simpleMap(re,g));for(h=0;h<we.length;h++){var ke,Te;U=(V=we[h]).charAt(0),G=e[V],Z=t[V],ke="y"===U&&!G.hasOwnProperty("scaleanchor")&&C[V]?Z.anchor:void 0,Te=!G.hasOwnProperty("constrain")&&C[V]?"domain":void 0,d(G,Z,W,{allAxisIds:_e,layoutOut:t,scaleanchorDflt:ke,constrainDflt:Te})}for(h=0;h<be.length;h++){var Me=be[h],Ae=null,Le=null;for(q in Me)(Z=t[g(q)]).matches||(Ae=Z.range,Le=Z.autorange);if(null===Ae||null===Le)for(q in Me){Ae=(Z=t[g(q)]).range,Le=Z.autorange;break}for(q in Me)(Z=t[g(q)]).matches&&(Z.range=Ae.slice(),Z.autorange=Le),Z._matchGroup=Me;if(xe.length)for(q in Me)for(y=0;y<xe.length;y++){var Se=xe[y];for(var Ce in Se)q===Ce&&(n.warn("Axis "+Ce+" is set with both a *scaleanchor* and *matches* constraint; ignoring the scale constraint."),delete Se[Ce],Object.keys(Se).length<2&&xe.splice(y,1))}}}},{"../../components/color":43,"../../components/fx/helpers":79,"../../components/fx/hovermode_defaults":82,"../../lib":168,"../../plot_api/plot_template":202,"../../registry":254,"../layout_attributes":244,"./axis_defaults":214,"./axis_ids":215,"./constants":218,"./constraints":219,"./layout_attributes":226,"./position_defaults":229,"./type_defaults":237}],228:[function(e,t,r){"use strict";var n=e("tinycolor2").mix,a=e("../../components/color/attributes").lightFraction,i=e("../../lib");t.exports=function(e,t,r,o){var l=(o=o||{}).dfltColor;function s(r,n){return i.coerce2(e,t,o.attributes,r,n)}var c=s("linecolor",l),u=s("linewidth");r("showline",o.showLine||!!c||!!u)||(delete t.linecolor,delete t.linewidth);var f=s("gridcolor",n(l,o.bgColor,o.blend||a).toRgbString()),d=s("gridwidth");if(r("showgrid",o.showGrid||!!f||!!d)||(delete t.gridcolor,delete t.gridwidth),!o.noZeroLine){var p=s("zerolinecolor",l),h=s("zerolinewidth");r("zeroline",o.showGrid||!!p||!!h)||(delete t.zerolinecolor,delete t.zerolinewidth)}}},{"../../components/color/attributes":42,"../../lib":168,tinycolor2:26}],229:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib");t.exports=function(e,t,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[t._id]],o=p._anchors[t._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(e.position)?"free":u[0]||"free"),s=s||("x"===d?"bottom":"left"),c=c||0,"free"===a.coerce(e,t,{anchor:{valType:"enumerated",values:["free"].concat(u),dflt:o}},"anchor")&&r("position",c),a.coerce(e,t,{side:{valType:"enumerated",values:"x"===d?["bottom","top"]:["left","right"],dflt:s}},"side");var h=!1;if(f.length&&(h=a.coerce(e,t,{overlaying:{valType:"enumerated",values:[!1].concat(f),dflt:!1}},"overlaying")),!h){var g=r("domain",l);g[0]>g[1]-1/4096&&(t.domain=l),a.noneOrAll(e.domain,t.domain,l)}return r("layer"),t}},{"../../lib":168,"fast-isnumeric":9}],230:[function(e,t,r){"use strict";var n=e("../../constants/alignment").FROM_BL;t.exports=function(e,t,r){void 0===r&&(r=n[e.constraintoward||"center"]);var a=[e.r2l(e.range[0]),e.r2l(e.range[1])],i=a[0]+(a[1]-a[0])*r;e.range=e._input.range=[e.l2r(i+(a[0]-i)*t),e.l2r(i+(a[1]-i)*t)]}},{"../../constants/alignment":145}],231:[function(e,t,r){"use strict";var n=e("polybooljs"),a=e("../../registry"),i=e("../../components/drawing").dashStyle,o=e("../../components/color"),l=e("../../components/fx"),s=e("../../components/fx/helpers").makeEventData,c=e("../../components/dragelement/helpers"),u=c.freeMode,f=c.rectMode,d=c.drawMode,p=c.openMode,h=c.selectMode,g=e("../../components/shapes/draw_newshape/display_outlines"),v=e("../../components/shapes/draw_newshape/helpers").handleEllipse,m=e("../../components/shapes/draw_newshape/newshapes"),y=e("../../lib"),x=e("../../lib/polygon"),b=e("../../lib/throttle"),_=e("./axis_ids").getFromId,w=e("../../lib/clear_gl_canvases"),k=e("../../plot_api/subroutines").redrawReglTraces,T=e("./constants"),M=T.MINSELECT,A=x.filter,L=x.tester,S=e("./handle_outline").clearSelect,C=e("./helpers"),O=C.p2r,P=C.axValue,D=C.getTransform;function z(e,t,r,n,a,i,o){var l,s,c,u,f,d,h,v,m,y=t._hoverdata,x=t._fullLayout.clickmode.indexOf("event")>-1,b=[];if(function(e){return e&&Array.isArray(e)&&!0!==e[0].hoverOnBox}(y)){F(e,t,i);var _=function(e,t){var r,n,a=e[0],i=-1,o=[];for(n=0;n<t.length;n++)if(r=t[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}}(y,l=H(t,r,n,a));if(_.pointNumbers.length>0?function(e,t){var r,n,a,i=[];for(a=0;a<e.length;a++)(r=e[a]).cd[0].trace.selectedpoints&&r.cd[0].trace.selectedpoints.length>0&&i.push(r);if(1===i.length&&i[0]===t.searchInfo&&(n=t.searchInfo.cd[0].trace).selectedpoints.length===t.pointNumbers.length){for(a=0;a<t.pointNumbers.length;a++)if(n.selectedpoints.indexOf(t.pointNumbers[a])<0)return!1;return!0}return!1}(l,_):function(e){var t,r,n=0;for(r=0;r<e.length;r++)if((t=e[r].cd[0].trace).selectedpoints){if(t.selectedpoints.length>1)return!1;if((n+=t.selectedpoints.length)>1)return!1}return 1===n}(l)&&(d=B(_))){for(o&&o.remove(),m=0;m<l.length;m++)(s=l[m])._module.selectPoints(s,!1);j(t,l),N(i),x&&t.emit("plotly_deselect",null)}else{for(h=e.shiftKey&&(void 0!==d?d:B(_)),c=function(e,t,r){return{pointNumber:e,searchInfo:t,subtract:r}}(_.pointNumber,_.searchInfo,h),u=I(i.selectionDefs.concat([c])),m=0;m<l.length;m++)if(f=V(l[m]._module.selectPoints(l[m],u),l[m]),b.length)for(var w=0;w<f.length;w++)b.push(f[w]);else b=f;if(j(t,l,v={points:b}),c&&i&&i.selectionDefs.push(c),o){var k=i.mergedPolygons,T=p(i.dragmode);g(q(k,T),o,i)}x&&t.emit("plotly_selected",v)}}}function E(e){return"pointNumber"in e&&"searchInfo"in e}function R(e){return{xmin:0,xmax:0,ymin:0,ymax:0,pts:[],contains:function(t,r,n,a){var i=e.searchInfo.cd[0].trace._expandedIndex;return a.cd[0].trace._expandedIndex===i&&n===e.pointNumber},isRect:!1,degenerate:!1,subtract:e.subtract}}function I(e){for(var t=[],r=E(e[0])?0:e[0][0][0],n=r,a=E(e[0])?0:e[0][0][1],i=a,o=0;o<e.length;o++)if(E(e[o]))t.push(R(e[o]));else{var l=x.tester(e[o]);l.subtract=e[o].subtract,t.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(e,r,n,a){for(var i=!1,o=0;o<t.length;o++)t[o].contains(e,r,n,a)&&(i=!1===t[o].subtract);return i},isRect:!1,degenerate:!1}}function F(e,t,r){t._fullLayout._drawing=!1;var n=t._fullLayout,a=r.plotinfo,i=r.dragmode,o=n._lastSelectedSubplot&&n._lastSelectedSubplot===a.id,l=(e.shiftKey||e.altKey)&&!(d(i)&&p(i));o&&l&&a.selection&&a.selection.selectionDefs&&!r.selectionDefs?(r.selectionDefs=a.selection.selectionDefs,r.mergedPolygons=a.selection.mergedPolygons):l&&a.selection||N(r),o||(S(t),n._lastSelectedSubplot=a.id)}function N(e){var t=e.dragmode,r=e.plotinfo,n=e.gd;if(n._fullLayout._activeShapeIndex>=0&&n._fullLayout._deactivateShape(n),d(t)){var i=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(i&&n._fullLayout._drawing){var o=m(i,e);o&&a.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=e.selectionDefs=[],r.selection.mergedPolygons=e.mergedPolygons=[]}function H(e,t,r,n){var a,i,o,l=[],s=t.map((function(e){return e._id})),c=r.map((function(e){return e._id}));for(o=0;o<e.calcdata.length;o++)if(!0===(i=(a=e.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=d(i._module,a,t[0],r[0]);u.scene=e._fullLayout._splomScenes[i.uid],l.push(u)}else if("sankey"===i.type){var f=d(i._module,a,t[0],r[0]);l.push(f)}else{if(-1===s.indexOf(i.xaxis))continue;if(-1===c.indexOf(i.yaxis))continue;l.push(d(i._module,a,_(e,i.xaxis),_(e,i.yaxis)))}else l.push(d(i._module,a,t[0],r[0]));return l;function d(e,t,r,n){return{_module:e,cd:t,xaxis:r,yaxis:n}}}function B(e){var t=e.searchInfo.cd[0].trace,r=e.pointNumber,n=e.pointNumbers,a=n.length>0?n[0]:r;return!!t.selectedpoints&&t.selectedpoints.indexOf(a)>-1}function j(e,t,r){var n,i,o,l;for(n=0;n<t.length;n++){var s=t[n].cd[0].trace._fullInput,c=e._fullLayout._tracePreGUI[s.uid]||{};void 0===c.selectedpoints&&(c.selectedpoints=s._input.selectedpoints||null)}if(r){var u=r.points||[];for(n=0;n<t.length;n++)(l=t[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],d=f.data,p=f.fullData;f.pointIndices?([].push.apply(d.selectedpoints,f.pointIndices),l._fullInput!==l&&[].push.apply(p.selectedpoints,f.pointIndices)):(d.selectedpoints.push(f.pointIndex),l._fullInput!==l&&p.selectedpoints.push(f.pointIndex))}}else for(n=0;n<t.length;n++)delete(l=t[n].cd[0].trace).selectedpoints,delete l._input.selectedpoints,l._fullInput!==l&&delete l._fullInput.selectedpoints;var h=!1;for(n=0;n<t.length;n++){l=(o=(i=t[n]).cd)[0].trace,a.traceIs(l,"regl")&&(h=!0);var g=i._module,v=g.styleOnSelect||g.style;v&&(v(e,o,o[0].node3),o[0].nodeRangePlot3&&v(e,o,o[0].nodeRangePlot3))}h&&(w(e),k(e))}function V(e,t){if(Array.isArray(e))for(var r=t.cd,n=t.cd[0].trace,a=0;a<e.length;a++)e[a]=s(e[a],n,r);return e}function q(e,t){for(var r=[],n=0;n<e.length;n++){r[n]=[];for(var a=0;a<e[n].length;a++){r[n][a]=[],r[n][a][0]=a?"L":"M";for(var i=0;i<e[n][a].length;i++)r[n][a].push(e[n][a][i])}t||r[n].push(["Z",r[n][0][1],r[n][0][2]])}return r}t.exports={prepSelect:function(e,t,r,a,s){var c,m,x,_,w,k,S,C=u(s),E=f(s),R=p(s),B=d(s),U=h(s),G="drawcircle"===s,Z="drawline"===s||G,X=a.gd,Y=X._fullLayout,W=Y._zoomlayer,J=a.element.getBoundingClientRect(),$=a.plotinfo,Q=D($),K=t-J.left,ee=r-J.top,te=K,re=ee,ne="M"+K+","+ee,ae=a.xaxes[0]._length,ie=a.yaxes[0]._length,oe=a.xaxes.concat(a.yaxes),le=e.altKey&&!(d(s)&&R);F(e,X,a),C&&(c=A([[K,ee]],T.BENDPX));var se=W.selectAll("path.select-outline-"+$.id).data(B?[0]:[1,2]),ce=Y.newshape;se.enter().append("path").attr("class",(function(e){return"select-outline select-outline-"+e+" select-outline-"+$.id})).style(B?{opacity:ce.opacity/2,fill:R?void 0:ce.fillcolor,stroke:ce.line.color,"stroke-dasharray":i(ce.line.dash,ce.line.width),"stroke-width":ce.line.width+"px"}:{}).attr("fill-rule",ce.fillrule).classed("cursor-move",!!B).attr("transform",Q).attr("d",ne+"Z");var ue,fe=W.append("path").attr("class","zoombox-corners").style({fill:o.background,stroke:o.defaultLine,"stroke-width":1}).attr("transform",Q).attr("d","M0,0Z"),de=Y._uid+T.SELECTID,pe=[],he=H(X,a.xaxes,a.yaxes,a.subplot);function ge(e,t){return e-t}ue=$.fillRangeItems?$.fillRangeItems:E?function(e,t){var r=e.range={};for(w=0;w<oe.length;w++){var n=oe[w],a=n._id.charAt(0);r[n._id]=[O(n,t[a+"min"]),O(n,t[a+"max"])].sort(ge)}}:function(e,t,r){var n=e.lassoPoints={};for(w=0;w<oe.length;w++){var a=oe[w];n[a._id]=r.filtered.map(P(a))}},a.moveFn=function(e,t){te=Math.max(0,Math.min(ae,e+K)),re=Math.max(0,Math.min(ie,t+ee));var r=Math.abs(te-K),i=Math.abs(re-ee);if(E){var o,l,s;if(U){var u=Y.selectdirection;switch(o="any"===u?i<Math.min(.6*r,M)?"h":r<Math.min(.6*i,M)?"v":"d":u){case"h":l=G?ie/2:0,s=ie;break;case"v":l=G?ae/2:0,s=ae}}if(B)switch(Y.newshape.drawdirection){case"vertical":o="h",l=G?ie/2:0,s=ie;break;case"horizontal":o="v",l=G?ae/2:0,s=ae;break;case"ortho":r<i?(o="h",l=ee,s=re):(o="v",l=K,s=te);break;default:o="d"}"h"===o?((_=Z?v(G,[te,l],[te,s]):[[K,l],[K,s],[te,s],[te,l]]).xmin=Z?te:Math.min(K,te),_.xmax=Z?te:Math.max(K,te),_.ymin=Math.min(l,s),_.ymax=Math.max(l,s),fe.attr("d","M"+_.xmin+","+(ee-M)+"h-4v"+2*M+"h4ZM"+(_.xmax-1)+","+(ee-M)+"h4v"+2*M+"h-4Z")):"v"===o?((_=Z?v(G,[l,re],[s,re]):[[l,ee],[l,re],[s,re],[s,ee]]).xmin=Math.min(l,s),_.xmax=Math.max(l,s),_.ymin=Z?re:Math.min(ee,re),_.ymax=Z?re:Math.max(ee,re),fe.attr("d","M"+(K-M)+","+_.ymin+"v-4h"+2*M+"v4ZM"+(K-M)+","+(_.ymax-1)+"v4h"+2*M+"v-4Z")):"d"===o&&((_=Z?v(G,[K,ee],[te,re]):[[K,ee],[K,re],[te,re],[te,ee]]).xmin=Math.min(K,te),_.xmax=Math.max(K,te),_.ymin=Math.min(ee,re),_.ymax=Math.max(ee,re),fe.attr("d","M0,0Z"))}else C&&(c.addPt([te,re]),_=c.filtered);a.selectionDefs&&a.selectionDefs.length?(x=function(e,t,r){return n.union({regions:e,inverted:!1},{regions:[t],inverted:!1}).regions}(a.mergedPolygons,_),_.subtract=le,m=I(a.selectionDefs.concat([_]))):(x=[_],m=L(_)),g(q(x,R),se,a),U&&b.throttle(de,T.SELECTDELAY,(function(){var e;pe=[];var t,r=[];for(w=0;w<he.length;w++)if(t=(k=he[w])._module.selectPoints(k,m),r.push(t),e=V(t,k),pe.length)for(var n=0;n<e.length;n++)pe.push(e[n]);else pe=e;j(X,he,S={points:pe}),ue(S,_,c),a.gd.emit("plotly_selecting",S)}))},a.clickFn=function(e,t){if(fe.remove(),X._fullLayout._activeShapeIndex>=0)X._fullLayout._deactivateShape(X);else if(!B){var r=Y.clickmode;b.done(de).then((function(){if(b.clear(de),2===e){for(se.remove(),w=0;w<he.length;w++)(k=he[w])._module.selectPoints(k,!1);j(X,he),N(a),X.emit("plotly_deselect",null)}else r.indexOf("select")>-1&&z(t,X,a.xaxes,a.yaxes,a.subplot,a,se),"event"===r&&X.emit("plotly_selected",void 0);l.click(X,t)})).catch(y.error)}},a.doneFn=function(){fe.remove(),b.done(de).then((function(){b.clear(de),a.gd.emit("plotly_selected",S),_&&a.selectionDefs&&(_.subtract=le,a.selectionDefs.push(_),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,x)),a.doneFnCompleted&&a.doneFnCompleted(pe)})).catch(y.error),B&&N(a)}},clearSelect:S,clearSelectionsCache:N,selectOnClick:z}},{"../../components/color":43,"../../components/dragelement/helpers":61,"../../components/drawing":65,"../../components/fx":83,"../../components/fx/helpers":79,"../../components/shapes/draw_newshape/display_outlines":128,"../../components/shapes/draw_newshape/helpers":129,"../../components/shapes/draw_newshape/newshapes":130,"../../lib":168,"../../lib/clear_gl_canvases":157,"../../lib/polygon":180,"../../lib/throttle":190,"../../plot_api/subroutines":203,"../../registry":254,"./axis_ids":215,"./constants":218,"./handle_outline":222,"./helpers":223,polybooljs:17}],232:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../../lib"),o=i.cleanNumber,l=i.ms2DateTime,s=i.dateTime2ms,c=i.ensureNumber,u=i.isArrayOrTypedArray,f=e("../../constants/numerical"),d=f.FP_SAFE,p=f.BADNUM,h=f.LOG_CLIP,g=f.ONEDAY,v=f.ONEHOUR,m=f.ONEMIN,y=f.ONESEC,x=e("./axis_ids"),b=e("./constants"),_=b.HOUR_PATTERN,w=b.WEEKDAY_PATTERN;function k(e){return Math.pow(10,e)}function T(e){return null!=e}t.exports=function(e,t){t=t||{};var r=e._id||"x",f=r.charAt(0);function M(t,r){if(t>0)return Math.log(t)/Math.LN10;if(t<=0&&r&&e.range&&2===e.range.length){var n=e.range[0],a=e.range[1];return.5*(n+a-2*h*Math.abs(n-a))}return p}function A(t,r,n){var o=s(t,n||e.calendar);if(o===p){if(!a(t))return p;t=+t;var l=Math.floor(10*i.mod(t+.05,1)),c=Math.round(t-l/10);o=s(new Date(c))+l/10}return o}function L(t,r,n){return l(t,r,n||e.calendar)}function S(t){return e._categories[Math.round(t)]}function C(t){if(T(t)){if(void 0===e._categoriesMap&&(e._categoriesMap={}),void 0!==e._categoriesMap[t])return e._categoriesMap[t];e._categories.push("number"==typeof t?String(t):t);var r=e._categories.length-1;return e._categoriesMap[t]=r,r}return p}function O(t){if(e._categoriesMap)return e._categoriesMap[t]}function P(e){var t=O(e);return void 0!==t?t:a(e)?+e:void 0}function D(e,t,r){return n.round(r+t*e,2)}function z(e,t,r){return(e-r)/t}var E=function(t){return a(t)?D(t,e._m,e._b):p},R=function(t){return z(t,e._m,e._b)};if(e.rangebreaks){var I="y"===f;E=function(t){if(!a(t))return p;var r=e._rangebreaks.length;if(!r)return D(t,e._m,e._b);var n=I;e.range[0]>e.range[1]&&(n=!n);for(var i=n?-1:1,o=i*t,l=0,s=0;s<r;s++){var c=i*e._rangebreaks[s].min,u=i*e._rangebreaks[s].max;if(o<c)break;if(!(o>u)){l=o<(c+u)/2?s:s+1;break}l=s+1}var f=e._B[l]||0;return isFinite(f)?D(t,e._m2,f):0},R=function(t){var r=e._rangebreaks.length;if(!r)return z(t,e._m,e._b);for(var n=0,a=0;a<r&&!(t<e._rangebreaks[a].pmin);a++)t>e._rangebreaks[a].pmax&&(n=a+1);return z(t,e._m2,e._B[n])}}e.c2l="log"===e.type?M:c,e.l2c="log"===e.type?k:c,e.l2p=E,e.p2l=R,e.c2p="log"===e.type?function(e,t){return E(M(e,t))}:E,e.p2c="log"===e.type?function(e){return k(R(e))}:R,-1!==["linear","-"].indexOf(e.type)?(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=o,e.c2d=e.c2r=e.l2d=e.l2r=c,e.d2p=e.r2p=function(t){return e.l2p(o(t))},e.p2d=e.p2r=R,e.cleanPos=c):"log"===e.type?(e.d2r=e.d2l=function(e,t){return M(o(e),t)},e.r2d=e.r2c=function(e){return k(o(e))},e.d2c=e.r2l=o,e.c2d=e.l2r=c,e.c2r=M,e.l2d=k,e.d2p=function(t,r){return e.l2p(e.d2r(t,r))},e.p2d=function(e){return k(R(e))},e.r2p=function(t){return e.l2p(o(t))},e.p2r=R,e.cleanPos=c):"date"===e.type?(e.d2r=e.r2d=i.identity,e.d2c=e.r2c=e.d2l=e.r2l=A,e.c2d=e.c2r=e.l2d=e.l2r=L,e.d2p=e.r2p=function(t,r,n){return e.l2p(A(t,0,n))},e.p2d=e.p2r=function(e,t,r){return L(R(e),t,r)},e.cleanPos=function(t){return i.cleanDate(t,p,e.calendar)}):"category"===e.type?(e.d2c=e.d2l=C,e.r2d=e.c2d=e.l2d=S,e.d2r=e.d2l_noadd=P,e.r2c=function(t){var r=P(t);return void 0!==r?r:e.fraction2r(.5)},e.l2r=e.c2r=c,e.r2l=P,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return S(R(e))},e.r2p=e.d2p,e.p2r=R,e.cleanPos=function(e){return"string"==typeof e&&""!==e?e:c(e)}):"multicategory"===e.type&&(e.r2d=e.c2d=e.l2d=S,e.d2r=e.d2l_noadd=P,e.r2c=function(t){var r=P(t);return void 0!==r?r:e.fraction2r(.5)},e.r2c_just_indices=O,e.l2r=e.c2r=c,e.r2l=P,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return S(R(e))},e.r2p=e.d2p,e.p2r=R,e.cleanPos=function(e){return Array.isArray(e)||"string"==typeof e&&""!==e?e:c(e)},e.setupMultiCategory=function(n){var a,o,l=e._traceIndices,s=t._axisMatchGroups;if(s&&s.length&&0===e._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=t[x.id2name(d)];l=l.concat(p._traceIndices)}}var h=[[0,{}],[0,{}]],g=[];for(a=0;a<l.length;a++){var v=n[l[a]];if(f in v){var m=v[f],y=v._length||i.minRowLength(m);if(u(m[0])&&u(m[1]))for(o=0;o<y;o++){var b=m[0][o],_=m[1][o];T(b)&&T(_)&&(g.push([b,_]),b in h[0][1]||(h[0][1][b]=h[0][0]++),_ in h[1][1]||(h[1][1][_]=h[1][0]++))}}}for(g.sort((function(e,t){var r=h[0][1],n=r[e[0]]-r[t[0]];if(n)return n;var a=h[1][1];return a[e[1]]-a[t[1]]})),a=0;a<g.length;a++)C(g[a])}),e.fraction2r=function(t){var r=e.r2l(e.range[0]),n=e.r2l(e.range[1]);return e.l2r(r+t*(n-r))},e.r2fraction=function(t){var r=e.r2l(e.range[0]),n=e.r2l(e.range[1]);return(e.r2l(t)-r)/(n-r)},e.cleanRange=function(t,r){r||(r={}),t||(t="range");var n,o,l=i.nestedProperty(e,t).get();if(o=(o="date"===e.type?i.dfltRange(e.calendar):"y"===f?b.DFLTRANGEY:r.dfltRange||b.DFLTRANGEX).slice(),"tozero"!==e.rangemode&&"nonnegative"!==e.rangemode||(o[0]=0),l&&2===l.length)for("date"!==e.type||e.autorange||(l[0]=i.cleanDate(l[0],p,e.calendar),l[1]=i.cleanDate(l[1],p,e.calendar)),n=0;n<2;n++)if("date"===e.type){if(!i.isDateTime(l[n],e.calendar)){e[t]=o;break}if(e.r2l(l[0])===e.r2l(l[1])){var s=i.constrain(e.r2l(l[0]),i.MIN_MS+1e3,i.MAX_MS-1e3);l[0]=e.l2r(s-1e3),l[1]=e.l2r(s+1e3);break}}else{if(!a(l[n])){if(!a(l[1-n])){e[t]=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(e,t).set(o)},e.setScale=function(r){var n=t._size;if(e.overlaying){var a=x.getFromId({_fullLayout:t},e.overlaying);e.domain=a.domain}var i=r&&e._r?"_r":"range",o=e.calendar;e.cleanRange(i);var l,s,c=e.r2l(e[i][0],o),u=e.r2l(e[i][1],o),d="y"===f;if(d?(e._offset=n.t+(1-e.domain[1])*n.h,e._length=n.h*(e.domain[1]-e.domain[0]),e._m=e._length/(c-u),e._b=-e._m*u):(e._offset=n.l+e.domain[0]*n.w,e._length=n.w*(e.domain[1]-e.domain[0]),e._m=e._length/(u-c),e._b=-e._m*c),e._rangebreaks=[],e._lBreaks=0,e._m2=0,e._B=[],e.rangebreaks&&(e._rangebreaks=e.locateBreaks(Math.min(c,u),Math.max(c,u)),e._rangebreaks.length)){for(l=0;l<e._rangebreaks.length;l++)s=e._rangebreaks[l],e._lBreaks+=Math.abs(s.max-s.min);var p=d;c>u&&(p=!p),p&&e._rangebreaks.reverse();var h=p?-1:1;for(e._m2=h*e._length/(Math.abs(u-c)-e._lBreaks),e._B.push(-e._m2*(d?u:c)),l=0;l<e._rangebreaks.length;l++)s=e._rangebreaks[l],e._B.push(e._B[e._B.length-1]-h*e._m2*(s.max-s.min));for(l=0;l<e._rangebreaks.length;l++)(s=e._rangebreaks[l]).pmin=E(s.min),s.pmax=E(s.max)}if(!isFinite(e._m)||!isFinite(e._b)||e._length<0)throw t._replotting=!1,new Error("Something went wrong with axis scaling")},e.maskBreaks=function(t){for(var r,n,a,l,s,c=e.rangebreaks||[],u=0;u<c.length;u++){var f=c[u];if(f.enabled)if(f.bounds){var d=f.pattern;switch(n=(r=i.simpleMap(f.bounds,d?o:e.d2c))[0],a=r[1],d){case w:l=(s=new Date(t)).getUTCDay(),n>a&&(a+=7,l<n&&(l+=7));break;case _:l=(s=new Date(t)).getUTCHours()+(s.getUTCMinutes()/60+s.getUTCSeconds()/3600+s.getUTCMilliseconds()/36e5),n>a&&(a+=24,l<n&&(l+=24));break;case"":l=t}if(l>=n&&l<a)return p}else for(var h=i.simpleMap(f.values,e.d2c).sort(i.sorterAsc),g=0;g<h.length;g++)if(a=(n=h[g])+f.dvalue,t>=n&&t<a)return p}return t},e.locateBreaks=function(t,r){var n,a,l,s,c=[];if(!e.rangebreaks)return c;var u=e.rangebreaks.slice().sort((function(e,t){return e.pattern===w&&t.pattern===_?-1:t.pattern===w&&e.pattern===_?1:0})),f=function(e,n){if((e=i.constrain(e,t,r))!==(n=i.constrain(n,t,r))){for(var a=!0,o=0;o<c.length;o++){var l=c[o];e>l.max||n<l.min||(e<l.min&&(l.min=e),n>l.max&&(l.max=n),a=!1)}a&&c.push({min:e,max:n})}};for(n=0;n<u.length;n++){var d=u[n];if(d.enabled)if(d.bounds){var p=t,h=r;d.pattern&&(p=Math.floor(p)),l=(a=i.simpleMap(d.bounds,d.pattern?o:e.r2l))[0],s=a[1];var x,b,k=new Date(p);switch(d.pattern){case w:b=7*g,x=(s-l+(s<l?7:0))*g,p+=l*g-(k.getUTCDay()*g+k.getUTCHours()*v+k.getUTCMinutes()*m+k.getUTCSeconds()*y+k.getUTCMilliseconds());break;case _:b=g,x=(s-l+(s<l?24:0))*v,p+=l*v-(k.getUTCHours()*v+k.getUTCMinutes()*m+k.getUTCSeconds()*y+k.getUTCMilliseconds());break;default:p=Math.min(a[0],a[1]),x=b=(h=Math.max(a[0],a[1]))-p}for(var T=p;T<h;T+=b)f(T,T+x)}else for(var M=i.simpleMap(d.values,e.d2c),A=0;A<M.length;A++)f(l=M[A],s=l+d.dvalue)}return c.sort((function(e,t){return e.min-t.min})),c},e.makeCalcdata=function(t,r){var n,a,o,l,s=e.type,c="date"===s&&t[r+"calendar"];if(r in t){if(n=t[r],l=t._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(e,t){for(var r=new Array(t),n=0;n<t;n++){var a=(e[0]||[])[n],i=(e[1]||[])[n];r[n]=O([a,i])}return r}(n,l);for(a=new Array(l),o=0;o<l;o++)a[o]=e.d2c(n[o],0,c)}else{var u=r+"0"in t?e.d2c(t[r+"0"],0,c):0,f=t["d"+r]?Number(t["d"+r]):1;for(n=t[{x:"y",y:"x"}[r]],l=t._length||n.length,a=new Array(l),o=0;o<l;o++)a[o]=u+o*f}if(e.rangebreaks)for(o=0;o<l;o++)a[o]=e.maskBreaks(a[o]);return a},e.isValidRange=function(t){return Array.isArray(t)&&2===t.length&&a(e.r2l(t[0]))&&a(e.r2l(t[1]))},e.isPtWithinRange=function(t,r){var n=e.c2l(t[f],null,r),a=e.r2l(e.range[0]),i=e.r2l(e.range[1]);return a<i?a<=n&&n<=i:i<=n&&n<=a},e.clearCalc=function(){var n=function(){e._categories=[],e._categoriesMap={}},a=t._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=t[x.id2name(u)];if(f._categories){s=f._categories,c=f._categoriesMap;break}}s&&c?(e._categories=s,e._categoriesMap=c):n();break}}i||n()}else n();if(e._initialCategories)for(var d=0;d<e._initialCategories.length;d++)C(e._initialCategories[d])},e.sortByInitialCategories=function(){var n=[];if(e._categories=[],e._categoriesMap={},e._initialCategories)for(var a=0;a<e._initialCategories.length;a++)C(e._initialCategories[a]);n=n.concat(e._traceIndices);var i=e._matchGroup;for(var o in i)if(r!==o){var l=t[x.id2name(o)];l._categories=e._categories,l._categoriesMap=e._categoriesMap,n=n.concat(l._traceIndices)}return n};var F=t._d3locale;"date"===e.type&&(e._dateFormat=F?F.timeFormat.utc:n.time.format.utc,e._extraFormat=t._extraFormat),e._separators=t.separators,e._numFormat=F?F.numberFormat:n.format,delete e._minDtick,delete e._forceTick0}},{"../../constants/numerical":148,"../../lib":168,"./axis_ids":215,"./constants":218,d3:7,"fast-isnumeric":9}],233:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes"),i=e("../array_container_defaults");function o(e){var t=["showexponent","showtickprefix","showticksuffix"].filter((function(t){return void 0!==e[t]}));if(t.every((function(r){return e[r]===e[t[0]]}))||1===t.length)return e[t[0]]}function l(e,t){function r(r,i){return n.coerce(e,t,a.tickformatstops,r,i)}r("enabled")&&(r("dtickrange"),r("value"))}t.exports=function(e,t,r,s,c,u){u&&1!==u.pass||function(e,t,r,n,a){var i=o(e);r("tickprefix")&&r("showtickprefix",i),r("ticksuffix",a.tickSuffixDflt)&&r("showticksuffix",i)}(e,0,r,0,c),u&&2!==u.pass||function(e,t,r,s,c){var u=o(e);if(r("tickprefix")&&r("showtickprefix",u),r("ticksuffix",c.tickSuffixDflt)&&r("showticksuffix",u),r("showticklabels")){var f=c.font||{},d=t.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");i(e,t,{name:"tickformatstops",inclusionAttr:"enabled",handleItemDefaults:l}),t.tickformatstops.length||delete t.tickformatstops,h||"date"===s||(r("showexponent",u),r("exponentformat"),r("separatethousands"))}}}(e,t,r,s,c)}},{"../../lib":168,"../array_container_defaults":208,"./layout_attributes":226}],234:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t,r,i){var o=n.coerce2(e,t,a,"ticklen"),l=n.coerce2(e,t,a,"tickwidth"),s=n.coerce2(e,t,a,"tickcolor",t.color);r("ticks",i.outerTicks||o||l||s?"outside":"")||(delete t.ticklen,delete t.tickwidth,delete t.tickcolor)}},{"../../lib":168,"./layout_attributes":226}],235:[function(e,t,r){"use strict";var n=e("./clean_ticks");t.exports=function(e,t,r,a){function i(r){var n=e[r];return void 0!==n?n:(t._template||{})[r]}var o,l=i("tick0"),s=i("dtick"),c=i("tickvals");if("auto"===(o="array"!==i("tickmode")||"log"!==a&&"date"!==a?r("tickmode",Array.isArray(c)?"array":s?"linear":"auto"):t.tickmode="auto"))r("nticks");else if("linear"===o){var u=t.dtick=n.dtick(s,a);t.tick0=n.tick0(l,a,t.calendar,u)}else"multicategory"!==a&&(void 0===r("tickvals")?t.tickmode="auto":r("ticktext"))}},{"./clean_ticks":217}],236:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../registry"),i=e("../../lib"),o=e("../../components/drawing"),l=e("./axes");t.exports=function(e,t,r,s){var c=e._fullLayout;if(0!==t.length){var u,f,d,p;s&&(u=s());var h=n.ease(r.easing);return e._transitionData._interruptCallbacks.push((function(){return window.cancelAnimationFrame(p),p=null,function(){for(var r={},n=0;n<t.length;n++){var i=t[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",e,r).then((function(){for(var e=0;e<t.length;e++)g(t[e].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<t.length;l++)v(t[l],o);d-f>r.duration?(function(){for(var r={},n=0;n<t.length;n++){var i=t[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",e,r).then((function(){for(var e=0;e<t.length;e++)g(t[e].plotinfo)}))}(),p=window.cancelAnimationFrame(n)):p=window.requestAnimationFrame(n)})),Promise.resolve()}function g(e){var t=e.xaxis,r=e.yaxis;c._defs.select("#"+e.clipId+"> rect").call(o.setTranslate,0,0).call(o.setScale,1,1),e.plot.call(o.setTranslate,t._offset,r._offset).call(o.setScale,1,1);var n=e.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,e)}function v(t,r){var n=t.plotinfo,a=n.xaxis,s=n.yaxis,c=a._length,u=s._length,f=!!t.xr1,d=!!t.yr1,p=[];if(f){var h=i.simpleMap(t.xr0,a.r2l),g=i.simpleMap(t.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(t.yr0,s.r2l),x=i.simpleMap(t.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(e,a,{skipTitle:!0}),l.drawOne(e,s,{skipTitle:!0}),l.redrawComponents(e,[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(e)}},{"../../components/drawing":65,"../../lib":168,"../../registry":254,"./axes":212,d3:7}],237:[function(e,t,r){"use strict";var n=e("../../registry").traceIs,a=e("./axis_autotype");function i(e){return{v:"x",h:"y"}[e.orientation||"v"]}function o(e,t){var r=i(e),a=n(e,"box-violin"),o=n(e._fullInput||{},"candlestick");return a&&!o&&t===r&&void 0===e[r]&&void 0===e[r+"0"]}t.exports=function(e,t,r,l){"-"===r("type",(l.splomStash||{}).type)&&(function(e,t){if("-"===e.type){var r,l=e._id,s=l.charAt(0);-1!==l.indexOf("scene")&&(l=s);var c=function(e,t,r){for(var n=0;n<e.length;n++){var a=e[n];if("splom"===a.type&&a._length>0&&(a["_"+r+"axes"]||{})[t])return a;if((a[r+"axis"]||r)===t){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(t,l,s);if(c)if("histogram"!==c.type||s!=={v:"y",h:"x"}[c.orientation||"v"]){var u=s+"calendar",f=c[u],d={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};if("box"===c.type&&c._hasPreCompStats&&s==={h:"x",v:"y"}[c.orientation||"v"]&&(d.noMultiCategory=!0),o(c,s)){var p=i(c),h=[];for(r=0;r<t.length;r++){var g=t[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))}e.type=a(h,f,d)}else if("splom"===c.type){var v=c.dimensions[c._axesDim[l]];v.visible&&(e.type=a(v.values,f,d))}else e.type=a(c[s]||[c[s+"0"]],f,d)}else e.type="linear"}}(t,l.data),"-"===t.type?t.type="linear":e.type=t.type)}},{"../../registry":254,"./axis_autotype":213}],238:[function(e,t,r){"use strict";var n=e("../registry"),a=e("../lib");function i(e,t,r){var n,i,o,l=!1;if("data"===t.type)n=e._fullData[null!==t.traces?t.traces[0]:0];else{if("layout"!==t.type)return!1;n=e._fullLayout}return i=a.nestedProperty(n,t.prop).get(),(o=r[t.type]=r[t.type]||{}).hasOwnProperty(t.prop)&&o[t.prop]!==i&&(l=!0),o[t.prop]=i,{changed:l,value:i}}function o(e,t){var r=[],n=t[0],i={};if("string"==typeof n)i[n]=t[1];else{if(!a.isPlainObject(n))return r;i=n}return s(i,(function(e,t,n){r.push({type:"layout",prop:e,value:n})}),"",0),r}function l(e,t){var r,n,i,o,l=[];if(n=t[0],i=t[1],r=t[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(t,n,a){var i,o;if(Array.isArray(a)){o=a.slice();var s=Math.min(o.length,e.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:t,traces:i,value:o})}),"",0),l}function s(e,t,r,n){Object.keys(e).forEach((function(i){var o=e[i];if("_"!==i[0]){var l=r+(n>0?".":"")+i;a.isPlainObject(o)?s(o,t,l,n+1):t(l,i,o)}}))}r.manageCommandObserver=function(e,t,n,o){var l={},s=!0;t&&t._commandObserver&&(l=t._commandObserver),l.cache||(l.cache={}),l.lookupTable={};var c=r.hasSimpleAPICommandBindings(e,n,l.lookupTable);if(t&&t._commandObserver){if(c)return l;if(t._commandObserver.remove)return t._commandObserver.remove(),t._commandObserver=null,l}if(c){i(e,c,l.cache),l.check=function(){if(s){var t=i(e,c,l.cache);return t.changed&&o&&void 0!==l.lookupTable[t.value]&&(l.disable(),Promise.resolve(o({value:t.value,type:c.type,prop:c.prop,traces:c.traces,index:l.lookupTable[t.value]})).then(l.enable,l.enable)),t.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f<u.length;f++)e._internalOn(u[f],l.check);l.remove=function(){for(var t=0;t<u.length;t++)e._removeInternalListener(u[t],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},t&&(t._commandObserver=l),l},r.hasSimpleAPICommandBindings=function(e,t,n){var a,i,o=t.length;for(a=0;a<o;a++){var l,s=t[a],c=s.method,u=s.args;if(Array.isArray(u)||(u=[]),!c)return!1;var f=r.computeAPICommandBindings(e,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(e,t,r){if("skip"===t)return Promise.resolve();var i=n.apiMethodRegistry[t],o=[e];Array.isArray(r)||(r=[]);for(var l=0;l<r.length;l++)o.push(r[l]);return i.apply(null,o).catch((function(e){return a.warn("API call to Plotly."+t+" rejected.",e),Promise.reject(e)}))},r.computeAPICommandBindings=function(e,t,r){var n;switch(Array.isArray(r)||(r=[]),t){case"restyle":n=l(e,r);break;case"relayout":n=o(0,r);break;case"update":n=l(e,[r[0],r[2]]).concat(o(0,[r[1]]));break;case"animate":n=function(e,t){return Array.isArray(t[0])&&1===t[0].length&&-1!==["string","number"].indexOf(typeof t[0][0])?[{type:"layout",prop:"_currentFrame",value:t[0][0].toString()}]:[]}(0,r);break;default:n=[]}return n}},{"../lib":168,"../registry":254}],239:[function(e,t,r){"use strict";var n=e("../lib/extend").extendFlat;r.attributes=function(e,t){t=t||{};var r={valType:"info_array",editType:(e=e||{}).editType,items:[{valType:"number",min:0,max:1,editType:e.editType},{valType:"number",min:0,max:1,editType:e.editType}],dflt:[0,1]},a=(e.name&&e.name,e.trace,t.description&&t.description,{x:n({},r,{}),y:n({},r,{}),editType:e.editType});return e.noGridCell||(a.row={valType:"integer",min:0,dflt:0,editType:e.editType},a.column={valType:"integer",min:0,dflt:0,editType:e.editType}),a},r.defaults=function(e,t,r,n){var a=n&&n.x||[0,1],i=n&&n.y||[0,1],o=t.grid;if(o){var l=r("domain.column");void 0!==l&&(l<o.columns?a=o._domains.x[l]:delete e.domain.column);var s=r("domain.row");void 0!==s&&(s<o.rows?i=o._domains.y[s]:delete e.domain.row)}var c=r("domain.x",a),u=r("domain.y",i);c[0]<c[1]||(e.domain.x=a.slice()),u[0]<u[1]||(e.domain.y=i.slice())}},{"../lib/extend":163}],240:[function(e,t,r){"use strict";t.exports=function(e){var t=e.editType,r=e.colorEditType;void 0===r&&(r=t);var n={family:{valType:"string",noBlank:!0,strict:!0,editType:t},size:{valType:"number",min:1,editType:t},color:{valType:"color",editType:r},editType:t};return e.arrayOk&&(n.family.arrayOk=!0,n.size.arrayOk=!0,n.color.arrayOk=!0),n}},{}],241:[function(e,t,r){"use strict";t.exports={_isLinkedToArray:"frames_entry",group:{valType:"string"},name:{valType:"string"},traces:{valType:"any"},baseframe:{valType:"string"},data:{valType:"any"},layout:{valType:"any"}}},{}],242:[function(e,t,r){"use strict";var n=e("../registry"),a=e("./cartesian/constants").SUBPLOT_PATTERN;r.getSubplotCalcData=function(e,t,r){var a=n.subplotsRegistry[t];if(!a)return[];for(var i=a.attr,o=[],l=0;l<e.length;l++){var s=e[l];s[0].trace[i]===r&&o.push(s)}return o},r.getModuleCalcData=function(e,t){var r,a=[],i=[];if(!(r="string"==typeof t?n.getModule(t).plot:"function"==typeof t?t:t.plot))return[a,e];for(var o=0;o<e.length;o++){var l=e[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(e,t,r){if(!n.subplotsRegistry[t])return[];var i,o,l,s=n.subplotsRegistry[t].attr,c=[];if("gl2d"===t){var u=r.match(a);o="x"+u[1],l="y"+u[2]}for(var f=0;f<e.length;f++)i=e[f],"gl2d"===t&&n.traceIs(i,"gl2d")?i[s[0]]===o&&i[s[1]]===l&&c.push(i):i[s]===r&&c.push(i);return c}},{"../registry":254,"./cartesian/constants":218}],243:[function(e,t,r){"use strict";function n(e,t){var r,n,a=[0,0,0,0];for(r=0;r<4;++r)for(n=0;n<4;++n)a[n]+=e[4*r+n]*t[r];return a}t.exports=function(e,t){return n(e.projection,n(e.view,n(e.model,[t[0],t[1],t[2],1])))}},{}],244:[function(e,t,r){"use strict";var n=e("./font_attributes"),a=e("./animation_attributes"),i=e("../components/color/attributes"),o=e("../components/shapes/draw_newshape/attributes"),l=e("./pad_attributes"),s=e("../lib/extend").extendFlat,c=n({editType:"calc"});c.family.dflt='"Open Sans", verdana, arial, sans-serif',c.size.dflt=12,c.color.dflt=i.defaultLine,t.exports={font:c,title:{text:{valType:"string",editType:"layoutstyle"},font:n({editType:"layoutstyle"}),xref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},yref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},x:{valType:"number",min:0,max:1,dflt:.5,editType:"layoutstyle"},y:{valType:"number",min:0,max:1,dflt:"auto",editType:"layoutstyle"},xanchor:{valType:"enumerated",dflt:"auto",values:["auto","left","center","right"],editType:"layoutstyle"},yanchor:{valType:"enumerated",dflt:"auto",values:["auto","top","middle","bottom"],editType:"layoutstyle"},pad:s(l({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"},newshape:o.newshape,activeshape:o.activeshape,meta:{valType:"any",arrayOk:!0,editType:"plot"},transition:s({},a.transition,{editType:"none"}),_deprecated:{title:{valType:"string",editType:"layoutstyle"},titlefont:n({editType:"layoutstyle"})}}},{"../components/color/attributes":42,"../components/shapes/draw_newshape/attributes":125,"../lib/extend":163,"./animation_attributes":207,"./font_attributes":240,"./pad_attributes":245}],245:[function(e,t,r){"use strict";t.exports=function(e){var t=e.editType;return{t:{valType:"number",dflt:0,editType:t},r:{valType:"number",dflt:0,editType:t},b:{valType:"number",dflt:0,editType:t},l:{valType:"number",dflt:0,editType:t},editType:t}}},{}],246:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../registry"),o=e("../plot_api/plot_schema"),l=e("../plot_api/plot_template"),s=e("../lib"),c=e("../components/color"),u=e("../constants/numerical").BADNUM,f=e("./cartesian/axis_ids"),d=e("./cartesian/handle_outline").clearSelect,p=e("./animation_attributes"),h=e("./frame_attributes"),g=e("../plots/get_data").getModuleCalcData,v=s.relinkPrivateKeys,m=s._,y=t.exports={};s.extendFlat(y,i),y.attributes=e("./attributes"),y.attributes.type.values=y.allTypes,y.fontAttrs=e("./font_attributes"),y.layoutAttributes=e("./layout_attributes"),y.fontWeight="normal";var x=y.transformsRegistry,b=e("./command");y.executeAPICommand=b.executeAPICommand,y.computeAPICommandBindings=b.computeAPICommandBindings,y.manageCommandObserver=b.manageCommandObserver,y.hasSimpleAPICommandBindings=b.hasSimpleAPICommandBindings,y.redrawText=function(e){var t=(e=s.getGraphDiv(e))._fullLayout||{};if(t._has&&t._has("polar")||!e.data||!e.data[0]||!e.data[0].r)return new Promise((function(t){setTimeout((function(){i.getComponentMethod("annotations","draw")(e),i.getComponentMethod("legend","draw")(e),i.getComponentMethod("colorbar","draw")(e),t(y.previousPromises(e))}),300)}))},y.resize=function(e){var t;e=s.getGraphDiv(e);var r=new Promise((function(r,n){e&&!s.isHidden(e)||n(new Error("Resize must be passed a displayed plot div element.")),e._redrawTimer&&clearTimeout(e._redrawTimer),e._resolveResize&&(t=e._resolveResize),e._resolveResize=r,e._redrawTimer=setTimeout((function(){if(!e.layout||e.layout.width&&e.layout.height||s.isHidden(e))r(e);else{delete e.layout.width,delete e.layout.height;var t=e.changed;e.autoplay=!0,i.call("relayout",e,{autosize:!0}).then((function(){e.changed=t,e._resolveResize===r&&(delete e._resolveResize,r(e))}))}}),100)}));return t&&t(r),r},y.previousPromises=function(e){if((e._promises||[]).length)return Promise.all(e._promises).then((function(){e._promises=[]}))},y.addLinks=function(e){if(e._context.showLink||e._context.showSources){var t=e._fullLayout,r=s.ensureSingle(t._paper,"text","js-plot-link-container",(function(e){e.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:c.defaultLine,"pointer-events":"all"}).each((function(){var e=n.select(this);e.append("tspan").classed("js-link-to-tool",!0),e.append("tspan").classed("js-link-spacer",!0),e.append("tspan").classed("js-sourcelinks",!0)}))})),a=r.node(),i={y:t._paper.attr("height")-9};document.body.contains(a)&&a.getComputedTextLength()>=t.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=t._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");e._context.showSources&&e._context.showSources(e),e._context.showLink&&function(e,t){t.text("");var r=t.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(e._context.linkText+" "+String.fromCharCode(187));if(e._context.sendData)r.on("click",(function(){y.sendDataToCloud(e)}));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})}}(e,o),l.text(o.text()&&u.text()?" - ":"")}},y.sendDataToCloud=function(e){var t=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL;if(t){e.emit("plotly_beforeexport");var r=n.select(e).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:t+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=y.graphJson(e,!1,"keepdata"),a.node().submit(),r.remove(),e.emit("plotly_afterexport"),!1}};var _=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],w=["year","month","dayMonth","dayMonthYear"];function k(e,t){var r=e._context.locale,n=!1,a={};function o(e){for(var r=!0,i=0;i<t.length;i++){var o=t[i];a[o]||(e[o]?a[o]=e[o]:r=!1)}r&&(n=!0)}for(var l=0;l<2;l++){for(var s=e._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 T(e,t){var r={_fullLayout:t},n="x"===e._id.charAt(0),a=e._mainAxis._anchorAxis,i="",o="",l="";if(a&&(l=a._mainAxis._id,i=n?e._id+l:l+e._id),!i||!t._plots[i]){i="";for(var s=e._counterAxes,c=0;c<s.length;c++){var u=s[c],d=n?e._id+u:u+e._id;o||(o=d);var p=f.getFromId(r,u);if(l&&p.overlaying===l){i=d;break}}}return i||o}function M(e){var t=e.transforms;if(Array.isArray(t)&&t.length)for(var r=0;r<t.length;r++){var n=t[r],a=n._module||x[n.type];if(a&&a.makesData)return!0}return!1}function A(e,t,r,n){for(var a=e.transforms,i=[e],o=0;o<a.length;o++){var l=a[o],s=x[l.type];s&&s.transform&&(i=s.transform(i,{transform:l,fullTrace:e,fullData:t,layout:r,fullLayout:n,transformIndex:o}))}return i}function L(e){var t=e.margin;if(!e._size){var r=e._size={l:Math.round(t.l),r:Math.round(t.r),t:Math.round(t.t),b:Math.round(t.b),p:Math.round(t.pad)};r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b}e._pushmargin||(e._pushmargin={}),e._pushmarginIds||(e._pushmarginIds={})}y.supplyDefaults=function(e,t){var r=t&&t.skipUpdateCalc,a=e._fullLayout||{};if(a._skipDefaults)delete a._skipDefaults;else{var o,l=e._fullLayout={},c=e.layout||{},u=e._fullData||[],f=e._fullData=[],p=e.data||[],h=e.calcdata||[],g=e._context||{};e._transitionData||y.createTransitionData(e),l._dfltTitle={plot:m(e,"Click to enter Plot title"),x:m(e,"Click to enter X axis title"),y:m(e,"Click to enter Y axis title"),colorbar:m(e,"Click to enter Colorscale title"),annotation:m(e,"new text")},l._traceWord=m(e,"trace");var x=k(e,_);if(l._mapboxAccessToken=g.mapboxAccessToken,a._initialAutoSizeIsDone){var b=a.width,T=a.height;y.supplyLayoutGlobalDefaults(c,l,x),c.width||(l.width=b),c.height||(l.height=T),y.sanitizeMargins(l)}else{y.supplyLayoutGlobalDefaults(c,l,x);var M=!c.width||!c.height,A=l.autosize,S=g.autosizable;M&&(A||S)?y.plotAutoSize(e,c,l):M&&y.sanitizeMargins(l),!A&&M&&(c.width=l.width,c.height=l.height)}l._d3locale=function(e,t){return e.decimal=t.charAt(0),e.thousands=t.charAt(1),n.locale(e)}(x,l.separators),l._extraFormat=k(e,w),l._initialAutoSizeIsDone=!0,l._dataLength=p.length,l._modules=[],l._visibleModules=[],l._basePlotModules=[];var C=l._subplots=function(){var e,t,r=i.collectableSubplotTypes,n={};if(!r){r=[];var a=i.subplotsRegistry;for(var o in a){var l=a[o].attr;if(l&&(r.push(o),Array.isArray(l)))for(t=0;t<l.length;t++)s.pushUnique(r,l[t])}}for(e=0;e<r.length;e++)n[r[e]]=[];return n}(),O=l._splomAxes={x:{},y:{}},P=l._splomSubplots={};l._splomGridDflt={},l._scatterStackOpts={},l._firstScatter={},l._alignmentOpts={},l._colorAxes={},l._requestRangeslider={},l._traceUids=function(e,t){var r,n,a=t.length,i=[];for(r=0;r<e.length;r++){var o=e[r]._fullInput;o!==n&&i.push(o),n=o}var l=i.length,c=new Array(a),u={};function f(e,t){c[t]=e,u[e]=1}function d(e,t){if(e&&"string"==typeof e&&!u[e])return f(e,t),!0}for(r=0;r<a;r++){var p=t[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,p),l._globalTransforms=(e._context||{}).globalTransforms,y.supplyDataDefaults(p,f,c,l);var D=Object.keys(O.x),z=Object.keys(O.y);if(D.length>1&&z.length>1){for(i.getComponentMethod("grid","sizeDefaults")(c,l),o=0;o<D.length;o++)s.pushUnique(C.xaxis,D[o]);for(o=0;o<z.length;o++)s.pushUnique(C.yaxis,z[o]);for(var E in P)s.pushUnique(C.cartesian,E)}if(l._has=y._hasPlotType.bind(l),u.length===f.length)for(o=0;o<f.length;o++)v(f[o],u[o]);y.supplyLayoutModuleDefaults(c,l,f,e._transitionData);var R=l._visibleModules,I=[];for(o=0;o<R.length;o++){var F=R[o].crossTraceDefaults;F&&s.pushUnique(I,F)}for(o=0;o<I.length;o++)I[o](f,l);l._hasOnlyLargeSploms=1===l._basePlotModules.length&&"splom"===l._basePlotModules[0].name&&D.length>15&&z.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"),y.linkSubplots(f,l,u,a),y.cleanPlot(f,l,u,a),a._zoomlayer&&!e._dragging&&d({_fullLayout:a}),function(e,t){var r,n=[];t.meta&&(r=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var a=0;a<e.length;a++){var i=e[a];i.meta?n[i.index]=i._meta={meta:i.meta}:t.meta&&(i._meta={meta:t.meta}),t.meta&&(i._meta.layout={meta:t.meta})}n.length&&(r||(r=t._meta={}),r.data=n)}(f,l),v(l,a),i.getComponentMethod("colorscale","crossTraceDefaults")(f,l),l._preGUI||(l._preGUI={}),l._tracePreGUI||(l._tracePreGUI={});var N,H=l._tracePreGUI,B={};for(N in H)B[N]="old";for(o=0;o<f.length;o++)B[N=f[o]._fullInput.uid]||(H[N]={}),B[N]="new";for(N in B)"old"===B[N]&&delete H[N];L(l),i.getComponentMethod("rangeslider","makeData")(l),r||h.length!==f.length||y.supplyDefaultsUpdateCalc(h,f)}},y.supplyDefaultsUpdateCalc=function(e,t){for(var r=0;r<t.length;r++){var n=t[r],a=(e[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}}},y.createTransitionData=function(e){e._transitionData||(e._transitionData={}),e._transitionData._frames||(e._transitionData._frames=[]),e._transitionData._frameHash||(e._transitionData._frameHash={}),e._transitionData._counter||(e._transitionData._counter=0),e._transitionData._interruptCallbacks||(e._transitionData._interruptCallbacks=[])},y._hasPlotType=function(e){var t,r=this._basePlotModules||[];for(t=0;t<r.length;t++)if(r[t].name===e)return!0;var n=this._modules||[];for(t=0;t<n.length;t++){var a=n[t].name;if(a===e)return!0;var o=i.modules[a];if(o&&o.categories[e])return!0}return!1},y.cleanPlot=function(e,t,r,n){var a,i,o=n._basePlotModules||[];for(a=0;a<o.length;a++){var l=o[a];l.clean&&l.clean(e,t,r,n)}var s=n._has&&n._has("gl"),c=t._has&&t._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;e:for(a=0;a<r.length;a++){var f=r[a].uid;for(i=0;i<e.length;i++)if(f===e[i].uid)continue e;u&&n._infolayer.select(".cb"+f).remove()}},y.linkSubplots=function(e,t,r,n){var a,o,l=n._plots||{},c=t._plots={},u=t._subplots,d={_fullData:e,_fullLayout:t},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<e.length;o++){var x=e[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=T(b,t),b._counterAxes.length&&(b.spikemode&&-1!==b.spikemode.indexOf("across")||b.automargin&&b.mirror&&"free"!==b.anchor||i.getComponentMethod("rangeslider","isVisible")(b))){var k=1,M=0;for(o=0;o<b._counterAxes.length;o++){var A=f.getFromId(d,b._counterAxes[o]);k=Math.min(k,A.domain[0]),M=Math.max(M,A.domain[1])}k<M&&(b._counterDomainMin=k,b._counterDomainMax=M)}},y.clearExpandedTraceDefaultColors=function(e){var t,r,n;for(r=[],(t=e._module._colorAttrs)||(e._module._colorAttrs=t=[],o.crawl(e._module.attributes,(function(e,n,a,i){r[i]=n,r.length=i+1,"color"===e.valType&&void 0===e.dflt&&t.push(r.join("."))}))),n=0;n<t.length;n++)s.nestedProperty(e,"_input."+t[n]).get()||s.nestedProperty(e,t[n]).set(null)},y.supplyDataDefaults=function(e,t,r,n){var a,o,c,u=n._modules,f=n._visibleModules,d=n._basePlotModules,p=0,h=0;function g(e){t.push(e);var r=e._module;r&&(s.pushUnique(u,r),!0===e.visible&&s.pushUnique(f,r),s.pushUnique(d,e._module.basePlotModule),p++,!1!==e._input.visible&&h++)}n._transformModules=[];var m={},x=[],b=(r.template||{}).data||{},_=l.traceTemplater(b);for(a=0;a<e.length;a++){if(c=e[a],(o=_.newTrace(c)).uid=n._traceUids[a],y.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=A(o,t,r,n),T=0;T<k.length;T++){var M=k[T],L={_template:o._template,type:o.type,uid:o.uid+T};w&&!1===M.visible&&delete M.visible,y.supplyTraceDefaults(M,L,p,n,a),v(L,M),L.index=a,L._input=c,L._fullInput=o,L._expandedIndex=p,L._expandedInput=M,g(L)}else o._fullInput=o,o._expandedInput=o,g(o);i.traceIs(o,"carpetAxis")&&(m[o.carpet]=o),i.traceIs(o,"carpetDependent")&&x.push(a)}for(a=0;a<x.length;a++)if((o=t[x[a]]).visible){var S=m[o.carpet];o._carpet=S,S&&S.visible?(o.xaxis=S.xaxis,o.yaxis=S.yaxis):o.visible=!1}},y.supplyAnimationDefaults=function(e){var t;e=e||{};var r={};function n(t,n){return s.coerce(e||{},r,p,t,n)}if(n("mode"),n("direction"),n("fromcurrent"),Array.isArray(e.frame))for(r.frame=[],t=0;t<e.frame.length;t++)r.frame[t]=y.supplyAnimationFrameDefaults(e.frame[t]||{});else r.frame=y.supplyAnimationFrameDefaults(e.frame||{});if(Array.isArray(e.transition))for(r.transition=[],t=0;t<e.transition.length;t++)r.transition[t]=y.supplyAnimationTransitionDefaults(e.transition[t]||{});else r.transition=y.supplyAnimationTransitionDefaults(e.transition||{});return r},y.supplyAnimationFrameDefaults=function(e){var t={};function r(r,n){return s.coerce(e||{},t,p.frame,r,n)}return r("duration"),r("redraw"),t},y.supplyAnimationTransitionDefaults=function(e){var t={};function r(r,n){return s.coerce(e||{},t,p.transition,r,n)}return r("duration"),r("easing"),t},y.supplyFrameDefaults=function(e){var t={};function r(r,n){return s.coerce(e,t,h,r,n)}return r("group"),r("name"),r("traces"),r("baseframe"),r("data"),r("layout"),t},y.supplyTraceDefaults=function(e,t,r,n,a){var o,l=n.colorway||c.defaults,u=l[r%l.length];function f(r,n){return s.coerce(e,t,y.attributes,r,n)}var d=f("visible");f("type"),f("name",n._traceWord+" "+a),f("uirevision",n.uirevision);var p=y.getModule(t);if(t._module=p,p){var h=p.basePlotModule,g=h.attr,v=h.attributes;if(g&&v){var m=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(e,t,v,b);m[b]&&s.pushUnique(m[b],_),x+=_}else x=s.coerce(e,t,v,g);m[h.name]&&s.pushUnique(m[h.name],x)}}}return d&&(f("customdata"),f("ids"),f("meta"),i.traceIs(t,"showLegend")?(s.coerce(e,t,p.attributes.showlegend?p.attributes:y.attributes,"showlegend"),f("legendgroup"),t._dfltShowLegend=!0):t._dfltShowLegend=!1,p&&p.supplyDefaults(e,t,u,n),i.traceIs(t,"noOpacity")||f("opacity"),i.traceIs(t,"notLegendIsolatable")&&(t.visible=!!t.visible),i.traceIs(t,"noHover")||(t.hovertemplate||s.coerceHoverinfo(e,t,n),"parcats"!==t.type&&i.getComponentMethod("fx","supplyDefaults")(e,t,u,n)),p&&p.selectPoints&&f("selectedpoints"),y.supplyTransformDefaults(e,t,n)),t},y.hasMakesDataTransform=M,y.supplyTransformDefaults=function(e,t,r){if(t._length||M(e)){var n=r._globalTransforms||[],a=r._transformModules||[];if(Array.isArray(e.transforms)||0!==n.length)for(var i=e.transforms||[],o=n.concat(i),l=t.transforms=[],c=0;c<o.length;c++){var u,f=o[c],d=f.type,p=x[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,t,r,e)).type=d,u._module=p,s.pushUnique(a,p)):u=s.extendFlat({},f),l.push(u)}}},y.supplyLayoutGlobalDefaults=function(e,t,r){function n(r,n){return s.coerce(e,t,y.layoutAttributes,r,n)}var a=e.template;s.isPlainObject(a)&&(t.template=a,t._template=a.layout,t._dataTemplate=a.data);var o=s.coerceFont(n,"font");n("title.text",t._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",!(e.width&&e.height)),n("width"),n("height"),n("margin.l"),n("margin.r"),n("margin.t"),n("margin.b"),n("margin.pad"),n("margin.autoexpand"),e.width&&e.height&&y.sanitizeMargins(t),i.getComponentMethod("grid","sizeDefaults")(e,t),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(t.paper_bgcolor,.5));var u=c.contrast(c.rgb(t.modebar.bgcolor));n("modebar.color",c.addOpacity(u,.3)),n("modebar.activecolor",c.addOpacity(u,.7)),n("modebar.uirevision",l),i.getComponentMethod("shapes","supplyDrawNewShapeDefaults")(e,t,n),n("meta"),s.isPlainObject(e.transition)&&(n("transition.duration"),n("transition.easing"),n("transition.ordering")),i.getComponentMethod("calendars","handleDefaults")(e,t,"calendar"),i.getComponentMethod("fx","supplyLayoutGlobalDefaults")(e,t,n)},y.plotAutoSize=function(e,t,r){var n,i,o=e._context||{},l=o.frameMargins,c=s.isPlotDiv(e);if(c&&e.emit("plotly_autosize"),o.fillFrame)n=window.innerWidth,i=window.innerHeight,document.body.style.overflow="hidden";else{var u=c?window.getComputedStyle(e):{};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=y.layoutAttributes.width.min,p=y.layoutAttributes.height.min;n<d&&(n=d),i<p&&(i=p);var h=!t.width&&Math.abs(r.width-n)>1,g=!t.height&&Math.abs(r.height-i)>1;(g||h)&&(h&&(r.width=n),g&&(r.height=i)),e._initialAutoSize||(e._initialAutoSize={width:n,height:i}),y.sanitizeMargins(r)},y.supplyLayoutModuleDefaults=function(e,t,r,n){var a,o,l,c=i.componentsRegistry,u=t._basePlotModules,f=i.subplotsRegistry.cartesian;for(a in c)(l=c[a]).includeBasePlot&&l.includeBasePlot(e,t);for(var d in u.length||u.push(f),t._has("cartesian")&&(i.getComponentMethod("grid","contentDefaults")(e,t),f.finalizeSubplots(e,t)),t._subplots)t._subplots[d].sort(s.subplotSort);for(o=0;o<u.length;o++)(l=u[o]).supplyLayoutDefaults&&l.supplyLayoutDefaults(e,t,r);var p=t._modules;for(o=0;o<p.length;o++)(l=p[o]).supplyLayoutDefaults&&l.supplyLayoutDefaults(e,t,r);var h=t._transformModules;for(o=0;o<h.length;o++)(l=h[o]).supplyLayoutDefaults&&l.supplyLayoutDefaults(e,t,r,n);for(a in c)(l=c[a]).supplyLayoutDefaults&&l.supplyLayoutDefaults(e,t,r)},y.purge=function(e){var t=e._fullLayout||{};void 0!==t._glcontainer&&(t._glcontainer.selectAll(".gl-canvas").remove(),t._glcontainer.remove(),t._glcanvas=null),t._modeBar&&t._modeBar.destroy(),e._transitionData&&(e._transitionData._interruptCallbacks&&(e._transitionData._interruptCallbacks.length=0),e._transitionData._animationRaf&&window.cancelAnimationFrame(e._transitionData._animationRaf)),s.clearThrottle(),s.clearResponsive(e),delete e.data,delete e.layout,delete e._fullData,delete e._fullLayout,delete e.calcdata,delete e.framework,delete e.empty,delete e.fid,delete e.undoqueue,delete e.undonum,delete e.autoplay,delete e.changed,delete e._promises,delete e._redrawTimer,delete e._hmlumcount,delete e._hmpixcount,delete e._transitionData,delete e._transitioning,delete e._initialAutoSize,delete e._transitioningWithDuration,delete e._dragging,delete e._dragged,delete e._dragdata,delete e._hoverdata,delete e._snapshotInProgress,delete e._editing,delete e._mouseDownTime,delete e._legendMouseDownTime,e.removeAllListeners&&e.removeAllListeners()},y.style=function(e){var t,r=e._fullLayout._visibleModules,n=[];for(t=0;t<r.length;t++){var a=r[t];a.style&&s.pushUnique(n,a.style)}for(t=0;t<n.length;t++)n[t](e)},y.sanitizeMargins=function(e){if(e&&e.margin){var t,r=e.width,n=e.height,a=e.margin,i=r-(a.l+a.r),o=n-(a.t+a.b);i<0&&(t=(r-1)/(a.l+a.r),a.l=Math.floor(t*a.l),a.r=Math.floor(t*a.r)),o<0&&(t=(n-1)/(a.t+a.b),a.t=Math.floor(t*a.t),a.b=Math.floor(t*a.b))}},y.clearAutoMarginIds=function(e){e._fullLayout._pushmarginIds={}},y.allowAutoMargin=function(e,t){e._fullLayout._pushmarginIds[t]=1},y.autoMargin=function(e,t,r){var n=e._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",t,"is too big in x, dropping"),r.l=r.r=0),r.b+r.t>.5*n.height&&(s.log("Margin push",t,"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[t]={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[t]=1}else delete a[t],delete i[t];if(!n._replotting)return y.doAutoMargin(e)}},y.doAutoMargin=function(e){var t=e._fullLayout;t._size||(t._size={}),L(t);var r=t._size,n=t.margin,o=s.extendFlat({},r),l=n.l,c=n.r,u=n.t,f=n.b,d=t.width,p=t.height,h=t._pushmargin,g=t._pushmarginIds;if(!1!==t.margin.autoexpand){for(var v in h)g[v]||delete h[v];for(var m 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[m].l||{},b=h[m].b||{},_=x.val,w=x.size,k=b.val,T=b.size;for(var M in h){if(a(w)&&h[M].r){var A=h[M].r.val,S=h[M].r.size;if(A>_){var C=(w*A+(S-d)*_)/(A-_),O=(S*(1-_)+(w-d)*(1-A))/(A-_);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),E=(D*(1-k)+(T-p)*(1-P))/(P-k);z>=0&&E>=0&&p-(E+z)>0&&z+E>f+u&&(f=z,u=E)}}}}}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,!t._replotting&&y.didMarginChange(o,r)){"_redrawFromAutoMarginCount"in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var R=3*(1+Object.keys(g).length);if(t._redrawFromAutoMarginCount<R)return i.call("plot",e);s.warn("Too many auto-margin redraws.")}};var S=["l","r","t","b","p","w","h"];function C(e,t,r){var n=!1,a=[y.previousPromises,function(){if(e._transitionData)return e._transitioning=!1,function(e){var t=Promise.resolve();if(!e)return t;for(;e.length;)t=t.then(e.shift());return t}(e._transitionData._interruptCallbacks)},r.prepareFn,y.rehover,function(){return e.emit("plotly_transitioning",[]),new Promise((function(a){e._transitioning=!0,t.duration>0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&e._transitionData._interruptCallbacks.push((function(){return i.call("redraw",e)})),e._transitionData._interruptCallbacks.push((function(){e.emit("plotly_transitioninterrupted",[])}));var o=0,l=0;function s(){return o++,function(){n||++l!==o||function(t){e._transitionData&&(function(e){if(e)for(;e.length;)e.shift()}(e._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return i.call("redraw",e)})).then((function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])})).then(t))}(a)}}r.runFn(s),setTimeout(s())}))}],o=s.syncOrAsync(a,e);return o&&o.then||(o=Promise.resolve()),o.then((function(){return e}))}y.didMarginChange=function(e,t){for(var r=0;r<S.length;r++){var n=S[r],i=e[n],o=t[n];if(!a(i)||Math.abs(o-i)>1)return!0}return!1},y.graphJson=function(e,t,r,n,a,i){(a&&t&&!e._fullData||a&&!t&&!e._fullLayout)&&y.supplyDefaults(e);var o=a?e._fullData:e.data,l=a?e._fullLayout:e.layout,c=(e._transitionData||{})._frames;function u(e,t){if("function"==typeof e)return t?"_function_":null;if(s.isPlainObject(e)){var n,a={};return Object.keys(e).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof e[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0&&!s.isPlainObject(e.stream))return}else if("keepall"!==r&&"string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0)return;a[i]=u(e[i],t)}else t&&(a[i]="_function")})),a}return Array.isArray(e)?e.map((function(e){return u(e,t)})):s.isTypedArray(e)?s.simpleMap(e,s.identity):s.isJSDate(e)?s.ms2DateTimeLocal(+e):e}var f={data:(o||[]).map((function(e){var r=u(e);return t&&delete r.fit,r}))};return t||(f.layout=u(l)),e.framework&&e.framework.isPolar&&(f=e.framework.getConfig()),c&&(f.frames=u(c)),i&&(f.config=u(e._context,!0)),"object"===n?f:JSON.stringify(f)},y.modifyFrames=function(e,t){var r,n,a,i=e._transitionData._frames,o=e._transitionData._frameHash;for(r=0;r<t.length;r++)switch((n=t[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()},y.computeFrame=function(e,t){var r,n,a,i,o=e._transitionData._frameHash;if(!t)throw new Error("computeFrame must be given a string frame name");var l=o[t.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=y.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]=y.extendTrace(u.data[i],l.data[r]))}return u},y.recomputeFrameHash=function(e){for(var t=e._transitionData._frameHash={},r=e._transitionData._frames,n=0;n<r.length;n++){var a=r[n];a&&a.name&&(t[a.name]=a)}},y.extendObjectWithContainers=function(e,t,r){var n,a,i,o,l,c,u,f=s.extendDeepNoArrays({},t||{}),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(e=s.extendDeepNoArrays(e||{},d),r&&r.length)for(i=0;i<r.length;i++)if(c=s.nestedProperty(p,r[i]).get()){for(u=(l=s.nestedProperty(e,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:y.extendObjectWithContainers(u[o],h)}l.set(u)}return e},y.dataArrayContainers=["transforms","dimensions"],y.layoutArrayContainers=i.layoutArrayContainers,y.extendTrace=function(e,t){return y.extendObjectWithContainers(e,t,y.dataArrayContainers)},y.extendLayout=function(e,t){return y.extendObjectWithContainers(e,t,y.layoutArrayContainers)},y.transition=function(e,t,r,n,a,i){var o={redraw:a.redraw},l={},c=[];return o.prepareFn=function(){for(var a=Array.isArray(t)?t.length:0,i=n.slice(0,a),o=0;o<i.length;o++){var u=i[o],f=e._fullData[u]._module;if(f){if(f.animatable){var d=f.basePlotModule.name;l[d]||(l[d]=[]),l[d].push(u)}e.data[i[o]]=y.extendTrace(e.data[i[o]],t[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;y.extendLayout(e.layout,p),delete e.calcdata,y.supplyDefaults(e),y.doCalcdata(e);var v=s.expandObjectPaths(r);if(v){var m=e._fullLayout._plots;for(var x in m){var b=m[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(t){var n,a,o=e._fullLayout._basePlotModules,u=c.length;if(r)for(a=0;a<o.length;a++)o[a].transitionAxes&&o[a].transitionAxes(e,c,i,t);for(var f in u?((n=s.extendFlat({},i)).duration=0,delete l.cartesian):n=i,l){var d=l[f];e._fullData[d[0]]._module.basePlotModule.plot(e,d,n,t)}},C(e,i,o)},y.transitionFromReact=function(e,t,r,n){var a=e._fullLayout,i=a.transition,o={},l=[];return o.prepareFn=function(){var e=a._plots;for(var i in o.redraw=!1,"some"===t.anim&&(o.redraw=!0),"some"===r.anim&&(o.redraw=!0),e){var c=e[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=e._fullData,u=e._fullLayout._basePlotModules,f=[],d=0;d<c.length;d++)f.push(d);function p(){for(var t=0;t<u.length;t++)u[t].transitionAxes&&u[t].transitionAxes(e,l,n,r)}function h(){for(var t=0;t<u.length;t++)u[t].plot(e,o,a,r)}l.length&&t.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()):t.anim&&(o=f,a=i,h())},C(e,i,o)},y.doCalcdata=function(e,t){var r,n,a,l,c=f.list(e),d=e._fullData,p=e._fullLayout,h=new Array(d.length),g=(e.calcdata||[]).slice();for(e.calcdata=h,p._numBoxes=0,p._numViolins=0,p._violinScaleGroupStats={},e._hmpixcount=0,e._hmlumcount=0,p._piecolormap={},p._sunburstcolormap={},p._treemapcolormap={},p._funnelareacolormap={},a=0;a<d.length;a++)Array.isArray(t)&&-1===t.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 y=p[m];!1!==y.cauto&&(delete y.cmin,delete y.cmax)}var b=!1;function _(t){if(r=d[t],n=r._module,!0===r.visible&&r.transforms){if(n&&n.calc){var a=n.calc(e,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=x[i.type])&&n.calcTransform&&(r._hasCalcTransform=!0,b=!0,n.calcTransform(e,r,i))}}}function w(t,a){if(r=d[t],!!(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(e,r))}Array.isArray(i)&&i[0]||(i=[{x:u,y:u}]),i[0].t||(i[0].t={}),i[0].trace=r,h[t]=i}}for(P(c,d,p),a=0;a<d.length;a++)w(a,!0);for(a=0;a<d.length;a++)_(a);for(b&&P(c,d,p),a=0;a<d.length;a++)w(a,!0);for(a=0;a<d.length;a++)w(a,!1);D(e);var k=function(e,t){var r,n,a,o,l,c=[];function u(e,r,n){var a=r._id.charAt(0);if("histogram2dcontour"===e){var i=r._counterAxes[0],o=f.getFromId(t,i),l="x"===a||"x"===i&&"category"===o.type,s="y"===a||"y"===i&&"category"===o.type;return function(e,t){return 0===e||0===t||l&&e===n[t].length-1||s&&t===n.length-1?-1:("y"===a?t:e)-1}}return function(e,t){return"y"===a?t:e}}var d={min:function(e){return s.aggNums(Math.min,null,e)},max:function(e){return s.aggNums(Math.max,null,e)},sum:function(e){return s.aggNums((function(e,t){return e+t}),null,e)},total:function(e){return s.aggNums((function(e,t){return e+t}),null,e)},mean:function(e){return s.mean(e)},median:function(e){return s.median(e)}};for(r=0;r<e.length;r++){var p=e[r];if("category"===p.type){var h=p.categoryorder.match(O);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=t._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=t.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=t._fullLayout[f.id2name(S)])}var C=A.trace.dimensions[L].values;for(o=0;o<C.length;o++)for(k=C[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&&(T=k=A.t.x[o],M=A.t.y[o]),"y"===b&&(T=k=A.t.y[o],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(e,t){return e[1]-t[1]})),p._categoriesAggregatedValue=z,p._initialCategories=z.map((function(e){return e[0]})),"descending"===v&&p._initialCategories.reverse(),c=c.concat(p.sortByInitialCategories())}}}return c}(c,e);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);D(e)}i.getComponentMethod("fx","calc")(e),i.getComponentMethod("errorbars","calc")(e)};var O=/(total|sum|min|max|mean|median) (ascending|descending)/;function P(e,t,r){var n,a,i,o={};for(n=0;n<e.length;n++)i=(a=e[n])._id,a.clearCalc(),"multicategory"===a.type&&a.setupMultiCategory(t),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 D(e){var t,r,n,a=e._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(t=0;t<d.length;t++){var p=d[t],h="cartesian"===n?a._plots[p]:a[p];for(r=0;r<f.length;r++)f[r](e,h,p)}else for(r=0;r<f.length;r++)f[r](e)}}y.rehover=function(e){e._fullLayout._rehover&&e._fullLayout._rehover()},y.redrag=function(e){e._fullLayout._redrag&&e._fullLayout._redrag()},y.generalUpdatePerTraceModule=function(e,t,r,n){var a,i=t.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(e,t,s.filterVisible(p),n)}t.traceHash=o},y.plotBasePlot=function(e,t,r,n,a){var o=i.getModule(e),l=g(t.calcdata,o)[0];o.plot(t,l,n,a)},y.cleanBasePlot=function(e,t,r,n,a){var i=a._has&&a._has(e),o=r._has&&r._has(e);i&&!o&&a["_"+e+"layer"].selectAll("g.trace").remove()}},{"../components/color":43,"../constants/numerical":148,"../lib":168,"../plot_api/plot_schema":201,"../plot_api/plot_template":202,"../plots/get_data":242,"../registry":254,"./animation_attributes":207,"./attributes":209,"./cartesian/axis_ids":215,"./cartesian/handle_outline":222,"./command":238,"./font_attributes":240,"./frame_attributes":241,"./layout_attributes":244,d3:7,"fast-isnumeric":9}],247:[function(e,t,r){"use strict";var n=e("../../../traces/scatter/attributes"),a=n.marker,i=e("../../../lib/extend").extendFlat;["Area traces are deprecated!","Please switch to the *barpolar* trace type."].join(" "),t.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":163,"../../../traces/scatter/attributes":294}],248:[function(e,t,r){"use strict";var n=e("../../cartesian/layout_attributes"),a=e("../../../lib/extend").extendFlat,i=e("../../../plot_api/edit_types").overrideAll,o=["Legacy polar charts are deprecated!","Please switch to *polar* subplots."].join(" "),l=a({},n.domain,{});function s(e,t){return a({},t,{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"}})}t.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":163,"../../../plot_api/edit_types":195,"../../cartesian/layout_attributes":226}],249:[function(e,t,r){"use strict";(t.exports=e("./micropolar")).manager=e("./micropolar_manager")},{"./micropolar":250,"./micropolar_manager":251}],250:[function(e,t,r){var n=e("d3"),a=e("../../../lib").extendDeepAll,i=e("../../../constants/alignment").MID_SHIFT,o=t.exports={version:"0.2.2"};o.Axis=function(){var e,t,r,l,s={data:[],layout:{}},c={},u={},f=n.dispatch("hover"),d={render:function(c){return function(c){t=c||t;var f=s.data,d=s.layout;("string"==typeof t||t.nodeName)&&(t=n.select(t)),t.datum(f).each((function(t,s){var c=t.slice();u={data:o.util.cloneJson(c),layout:o.util.cloneJson(d)};var f=0;c.forEach((function(e,t){e.color||(e.color=d.defaultColorRange[f],f=(f+1)%d.defaultColorRange.length),e.strokeColor||(e.strokeColor="LinePlot"===e.geometry?e.color:n.rgb(e.color).darker().toString()),u.data[t].color=e.color,u.data[t].strokeColor=e.strokeColor,u.data[t].strokeDash=e.strokeDash,u.data[t].strokeSize=e.strokeSize}));var p=c.filter((function(e,t){var r=e.visible;return void 0===r||!0===r})),h=!1,g=p.map((function(e,t){return h=h||void 0!==e.groupId,e}));if(h){var v=n.nest().key((function(e,t){return void 0!==e.groupId?e.groupId:"unstacked"})).entries(g),m=[],y=v.map((function(e,t){if("unstacked"===e.key)return e.values;var r=e.values[0].r.map((function(e,t){return 0}));return e.values.forEach((function(e,t,n){e.yStack=[r],m.push(r),r=o.util.sumArrays(e.r,r)})),e.values}));p=n.merge(y)}p.forEach((function(e,t){e.t=Array.isArray(e.t[0])?e.t:[e.t],e.r=Array.isArray(e.r[0])?e.r:[e.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(e,t){return e.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(e,t){return e.t}))),T="string"==typeof k[0];T&&(k=o.util.deduplicate(k),w=k.slice(),k=n.range(k.length),p=p.map((function(e,t){var r=e;return e.t=[k],h&&(r.yStack=e.yStack),r})));var M=p.filter((function(e,t){return"LinePlot"===e.geometry||"DotPlot"===e.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(e,t){return parseFloat(e.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,void 0===(e=n.select(this).select("svg.chart-root"))||e.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"),E=this.appendChild(this.ownerDocument.importNode(z.documentElement,!0));e=n.select(E)}e.select(".guides-group").style({"pointer-events":"none"}),e.select(".angular.axis-group").style({"pointer-events":"none"}),e.select(".radial.axis-group").style({"pointer-events":"none"});var R,I=e.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(e,t){return" "+e+" 0 "+d.font.outlineColor})).join(",")};if(d.showLegend){R=e.select(".legend-group").attr({transform:"translate("+[x,d.margin.top]+")"}).style({display:"block"});var H=p.map((function(e,t){var r=o.util.cloneJson(e);return r.symbol="DotPlot"===e.geometry?e.dotType||"circle":"LinePlot"!=e.geometry?"square":"line",r.visibleInLegend=void 0===e.visibleInLegend||e.visibleInLegend,r.color="LinePlot"===e.geometry?e.strokeColor:e.color,r}));o.Legend().config({data:p.map((function(e,t){return e.name||"Element"+t})),legendConfig:a({},o.Legend.defaultConfig().legendConfig,{container:R,elements:H,reverseOrder:d.legend.reverseOrder})})();var B=R.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(),R.attr("transform","translate("+[_[0]+x,_[1]-x]+")")}else R=e.select(".legend-group").style({display:"none"});e.attr({width:d.width,height:d.height}).style({opacity:d.opacity}),I.attr("transform","translate("+_+")").style({cursor:"crosshair"});var j=[(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(j[0]=Math.max(0,j[0]),j[1]=Math.max(0,j[1]),e.select(".outer-group").attr("transform","translate("+j+")"),d.title&&d.title.text){var V=e.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=e.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=e.select("circle.background-circle").attr({r:x}).style({fill:d.backgroundColor,stroke:d.stroke});function X(e,t){return l(e)%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(e,t){return this.textContent+d.radialAxis.ticksSuffix})).style(N).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(e,t){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=e.select(".angular.axis-group").selectAll("g.angular-tick").data(D),J=W.enter().append("g").classed("angular-tick",!0);W.attr({transform:function(e,t){return"rotate("+X(e)+")"}}).style({display:d.angularAxis.visible?"block":"none"}),W.exit().remove(),J.append("line").classed("grid-line",!0).classed("major",(function(e,t){return t%(d.minorTicks+1)==0})).classed("minor",(function(e,t){return!(t%(d.minorTicks+1)==0)})).style(F),J.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"}),J.append("text").classed("axis-text",!0).style(N);var $=W.select("text.axis-text").attr({x:x+d.labelOffset,dy:i+"em",transform:function(e,t){var r=X(e),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(e,t){return t%(d.minorTicks+1)!=0?"":w?w[e]+d.angularAxis.ticksSuffix:e+d.angularAxis.ticksSuffix})).style(N);d.angularAxis.rewriteTicks&&$.text((function(e,t){return t%(d.minorTicks+1)!=0?"":d.angularAxis.rewriteTicks(this.textContent,t)}));var Q=n.max(I.selectAll(".angular-tick text")[0].map((function(e,t){return e.getCTM().e+e.getBBox().width})));R.attr({transform:"translate("+[x+Q,d.margin.top]+")"});var K=e.select("g.geometry-group").selectAll("g").size()>0,ee=e.select("g.geometry-group").selectAll("g.geometry").data(p);if(ee.enter().append("g").attr({class:function(e,t){return"geometry geometry"+t}}),ee.exit().remove(),p[0]||K){var te=[];p.forEach((function(e,t){var n={};n.radialScale=r,n.angularScale=l,n.container=ee.filter((function(e,r){return r==t})),n.geometry=e.geometry,n.orientation=d.orientation,n.direction=d.direction,n.index=t,te.push({data:e,geometryConfig:n})}));var re=n.nest().key((function(e,t){return void 0!==e.data.groupId||"unstacked"})).entries(te),ne=[];re.forEach((function(e,t){"unstacked"===e.key?ne=ne.concat(e.values.map((function(e,t){return[e]}))):ne.push(e.values)})),ne.forEach((function(e,t){var r;r=Array.isArray(e)?e[0].geometryConfig.geometry:e.geometryConfig.geometry;var n=e.map((function(e,t){return a(o[r].defaultConfig(),e)}));o[r]().config(n)()}))}var ae,ie,oe=e.select(".guides-group"),le=e.select(".tooltips-group"),se=o.tooltipPanel().config({container:le,fontSize:8})(),ce=o.tooltipPanel().config({container:le,fontSize:8})(),ue=o.tooltipPanel().config({container:le,hasTick:!0})();if(!T){var fe=oe.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});I.on("mousemove.angular-guide",(function(e,t){var r=o.util.getMousePos(Z).angle;fe.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-d.orientation)%360;ae=l.invert(n);var a=o.util.convertToCartesian(x+12,r+180);se.text(o.util.round(ae)).move([a[0]+_[0],a[1]+_[1]])})).on("mouseout.angular-guide",(function(e,t){oe.select("line").style({opacity:0})}))}var de=oe.select("circle").style({stroke:"grey",fill:"none"});I.on("mousemove.radial-guide",(function(e,t){var n=o.util.getMousePos(Z).radius;de.attr({r:n}).style({opacity:.5}),ie=r.invert(o.util.getMousePos(Z).radius);var a=o.util.convertToCartesian(n,d.radialAxis.orientation);ce.text(o.util.round(ie)).move([a[0]+_[0],a[1]+_[1]])})).on("mouseout.radial-guide",(function(e,t){de.style({opacity:0}),ue.hide(),se.hide(),ce.hide()})),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",(function(t,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(t[0]),r:o.util.round(t[1])};T&&(c.t=w[t[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),d=e.node().getBoundingClientRect(),p=[f.left+f.width/2-j[0]-d.left,f.top+f.height/2-j[1]-d.top];ue.config({color:l}).text(u),ue.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(e,t){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ue.show()})).on("mouseout.tooltip",(function(e,t){ue.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},config:function(e){if(!arguments.length)return s;var t=o.util.cloneJson(e);return t.data.forEach((function(e,t){s.data[t]||(s.data[t]={}),a(s.data[t],o.Axis.defaultConfig().data[0]),a(s.data[t],e)})),a(s.layout,o.Axis.defaultConfig().layout),a(s.layout,t.layout),this},getLiveConfig:function(){return u},getinputConfig:function(){return c},radialScale:function(e){return r},angularScale:function(e){return l},svg:function(){return e}};return n.rebind(d,f,"on"),d},o.Axis.defaultConfig=function(e,t){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(e,t){for(var r in e)r in t&&(t[r]=e[r])},o.util._extend=function(e,t){for(var r in e)t[r]=e[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(e,t){var r=t||6;return n.range(0,360+r,r).map((function(t,r){var n=t*Math.PI/180;return[t,e(n)]}))},o.util.dataFromEquation=function(e,t,r){var a=t||6,i=[],o=[];n.range(0,360+a,a).forEach((function(t,r){var n=t*Math.PI/180,a=e(n);i.push(t),o.push(a)}));var l={t:i,r:o};return r&&(l.name=r),l},o.util.ensureArray=function(e,t){if(void 0===e)return null;var r=[].concat(e);return n.range(t).map((function(e,t){return r[t]||r[0]}))},o.util.fillArrays=function(e,t,r){return t.forEach((function(t,n){e[t]=o.util.ensureArray(e[t],r)})),e},o.util.cloneJson=function(e){return JSON.parse(JSON.stringify(e))},o.util.validateKeys=function(e,t){"string"==typeof t&&(t=t.split("."));var r=t.shift();return e[r]&&(!t.length||objHasKeys(e[r],t))},o.util.sumArrays=function(e,t){return n.zip(e,t).map((function(e,t){return n.sum(e)}))},o.util.arrayLast=function(e){return e[e.length-1]},o.util.arrayEqual=function(e,t){for(var r=Math.max(e.length,t.length,1);r-- >=0&&e[r]===t[r];);return-2===r},o.util.flattenArray=function(e){for(var t=[];!o.util.arrayEqual(t,e);)t=e,e=[].concat.apply([],e);return e},o.util.deduplicate=function(e){return e.filter((function(e,t,r){return r.indexOf(e)==t}))},o.util.convertToCartesian=function(e,t){var r=t*Math.PI/180;return[e*Math.cos(r),e*Math.sin(r)]},o.util.round=function(e,t){var r=t||2,n=Math.pow(10,r);return Math.round(e*n)/n},o.util.getMousePos=function(e){var t=n.mouse(e.node()),r=t[0],a=t[1],i={};return i.x=r,i.y=a,i.pos=t,i.angle=180*(Math.atan2(a,r)+Math.PI)/Math.PI,i.radius=Math.sqrt(r*r+a*a),i},o.util.duplicatesCount=function(e){for(var t,r={},n={},a=0,i=e.length;a<i;a++)(t=e[a])in r?(r[t]++,n[t]=r[t]):r[t]=1;return n},o.util.duplicates=function(e){return Object.keys(o.util.duplicatesCount(e))},o.util.translator=function(e,t,r,n){if(n){var a=r.slice();r=t,t=a}var i=t.reduce((function(e,t){if(void 0!==e)return e[t]}),e);void 0!==i&&(t.reduce((function(e,r,n){if(void 0!==e)return n===t.length-1&&delete e[r],e[r]}),e),r.reduce((function(e,t,n){return void 0===e[t]&&(e[t]={}),n===r.length-1&&(e[t]=i),e[t]}),e))},o.PolyChart=function(){var e=[o.PolyChart.defaultConfig()],t=n.dispatch("hover"),r={solid:"none",dash:[5,2],dot:[2,5]};function i(){var t=e[0].geometryConfig,a=t.container;"string"==typeof a&&(a=n.select(a)),a.datum(e).each((function(e,a){var i=!!e[0].data.yStack,o=e.map((function(e,t){return i?n.zip(e.data.t[0],e.data.r[0],e.data.yStack[0]):n.zip(e.data.t[0],e.data.r[0])})),l=t.angularScale,s=t.radialScale.domain()[0],c={bar:function(r,a,i){var o=e[i].data,s=t.radialScale(r[1])-t.radialScale(0),c=t.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(e,r){return"rotate("+(t.orientation+l(e[0]))+")"}})},dot:function(r,a,i){var o=r[2]?[r[0],r[1]+r[2]]:r,l=n.svg.symbol().size(e[i].data.dotSize).type(e[i].data.dotType)(r,a);n.select(this).attr({class:"mark dot",d:l,transform:function(e,r){var n,a={x:(n=function(e,r){return{r:t.radialScale(e[1]),t:(t.angularScale(e[0])+t.orientation)*Math.PI/180}}(o)).r*Math.cos(n.t),y:n.r*Math.sin(n.t)};return"translate("+[a.x,a.y]+")"}})}},u=n.svg.line.radial().interpolate(e[0].data.lineInterpolation).radius((function(e){return t.radialScale(e[1])})).angle((function(e){return t.angularScale(e[0])*Math.PI/180}));c.line=function(r,a,i){var l=r[2]?o[i].map((function(e,t){return[e[0],e[1]+e[2]]})):o[i];if(n.select(this).each(c.dot).style({opacity:function(t,r){return+e[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(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(e,t){return h.fill(r,a,i)},"fill-opacity":0,stroke:function(e,t){return h.stroke(r,a,i)},"stroke-width":function(e,t){return h["stroke-width"](r,a,i)},"stroke-dasharray":function(e,t){return h["stroke-dasharray"](r,a,i)},opacity:function(e,t){return h.opacity(r,a,i)},display:function(e,t){return h.display(r,a,i)}})}};var f=t.angularScale.range(),d=Math.abs(f[1]-f[0])/o[0].length*Math.PI/180,p=n.svg.arc().startAngle((function(e){return-d/2})).endAngle((function(e){return d/2})).innerRadius((function(e){return t.radialScale(s+(e[2]||0))})).outerRadius((function(e){return t.radialScale(s+(e[2]||0))+t.radialScale(e[1])}));c.arc=function(e,r,a){n.select(this).attr({class:"mark arc",d:p,transform:function(e,r){return"rotate("+(t.orientation+l(e[0])+90)+")"}})};var h={fill:function(t,r,n){return e[n].data.color},stroke:function(t,r,n){return e[n].data.strokeColor},"stroke-width":function(t,r,n){return e[n].data.strokeSize+"px"},"stroke-dasharray":function(t,n,a){return r[e[a].data.strokeDash]},opacity:function(t,r,n){return e[n].data.opacity},display:function(t,r,n){return void 0===e[n].data.visible||e[n].data.visible?"block":"none"}},g=n.select(this).selectAll("g.layer").data(o);g.enter().append("g").attr({class:"layer"});var v=g.selectAll("path.mark").data((function(e,t){return e}));v.enter().append("path").attr({class:"mark"}),v.style(h).each(c[t.geometryType]),v.exit().remove(),g.exit().remove()}))}return i.config=function(t){return arguments.length?(t.forEach((function(t,r){e[r]||(e[r]={}),a(e[r],o.PolyChart.defaultConfig()),a(e[r],t)})),this):e},i.getColorScale=function(){},n.rebind(i,t,"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 e=o.Legend.defaultConfig(),t=n.dispatch("hover");function r(){var t=e.legendConfig,i=e.data.map((function(e,r){return[].concat(e).map((function(e,n){var i=a({},t.elements[r]);return i.name=e,i.color=[].concat(t.elements[r].color)[n],i}))})),o=n.merge(i);o=o.filter((function(e,r){return t.elements[r]&&(t.elements[r].visibleInLegend||void 0===t.elements[r].visibleInLegend)})),t.reverseOrder&&(o=o.reverse());var l=t.container;("string"==typeof l||l.nodeName)&&(l=n.select(l));var s=o.map((function(e,t){return e.color})),c=t.fontSize,u=null==t.isContinuous?"number"==typeof o[0]:t.isContinuous,f=u?t.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(e,t){return t/(s.length-1)*100+"%"}}).style({"stop-color":function(e,t){return e}}),d.append("rect").classed("legend-mark",!0).attr({height:t.height,width:t.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(e,t){return"translate("+[c/2,v(t)+c/2]+")"},d:function(e,t){var r,a,i,o=e.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(e,t){return g(t)}}),y.exit().remove()}var x=n.svg.axis().scale(v).orient("right"),b=d.select("g.legend-axis").attr({transform:"translate("+[u?t.colorBandWidth:c,c/2]+")"}).call(x);return b.selectAll(".domain").style({fill:"none",stroke:"none"}),b.selectAll("line").style({fill:"none",stroke:u?t.textColor:"none"}),b.selectAll("text").style({fill:t.textColor,"font-size":t.fontSize}).text((function(e,t){return o[t].name})),r}return r.config=function(t){return arguments.length?(a(e,t),this):e},n.rebind(r,t,"on"),r},o.Legend.defaultConfig=function(e,t){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 e,t,r,i={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},l="tooltip-"+o.tooltipPanel.uid++,s=10,c=function(){var n=(e=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"}),t=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||"";t.style({fill:u,"font-size":i.fontSize+"px"}).text(f);var d=i.padding,p=t.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),e.attr({transform:"translate("+[s,-v/2+2*d]+")"}),e.style({display:"block"}),c},c.move=function(t){if(e)return e.attr({transform:"translate("+[t[0],t[1]]+")"}).style({display:"block"}),c},c.hide=function(){if(e)return e.style({display:"none"}),c},c.show=function(){if(e)return e.style({display:"block"}),c},c.config=function(e){return a(i,e),c},c},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){return{convert:function(e,t){var r={};if(e.data&&(r.data=e.data.map((function(e,r){var n=a({},e);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(e,r){o.util.translator.apply(null,e.concat(t))})),t||delete n.marker,t&&delete n.groupId,t?("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})),!t&&e.layout&&"stack"===e.layout.barmode)){var i=o.util.duplicates(r.data.map((function(e,t){return e.geometry})));r.data.forEach((function(e,t){var n=i.indexOf(e.geometry);-1!=n&&(r.data[t].groupId=n)}))}if(e.layout){var l=a({},e.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(e,r){o.util.translator.apply(null,e.concat(t))})),t?(void 0!==l.tickLength&&(l.angularaxis.ticklen=l.tickLength,delete l.tickLength),l.tickColor&&(l.angularaxis.tickcolor=l.tickColor,delete l.tickColor)):(l.angularAxis&&void 0!==l.angularAxis.ticklen&&(l.tickLength=l.angularAxis.ticklen),l.angularAxis&&void 0!==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&&void 0!==l.margin.t){var s=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};n.entries(l.margin).forEach((function(e,t){u[c[s.indexOf(e.key)]]=e.value})),l.margin=u}t&&(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}}}},{"../../../constants/alignment":145,"../../../lib":168,d3:7}],251:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../../lib"),i=e("../../../components/color"),o=e("./micropolar"),l=e("./undo_manager"),s=a.extendDeepAll,c=t.exports={};c.framework=function(e){var t,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(),t=t?s(t,r):r,a||(a=o.Axis()),i=o.adapter.plotly().convert(t),a.config(i).render(u),e.data=t.data,e.layout=t.layout,c.fillLayout(e),t}return d.isPolar=!0,d.svg=function(){return a.svg()},d.getConfig=function(){return t},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 e,n,a=this,i=o.util.cloneJson(t);e=i,n=r,f.add({undo:function(){n&&a(n)},redo:function(){a(e)}}),r=o.util.cloneJson(i)},d.undo=function(){f.undo()},d.redo=function(){f.redo()},d},c.fillLayout=function(e){var t=n.select(e).selectAll(".plot-container"),r=t.selectAll(".svg-container"),a=e.framework&&e.framework.svg&&e.framework.svg(),o={width:800,height:600,paper_bgcolor:i.background,_container:t,_paperdiv:r,_paper:a};e._fullLayout=s(o,e.layout)}},{"../../../components/color":43,"../../../lib":168,"./micropolar":250,"./undo_manager":252,d3:7}],252:[function(e,t,r){"use strict";t.exports=function(){var e,t=[],r=-1,n=!1;function a(e,t){return e?(n=!0,e[t](),n=!1,this):this}return{add:function(e){return n||(t.splice(r+1,t.length-r),t.push(e),r=t.length-1),this},setCallback:function(t){e=t},undo:function(){var n=t[r];return n?(a(n,"undo"),r-=1,e&&e(n.undo),this):this},redo:function(){var n=t[r+1];return n?(a(n,"redo"),r+=1,e&&e(n.redo),this):this},clear:function(){t=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return r<t.length-1},getCommands:function(){return t},getPreviousCommand:function(){return t[r-1]},getIndex:function(){return r}}}},{}],253:[function(e,t,r){"use strict";function n(e){var t=e.description?" "+e.description:"",r=e.keys||[];if(r.length>0){for(var n=[],a=0;a<r.length;a++)n[a]="`"+r[a]+"`";t+="Finally, the template string has access to ",t=1===r.length?"variable "+n[0]:"variables "+n.slice(0,-1).join(", ")+" and "+n.slice(-1)+"."}return t}['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}".',e("../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}".',e("../constants/docs").DATE_FORMAT_LINK,"for details on the date formatting syntax."].join(" "),r.hovertemplateAttrs=function(e,t){e=e||{},n(t=t||{});var r={valType:"string",dflt:"",editType:e.editType||"none"};return!1!==e.arrayOk&&(r.arrayOk=!0),r},r.texttemplateAttrs=function(e,t){e=e||{},n(t=t||{});var r={valType:"string",dflt:"",editType:e.editType||"calc"};return!1!==e.arrayOk&&(r.arrayOk=!0),r}},{"../constants/docs":146}],254:[function(e,t,r){"use strict";var n=e("./lib/loggers"),a=e("./lib/noop"),i=e("./lib/push_unique"),o=e("./lib/is_plain_object"),l=e("./lib/dom").addStyleRule,s=e("./lib/extend"),c=e("./plots/attributes"),u=e("./plots/layout_attributes"),f=s.extendFlat,d=s.extendDeepAll;function p(e){var t=e.name,a=e.categories,i=e.meta;if(r.modules[t])n.log("Type "+t+" already registered");else{r.subplotsRegistry[e.basePlotModule.name]||function(e){var t=e.name;if(r.subplotsRegistry[t])n.log("Plot type "+t+" already registered.");else for(var a in m(e),r.subplotsRegistry[t]=e,r.componentsRegistry)b(a,e.name)}(e.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[t]={_module:e,categories:o},i&&Object.keys(i).length&&(r.modules[t].meta=i),r.allTypes.push(t),r.componentsRegistry)y(c,t);e.layoutAttributes&&f(r.traceLayoutAttributes,e.layoutAttributes);var u=e.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(e){if("string"!=typeof e.name)throw new Error("Component module *name* must be a string.");var t=e.name;for(var n in r.componentsRegistry[t]=e,e.layoutAttributes&&(e.layoutAttributes._isLinkedToArray&&i(r.layoutArrayContainers,t),m(e)),r.modules)y(t,n);for(var a in r.subplotsRegistry)b(t,a);for(var o in r.transformsRegistry)x(t,o);e.schema&&e.schema.layout&&d(u,e.schema.layout)}function g(e){if("string"!=typeof e.name)throw new Error("Transform module *name* must be a string.");var t="Transform module "+e.name,a="function"==typeof e.transform,i="function"==typeof e.calcTransform;if(!a&&!i)throw new Error(t+" is missing a *transform* or *calcTransform* method.");for(var l in a&&i&&n.log([t+" has both a *transform* and *calcTransform* methods.","Please note that all *transform* methods are executed","before all *calcTransform* methods."].join(" ")),o(e.attributes)||n.log(t+" registered without an *attributes* object."),"function"!=typeof e.supplyDefaults&&n.log(t+" registered without a *supplyDefaults* method."),r.transformsRegistry[e.name]=e,r.componentsRegistry)x(l,e.name)}function v(e){var t=e.name,n=t.split("-")[0],a=e.dictionary,i=e.format,o=a&&Object.keys(a).length,l=i&&Object.keys(i).length,s=r.localeRegistry,c=s[t];if(c||(s[t]=c={}),n!==t){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(e){if(e.layoutAttributes){var t=e.layoutAttributes._arrayAttrRegexps;if(t)for(var n=0;n<t.length;n++)i(r.layoutArrayRegexes,t[n])}}function y(e,t){var n=r.componentsRegistry[e].schema;if(n&&n.traces){var a=n.traces[t];a&&d(r.modules[t]._module.attributes,a)}}function x(e,t){var n=r.componentsRegistry[e].schema;if(n&&n.transforms){var a=n.transforms[t];a&&d(r.transformsRegistry[t].attributes,a)}}function b(e,t){var n=r.componentsRegistry[e].schema;if(n&&n.subplots){var a=r.subplotsRegistry[t],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 _(e){return"object"==typeof e&&(e=e.type),e}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(e){if(r.collectableSubplotTypes=null,!e)throw new Error("No argument passed to Plotly.register.");e&&!Array.isArray(e)&&(e=[e]);for(var t=0;t<e.length;t++){var n=e[t];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(e){var t=r.modules[_(e)];return!!t&&t._module},r.traceIs=function(e,t){if("various"===(e=_(e)))return!1;var a=r.modules[e];return a||(e&&"area"!==e&&n.log("Unrecognized trace type "+e+"."),a=r.modules[c.type.dflt]),!!a.categories[t]},r.getTransformIndices=function(e,t){for(var r=[],n=e.transforms||[],a=0;a<n.length;a++)n[a].type===t&&r.push(a);return r},r.hasTransform=function(e,t){for(var r=e.transforms||[],n=0;n<r.length;n++)if(r[n].type===t)return!0;return!1},r.getComponentMethod=function(e,t){var n=r.componentsRegistry[e];return n&&n[t]||a},r.call=function(){var e=arguments[0],t=[].slice.call(arguments,1);return r.apiMethodRegistry[e].apply(null,t)}},{"./lib/dom":161,"./lib/extend":163,"./lib/is_plain_object":169,"./lib/loggers":172,"./lib/noop":177,"./lib/push_unique":181,"./plots/attributes":209,"./plots/layout_attributes":244}],255:[function(e,t,r){"use strict";var n=e("../registry"),a=e("../lib"),i=a.extendFlat,o=a.extendDeep;function l(e){var t;switch(e){case"themes__thumb":t={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":t={title:{text:""},hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:t={}}return t}t.exports=function(e,t){var r;e.framework&&e.framework.isPolar&&(e=e.framework.getConfig());var a,s=e.data,c=e.layout,u=o([],s),f=o({},c,l(t.tileClass)),d=e._context||{};if(t.width&&(f.width=t.width),t.height&&(f.height=t.height),"thumbnail"===t.tileClass||"themes__thumb"===t.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(t.annotations))for(r=0;r<t.annotations.length;r++)f.annotations.push(t.annotations[r]);var g=Object.keys(f).filter((function(e){return e.match(/^scene\d*$/)}));if(g.length){var v={};for("thumbnail"===t.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");t.tileClass&&(y.className=t.tileClass);var x={gd:y,td:y,layout:f,data:u,config:{staticPlot:void 0===t.staticPlot||t.staticPlot,plotGlPixelRatio:void 0===t.plotGlPixelRatio?2:t.plotGlPixelRatio,displaylogo:t.displaylogo||!1,showLink:t.showLink||!1,showTips:t.showTips||!1,mapboxAccessToken:d.mapboxAccessToken}};return"transparent"!==t.setBackground&&(x.config.setBackground=t.setBackground||"opaque"),x.gd.defaultLayout=l(t.tileClass),x}},{"../lib":168,"../registry":254}],256:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plot_api/to_image"),i=e("./filesaver"),o=e("./helpers");t.exports=function(e,t){var r;return n.isPlainObject(e)||(r=n.getGraphDiv(e)),(t=t||{}).format=t.format||"png",t.imageDataOnly=!0,new Promise((function(l,s){r&&r._snapshotInProgress&&s(new Error("Snapshotting already in progress.")),n.isIE()&&"svg"!==t.format&&s(new Error(o.MSG_IE_BAD_FORMAT)),r&&(r._snapshotInProgress=!0);var c=a(e,t),u=t.filename||e.fn||"newplot";u+="."+t.format.replace("-","."),c.then((function(e){return r&&(r._snapshotInProgress=!1),i(e,u,t.format)})).then((function(e){l(e)})).catch((function(e){r&&(r._snapshotInProgress=!1),s(e)}))}))}},{"../lib":168,"../plot_api/to_image":205,"./filesaver":257,"./helpers":258}],257:[function(e,t,r){"use strict";var n=e("../lib"),a=e("./helpers");t.exports=function(e,t,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(e)),l(t)}return n.isIE()?(c=a.createBlob(e,"svg"),window.navigator.msSaveBlob(c,t),c=null,l(t)):o?(c=a.createBlob(e,r),u=a.createObjectURL(c),i.href=u,i.download=t,document.body.appendChild(i),i.click(),document.body.removeChild(i),a.revokeObjectURL(u),c=null,l(t)):void s(new Error("download error"))}))}},{"../lib":168,"./helpers":258}],258:[function(e,t,r){"use strict";var n=e("../registry");r.getDelay=function(e){return e._has&&(e._has("gl3d")||e._has("gl2d")||e._has("mapbox"))?500:0},r.getRedrawFunc=function(e){return function(){var t=e._fullLayout||{};(!t._has||!t._has("polar"))&&e.data&&e.data[0]&&e.data[0].r||n.getComponentMethod("colorbar","draw")(e)}},r.encodeSVG=function(e){return"data:image/svg+xml,"+encodeURIComponent(e)},r.encodeJSON=function(e){return"data:application/json,"+encodeURIComponent(e)};var a=window.URL||window.webkitURL;r.createObjectURL=function(e){return a.createObjectURL(e)},r.revokeObjectURL=function(e){return a.revokeObjectURL(e)},r.createBlob=function(e,t){if("svg"===t)return new window.Blob([e],{type:"image/svg+xml;charset=utf-8"});if("full-json"===t)return new window.Blob([e],{type:"application/json;charset=utf-8"});var r=function(e){for(var t=e.length,r=new ArrayBuffer(t),n=new Uint8Array(r),a=0;a<t;a++)n[a]=e.charCodeAt(a);return r}(window.atob(e));return new window.Blob([r],{type:"image/"+t})},r.octetStream=function(e){document.location.href="data:application/octet-stream"+e},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":254}],259:[function(e,t,r){"use strict";var n=e("./helpers"),a={getDelay:n.getDelay,getRedrawFunc:n.getRedrawFunc,clone:e("./cloneplot"),toSVG:e("./tosvg"),svgToImg:e("./svgtoimg"),toImage:e("./toimage"),downloadImage:e("./download")};t.exports=a},{"./cloneplot":255,"./download":256,"./helpers":258,"./svgtoimg":260,"./toimage":261,"./tosvg":262}],260:[function(e,t,r){"use strict";var n=e("../lib"),a=e("events").EventEmitter,i=e("./helpers");t.exports=function(e){var t=e.emitter||new a,r=new Promise((function(a,o){var l=window.Image,s=e.svg,c=e.format||"png";if(n.isIE()&&"svg"!==c){var u=new Error(i.MSG_IE_BAD_FORMAT);return o(u),e.promise?r:t.emit("error",u)}var f,d,p=e.canvas,h=e.scale||1,g=e.width||300,v=e.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)),!e.promise)return t.emit("error",n)}a(r),e.promise||t.emit("success",r)},b.onerror=function(r){if(f=null,i.revokeObjectURL(d),o(r),!e.promise)return t.emit("error",r)},b.src=d}));return e.promise?r:t}},{"../lib":168,"./helpers":258,events:6}],261:[function(e,t,r){"use strict";var n=e("events").EventEmitter,a=e("../registry"),i=e("../lib"),o=e("./helpers"),l=e("./cloneplot"),s=e("./tosvg"),c=e("./svgtoimg");t.exports=function(e,t){var r=new n,u=l(e,{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 e=o.getDelay(f._fullLayout);setTimeout((function(){var e=s(f),n=document.createElement("canvas");n.id=i.randstr(),(r=c({format:t.format,width:f._fullLayout.width,height:f._fullLayout.height,canvas:n,emitter:r,svg:e})).clean=function(){f&&document.body.removeChild(f)}}),e)})).catch((function(e){r.emit("error",e)})),r}},{"../lib":168,"../registry":254,"./cloneplot":255,"./helpers":258,"./svgtoimg":260,"./tosvg":262,events:6}],262:[function(e,t,r){"use strict";var n=e("d3"),a=e("../lib"),i=e("../components/drawing"),o=e("../components/color"),l=e("../constants/xmlns_namespaces"),s=/"/g,c=new RegExp('("TOBESTRIPPED)|(TOBESTRIPPED")',"g");t.exports=function(e,t,r){var u,f=e._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(e)}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 e=n.select(this);if("hidden"!==this.style.visibility&&"none"!==this.style.display){e.style({visibility:null,display:null});var t=this.style.fontFamily;t&&-1!==t.indexOf('"')&&e.style("font-family",t.replace(s,"TOBESTRIPPED"))}else e.remove()})),f._gradientUrlQueryParts){var _=[];for(var w in f._gradientUrlQueryParts)_.push(w);_.length&&d.selectAll(_.join(",")).each((function(){var e=n.select(this),t=this.style.fill;t&&-1!==t.indexOf("url(")&&e.style("fill",t.replace(s,"TOBESTRIPPED"));var r=this.style.stroke;r&&-1!==r.indexOf("url(")&&e.style("stroke",r.replace(s,"TOBESTRIPPED"))}))}"pdf"!==t&&"eps"!==t||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"===t&&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=(k=(k=function(e){var t=n.select("body").append("div").style({display:"none"}).html(""),r=e.replace(/(&[^;]*;)/gi,(function(e){return"&lt;"===e?"&#60;":"&rt;"===e?"&#62;":-1!==e.indexOf("<")||-1!==e.indexOf(">")?"":t.html(e).text()}));return t.remove(),r}(k)).replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&amp;")).replace(c,"'"),a.isIE()&&(k=(k=(k=k.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),k}},{"../components/color":43,"../components/drawing":65,"../constants/xmlns_namespaces":149,"../lib":168,d3:7}],263:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;r<e.length;r++)e[r].i=r;n.mergeArray(t.text,e,"tx"),n.mergeArray(t.hovertext,e,"htx");var a=t.marker;if(a){n.mergeArray(a.opacity,e,"mo",!0),n.mergeArray(a.color,e,"mc");var i=a.line;i&&(n.mergeArray(i.color,e,"mlc"),n.mergeArrayCastPositive(i.width,e,"mlw"))}}},{"../../lib":168}],264:[function(e,t,r){"use strict";var n=e("../scatter/attributes"),a=e("../../plots/template_attributes").hovertemplateAttrs,i=e("../../plots/template_attributes").texttemplateAttrs,o=e("../../components/colorscale/attributes"),l=e("../../plots/font_attributes"),s=e("./constants"),c=e("../../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"}});t.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":50,"../../lib/extend":163,"../../plots/font_attributes":240,"../../plots/template_attributes":253,"../scatter/attributes":294,"./constants":266}],265:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axes"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/calc"),o=e("./arrays_to_calcdata"),l=e("../scatter/calc_selection");t.exports=function(e,t){var r,s,c=n.getFromId(e,t.xaxis||"x"),u=n.getFromId(e,t.yaxis||"y");"h"===t.orientation?(r=c.makeCalcdata(t,"x"),s=u.makeCalcdata(t,"y")):(r=u.makeCalcdata(t,"y"),s=c.makeCalcdata(t,"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]},t.ids&&(d[p].id=String(t.ids[p]));return a(t,"marker")&&i(e,t,{vals:t.marker.color,containerStr:"marker",cLetter:"c"}),a(t,"marker.line")&&i(e,t,{vals:t.marker.line.color,containerStr:"marker.line",cLetter:"c"}),o(d,t),l(d,t),d}},{"../../components/colorscale/calc":51,"../../components/colorscale/helpers":54,"../../plots/cartesian/axes":212,"../scatter/calc_selection":296,"./arrays_to_calcdata":263}],266:[function(e,t,r){"use strict";t.exports={TEXTPAD:3,eventDataKeys:["value","label"]}},{}],267:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib").isArrayOrTypedArray,i=e("../../constants/numerical").BADNUM,o=e("../../registry"),l=e("../../plots/cartesian/axes"),s=e("../../plots/cartesian/axis_ids").getAxisGroup,c=e("./sieve.js");function u(e,t,r,o,u){if(o.length){var b,_,w,k;switch(function(e,t){var r,i;for(r=0;r<t.length;r++){var o,l=t[r],s=l[0].trace,c="funnel"===s.type?s._base:s.base,u="h"===s.orientation?s.xcalendar:s.ycalendar,f="category"===e.type||"multicategory"===e.type?function(){return null}:e.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(t,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(e,t,r,n,a){var o=new c(n,{sepNegVal:!1,overlapNoMerge:!a.norm});(function(e,t,r,n){for(var a=e._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,t._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(t,r),g(t,r,f)})(e,t,o,a),function(e){for(var t=e.traces,r=0;r<t.length;r++){var n=t[r];if(void 0===n[0].trace.base)for(var a=new c([n],{sepNegVal:!0,overlapNoMerge:!0}),o=0;o<n.length;o++){var l=n[o];if(l.p!==i){var s=a.put(l.p,l.b+l.s);s&&(l.b=s)}}}}(o),a.norm?(m(o),y(r,o,a)):v(r,o)}(e,t,r,_,u),b.length&&f(t,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(e,t,r,n,a){var o=new c(n,{sepNegVal:"relative"===a.mode,overlapNoMerge:!(a.norm||"stack"===a.mode||"relative"===a.mode)});d(t,o,a),function(e,t,r){var n,a,o,s,c,u,f=x(e),d=t.traces;for(s=0;s<d.length;s++)if("funnel"===(a=(n=d[s])[0].trace).type)for(c=0;c<n.length;c++)(u=n[c]).s!==i&&t.put(u.p,-.5*u.s);for(s=0;s<d.length;s++){o="funnel"===(a=(n=d[s])[0].trace).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=t.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[e._id]=l.findExtremes(e,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];p.s!==i&&p.b+p.s===o.get(p.p,p.s)&&(p._outmost=!0)}a.norm&&y(r,o,a)}(0,t,r,_,u),b.length&&f(t,r,b,u)}!function(e,t){var r,a,i,o=x(t),l={},s=1/0,c=-1/0;for(r=0;r<e.length;r++)for(i=e[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(e){return String(Math.round(f*(e-s)))};for(r=0;r<e.length;r++){(i=e[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,t)}}function f(e,t,r,n){for(var a=0;a<r.length;a++){var i=r[a],o=new c([i],{sepNegVal:!1,overlapNoMerge:!n.norm});d(e,o,n),n.norm?(m(o),y(t,o,n)):v(t,o)}}function d(e,t,r){for(var n=t.minDiff,a=t.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}t.binWidth=a[0][0].t.barwidth/100,p(t),h(e,t),g(e,t)}function p(e){var t,r,i=e.traces;for(t=0;t<i.length;t++){var o,l=i[t],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(e,t){for(var r=t.traces,n=x(e),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(e,t,r){var n=t.traces,a=t.minDiff/2;l.minDtick(e,t.minDiff,t.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[e._id]=l.findExtremes(e,h,{padded:!1})}}function v(e,t){for(var r=t.traces,n=x(e),a=0;a<r.length;a++){for(var i=r[a],o=i[0].trace,s=[],c=!1,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||(c=!0)}o._extremes[e._id]=l.findExtremes(e,s,{tozero:c,padded:!0})}}function m(e){for(var t=e.traces,r=0;r<t.length;r++)for(var n=t[r],a=0;a<n.length;a++){var o=n[a];o.s!==i&&e.put(o.p,o.b+o.s)}}function y(e,t,r){var a=t.traces,o=x(e),s="fraction"===r.norm?1:100,c=s/1e9,u=e.l2c(e.c2l(0)),f="stack"===r.mode?s:u;function d(t){return n(e.c2l(t))&&(t<u-c||t>f+c||!n(u))}for(var p=0;p<a.length;p++){for(var h=a[p],g=h[0].trace,v=[],m=!1,y=!1,b=0;b<h.length;b++){var _=h[b];if(_.s!==i){var w=Math.abs(s/t.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||(m=!0)}}g._extremes[e._id]=l.findExtremes(e,v,{tozero:m,padded:y})}}function x(e){return e._id.charAt(0)}t.exports={crossTraceCalc:function(e,t){for(var r=t.xaxis,n=t.yaxis,a=e._fullLayout,i=e._fullData,l=e.calcdata,s=[],c=[],f=0;f<i.length;f++){var d=i[f];if(!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]),d._computePh))for(var p=e.calcdata[f],h=0;h<p.length;h++)"function"==typeof p[h].ph0&&(p[h].ph0=p[h].ph0()),"function"==typeof p[h].ph1&&(p[h].ph1=p[h].ph1())}var g={mode:a.barmode,norm:a.barnorm,gap:a.bargap,groupgap:a.bargroupgap};u(e,r,n,c,g),u(e,n,r,s,g)},setGroupPositions:u}},{"../../constants/numerical":148,"../../lib":168,"../../plots/cartesian/axes":212,"../../plots/cartesian/axis_ids":215,"../../registry":254,"./sieve.js":277,"fast-isnumeric":9}],268:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../components/color"),i=e("../../registry"),o=e("../scatter/xy_defaults"),l=e("./style_defaults"),s=e("../../plots/cartesian/axis_ids").getAxisGroup,c=e("./attributes"),u=n.coerceFont;function f(e,t,r,n){var a=t.orientation,i=t[{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(t):f=u[c]={traces:[t],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}),t._offsetIndex=h.offsetIndex)}function d(e,t,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=!(e.textfont&&e.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")}t.exports={supplyDefaults:function(e,t,r,s){function u(r,a){return n.coerce(e,t,c,r,a)}if(o(e,t,s,u)){u("orientation",t.x&&!t.y?"h":"v"),u("base"),u("offset"),u("width"),u("text"),u("hovertext"),u("hovertemplate");var f=u("textposition");d(e,0,s,u,f,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),l(e,t,u,r,s);var p=(t.marker.line||{}).color,h=i.getComponentMethod("errorbars","supplyDefaults");h(e,t,p||a.defaultLine,{axis:"y"}),h(e,t,p||a.defaultLine,{axis:"x",inherit:"y"}),n.coerceSelectionMarkerOpacity(t,u)}else t.visible=!1},crossTraceDefaults:function(e,t){var r;function a(e){return n.coerce(r._input,r,c,e)}if("group"===t.barmode)for(var i=0;i<e.length;i++)"bar"===(r=e[i]).type&&(r._input,f(0,r,t,a))},handleGroupingDefaults:f,handleText:d}},{"../../components/color":43,"../../lib":168,"../../plots/cartesian/axis_ids":215,"../../registry":254,"../scatter/xy_defaults":320,"./attributes":264,"./style_defaults":279}],269:[function(e,t,r){"use strict";t.exports=function(e,t,r){return e.x="xVal"in t?t.xVal:t.x,e.y="yVal"in t?t.yVal:t.y,t.xa&&(e.xaxis=t.xa),t.ya&&(e.yaxis=t.ya),"h"===r.orientation?(e.label=e.y,e.value=e.x):(e.label=e.x,e.value=e.y),e}},{}],270:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("tinycolor2"),i=e("../../lib").isArrayOrTypedArray;r.coerceString=function(e,t,r){if("string"==typeof t){if(t||!e.noBlank)return t}else if(("number"==typeof t||!0===t)&&!e.strict)return String(t);return void 0!==r?r:e.dflt},r.coerceNumber=function(e,t,r){if(n(t)){t=+t;var a=e.min,i=e.max;if(!(void 0!==a&&t<a||void 0!==i&&t>i))return t}return void 0!==r?r:e.dflt},r.coerceColor=function(e,t,r){return a(t).isValid()?t:void 0!==r?r:e.dflt},r.coerceEnumerated=function(e,t,r){return e.coerceNumber&&(t=+t),-1!==e.values.indexOf(t)?t:void 0!==r?r:e.dflt},r.getValue=function(e,t){var r;return Array.isArray(e)?t<e.length&&(r=e[t]):r=e,r},r.getLineWidth=function(e,t){return 0<t.mlw?t.mlw:i(e.marker.line.width)?0:e.marker.line.width}},{"../../lib":168,"fast-isnumeric":9,tinycolor2:26}],271:[function(e,t,r){"use strict";var n=e("../../components/fx"),a=e("../../registry"),i=e("../../components/color"),o=e("../../lib").fillText,l=e("./helpers").getLineWidth,s=e("../../plots/cartesian/axes").hoverLabelText,c=e("../../constants/numerical").BADNUM;function u(e,t,r,a){var i,l,u,f,d,p,h,g=e.cd,v=g[0].trace,m=g[0].t,y="closest"===a,x="waterfall"===v.type,b=e.maxHoverDistance;function _(e){return e[u]-e.w/2}function w(e){return e[u]+e.w/2}var k=y?_:function(e){return Math.min(_(e),e.p-m.bardelta/2)},T=y?w:function(e){return Math.max(w(e),e.p+m.bardelta/2)};function M(e,t){return n.inbox(e-i,t-i,b+Math.min(1,Math.abs(t-e)/h)-1)}function A(e){return M(k(e),T(e))}function L(e){var t=l,r=e.b,a=e[f];if(x){var i=Math.abs(e.rawS)||0;t>0?a+=i:t<0&&(a-=i)}return n.inbox(r-t,a-t,b+(a-t)/(a-r)-1)}"h"===v.orientation?(i=r,l=t,u="y",f="x",d=L,p=A):(i=t,l=r,u="x",f="y",p=L,d=A);var S=e[u+"a"],C=e[f+"a"];h=Math.abs(S.r2c(S.range[1])-S.r2c(S.range[0]));var O=n.getDistanceFunction(a,d,p,(function(e){return(d(e)+p(e))/2}));if(n.getClosest(g,O,e),!1!==e.index&&g[e.index].p!==c){y||(k=function(e){return Math.min(_(e),e.p-m.bargroupwidth/2)},T=function(e){return Math.max(w(e),e.p+m.bargroupwidth/2)});var P=g[e.index],D=v.base?P.b+P.s:P.s;e[f+"0"]=e[f+"1"]=C.c2p(P[f],!0),e[f+"LabelVal"]=D;var z=m.extents[m.extents.round(P.p)];return e[u+"0"]=S.c2p(y?k(P):z[0],!0),e[u+"1"]=S.c2p(y?T(P):z[1],!0),e[u+"LabelVal"]=P.p,e.labelLabel=s(S,e[u+"LabelVal"]),e.valueLabel=s(C,e[f+"LabelVal"]),e.spikeDistance=(L(P)+function(e){return M(_(e),w(e))}(P))/2-b,e[u+"Spike"]=S.c2p(P.p,!0),o(P,v,e),e.hovertemplate=v.hovertemplate,e}}function f(e,t){var r=t.mcc||e.marker.color,n=t.mlcc||e.marker.line.color,a=l(e,t);return i.opacity(r)?r:i.opacity(n)&&a?n:void 0}t.exports={hoverPoints:function(e,t,r,n){var i=u(e,t,r,n);if(i){var o=i.cd,l=o[0].trace,s=o[i.index];return i.color=f(l,s),a.getComponentMethod("errorbars","hoverInfo")(s,l,i),[i]}},hoverOnBars:u,getTraceColor:f}},{"../../components/color":43,"../../components/fx":83,"../../constants/numerical":148,"../../lib":168,"../../plots/cartesian/axes":212,"../../registry":254,"./helpers":270}],272:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc").crossTraceCalc,colorbar:e("../scatter/marker_colorbar"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot").plot,style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover").hoverPoints,eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"bar",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},{"../../plots/cartesian":225,"../scatter/marker_colorbar":312,"./arrays_to_calcdata":263,"./attributes":264,"./calc":265,"./cross_trace_calc":267,"./defaults":268,"./event_data":269,"./hover":271,"./layout_attributes":273,"./layout_defaults":274,"./plot":275,"./select":276,"./style":278}],273:[function(e,t,r){"use strict";t.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"}}},{}],274:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/cartesian/axes"),i=e("../../lib"),o=e("./layout_attributes");t.exports=function(e,t,r){function l(r,n){return i.coerce(e,t,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}h.visible&&"histogram"===h.type&&"category"!==a.getFromId({_fullLayout:t},h["v"===h.orientation?"xaxis":"yaxis"]).type&&(c=!0)}}s?("overlay"!==d&&l("barnorm"),l("bargap",c&&!u?0:.2),l("bargroupgap")):delete t.barmode}},{"../../lib":168,"../../plots/cartesian/axes":212,"../../registry":254,"./layout_attributes":273}],275:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../../lib"),o=e("../../lib/svg_text_utils"),l=e("../../components/color"),s=e("../../components/drawing"),c=e("../../registry"),u=e("../../plots/cartesian/axes").tickText,f=e("./uniform_text"),d=f.recordMinTextSize,p=f.clearMinTextSize,h=e("./style"),g=e("./helpers"),v=e("./constants"),m=e("./attributes"),y=m.text,x=m.textposition,b=e("../../components/fx/helpers").appendArrayPointValue,_=v.TEXTPAD;function w(e){return e.id}function k(e){if(e.ids)return w}function T(e,t){return e<t?1:-1}function M(e,t,r,n){var a;return!t.uniformtext.mode&&A(r)?(n&&(a=n()),e.transition().duration(r.duration).ease(r.easing).each("end",(function(){a&&a()})).each("interrupt",(function(){a&&a()}))):e}function A(e){return e&&e.duration>0}function L(e){return"auto"===e?0:e}function S(e,t){var r=Math.PI/180*t,n=Math.abs(Math.sin(r)),a=Math.abs(Math.cos(r));return{x:e.width*a+e.height*n,y:e.width*n+e.height*a}}function C(e,t,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(t-e),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=(e+_)*p+(t-_)*d,C=(r+n)/2,O=0,P=0;if(f||u){var D=(o?b.x:b.y)/2,z=o?T(e,t):T(r,n);o?f?(A=e+z*y,O=-z*D):(A=t-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}}t.exports={plot:function(e,t,r,f,v,m){var w=t.xaxis,O=t.yaxis,P=e._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,E=0;p&&f.connector.visible&&"between"===f.connector.mode&&(E=f.connector.line.width/2);var R="h"===f.orientation,I=A(v),F=i.ensureSingle(c,"g","points"),N=k(f),H=F.selectAll("g.point").data(i.identity,N);H.enter().append("g").classed("point",!0),H.exit().remove(),H.each((function(c,p){var k,A,D=n.select(this),F=function(e,t,r,n){var a=[],i=[],o=n?t:r,l=n?r:t;return a[0]=o.c2p(e.s0,!0),i[0]=l.c2p(e.p0,!0),a[1]=o.c2p(e.s1,!0),i[1]=l.c2p(e.p1,!0),n?[a,i]:[i,a]}(c,w,O,R),N=F[0][0],H=F[0][1],B=F[1][0],j=F[1][1],V=0==(R?H-N:j-B);if(V&&z&&g.getLineWidth(f,c)&&(V=!1),V||(V=!(a(N)&&a(H)&&a(B)&&a(j))),c.isBlank=V,V&&(R?H=N:j=B),E&&!V&&(R?(N-=T(N,H)*E,H+=T(N,H)*E):(B-=T(B,j)*E,j+=T(B,j)*E)),"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(e){var t=n.round(k/2%1,2);return 0===v.gap&&0===v.groupgap?n.round(Math.round(e)-t,2):e}if(!e._context.staticPlot){var G=l.opacity(A)<1||k>.01?U:function(e,t,r){return r&&e===t?e:Math.abs(e-t)>=2?U(e):e>t?Math.ceil(e):Math.floor(e)};N=G(N,H,R),H=G(H,N,R),B=G(B,j,!R),j=G(j,B,!R)}var Z=M(i.ensureSingle(D,"path"),P,v,m);if(Z.style("vector-effect","non-scaling-stroke").attr("d",isNaN((H-N)*(j-B))?"M0,0Z":"M"+N+","+B+"V"+j+"H"+H+"V"+B+"Z").call(s.setClipUrl,t.layerClipId,e),!P.uniformtext.mode&&I){var X=s.makePointStyleFns(f);s.singlePointStyle(c,Z,f,X,e)}!function(e,t,r,n,a,l,c,f,p,v,m){var w,k=t.xaxis,A=t.yaxis,O=e._fullLayout;function P(t,r,n){return i.ensureSingle(t,"text").text(r).attr({class:"bartext bartext-"+w,"text-anchor":"middle","data-notex":1}).call(s.font,n).call(o.convertToTspans,e)}var D=n[0].trace,z="h"===D.orientation,E=function(e,t,r,n,a){var o,l=t[0].trace;return o=l.texttemplate?function(e,t,r,n,a){var o=t[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(e){return u(d,+e,!0).text}"h"===o.orientation?(s="y",c=a,f="x",d=n):(s="x",c=n,f="y",d=a);var v,m=t[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,e._d3locale,_,y,o._meta||{})}(e,t,r,n,a):l.textinfo?function(e,t,r,n){var a=e[0].trace,o="h"===a.orientation,l="waterfall"===a.type,s="funnel"===a.type;function c(e){return u(o?r:n,+e,!0).text}var f,d,p=a.textinfo,h=e[t],g=p.split("+"),v=[],m=function(e){return-1!==g.indexOf(e)};if(m("label")&&v.push((d=e[t].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>")}(t,r,n,a):g.getValue(l.text,r),g.coerceString(y,o)}(O,n,a,k,A);w=function(e,t){var r=g.getValue(e.textposition,t);return g.coerceEnumerated(x,r)}(D,a);var R="stack"===v.mode||"relative"===v.mode,I=n[a],F=!R||I._outmost;if(E&&"none"!==w&&(!I.isBlank&&l!==c&&f!==p||"auto"!==w&&"inside"!==w)){var N=O.font,H=h.getBarColor(n[a],D),B=h.getInsideTextFont(D,a,N,H),j=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",q=P(r,E,X=i.ensureUniformFontSize(e,B)),G=(U=s.bBox(q.node())).width,Z=U.height,G>0&&Z>0&&(G<=Y&&Z<=W||G<=W&&Z<=Y||(z?Y>=G*(W/Z):W>=Z*(Y/G)))?w="inside":(w="outside",q.remove(),q=null)}else w="inside";if(!q){var J=(q=P(r,E,X=i.ensureUniformFontSize(e,"outside"===w?j:B))).attr("transform");if(q.attr("transform",""),G=(U=s.bBox(q.node())).width,Z=U.height,q.attr("transform",J),G<=0||Z<=0)return void q.remove()}var $,Q=D.textangle;"outside"===w?$=function(e,t,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(t-e),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=(e+t)/2,w=(r+n)/2,k=0,M=0,A=l?T(t,e):T(r,n);return l?(b=t-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:"both"===D.constraintext||"outside"===D.constraintext,angle:Q}):$=C(l,c,f,p,U,{isHorizontal:z,constrained:"both"===D.constraintext||"inside"===D.constraintext,angle:Q,anchor:D.insidetextanchor}),$.fontSize=X.size,d(D.type,$,O),I.transform=$,M(q,O,v,m).attr("transform",i.getTextTransform($))}else r.select("text").remove()}(e,t,D,r,p,N,H,B,j,v,m),t.layerClipId&&s.hideOutsideRangePoint(c,D.select("text"),w,O,f.xcalendar,f.ycalendar)}));var B=!1===f.cliponaxis;s.setClipUrl(c,B?null:t.layerClipId,e)}));c.getComponentMethod("errorbars","plot")(e,D,t,v)},toMoveInsideBar:C}},{"../../components/color":43,"../../components/drawing":65,"../../components/fx/helpers":79,"../../lib":168,"../../lib/svg_text_utils":189,"../../plots/cartesian/axes":212,"../../registry":254,"./attributes":264,"./constants":266,"./helpers":270,"./style":278,"./uniform_text":280,d3:7,"fast-isnumeric":9}],276:[function(e,t,r){"use strict";function n(e,t,r,n,a){var i=t.c2p(n?e.s0:e.p0,!0),o=t.c2p(n?e.s1:e.p1,!0),l=r.c2p(n?e.p0:e.s0,!0),s=r.c2p(n?e.p1:e.s1,!0);return a?[(i+o)/2,(l+s)/2]:n?[o,(l+s)/2]:[(i+o)/2,s]}t.exports=function(e,t){var r,a=e.cd,i=e.xaxis,o=e.yaxis,l=a[0].trace,s="funnel"===l.type,c="h"===l.orientation,u=[];if(!1===t)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);t.contains(d,!1,r,e)?(u.push({pointNumber:r,x:i.c2d(f.x),y:o.c2d(f.y)}),f.selected=1):f.selected=0}return u}},{}],277:[function(e,t,r){"use strict";t.exports=i;var n=e("../../lib").distinctVals,a=e("../../constants/numerical").BADNUM;function i(e,t){this.traces=e,this.sepNegVal=t.sepNegVal,this.overlapNoMerge=t.overlapNoMerge;for(var r=1/0,i=[],o=0;o<e.length;o++){for(var l=e[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(e,t){var r=this.getLabel(e,t),n=this.bins[r]||0;return this.bins[r]=n+t,n},i.prototype.get=function(e,t){var r=this.getLabel(e,t);return this.bins[r]||0},i.prototype.getLabel=function(e,t){return(t<0&&this.sepNegVal?"v":"^")+(this.overlapNoMerge?e:Math.round(e/this.binWidth))}},{"../../constants/numerical":148,"../../lib":168}],278:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../components/color"),i=e("../../components/drawing"),o=e("../../lib"),l=e("../../registry"),s=e("./uniform_text").resizeText,c=e("./attributes"),u=c.textfont,f=c.insidetextfont,d=c.outsidetextfont,p=e("./helpers");function h(e,t,r){i.pointStyle(e.selectAll("path"),t,r),g(e,t,r)}function g(e,t,r){e.selectAll("text").each((function(e){var a=n.select(this),l=o.ensureUniformFontSize(r,v(a,e,t,r));i.font(a,l)}))}function v(e,t,r,n){var a=n._fullLayout.font,i=r.textfont;if(e.classed("bartext-inside")){var o=_(t,r);i=y(r,t.i,a,o)}else e.classed("bartext-outside")&&(i=x(r,t.i,a));return i}function m(e,t,r){return b(u,e.textfont,t,r)}function y(e,t,r,n){var i=m(e,t,r);return(void 0===e._input.textfont||void 0===e._input.textfont.color||Array.isArray(e.textfont.color)&&void 0===e.textfont.color[t])&&(i={color:a.contrast(n),family:i.family,size:i.size}),b(f,e.insidetextfont,t,i)}function x(e,t,r){var n=m(e,t,r);return b(d,e.outsidetextfont,t,n)}function b(e,t,r,n){t=t||{};var a=p.getValue(t.family,r),i=p.getValue(t.size,r),o=p.getValue(t.color,r);return{family:p.coerceString(e.family,a,n.family),size:p.coerceNumber(e.size,i,n.size),color:p.coerceColor(e.color,o,n.color)}}function _(e,t){return"waterfall"===t.type?t[e.dir].marker.color:e.mc||t.marker.color}t.exports={style:function(e){var t=n.select(e).selectAll("g.barlayer").selectAll("g.trace");s(e,t,"bar");var r=t.size(),a=e._fullLayout;t.style("opacity",(function(e){return e[0].trace.opacity})).each((function(e){("stack"===a.barmode&&r>1||0===a.bargap&&0===a.bargroupgap&&!e[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")})),t.selectAll("g.points").each((function(t){h(n.select(this),t[0].trace,e)})),l.getComponentMethod("errorbars","style")(t)},styleTextPoints:g,styleOnSelect:function(e,t,r){var a=t[0].trace;a.selectedpoints?function(e,t,r){i.selectedPointStyle(e.selectAll("path"),t),function(e,t,r){e.each((function(e){var a,l=n.select(this);if(e.selected){a=o.ensureUniformFontSize(r,v(l,e,t,r));var s=t.selected.textfont&&t.selected.textfont.color;s&&(a.color=s),i.font(l,a)}else i.selectedTextStyle(l,t)}))}(e.selectAll("text"),t,r)}(r,a,e):(h(r,a,e),l.getComponentMethod("errorbars","style")(r))},getInsideTextFont:y,getOutsideTextFont:x,getBarColor:_,resizeText:s}},{"../../components/color":43,"../../components/drawing":65,"../../lib":168,"../../registry":254,"./attributes":264,"./helpers":270,"./uniform_text":280,d3:7}],279:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults");t.exports=function(e,t,r,o,l){r("marker.color",o),a(e,"marker")&&i(e,t,l,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(e,"marker.line")&&i(e,t,l,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":43,"../../components/colorscale/defaults":53,"../../components/colorscale/helpers":54}],280:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib");function i(e){return"_"+e+"Text_minsize"}t.exports={recordMinTextSize:function(e,t,r){if(r.uniformtext.mode){var n=i(e),a=r.uniformtext.minsize,o=t.scale*t.fontSize;t.hide=o<a,r[n]=r[n]||1/0,t.hide||(r[n]=Math.min(r[n],Math.max(o,a)))}},clearMinTextSize:function(e,t){t[i(e)]=void 0},resizeText:function(e,t,r){var i=e._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"}t.selectAll(l).each((function(e){var t=e.transform;t&&(t.scale=s&&t.hide?0:o/t.fontSize,n.select(this).select("text").attr("transform",a.getTextTransform(t)))}))}}}},{"../../lib":168,d3:7}],281:[function(e,t,r){"use strict";var n=e("../../plots/attributes"),a=e("../../plots/domain").attributes,i=e("../../plots/font_attributes"),o=e("../../components/color/attributes"),l=e("../../plots/template_attributes").hovertemplateAttrs,s=e("../../plots/template_attributes").texttemplateAttrs,c=e("../../lib/extend").extendFlat,u=i({editType:"plot",arrayOk:!0,colorEditType:"plot"});t.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":42,"../../lib/extend":163,"../../plots/attributes":209,"../../plots/domain":239,"../../plots/font_attributes":240,"../../plots/template_attributes":253}],282:[function(e,t,r){"use strict";var n=e("../../plots/plots");r.name="pie",r.plot=function(e,t,a,i){n.plotBasePlot(r.name,e,t,a,i)},r.clean=function(e,t,a,i){n.cleanBasePlot(r.name,e,t,a,i)}},{"../../plots/plots":246}],283:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("tinycolor2"),i=e("../../components/color"),o={};function l(e){return function(t,r){return!!t&&!!(t=a(t)).isValid()&&(t=i.addOpacity(t,t.getAlpha()),e[r]||(e[r]=t),t)}}function s(e,t){var r,n=JSON.stringify(e),i=t[n];if(!i){for(i=e.slice(),r=0;r<e.length;r++)i.push(a(e[r]).lighten(20).toHexString());for(r=0;r<e.length;r++)i.push(a(e[r]).darken(20).toHexString());t[n]=i}return i}t.exports={calc:function(e,t){var r,a,i=[],o=e._fullLayout,s=o.hiddenlabels||[],c=t.labels,u=t.marker.colors||[],f=t.values,d=t._length,p=t._hasValues&&d;if(t.dlabel)for(c=new Array(d),r=0;r<d;r++)c[r]=String(t.label0+r*t.dlabel);var h={},g=l(o["_"+t.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"===t.type?m:t.sort)&&i.sort((function(e,t){return t.v-e.v})),i[0]&&(i[0].vTotal=v),i},crossTraceCalc:function(e,t){var r=(t||{}).type;r||(r="pie");var n=e._fullLayout,a=e.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":43,"fast-isnumeric":9,tinycolor2:26}],284:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("./attributes"),o=e("../../plots/domain").defaults,l=e("../bar/defaults").handleText;function s(e,t){var r=Array.isArray(e),i=a.isArrayOrTypedArray(t),o=Math.min(r?e.length:1/0,i?t.length:1/0);if(isFinite(o)||(o=0),o&&i){for(var l,s=0;s<o;s++){var c=t[s];if(n(c)&&c>0){l=!0;break}}l||(o=0)}return{hasLabels:r,hasValues:i,len:o}}t.exports={handleLabelsAndValues:s,supplyDefaults:function(e,t,r,n){function c(r,n){return a.coerce(e,t,i,r,n)}var u=s(c("labels"),c("values")),f=u.len;if(t._hasLabels=u.hasLabels,t._hasValues=u.hasValues,!t._hasLabels&&t._hasValues&&(c("label0"),c("dlabel")),f){t._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(e,t,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(t,n,c);var v=c("hole");if(c("title.text")){var m=c("title.position",v?"middle center":"top center");v||"middle center"!==m||(t.title.position="top center"),a.coerceFont(c,"title.font",n.font)}c("sort"),c("direction"),c("rotation"),c("pull")}else t.visible=!1}}},{"../../lib":168,"../../plots/domain":239,"../bar/defaults":268,"./attributes":281,"fast-isnumeric":9}],285:[function(e,t,r){"use strict";var n=e("../../components/fx/helpers").appendArrayMultiPointValues;t.exports=function(e,t){var r={curveNumber:t.index,pointNumbers:e.pts,data:t._input,fullData:t,label:e.label,color:e.color,value:e.v,percent:e.percent,text:e.text,v:e.v};return 1===e.pts.length&&(r.pointNumber=r.i=e.pts[0]),n(r,t,e.pts),"funnelarea"===t.type&&(delete r.v,delete r.i),r}},{"../../components/fx/helpers":79}],286:[function(e,t,r){"use strict";var n=e("../../lib");r.formatPiePercent=function(e,t){var r=(100*e).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,t)+"%"},r.formatPieValue=function(e,t){var r=e.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,t)},r.getFirstFilled=function(e,t){if(Array.isArray(e))for(var r=0;r<t.length;r++){var n=e[t[r]];if(n||0===n||""===n)return n}},r.castOption=function(e,t){return Array.isArray(e)?r.getFirstFilled(e,t):e||void 0}},{"../../lib":168}],287:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults").supplyDefaults,supplyLayoutDefaults:e("./layout_defaults"),layoutAttributes:e("./layout_attributes"),calc:e("./calc").calc,crossTraceCalc:e("./calc").crossTraceCalc,plot:e("./plot").plot,style:e("./style"),styleOne:e("./style_one"),moduleType:"trace",name:"pie",basePlotModule:e("./base_plot"),categories:["pie-like","pie","showLegend"],meta:{}}},{"./attributes":281,"./base_plot":282,"./calc":283,"./defaults":284,"./layout_attributes":288,"./layout_defaults":289,"./plot":290,"./style":291,"./style_one":292}],288:[function(e,t,r){"use strict";t.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{}],289:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t){function r(r,i){return n.coerce(e,t,a,r,i)}r("hiddenlabels"),r("piecolorway",t.colorway),r("extendpiecolors")}},{"../../lib":168,"./layout_attributes":288}],290:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../plots/plots"),i=e("../../components/fx"),o=e("../../components/color"),l=e("../../components/drawing"),s=e("../../lib"),c=e("../../lib/svg_text_utils"),u=e("../bar/uniform_text"),f=u.recordMinTextSize,d=u.clearMinTextSize,p=e("../bar/constants").TEXTPAD,h=e("./helpers"),g=e("./event_data"),v=e("../../lib").isValidTextValue;function m(e,t,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),e.on("mouseover",(function(e){var r=t._fullLayout,u=t._fullData[o.index];if(!t._dragging&&!1!==r.hovermode){var f=u.hoverinfo;if(Array.isArray(f)&&(f=i.castHoverinfo({hoverinfo:[h.castOption(f,e.pts)],_module:o._module},r,0)),"all"===f&&(f="label+text+value+percent+name"),u.hovertemplate||"none"!==f&&"skip"!==f&&f){var d=e.rInscribed||0,p=l+e.pxmid[0]*(1-d),v=c+e.pxmid[1]*(1-d),m=r.separators,y=[];if(f&&-1!==f.indexOf("label")&&y.push(e.label),e.text=h.castOption(u.hovertext||u.text,e.pts),f&&-1!==f.indexOf("text")){var x=e.text;s.isValidTextValue(x)&&y.push(x)}e.value=e.v,e.valueLabel=h.formatPieValue(e.v,m),f&&-1!==f.indexOf("value")&&y.push(e.valueLabel),e.percent=e.v/a.vTotal,e.percentLabel=h.formatPiePercent(e.percent,m),f&&-1!==f.indexOf("percent")&&y.push(e.percentLabel);var b=u.hoverlabel,_=b.font;i.loneHover({trace:o,x0:p-d*a.r,x1:p+d*a.r,y:v,text:y.join("<br>"),name:u.hovertemplate||-1!==f.indexOf("name")?u.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:h.castOption(b.bgcolor,e.pts)||e.color,borderColor:h.castOption(b.bordercolor,e.pts),fontFamily:h.castOption(_.family,e.pts),fontSize:h.castOption(_.size,e.pts),fontColor:h.castOption(_.color,e.pts),nameLength:h.castOption(b.namelength,e.pts),textAlign:h.castOption(b.align,e.pts),hovertemplate:h.castOption(u.hovertemplate,e.pts),hovertemplateLabels:e,eventData:[g(e,u)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t}),o._hasHoverLabel=!0}o._hasHoverEvent=!0,t.emit("plotly_hover",{points:[g(e,u)],event:n.event})}})),e.on("mouseout",(function(e){var r=t._fullLayout,a=t._fullData[o.index],l=n.select(this).datum();o._hasHoverEvent&&(e.originalEvent=n.event,t.emit("plotly_unhover",{points:[g(l,a)],event:n.event}),o._hasHoverEvent=!1),o._hasHoverLabel&&(i.loneUnhover(r._hoverlayer.node()),o._hasHoverLabel=!1)})),e.on("click",(function(e){var r=t._fullLayout,a=t._fullData[o.index];t._dragging||!1===r.hovermode||(t._hoverdata=[g(e,a)],i.click(t,n.event))}))}function y(e,t,r){var n=h.castOption(e.insidetextfont.color,t.pts);!n&&e._input.textfont&&(n=h.castOption(e._input.textfont.color,t.pts));var a=h.castOption(e.insidetextfont.family,t.pts)||h.castOption(e.textfont.family,t.pts)||r.family,i=h.castOption(e.insidetextfont.size,t.pts)||h.castOption(e.textfont.size,t.pts)||r.size;return{color:n||o.contrast(t.color),family:a,size:i}}function x(e,t){for(var r,n,a=0;a<e.length;a++)if((n=(r=e[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,t),u=l.bBox(o.node(),!0);r.titleBox={width:u.width,height:u.height},o.remove()}}function b(e,t,r){var n=r.r||t.rpx1,a=t.rInscribed;if(t.startangle===t.stopangle)return{rCenter:1-a,scale:0,rotate:0,textPosAngle:0};var i,o=t.ring,l=1===o&&Math.abs(t.startangle-t.stopangle)===2*Math.PI,s=t.halfangle,c=t.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(e,t){var r=e.startangle,n=e.stopangle;return r>t&&t>n||r<t&&t<n}(t,r)){var l=Math.abs(r-t.startangle),s=Math.abs(r-t.stopangle),c=l<s?l:s;(i="tan"===a?w(e,n,o,c,0):_(e,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(e.width*e.width+e.height*e.height);if((i={scale:a*n*2/y,rCenter:1-a,rotate:0}).textPosAngle=(t.startangle+t.stopangle)/2,i.scale>=1)return i;g.push(i)}(h||p)&&((i=_(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,g.push(i)),(h||d)&&((i=w(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,g.push(i));for(var x=0,b=0,k=0;k<g.length;k++){var T=g[k].scale;if(b<T&&(b=T,x=k),!h&&b>=1)break}return g[x]}function _(e,t,r,n,a){t=Math.max(0,t-2*p);var i=e.width/e.height,o=M(i,n,t,r);return{scale:2*o/e.height,rCenter:k(i,o/t),rotate:T(a)}}function w(e,t,r,n,a){t=Math.max(0,t-2*p);var i=e.height/e.width,o=M(i,n,t,r);return{scale:2*o/e.width,rCenter:k(i,o/t),rotate:T(a+Math.PI/2)}}function k(e,t){return Math.cos(t)-e*t}function T(e){return(180/Math.PI*e+720)%180-90}function M(e,t,r,n){var a=e+1/(2*Math.tan(t));return r*Math.min(1/(Math.sqrt(a*a+.5)+a),n/(Math.sqrt(e*e+n/2)+e))}function A(e,t){return e.v!==t.vTotal||t.trace.hole?Math.min(1/(1+1/Math.sin(e.halfangle)),e.ring/2):1}function L(e,t){var r=t.pxmid[0],n=t.pxmid[1],a=e.width/2,i=e.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 S(e,t){var r,n,a,i=e.trace,o={x:e.cx,y:e.cy},l={tx:0,ty:0};l.ty+=i.title.font.size,a=O(i),-1!==i.title.position.indexOf("top")?(o.y-=(1+a)*e.r,l.ty-=e.titleBox.height):-1!==i.title.position.indexOf("bottom")&&(o.y+=(1+a)*e.r);var s,c=e.r/(void 0===(s=e.trace.aspectratio)?1:s),u=t.w*(i.domain.x[1]-i.domain.x[0])/2;return-1!==i.title.position.indexOf("left")?(u+=c,o.x-=(1+a)*c,l.tx+=e.titleBox.width/2):-1!==i.title.position.indexOf("center")?u*=2:-1!==i.title.position.indexOf("right")&&(u+=c,o.x+=(1+a)*c,l.tx-=e.titleBox.width/2),r=u/e.titleBox.width,n=C(e,t)/e.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:l.tx,ty:l.ty}}function C(e,t){var r=e.trace,n=t.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(e.titleBox.height,n/2)}function O(e){var t,r=e.pull;if(!r)return 0;if(Array.isArray(r))for(r=0,t=0;t<e.pull.length;t++)e.pull[t]>r&&(r=e.pull[t]);return r}function P(e,t){for(var r=[],n=0;n<e.length;n++){var a=e[n][0],i=a.trace,o=i.domain,l=t.w*(o.x[1]-o.x[0]),s=t.h*(o.y[1]-o.y[0]);i.title.text&&"middle center"!==i.title.position&&(s-=C(a,t));var c=l/2,u=s/2;"funnelarea"!==i.type||i.scalegroup||(u/=i.aspectratio),a.r=Math.min(c,u)/(1+O(i)),a.cx=t.l+t.w*(i.domain.x[1]+i.domain.x[0])/2,a.cy=t.t+t.h*(1-i.domain.y[0])-s/2,i.title.text&&-1!==i.title.position.indexOf("bottom")&&(a.cy-=C(a,t)),i.scalegroup&&-1===r.indexOf(i.scalegroup)&&r.push(i.scalegroup)}!function(e,t){for(var r,n,a,i=0;i<t.length;i++){var o=1/0,l=t[i];for(n=0;n<e.length;n++)if((a=(r=e[n][0]).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?u=(c=r.r)/a.aspectratio:c=(u=r.r)*a.aspectratio,s=(c*=(1+a.baseratio)/2)*u}o=Math.min(o,s/r.vTotal)}for(n=0;n<e.length;n++)if((a=(r=e[n][0]).trace).scalegroup===l){var f=o*r.vTotal;"funnelarea"===a.type&&(f/=(1+a.baseratio)/2,f/=a.aspectratio),r.r=Math.sqrt(f)}}}(e,r)}function D(e,t){return[e*Math.sin(t),-e*Math.cos(t)]}function z(e,t,r){var n=e._fullLayout,a=r.trace,i=a.texttemplate,o=a.textinfo;if(!i&&o&&"none"!==o){var l,c=o.split("+"),u=function(e){return-1!==c.indexOf(e)},f=u("label"),d=u("text"),p=u("value"),g=u("percent"),m=n.separators;if(l=f?[t.label]:[],d){var y=h.getFirstFilled(a.text,t.pts);v(y)&&l.push(y)}p&&l.push(h.formatPieValue(t.v,m)),g&&l.push(h.formatPiePercent(t.v/r.vTotal,m)),t.text=l.join("<br>")}if(i){var x=s.castOption(a,t.i,"texttemplate");if(x){var b=function(e){return{label:e.label,value:e.v,valueLabel:h.formatPieValue(e.v,n.separators),percent:e.v/r.vTotal,percentLabel:h.formatPiePercent(e.v/r.vTotal,n.separators),color:e.color,text:e.text,customdata:s.castOption(a,e.i,"customdata")}}(t),_=h.getFirstFilled(a.text,t.pts);(v(_)||""===_)&&(b.text=_),t.text=s.texttemplateString(x,b,e._fullLayout._d3locale,b,a._meta||{})}else t.text=""}}function E(e,t){var r=e.rotate*Math.PI/180,n=Math.cos(r),a=Math.sin(r),i=(t.left+t.right)/2,o=(t.top+t.bottom)/2;e.textX=i*n-o*a,e.textY=i*a+o*n,e.noCenter=!0}t.exports={plot:function(e,t){var r=e._fullLayout,i=r._size;d("pie",r),x(t,e),P(t,i);var u=s.makeTraceGroups(r._pielayer,t,"trace").each((function(t){var u=n.select(this),d=t[0],p=d.trace;!function(e){var t,r,n,a=e[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(t=0;t<e.length&&e[t].hidden;t++);if(t===e.length)return;l+=s*e[t].v,s*=-1,c="px1",u="px0"}for(n=D(i,l),t=0;t<e.length;t++)(r=e[t]).hidden||(r[c]=n,r.startangle=l,l+=s*r.v/2,r.pxmid=D(i,l),r.midangle=l,n=D(i,l+=s*r.v/2),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=A(r,a))}(t),u.attr("stroke-linejoin","round"),u.each((function(){var g=n.select(this).selectAll("g.slice").data(t);g.enter().append("g").classed("slice",!0),g.exit().remove();var v=[[[],[]],[[],[]]],x=!1;g.each((function(a,i){if(a.hidden)n.select(this).selectAll("path,g").remove();else{a.pointNumber=a.i,a.curveNumber=p.index,v[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(m,e,t),p.pull){var w=+h.castOption(p.pull,a.pts)||0;w>0&&(o+=w*a.pxmid[0],u+=w*a.pxmid[1])}a.cxFinal=o,a.cyFinal=u;var k=p.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 A=1-k;_.attr("d","M"+(o+k*a.px1[0])+","+(u+k*a.px1[1])+O(a.px1,a.px0,!1,k)+"l"+A*a.px0[0]+","+A*a.px0[1]+M+"Z")}else _.attr("d","M"+o+","+u+"l"+a.px0[0]+","+a.px0[1]+M+"Z")}z(e,a,d);var S=h.castOption(p.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(e){e.attr("data-notex",1)})),v=s.ensureUniformFontSize(e,"outside"===S?function(e,t,r){return{color:h.castOption(e.outsidetextfont.color,t.pts)||h.castOption(e.textfont.color,t.pts)||r.color,family:h.castOption(e.outsidetextfont.family,t.pts)||h.castOption(e.textfont.family,t.pts)||r.family,size:h.castOption(e.outsidetextfont.size,t.pts)||h.castOption(e.textfont.size,t.pts)||r.size}}(p,a,r.font):y(p,a,r.font));g.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(l.font,v).call(c.convertToTspans,e);var m,_=l.bBox(g.node());if("outside"===S)m=L(_,a);else if(m=b(_,a,d),"auto"===S&&m.scale<1){var w=s.ensureUniformFontSize(e,p.outsidetextfont);g.call(l.font,w),m=L(_=l.bBox(g.node()),a)}var k=m.textPosAngle,T=void 0===k?a.pxmid:D(d.r,k);if(m.targetX=o+T[0]*m.rCenter+(m.x||0),m.targetY=u+T[1]*m.rCenter+(m.y||0),E(m,_),m.outside){var M=m.targetY;a.yLabelMin=M-_.height/2,a.yLabelMid=M,a.yLabelMax=M+_.height/2,a.labelExtraX=0,a.labelExtraY=0,x=!0}m.fontSize=v.size,f(p.type,m,r),t[i].transform=m,g.attr("transform",s.getTextTransform(m))}))}function O(e,t,r,n){var i=n*(t[0]-e[0]),o=n*(t[1]-e[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(p.title.text?[0]:[]);if(_.enter().append("g").classed("titletext",!0),_.exit().remove(),_.each((function(){var t,r=s.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),a=p.title.text;p._meta&&(a=s.templateString(a,p._meta)),r.text(a).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(l.font,p.title.font).call(c.convertToTspans,e),t="middle center"===p.title.position?function(e){var t=Math.sqrt(e.titleBox.width*e.titleBox.width+e.titleBox.height*e.titleBox.height);return{x:e.cx,y:e.cy,scale:e.trace.hole*e.r*2/t,tx:0,ty:-e.titleBox.height/2+e.trace.title.font.size}}(d):S(d,i),r.attr("transform","translate("+t.x+","+t.y+")"+(t.scale<1?"scale("+t.scale+")":"")+"translate("+t.tx+","+t.ty+")")})),x&&function(e,t){var r,n,a,i,o,l,s,c,u,f,d,p,g;function v(e,t){return e.pxmid[1]-t.pxmid[1]}function m(e,t){return t.pxmid[1]-e.pxmid[1]}function y(e,r){r||(r={});var a,c,u,d,p=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),g=n?e.yLabelMin:e.yLabelMax,v=n?e.yLabelMax:e.yLabelMin,m=e.cyFinal+o(e.px0[1],e.px1[1]),y=p-g;if(y*s>0&&(e.labelExtraY=y),Array.isArray(t.pull))for(c=0;c<f.length;c++)(u=f[c])===e||(h.castOption(t.pull,e.pts)||0)>=(h.castOption(t.pull,u.pts)||0)||((e.pxmid[1]-u.pxmid[1])*s>0?(y=u.cyFinal+o(u.px0[1],u.px1[1])-g-e.labelExtraY)*s>0&&(e.labelExtraY+=y):(v+e.labelExtraY-m)*s>0&&(a=3*l*Math.abs(c-f.indexOf(e)),(d=u.cxFinal+i(u.px0[0],u.px1[0])+a-(e.cxFinal+e.pxmid[0])-e.labelExtraX)*l>0&&(e.labelExtraX+=d)))}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=e[n][r]).sort(a),u=e[1-n][r],f=u.concat(c),p=[],d=0;d<c.length;d++)void 0!==c[d].yLabelMid&&p.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<p.length;d++){var x=d&&p[d-1];g&&!d&&(x=g),y(p[d],x)}}}(v,p),function(e,t){e.each((function(e){var r=n.select(this);if(e.labelExtraX||e.labelExtraY){var a=r.select("g.slicetext text");e.transform.targetX+=e.labelExtraX,e.transform.targetY+=e.labelExtraY,a.attr("transform",s.getTextTransform(e.transform));var i=e.cxFinal+e.pxmid[0],l="M"+i+","+(e.cyFinal+e.pxmid[1]),c=(e.yLabelMax-e.yLabelMin)*(e.pxmid[0]<0?-1:1)/4;if(e.labelExtraX){var u=e.labelExtraX*e.pxmid[1]/e.pxmid[0],f=e.yLabelMid+e.labelExtraY-(e.cyFinal+e.pxmid[1]);Math.abs(u)>Math.abs(f)?l+="l"+f*e.pxmid[0]/e.pxmid[1]+","+f+"H"+(i+e.labelExtraX+c):l+="l"+e.labelExtraX+","+u+"v"+(f-u)+"h"+c}else l+="V"+(e.yLabelMid+e.labelExtraY)+"h"+c;s.ensureSingle(r,"path","textline").call(o.stroke,t.outsidetextfont.color).attr({"stroke-width":Math.min(2,t.outsidetextfont.size/8),d:l,fill:"none"})}else r.select("path.textline").remove()}))}(g,p),x&&p.automargin){var w=l.bBox(u.node()),k=p.domain,T=i.w*(k.x[1]-k.x[0]),M=i.h*(k.y[1]-k.y[0]),A=(.5*T-d.r)/i.w,C=(.5*M-d.r)/i.h;a.autoMargin(e,"pie."+p.uid+".automargin",{xl:k.x[0]-A,xr:k.x[1]+A,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 e=n.select(this);e.attr("dy")&&e.attr("dy",e.attr("dy"))}))}),0)},formatSliceLabel:z,transformInsideText:b,determineInsideTextFont:y,positionTitleOutside:S,prerenderTitles:x,layoutAreas:P,attachFxHandlers:m,computeTransform:E}},{"../../components/color":43,"../../components/drawing":65,"../../components/fx":83,"../../lib":168,"../../lib/svg_text_utils":189,"../../plots/plots":246,"../bar/constants":266,"../bar/uniform_text":280,"./event_data":285,"./helpers":286,d3:7}],291:[function(e,t,r){"use strict";var n=e("d3"),a=e("./style_one"),i=e("../bar/uniform_text").resizeText;t.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");i(e,t,"pie"),t.each((function(e){var t=e[0].trace,r=n.select(this);r.style({opacity:t.opacity}),r.selectAll("path.surface").each((function(e){n.select(this).call(a,e,t)}))}))}},{"../bar/uniform_text":280,"./style_one":292,d3:7}],292:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("./helpers").castOption;t.exports=function(e,t,r){var i=r.marker.line,o=a(i.color,t.pts)||n.defaultLine,l=a(i.width,t.pts)||0;e.style("stroke-width",l).call(n.fill,t.color).call(n.stroke,o)}},{"../../components/color":43,"./helpers":286}],293:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;r<e.length;r++)e[r].i=r;n.mergeArray(t.text,e,"tx"),n.mergeArray(t.texttemplate,e,"txt"),n.mergeArray(t.hovertext,e,"htx"),n.mergeArray(t.customdata,e,"data"),n.mergeArray(t.textposition,e,"tp"),t.textfont&&(n.mergeArrayCastPositive(t.textfont.size,e,"ts"),n.mergeArray(t.textfont.color,e,"tc"),n.mergeArray(t.textfont.family,e,"tf"));var a=t.marker;if(a){n.mergeArrayCastPositive(a.size,e,"ms"),n.mergeArrayCastPositive(a.opacity,e,"mo"),n.mergeArray(a.symbol,e,"mx"),n.mergeArray(a.color,e,"mc");var i=a.line;a.line&&(n.mergeArray(i.color,e,"mlc"),n.mergeArrayCastPositive(i.width,e,"mlw"));var o=a.gradient;o&&"none"!==o.type&&(n.mergeArray(o.type,e,"mgt"),n.mergeArray(o.color,e,"mgc"))}}},{"../../lib":168}],294:[function(e,t,r){"use strict";var n=e("../../plots/template_attributes").texttemplateAttrs,a=e("../../plots/template_attributes").hovertemplateAttrs,i=e("../../components/colorscale/attributes"),o=e("../../plots/font_attributes"),l=e("../../components/drawing/attributes").dash,s=e("../../components/drawing"),c=e("./constants"),u=e("../../lib/extend").extendFlat;t.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":50,"../../components/drawing":65,"../../components/drawing/attributes":64,"../../lib/extend":163,"../../plots/font_attributes":240,"../../plots/template_attributes":253,"./constants":298}],295:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("../../plots/cartesian/axes"),o=e("../../constants/numerical").BADNUM,l=e("./subtypes"),s=e("./colorscale_calc"),c=e("./arrays_to_calcdata"),u=e("./calc_selection");function f(e,t,r,n,a,o,s){var c=t._length,u=e._fullLayout,f=r._id,d=n._id,p=u._firstScatter[h(t)]===t.uid,v=(g(t,u,r,n)||{}).orientation,m=t.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:(t.error_y||{}).visible||"tonexty"!==m&&"tozeroy"!==m&&(l.hasMarkers(t)||l.hasText(t))||(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&&(t._extremes[f]=i.findExtremes(r,a,y)),d&&(t._extremes[d]=i.findExtremes(n,o,x))}function d(e,t){if(l.hasMarkers(e)){var r,n=e.marker,o=1.6*(e.marker.sizeref||1);if(r="area"===e.marker.sizemode?function(e){return Math.max(Math.sqrt((e||0)/o),3)}:function(e){return Math.max((e||0)/o,3)},a.isArrayOrTypedArray(n.size)){var s={type:"linear"};i.setConvert(s);for(var c=s.makeCalcdata(e.marker,"size"),u=new Array(t),f=0;f<t;f++)u[f]=r(c[f]);return u}return r(n.size)}}function p(e,t){var r=h(t),n=e._firstScatter;n[r]||(n[r]=t.uid)}function h(e){var t=e.stackgroup;return e.xaxis+e.yaxis+e.type+(t?"-"+t:"")}function g(e,t,r,n){var a=e.stackgroup;if(a){var i=t._scatterStackOpts[r._id+n._id][a],o="v"===i.orientation?n:r;return"linear"===o.type||"log"===o.type?i:void 0}}t.exports={calc:function(e,t){var r,l,h,v,m,y,x=e._fullLayout,b=i.getFromId(e,t.xaxis||"x"),_=i.getFromId(e,t.yaxis||"y"),w=b.makeCalcdata(t,"x"),k=_.makeCalcdata(t,"y"),T=t._length,M=new Array(T),A=t.ids,L=g(t,x,b,_),S=!1;p(x,t);var C,O="x",P="y";for(L?(a.pushUnique(L.traceIndices,t._expandedIndex),(r="v"===L.orientation)?(P="s",C="x"):(O="s",C="y"),m="interpolate"===L.stackgaps):f(e,t,b,_,w,k,d(t,T)),l=0;l<T;l++){var D=M[l]={},z=n(w[l]),E=n(k[l]);z&&E?(D[O]=w[l],D[P]=k[l]):L&&(r?z:E)?(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,t),s(e,t),u(M,t),L){for(l=0;l<M.length;)M[l][C]===o?M.splice(l,1):l++;if(a.sort(M,(function(e,t){return e[C]-t[C]||e.i-t.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 R=M[l-1][C],I=M[l-1].s,F=(M[h].s-I)/(M[h][C]-R);l<h;)M[l].s=I+(M[l][C]-R)*F,l++}}}return M},calcMarkerSize:d,calcAxisExpansion:f,setFirstScatter:p,getStackOpts:g}},{"../../constants/numerical":148,"../../lib":168,"../../plots/cartesian/axes":212,"./arrays_to_calcdata":293,"./calc_selection":296,"./colorscale_calc":297,"./subtypes":318,"fast-isnumeric":9}],296:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){n.isArrayOrTypedArray(t.selectedpoints)&&n.tagSelected(e,t)}},{"../../lib":168}],297:[function(e,t,r){"use strict";var n=e("../../components/colorscale/helpers").hasColorscale,a=e("../../components/colorscale/calc"),i=e("./subtypes");t.exports=function(e,t){i.hasLines(t)&&n(t,"line")&&a(e,t,{vals:t.line.color,containerStr:"line",cLetter:"c"}),i.hasMarkers(t)&&(n(t,"marker")&&a(e,t,{vals:t.marker.color,containerStr:"marker",cLetter:"c"}),n(t,"marker.line")&&a(e,t,{vals:t.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}},{"../../components/colorscale/calc":51,"../../components/colorscale/helpers":54,"./subtypes":318}],298:[function(e,t,r){"use strict";t.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20,eventDataKeys:[]}},{}],299:[function(e,t,r){"use strict";var n=e("./calc");function a(e,t,r,n,a,i,o){a[n]=!0;var l={i:null,gap:!0,s:0};if(l[o]=r,e.splice(t,0,l),t&&r===e[t-1][o]){var s=e[t-1];l.s=s.s,l.i=s.i,l.gap=s.gap}else i&&(l.s=function(e,t,r,n){var a=e[t-1],i=e[t+1];return i?a?a.s+(i.s-a.s)*(r-a[n])/(i[n]-a[n]):i.s:a.s}(e,t,r,o));t||(e[0].t=e[1].t,e[0].trace=e[1].trace,delete e[1].t,delete e[1].trace)}t.exports=function(e,t){var r=t.xaxis,i=t.yaxis,o=r._id+i._id,l=e._fullLayout._scatterStackOpts[o];if(l){var s,c,u,f,d,p,h,g,v,m,y,x,b,_,w,k=e.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),E=new Array(L);for(c=0;c<L;c++)z[c]=d[c].x,E[c]=d[c].y;n.calcAxisExpansion(e,C,r,i,z,E,O),d[0].t.orientation=m.orientation}}}}}},{"./calc":295}],300:[function(e,t,r){"use strict";t.exports=function(e){for(var t=0;t<e.length;t++){var r=e[t];if("scatter"===r.type){var n=r.fill;if("none"!==n&&"toself"!==n&&(r.opacity=void 0,"tonexty"===n||"tonextx"===n))for(var a=t-1;a>=0;a--){var i=e[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],301:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("./attributes"),o=e("./constants"),l=e("./subtypes"),s=e("./xy_defaults"),c=e("./stack_defaults"),u=e("./marker_defaults"),f=e("./line_defaults"),d=e("./line_shape_defaults"),p=e("./text_defaults"),h=e("./fillcolor_defaults");t.exports=function(e,t,r,g){function v(r,a){return n.coerce(e,t,i,r,a)}var m=s(e,t,g,v);if(m||(t.visible=!1),t.visible){var y=c(e,t,g,v),x=!y&&m<o.PTS_LINESONLY?"lines+markers":"lines";v("text"),v("hovertext"),v("mode",x),l.hasLines(t)&&(f(e,t,r,g,v),d(e,t,v),v("connectgaps"),v("line.simplify")),l.hasMarkers(t)&&u(e,t,r,g,v,{gradient:!0}),l.hasText(t)&&(v("texttemplate"),p(e,t,g,v));var b=[];(l.hasMarkers(t)||l.hasText(t))&&(v("cliponaxis"),v("marker.maxdisplayed"),b.push("points")),v("fill",y?y.fillDflt:"none"),"none"!==t.fill&&(h(e,t,r,v),l.hasLines(t)||d(e,t,v));var _=(t.line||{}).color,w=(t.marker||{}).color;"tonext"!==t.fill&&"toself"!==t.fill||b.push("fills"),v("hoveron",b.join("+")||"points"),"fills"!==t.hoveron&&v("hovertemplate");var k=a.getComponentMethod("errorbars","supplyDefaults");k(e,t,_||w||r,{axis:"y"}),k(e,t,_||w||r,{axis:"x",inherit:"y"}),n.coerceSelectionMarkerOpacity(t,v)}}},{"../../lib":168,"../../registry":254,"./attributes":294,"./constants":298,"./fillcolor_defaults":302,"./line_defaults":307,"./line_shape_defaults":309,"./marker_defaults":313,"./stack_defaults":316,"./subtypes":318,"./text_defaults":319,"./xy_defaults":320}],302:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../lib").isArrayOrTypedArray;t.exports=function(e,t,r,i){var o=!1;if(t.marker){var l=t.marker.color,s=(t.marker.line||{}).color;l&&!a(l)?o=l:s&&!a(s)&&(o=s)}i("fillcolor",n.addOpacity((t.line||{}).color||o||r,.5))}},{"../../components/color":43,"../../lib":168}],303:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axes");t.exports=function(e,t,r){var a={},i={_fullLayout:r},o=n.getFromTrace(i,t,"x"),l=n.getFromTrace(i,t,"y");return a.xLabel=n.tickText(o,e.x,!0).text,a.yLabel=n.tickText(l,e.y,!0).text,a}},{"../../plots/cartesian/axes":212}],304:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("./subtypes");t.exports=function(e,t){var r,i;if("lines"===e.mode)return(r=e.line.color)&&n.opacity(r)?r:e.fillcolor;if("none"===e.mode)return e.fill?e.fillcolor:"";var o=t.mcc||(e.marker||{}).color,l=t.mlcc||((e.marker||{}).line||{}).color;return(i=o&&n.opacity(o)?o:l&&n.opacity(l)&&(t.mlw||((e.marker||{}).line||{}).width)?l:"")?n.opacity(i)<.3?n.addOpacity(i,.3):i:(r=(e.line||{}).color)&&n.opacity(r)&&a.hasLines(e)&&e.line.width?r:e.fillcolor}},{"../../components/color":43,"./subtypes":318}],305:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../components/fx"),i=e("../../registry"),o=e("./get_trace_color"),l=e("../../components/color"),s=n.fillText;t.exports=function(e,t,r,c){var u=e.cd,f=u[0].trace,d=e.xa,p=e.ya,h=d.c2p(t),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(e){var t=Math.max(y,e.mrc||0),r=d.c2p(e.x)-h,n=p.c2p(e.y)-g;return Math.max(Math.sqrt(r*r+n*n)-t,1-y/t)},b=a.getDistanceFunction(c,(function(e){var t=Math.max(3,e.mrc||0),r=1-1/t,n=Math.abs(d.c2p(e.x)-h);return n<t?r*n/t:n-t+r}),(function(e){var t=Math.max(3,e.mrc||0),r=1-1/t,n=Math.abs(p.c2p(e.y)-g);return n<t?r*n/t:n-t+r}),x);if(a.getClosest(u,b,e),!1!==e.index){var _=u[e.index],w=d.c2p(_.x,!0),k=p.c2p(_.y,!0),T=_.mrc||1;e.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(e,{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,e),i.getComponentMethod("errorbars","hoverInfo")(_,f,e),[e]}}if(-1!==m.indexOf("fills")&&f._polygons){var C,O,P,D,z,E,R,I,F,N=f._polygons,H=[],B=!1,j=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,H.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<H.length;C++)for(D=H[C].pts,O=1;O<D.length;O++)(I=D[O-1][1])>G!=(F=D[O][1])>=G&&(E=D[O-1][0],R=D[O][0],F-I&&(z=E+(R-E)*(G-I)/(F-I),j=Math.min(j,z),V=Math.max(V,z)));j=Math.max(j,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(e,{distance:e.maxHoverDistance,x0:j,x1:V,y0:G,y1:G,color:Z,hovertemplate:!1}),delete e.index,f.text&&!Array.isArray(f.text)?e.text=String(f.text):e.text=f.name,[e]}}}},{"../../components/color":43,"../../components/fx":83,"../../lib":168,"../../registry":254,"./get_trace_color":304}],306:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:e("./attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("./cross_trace_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./cross_trace_calc"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot"),colorbar:e("./marker_colorbar"),formatLabels:e("./format_labels"),style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":225,"./arrays_to_calcdata":293,"./attributes":294,"./calc":295,"./cross_trace_calc":299,"./cross_trace_defaults":300,"./defaults":301,"./format_labels":303,"./hover":305,"./marker_colorbar":312,"./plot":314,"./select":315,"./style":317,"./subtypes":318}],307:[function(e,t,r){"use strict";var n=e("../../lib").isArrayOrTypedArray,a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults");t.exports=function(e,t,r,o,l,s){var c=(e.marker||{}).color;l("line.color",r),a(e,"line")?i(e,t,o,l,{prefix:"line.",cLetter:"c"}):l("line.color",!n(c)&&c||r),l("line.width"),(s||{}).noDash||l("line.dash")}},{"../../components/colorscale/defaults":53,"../../components/colorscale/helpers":54,"../../lib":168}],308:[function(e,t,r){"use strict";var n=e("../../constants/numerical"),a=n.BADNUM,i=n.LOG_CLIP,o=i+.5,l=i-.5,s=e("../../lib"),c=s.segmentsIntersect,u=s.constrain,f=e("./constants");t.exports=function(e,t){var r,n,i,d,p,h,g,v,m,y,x,b,_,w,k,T,M,A,L=t.xaxis,S=t.yaxis,C="log"===L.type,O="log"===S.type,P=L._length,D=S._length,z=t.connectGaps,E=t.baseTolerance,R=t.shape,I="linear"===R,F=t.fill&&"none"!==t.fill,N=[],H=f.minTolerance,B=e.length,j=new Array(B),V=0;function q(r){var n=e[r];if(!n)return!1;var i=t.linearized?L.l2p(n.x):L.c2p(n.x),s=t.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(e,t,r,n){var a=r-e,i=n-t,o=.5-e,l=.5-t,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(e,t){var r=e[0]/P,n=e[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&&t&&U(r,n,t[0]/P,t[1]/D)&&(a=0),(1+f.toleranceGrowth*a)*E}function Z(e,t){var r=e[0]-t[0],n=e[1]-t[1];return Math.sqrt(r*r+n*n)}var X,Y,W,J,$,Q,K,ee=f.maxScreensAway,te=-P*ee,re=P*(1+ee),ne=-D*ee,ae=D*(1+ee),ie=[[te,ne,re,ne],[re,ne,re,ae],[re,ae,te,ae],[te,ae,te,ne]];function oe(e){if(e[0]<te||e[0]>re||e[1]<ne||e[1]>ae)return[u(e[0],te,re),u(e[1],ne,ae)]}function le(e,t){return e[0]===t[0]&&(e[0]===te||e[0]===re)||e[1]===t[1]&&(e[1]===ne||e[1]===ae)||void 0}function se(e,t,r){return function(n,a){var i=oe(n),o=oe(a),l=[];if(i&&o&&le(i,o))return l;i&&l.push(i),o&&l.push(o);var c=2*s.constrain((n[e]+a[e])/2,t,r)-((i||n)[e]+(o||a)[e]);return c&&((i&&o?c>0==i[e]>o[e]?i:o:i||o)[e]+=c),l}}function ce(e){var t=e[0],r=e[1],n=t===j[V-1][0],a=r===j[V-1][1];if(!n||!a)if(V>1){var i=t===j[V-2][0],o=r===j[V-2][1];n&&(t===te||t===re)&&i?o?V--:j[V-1]=e:a&&(r===ne||r===ae)&&o?i?V--:j[V-1]=e:j[V++]=e}else j[V++]=e}function ue(e){j[V-1][0]!==e[0]&&j[V-1][1]!==e[1]&&ce([W,J]),ce(e),$=null,W=J=0}function fe(e){if(M=e[0]/P,A=e[1]/D,X=e[0]<te?te:e[0]>re?re:0,Y=e[1]<ne?ne:e[1]>ae?ae:0,X||Y){if(V)if($){var t=K($,e);t.length>1&&(ue(t[0]),j[V++]=t[1])}else Q=K(j[V-1],e)[0],j[V++]=Q;else j[V++]=[X||e[0],Y||e[1]];var r=j[V-1];X&&Y&&(r[0]!==X||r[1]!==Y)?($&&(W!==X&&J!==Y?ce(W&&J?(n=$,i=(a=e)[0]-n[0],o=(a[1]-n[1])/i,(n[1]*a[0]-a[1]*n[0])/i>0?[o>0?te:re,ae]:[o>0?re:te,ne]):[W||X,J||Y]):W&&J&&ce([W,J])),ce([X,Y])):W-X&&J-Y&&ce([X||W,Y||J]),$=e,W=X,J=Y}else $&&ue(K($,e)[0]),j[V++]=e;var n,a,i,o}for("linear"===R||"spline"===R?K=function(e,t){for(var r=[],n=0,a=0;a<4;a++){var i=ie[a],o=c(e[0],e[1],t[0],t[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,e)<Z(r[0],e)?r.unshift(o):r.push(o),n++)}return r}:"hv"===R||"vh"===R?K=function(e,t){var r=[],n=oe(e),a=oe(t);return n&&a&&le(n,a)||(n&&r.push(n),a&&r.push(a)),r}:"hvh"===R?K=se(0,te,re):"vhv"===R&&(K=se(1,ne,ae)),r=0;r<B;r++)if(n=q(r)){for(V=0,$=null,fe(n),r++;r<B;r++){if(!(d=q(r))){if(z)continue;break}if(I&&t.simplify){var de=q(r+1);if(y=Z(d,n),F&&(0===V||V===B-1)||!(y<G(d,de)*H)){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<e.length;r++){if(h=de,de=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,de))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?(fe(d),i!==p&&fe(p)):(p!==n&&fe(p),i!==d&&fe(d)),fe(i),r>=e.length||!h)break;fe(h),n=h}}else fe(d)}$&&ce([W||$[0],J||$[1]]),N.push(j.slice(0,V))}return N}},{"../../constants/numerical":148,"../../lib":168,"./constants":298}],309:[function(e,t,r){"use strict";t.exports=function(e,t,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],310:[function(e,t,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};t.exports=function(e,t,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(e,t){var r=e[0].trace,n=t[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}},{}],311:[function(e,t,r){"use strict";var n=e("fast-isnumeric");t.exports=function(e){var t=e.marker,r=t.sizeref||1,a=t.sizemin||0,i="area"===t.sizemode?function(e){return Math.sqrt(e/r)}:function(e){return e/r};return function(e){var t=i(e/2);return n(t)&&t>0?Math.max(t,a):0}}},{"fast-isnumeric":9}],312:[function(e,t,r){"use strict";t.exports={container:"marker",min:"cmin",max:"cmax"}},{}],313:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("./subtypes");t.exports=function(e,t,r,l,s,c){var u=o.isBubble(e),f=(e.line||{}).color;c=c||{},f&&(r=f),s("marker.symbol"),s("marker.opacity",u?.7:1),s("marker.size"),s("marker.color",r),a(e,"marker")&&i(e,t,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)&&t.marker.color!==f?f:u?n.background:n.defaultLine),a(e,"marker.line")&&i(e,t,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":43,"../../components/colorscale/defaults":53,"../../components/colorscale/helpers":54,"./subtypes":318}],314:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../registry"),i=e("../../lib"),o=i.ensureSingle,l=i.identity,s=e("../../components/drawing"),c=e("./subtypes"),u=e("./line_points"),f=e("./link_traces"),d=e("../../lib/polygon").tester;function p(e,t,r,f,p,h,g){var v;!function(e,t,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)){var p=d.marker.maxdisplayed;if(0!==p){var h=a.filter((function(e){return e.x>=u[0]&&e.x<=u[1]&&e.y>=f[0]&&e.y<=f[1]})),g=Math.ceil(h.length/p),v=0;o.forEach((function(e,r){var n=e[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r<t&&v++}));var m=Math.round(v*g/3+Math.floor(v/3)*g/7.1);a.forEach((function(e){delete e.vis})),h.forEach((function(e,t){0===Math.round((t+m)%g)&&(e.vis=!0)}))}}}(0,t,r,f,p);var m=!!g&&g.duration>0;function y(e){return m?e.transition():e}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")(e,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="",E=[],R=_._prevtrace;R&&(z=R._prevRevpath||"",C=R._nextFill,E=R._polygons);var I,F,N,H,B,j,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(e){var t=e[e.length-1];return e.length>1&&e[0][0]===t[0]&&e[0][1]===t[1]?s.smoothclosed(e.slice(1),w.smoothing):s.smoothopen(e,w.smoothing)}:function(e){return"M"+e.join("L")},N=function(e){return F(e.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&&(H=G[0][0],j=(B=G[G.length-1])[B.length-1]),Z=function(e){return function(t){if(P=I(t),D=N(t),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(_)&&t.length>1){var r=n.select(this);if(r.datum(f),e)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,e),G.length?(S?(S.datum(f),H&&j&&(O?("y"===O?H[1]=j[1]=b.c2p(0,!0):"x"===O&&(H[0]=j[0]=x.c2p(0,!0)),y(S).attr("d","M"+j+"L"+H+"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(E)):(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(t,a,i){var o,u=i[0].trace,f=c.hasMarkers(u),d=c.hasText(u),p=function(e){if(e.ids)return K}(u),h=ee,g=ee;if(f||d){var v=l,_=u.stackgroup,w=_&&"infer zero"===e._fullLayout._scatterStackOpts[x._id+b._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?v=w?$:J:_&&!w&&(v=Q),f&&(h=v),d&&(g=v)}var k,T=(o=t.selectAll("path.point").data(h,p)).enter().append("path").classed("point",!0);m&&T.call(s.pointStyle,u,e).call(s.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),f&&(k=s.makePointStyleFns(u)),o.each((function(t){var a=n.select(this),i=y(a);s.translatePoint(t,i,x,b)?(s.singlePointStyle(t,i,u,k,e),r.layerClipId&&s.hideOutsideRangePoint(t,i,x,b,u.xcalendar,u.ycalendar),u.customdata&&a.classed("plotly-customdata",null!==t.data&&void 0!==t.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(e){var t=n.select(this),a=y(t.select("text"));s.translatePoint(e,a,x,b)?r.layerClipId&&s.hideOutsideRangePoint(e,t,x,b,u.xcalendar,u.ycalendar):t.remove()})),o.selectAll("text").call(s.textPointStyle,u,e).each((function(e){var t=x.c2p(e.x),r=b.c2p(e.y);n.select(this).selectAll("tspan.line").each((function(){y(n.select(this)).attr({x:t,y:r})}))})),o.exit().remove()}(A,L,f);var Y=!1===_.cliponaxis?null:r.layerClipId;s.setClipUrl(A,Y,e),s.setClipUrl(L,Y,e)}function W(e){y(e).attr("d","M0,0Z")}function J(e){return e.filter((function(e){return!e.gap&&e.vis}))}function $(e){return e.filter((function(e){return e.vis}))}function Q(e){return e.filter((function(e){return!e.gap}))}function K(e){return e.id}function ee(){return!1}}t.exports=function(e,t,r,a,i,c){var u,d,h=!i,g=!!i&&i.duration>0,v=f(e,t,r);(u=a.selectAll("g.trace").data(v,(function(e){return e[0].trace.uid}))).enter().append("g").attr("class",(function(e){return"trace scatter trace"+e[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(e,t,r){t.each((function(t){var a=o(n.select(this),"g","fills");s.setClipUrl(a,r.layerClipId,e);var i=t[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(e){i[e]=null})).remove(),u.order().each((function(e){i[e]=o(n.select(this),"path","js-fill")}))}))}(e,u,t),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(e,n,t,r,v,this,i)}))}))):u.each((function(r,n){p(e,n,t,r,v,this,i)})),h&&u.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":65,"../../lib":168,"../../lib/polygon":180,"../../registry":254,"./line_points":308,"./link_traces":310,"./subtypes":318,d3:7}],315:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports=function(e,t){var r,a,i,o,l=e.cd,s=e.xaxis,c=e.yaxis,u=[],f=l[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===t)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&&t.contains([i,o],!1,r,e)?(u.push({pointNumber:a.i,x:s.c2d(a.x),y:c.c2d(a.y)}),a.selected=1):a.selected=0;return u}},{"./subtypes":318}],316:[function(e,t,r){"use strict";var n=["orientation","groupnorm","stackgaps"];t.exports=function(e,t,r,a){var i=r._scatterStackOpts,o=a("stackgroup");if(o){var l=t.xaxis+t.yaxis,s=i[l];s||(s=i[l]={});var c=s[o],u=!1;c?c.traces.push(t):(c=s[o]={traceIndices:[],traces:[t]},u=!0);for(var f={orientation:t.x&&!t.y?"h":"v"},d=0;d<n.length;d++){var p=n[d],h=p+"Found";if(!c[h]){var g=void 0!==e[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}}},{}],317:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../components/drawing"),i=e("../../registry");function o(e,t,r){a.pointStyle(e.selectAll("path.point"),t,r)}function l(e,t,r){a.textPointStyle(e.selectAll("text"),t,r)}t.exports={style:function(e){var t=n.select(e).selectAll("g.trace.scatter");t.style("opacity",(function(e){return e[0].trace.opacity})),t.selectAll("g.points").each((function(t){o(n.select(this),t.trace||t[0].trace,e)})),t.selectAll("g.text").each((function(t){l(n.select(this),t.trace||t[0].trace,e)})),t.selectAll("g.trace path.js-line").call(a.lineGroupStyle),t.selectAll("g.trace path.js-fill").call(a.fillGroupStyle),i.getComponentMethod("errorbars","style")(t)},stylePoints:o,styleText:l,styleOnSelect:function(e,t,r){var n=t[0].trace;n.selectedpoints?(a.selectedPointStyle(r.selectAll("path.point"),n),a.selectedTextStyle(r.selectAll("text"),n)):(o(r,n,e),l(r,n,e))}}},{"../../components/drawing":65,"../../registry":254,d3:7}],318:[function(e,t,r){"use strict";var n=e("../../lib");t.exports={hasLines:function(e){return e.visible&&e.mode&&-1!==e.mode.indexOf("lines")},hasMarkers:function(e){return e.visible&&(e.mode&&-1!==e.mode.indexOf("markers")||"splom"===e.type)},hasText:function(e){return e.visible&&e.mode&&-1!==e.mode.indexOf("text")},isBubble:function(e){return n.isPlainObject(e.marker)&&n.isArrayOrTypedArray(e.marker.size)}}},{"../../lib":168}],319:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t,r,a,i){i=i||{},a("textposition"),n.coerceFont(a,"textfont",r.font),i.noSelect||(a("selected.textfont.color"),a("unselected.textfont.color"))}},{"../../lib":168}],320:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry");t.exports=function(e,t,r,i){var o,l=i("x"),s=i("y");if(a.getComponentMethod("calendars","handleTraceDefaults")(e,t,["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 t._length=o,o}},{"../../lib":168,"../../registry":254}],321:[function(e,t,r){"use strict";r.version="1.54.1"},{}]},{},[4])(4)}).call(this,r(/*! ./../../webpack/buildin/global.js */11),r(/*! jquery */27))}}]);
  //# sourceMappingURL=6.js.map?v=3.3.30